linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Bjorn Helgaas <helgaas@kernel.org>, <linux-usb@vger.kernel.org>,
	<linux-acpi@vger.kernel.org>, <linux-pci@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
	John Garry <john.garry@huawei.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	<anthony.jebson@huawei.com>, Hanjun Guo <hanjun.guo@linaro.org>
Subject: Re: [RFC PATCH] USB: PCI: set 32bit DMA mask for PCI based USB controllers
Date: Thu, 31 Jan 2019 09:19:14 +0800	[thread overview]
Message-ID: <b42f939d-8946-4865-59d8-7451d7d753bd@huawei.com> (raw)
In-Reply-To: <20190130074059.GA29458@lst.de>

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



  reply	other threads:[~2019-01-31  1:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30  7:01 [RFC PATCH] USB: PCI: set 32bit DMA mask for PCI based USB controllers Hanjun Guo
2019-01-30  7:40 ` Christoph Hellwig
2019-01-31  1:19   ` Hanjun Guo [this message]
2019-01-31  9:54 ` John Garry
2019-02-01  5:55   ` Hanjun Guo
2019-02-01  9:13     ` Hanjun Guo
2019-02-02  8:10       ` Hanjun Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b42f939d-8946-4865-59d8-7451d7d753bd@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=anthony.jebson@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hanjun.guo@linaro.org \
    --cc=hch@lst.de \
    --cc=helgaas@kernel.org \
    --cc=john.garry@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=rafael@kernel.org \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).