From d7abf6e73ce4638b56923912785fb951f4c50987 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Mon, 7 Sep 2020 06:48:08 +0000 Subject: [PATCH] musb/allwinner: apply register filter in awusbdrd_bs_r_2() as well Otherwise, I get this panic: panic: awusbdrd_reg: Invalid register 0x342 It looks that musb code both writes and reads at least MUSB2_REG_TXDBDIS. MFC after: 5 weeks X-MFC after: r365399 --- sys/dev/usb/controller/musb_otg_allwinner.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/usb/controller/musb_otg_allwinner.c b/sys/dev/usb/controller/musb_otg_allwinner.c index 21787c54cbfd..63261ebbf601 100644 --- a/sys/dev/usb/controller/musb_otg_allwinner.c +++ b/sys/dev/usb/controller/musb_otg_allwinner.c @@ -259,6 +259,8 @@ awusbdrd_bs_r_2(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o) { const struct bus_space *bs = t; + if (awusbdrd_filt(o) != 0) + return (0); return bus_space_read_2(bs_parent_space(bs), h, awusbdrd_reg(o)); }