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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41FDEC001DC for ; Fri, 7 Jul 2023 11:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HPfyiIboJ0/MQa7vN4x/XrWo2/MwDynB2gVK2fM22jM=; b=rxuR475vnHCGec YK1Boa1jTBMeRRGmxY0R/FF3mJ4GXZinO7FILFEA/OCgY0PcK4R+AQOvcsWOJbBvElFAwCmW/Uxou MEGFXckDaGRlGtDJJpqaaj+uUuDOhBWliTDqZLGEhf7ZE8naAIpBRCOxhgNNGHZ47SNlQr5M9Kknj BlRCh4YIjlrF9MCgveclDDdvddyTqjmccWtdgOjLDyxCRH1IzizLBej7FtXkA3vNP40USGP/ePeKI OctBT6l67qxrjKf+3kgEKttWzHW+/ewbUB5ggz3Jc/OC97aoFLT7N8J44pBbmuVOqhF/CM3+I3Xso naPMqsMnN9sB7SOoUyPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHja2-004VMX-2d; Fri, 07 Jul 2023 11:24:54 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHjZz-004VKo-0S; Fri, 07 Jul 2023 11:24:52 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2404561719; Fri, 7 Jul 2023 11:24:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5956EC433C7; Fri, 7 Jul 2023 11:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1688729088; bh=LOgGo2S8J0W/3urW+Ti0fTdtCUZF8vgQbegkxehA2Nw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V6pm8aS+Hqo30H+UfcDWPK9FUel6+CEaeLnbsqjg5FNFn7kS9vpsV/yUffNtNtN4r eYj8wPa9jFaESU9qYfLPXkEq1P+y26NKM033eo6Tum/YGx4QnFqAodrRTvrUgwxjd+ Hb0ygjCLtz/yNG4DLd9KU6K45+rum5O927EybD2I= Date: Fri, 7 Jul 2023 11:37:39 +0100 From: Greg KH To: Gatien Chevallier Cc: Oleksii_Moisieiev@epam.com, herbert@gondor.apana.org.au, davem@davemloft.net, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, alexandre.torgue@foss.st.com, vkoul@kernel.org, jic23@kernel.org, olivier.moysan@foss.st.com, arnaud.pouliquen@foss.st.com, mchehab@kernel.org, fabrice.gasnier@foss.st.com, andi.shyti@kernel.org, ulf.hansson@linaro.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, hugues.fruchet@foss.st.com, lee@kernel.org, will@kernel.org, catalin.marinas@arm.com, arnd@kernel.org, richardcochran@gmail.com, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, alsa-devel@alsa-project.org, linux-media@vger.kernel.org, linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-phy@lists.infradead.org, linux-serial@vger.kernel.org, linux-spi@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 05/10] firewall: introduce stm32_firewall framework Message-ID: <2023070748-false-enroll-e5dc@gregkh> References: <20230705172759.1610753-1-gatien.chevallier@foss.st.com> <20230705172759.1610753-6-gatien.chevallier@foss.st.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230705172759.1610753-6-gatien.chevallier@foss.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230707_042451_289058_240C3C62 X-CRM114-Status: GOOD ( 24.26 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Wed, Jul 05, 2023 at 07:27:54PM +0200, Gatien Chevallier wrote: > Introduce a firewall framework that offers to firewall consumers different > firewall services such as the ability to check their access rights against > their firewall controller(s). > > The firewall framework offers a generic API that is defined in firewall > controllers drivers to best fit the specificity of each firewall. But you aren't defining a "generic" api here, you are defining a specific one for your specific hardware. Or am I missing something? > > There are various types of firewalls: > -Peripheral firewalls that filter accesses to peripherals > -Memory firewalls that filter accesses to memories or memory regions > -Resource firewalls that filter accesses to internal resources such as > reset and clock controllers > > A firewall controller must be probed at arch_initcall level and register > to the framework so that consumers can use their services. Why must it happen at arch_initcall? So it can never be a module? That feels wrong. > > Signed-off-by: Gatien Chevallier > --- > MAINTAINERS | 5 + > arch/arm64/Kconfig.platforms | 1 + > drivers/bus/Kconfig | 10 + > drivers/bus/Makefile | 1 + > drivers/bus/stm32_firewall.c | 252 ++++++++++++++++++++++ > drivers/bus/stm32_firewall.h | 83 +++++++ > include/linux/bus/stm32_firewall_device.h | 134 ++++++++++++ > 7 files changed, 486 insertions(+) > create mode 100644 drivers/bus/stm32_firewall.c > create mode 100644 drivers/bus/stm32_firewall.h > create mode 100644 include/linux/bus/stm32_firewall_device.h > > diff --git a/MAINTAINERS b/MAINTAINERS > index 41385f01fa98..fabf95ba9b86 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -20123,6 +20123,11 @@ T: git git://linuxtv.org/media_tree.git > F: Documentation/devicetree/bindings/media/i2c/st,st-mipid02.yaml > F: drivers/media/i2c/st-mipid02.c > > +ST STM32 FIREWALL > +M: Gatien Chevallier > +S: Maintained > +F: drivers/bus/stm32_firewall.c > + > ST STM32 I2C/SMBUS DRIVER > M: Pierre-Yves MORDRET > M: Alain Volmat > diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms > index 6069120199bb..5a46e90f1e4e 100644 > --- a/arch/arm64/Kconfig.platforms > +++ b/arch/arm64/Kconfig.platforms > @@ -293,6 +293,7 @@ config ARCH_STM32 > select ARM_SMC_MBOX > select ARM_SCMI_PROTOCOL > select COMMON_CLK_SCMI > + select STM32_FIREWALL > help > This enables support for ARMv8 based STMicroelectronics > STM32 family, including: > diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig > index fcfa280df98a..4d54a7ea52b2 100644 > --- a/drivers/bus/Kconfig > +++ b/drivers/bus/Kconfig > @@ -163,6 +163,16 @@ config QCOM_SSC_BLOCK_BUS > i2c/spi/uart controllers, a hexagon core, and a clock controller > which provides clocks for the above. > > +config STM32_FIREWALL > + bool "STM32 Firewall framework" > + depends on ARCH_STM32 Why this dependency? > + default MACH_STM32MP157 || MACH_STM32MP13 || MACH_STM32MP25 > + help > + Say y to enable firewall framework and its services. Firewall > + controllers will be able to register to the framework. Firewall > + controllers must be initialized and register to the firewall framework > + at arch_initcall level. This needs better wording saying it is only for stm32 devices. > + > config SUN50I_DE2_BUS > bool "Allwinner A64 DE2 Bus Driver" > default ARM64 > diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile > index d90eed189a65..fc0511450ec2 100644 > --- a/drivers/bus/Makefile > +++ b/drivers/bus/Makefile > @@ -26,6 +26,7 @@ obj-$(CONFIG_OMAP_INTERCONNECT) += omap_l3_smx.o omap_l3_noc.o > obj-$(CONFIG_OMAP_OCP2SCP) += omap-ocp2scp.o > obj-$(CONFIG_QCOM_EBI2) += qcom-ebi2.o > obj-$(CONFIG_QCOM_SSC_BLOCK_BUS) += qcom-ssc-block-bus.o > +obj-$(CONFIG_STM32_FIREWALL) += stm32_firewall.o > obj-$(CONFIG_SUN50I_DE2_BUS) += sun50i-de2.o > obj-$(CONFIG_SUNXI_RSB) += sunxi-rsb.o > obj-$(CONFIG_OF) += simple-pm-bus.o > diff --git a/drivers/bus/stm32_firewall.c b/drivers/bus/stm32_firewall.c > new file mode 100644 > index 000000000000..510db5bc6eaf > --- /dev/null > +++ b/drivers/bus/stm32_firewall.c > @@ -0,0 +1,252 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later Are you _SURE_ this needs to be "or later"? Sorry, I have to ask. thanks, greg k-h -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy