linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: ioat: use PCI core macros for PCIe Capability
@ 2023-03-07 21:46 Bjorn Helgaas
  2023-03-07 21:50 ` Dave Jiang
  2023-03-17 17:45 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2023-03-07 21:46 UTC (permalink / raw)
  To: Vinod Koul; +Cc: dmaengine, linux-kernel, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.com>

The PCIe Capability is defined by the PCIe spec, so use the PCI_EXP_DEVCTL
macros defined by the PCI core instead of defining copies in IOAT.  This
makes it easier to find all uses of the PCIe Device Control register.  No
functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/dma/ioat/init.c      | 6 +++---
 drivers/dma/ioat/registers.h | 7 -------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
index 5d707ff63554..fa7c0f9aa61d 100644
--- a/drivers/dma/ioat/init.c
+++ b/drivers/dma/ioat/init.c
@@ -1191,13 +1191,13 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca)
 		ioat_dma->dca = ioat_dca_init(pdev, ioat_dma->reg_base);
 
 	/* disable relaxed ordering */
-	err = pcie_capability_read_word(pdev, IOAT_DEVCTRL_OFFSET, &val16);
+	err = pcie_capability_read_word(pdev, PCI_EXP_DEVCTL, &val16);
 	if (err)
 		return pcibios_err_to_errno(err);
 
 	/* clear relaxed ordering enable */
-	val16 &= ~IOAT_DEVCTRL_ROE;
-	err = pcie_capability_write_word(pdev, IOAT_DEVCTRL_OFFSET, val16);
+	val16 &= ~PCI_EXP_DEVCTL_RELAX_EN;
+	err = pcie_capability_write_word(pdev, PCI_EXP_DEVCTL, val16);
 	if (err)
 		return pcibios_err_to_errno(err);
 
diff --git a/drivers/dma/ioat/registers.h b/drivers/dma/ioat/registers.h
index f55a5f92f185..54cf0ad39887 100644
--- a/drivers/dma/ioat/registers.h
+++ b/drivers/dma/ioat/registers.h
@@ -14,13 +14,6 @@
 #define IOAT_PCI_CHANERR_INT_OFFSET		0x180
 #define IOAT_PCI_CHANERRMASK_INT_OFFSET		0x184
 
-/* PCIe config registers */
-
-/* EXPCAPID + N */
-#define IOAT_DEVCTRL_OFFSET			0x8
-/* relaxed ordering enable */
-#define IOAT_DEVCTRL_ROE			0x10
-
 /* MMIO Device Registers */
 #define IOAT_CHANCNT_OFFSET			0x00	/*  8-bit */
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: ioat: use PCI core macros for PCIe Capability
  2023-03-07 21:46 [PATCH] dmaengine: ioat: use PCI core macros for PCIe Capability Bjorn Helgaas
@ 2023-03-07 21:50 ` Dave Jiang
  2023-03-17 17:45 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2023-03-07 21:50 UTC (permalink / raw)
  To: Bjorn Helgaas, Vinod Koul; +Cc: dmaengine, linux-kernel, Bjorn Helgaas



On 3/7/23 2:46 PM, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> The PCIe Capability is defined by the PCIe spec, so use the PCI_EXP_DEVCTL
> macros defined by the PCI core instead of defining copies in IOAT.  This
> makes it easier to find all uses of the PCIe Device Control register.  No
> functional change intended.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Acked-by: Dave Jiang <dave.jiang@intel.com>

> ---
>   drivers/dma/ioat/init.c      | 6 +++---
>   drivers/dma/ioat/registers.h | 7 -------
>   2 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
> index 5d707ff63554..fa7c0f9aa61d 100644
> --- a/drivers/dma/ioat/init.c
> +++ b/drivers/dma/ioat/init.c
> @@ -1191,13 +1191,13 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca)
>   		ioat_dma->dca = ioat_dca_init(pdev, ioat_dma->reg_base);
>   
>   	/* disable relaxed ordering */
> -	err = pcie_capability_read_word(pdev, IOAT_DEVCTRL_OFFSET, &val16);
> +	err = pcie_capability_read_word(pdev, PCI_EXP_DEVCTL, &val16);
>   	if (err)
>   		return pcibios_err_to_errno(err);
>   
>   	/* clear relaxed ordering enable */
> -	val16 &= ~IOAT_DEVCTRL_ROE;
> -	err = pcie_capability_write_word(pdev, IOAT_DEVCTRL_OFFSET, val16);
> +	val16 &= ~PCI_EXP_DEVCTL_RELAX_EN;
> +	err = pcie_capability_write_word(pdev, PCI_EXP_DEVCTL, val16);
>   	if (err)
>   		return pcibios_err_to_errno(err);
>   
> diff --git a/drivers/dma/ioat/registers.h b/drivers/dma/ioat/registers.h
> index f55a5f92f185..54cf0ad39887 100644
> --- a/drivers/dma/ioat/registers.h
> +++ b/drivers/dma/ioat/registers.h
> @@ -14,13 +14,6 @@
>   #define IOAT_PCI_CHANERR_INT_OFFSET		0x180
>   #define IOAT_PCI_CHANERRMASK_INT_OFFSET		0x184
>   
> -/* PCIe config registers */
> -
> -/* EXPCAPID + N */
> -#define IOAT_DEVCTRL_OFFSET			0x8
> -/* relaxed ordering enable */
> -#define IOAT_DEVCTRL_ROE			0x10
> -
>   /* MMIO Device Registers */
>   #define IOAT_CHANCNT_OFFSET			0x00	/*  8-bit */
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: ioat: use PCI core macros for PCIe Capability
  2023-03-07 21:46 [PATCH] dmaengine: ioat: use PCI core macros for PCIe Capability Bjorn Helgaas
  2023-03-07 21:50 ` Dave Jiang
@ 2023-03-17 17:45 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2023-03-17 17:45 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: dmaengine, linux-kernel, Bjorn Helgaas

On 07-03-23, 15:46, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> The PCIe Capability is defined by the PCIe spec, so use the PCI_EXP_DEVCTL
> macros defined by the PCI core instead of defining copies in IOAT.  This
> makes it easier to find all uses of the PCIe Device Control register.  No
> functional change intended.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-17 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 21:46 [PATCH] dmaengine: ioat: use PCI core macros for PCIe Capability Bjorn Helgaas
2023-03-07 21:50 ` Dave Jiang
2023-03-17 17:45 ` Vinod Koul

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).