Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1021249pxp; Wed, 9 Mar 2022 18:52:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaqAfNb7HolAGAgXtUa+JCPngItMdKnTXAHPvO4UZWLRJmCD1P6fuFfY+GqbBaHML7dbJK X-Received: by 2002:aa7:c793:0:b0:408:4a69:90b4 with SMTP id n19-20020aa7c793000000b004084a6990b4mr2300464eds.58.1646880778639; Wed, 09 Mar 2022 18:52:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646880778; cv=none; d=google.com; s=arc-20160816; b=meZHkQhdA83nkHQpNWuo8Q7/qMzgS5ZRtAi98Ekx0twiR5RD/pjJOP6ceMgSD9s7/j cZ2EQ3xvCP77D9xv7ISWxi8YuiMnoKI2RtCTsel7J81CEJmq4/gi2n9GQfwc7LX2JZEX UqjfwBi3/GEdN75Wy9aSUjNlrv5OUAhbovWbHCPXT9bSgQ/WhaE9Cuu70JJnHWVKurIo weI07KkoDEbmbKRsATe703IGa+vD45bGS89gFVPiUNNbRE+61YC/yw6lcEsGQXKoP1/U yeKkJQi73WScvNgyf9GuXgz1TSICNyGgK27IiAD23Z2zIoA9miJVpxm4z4dsDEFV8ISQ oFRQ== 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=SHLpaCDabk6UVYQs8CpJ48dsCLpU1oWOF4RtdySvC5Q=; b=wmFrgi5ozDCOUd2v2AzmDK2G1Eq08AkxTmYqo70dKBUIE7032rby995nKoyB8LJVG4 1Fe//1POSr8FGdW1VnWIS7k7DNVgWSGeqyv8Txodx8+Z3tys2B/kLH9ZcY34c2I1DILf ZCwJxLe2QMjaeLIdOcv/KMpaH4uFi2yPpcw3CY+MKD6I7kspaM5TUYVq3vjcX/lq+Gvp vsN/8AzCNwf6ijrcajsJWLHGi7CzrUYbW++c5R2steIZCiwFhqz4ZZfmRbW2k95Jp4iJ wqtWrW5CXE5NtQKCVNw2tjFUSVW7E+PC9tpvWgCeYwdS30k8jCOxNZHgIt+FkUattrQ3 F/hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="pFmS/RzS"; 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 r14-20020aa7d14e000000b004163083090asi2223075edo.379.2022.03.09.18.52.36; Wed, 09 Mar 2022 18:52:58 -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="pFmS/RzS"; 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 S237928AbiCIVK5 (ORCPT + 99 others); Wed, 9 Mar 2022 16:10:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233585AbiCIVKx (ORCPT ); Wed, 9 Mar 2022 16:10:53 -0500 Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAFEB2BB38; Wed, 9 Mar 2022 13:09:53 -0800 (PST) Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-2dbc48104beso37582987b3.5; Wed, 09 Mar 2022 13:09:53 -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=SHLpaCDabk6UVYQs8CpJ48dsCLpU1oWOF4RtdySvC5Q=; b=pFmS/RzST3I09Hy16iYpLdQMT/xbrr+WbU8JftfckdHtYSZVA46yxhvOzSwu7uDhYX Z9XDLUAIckIL81UHQz/RqmR0dGCWSSzHRRmmTbcE8ec7cCLMpMS8EyEqQHh40N1EK4AT 7jtXhp+cBvwC3KHfxBK+GvAgDmVcTPOYRPGp+e3K9r52vFNGMcz+MWbTBLufabvuMFii a4ZtIbVZf/0rotQkVX3fKvIoVvKIeV5wiSqZyHS1VwOcawkEqMwUUdnIMsv4B1J9HL9P wfzoFTS1wC5ts34SGFkNTgDX1IRIFL665UQkAuxIW5Q2pr1V+oG5ZrP70kDDUgbrSPTP P6eQ== 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=SHLpaCDabk6UVYQs8CpJ48dsCLpU1oWOF4RtdySvC5Q=; b=gAEe8aOcGqsN0vf1Xr2qc7e7QFk2moC03rVCWijWiQAcuI9+DN05/cUwru4mGG7c05 Cgaal4ZUxJWv8wmN5HwAQTpcYVXJv5RP6f5nXv6a+Acf3uCGIEQ8TXf0rgToOicIa7bz YXxg6ki9RxqQiTZkdmpJ8NjMGg0UWopZiUOZiwIkmcQaqPleOlTnCY6sYIPEwAxtaWbD cHZqTcnu6bS0lJmeZTgypZeoNxlSW8CCXbzQY7QGDJGXqo4AlgR0t3lwhM9soNoGMhyM DxF2CNt40ktgvcb8qQa3lm98qtFakxxzpp7nGvUoJ+tRo0ar6Z/jwMoBXelzThVoMcXL NQpQ== X-Gm-Message-State: AOAM533GTU2WIQujQRiQAK3RpOhUejD65VaLPylHqEvqvxqVn9L1sPu3 GFTLzhRo+BlKj/nUQAo8UHeLAGi9Abf91hvvKR8= X-Received: by 2002:a0d:d80a:0:b0:2dc:1f1d:878d with SMTP id a10-20020a0dd80a000000b002dc1f1d878dmr1503559ywe.16.1646860192963; Wed, 09 Mar 2022 13:09:52 -0800 (PST) MIME-Version: 1.0 References: <20211209001056.29774-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <875yry1316.wl-maz@kernel.org> In-Reply-To: <875yry1316.wl-maz@kernel.org> From: "Lad, Prabhakar" Date: Wed, 9 Mar 2022 21:09:27 +0000 Message-ID: Subject: Re: [RFC PATCH] of: platform: Skip mapping of interrupts in of_device_alloc() To: Marc Zyngier Cc: Lad Prabhakar , Rob Herring , Frank Rowand , Thomas Gleixner , Geert Uytterhoeven , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Linux-Renesas , Biju Das 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 Marc, On Thu, Dec 9, 2021 at 10:33 AM Marc Zyngier wrote: > > On Thu, 09 Dec 2021 10:00:44 +0000, > "Lad, Prabhakar" wrote: > > > > > The root of the issue is that all the resource allocation is done > > > upfront, way before we even have a driver that could potentially > > > deal with this device. This is a potential waste of resource, and > > > it triggers the issue you noticed. > > > > > > If you delay the resource allocation until there is an actual > > > match with a driver, you could have a per-driver flag telling you > > > whether the IRQ allocation should be performed before the probe() > > > function is called. > > > > > As suggested by Rob, if we switch the drivers to use > > platform_get_resource(pdev, IORESOURCE_IRQ, n) call with > > platform_get_irq() this code should go away and with this switch the > > resource allocation will happen demand. Is this approach OK? > > If you get rid of of_irq_to_resource_table() altogether, then yes, > this has a fighting chance to work. > To clarify, did you mean to get rid of_irq_to_resource_table() completely or just from the drivers/of/platform.c ([0])? [0] https://elixir.bootlin.com/linux/latest/source/drivers/of/platform.c#L143 Cheers, Prabhakar