OpenCloudOS-Kernel/include/linux/usb
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
..
audio-v2.h usb: audio-v2: add ability to define feature unit descriptor 2021-07-21 10:10:11 +02:00
audio-v3.h
audio.h
c67x00.h
ccid.h
cdc-wdm.h usb: class: cdc-wdm: WWAN framework integration 2021-05-11 16:17:56 -07:00
cdc.h
cdc_ncm.h
ch9.h
chipidea.h
composite.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
ehci-dbgp.h
ehci_def.h USB: EHCI: Add alias for Broadcom INSNREG 2021-08-18 22:28:28 +02:00
ehci_pdriver.h
ezusb.h
functionfs.h
g_hid.h
gadget.h usb: gadget: remove unnecessary AND operation when get ep maxp 2021-08-13 13:05:51 +02:00
gadget_configfs.h
hcd.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
input.h
iowarrior.h
irda.h
isp116x.h
isp1301.h
isp1362.h
m66592.h
musb-ux500.h
musb.h
net2280.h
of.h
ohci_pdriver.h
otg-fsm.h usb: otg-fsm: Fix hrtimer list corruption 2021-07-27 16:31:31 +02:00
otg.h usb: common: add helper to get role-switch-default-mode 2021-07-27 15:58:37 +02:00
pd.h usb: pd: Set PD_T_SINK_WAIT_CAP to 310ms 2021-06-02 16:59:29 +02:00
pd_ado.h
pd_bdo.h
pd_ext_sdb.h usb: typec: tcpm: Properly handle Alert and Status Messages 2021-06-04 13:24:16 +02:00
pd_vdo.h
phy.h
phy_companion.h
quirks.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
r8a66597.h
r8152.h
renesas_usbhs.h
rndis_host.h
role.h usb: roles: add helper usb_role_string() 2021-05-27 09:17:18 +02:00
serial.h USB-serial updates for 5.14-rc1 2021-06-24 12:54:28 +02:00
sl811.h
storage.h
tcpm.h usb: typec: tcpm: Move TCPC to APPLY_RC state during PR_SWAP 2021-05-21 20:05:56 +02:00
tegra_usb_phy.h
typec.h
typec_altmode.h
typec_dp.h usb: fix spelling mistakes in header files 2021-05-21 20:05:31 +02:00
typec_mux.h
typec_tbt.h
uas.h
ulpi.h
usb338x.h
usb_phy_generic.h
usbnet.h
xhci-dbgp.h