From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937312AbdDSUll (ORCPT ); Wed, 19 Apr 2017 16:41:41 -0400 Received: from mail-qt0-f182.google.com ([209.85.216.182]:33925 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764621AbdDSUlj (ORCPT ); Wed, 19 Apr 2017 16:41:39 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Andy Shevchenko Date: Wed, 19 Apr 2017 23:41:37 +0300 Message-ID: Subject: Re: [PATCH v1 1/2] gpio: gpio-wcove: fix GPIO irq status mask To: Kuppuswamy Sathyanarayanan Cc: Alexandre Courbot , Linus Walleij , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sathyanarayanan Kuppuswamy Natarajan Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 14, 2017 at 8:29 PM, wrote: > From: Kuppuswamy Sathyanarayanan > > According to Whiskey cove PMIC spec, bit 7 of GPIOIRQ0_REG belongs to cove -> Cove > battery IO. So we should skip this bit when checking for GPIO irq pending irq -> IRQ > status. Otherwise, wcove_gpio_irq_handler() might go into the infinite > loop until irq "pending" status becomes 0. This patch fixes this issue. Ditto. > +#define GPIO_IRQ0_MASK 0x7f > +#define GPIO_IRQ1_MASK 0x3f GENMASK() > - pending = p[0] | (p[1] << 8); > + pending = (p[0] & GPIO_IRQ0_MASK) | > + ((p[1] & GPIO_IRQ1_MASK) << 7); I would leave this on one line despite 80 characters limit (actually how long is it?). -- With Best Regards, Andy Shevchenko