Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1434731AbdDZDKY (ORCPT ); Tue, 25 Apr 2017 23:10:24 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:33784 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758800AbdDZDKQ (ORCPT ); Tue, 25 Apr 2017 23:10:16 -0400 Subject: Re: [PATCH] irqchip/mbigen: Fix the clear register offset To: Majun , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, tglx@linutronix.de, dingtianhong@huawei.com, guohanjun@huawei.com References: <1493086563-36396-1-git-send-email-majun258@huawei.com> From: Hanjun Guo Message-ID: <68214147-bc4d-c542-ce40-78f69a63e53d@linaro.org> Date: Wed, 26 Apr 2017 11:10:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1493086563-36396-1-git-send-email-majun258@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1562 Lines: 52 Hi Majun, On 2017/4/25 10:16, Majun wrote: > From: MaJun > > Don't minus reserved interrupts (64) when get the clear register offset,because > the clear register space includes the space of these 64 interrupts. Could you mention the background that there is a timeout mechanism to clear the register in the mbigen to make the code work even we clear the wrong (and noneffective) register? that will help for review I think. > > Signed-off-by: MaJun > --- > drivers/irqchip/irq-mbigen.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c > index 061cdb8..75818a5 100644 > --- a/drivers/irqchip/irq-mbigen.c > +++ b/drivers/irqchip/irq-mbigen.c > @@ -108,7 +108,6 @@ static inline void get_mbigen_clear_reg(irq_hw_number_t hwirq, > { > unsigned int ofst; > > - hwirq -= RESERVED_IRQ_PER_MBIGEN_CHIP; > ofst = hwirq / 32 * 4; > > *mask = 1 << (hwirq % 32); How about following to save more lines of code: --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -106,10 +106,7 @@ static inline void get_mbigen_type_reg(irq_hw_number_t hwirq, static inline void get_mbigen_clear_reg(irq_hw_number_t hwirq, u32 *mask, u32 *addr) { - unsigned int ofst; - - hwirq -= RESERVED_IRQ_PER_MBIGEN_CHIP; - ofst = hwirq / 32 * 4; + unsigned int ofst = hwirq / 32 * 4; *mask = 1 << (hwirq % 32); *addr = ofst + REG_MBIGEN_CLEAR_OFFSET; Thanks Hanjun