Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp619499ybl; Tue, 28 Jan 2020 08:59:46 -0800 (PST) X-Google-Smtp-Source: APXvYqyUOrP5HZr9k6jLRpNMzpADiltxK00gaSb93vEY5ddml4O09i2TxAXZ8svIb372pcIlpie5 X-Received: by 2002:a54:4f14:: with SMTP id e20mr3399738oiy.84.1580230785672; Tue, 28 Jan 2020 08:59:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580230785; cv=none; d=google.com; s=arc-20160816; b=bueu+Kca/WXBVR05T5fRRome2SoOExEF7r4q5UrHB6HUUk5TgfQ1B5FBIvB0eFtQja q3CuD/Z+9Djduxswp/O1GIl5804EbrMdLkFDWkq2i6VniQh1Bky+TZ/hA8liCIJxqQcd jzN4IbQzCGCgjHZFFQg2+Q8lsj2cBO9sCdtyqKKnqYCcNcuu1/jVLxAcMVqcuOyIybh0 ovHPk95LEOD4AXAoLew5lx+lEybx0Bz7/upmqD4Ly52OMdrPhZSsl7ZaRb8bXFUl7hYJ ZpkFXaND+52HXgMDYi6nz+c3oliVWsloVNV1FkBg42NdqQjAGzGyIQsB6CxYO6FqqX9m CufQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ORQjAv6XfxDbjqhLIRMaXocEHCzuK86f9/MnHHeflDc=; b=Ch4wcjp9TJiTOeCLYIKtnQlEWB2T2ZZfv6tmGiZeyWrlQODSq7mt6qjOTrDOXCBS6A 4yXWifgQ0qJjGwU/utd/ROSG2BJcJuobpNoBa3aARHYVywzwiGJ1z91maf8edUki5Vt8 bYroPf0v4y+lXAYY5QDh6AzRWhvxzxFCvh4Yc+c99UoZ5OXeT4xxaEIp4SBAQyLqHMoj 0qPS3AGMLkYwrm3HvR1kSbPSwoC9LiN4bHvdFMe6ITY9guRYO1Ewz8ko4o7Xz/KuaymL btXkIXWENR9cKxESDKb6YURGHiuT0ejYASBdnZMt2v8hb21ian5OM8T0HxiduDG/TqUC Uy7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fT54GEgu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j74si4502975otj.246.2020.01.28.08.59.32; Tue, 28 Jan 2020 08:59:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fT54GEgu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726764AbgA1Q5P (ORCPT + 99 others); Tue, 28 Jan 2020 11:57:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:55392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgA1Q5P (ORCPT ); Tue, 28 Jan 2020 11:57:15 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 6CD16214AF; Tue, 28 Jan 2020 16:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580230634; bh=0zx2j6Lsa9HwzHF4AoAgg97MA5gTZ+rv9fANMAw8vc0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fT54GEgub6xQ+dP1/kFc16jal8sv+sq/QzA3NbhbYxQo4EEtJbB311GkL0yZ1k6qL 2Qz0YeWv1OD6dQr7NdpT404ix2ZEcx7+mxIghu5p6kgJTQgVvZiFPC2LXrSB+2xBJ9 zMdfhIjclnj092JF68J3w0MHKFeYvqedJPNU9CMs= Date: Tue, 28 Jan 2020 17:57:12 +0100 From: Greg KH To: Benjamin GAIGNARD Cc: "broonie@kernel.org" , "robh@kernel.org" , "arnd@arndb.de" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "fabio.estevam@nxp.com" , "sudeep.holla@arm.com" , "lkml@metux.net" , Loic PALLARDY , "linux-kernel@vger.kernel.org" , "linux-imx@nxp.com" , "kernel@pengutronix.de" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "system-dt@lists.openampproject.org" , "stefano.stabellini@xilinx.com" Subject: Re: [PATCH v2 2/7] bus: Introduce firewall controller framework Message-ID: <20200128165712.GA3667596@kroah.com> References: <20200128153806.7780-1-benjamin.gaignard@st.com> <20200128153806.7780-3-benjamin.gaignard@st.com> <20200128155243.GC3438643@kroah.com> <0dd9dc95-1329-0ad4-d03d-99899ea4f574@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0dd9dc95-1329-0ad4-d03d-99899ea4f574@st.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 28, 2020 at 04:41:29PM +0000, Benjamin GAIGNARD wrote: > > On 1/28/20 4:52 PM, Greg KH wrote: > > On Tue, Jan 28, 2020 at 04:38:01PM +0100, Benjamin Gaignard wrote: > >> The goal of this framework is to offer an interface for the > >> hardware blocks controlling bus accesses rights. > >> > >> Bus firewall controllers are typically used to control if a > >> hardware block can perform read or write operations on bus. > > So put this in the bus-specific code that controls the bus that these > > devices live on. Why put it in the driver core when this is only on one > > "bus" (i.e. the catch-all-and-a-bag-of-chips platform bus)? > > It is really similar to what pin controller does, configuring an > hardware block given DT information. Great, then use that instead :) > I could argue that firewalls are not bus themselves they only interact > with it. They live on a bus, and do so in bus-specific ways, right? > Bus firewalls exist on other SoC, I hope some others could be added in > this framework. ETZPC is only the first. Then put it on the bus it lives on, and the bus that the drivers for that device are being controlled with. That sounds like the sane place to do so, right? > > And really, this should just be a totally new bus type, right? And any > > devices on this bus should be changed to be on this new bus, and the > > drivers changed to support them, instead of trying to overload the > > platform bus with more stuff. > > I have tried to use the bus notifier to avoid to add this code at probe > time but without success: > > https://lkml.org/lkml/2018/2/27/300 Almost 2 years ago? I can't remember something written 1 week ago... Yes, don't abuse the notifier chain. I hate that thing as it is. > I have also tried to disable the nodes at runtime and Mark Rutland > explain me why it was wrong. The bus controller should do this, right? Why not just do it there? thanks, greg k-h