[PATCH] irqchip/gic-v3-its: Mark GIC as non-shareable by OF property

From: Fang Xiang
Date: Sun Sep 03 2023 - 22:05:51 EST


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.

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.

Signed-off-by: Fang Xiang <fangxiang3@xxxxxxxxxx>
---
drivers/irqchip/irq-gic-v3-its.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-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;
}

+static void its_of_update_shareability(struct its_node *its)
+{
+ if (!fwnode_property_present(its->fwnode_handle,
+ "force-non-shareable"))
+ return;
+
+ its->flags |= ITS_FLAGS_FORCE_NON_SHAREABLE;
+ gic_rdists->flags |= RDIST_FLAGS_FORCE_NON_SHAREABLE;
+}
+
static int __init its_probe_one(struct resource *res,
struct fwnode_handle *handle, int numa_node)
{
@@ -5130,6 +5140,7 @@ static int __init its_probe_one(struct resource *res,
its->msi_domain_flags = IRQ_DOMAIN_FLAG_ISOLATED_MSI;

its_enable_quirks(its);
+ its_of_update_shareability(its);

err = its_alloc_tables(its);
if (err)
--
2.34.1

#/******±¾Óʼþ¼°Æ丽¼þº¬ÓÐСÃ×¹«Ë¾µÄ±£ÃÜÐÅÏ¢£¬½öÏÞÓÚ·¢Ë͸øÉÏÃæµØÖ·ÖÐÁгöµÄ¸öÈË»òȺ×é¡£½ûÖ¹ÈκÎÆäËûÈËÒÔÈκÎÐÎʽʹÓ㨰üÀ¨µ«²»ÏÞÓÚÈ«²¿»ò²¿·ÖµØй¶¡¢¸´ÖÆ¡¢»òÉ¢·¢£©±¾ÓʼþÖеÄÐÅÏ¢¡£Èç¹ûÄú´íÊÕÁ˱¾Óʼþ£¬ÇëÄúÁ¢¼´µç»°»òÓʼþ֪ͨ·¢¼þÈ˲¢É¾³ý±¾Óʼþ£¡ This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#