From patchwork Sat Jul 5 15:03:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 4488561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3875D9F26C for ; Sat, 5 Jul 2014 15:06:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64D8A2022D for ; Sat, 5 Jul 2014 15:06:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F03E2022A for ; Sat, 5 Jul 2014 15:06:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X3RVn-0002Qi-OO; Sat, 05 Jul 2014 15:04:23 +0000 Received: from top.free-electrons.com ([176.31.233.9] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X3RVk-0002Nu-In for linux-arm-kernel@lists.infradead.org; Sat, 05 Jul 2014 15:04:21 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id D96E480F; Sat, 5 Jul 2014 17:04:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, MIME_QP_LONG_LINE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (unknown [190.2.108.81]) by mail.free-electrons.com (Postfix) with ESMTPSA id D0BA77FE; Sat, 5 Jul 2014 17:04:09 +0200 (CEST) Date: Sat, 5 Jul 2014 12:03:08 -0300 From: Ezequiel Garcia To: Laurent Pinchart Subject: Re: 3.16rc3 multiplatform, Armada 370 and IOMMU: unbootable kernel Message-ID: <20140705150308.GA28791@arch.cereza> References: <20140703135146.GA6898@luxor.wired.org> <53B5C61D.2060308@free-electrons.com> <53B5CA26.7050405@free-electrons.com> <1936558.QaAG1bYMuD@avalon> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1936558.QaAG1bYMuD@avalon> User-Agent: Mutt/1.5.22 (2013-10-16) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140705_080420_917554_AF89C6D4 X-CRM114-Status: GOOD ( 15.86 ) X-Spam-Score: 1.0 (+) Cc: Thomas Petazzoni , Andrew Lunn , Jason Cooper , Greg Kroah-Hartman , Joerg Roedel , Hiroshi.DOYU@nokia.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, Paolo Pisati , Gregory CLEMENT , Florian Vaussard , Sebastian Hesselbarth X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP After following Gregory's stacktrace (also reproduced here): [] (iommu_bus_notifier) from [] (notifier_call_chain+0x64/0x9c) [] (notifier_call_chain) from [] (__blocking_notifier_call_chain+0x40/0x58) [] (__blocking_notifier_call_chain) from [] (blocking_notifier_call_chain+0x14/0x1c) [] (blocking_notifier_call_chain) from [] (device_add+0x424/0x524) [] (device_add) from [] (pci_device_add+0xec/0x110) [] (pci_device_add) from [] (pci_scan_single_device+0xa0/0xac) I added a few printks and found that the problem is that the iommu_bus_notifier is called for the 'pci' bus type, which has a null iommu_ops. On 04 Jul 10:47 AM, Laurent Pinchart wrote: [..] > > We need a quick fix for v3.16, ... Therefore, a quick fix would be to simply check for that: This (nasty workaround?) patch makes the problem go away. [..] > > So it also boot well in 3.15 and then failed in 3.16-rc3. I hope it will > > help the developers of the OMAP IOMMU driver to fix it. > > Thank you. I've had a look at the OMAP IOMMU driver changes between v3.15 and > v3.16-rc3, and didn't find at first sight any change that could explain the > crash. > > 286f600 iommu/omap: Fix map protection value handling > 67b779d iommu/omap: Remove comment about supporting single page mappings only > f7129a0 iommu/omap: Fix 'no page for' debug message in flush_iotlb_page() > 5acc97d iommu/omap: Move to_iommu definition from omap-iopgtable.h > 2ac6133 iommu/omap: Remove omap_iommu_domain_has_cap() function > d760e3e iommu/omap: Correct init value of iotlb_entry valid field > > Could you try reverting those changes and retest ? If the problem doesn't > disappear, we'll need to look somewhere else. > I reverted the above commits but nothing changed. I'm far from being an expert, but it sounds odd to have this bus notifier (that got registered for the platform bus type) called by a pci bus type. This doesn't look like a mvebu-specific problem, other platforms should be affected as well. I'm Ccing GregKH, in case he has an idea what's going on. diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index e5555fc..b712cb2 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -536,6 +536,9 @@ static int iommu_bus_notifier(struct notifier_block *nb, struct iommu_group *group; unsigned long group_action = 0; + if (!ops) + return 0; + /* * ADD/DEL call into iommu driver ops if provided, which may * result in ADD/DEL notifiers to group->notifier