Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp357655pxp; Wed, 9 Mar 2022 04:33:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNdyB5GqzoT9ExbsljshOdLH9VpgNbRrIAEVQ5/Rx3H1G3Z0IMfDmuGuAWSmk7zGF2ZVUg X-Received: by 2002:a17:906:b1da:b0:6d6:dd9a:3a9b with SMTP id bv26-20020a170906b1da00b006d6dd9a3a9bmr17524307ejb.766.1646829216001; Wed, 09 Mar 2022 04:33:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646829215; cv=none; d=google.com; s=arc-20160816; b=S6ZGNxrPFZfjabXqfecMGuRbGd1sgrJJY6gtqCdjYCtV8rizW8BkiGhe3RU0YqWWbF ZrBpGHUt24NrP8qTUG4KU5JD3zU9YnOjkwuUJzbObdCLFACcKlMUp55jG/Zkw1IpgIL8 GUo8wF/8t2qFg4W9a+chp+IVJJp+9Bly5N353pjw8xA+AjpeDh2XwkX4TIWXLYxe+GAZ r5+JTYaMMEjSSP20wP+IwM+p4/OFNFdzqlq6z4NKfwnCCcYAHYDCf5ZZpTr5d3qCO/7L 1wNza+3z8dgCHq1ez7GladxQU7gURzngeRCAcOoEcAUJufjBSEd9zsHi36/YcJfkcxrY l9/g== 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=vfNPAq/xUBFYXwIgl1HZDnGv0DGUDqF2s2A85pcqjZg=; b=thOeYI3SPelwPKGdbCZ92EU3c/7kVapgKgOPGyDkz0v3FgiTFIFsw4g2oJCfZyggpI YZR/JBvGsZ77ONx851BSW5arayqG4DroNkS+bXMnpcGnNPk3wVr1gv31hv0113+XW/P5 ewTXuz4ALar3nqqimuxWGnFB4K62lxUCvpRmwBmOiKmcPuk/kDJLoJNyr8HDTc5yAIJK AD+lQGMGX/8c4sqH6Gxwud4zJdUU63B27w951QByKClxhhAUSd1N2JmIadOBK6JcVOAK ld0AqD95w0HpxemVwQbbzr3Oz/jIzYU06Yj80XQWM5y1vVLS3KRU0Dc0zDekpZVwgRZq nhyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MnnhLtR5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb7-20020a170907160700b006dae9eee72fsi1162870ejc.738.2022.03.09.04.33.02; Wed, 09 Mar 2022 04:33:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MnnhLtR5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232546AbiCIMAv (ORCPT + 99 others); Wed, 9 Mar 2022 07:00:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231759AbiCIMAu (ORCPT ); Wed, 9 Mar 2022 07:00:50 -0500 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5164EF94E7; Wed, 9 Mar 2022 03:59:51 -0800 (PST) Received: by mail-yb1-xb29.google.com with SMTP id z30so3861215ybi.2; Wed, 09 Mar 2022 03:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vfNPAq/xUBFYXwIgl1HZDnGv0DGUDqF2s2A85pcqjZg=; b=MnnhLtR5FEJAHdHPjX7mN7njyVpCD396Qt47sfyw8J2MvN5JGwW+0wj4OTBSSlsANt Iq+BGRwtxLz4FfIpPFLuBEPy35/ftoUxB6lukMB0INyoDUT1LTsdidxHE4yS4K3ddE32 kdfRF/ePV78hxOI1UsVSewWkWZ8JscQQPEhWDkJ2E8zt3y04BKE9ubT8a6s3y2tuZu83 WCcVnsq2ERMEL0SeQlHK+Ui8WB6AlJ0BXvngqWRvTX04SOmW5TtwV+wjblrRYwthFfk+ c+FzbA3fDIZeUx2RVXea+ae/1TnbJfvOHVgj9eK+uuyhyEQ8JpqVamrmuEhaDGNynxj0 No9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vfNPAq/xUBFYXwIgl1HZDnGv0DGUDqF2s2A85pcqjZg=; b=KaIHLwk4RwEx7gdHPzGuFLfxByCOkyXEwXguq2bWpTX9EJSwK+nDwfzuqsjkNwlfzo EGK0UgtEdx0C+d0QoJHI1UVDsyoQz3pd9/7WgiVqGhVVPRnnOfJWZ7qrJXMbnFez32hE MZnADbyGu5WqvPactbOUeQbnkpjueQI3rH8MzKOjh6JgyxMwgjg5ls3vIxmsUxcx3Bdb bhnwwIelSa/ceyuqBL2C19/tzcvGTylSzpwJGnz6dorOUrX6tIWbvMiG3JkrzsXT3bQ4 p4N3o5KxBHw/yBpwgZZRK8da9XszyzJnrQSXHPSQR97j0cJ7/6AEkhhrR7oN89VfuOix ARmA== X-Gm-Message-State: AOAM532d2p/U0RGOI9EUObolonqbk+ScgahROA4R4QI4Rll2QHj3hO6U ZD0f9KqbYD/mknHj/nKWdw0NWZzz8huaoIoUetk= X-Received: by 2002:a25:d3cb:0:b0:629:182c:6c50 with SMTP id e194-20020a25d3cb000000b00629182c6c50mr16116332ybf.417.1646827190454; Wed, 09 Mar 2022 03:59:50 -0800 (PST) MIME-Version: 1.0 References: <20220110144039.5810-1-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: <20220110144039.5810-1-prabhakar.mahadev-lad.rj@bp.renesas.com> From: "Lad, Prabhakar" Date: Wed, 9 Mar 2022 11:59:24 +0000 Message-ID: Subject: Re: [PATCH v4] thermal: rcar_thermal: Use platform_get_irq_optional() to get the interrupt To: =?UTF-8?Q?Niklas_S=C3=B6derlund?= Cc: Lad Prabhakar , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Rob Herring , Andy Shevchenko , Linux-Renesas , Linux PM list , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Niklas, On Mon, Jan 10, 2022 at 2:40 PM Lad Prabhakar wrote: > > platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static > allocation of IRQ resources in DT core code, this causes an issue > when using hierarchical interrupt domains using "interrupts" property > in the node as this bypasses the hierarchical setup and messes up the > irq chaining. > > In preparation for removal of static setup of IRQ resource from DT core > code use platform_get_irq_optional(). > > Signed-off-by: Lad Prabhakar > --- > v3->v4: > * Updated check as suggested by Andy > > v2->v3: > * Fixed review comment pointed by Andy > > v1->v2 > * Simplified checking error code > * Break loop earlier if no interrupts are seen > > v1: https://lkml.org/lkml/2021/12/18/163 > --- > drivers/thermal/rcar_thermal.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > This patch is not in -next yet. In which release v5.18/19 do you plan to merge this in? Cheers, Prabhakar > diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c > index b49f04daaf47..1d729ed4d685 100644 > --- a/drivers/thermal/rcar_thermal.c > +++ b/drivers/thermal/rcar_thermal.c > @@ -445,7 +445,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) > struct rcar_thermal_common *common; > struct rcar_thermal_priv *priv; > struct device *dev = &pdev->dev; > - struct resource *res, *irq; > + struct resource *res; > const struct rcar_thermal_chip *chip = of_device_get_match_data(dev); > int mres = 0; > int i; > @@ -467,9 +467,16 @@ static int rcar_thermal_probe(struct platform_device *pdev) > pm_runtime_get_sync(dev); > > for (i = 0; i < chip->nirqs; i++) { > - irq = platform_get_resource(pdev, IORESOURCE_IRQ, i); > - if (!irq) > - continue; > + int irq; > + > + ret = platform_get_irq_optional(pdev, i); > + if (ret < 0 && ret != -ENXIO) > + goto error_unregister; > + if (ret > 0) > + irq = ret; > + else > + break; > + > if (!common->base) { > /* > * platform has IRQ support. > @@ -487,7 +494,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) > idle = 0; /* polling delay is not needed */ > } > > - ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, > + ret = devm_request_irq(dev, irq, rcar_thermal_irq, > IRQF_SHARED, dev_name(dev), common); > if (ret) { > dev_err(dev, "irq request failed\n "); > -- > 2.17.1 >