Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6553416ybx; Mon, 11 Nov 2019 10:51:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzBZX4XtjDmkVpY9R0ZQjdH864t1mqukADRpe0mqhf5y3IzGZahpY0r4Mo4p/yz3CD91XUM X-Received: by 2002:a17:906:7e08:: with SMTP id e8mr24612520ejr.199.1573498269521; Mon, 11 Nov 2019 10:51:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498269; cv=none; d=google.com; s=arc-20160816; b=JrkZAb4JQJ++Cs73pPRSVr2PmxWSnID/yRqZTmE9UtfoDT2VXf3W9PzHjsFlLq4O6I 5bnJz3G3J+f4izqb9odmopllG0QIcuANWXcrsT6fDgnpkJY6ULBXGTLCMnFcRjn8qb1W x57X+7WQ7472/5ZY2guEjYScyBezmIJO7VcnonAdU5filfnA9jW/LsojMXYIAzqErQ3R mkMr50yEMn7oq+zFpgQfJ4V+WiPpxOzvYMF+KdNFgPSns8Mrw5/ihUFVciiuySxe8QQ9 qIPsew+BKabEZmWoFRusZKXN8cUZb0zQrOBDSY/dKShf964KskS7Chh6yZ1f1tDqR7JF 8JBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ub6vDPhZWf6kS4d7y74MwQNJ3BFAGQUz+XnlOWAcHBc=; b=fjcpROJpejo6WZ7o9lKok2jqeskW7inC24eqf0Vc7aqi00Pn2YaMYorCA4kwvyyfpo O5eRzOcqVYQGImkhVqL5qsccQWVHtVaGPjwpphlezGRr3S0VFK+Dw8nVZ7u23TaOdMc8 m9wa+etBDwJlvQzD/pPDlcvEDooQd96oQC6sYwdP/yHluWic4JamXJG4vSsl8kLwm2jQ ScWr198/cyTuhweQKGslrA+TSjyAORubXCyHnf2AcvJMLo/yGeNgifcnJ4dHoRWtXFK9 Ghn5vrZWhcMhIrHYjitWRjPjTPPUM7T3wmmpGzm+exc3s+sv9eKXd0yx0F9IIf1RjOtW G+tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1b7GdOUg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y40si12315720edd.383.2019.11.11.10.50.45; Mon, 11 Nov 2019 10:51:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1b7GdOUg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730103AbfKKSrb (ORCPT + 99 others); Mon, 11 Nov 2019 13:47:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:40280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730076AbfKKSr3 (ORCPT ); Mon, 11 Nov 2019 13:47:29 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 307A7204FD; Mon, 11 Nov 2019 18:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573498048; bh=pc99F0Jd2Vg9JY50ObVWgymOB0Sgeg2O/tcimhadOd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1b7GdOUgt84Xm6IfUJ5/wrkKA1zlk2UL2GK4c5GYeyEsYv8EqK2EPqh3+iNHUIOL6 GThRALhfujlasq+eda6fyagEvXF+UH1OhVmCDNGZBSX405lTho306chIetr8dgwdtM /Psi4y/v1Lj+PSBRYOKMrQntOvB3xQ3QvFJ6gAko= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Andy Shevchenko , Mika Westerberg , Sasha Levin Subject: [PATCH 4.19 120/125] pinctrl: cherryview: Fix irq_valid_mask calculation Date: Mon, 11 Nov 2019 19:29:19 +0100 Message-Id: <20191111181455.764494754@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 63bdef6cd6941917c823b9cc9aa0219d19fcb716 ] Commit 03c4749dd6c7 ("gpio / ACPI: Drop unnecessary ACPI GPIO to Linux GPIO translation") has made the cherryview gpio numbers sparse, to get a 1:1 mapping between ACPI pin numbers and gpio numbers in Linux. This has greatly simplified things, but the code setting the irq_valid_mask was not updated for this, so the valid mask is still in the old "compressed" numbering with the gaps in the pin numbers skipped, which is wrong as irq_valid_mask needs to be expressed in gpio numbers. This results in the following error on devices using pin 24 (0x0018) on the north GPIO controller as an ACPI event source: [ 0.422452] cherryview-pinctrl INT33FF:01: Failed to translate GPIO to IRQ This has been reported (by email) to be happening on a Caterpillar CAT T20 tablet and I've reproduced this myself on a Medion Akoya e2215t 2-in-1. This commit uses the pin number instead of the compressed index into community->pins to clear the correct bits in irq_valid_mask for GPIOs using GPEs for interrupts, fixing these errors and in case of the Medion Akoya e2215t also fixing the LID switch not working. Cc: stable@vger.kernel.org Fixes: 03c4749dd6c7 ("gpio / ACPI: Drop unnecessary ACPI GPIO to Linux GPIO translation") Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mika Westerberg Signed-off-by: Sasha Levin --- drivers/pinctrl/intel/pinctrl-cherryview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 227646eb817c8..9eab508395814 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1595,7 +1595,7 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq) intsel >>= CHV_PADCTRL0_INTSEL_SHIFT; if (need_valid_mask && intsel >= community->nirqs) - clear_bit(i, chip->irq.valid_mask); + clear_bit(desc->number, chip->irq.valid_mask); } /* -- 2.20.1