Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3866949pxb; Tue, 17 Nov 2020 05:46:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAMde98P26rKfVyPPzq6lLlTejATA51GZEY+R3zLlBdjJOq+EYCaWIgbcI30/KwXBo6Tpf X-Received: by 2002:aa7:df82:: with SMTP id b2mr19952343edy.251.1605620768577; Tue, 17 Nov 2020 05:46:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620768; cv=none; d=google.com; s=arc-20160816; b=WKakD/klJr0xPzPPYgbxPW1vpyaOzBFdQCKU+zTfMi9vQ5NQKSidl3oGS6Jhuv2YKt dNLZpfxxhkntLM2xpOAfeQ9mztCse17P5EPpt5PYyttYAP6x6JC1vEgis1k7e+KnR/VX 20S0eDgFnvhBa21wsZCFFMst0bch1u/mYOvV2SfX++modCUKZquub4z7R15SR8N5wvE2 +u6Q2dt1dhbWrilbIVNJElKt0IdyimG5QydTe6R0f7W2HG5Q2kuMQhWCjZnJzYA1mEIN sShRfoqdPK4C7KlzO0A2V+rspT7jXxK0YuY9kPf+YKMSX/ZEvLzfg43GtBSSoVtjxjIZ kg9g== 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=ITEefpzRkMbJ3ILNcOkrdGeZXGiT6OdYIfyFjPQmjUY=; b=nzTwd3c8uux37x9xJZdvTYdAmlG3CLDNsGGQJC6pLdkKT6JLYrplIJS9Y0d3cKayg7 5UefVhnVXkUV/6d99X0oJ1G9QJN/gZKN1VaHp6CtLEZ4sOhpOlL4B9chWj2klD2i/Vs6 ASNzfLeqx0oBcq2VU27+lC4ZMyL923BD7gVqcZM0rFisW7s/M36Z39H/YD3Ckw1g6+CB iNoGqaTpArMdbY9XKEOVl6gUQIIc1D1fQVy9xzOeN60LQjUTLo61QivL75qv145guNRZ UuFjZqfeD5WFFEgYLJPzhbgEomInpqJMjNHo/tIuTcnLqMTkWdF1cd8b3jdAJ9jOz/Co l9jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Hs4Cta/p"; 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 h13si15231120edn.268.2020.11.17.05.45.46; Tue, 17 Nov 2020 05:46:08 -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="Hs4Cta/p"; 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 S2387433AbgKQNm0 (ORCPT + 99 others); Tue, 17 Nov 2020 08:42:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:54886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732799AbgKQNmR (ORCPT ); Tue, 17 Nov 2020 08:42:17 -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 E8016206A5; Tue, 17 Nov 2020 13:42:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605620536; bh=VhRyKNSfnVN0dyTEhy0YksX8nioS8WhlK9XeiRQ8dUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hs4Cta/pQ4Dum82OWVL2TRsjJtjwvETxHcu5gbxTX8IuWWsDlqgTMc1MEmIqNvM+R ziKOn+Ilhco4D63vRoifJoSOOy9coNu52al0RF6aPtdBG+caplMMZSK8lkiPCSJCmZ 23qEgy5qmlb1Z49ZCm5RKttawrUgxnZc0c4xL+QM= 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 5.9 223/255] gpio: pcie-idio-24: Fix IRQ Enable Register value Date: Tue, 17 Nov 2020 14:06:03 +0100 Message-Id: <20201117122149.790152224@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@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 @@ -334,13 +334,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); @@ -363,12 +363,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) {