Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1795344pxb; Mon, 8 Mar 2021 06:38:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWxia4utO4cpQC/AFdmZWhVgSm66/ZxTKVKbvH/G104tThMwUzimG1wS5j4fiT4hWzulMu X-Received: by 2002:a50:e14d:: with SMTP id i13mr22179672edl.106.1615214308426; Mon, 08 Mar 2021 06:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615214308; cv=none; d=google.com; s=arc-20160816; b=QQDAGpCQBeJ1+Byati1P4SqNXI8B13UjgcNxUb7B1HcLgBm26v9B460Ytxqdie/y0f TKGGR+RWvPBtaugxrzw0/Ht2hbXl5CZLvp7qDKNgyjuQPvTRZ8BjWdx3LcjqtrkhfIBD z4xUCxHF4mVoM7H1QO0R6c4PJJKRo9pzfXQrbmetUh1GelU4HoJ1UBFj4ktP8+MT5g0I dZcFkef4wPubEBMdrplQ/97Z6/7iZdoQvQ3ZTbAOTQFmevhGwD+MdLHs0N+HfCnjiBfD KN9QGB6yIzUaMshuSJp+GOzF68kxc1TszXWNmLVX69wl3+tItm1LvzM3cPYFNk8yVsWd h/Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=NLoPGDX6fbnVoDPoNl5LeX3VitbGImpKEKbd4GlS6p8=; b=TlHjJh5N5CDnZEoArbQLccKJYkk/DhnYvENcSoRWfL6KSbBhuazwRhJoFPyVsPzxRG a1fflJy5P0JDys2nBXJWkktqjBVBeT5jjeIk3oiRNRvFZJYKLGZn3rAk7vT5AIOnLTAs EJj1E+LJ9NTsauxTg0JUIMPzhjNNYB0DoJ0DnycZ4vjiykfFYQtH3xAUhcJDo5Bm4Ip6 S6x9H1PoszOMKJZepxsJp8NzicTN0pkk1eBKo5I6GrMDJXo3Ymmq3AK1+ySgvRe4Vi+2 QKAV+GYLpfWiFAYe438ILheQ+fiOWsQGZ8YSa98gpHuHSGIDKB6cSJGZBm7Rp4urUO7h CG+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x21si7090998ejv.446.2021.03.08.06.38.05; Mon, 08 Mar 2021 06:38:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbhCHOe4 (ORCPT + 99 others); Mon, 8 Mar 2021 09:34:56 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:41665 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231408AbhCHOei (ORCPT ); Mon, 8 Mar 2021 09:34:38 -0500 X-UUID: 1f678c5153ea4dc4b6762b2c293aa136-20210308 X-UUID: 1f678c5153ea4dc4b6762b2c293aa136-20210308 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1103821765; Mon, 08 Mar 2021 22:34:25 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 8 Mar 2021 22:34:24 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 8 Mar 2021 22:34:24 +0800 From: Mark-PK Tsai To: , Mark-PK Tsai CC: , , , , , , , Subject: Re: [PATCH] irqchip/irq-mst: Support polarity configuration Date: Mon, 8 Mar 2021 22:31:10 +0800 Message-ID: <20210308143109.24644-1-mark-pk.tsai@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <01b1c85119619c2418908a2fdabfb5dc@kernel.org> References: <01b1c85119619c2418908a2fdabfb5dc@kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier >On 2021-03-08 03:01, Mark-PK Tsai wrote: >> From: Marc Zyngier >> >>> > >>> > Support irq polarity configuration and save and restore the config >>> > when system suspend and resume. >>> > >>> > Signed-off-by: Mark-PK Tsai >>> > --- >>> > drivers/irqchip/irq-mst-intc.c | 87 ++++++++++++++++++++++++++++++++-- >>> > 1 file changed, 84 insertions(+), 3 deletions(-) >>> > >>> > diff --git a/drivers/irqchip/irq-mst-intc.c b/drivers/irqchip/irq-mst-intc.c >>> > index 143657b0cf28..979a4d55bcb1 100644 >>> > --- a/drivers/irqchip/irq-mst-intc.c >>> > +++ b/drivers/irqchip/irq-mst-intc.c >>> > @@ -13,15 +13,25 @@ >>> > #include >>> > #include >>> > #include >>> > +#include >>> > >>> > -#define INTC_MASK 0x0 >>> > -#define INTC_EOI 0x20 >>> > +#define INTC_MASK 0x0 >>> > +#define INTC_REV_POLARITY 0x10 >>> > +#define INTC_EOI 0x20 >>> > + >>> > +#ifdef CONFIG_PM_SLEEP >>> > +static LIST_HEAD(mst_intc_list); >>> > +#endif >>> > >>> > struct mst_intc_chip_data { >>> > raw_spinlock_t lock; >>> > unsigned int irq_start, nr_irqs; >>> > void __iomem *base; >>> > bool no_eoi; >>> > +#ifdef CONFIG_PM_SLEEP >>> > + struct list_head entry; >>> > + u16 saved_polarity_conf[DIV_ROUND_UP(64, 16)]; >>> >>> Where is this 64 coming from? >> >> The maximum number of interrupts a mst-intc supports is 64 in >> Mstar and Mediatek SoCs now. >> So I just use the maximum number of interrupts here. > >Then please use a named constant instead of a magic number. > Okay, I will update in patch v3.