Files
rockchip-kernel/include/linux
Kees Cook e4788edc73 USB: EHCI: Add alias for Broadcom INSNREG
Refactor struct ehci_regs to avoid accessing beyond the end of
port_status. This change results in no difference in the final
object code.

Avoids several warnings when building with -Warray-bounds:

drivers/usb/host/ehci-brcm.c: In function 'ehci_brcm_reset':
drivers/usb/host/ehci-brcm.c:113:32: warning: array subscript 16 is above array bounds of 'u32[15]' {aka 'unsigned int[15]'} [-Warray-bounds]
  113 |  ehci_writel(ehci, 0x00800040, &ehci->regs->port_status[0x10]);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/usb/host/ehci.h:274,
                 from drivers/usb/host/ehci-brcm.c:15:
./include/linux/usb/ehci_def.h:132:7: note: while referencing 'port_status'
  132 |   u32 port_status[HCS_N_PORTS_MAX];
      |       ^~~~~~~~~~~

Note that the documentation around this proprietary register was
confusing. If "USB_EHCI_INSNREG00" is at port_status[0x0f], its offset
would be 0x80 (not 0x90). The comments have been adjusted to fix this
apparent typo.

Fixes: 9df231511b ("usb: ehci: Add new EHCI driver for Broadcom STB SoC's")
Cc: Al Cooper <alcooperx@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210818173018.2259231-3-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-18 22:28:28 +02:00
..
2021-07-06 20:14:42 -04:00
2021-06-03 18:40:15 +02:00
2021-06-03 14:04:18 -07:00
2021-05-06 19:24:11 -07:00
2021-04-14 16:30:30 +03:00
2021-05-24 21:13:05 -07:00
2021-04-08 16:04:20 -07:00
2021-06-30 19:45:42 +02:00
2021-03-22 03:57:39 +01:00
2021-04-12 15:04:23 +02:00
2021-06-25 19:57:01 -04:00
2021-04-30 11:20:40 -07:00
2021-06-29 10:53:48 -07:00
2021-07-15 10:13:49 -07:00
2021-06-01 10:29:21 +01:00
2021-05-12 20:11:17 +02:00
2021-06-17 13:09:27 -04:00
2021-06-15 17:46:57 +02:00
2021-07-01 11:06:02 -07:00
2021-08-03 11:14:03 +01:00
2021-06-29 10:53:53 -07:00
2021-07-01 11:06:05 -07:00
2021-07-12 09:37:26 +02:00
2021-08-08 13:00:20 +01:00
2021-07-06 10:37:46 -05:00
2021-06-16 17:20:40 -05:00
2021-07-06 10:37:46 -05:00
2021-07-06 10:37:46 -05:00
2021-07-06 10:37:46 -05:00
2021-06-12 13:08:57 -07:00
2021-06-07 14:11:47 -07:00
2021-06-30 19:12:19 +02:00
2021-03-22 02:45:52 +01:00
2021-05-10 16:03:35 -07:00
2021-06-24 15:49:32 +02:00
2021-07-01 11:06:03 -07:00
2021-07-01 11:06:03 -07:00
2021-03-25 17:39:33 -07:00
2021-05-21 22:13:13 +02:00
2021-05-13 18:29:11 +02:00
2021-05-13 16:57:17 +02:00
2021-03-30 17:06:49 -07:00
2021-03-22 15:02:14 +01:00
2021-03-30 13:42:33 -04:00