linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Removed some usages of the deprecated "pci-dma-compat.h" KPI
@ 2022-02-23  5:15 Yusuf Khan
  2022-02-23  9:54 ` Yusuf Khan
  2022-02-25 18:19 ` Bjorn Helgaas
  0 siblings, 2 replies; 6+ messages in thread
From: Yusuf Khan @ 2022-02-23  5:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-pci, tiwai, perex, alex.bou9, mporter, logang,
	kurt.schwemmer, bhelgaas, kw, robh, lorenzo.pieralisi,
	jonathan.derrick, nirmal.patel, Yusuf Khan

The inspiration for this commit comes from Christophe
JAILLET in [1], you can find reasons for why this was removed
linked there. This removes the use of the KPI in some pci
components and rapidio(whatever that is) devices.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux
-next.git/patch/?id=ada3caabaf6135150077c3f729bb06e8f3b5b8f6

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
---
 drivers/pci/controller/vmd.c     | 1 +
 drivers/pci/switch/switchtec.c   | 1 +
 drivers/rapidio/devices/tsi721.c | 8 ++++----
 sound/pci/asihpi/hpios.c         | 1 +
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index cc166c683638..244dc0f2f71e 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -17,6 +17,7 @@
 #include <linux/srcu.h>
 #include <linux/rculist.h>
 #include <linux/rcupdate.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/irqdomain.h>
 
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index c36c1238c604..05a876ec1463 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -15,6 +15,7 @@
 #include <linux/wait.h>
 #include <linux/io-64-nonatomic-lo-hi.h>
 #include <linux/nospec.h>
+#include <linux/dma-mapping.h>
 
 MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
 MODULE_VERSION("0.1");
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 4dd31dd9feea..b3134744fb55 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -2836,17 +2836,17 @@ static int tsi721_probe(struct pci_dev *pdev,
 	}
 
 	/* Configure DMA attributes. */
-	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
-		err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+	if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
+		err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
 		if (err) {
 			tsi_err(&pdev->dev, "Unable to set DMA mask");
 			goto err_unmap_bars;
 		}
 
-		if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))
+		if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)))
 			tsi_info(&pdev->dev, "Unable to set consistent DMA mask");
 	} else {
-		err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+		err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
 		if (err)
 			tsi_info(&pdev->dev, "Unable to set consistent DMA mask");
 	}
diff --git a/sound/pci/asihpi/hpios.c b/sound/pci/asihpi/hpios.c
index 6fe60d13e24b..08757c92aee5 100644
--- a/sound/pci/asihpi/hpios.c
+++ b/sound/pci/asihpi/hpios.c
@@ -10,6 +10,7 @@ HPI Operating System function implementation for Linux
 (C) Copyright AudioScience Inc. 1997-2003
 ******************************************************************************/
 #define SOURCEFILE_NAME "hpios.c"
+#include <linux/dma-mapping.h>
 #include "hpi_internal.h"
 #include "hpidebug.h"
 #include <linux/delay.h>
-- 
2.25.1


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

* Re: [PATCH] Removed some usages of the deprecated "pci-dma-compat.h" KPI
  2022-02-23  5:15 [PATCH] Removed some usages of the deprecated "pci-dma-compat.h" KPI Yusuf Khan
