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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D46E9C71153 for ; Mon, 4 Sep 2023 07:25:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344782AbjIDHZE (ORCPT ); Mon, 4 Sep 2023 03:25:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbjIDHZB (ORCPT ); Mon, 4 Sep 2023 03:25:01 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AECFA99 for ; Mon, 4 Sep 2023 00:24:57 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id 1570CCE0E16 for ; Mon, 4 Sep 2023 07:24:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C241C433CA; Mon, 4 Sep 2023 07:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693812294; bh=+Fgf+ImZTDHXXqnwmS8ZbyqaMlbLSub5KTWLjW3eOcU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=H0IB075KyiKfr1kXyc8e21zXdpuvwIgjPf5b4GZ9e4EdywRRDIAzSXtvigiZgk+V3 VdXs1QZj0+uYgLsdHBm074V58F0MNbb1raZ1F1LIJ3UnMGn96zap2fiahuNRlekY6G 19bg+7qsXQFsKDauqboTa2jyKyiW+rrP3654MrgsZT294t0huNHRFFYZNfkWGCpQ+Y YpBchICH64xhYXHvtYdomPUzBkbBWKkdHjt5INGcF5YfKyKvNH87mK1PRkTcLkZcvl atkcjN4GSkPBxBccFcFYW2yKjWe24S+7kbDGM5yxKoqEduq91rqy1sk/krqQlohLc5 Ilt7yfshC1WvQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qd3x5-00AKnd-R0; Mon, 04 Sep 2023 08:24:51 +0100 Date: Mon, 04 Sep 2023 08:24:51 +0100 Message-ID: <86sf7ue6yk.wl-maz@kernel.org> From: Marc Zyngier To: Fang Xiang Cc: , Subject: Re: [PATCH] irqchip/gic-v3-its: Mark GIC as non-shareable by OF property In-Reply-To: <20230904020431.27057-1-fangxiang3@xiaomi.com> References: <20230904020431.27057-1-fangxiang3@xiaomi.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/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: fangxiang3@xiaomi.com, tglx@linutronix.de, linux-kernel@vger.kernel.org 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 Mon, 04 Sep 2023 03:04:31 +0100, Fang Xiang wrote: >=20 > GIC600/GIC700 integration in some platforms does not support the > sharability feature. Commit a8707f553884 ("irqchip/gic-v3: Add > Rockchip 3588001 erratum workaround") added flags to indicate the > integration design error, but the quirk is just applied with > RK3588/RK3588S and GIC600. >=20 > The property are named "force-non-shareable" to be vendor agnostic, > since apparently similar integration design errors exist in other > platforms and they can reuse the same property in their GIC ITS > device-node. No. If this is a problem, this must be dealt with in the following manner: - a standard property, which is documented in the ITS binding - an equivalent ACPI property, equally documented - separate instances of the property for the core GIC and the ITS (because the RDs are *not* defined at the ITS level) >=20 > Signed-off-by: Fang Xiang > --- > drivers/irqchip/irq-gic-v3-its.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v= 3-its.c > index e0c2b10d154d..2e92eac1e5f3 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -5055,6 +5055,16 @@ static int __init its_compute_its_list_map(struct = resource *res, > return its_number; > } >=20 > +static void its_of_update_shareability(struct its_node *its) > +{ > + if (!fwnode_property_present(its->fwnode_handle, > + "force-non-shareable")) > + return; > + > + its->flags |=3D ITS_FLAGS_FORCE_NON_SHAREABLE; > + gic_rdists->flags |=3D RDIST_FLAGS_FORCE_NON_SHAREABLE; There is no reason why we should conflate the two, other than your implementation being monolithic. > +} > + > static int __init its_probe_one(struct resource *res, > struct fwnode_handle *handle, int numa_no= de) > { > @@ -5130,6 +5140,7 @@ static int __init its_probe_one(struct resource *re= s, > its->msi_domain_flags =3D IRQ_DOMAIN_FLAG_ISOLATED_MSI; >=20 > its_enable_quirks(its); > + its_of_update_shareability(its); As mentioned above, we need a mechanism that works across firmware implemen= tations. >=20 > err =3D its_alloc_tables(its); > if (err) > -- > 2.34.1 >=20 > #/******=C2=B1=C2=BE=C3=93=C3=8A=C2=BC=C3=BE=C2=BC=C2=B0=C3=86=C3=A4=C2= =B8=C2=BD=C2=BC=C3=BE=C2=BA=C2=AC=C3=93=C3=90=C3=90=C2=A1=C3=83=C3=97=C2=B9=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0=C2=BB=C3=B2=C3=93=C3=8A=C2=BC=C3=BE=C3=8D=C2=A8=C3=96=C2=AA=C2= =B7=C2=A2=C2=BC=C3=BE=C3=88=C3=8B=C2=B2=C2=A2=C3=89=C2=BE=C2=B3=C3=BD=C2=B1= =C2=BE=C3=93=C3=8A=C2=BC=C3=BE=C2=A3=C2=A1 This e-mail and its attachments = contain confidential information from XIAOMI, which is intended only for th= e person or entity whose address is listed above. Any use of the informatio= n contained herein in any way (including, but not limited to, total or part= ial disclosure, reproduction, or dissemination) by persons other than the i= ntended recipient(s) is prohibited. If you receive this e-mail in error, pl= ease notify the sender by phone or email immediately and delete it!******/# \ Please fix your email setup. M. --=20 Without deviation from the norm, progress is not possible.