Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C004C433F5 for ; Thu, 9 Dec 2021 10:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234407AbhLIKgt (ORCPT ); Thu, 9 Dec 2021 05:36:49 -0500 Received: from sin.source.kernel.org ([145.40.73.55]:53094 "EHLO sin.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbhLIKgs (ORCPT ); Thu, 9 Dec 2021 05:36:48 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 1FF18CE255B; Thu, 9 Dec 2021 10:33:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 172E6C341C6; Thu, 9 Dec 2021 10:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639045992; bh=cCjdkQQEAw3IgfatSfUxzwtJJai/1rs90YbSLTa/0Gk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=elx2XscFlwhwzK04VGG1r3ze4mi4mgGJ7fp1C+Z5TBPyGLO04WpHT4S8h77/U3kUf HDEMFyvK2FvPOIl8B1X5WjN/AfSAZlJv12I8e3v/hqLAom4Q+KChiemhOqkCIwqa/g zpwqEdjefUqGSBgFldhcHc67cst8Id+12jGZfW1/vD77haH6fkUqFM1X2x09F22gcP 7kmGXquahtrPLTBFpWklMRflgN+r5RnHM9Pee53KVKdObbnpqSWm97EtJ91MRg0k6t l+BOJJ3UAxmT7iiGpLCPXDWKRJ99YH3sn0cZZb1Z+eOdzAcSJCKIJbP/p9NY4fpcjq eTGNA8HZZfLFA== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mvGjd-00Azp7-TW; Thu, 09 Dec 2021 10:33:10 +0000 Date: Thu, 09 Dec 2021 10:33:09 +0000 Message-ID: <875yry1316.wl-maz@kernel.org> From: Marc Zyngier To: "Lad, Prabhakar" 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 Subject: Re: [RFC PATCH] of: platform: Skip mapping of interrupts in of_device_alloc() In-Reply-To: References: <20211209001056.29774-1-prabhakar.mahadev-lad.rj@bp.renesas.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: prabhakar.csengg@gmail.com, prabhakar.mahadev-lad.rj@bp.renesas.com, robh+dt@kernel.org, frowand.list@gmail.com, tglx@linutronix.de, geert+renesas@glider.be, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, biju.das.jz@bp.renesas.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. M. -- Without deviation from the norm, progress is not possible.