From 7b81cb6bddd2c4f2489506771070924bd0ae9902 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 16 Aug 2019 08:24:32 +0200 Subject: usb: add a HCD_DMA flag instead of guestimating DMA capabilities The usb core is the only major place in the kernel that checks for a non-NULL device dma_mask to see if a device is DMA capable. This is generally a bad idea, as all major busses always set up a DMA mask, even if the device is not DMA capable - in fact bus layers like PCI can't even know if a device is DMA capable at enumeration time. This leads to lots of workaround in HCD drivers, and also prevented us from setting up a DMA mask for platform devices by default last time we tried. Replace this guess with an explicit HCD_DMA that is set by drivers that appear to have DMA support. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20190816062435.881-4-hch@lst.de Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/sl811-hcd.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'drivers/usb/host/sl811-hcd.c') diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 5b061e599948..72a34a1eb618 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -1632,12 +1632,6 @@ sl811h_probe(struct platform_device *dev) irq = ires->start; irqflags = ires->flags & IRQF_TRIGGER_MASK; - /* refuse to confuse usbcore */ - if (dev->dev.dma_mask) { - dev_dbg(&dev->dev, "no we won't dma\n"); - return -EINVAL; - } - /* the chip may be wired for either kind of addressing */ addr = platform_get_resource(dev, IORESOURCE_MEM, 0); data = platform_get_resource(dev, IORESOURCE_MEM, 1); -- cgit v1.2.3