Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3813677pxb; Mon, 8 Feb 2021 00:18:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6d25e6cyiyBs4UmjAp+8Q13TqF+og/VWQYFEa8poL+DQ6j7q2BlXEqdASjKSekrDIsqHt X-Received: by 2002:a50:aac8:: with SMTP id r8mr15710083edc.9.1612772295528; Mon, 08 Feb 2021 00:18:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612772295; cv=none; d=google.com; s=arc-20160816; b=gXF4lPUX5+6vgJNlaNPsfWqkvM1yzm3OLPWGod/fpXfOY9EaH0vAV9omEcTVQAgrTa X7GCEMf1p2lZ6VuigHXLWtaKdo6XxUfwyF3S0KPho69HuoG0bLZFzlrMcFN2pGZZDRfu sWIgmAbDKP7qKGYQxyPoW9eMQ7fX890wC9NAif2Ge32Ry5EdXIlj6Hg1ogkDeouRcZNe Rehm5dZzp4AX6pcPPA27fIUJ32eUVvroY2admxLZR0oL9U8YpLFQ7Snyq3G92FdRzHb4 m6zyx97ZHcfffe3CbvbIuEDt0e2EA5V0ZjW1Qn+KKqi96/uiuIX1J0hoc59PRdsYmf2X ESjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=XgoPUqQXgR0uYujgzVQ4yQ/U/qDYhHI0TbM+ugNU6og=; b=nOmX5ivMqSAtjbc/+J7JHTAPwwzd7YCo2beC30yXBDqd9p23aXEevKknbIs1Y+VXdx y8M/fvbcU9Rvb/6+tOW6Ln1xzNEw1SL9QwvyR+nUPPlgyvnwN+tJbK0iACznyKiO97Ed pOqDn0GwoTNQprZIh5zdUQis1sVZEW8qSZo7UZz5KD1d02lZcj+RtuhFp+1I2pqv8dl/ vXJlfDptVltjK+z5hIuz1Uga1cjNZLTo7T6odBT0RdmWb0RdYSAn6s7r84koeGwasTo2 nHSOymHe2L9nNMal39UhrJ8Yz4W/SyO774pCxOWYpkfmMFeyrXenCtNio5mUGkKF68/e 6jYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="OzzLkcs/"; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si1226117edt.210.2021.02.08.00.17.51; Mon, 08 Feb 2021 00:18:15 -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=@samsung.com header.s=mail20170921 header.b="OzzLkcs/"; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbhBHIO6 (ORCPT + 99 others); Mon, 8 Feb 2021 03:14:58 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:40348 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbhBHIO5 (ORCPT ); Mon, 8 Feb 2021 03:14:57 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20210208081413euoutp0145ed9265f4af0ec867675cdea51d41db~ht6NNAO5t3255432554euoutp01v for ; Mon, 8 Feb 2021 08:14:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20210208081413euoutp0145ed9265f4af0ec867675cdea51d41db~ht6NNAO5t3255432554euoutp01v DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1612772053; bh=XgoPUqQXgR0uYujgzVQ4yQ/U/qDYhHI0TbM+ugNU6og=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=OzzLkcs/IdRX17wY/XydK2V91YN/VFT51mn4rzj4ePubUY05+l60OcVdkzEtNWvjf r1GUw7sxEkJEYd1TUKj0oo6RTkua8DUwnrooFlyhcElV4ETkEmOvoqd/gQ/ChKPfy/ YhUFQLPsAb35PDO3wvVKoqttM0yXxjVzcL8DLbBA= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20210208081413eucas1p13e4010ae8aeacf8394fb77905b0075cb~ht6M52llf0792107921eucas1p1N; Mon, 8 Feb 2021 08:14:13 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 07.95.45488.5D2F0206; Mon, 8 Feb 2021 08:14:13 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20210208081412eucas1p2fcc78bf5251226982548f91fea96525c~ht6MVMFMU1388813888eucas1p2s; Mon, 8 Feb 2021 08:14:12 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210208081412eusmtrp2d5da6c62a297720b2341d751ed598796~ht6MUVd1H2144921449eusmtrp2W; Mon, 8 Feb 2021 08:14:12 +0000 (GMT) X-AuditID: cbfec7f5-c5fff7000000b1b0-27-6020f2d5d8bb Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 25.41.21957.4D2F0206; Mon, 8 Feb 2021 08:14:12 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210208081411eusmtip2235ad5fecb5390ced0f44ad7da32e1a0~ht6Ldg4912126721267eusmtip2Q; Mon, 8 Feb 2021 08:14:11 +0000 (GMT) Subject: Re: [PATCH v2 2/2] of: property: Add fw_devlink support for interrupts To: Saravana Kannan , Geert Uytterhoeven Cc: 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 From: Marek Szyprowski Message-ID: Date: Mon, 8 Feb 2021 09:14:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMKsWRmVeSWpSXmKPExsWy7djPc7pXPykkGKzpZrf4MvcUi8X8I+dY LWa++c9m8ezWXiaL5sXr2SxaZi1isdixXcTiZ/sWJospf5YzWVzeNYfNovPLLDaLnXNOslq0 7j3CbvF/zw52i65Df9ksbv/mcxDw2LZ7G6vH+xut7B47Z91l91iwqdRj06pONo871/aweRw6 3MHosX/uGnaP3uZ3bB6fN8kFcEVx2aSk5mSWpRbp2yVwZVyftJGt4LtVxd3FqxkbGC8bdDFy ckgImEjMmbuAtYuRi0NIYAWjxNzrr5ghnC+MEp+A7oZwPjNKdL4CyUC0HLvRxA6RWM4ocfzI G6j+j4wS018tZwWpEhYIlOhqPQTWISIQLrF5y2SwucwCb1gkvk6bxAaSYBMwlOh62wVm8wrY Sdzpe8oCYrMIqEhsPjsNLC4qkCSx/OYfJogaQYmTM5+A1XACLbi59ArYAmYBeYntb+dA2eIS t57MZwJZJiGwm1Ni1vXf7BB3u0gs//aIEcIWlnh1fAtUXEbi/06YhmZGiYf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3s9WJGwQKBEV+shZhBbRCBcomXHDxaQImaB DywSzZ+nMkF0PGaT2NH2DKyDTcBQouttF5jNK2AncafvKQuIzSKgIrH57DSwuKhAksTjW/eZ IGoEJU7OfAJWwwm07ebSK2DbmAXMJOZtfghly0tsfzsHyhaXuPVkPtMERqFZSNpnIWmZhaRl FpKWBYwsqxhFUkuLc9Nziw31ihNzi0vz0vWS83M3MQLjf9uxn5t3MM579VHvECMTB+MhRgkO ZiUR3sBOuQQh3pTEyqrUovz4otKc1OJDjKZA/0xklhJNzgcmoLySeEMzA1NDEzNLA1NLM2Ml cd6tc9fECwmkJ5akZqemFqQWwfQxcXBKNTDphnwMDl45c4W2xzYJoVu+BcyzDnz2YVdJmHjx of/lnkr1mecq3u8VOSVfrvur5mxf0mzOS9xpp2edNWO8wOH6/tR9b6bEWNUALvNl7ApPf70x TbfTf1vXtfJrW42s9Fourh9R+0+9fSrY/Ohkn5pFUiXX2pe9va3ONTIvDucxNDmrJE/brTfN pPTyhUPPc3Zk8C700/pU+KO+dENC8ALV/Zv9U/e7f+wW/9J6Qye0aA77qtMR7yRqhFZNj/KX cP59YlZ93QzjDaZ7dZfOd/1zX+pB6Id9xk/YQoxOrZvebxjx89QNjXzZthuTl7O9LTRuPuxy I3nerPRfJhHcV0Wa/icavZxv+GEOz64ftv+VWIozEg21mIuKEwGl043kiAMAAA== X-CMS-MailID: 20210208081412eucas1p2fcc78bf5251226982548f91fea96525c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20210204115252eucas1p2d145686f7a5dc7e7a04dddd0b0f2286c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210204115252eucas1p2d145686f7a5dc7e7a04dddd0b0f2286c 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > -Saravana > > --- a/drivers/of/property.c > +++ b/drivers/of/property.c > @@ -1300,10 +1300,12 @@ static struct device_node > *parse_gpio_compat(struct device_node *np, > static struct device_node *parse_interrupts(struct device_node *np, > const char *prop_name, int index) > { > - if (strcmp(prop_name, "interrupts") || index) > + struct of_phandle_args sup_args; > + if (strcmp(prop_name, "interrupts")) > return NULL; > > - return of_irq_find_parent(np); > + return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np; > } > Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland