[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b42f939d-8946-4865-59d8-7451d7d753bd@huawei.com>
Date: Thu, 31 Jan 2019 09:19:14 +0800
From: Hanjun Guo <guohanjun@...wei.com>
To: Christoph Hellwig <hch@....de>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Robin Murphy <robin.murphy@....com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Bjorn Helgaas <helgaas@...nel.org>,
<linux-usb@...r.kernel.org>, <linux-acpi@...r.kernel.org>,
<linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linuxarm@...wei.com>, John Garry <john.garry@...wei.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
<anthony.jebson@...wei.com>, Hanjun Guo <hanjun.guo@...aro.org>
Subject: Re: [RFC PATCH] USB: PCI: set 32bit DMA mask for PCI based USB
controllers
Hi Christoph,
On 2019/1/30 15:40, Christoph Hellwig wrote:
> On Wed, Jan 30, 2019 at 03:01:54PM +0800, Hanjun Guo wrote:
>> This is the RFC version, I'm not sure this is the best solution,
>> comments are warmly welcomed.
>>
>> Thanks
>> Hanjun
>>
>> drivers/usb/core/hcd-pci.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
>> index 0343246..a9c33e6 100644
>> --- a/drivers/usb/core/hcd-pci.c
>> +++ b/drivers/usb/core/hcd-pci.c
>> @@ -188,6 +188,10 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>> if (pci_enable_device(dev) < 0)
>> return -ENODEV;
>>
>> + retval = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
>> + if (retval)
>> + return retval;
>
> dma_coerce_mask_and_coherent is only for platform devices (and I'm
> not sure it is a good idea to start with, but that is a different
> story).
Yes, that's why this is the RFC version.
>
> PCI device should have the dma_mask pointer set already, so you should
> use dma_set_mask_and_coherent here.
I will wait for a while to see if more comments, if not, I will update
my patch as you suggested.
Thanks
Hanjun
Powered by blists - more mailing lists