@ 2022-02-23  9:54 ` Yusuf Khan
  2022-02-25 18:20   ` Bjorn Helgaas
  2022-02-25 18:19 ` Bjorn Helgaas
  1 sibling, 1 reply; 6+ messages in thread
From: Yusuf Khan @ 2022-02-23  9:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-pci, tiwai, perex, alex.bou9, mporter, logang,
	kurt.schwemmer, Bjorn Helgaas, kw, robh, lorenzo.pieralisi,
	jonathan.derrick, nirmal.patel

See https://lkml.org/lkml/2022/2/23/11 Before you think of this commit!

On Tue, Feb 22, 2022 at 9:15 PM Yusuf Khan <yusisamerican@gmail.com> wrote:
>
> The inspiration for this commit comes from Christophe
> JAILLET in [1], you can find reasons for why this was removed
> linked there. This removes the use of the KPI in some pci
> components and rapidio(whatever that is) devices.
>
> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux
> -next.git/patch/?id=ada3caabaf6135150077c3f729bb06e8f3b5b8f6
>
> Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
> ---
>  drivers/pci/controller/vmd.c     | 1 +
>  drivers/pci/switch/switchtec.c   | 1 +
>  drivers/rapidio/devices/tsi721.c | 8 ++++----
>  sound/pci/asihpi/hpios.c         | 1 +
>  4 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> index cc166c683638..244dc0f2f71e 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -17,6 +17,7 @@
>  #include <linux/srcu.h>
>  #include <linux/rculist.h>
>  #include <linux/rcupdate.h>
> +#include <linux/dma-mapping.h>
>
>  #include <asm/irqdomain.h>
>
> diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
> index c36c1238c604..05a876ec1463 100644
> --- a/drivers/pci/switch/switchtec.c
> +++ b/drivers/pci/switch/switchtec.c
> @@ -15,6 +15,7 @@
>  #include <linux/wait.h>
>  #include <linux/io-64-nonatomic-lo-hi.h>
>  #include <linux/nospec.h>
> +#include <linux/dma-mapping.h>
>
>  MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
>  MODULE_VERSION("0.1");
> diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
> index 4dd31dd9feea..b3134744fb55 100644
> --- a/drivers/rapidio/devices/tsi721.c
> +++ b/drivers/rapidio/devices/tsi721.c
> @@ -2836,17 +2836,17 @@ static int tsi721_probe(struct pci_dev *pdev,
>         }
>
>         /* Configure DMA attributes. */
> -       if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
> -               err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
> +       if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
> +               err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
>                 if (err) {
>                         tsi_err(&pdev->dev, "Unable to set DMA mask");
>                         goto err_unmap_bars;
>                 }
>
> -               if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))
> +               if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)))
>                         tsi_info(&pdev->dev, "Unable to set consistent DMA mask");
>         } else {
> -               err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
> +               err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
>                 if (err)
>                         tsi_info(&pdev->dev, "Unable to set consistent DMA mask");
>         }
> diff --git a/sound/pci/asihpi/hpios.c b/sound/pci/asihpi/hpios.c
> index 6fe60d13e24b..08757c92aee5 100644
> --- a/sound/pci/asihpi/hpios.c
> +++ b/sound/pci/asihpi/hpios.c
> @@ -10,6 +10,7 @@ HPI Operating System function implementation for Linux
>  (C) Copyright AudioScience Inc. 1997-2003
>  ******************************************************************************/
>  #define SOURCEFILE_NAME "hpios.c"
> +#include <linux/dma-mapping.h>
>  #include "hpi_internal.h"
>  #include "hpidebug.h"
>  #include <linux/delay.h>
> --
> 2.25.1
>

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

* Re: [PATCH] Removed some usages of the deprecated "pci-dma-compat.h" KPI
  2022-02-23  5:15 [PATCH] Removed some usages of the deprecated "pci-dma-compat.h" KPI Yusuf Khan
  2022-02-23  9:54 ` Yusuf Khan
@ 2022-02-25 18:19 ` Bjorn Helgaas
  2022-02-26  4:16   ` Yusuf Khan
  1 sibling, 1 reply; 6+ messages in thread
From: Bjorn Helgaas @ 2022-02-25 18:19 UTC (permalink / raw)
  To: Yusuf Khan
  Cc: linux-kernel, linux-pci, tiwai, perex, alex.bou9, mporter,
	logang, kurt.schwemmer, bhelgaas, kw, robh, lorenzo.pieralisi,
	jonathan.derrick, nirmal.patel

On Tue, Feb 22, 2022 at 09:15:45PM -0800, Yusuf Khan wrote:
> The inspiration for this commit comes from Christophe
> JAILLET in [1], you can find reasons for why this was removed
> linked there. This removes the use of the KPI in some pci
> components and rapidio(whatever that is) devices.
> 
> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux
> -next.git/patch/?id=ada3caabaf6135150077c3f729bb06e8f3b5b8f6

Commit log may include references, but should be self-contained.  It
should be complete in itself, even without reading the subject.  The
subject line is like an article title; it's not the first sentence of
the article.  It's OK to repeat the subject line in the commit log.

If you do include links like the above, make sure they aren't split
across lines.

Explain why this patch is useful.  Expand "KPI".  Use imperative mood. 
Capitalize "PCI" and other acronyms in commit logs and comments.
Remove "(whatever that is)"; it doesn't help justify the patch.

Subject claims to remove usages of "pci-dma-compat.h", but I don't see
any mention of pci-dma-compat.h in the patch.

More tips:
https://lore.kernel.org/r/20171026223701.GA25649@bhelgaas-glaptop.roam.corp.google.com

Bjorn

> Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
> ---
>  drivers/pci/controller/vmd.c     | 1 +
>  drivers/pci/switch/switchtec.c   | 1 +
>  drivers/rapidio/devices/tsi721.c | 8 ++++----
>  sound/pci/asihpi/hpios.c         | 1 +
>  4 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> index cc166c683638..244dc0f2f71e 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -17,6 +17,7 @@
>  #include <linux/srcu.h>
>  #include <linux/rculist.h>
>  #include <linux/rcupdate.h>
> +#include <linux/dma-mapping.h>

Explain in commit log why this is important, since this patch doesn't
add any new use of things from dma-mapping.h, and it doesn't remove
any interfaces from other header files.

