From: Larry Finger <Larry.Finger@lwfinger.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Bart Van Assche <Bart.VanAssche@sandisk.com>,
"regressions@leemhuis.info" <regressions@leemhuis.info>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Regression in 4.11 - PowerPC crashes on boot, bisected to commit 5657933dbb6e
Date: Thu, 9 Mar 2017 16:22:01 -0600 [thread overview]
Message-ID: <7914f595-6c77-a0f3-e44a-5441ad29151e@lwfinger.net> (raw)
In-Reply-To: <1488836928.2870.142.camel@kernel.crashing.org>
[-- Attachment #1: Type: text/plain, Size: 1599 bytes --]
On 03/06/2017 03:48 PM, Benjamin Herrenschmidt wrote:
> On Mon, 2017-03-06 at 13:46 -0600, Larry Finger wrote:
>> I was able to create a PPC emulation with debian-8.7.1-powerpc-CD-1.iso
>>> following the instructions in https://gmplib.org/~tege/qemu.html. My only
>> problem was that "-net tap" fails and I did not find any way to get networking
>> working.
>>
>> After looking at the screen through a number of crashes, I have determined that
>> the top entry in the traceback comes from dmam_alloc_coherent(). I have not been
>> able to see the offset to determine which BUG_ON call in that routine is being
>> triggered.
>>
>> I tried to modify panic() to see if I could keep the screen on longer after the
>> failure, but no joy so far.
>
> I think the problem is this code in drivers/macintosh/macio_asic.c:
>
> #ifdef CONFIG_PCI
> /* Set the DMA ops to the ones from the PCI device, this could be
> * fishy if we didn't know that on PowerMac it's always direct ops
> * or iommu ops that will work fine
> *
> * To get all the fields, copy all archdata
> */
> dev->ofdev.dev.archdata = chip->lbus.pdev->dev.archdata;
> #endif /* CONFIG_PCI */
>
> This is definitely bad. A quick fix is to copy the new dev->dma_ops field
> (as well, there is still stuff in archdata that we need too).
>
> A better long term fix is to have a set of macio_dma_ops wrappers that do
> "the right thing".
Ben,
Attached is a patch that fixes the crash. At the moment, it has my s-o-b, but I
do not feel it right to claim authorship. My role should be a
Reported-and-tested-by. Please advise.
Larry
[-- Attachment #2: 0001-powerpc-Fix-crash-introduced-with-commit-5657933dbb6.patch --]
[-- Type: text/x-patch, Size: 1410 bytes --]
>From fe51bd0233e10d0eed64cfe177f5d43ca95642a7 Mon Sep 17 00:00:00 2001
From: Larry Finger <Larry.Finger@lwfinger.net>
Date: Thu, 9 Mar 2017 16:06:21 -0600
Subject: [PATCH] powerpc: Fix crash introduced with commit 5657933dbb6e
Code inserted during the git merges before kernel 4.11-rc1 caused an
early panic quickly followed by a complete shutdown. The traceback was
not displayed long enough to read or photograph.
The problem was bisected to commit 5657933dbb6e ("treewide: Move dma_ops
from struct dev_archdata into struct device"). The problem was a missing
copy of critical information from struct dev_archdata into struct device,
leading to the dereference of a null pointer.
Fixes: commit 5657933dbb6e ("treewide: Move dma_ops from struct dev_archdata into struct device")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/macintosh/macio_asic.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 3f041b1..f757cef2 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -392,6 +392,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
* To get all the fields, copy all archdata
*/
dev->ofdev.dev.archdata = chip->lbus.pdev->dev.archdata;
+ dev->ofdev.dev.dma_ops = chip->lbus.pdev->dev.dma_ops;
#endif /* CONFIG_PCI */
#ifdef DEBUG
--
2.10.2
next prev parent reply other threads:[~2017-03-09 22:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-02 3:26 Larry Finger
2017-03-02 4:07 ` Bart Van Assche
2017-03-02 12:26 ` Larry Finger
2017-03-02 5:14 ` Benjamin Herrenschmidt
2017-03-02 5:22 ` Bart Van Assche
2017-03-02 12:40 ` Larry Finger
2017-03-06 18:02 ` Bart Van Assche
2017-03-06 19:46 ` Larry Finger
2017-03-06 21:48 ` Benjamin Herrenschmidt
2017-03-07 0:43 ` Larry Finger
2017-03-09 22:22 ` Larry Finger [this message]
2017-03-10 1:45 ` Benjamin Herrenschmidt
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=7914f595-6c77-a0f3-e44a-5441ad29151e@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=Bart.VanAssche@sandisk.com \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=regressions@leemhuis.info \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®