From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH v2] nvme-pci: Use PCI bus address for data/queues in CMB
Date: Mon, 2 Oct 2017 11:21:29 -0600 [thread overview]
Message-ID: <20171002172128.GV8463@localhost.localdomain> (raw)
In-Reply-To: <20171001074203.GA11115@lst.de>
On Sun, Oct 01, 2017@09:42:03AM +0200, Christoph Hellwig wrote:
> This looks very convoluted, mostly because the existing code is
> doing weird things. For one thing what is sq_dma_addr currently
> is not a DMA adddress - we either need the resource address
> for the ioremap, but we don't need to stash that away, and second
> the one programmed into the controller should be a pci_bus_addr_t.
>
> Second we already have a nice PCI-layer helper called pci_bus_address
> to get the bus address for us and we should use it.
>
> Something like the patch below should solve the issue:
Yah, calling this a DMA address was a misnomer and confusing.
> ---
> From b78f4164881125c4fecfdb87878d0120b2177c53 Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch at lst.de>
> Date: Sun, 1 Oct 2017 09:37:35 +0200
> Subject: nvme-pci: Use PCI bus address for data/queues in CMB
>
> Currently, NVMe PCI host driver is programming CMB dma address as
> I/O SQs addresses. This results in failures on systems where 1:1
> outbound mapping is not used (example Broadcom iProc SOCs) because
> CMB BAR will be progammed with PCI bus address but NVMe PCI EP will
> try to access CMB using dma address.
>
> To have CMB working on systems without 1:1 outbound mapping, we
> program PCI bus address for I/O SQs instead of dma address. This
> approach will work on systems with/without 1:1 outbound mapping.
>
> Based on a report and previous patch from Abhishek Shah.
>
> Fixes: 8ffaadf7 ("NVMe: Use CMB for the IO SQes if available")
> Cc: stable at vger.kernel.org
> Reported-by: Abhishek Shah <abhishek.shah at broadcom.com>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
This looks good.
Reviewed-by: Keith Busch <keith.busch at intel.com>
WARNING: multiple messages have this Message-ID (diff)
From: Keith Busch <keith.busch@intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-nvme@lists.infradead.org, Jens Axboe <axboe@fb.com>,
bcm-kernel-feedback-list@broadcom.com, stable@vger.kernel.org,
Abhishek Shah <abhishek.shah@broadcom.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] nvme-pci: Use PCI bus address for data/queues in CMB
Date: Mon, 2 Oct 2017 11:21:29 -0600 [thread overview]
Message-ID: <20171002172128.GV8463@localhost.localdomain> (raw)
In-Reply-To: <20171001074203.GA11115@lst.de>
On Sun, Oct 01, 2017 at 09:42:03AM +0200, Christoph Hellwig wrote:
> This looks very convoluted, mostly because the existing code is
> doing weird things. For one thing what is sq_dma_addr currently
> is not a DMA adddress - we either need the resource address
> for the ioremap, but we don't need to stash that away, and second
> the one programmed into the controller should be a pci_bus_addr_t.
>
> Second we already have a nice PCI-layer helper called pci_bus_address
> to get the bus address for us and we should use it.
>
> Something like the patch below should solve the issue:
Yah, calling this a DMA address was a misnomer and confusing.
> ---
> From b78f4164881125c4fecfdb87878d0120b2177c53 Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch@lst.de>
> Date: Sun, 1 Oct 2017 09:37:35 +0200
> Subject: nvme-pci: Use PCI bus address for data/queues in CMB
>
> Currently, NVMe PCI host driver is programming CMB dma address as
> I/O SQs addresses. This results in failures on systems where 1:1
> outbound mapping is not used (example Broadcom iProc SOCs) because
> CMB BAR will be progammed with PCI bus address but NVMe PCI EP will
> try to access CMB using dma address.
>
> To have CMB working on systems without 1:1 outbound mapping, we
> program PCI bus address for I/O SQs instead of dma address. This
> approach will work on systems with/without 1:1 outbound mapping.
>
> Based on a report and previous patch from Abhishek Shah.
>
> Fixes: 8ffaadf7 ("NVMe: Use CMB for the IO SQes if available")
> Cc: stable@vger.kernel.org
> Reported-by: Abhishek Shah <abhishek.shah@broadcom.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
This looks good.
Reviewed-by: Keith Busch <keith.busch@intel.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: keith.busch@intel.com (Keith Busch)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] nvme-pci: Use PCI bus address for data/queues in CMB
Date: Mon, 2 Oct 2017 11:21:29 -0600 [thread overview]
Message-ID: <20171002172128.GV8463@localhost.localdomain> (raw)
In-Reply-To: <20171001074203.GA11115@lst.de>
On Sun, Oct 01, 2017 at 09:42:03AM +0200, Christoph Hellwig wrote:
> This looks very convoluted, mostly because the existing code is
> doing weird things. For one thing what is sq_dma_addr currently
> is not a DMA adddress - we either need the resource address
> for the ioremap, but we don't need to stash that away, and second
> the one programmed into the controller should be a pci_bus_addr_t.
>
> Second we already have a nice PCI-layer helper called pci_bus_address
> to get the bus address for us and we should use it.
>
> Something like the patch below should solve the issue:
Yah, calling this a DMA address was a misnomer and confusing.
> ---
> From b78f4164881125c4fecfdb87878d0120b2177c53 Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch@lst.de>
> Date: Sun, 1 Oct 2017 09:37:35 +0200
> Subject: nvme-pci: Use PCI bus address for data/queues in CMB
>
> Currently, NVMe PCI host driver is programming CMB dma address as
> I/O SQs addresses. This results in failures on systems where 1:1
> outbound mapping is not used (example Broadcom iProc SOCs) because
> CMB BAR will be progammed with PCI bus address but NVMe PCI EP will
> try to access CMB using dma address.
>
> To have CMB working on systems without 1:1 outbound mapping, we
> program PCI bus address for I/O SQs instead of dma address. This
> approach will work on systems with/without 1:1 outbound mapping.
>
> Based on a report and previous patch from Abhishek Shah.
>
> Fixes: 8ffaadf7 ("NVMe: Use CMB for the IO SQes if available")
> Cc: stable at vger.kernel.org
> Reported-by: Abhishek Shah <abhishek.shah@broadcom.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
This looks good.
Reviewed-by: Keith Busch <keith.busch@intel.com>
WARNING: multiple messages have this Message-ID (diff)
From: Keith Busch <keith.busch@intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Abhishek Shah <abhishek.shah@broadcom.com>,
Jens Axboe <axboe@fb.com>, Sagi Grimberg <sagi@grimberg.me>,
linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com, stable@vger.kernel.org
Subject: Re: [PATCH v2] nvme-pci: Use PCI bus address for data/queues in CMB
Date: Mon, 2 Oct 2017 11:21:29 -0600 [thread overview]
Message-ID: <20171002172128.GV8463@localhost.localdomain> (raw)
In-Reply-To: <20171001074203.GA11115@lst.de>
On Sun, Oct 01, 2017 at 09:42:03AM +0200, Christoph Hellwig wrote:
> This looks very convoluted, mostly because the existing code is
> doing weird things. For one thing what is sq_dma_addr currently
> is not a DMA adddress - we either need the resource address
> for the ioremap, but we don't need to stash that away, and second
> the one programmed into the controller should be a pci_bus_addr_t.
>
> Second we already have a nice PCI-layer helper called pci_bus_address
> to get the bus address for us and we should use it.
>
> Something like the patch below should solve the issue:
Yah, calling this a DMA address was a misnomer and confusing.
> ---
> From b78f4164881125c4fecfdb87878d0120b2177c53 Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch@lst.de>
> Date: Sun, 1 Oct 2017 09:37:35 +0200
> Subject: nvme-pci: Use PCI bus address for data/queues in CMB
>
> Currently, NVMe PCI host driver is programming CMB dma address as
> I/O SQs addresses. This results in failures on systems where 1:1
> outbound mapping is not used (example Broadcom iProc SOCs) because
> CMB BAR will be progammed with PCI bus address but NVMe PCI EP will
> try to access CMB using dma address.
>
> To have CMB working on systems without 1:1 outbound mapping, we
> program PCI bus address for I/O SQs instead of dma address. This
> approach will work on systems with/without 1:1 outbound mapping.
>
> Based on a report and previous patch from Abhishek Shah.
>
> Fixes: 8ffaadf7 ("NVMe: Use CMB for the IO SQes if available")
> Cc: stable@vger.kernel.org
> Reported-by: Abhishek Shah <abhishek.shah@broadcom.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
This looks good.
Reviewed-by: Keith Busch <keith.busch@intel.com>
next prev parent reply other threads:[~2017-10-02 17:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-30 9:28 [PATCH v2] nvme-pci: Use PCI bus address for data/queues in CMB Abhishek Shah
2017-09-30 9:28 ` Abhishek Shah
2017-09-30 9:28 ` Abhishek Shah
2017-09-30 9:28 ` Abhishek Shah
2017-10-01 7:42 ` Christoph Hellwig
2017-10-01 7:42 ` Christoph Hellwig
2017-10-01 7:42 ` Christoph Hellwig
2017-10-01 7:42 ` Christoph Hellwig
2017-10-02 17:21 ` Keith Busch [this message]
2017-10-02 17:21 ` Keith Busch
2017-10-02 17:21 ` Keith Busch
2017-10-02 17:21 ` Keith Busch
2017-10-04 6:30 ` Christoph Hellwig
2017-10-04 6:30 ` Christoph Hellwig
2017-10-04 6:30 ` Christoph Hellwig
2017-10-04 9:37 ` Abhishek Shah
2017-10-04 9:37 ` Abhishek Shah
2017-10-04 9:37 ` Abhishek Shah
2017-10-04 9:37 ` Abhishek Shah
2017-10-11 10:00 ` Sagi Grimberg
2017-10-11 10:00 ` Sagi Grimberg
2017-10-11 10:00 ` Sagi Grimberg
2017-10-11 10:00 ` Sagi Grimberg
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=20171002172128.GV8463@localhost.localdomain \
--to=keith.busch@intel.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.