WSL2-Linux-Kernel/drivers
John Keeping 644139f8b6 usb: dwc2: Fix IN FIFO allocation
On chips with fewer FIFOs than endpoints (for example RK3288 which has 9
endpoints, but only 6 which are cabable of input), the DPTXFSIZN
registers above the FIFO count may return invalid values.

With logging added on startup, I see:

	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=1 sz=256
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=2 sz=128
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=3 sz=128
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=4 sz=64
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=5 sz=64
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=6 sz=32
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=7 sz=0
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=8 sz=0
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=9 sz=0
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=10 sz=0
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=11 sz=0
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=12 sz=0
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=13 sz=0
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=14 sz=0
	dwc2 ff580000.usb: dwc2_hsotg_init_fifo: ep=15 sz=0

but:

	# cat /sys/kernel/debug/ff580000.usb/fifo
	Non-periodic FIFOs:
	RXFIFO: Size 275
	NPTXFIFO: Size 16, Start 0x00000113

	Periodic TXFIFOs:
		DPTXFIFO 1: Size 256, Start 0x00000123
		DPTXFIFO 2: Size 128, Start 0x00000223
		DPTXFIFO 3: Size 128, Start 0x000002a3
		DPTXFIFO 4: Size 64, Start 0x00000323
		DPTXFIFO 5: Size 64, Start 0x00000363
		DPTXFIFO 6: Size 32, Start 0x000003a3
		DPTXFIFO 7: Size 0, Start 0x000003e3
		DPTXFIFO 8: Size 0, Start 0x000003a3
		DPTXFIFO 9: Size 256, Start 0x00000123

so it seems that FIFO 9 is mirroring FIFO 1.

Fix the allocation by using the FIFO count instead of the endpoint count
when selecting a FIFO for an endpoint.

