Skip to content

Commit 40f8d17

Browse files
Jamie Ilesgregkh
authored andcommitted
drivers/usb/dwc3: fix PCI parent check
The sysdev_is_parent check was being used to infer PCI devices that have the DMA mask set from the PCI capabilities, but sysdev_is_parent is also used for non-PCI ACPI devices in which case the DMA mask would be the bus default or as set by the _DMA method. Without this fix the DMA mask would default to 32-bits and so allocation would fail if there was no DRAM below 4GB. Fixes: 47ce459 ("usb: dwc3: leave default DMA for PCI devices") Cc: stable <stable@kernel.org> Signed-off-by: Jamie Iles <jamie.iles@oss.qualcomm.com> Signed-off-by: Punit Agrawal <punit.agrawal@oss.qualcomm.com> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://patch.msgid.link/20251107104437.1602509-1-punit.agrawal@oss.qualcomm.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 41e99fe commit 40f8d17

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/usb/dwc3/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/of.h>
2626
#include <linux/of_graph.h>
2727
#include <linux/acpi.h>
28+
#include <linux/pci.h>
2829
#include <linux/pinctrl/consumer.h>
2930
#include <linux/pinctrl/devinfo.h>
3031
#include <linux/reset.h>
@@ -2241,7 +2242,7 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
22412242
dev_set_drvdata(dev, dwc);
22422243
dwc3_cache_hwparams(dwc);
22432244

2244-
if (!dwc->sysdev_is_parent &&
2245+
if (!dev_is_pci(dwc->sysdev) &&
22452246
DWC3_GHWPARAMS0_AWIDTH(dwc->hwparams.hwparams0) == 64) {
22462247
ret = dma_set_mask_and_coherent(dwc->sysdev, DMA_BIT_MASK(64));
22472248
if (ret)

0 commit comments

Comments
 (0)