提交 7c03258b 编写于 作者: H Hanjun Guo 提交者: Yang Yingliang

usb: xhci: Add workaround for phytium

hulk inclusion
category: feature
bugzilla: NA
CVE: NA
---------------------------

Add workaround for phytium as the firmware didn't report the
DMA size info.
Signed-off-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 85495901
......@@ -302,6 +302,18 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
return xhci_pci_reinit(xhci, pdev);
}
#ifdef CONFIG_ARM64
#include <asm/cputype.h>
static void phytium_xhci_pci_workaround(struct pci_dev *dev)
{
/* Firmware bug, DMA mask is not reported by the firmware */
if (read_cpuid_implementor() == ARM_CPU_IMP_PHYTIUM)
dma_set_mask(&dev->dev, DMA_BIT_MASK(64));
}
#else
static inline void phytium_xhci_pci_workaround(struct pci_dev *dev) { }
#endif
/*
* We need to register our own PCI probe function (instead of the USB core's
* function) in order to create a second roothub under xHCI.
......@@ -315,6 +327,8 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
driver = (struct hc_driver *)id->driver_data;
phytium_xhci_pci_workaround(dev);
/* Prevent runtime suspending between USB-2 and USB-3 initialization */
pm_runtime_get_noresume(&dev->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册