Acked-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-15 10:39:21 +01:00
..
accessibility
acpi ACPI: PM: Avoid attaching ACPI PM domain to certain devices 2019-12-10 00:22:18 +01:00
amba
android binder: fix incorrect calculation for num_valid 2019-12-14 09:10:47 +01:00
ata ata: ahci_brcm: Add missing clock management during recovery 2019-12-25 20:47:24 -07:00
atm atm: eni: fix uninitialized variable warning 2020-01-08 13:11:00 -08:00
auxdisplay
base Merge branch 'remove-ksys-mount-dup' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux 2019-12-15 11:36:12 -08:00
bcma
block block-5.5-20200103 2020-01-03 12:11:30 -08:00
bluetooth
bus bus: ti-sysc: Fix missing reset delay handling 2019-12-12 08:20:10 -08:00
cdrom
char tpm: Handle negative priv->response_len in tpm_common_read() 2020-01-08 18:11:09 +02:00
clk clk: qcom: Avoid SMMU/cx gdsc corner cases 2019-12-18 22:02:27 -08:00
clocksource clocksource: riscv: add notrace to riscv_sched_clock 2020-01-04 21:48:48 -08:00
connector
counter
cpufreq Merge branch 'cpufreq/arm/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm 2020-01-07 10:41:35 +01:00
cpuidle cpuidle: Drop unnecessary type cast in cpuidle_poll_time() 2019-12-12 17:56:08 +01:00
crypto
dax
dca
devfreq PM / devfreq: tegra: Add COMMON_CLK dependency 2019-12-23 10:42:58 +09:00
dio
dma ioat: ioat_alloc_ring() failure handling. 2019-12-27 12:06:06 +05:30
dma-buf - A fix for a memory leak in the dma-buf support 2019-12-09 17:13:19 +10:00
edac riscv: move sifive_l2_cache.h to include/soc 2020-01-12 10:12:44 -08:00
eisa
extcon
firewire
firmware firmware: tee_bnxt: Fix multiple call to tee_client_close_context 2020-01-06 13:51:37 -08:00
fpga
fsi
gnss
gpio gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism 2020-01-07 12:58:15 +01:00
gpu Merge tag 'drm-intel-fixes-2020-01-09-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes 2020-01-10 11:43:02 +10:00
greybus
hid HID: hidraw, uhid: Always report EPOLLOUT 2020-01-10 15:34:28 +01:00
hsi
hv
hwmon
hwspinlock
hwtracing intel_th: msu: Fix window switching without windows 2019-12-17 15:45:59 +01:00
i2c i2c: fix bus recovery stop mode timing 2020-01-09 22:21:08 +01:00
i3c
ide
idle
iio First set of fixes for IIO in the 5.5 cycle. 2019-12-09 09:27:52 +01:00
infiniband i40iw: Remove setting of VMA private data and use rdma_user_mmap_io 2020-01-07 15:07:37 -04:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2020-01-09 15:37:40 -08:00
interconnect interconnect: qcom: msm8974: Walk the list safely on node removal 2019-12-12 10:28:54 +01:00
iommu iommu/dma: fix variable 'cookie' set but not used 2020-01-07 17:08:58 +01:00
ipack
irqchip riscv: prefix IRQ_ macro names with an RV_ namespace 2020-01-04 21:48:59 -08:00
isdn
leds
lightnvm
macintosh
mailbox
mcb
md for-linus-20191212 2019-12-13 14:27:19 -08:00
media media updates for v5.5-rc5 2020-01-04 10:41:08 -08:00
memory memory: tegra: Fixes for v5.5-rc1 2019-12-06 08:28:51 -08:00
memstick
message
mfd
misc powerpc fixes for 5.5 #4 2019-12-21 06:17:05 -08:00
mmc mmc: sdhci-of-esdhc: re-implement erratum A-009204 workaround 2019-12-19 08:13:43 +01:00
mtd mtd: spi-nor: Fix the writing of the Status Register on micron flashes 2020-01-09 20:11:34 +01:00
mux
net Merge 5.5-rc6 into usb-next 2020-01-13 12:11:40 +01:00
nfc nfc: s3fwrn5: replace the assertion with a WARN_ON 2019-12-19 17:33:23 -08:00
ntb Add Hygon Device ID to the AMD NTB device driver 2019-12-07 18:38:17 -08:00
nubus
nvdimm
nvme nvmet: fix per feat data len for get_feature 2020-01-10 08:55:50 -07:00
nvmem
of Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 09:54:33 -08:00
opp
oprofile
parisc
parport
pci PCI: rockchip: Fix IO outbound ATU register number 2019-12-12 15:25:37 -06:00
pcmcia
perf perf/smmuv3: Remove the leftover put_cpu() in error path 2019-12-18 16:15:36 +00:00
phy Merge 5.5-rc6 into usb-next 2020-01-13 12:11:40 +01:00
pinctrl pinctrl: meson: Fix wrong shift value when get drive-strength 2020-01-07 11:21:07 +01:00
platform A collection of MIPS fixes: 2020-01-04 14:16:57 -08:00
pnp
power
powercap powercap: intel_rapl: add NULL pointer check to rapl_mmio_cpu_online() 2020-01-07 12:24:34 +01:00
pps
ps3
ptp ptp: fix the race between the release of ptp_clock and cdev 2019-12-30 20:19:27 -08:00
pwm
rapidio
ras
regulator regulator: Fixes for v5.5 2020-01-06 12:04:31 -08:00
remoteproc
reset reset: Do not register resource data for missing resets 2019-12-10 11:43:37 +01:00
rpmsg
rtc rtc: cmos: Revert "rtc: Fix the AltCentury value on AMD/Hygon platform" 2020-01-04 05:31:50 +01:00
s390 s390/qeth: fix initialization on old HW 2019-12-24 22:41:06 -08:00
sbus
scsi SCSI fixes on 20191227 2019-12-27 17:28:41 -08:00
sfi
sh
siox
slimbus
soc riscv: move sifive_l2_cache.h to include/soc 2020-01-12 10:12:44 -08:00
soundwire
spi spi: Fixes for v5.5 2020-01-06 12:34:44 -08:00
spmi
ssb
staging Staging fixes for 5.5-rc6 2020-01-10 13:22:11 -08:00
target SCSI fixes on 20191227 2019-12-27 17:28:41 -08:00
tc
tee Merge mainline/master into arm/fixes 2019-12-05 13:18:54 -08:00
thermal drivers: thermal: tsens: Work with old DTBs 2020-01-07 08:22:35 +01:00
thunderbolt thunderbolt: fix memory leak of object sw 2020-01-14 15:37:41 +01:00
tty serdev: Don't claim unsupported ACPI serial devices 2020-01-06 20:00:44 +01:00
uio
usb usb: dwc2: Fix IN FIFO allocation 2020-01-15 10:39:21 +01:00
vfio VFIO updates for v5.5-rc1 2019-12-07 14:51:04 -08:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-08 13:28:11 -08:00
video
virt
virtio virtio_balloon: divide/multiply instead of shifts 2019-12-11 08:14:07 -05:00
visorbus
vlynq
vme
w1
watchdog watchdog: orion: fix platform_get_irq() complaints 2019-12-30 15:58:29 +01:00
xen xen: branch for v5.5-rc3 2019-12-21 06:24:56 -08:00
zorro
Kconfig
Makefile thunderbolt: Update Kconfig entries to USB4 2019-12-18 15:39:18 +01:00