Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3875649pxb; Tue, 17 Nov 2020 06:00:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkQMswdtrQzk42eFqssvzGhNjL6bl8h2nPuFhyyeowRz2FS7cJYw13y/bCTvd+KV8cocPs X-Received: by 2002:a17:906:76c2:: with SMTP id q2mr19976208ejn.444.1605621641433; Tue, 17 Nov 2020 06:00:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605621641; cv=none; d=google.com; s=arc-20160816; b=l+uq63HjdTGt2S9UMkIorBXgonK3HtJ7rtsRBSbmnWBsQuQ+YPksBPJWrk1tUjtavT U/fdqTS5Vzz30U5rxdB2bkhUfzRFOM0mCs0JIY2nhk2lvMDI0SBI/nOvF3GfcQnIQA3l 2QIZoieUUYD2a57T2GXn/2qnOJwVMZTl4H9MXuBtrqWTZ5s8PRLffg/jKCMEZqPtpzkw ddE4UYx/0s7cYklksMLKtIgt7TpkgkrrRolyGlTW78awjz0r8xzIh51hlMg/B+9qETfH cT/vC07DpkHRgCSvBl86RGzHQyTODKAYAtEbS/RZ32PvOeNvxqN78b/IpdHRs0xmnYlS Iehw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J6P18m8KQ8F3C29sE4tWCKCvk6+zgk0WeB61rLbekZI=; b=nHjG4+TPBAMY4GvkMhgEKkF3Ukslrzylbm4Of1mSviGOfdd9k7XEItYZei5YA06Blc CwlS0886xgNg0L4gcoBfqYZcNwt2LN56qM6TzJetkC0sUdSgo/AK1bZZkWtEPg4o0DYU yk1yQdQl0rPVAsxTt0NRS8qmWtlfR0FvVatDPjIBZOwY0yzOPRyIXPYzT7tilNqTG+EM idbNAWe5kGcEfColVNfN6ekdB5/RZwymQ5fFHZDhPlvT7D7L9r33I1COQPe2DEg3CSFN EEta36dk16Tz9uhj+/n2Fz8Rj3Wldua+R8m5ivtRWE2oYcuJLK+etPJuODHxFzMup9IU EQjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kmsGdJln; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m22si14210523edq.478.2020.11.17.06.00.18; Tue, 17 Nov 2020 06:00:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b=kmsGdJln; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732140AbgKQN4d (ORCPT + 99 others); Tue, 17 Nov 2020 08:56:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:56358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730649AbgKQNWO (ORCPT ); Tue, 17 Nov 2020 08:22:14 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 36073221FE; Tue, 17 Nov 2020 13:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619333; bh=VtZqPqHdulf/Dbcc2C0lldB/XlyVF4+MLKNHmpJAyE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kmsGdJln67ymL1s1TnWdtgojECyWDNDEgNhtoTMQl+jZjDY65dJwxjMnfPLkiQlzc 1z6cDi6ka4+JvErY5LWLLJz8WZPwWOGeoDoOnOfpU53A18jBXCba7IwKvOfyNHjtsz p7Pb2qvOj3lo80Jql92hByn5QNQgBmupy9DZbYKk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnaud de Turckheim , William Breathitt Gray , Bartosz Golaszewski Subject: [PATCH 4.19 078/101] gpio: pcie-idio-24: Fix IRQ Enable Register value Date: Tue, 17 Nov 2020 14:05:45 +0100 Message-Id: <20201117122116.921376222@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaud de Turckheim commit 23a7fdc06ebcc334fa667f0550676b035510b70b upstream. This fixes the COS Enable Register value for enabling/disabling the corresponding IRQs bank. Fixes: 585562046628 ("gpio: Add GPIO support for the ACCES PCIe-IDIO-24 family") Cc: stable@vger.kernel.org Signed-off-by: Arnaud de Turckheim Reviewed-by: William Breathitt Gray Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpio-pcie-idio-24.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/gpio/gpio-pcie-idio-24.c +++ b/drivers/gpio/gpio-pcie-idio-24.c @@ -360,13 +360,13 @@ static void idio_24_irq_mask(struct irq_ unsigned long flags; const unsigned long bit_offset = irqd_to_hwirq(data) - 24; unsigned char new_irq_mask; - const unsigned long bank_offset = bit_offset/8 * 8; + const unsigned long bank_offset = bit_offset / 8; unsigned char cos_enable_state; raw_spin_lock_irqsave(&idio24gpio->lock, flags); idio24gpio->irq_mask &= ~BIT(bit_offset); - new_irq_mask = idio24gpio->irq_mask >> bank_offset; + new_irq_mask = idio24gpio->irq_mask >> bank_offset * 8; if (!new_irq_mask) { cos_enable_state = ioread8(&idio24gpio->reg->cos_enable); @@ -389,12 +389,12 @@ static void idio_24_irq_unmask(struct ir unsigned long flags; unsigned char prev_irq_mask; const unsigned long bit_offset = irqd_to_hwirq(data) - 24; - const unsigned long bank_offset = bit_offset/8 * 8; + const unsigned long bank_offset = bit_offset / 8; unsigned char cos_enable_state; raw_spin_lock_irqsave(&idio24gpio->lock, flags); - prev_irq_mask = idio24gpio->irq_mask >> bank_offset; + prev_irq_mask = idio24gpio->irq_mask >> bank_offset * 8; idio24gpio->irq_mask |= BIT(bit_offset); if (!prev_irq_mask) {