All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: felix: the switch does not support DMA
@ 2021-01-09 20:34 Vladimir Oltean
  2021-01-10  1:24 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Oltean @ 2021-01-09 20:34 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, netdev
  Cc: andrew, f.fainelli, vivien.didelot

From: Vladimir Oltean <vladimir.oltean@nxp.com>

The code that sets the DMA mask to 64 bits is bogus, it is taken from
the enetc driver together with the rest of the PCI probing boilerplate.

Since this patch is touching the error path to delete err_dma, let's
also change the err_alloc_felix label which was incorrect. The kzalloc
failure does not need a kfree, but it doesn't hurt either, since kfree
works with NULL pointers.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/dsa/ocelot/felix_vsc9959.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 2e5bbdca5ea4..a87597eef8cf 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -1408,17 +1408,6 @@ static int felix_pci_probe(struct pci_dev *pdev,
 		goto err_pci_enable;
 	}
 
-	/* set up for high or low dma */
-	err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-	if (err) {
-		err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
-		if (err) {
-			dev_err(&pdev->dev,
-				"DMA configuration failed: 0x%x\n", err);
-			goto err_dma;
-		}
-	}
-
 	felix = kzalloc(sizeof(struct felix), GFP_KERNEL);
 	if (!felix) {
 		err = -ENOMEM;
@@ -1474,9 +1463,8 @@ static int felix_pci_probe(struct pci_dev *pdev,
 	kfree(ds);
 err_alloc_ds:
 err_alloc_irq:
-err_alloc_felix:
 	kfree(felix);
-err_dma:
+err_alloc_felix:
 	pci_disable_device(pdev);
 err_pci_enable:
 	return err;
-- 
2.25.1


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

* Re: [PATCH net-next] net: dsa: felix: the switch does not support DMA
  2021-01-09 20:34 [PATCH net-next] net: dsa: felix: the switch does not support DMA Vladimir Oltean
@ 2021-01-10  1:24 ` Florian Fainelli
  2021-01-12  0:17   ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2021-01-10  1:24 UTC (permalink / raw)
  To: Vladimir Oltean, David S . Miller, Jakub Kicinski, netdev
  Cc: andrew, vivien.didelot



On 1/9/2021 12:34 PM, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> The code that sets the DMA mask to 64 bits is bogus, it is taken from
> the enetc driver together with the rest of the PCI probing boilerplate.
> 
> Since this patch is touching the error path to delete err_dma, let's
> also change the err_alloc_felix label which was incorrect. The kzalloc
> failure does not need a kfree, but it doesn't hurt either, since kfree
> works with NULL pointers.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH net-next] net: dsa: felix: the switch does not support DMA
  2021-01-10  1:24 ` Florian Fainelli
@ 2021-01-12  0:17   ` Jakub Kicinski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2021-01-12  0:17 UTC (permalink / raw)
  To: Florian Fainelli, Vladimir Oltean
  Cc: David S . Miller, netdev, andrew, vivien.didelot

On Sat, 9 Jan 2021 17:24:39 -0800 Florian Fainelli wrote:
> On 1/9/2021 12:34 PM, Vladimir Oltean wrote:
> > From: Vladimir Oltean <vladimir.oltean@nxp.com>
> > 
> > The code that sets the DMA mask to 64 bits is bogus, it is taken from
> > the enetc driver together with the rest of the PCI probing boilerplate.
> > 
> > Since this patch is touching the error path to delete err_dma, let's
> > also change the err_alloc_felix label which was incorrect. The kzalloc
> > failure does not need a kfree, but it doesn't hurt either, since kfree
> > works with NULL pointers.
> > 
> > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>  
> 
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks!

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

end of thread, other threads:[~2021-01-12  0:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-09 20:34 [PATCH net-next] net: dsa: felix: the switch does not support DMA Vladimir Oltean
2021-01-10  1:24 ` Florian Fainelli
2021-01-12  0:17   ` Jakub Kicinski

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.