Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp82442pxb; Mon, 8 Feb 2021 16:01:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQOR6QSsbfjokqNBRQk5Wvvp3jmMBQzDLsQl7c4ZJ2bIFDwklpFqA1nE6VsYp93Xd5Dd10 X-Received: by 2002:aa7:cc18:: with SMTP id q24mr19380867edt.82.1612828867350; Mon, 08 Feb 2021 16:01:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612828867; cv=none; d=google.com; s=arc-20160816; b=e/VHQl4N3u+0IPKpUnerkWcxn74iWgsCIPn6ywjT0qCJ1annCJOvuVYmoYZF/jq1De kUGrGvM6+fzdjhOzRlg+F1W7QWFb4L08tNC9nZPz12PMVPFXz1OJwEEKgMFA/HkE3c0A /eBlFp+zjE2Sa9RhLGptJXInep62UvE9iEvXLy9AjPruXqqjs6zvLpDe7GWCwT7rv7PG d7oW05Ym69XjNzGpl1F1XfOr1zPfeIsW3yEvL/cFZ3OdM7GFrlDv7kOLJG6JKRP9JWDV E0cOcfayafn/6BIgYB47NndvytAqXVnfkVRczpBDhGL1zgTNWqUTMPRcdL6ADps4CAsE 2Z/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lzfzZMa99tyYou47Mwj80zUT6xShIhy0DCTdQpmeONY=; b=LBusmfpjbwh9HA4KOQ0JNYhXuGBEaEJx5U1+N4dOE4e0dHhqsMNiGygLBVH6mXTNmo 2P1YG1vHWN6EngcCIYZvDGb7648wNQfRS1hU7Kwzrt8T5nV4Yot6uAW6PHCgCZGbhmjr wvGITuhZ1EN8Js04QjRyw1e2PPnjo4+0OnCiO0rRxHoj0aQbPMMutnyQ/PqsJ7u0Wtgi sg0hK1LHCUNAgzN0w8PK5j/A+OTNHKtlH/LSYyZ/v4eeFDOJfjz+iKkSe/K8cbFEGiCf 3XJiH6Dn8AnJDMm8BLmFjO4dvoqroNkQAlYkDcRrVAqRVQlp7Fy/jQvmL0zRxNcR/Dc0 seGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=D+W9iv9d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz22si11705468ejc.658.2021.02.08.16.00.42; Mon, 08 Feb 2021 16:01:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=D+W9iv9d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbhBHX7R (ORCPT + 99 others); Mon, 8 Feb 2021 18:59:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbhBHX7M (ORCPT ); Mon, 8 Feb 2021 18:59:12 -0500 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66591C061794 for ; Mon, 8 Feb 2021 15:58:19 -0800 (PST) Received: by mail-yb1-xb31.google.com with SMTP id 133so3712396ybd.5 for ; Mon, 08 Feb 2021 15:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lzfzZMa99tyYou47Mwj80zUT6xShIhy0DCTdQpmeONY=; b=D+W9iv9dxMOLzV38cOBUWqeHFAdyFUAntsifLuYxuifdJrBNL+fvmNmCr+pBy+5OH+ FLaKWl5s64QQQ38lyrP44rPLnsnHS0SJG4aB8YCAIvjDJB8ehxH/Eug3fXs1whfuED7M vzaFSFUkI5Z+yW2Tv2FVBAuhCBiziPsvtvbdAH8ni9iAQILynnECUU0KXKrisaKIyLjK YYFAoCkPmw4pVh8g6DSxnJLGgW69VkEEDAoeBaj1UHCHdF2I93DvRTlHgpmNoli+wyuU 1+oigLqxQgxqoaojN2VgmOAatX785VoBPLzF5qfL15W73L/ZchxyY/43071lIh+FSp4p XyEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lzfzZMa99tyYou47Mwj80zUT6xShIhy0DCTdQpmeONY=; b=Yi9D9whAep6g28r5NAAVuFnzHIfsGmo+7s4wmRcW6hncBCEJtxK4mtlm9LZrqNcmvw jDo88rKhw8NG+Kuoog4bwdl0o3gnrjeUijVGIJ4IqQgHp0m5IUlZLCduU841pjmdhNpM 5NdJQ7cfcKKU83NzcyOV6K9LuV+IJMFG0jpiWfvXTXf218URGj03d7Fz725lLgcxy4m9 3T5uMJJJa1QiWJKuJMxt0crVZzTPngU0xb9adZO+zKhagt8v/0cFckGF2jb/vH7BBkSc 7uFmRRMjd4ganFD7KRk2jYmIvS4/wv0t4JlWsSZDBN/nPz3Qr0Sc1ao+vMPtIqGNQ0Tj eN1A== X-Gm-Message-State: AOAM5316G/Pwk6IBLQfN/TBJNCcUxRl6cx7zDy94MUoTW8rEjMQsSVrb /TccwTLo8DdDGP37dojbNMGdD5Bv5OXMpnqJHFMV+g== X-Received: by 2002:a25:af0b:: with SMTP id a11mr22574164ybh.228.1612828698549; Mon, 08 Feb 2021 15:58:18 -0800 (PST) MIME-Version: 1.0 References: <20210121225712.1118239-1-saravanak@google.com> <20210121225712.1118239-3-saravanak@google.com> <9692dfc9-4c63-71c9-b52b-d0feba466695@samsung.com> <6b606a5d-0435-1e9d-ac61-a8dacf051067@samsung.com> In-Reply-To: From: Saravana Kannan Date: Mon, 8 Feb 2021 15:57:42 -0800 Message-ID: Subject: Re: [PATCH v2 2/2] of: property: Add fw_devlink support for interrupts To: Marek Szyprowski Cc: Geert Uytterhoeven , Rob Herring , Frank Rowand , Greg Kroah-Hartman , linux-tegra , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Linus Walleij , Bartosz Golaszewski , Jon Hunter , Marc Zyngier , Kevin Hilman , Android Kernel Team , Rob Herring , Thierry Reding Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 8, 2021 at 12:14 AM Marek Szyprowski wrote: > > Hi Saravana, > > On 06.02.2021 05:32, Saravana Kannan wrote: > > On Fri, Feb 5, 2021 at 9:55 AM Saravana Kannan wrote: > >> On Fri, Feb 5, 2021 at 9:52 AM Geert Uytterhoeven wrote: > >>> On Fri, Feb 5, 2021 at 6:20 PM Saravana Kannan wrote: > >>>> On Fri, Feb 5, 2021 at 2:20 AM Geert Uytterhoeven wrote: > >>>>> On Fri, Feb 5, 2021 at 11:06 AM Saravana Kannan wrote: > >>>>>> On Fri, Feb 5, 2021 at 12:06 AM Geert Uytterhoeven wrote: > >>>>>>> On Fri, Feb 5, 2021 at 8:38 AM Marek Szyprowski > >>>>>>> wrote: > >>>>>>>> On 04.02.2021 22:31, Saravana Kannan wrote: > >>>>>>>>> On Thu, Feb 4, 2021 at 3:52 AM Marek Szyprowski > >>>>>>>>> wrote: > >>>>>>>>>> On 21.01.2021 23:57, Saravana Kannan wrote: > >>>>>>>>>>> This allows fw_devlink to create device links between consumers of an > >>>>>>>>>>> interrupt and the supplier of the interrupt. > >>>>>>>>>>> > >>>>>>>>>>> Cc: Marc Zyngier > >>>>>>>>>>> Cc: Kevin Hilman > >>>>>>>>>>> Cc: Greg Kroah-Hartman > >>>>>>>>>>> Reviewed-by: Rob Herring > >>>>>>>>>>> Reviewed-by: Thierry Reding > >>>>>>>>>>> Reviewed-by: Linus Walleij > >>>>>>>>>>> Signed-off-by: Saravana Kannan > >>>>>>>>>> This patch landed some time ago in linux-next as commit 4104ca776ba3 > >>>>>>>>>> ("of: property: Add fw_devlink support for interrupts"). It breaks MMC > >>>>>>>>>> host controller operation on ARM Juno R1 board (the mmci@50000 device > >>>>>>>>>> defined in arch/arm64/boot/dts/arm/juno-motherboard.dtsi). I didn't > >>>>>>>>> I grepped around and it looks like the final board file is this or > >>>>>>>>> whatever includes it? > >>>>>>>>> arch/arm64/boot/dts/arm/juno-base.dtsi > >>>>>>>> The final board file is arch/arm64/boot/dts/arm/juno-r1.dts > >>>>>>>>> This patch just finds the interrupt-parent and then tries to use that > >>>>>>>>> as a supplier if "interrupts" property is listed. But the only > >>>>>>>>> interrupt parent I can see is: > >>>>>>>>> gic: interrupt-controller@2c010000 { > >>>>>>>>> compatible = "arm,gic-400", "arm,cortex-a15-gic"; > >>>>>>>>> > >>>>>>>>> And the driver uses IRQCHIP_DECLARE() and hence should be pretty much > >>>>>>>>> a NOP since those suppliers are never devices and are ignored. > >>>>>>>>> $ git grep "arm,gic-400" -- drivers/ > >>>>>>>>> drivers/irqchip/irq-gic.c:IRQCHIP_DECLARE(gic_400, "arm,gic-400", gic_of_init); > >>>>>>>>> > >>>>>>>>> This doesn't make any sense. Am I looking at the right files? Am I > >>>>>>>>> missing something? > >>>>>>>> Okay, I've added displaying a list of deferred devices when mounting > >>>>>>>> rootfs fails and got following items: > >>>>>>>> > >>>>>>>> Deferred devices: > >>>>>>>> 18000000.ethernet platform: probe deferral - supplier > >>>>>>>> bus@8000000:motherboard-bus not ready > >>>>>>>> 1c050000.mmci amba: probe deferral - supplier > >>>>>>>> bus@8000000:motherboard-bus not ready > >>>>>>>> 1c1d0000.gpio amba: probe deferral - supplier > >>>>>>>> bus@8000000:motherboard-bus not ready > >>>>>>>> 2b600000.iommu platform: probe deferral - wait for supplier > >>>>>>>> scpi-power-domains > >>>>>>>> 7ff50000.hdlcd platform: probe deferral - wait for supplier scpi-clk > >>>>>>>> 7ff60000.hdlcd platform: probe deferral - wait for supplier scpi-clk > >>>>>>>> 1c060000.kmi amba: probe deferral - supplier > >>>>>>>> bus@8000000:motherboard-bus not ready > >>>>>>>> 1c070000.kmi amba: probe deferral - supplier > >>>>>>>> bus@8000000:motherboard-bus not ready > >>>>>>>> 1c170000.rtc amba: probe deferral - supplier > >>>>>>>> bus@8000000:motherboard-bus not ready > >>>>>>>> 1c0f0000.wdt amba: probe deferral - supplier > >>>>>>>> bus@8000000:motherboard-bus not ready > >>>>>>>> gpio-keys > >>>>>>>> Kernel panic - not syncing: VFS: Unable to mount root fs on > >>>>>>>> unknown-block(0,0) > >>>>>>>> > >>>>>>>> I don't see the 'bus@8000000:motherboard-bus' on the deferred devices > >>>>>>>> list, so it looks that device core added a link to something that is not > >>>>>>>> a platform device... > >>>>>> Probe deferred devices (even platform devices) not showing up in that > >>>>>> list is not unusual. That's because devices end up on that list only > >>>>>> after a driver for them is matched and then it fails. > >>>>>> > >>>>>>> Lemme guess: bus@8000000 is a simple bus, but it has an > >>>>>>> interrupt-map, and the devlink code doesn't follow the mapping? > >>>>>>> > >>>>>> No, what's happening is that (and this is something I just learned) > >>>>>> that if a parent has an "#interrupt-cells" property, it becomes your > >>>>>> interrupt parent. In this case, the motherboard-bus (still a platform > >>>>>> device) is the parent, but it never probes (because it's simple-bus > >>>>>> and "arm,vexpress,v2p-p1"). But it becomes the interrupt parent. And > >>>>>> this mmci device is marked as a consumer of this bus (while still a > >>>>>> grand-child). Yeah, I'm working on patches (multiple rewrites) to take > >>>>>> care of cases like this. > >>>>> One more reason to scrap the different handling of "simple-bus" and > >>>>> "simple-pm-bus", and use drivers/bus/simple-pm-bus.c, which is a > >>>>> platform device driver, for both? (like I originally intended ;-) > >>>> I'm not sure if this will cause more issues since people are used to > >>>> simple-bus not needing a driver. I'm afraid to open that pandora's > >>>> box. Maybe last resort if I don't have any other options. > >>>> > >>>> But keeping that aside, I'm confused how interrupts are even working > >>>> if the parent is a DT node with no driver (let alone a device). Any > >>>> ideas on what's going on or what I'm misunderstanding? > >>> No driver is needed, as the interrupts are just translated by the map, > >>> and passed to another interrupt controller, which does have a driver. > >>> > >>> Cfr. Section 2.4.3 "Interrupt Nexus Properties" in the DeviceTree > >>> Specification (https://protect2.fireeye.com/v1/url?k=72fff987-2d64c09f-72fe72c8-0cc47a314e9a-fd7dac11a78508f3&q=1&e=c0dbf5ca-130b-4aac-a011-447e82ca1914&u=https%3A%2F%2Fwww.devicetree.org%2F). > >>> > >> Yeah, I need to add interrupt-map support. Sigh. Only so many things I > >> can fix at a time. Let me know if you want to help. > >> > > Marek, > > > > After reading the DT spec and poking at the code, I THINK this code is > > correct. Can you give it a shot? If it works, then I can clean it up, > > roll in interrupts-extended and send a patch. > > Yep, this fixes this issue. Fell free to add: > > Reported-by: Marek Szyprowski > > Tested-by: Marek Szyprowski > Thanks! I'll send out the proper patch. -Saravana