From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: Meelis Roos <mroos-Y27EyoLml9s@public.gmane.org>
Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Subject: Re: new SBus related DMA warnings in 4.18+git
Date: Tue, 28 Aug 2018 11:29:15 +0200 [thread overview]
Message-ID: <20180828092915.GC12488@lst.de> (raw)
In-Reply-To: <alpine.LRH.2.21.1808272203270.28446-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
On Mon, Aug 27, 2018 at 10:04:58PM +0300, Meelis Roos wrote:
> > On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> > > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus
> > > and several SBus connected devicess give DMA mapping related warnings:
> >
> > This should have been around since the warning was added.
> >
> > The patch below should fix it:
> >
> > ---
> > >From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
> > From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> > Date: Mon, 27 Aug 2018 17:23:24 +0200
> > Subject: driver core: initialize a default DMA mask for platform device
>
> No, it does not fix it. Dmesg from another SBus machine that conmpiled
> it faster (Sun Ultra 2):
Based on the other thread here is a new attempt:
---
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 3641a294ed54..1738f7f12a9f 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -381,6 +381,10 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
else
dev_set_name(&op->dev, "%08x", dp->phandle);
+ op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+ op->dev.dma_mask = &op->dma_mask;
+ op->dma_mask = DMA_BIT_MASK(32);
+
if (of_device_register(op)) {
printk("%s: Could not register of device.\n",
dp->full_name);
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 44e4d4435bed..60ebb1f976ab 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -675,6 +675,9 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
dev_set_name(&op->dev, "root");
else
dev_set_name(&op->dev, "%08x", dp->phandle);
+ op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+ op->dev.dma_mask = &op->dma_mask;
+ op->dma_mask = DMA_BIT_MASK(32);
if (of_device_register(op)) {
printk("%s: Could not register of device.\n",
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Meelis Roos <mroos-Y27EyoLml9s@public.gmane.org>
Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Subject: Re: new SBus related DMA warnings in 4.18+git
Date: Tue, 28 Aug 2018 09:29:15 +0000 [thread overview]
Message-ID: <20180828092915.GC12488@lst.de> (raw)
In-Reply-To: <alpine.LRH.2.21.1808272203270.28446-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
On Mon, Aug 27, 2018 at 10:04:58PM +0300, Meelis Roos wrote:
> > On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> > > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus
> > > and several SBus connected devicess give DMA mapping related warnings:
> >
> > This should have been around since the warning was added.
> >
> > The patch below should fix it:
> >
> > ---
> > >From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
> > From: Christoph Hellwig <hch@lst.de>
> > Date: Mon, 27 Aug 2018 17:23:24 +0200
> > Subject: driver core: initialize a default DMA mask for platform device
>
> No, it does not fix it. Dmesg from another SBus machine that conmpiled
> it faster (Sun Ultra 2):
Based on the other thread here is a new attempt:
---
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 3641a294ed54..1738f7f12a9f 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -381,6 +381,10 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
else
dev_set_name(&op->dev, "%08x", dp->phandle);
+ op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+ op->dev.dma_mask = &op->dma_mask;
+ op->dma_mask = DMA_BIT_MASK(32);
+
if (of_device_register(op)) {
printk("%s: Could not register of device.\n",
dp->full_name);
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 44e4d4435bed..60ebb1f976ab 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -675,6 +675,9 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
dev_set_name(&op->dev, "root");
else
dev_set_name(&op->dev, "%08x", dp->phandle);
+ op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+ op->dev.dma_mask = &op->dma_mask;
+ op->dma_mask = DMA_BIT_MASK(32);
if (of_device_register(op)) {
printk("%s: Could not register of device.\n",
next prev parent reply other threads:[~2018-08-28 9:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-26 7:48 new SBus related DMA warnings in 4.18+git Meelis Roos
2018-08-26 7:48 ` Meelis Roos
[not found] ` <alpine.LRH.2.21.1808260902280.22219-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
2018-08-27 15:47 ` Christoph Hellwig
2018-08-27 15:47 ` Christoph Hellwig
[not found] ` <20180827154716.GA30492-jcswGhMUV9g@public.gmane.org>
2018-08-27 19:04 ` Meelis Roos
2018-08-27 19:04 ` Meelis Roos
[not found] ` <alpine.LRH.2.21.1808272203270.28446-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
2018-08-28 9:29 ` Christoph Hellwig [this message]
2018-08-28 9:29 ` Christoph Hellwig
[not found] ` <20180828092915.GC12488-jcswGhMUV9g@public.gmane.org>
2018-08-28 10:30 ` Meelis Roos
2018-08-28 10:30 ` Meelis Roos
[not found] ` <alpine.LRH.2.21.1808281330270.13945-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
2018-08-28 11:43 ` Christoph Hellwig
2018-08-28 11:43 ` Christoph Hellwig
[not found] ` <20180828114358.GA14519-jcswGhMUV9g@public.gmane.org>
2018-08-29 5:47 ` Meelis Roos
2018-08-29 5:47 ` Meelis Roos
[not found] ` <alpine.LRH.2.21.1808281649580.19903-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
2018-08-29 5:51 ` Christoph Hellwig
2018-08-29 5:51 ` Christoph Hellwig
2018-08-27 19:15 ` Sam Ravnborg
2018-08-27 19:15 ` Sam Ravnborg
[not found] ` <20180827191518.GA26665-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
2018-08-27 20:41 ` David Miller
2018-08-27 20:41 ` David Miller
[not found] ` <20180827.134136.955064444069965259.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2018-08-28 9:24 ` Christoph Hellwig
2018-08-28 9:24 ` Christoph Hellwig
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=20180828092915.GC12488@lst.de \
--to=hch-jcswghmuv9g@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=mroos-Y27EyoLml9s@public.gmane.org \
--cc=sparclinux-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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.