>  #include <asm/irqdomain.h>
>  
> diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
> index c36c1238c604..05a876ec1463 100644
> --- a/drivers/pci/switch/switchtec.c
> +++ b/drivers/pci/switch/switchtec.c
> @@ -15,6 +15,7 @@
>  #include <linux/wait.h>
>  #include <linux/io-64-nonatomic-lo-hi.h>
>  #include <linux/nospec.h>
> +#include <linux/dma-mapping.h>
>  
>  MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
>  MODULE_VERSION("0.1");
> diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
> index 4dd31dd9feea..b3134744fb55 100644
> --- a/drivers/rapidio/devices/tsi721.c
> +++ b/drivers/rapidio/devices/tsi721.c
> @@ -2836,17 +2836,17 @@ static int tsi721_probe(struct pci_dev *pdev,
>  	}
>  
>  	/* Configure DMA attributes. */
> -	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
> -		err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
> +	if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
> +		err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
>  		if (err) {
>  			tsi_err(&pdev->dev, "Unable to set DMA mask");
>  			goto err_unmap_bars;
>  		}
>  
> -		if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))
> +		if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)))
>  			tsi_info(&pdev->dev, "Unable to set consistent DMA mask");
>  	} else {
> -		err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
> +		err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
>  		if (err)
>  			tsi_info(&pdev->dev, "Unable to set consistent DMA mask");
>  	}
> diff --git a/sound/pci/asihpi/hpios.c b/sound/pci/asihpi/hpios.c
> index 6fe60d13e24b..08757c92aee5 100644
> --- a/sound/pci/asihpi/hpios.c
> +++ b/sound/pci/asihpi/hpios.c
> @@ -10,6 +10,7 @@ HPI Operating System function implementation for Linux
>  (C) Copyright AudioScience Inc. 1997-2003
>  ******************************************************************************/
>  #define SOURCEFILE_NAME "hpios.c"
> +#include <linux/dma-mapping.h>
>  #include "hpi_internal.h"
>  #include "hpidebug.h"
>  #include <linux/delay.h>
> -- 
> 2.25.1
> 

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

* Re: [PATCH] Removed some usages of the deprecated "pci-dma-compat.h" KPI
  2022-02-23  9:54 ` Yusuf Khan
@ 2022-02-25 18:20   ` Bjorn Helgaas
  2022-02-26  2:12     ` Yusuf Khan
  0 siblings, 1 reply; 6+ messages in thread
From: Bjorn Helgaas @ 2022-02-25 18:20 UTC (permalink / raw)
  To: Yusuf Khan
  Cc: linux-kernel, linux-pci, tiwai, perex, alex.bou9, mporter,
	logang, kurt.schwemmer, Bjorn Helgaas, kw, robh,
	lorenzo.pieralisi, jonathan.derrick, nirmal.patel

On Wed, Feb 23, 2022 at 01:54:54AM -0800, Yusuf Khan wrote:
> See https://lkml.org/lkml/2022/2/23/11 Before you think of this commit!

Use links to https://lore.kernel.org/r/ whenever you can, instead of
lkml.org, etc.

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

* Re: [PATCH] Removed some usages of the deprecated "pci-dma-compat.h" KPI
  2022-02-25 18:20   ` Bjorn Helgaas
@ 2022-02-26  2:12     ` Yusuf Khan
  0 siblings, 0 replies; 6+ messages in thread
From: Yusuf Khan @ 2022-02-26  2:12 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-kernel, linux-pci, tiwai, perex, alex.bou9, mporter,
	logang, kurt.schwemmer, Bjorn Helgaas, kw, robh,
	lorenzo.pieralisi, jonathan.derrick, nirmal.patel

sorry....

On Fri, Feb 25, 2022 at 10:20 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Wed, Feb 23, 2022 at 01:54:54AM -0800, Yusuf Khan wrote:
> > See https://lkml.org/lkml/2022/2/23/11 Before you think of this commit!
>
> Use links to https://lore.kernel.org/r/ whenever you can, instead of
> lkml.org, etc.

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

* Re: [PATCH] Removed some usages of the deprecated "pci-dma-compat.h" KPI
  2022-02-25 18:19 ` Bjorn Helgaas
@ 2022-02-26  4:16   ` Yusuf Khan
  0 siblings, 0 replies; 6+ messages in thread
From: Yusuf Khan @ 2022-02-26  4:16 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-kernel, linux-pci, tiwai, perex, alex.bou9, mporter,
	logang, kurt.schwemmer, Bjorn Helgaas, kw, robh,
	lorenzo.pieralisi, jonathan.derrick, nirmal.patel

pci-dma-compat.h is included by pci.h so files that depend on it don't
(usually)include it The patch removed function calls to it and replaced them
with dma-mapping calls since that's what it wraps.

As I failed english in school I don't understand half of what you
said, that said
the link to "More tips" was helpful.

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

end of thread, other threads:[~2022-02-26  4:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-23  5:15 [PATCH] Removed some usages of the deprecated "pci-dma-compat.h" KPI Yusuf Khan
2022-02-23  9:54 ` Yusuf Khan
2022-02-25 18:20   ` Bjorn Helgaas
2022-02-26  2:12     ` Yusuf Khan
2022-02-25 18:19 ` Bjorn Helgaas
2022-02-26  4:16   ` Yusuf Khan

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