From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D46F2C433E2 for ; Sat, 12 Sep 2020 12:53:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F7462220A for ; Sat, 12 Sep 2020 12:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599915195; bh=E+BZblSWsWqcokwAv8F7Mg2fMTtKC3laJsPFzStMtz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IvdVQ8UCHUGQXEVw19zhMYfWC8jLaQG765RtjhC2YshVzwx/yBITKHPHZxN50NnHa vNINFLUPLWqMbBQ8IxfsL/+DTbmG7zQ6jQWbPqFJYV4atlnb2SxeJDXdCBCs7tk+uW F0v/iRNaM0ZRKq0Nv7XrgJjQ69w/itZeKSf8I2qw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725961AbgILMxM (ORCPT ); Sat, 12 Sep 2020 08:53:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:46352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbgILMwJ (ORCPT ); Sat, 12 Sep 2020 08:52:09 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 067DE21D6C; Sat, 12 Sep 2020 12:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599915128; bh=E+BZblSWsWqcokwAv8F7Mg2fMTtKC3laJsPFzStMtz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j06z+5fH97R+cPudPyUlkXMHqb931PSbU8oTUd0LggdbAhadFOT12DEcKMimHmYiM tGfKYNCITlub6x82vkzUK61HiX4lhFcCuhkHoRDcR+JdAUpsjI6uTAaVpuFwchmp+C M8DYjp3sTCxsxpoQu0txm8HIYNFY2bTd/WR7x1LA= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kH50g-00BEw6-HQ; Sat, 12 Sep 2020 13:52:06 +0100 From: Marc Zyngier To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Enric Balletbo i Serra , Frank Wunderlich , John Stultz , Saravana Kannan , Hanks Chen , Andy Gross , Bjorn Andersson , Matthias Brugger , Thomas Gleixner , Jason Cooper , Rob Herring , Frank Rowand , kernel-team@android.com Subject: [PATCH 3/6] irqchip: Introduce IRQCHIP_HYBRID_DRIVER_{BEGIN,END} macros Date: Sat, 12 Sep 2020 13:51:45 +0100 Message-Id: <20200912125148.1271481-4-maz@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200912125148.1271481-1-maz@kernel.org> References: <20200912125148.1271481-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, enric.balletbo@collabora.com, linux@fw-web.de, john.stultz@linaro.org, saravanak@google.com, hanks.chen@mediatek.com, agross@kernel.org, bjorn.andersson@linaro.org, matthias.bgg@gmail.com, tglx@linutronix.de, jason@lakedaemon.net, robh+dt@kernel.org, frowand.list@gmail.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Although we are trying to move to a world where a large number of irqchip drivers can safely be built as platform drivers the reality is that most endpoint drivers are not ready for that, and will fail to probe as they expect their interrupt controller to be up and running. A halfway house solution is to let the driver indicate that if it is built-in (i.e. not a module), then it must use the earily probe mechanism, IRQCHIP_DECLARE() style. Otherwise, it is a normal module implemenenting a platform driver, and we can fallback to the existing code. Hopefully we'll one day be able to drop this code altogether, but that's not for tomorrow. Signed-off-by: Marc Zyngier --- include/linux/irqchip.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h index f8f25e9f8200..31fc9d00101f 100644 --- a/include/linux/irqchip.h +++ b/include/linux/irqchip.h @@ -50,6 +50,18 @@ static struct platform_driver drv_name##_driver = { \ }; \ builtin_platform_driver(drv_name##_driver) +#ifdef MODULE +#define IRQCHIP_HYBRID_DRIVER_BEGIN(drv) \ + IRQCHIP_PLATFORM_DRIVER_BEGIN(drv) +#define IRQCHIP_HYBRID_DRIVER_END(drv) \ + IRQCHIP_PLATFORM_DRIVER_END(drv) +#else +#define IRQCHIP_HYBRID_DRIVER_BEGIN(drv) \ + _OF_DECLARE_ARRAY_START(irqchip, drv) +#define IRQCHIP_HYBRID_DRIVER_END(drv) \ + _OF_DECLARE_ARRAY_END; +#endif + /* * This macro must be used by the different irqchip drivers to declare * the association between their version and their initialization function. -- 2.28.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60855C2D0F6 for ; Sat, 12 Sep 2020 12:53:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A440208E4 for ; Sat, 12 Sep 2020 12:53:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ufI0b3El"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="j06z+5fH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A440208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=StOg2JIusUsqTNXTjum40vX/ELwOWIBF8yuQEkZSuxg=; b=ufI0b3ElpI2ARsABm4yKo38+b BZTxMRKUKxg/9iHDO3Di7ZMi8bqXAR/p7B4L7YIwSup9DIFWBxZeF/2Sh54+DKgf4tWd3SgjMyzk1 GW7HMx0HhGrXn3DAdYxHpaM1FabkdPVOVhQdbT+Z5eu41PAbxd6NryCZvrxloSCuuocwXDp4SFwzG tA8VSsoAUX84VHunFF/0UE+ZhaGPT19oo3CS6FjsMd0Av4K+aP2sy2bv1BUNhvv3vqeGb4lUNLS/F TuL8D2z02qZwVWHxiNHMVrpJ1/6d4t8TUhA7N6ZkwHHgno7m6pxDDwzWgQaemZMZiypPhuu/xiZvg ErHrOmlbw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kH50t-0004pD-B3; Sat, 12 Sep 2020 12:52:19 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kH50i-0004mP-Vj for linux-arm-kernel@lists.infradead.org; Sat, 12 Sep 2020 12:52:11 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 067DE21D6C; Sat, 12 Sep 2020 12:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599915128; bh=E+BZblSWsWqcokwAv8F7Mg2fMTtKC3laJsPFzStMtz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j06z+5fH97R+cPudPyUlkXMHqb931PSbU8oTUd0LggdbAhadFOT12DEcKMimHmYiM tGfKYNCITlub6x82vkzUK61HiX4lhFcCuhkHoRDcR+JdAUpsjI6uTAaVpuFwchmp+C M8DYjp3sTCxsxpoQu0txm8HIYNFY2bTd/WR7x1LA= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kH50g-00BEw6-HQ; Sat, 12 Sep 2020 13:52:06 +0100 From: Marc Zyngier To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/6] irqchip: Introduce IRQCHIP_HYBRID_DRIVER_{BEGIN, END} macros Date: Sat, 12 Sep 2020 13:51:45 +0100 Message-Id: <20200912125148.1271481-4-maz@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200912125148.1271481-1-maz@kernel.org> References: <20200912125148.1271481-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, enric.balletbo@collabora.com, linux@fw-web.de, john.stultz@linaro.org, saravanak@google.com, hanks.chen@mediatek.com, agross@kernel.org, bjorn.andersson@linaro.org, matthias.bgg@gmail.com, tglx@linutronix.de, jason@lakedaemon.net, robh+dt@kernel.org, frowand.list@gmail.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200912_085209_200097_258B128E X-CRM114-Status: GOOD ( 14.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Cooper , Saravana Kannan , kernel-team@android.com, Hanks Chen , Rob Herring , Bjorn Andersson , Matthias Brugger , Andy Gross , John Stultz , Enric Balletbo i Serra , Frank Wunderlich , Frank Rowand , Thomas Gleixner Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Although we are trying to move to a world where a large number of irqchip drivers can safely be built as platform drivers the reality is that most endpoint drivers are not ready for that, and will fail to probe as they expect their interrupt controller to be up and running. A halfway house solution is to let the driver indicate that if it is built-in (i.e. not a module), then it must use the earily probe mechanism, IRQCHIP_DECLARE() style. Otherwise, it is a normal module implemenenting a platform driver, and we can fallback to the existing code. Hopefully we'll one day be able to drop this code altogether, but that's not for tomorrow. Signed-off-by: Marc Zyngier --- include/linux/irqchip.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h index f8f25e9f8200..31fc9d00101f 100644 --- a/include/linux/irqchip.h +++ b/include/linux/irqchip.h @@ -50,6 +50,18 @@ static struct platform_driver drv_name##_driver = { \ }; \ builtin_platform_driver(drv_name##_driver) +#ifdef MODULE +#define IRQCHIP_HYBRID_DRIVER_BEGIN(drv) \ + IRQCHIP_PLATFORM_DRIVER_BEGIN(drv) +#define IRQCHIP_HYBRID_DRIVER_END(drv) \ + IRQCHIP_PLATFORM_DRIVER_END(drv) +#else +#define IRQCHIP_HYBRID_DRIVER_BEGIN(drv) \ + _OF_DECLARE_ARRAY_START(irqchip, drv) +#define IRQCHIP_HYBRID_DRIVER_END(drv) \ + _OF_DECLARE_ARRAY_END; +#endif + /* * This macro must be used by the different irqchip drivers to declare * the association between their version and their initialization function. -- 2.28.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel