Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1585666ybv; Thu, 20 Feb 2020 23:46:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxOd7ZXnpEgVNAgf0wSHP+MNalZ4mHr3M7U+P0wfu8N9OJy2PHtdxwKi/QhKFCrl394AjTG X-Received: by 2002:a9d:6415:: with SMTP id h21mr28190784otl.152.1582271207567; Thu, 20 Feb 2020 23:46:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582271207; cv=none; d=google.com; s=arc-20160816; b=ZcYhgMgWfawREF154nq3seFg9cR7Ou+56IGe6IuhTxjxm2CI/KKE5FbWGHlkGx8zYy Mm07MFgnNO8dL0eUUgjx7o9595qKr3d6JY2R5+qENv0IxtSWUr2NUH3wLDpmz7CVEGhj cvWhuBkUaECxXBnKeQwCHwd/q655/6d2qi8qdZV6RPnH0oGd6JoxuJ2hQz9IgnIZUpip L3m+rySVatqpZv8bM7qmSDYJlFFsKF8d/OmjDT8+0U/Nv2c1Mr11X0g7sTSHgdEWK50K 77NTrG/5SLPefuF/Whm0kpYIGQrDnLNMe7D+FPiY7L9a16LgJxVxF+rHil2OrE7WY0jM LMvQ== 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=Awi29rjKhw8y+oGpP2DtzrpL986Hne6CY0NH9fWmRpE=; b=Vur8ljNMzFY7CpWx7CSbimWoE6ltM+BU6GdGS23tdtAPBO4ObNR/szSO6LmiNr1RpR 1Awk41KloggpGSvrSIHdLvvQjUgn9AcgHqG5lrMEm06X2IhR4jfSpwkSrNkiXwBoOoE8 IieAAVnf9Pu9zHjbFqdMyCdiT6ItZueOnu2sU4pvWKlksNfY7GN9q6lI95PCWGFqlmQB 8SUaKPLOMnvzri9IG/ySRm3B352SNgnxWK17HCTc6Rac1Kt2UPRxg410OELev3WBN0K3 EOb9hrxr+lkZMlXfura04mppCe7ivV71YoAeYf2cG7sAn+XgKEOKLaOybFSymy+wIWZY HmHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ug+D6qNR; 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 v5si390788oix.197.2020.02.20.23.46.35; Thu, 20 Feb 2020 23:46:47 -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=Ug+D6qNR; 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 S1728480AbgBUHpp (ORCPT + 99 others); Fri, 21 Feb 2020 02:45:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:40972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727150AbgBUHpn (ORCPT ); Fri, 21 Feb 2020 02:45:43 -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 66878222C4; Fri, 21 Feb 2020 07:45:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271142; bh=CqNEsGGJ+joZE9+STxSSxsiHVjaZLJByQ0HUUaaZDEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ug+D6qNRF7eKOxtO5r0IawzDKRze7s793fsIAQ5AAlGegkM49uyVllB+AT2vRM5hV UbmN0fhsNQhx3elh4R2PIrs80WU5iul+IaQIKwW7kX4RSncctwCaHu9kEQgC+eQWL4 Wwmic9cK8MvjFL32OIAwvcvJNFqStemz7lgubuj8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Mika Westerberg , Linus Walleij , Andy Shevchenko , Sasha Levin Subject: [PATCH 5.5 055/399] pinctrl: baytrail: Do not clear IRQ flags on direct-irq enabled pins Date: Fri, 21 Feb 2020 08:36:20 +0100 Message-Id: <20200221072407.710474650@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@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 a23680594da7a9e2696dbcf4f023e9273e2fa40b ] Suspending Goodix touchscreens requires changing the interrupt pin to output before sending them a power-down command. Followed by wiggling the interrupt pin to wake the device up, after which it is put back in input mode. On Bay Trail devices with a Goodix touchscreen direct-irq mode is used in combination with listing the pin as a normal GpioIo resource. This works fine, until the goodix driver gets rmmod-ed and then insmod-ed again. In this case byt_gpio_disable_free() calls byt_gpio_clear_triggering() which clears the IRQ flags and after that the (direct) IRQ no longer triggers. This commit fixes this by adding a check for the BYT_DIRECT_IRQ_EN flag to byt_gpio_clear_triggering(). Note that byt_gpio_clear_triggering() only gets called from byt_gpio_disable_free() for direct-irq enabled pins, as these are excluded from the irq_valid mask by byt_init_irq_valid_mask(). Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko Signed-off-by: Sasha Levin --- drivers/pinctrl/intel/pinctrl-baytrail.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index 72ffd19448e50..ce9cf50121bd5 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -753,7 +753,13 @@ static void byt_gpio_clear_triggering(struct byt_gpio *vg, unsigned int offset) raw_spin_lock_irqsave(&byt_lock, flags); value = readl(reg); - value &= ~(BYT_TRIG_POS | BYT_TRIG_NEG | BYT_TRIG_LVL); + + /* Do not clear direct-irq enabled IRQs (from gpio_disable_free) */ + if (value & BYT_DIRECT_IRQ_EN) + /* nothing to do */ ; + else + value &= ~(BYT_TRIG_POS | BYT_TRIG_NEG | BYT_TRIG_LVL); + writel(value, reg); raw_spin_unlock_irqrestore(&byt_lock, flags); } -- 2.20.1