Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1593472pxb; Mon, 8 Mar 2021 01:11:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzETAQuICiDvlQ99/lLwGS1ucn2prmGhh9vuwyyyb71lOBiazELnW+nRHE85xgE5uxZQ0C5 X-Received: by 2002:a05:6402:35d3:: with SMTP id z19mr20899508edc.143.1615194676126; Mon, 08 Mar 2021 01:11:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615194676; cv=none; d=google.com; s=arc-20160816; b=t6rjdsyhihJnduJ0BsNwLEoXBcfEON/LiLBCfBktjL/DX+987p5oOYlKpyj3oMd9UF la8WQE/od9Ar+7PXVpG2s9dafgMtxrskgTf2Gv0hCV3MRohW5ExFmNo7o0kpQ3ANL87u cUt+k/vPcH+TRr3tPiBjVQxn4Il5bl4OxwsjD/4mjzbgJjpdrIWuDRNMvi/JQnz3CulI W+KShPthGlHjlgzmvaneQ0AxgbANCMO6BOXhrsFC76urTrAlYUdwzAP2R9yWCFr/cCB4 PvMFGBShyLC9vX2cjJ56q+tDuIkn4FiMpW2PGIYHOyijQ0dLftVS+zbytrvpXA7+wpcF w7Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=2IYKjLSIJQJZ7LmrYu+zw9qDPSyzMkzLbzYXuYO3mVc=; b=GYdix7Y7rFaKAsBwnFaUnYGFa0DvmXaDacFG4TIYt2gUoX7PohyhCj0jo8vd0msvK7 z4aWuvc5rkrq005GBKOigPCwbZZcez/WTjuxtN13TtWggAKkxavGNRnRWHmkcQ9j4LLr f9rZcwtb35jBgsjYPZ9YCkuVqQdwncYIssjeXfSOUnaDxiFunRYnwuhw2bOXhk7MbOyp WQEgS8fbi9h1DnJ5+pB9F9ksDoCC0IWvCrmML85tCdKCw3/WKeDjOyGU/zp24LrVoOtu kzon5oEoSbHrvrZPHyVCku13PdYnNGWnBHqVCLLmjB1boCqgoJzHOqH8i48cVix/JRIM YRcg== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ar21si6639374ejc.618.2021.03.08.01.10.53; Mon, 08 Mar 2021 01:11:16 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229458AbhCHJJy (ORCPT + 99 others); Mon, 8 Mar 2021 04:09:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:39908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbhCHJJx (ORCPT ); Mon, 8 Mar 2021 04:09:53 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 07720651B9; Mon, 8 Mar 2021 09:09:53 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1lJBtf-000IHt-0Y; Mon, 08 Mar 2021 09:09:51 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 08 Mar 2021 09:09:50 +0000 From: Marc Zyngier To: Mark-PK Tsai Cc: daniel@thingy.jp, jason@lakedaemon.net, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, tglx@linutronix.de, yj.chiang@mediatek.com Subject: Re: [PATCH] irqchip/irq-mst: Support polarity configuration In-Reply-To: <20210308030102.5161-1-mark-pk.tsai@mediatek.com> References: <874khorux9.wl-maz@kernel.org> <20210308030102.5161-1-mark-pk.tsai@mediatek.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <01b1c85119619c2418908a2fdabfb5dc@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: mark-pk.tsai@mediatek.com, daniel@thingy.jp, jason@lakedaemon.net, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, tglx@linutronix.de, yj.chiang@mediatek.com 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 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. Thanks, M. -- Jazz is not dead. It just smells funny...