From: Christoph Hellwig <hch@lst.de>
To: Hanjun Guo <guohanjun@huawei.com>
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>,
Christoph Hellwig <hch@lst.de>,
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: Wed, 30 Jan 2019 08:40:59 +0100 [thread overview]
Message-ID: <20190130074059.GA29458@lst.de> (raw)
In-Reply-To: <1548831714-3706-1-git-send-email-guohanjun@huawei.com>
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).
PCI device should have the dma_mask pointer set already, so you should
use dma_set_mask_and_coherent here.
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Hanjun Guo <guohanjun@huawei.com>
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>,
Christoph Hellwig <hch@lst.de>,
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: [RFC] USB: PCI: set 32bit DMA mask for PCI based USB controllers
Date: Wed, 30 Jan 2019 08:40:59 +0100 [thread overview]
Message-ID: <20190130074059.GA29458@lst.de> (raw)
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).
PCI device should have the dma_mask pointer set already, so you should
use dma_set_mask_and_coherent here.
next prev parent reply other threads:[~2019-01-30 7:40 UTC|newest]
Thread overview: 20+ 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:01 ` [RFC] " Hanjun Guo
2019-01-30 7:01 ` [RFC PATCH] " Hanjun Guo
2019-01-30 7:40 ` Christoph Hellwig [this message]
2019-01-30 7:40 ` [RFC] " Christoph Hellwig
2019-01-31 1:19 ` [RFC PATCH] " Hanjun Guo
2019-01-31 1:19 ` [RFC] " Hanjun Guo
2019-01-31 1:19 ` [RFC PATCH] " Hanjun Guo
2019-01-31 9:54 ` John Garry
2019-01-31 9:54 ` [RFC] " John Garry
2019-01-31 9:54 ` [RFC PATCH] " John Garry
2019-02-01 5:55 ` Hanjun Guo
2019-02-01 5:55 ` [RFC] " Hanjun Guo
2019-02-01 5:55 ` [RFC PATCH] " Hanjun Guo
2019-02-01 9:13 ` Hanjun Guo
2019-02-01 9:13 ` [RFC] " Hanjun Guo
2019-02-01 9:13 ` [RFC PATCH] " Hanjun Guo
2019-02-02 8:10 ` Hanjun Guo
2019-02-02 8:10 ` [RFC] " Hanjun Guo
2019-02-02 8:10 ` [RFC PATCH] " 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=20190130074059.GA29458@lst.de \
--to=hch@lst.de \
--cc=Jonathan.Cameron@huawei.com \
--cc=anthony.jebson@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=guohanjun@huawei.com \
--cc=hanjun.guo@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.