* [PATCH net] macsonic: Set platform device coherent_dma_mask
@ 2018-05-03 4:24 Finn Thain
0 siblings, 0 replies; 5+ messages in thread
From: Finn Thain @ 2018-05-03 4:24 UTC (permalink / raw)
To: David S. Miller; +Cc: linux-m68k, netdev, linux-kernel
Set the device's coherent_dma_mask to avoid a WARNING splat.
Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is
no coherent_dma_mask").
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
drivers/net/ethernet/natsemi/macsonic.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index 0937fc2a928e..37b1ffa8bb61 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -523,6 +523,10 @@ static int mac_sonic_platform_probe(struct platform_device *pdev)
struct sonic_local *lp;
int err;
+ err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+ if (err)
+ return err;
+
dev = alloc_etherdev(sizeof(struct sonic_local));
if (!dev)
return -ENOMEM;
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <S1752057AbeECEYP/20180503042418Z+1168@vger.kernel.org>]
* Re: [PATCH net] macsonic: Set platform device coherent_dma_mask
[not found] <S1752057AbeECEYP/20180503042418Z+1168@vger.kernel.org>
@ 2018-05-03 7:25 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2018-05-03 7:25 UTC (permalink / raw)
To: Finn Thain; +Cc: David S. Miller, linux-m68k, netdev, Linux Kernel Mailing List
Hi Finn,
On Thu, May 3, 2018 at 6:24 AM, Finn Thain <fthain@telegraphics.com.au> wrote:
> Set the device's coherent_dma_mask to avoid a WARNING splat.
> Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is
> no coherent_dma_mask").
>
> Cc: linux-m68k@lists.linux-m68k.org
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Thanks for your patch!
> --- a/drivers/net/ethernet/natsemi/macsonic.c
> +++ b/drivers/net/ethernet/natsemi/macsonic.c
> @@ -523,6 +523,10 @@ static int mac_sonic_platform_probe(struct platform_device *pdev)
> struct sonic_local *lp;
> int err;
>
> + err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> + if (err)
> + return err;
> +
> dev = alloc_etherdev(sizeof(struct sonic_local));
> if (!dev)
> return -ENOMEM;
Shouldn't this be handled in the platform code that instantiates the device,
i.e. in arch/m68k/mac/config.c:mac_platform_init()?
Cfr. commit f61e64310b75733d ("m68k: set dma and coherent masks for platform
FEC ethernets").
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net] macsonic: Set platform device coherent_dma_mask
@ 2018-05-03 4:24 Finn Thain
0 siblings, 0 replies; 5+ messages in thread
From: Finn Thain @ 2018-05-03 4:24 UTC (permalink / raw)
To: David S. Miller; +Cc: linux-m68k, netdev, linux-kernel
Set the device's coherent_dma_mask to avoid a WARNING splat.
Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is
no coherent_dma_mask").
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
drivers/net/ethernet/natsemi/macsonic.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index 0937fc2a928e..37b1ffa8bb61 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -523,6 +523,10 @@ static int mac_sonic_platform_probe(struct platform_device *pdev)
struct sonic_local *lp;
int err;
+ err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+ if (err)
+ return err;
+
dev = alloc_etherdev(sizeof(struct sonic_local));
if (!dev)
return -ENOMEM;
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net] macsonic: Set platform device coherent_dma_mask
@ 2018-05-03 4:24 Finn Thain
0 siblings, 0 replies; 5+ messages in thread
From: Finn Thain @ 2018-05-03 4:24 UTC (permalink / raw)
To: David S. Miller; +Cc: linux-m68k, netdev, linux-kernel
Set the device's coherent_dma_mask to avoid a WARNING splat.
Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is
no coherent_dma_mask").
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
drivers/net/ethernet/natsemi/macsonic.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index 0937fc2a928e..37b1ffa8bb61 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -523,6 +523,10 @@ static int mac_sonic_platform_probe(struct platform_device *pdev)
struct sonic_local *lp;
int err;
+ err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+ if (err)
+ return err;
+
dev = alloc_etherdev(sizeof(struct sonic_local));
if (!dev)
return -ENOMEM;
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net] macsonic: Set platform device coherent_dma_mask
@ 2018-05-03 4:24 Finn Thain
0 siblings, 0 replies; 5+ messages in thread
From: Finn Thain @ 2018-05-03 4:24 UTC (permalink / raw)
To: David S. Miller; +Cc: linux-m68k, netdev, linux-kernel
Set the device's coherent_dma_mask to avoid a WARNING splat.
Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is
no coherent_dma_mask").
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
drivers/net/ethernet/natsemi/macsonic.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index 0937fc2a928e..37b1ffa8bb61 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -523,6 +523,10 @@ static int mac_sonic_platform_probe(struct platform_device *pdev)
struct sonic_local *lp;
int err;
+ err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+ if (err)
+ return err;
+
dev = alloc_etherdev(sizeof(struct sonic_local));
if (!dev)
return -ENOMEM;
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-03 7:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-03 4:24 [PATCH net] macsonic: Set platform device coherent_dma_mask Finn Thain
[not found] <S1752057AbeECEYP/20180503042418Z+1168@vger.kernel.org>
2018-05-03 7:25 ` Geert Uytterhoeven
-- strict thread matches above, loose matches on Subject: below --
2018-05-03 4:24 Finn Thain
2018-05-03 4:24 Finn Thain
2018-05-03 4:24 Finn Thain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox