Received: by 10.192.165.148 with SMTP id m20csp757248imm; Fri, 27 Apr 2018 07:04:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrhEhOJTUw7xDJTQz8NfZ31krl6gTyAJPZEeiuYeSEr4pfvjSTKOBBDfyUY1rJw/WfD3r6K X-Received: by 10.98.13.71 with SMTP id v68mr2328707pfi.69.1524837896298; Fri, 27 Apr 2018 07:04:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524837896; cv=none; d=google.com; s=arc-20160816; b=Jgif2CcRXM2rlXcKO/65WqX9RMAUPrmtPnY0ZM0P5K6I2DEv5vVWgVB3osld9vDoeW hVUJhrJCRo4z3Umnj6fIsg6KetWNYTXfHqz6Cfb/TicrG/KV+FcMK3mEdA8i0dypFCZB NaR9Hr7QxNRZrkTBQIdNgtHy7GkIxnXjh4wvtlsYUFuXXjp/FpKMofeAN6uKFFjwIy2M +ieJ/UPxz8qV4fxV5PMN8PWoUOX5zslXShgYUTsYEW7oq0to1BN7a00pSei5Rpl29WmT vOqOqzmAVtWeMOk8b3dk/AlXRsx6dKE39XuGdOHOXOzRgYNad0/a0GoKW3reXZRbLhP1 jW7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=SXZkosgqIJw2evUzMErYWVIFy1ai+mL6igO9twgX/oY=; b=GlWY99LE27tQ8HPgTrIObKyItwxgmeiq2TSEwzSeGF+Ff5zVVZGbrSc+BxU6dMMKuR kgY5UYjohnQ7SXoYwPnMm6n0Bho3a54q1NzU4gOyveLIwz7o0N9UrPpg1yTMAAI2ASXQ JDTziKj3hGox9+OTju/SxjU6Zmr8x7sOeIMRMdLwEk7LBE/sU62Mzo/wm4NjrvpIqrd3 bnZ4BKfesE+pGxBQshmW6D6Xmkh4jKjmFparCZuu5IIcQgU2cFtpkJnEkV4FuJeqymF4 H3ygQ9+t5K3wEnfn+f2BJkXjFXNnDBTKQ7wTm++bjNzhtTXVgS4WxE8Qw7uJLK/VNSsk sw3g== ARC-Authentication-Results: i=1; mx.google.com; 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 o186-v6si1275505pga.350.2018.04.27.07.04.42; Fri, 27 Apr 2018 07:04:56 -0700 (PDT) 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; 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 S933541AbeD0ODd (ORCPT + 99 others); Fri, 27 Apr 2018 10:03:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933518AbeD0OD3 (ORCPT ); Fri, 27 Apr 2018 10:03:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 582982189F; Fri, 27 Apr 2018 14:03:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 582982189F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mika Westerberg , Daniel Drake , Chris Chiu , Linus Walleij Subject: [PATCH 4.9 25/74] Revert "pinctrl: intel: Initialize GPIO properly when used through irqchip" Date: Fri, 27 Apr 2018 15:58:15 +0200 Message-Id: <20180427135710.947021572@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135709.899303463@linuxfoundation.org> References: <20180427135709.899303463@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kroah-Hartman This reverts commit f5a26acf0162477af6ee4c11b4fb9cffe5d3e257 Mike writes: It seems that commit f5a26acf0162 ("pinctrl: intel: Initialize GPIO properly when used through irqchip") can cause problems on some Skylake systems with Sunrisepoint PCH-H. Namely on certain systems it may turn the backlight PWM pin from native mode to GPIO which makes the screen blank during boot. There is more information here: https://bugzilla.redhat.com/show_bug.cgi?id=1543769 The actual reason is that GPIO numbering used in BIOS is using "Windows" numbers meaning that they don't match the hardware 1:1 and because of this a wrong pin (backlight PWM) is picked and switched to GPIO mode. There is a proper fix for this but since it has quite many dependencies on commits that cannot be considered stable material, I suggest we revert commit f5a26acf0162 from stable trees 4.9, 4.14 and 4.15 to prevent the backlight issue. Reported-by: Mika Westerberg Fixes: f5a26acf0162 ("pinctrl: intel: Initialize GPIO properly when used through irqchip") Cc: Daniel Drake Cc: Chris Chiu Cc: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/pinctrl/intel/pinctrl-intel.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -368,18 +368,6 @@ static void __intel_gpio_set_direction(v writel(value, padcfg0); } -static void intel_gpio_set_gpio_mode(void __iomem *padcfg0) -{ - u32 value; - - /* Put the pad into GPIO mode */ - value = readl(padcfg0) & ~PADCFG0_PMODE_MASK; - /* Disable SCI/SMI/NMI generation */ - value &= ~(PADCFG0_GPIROUTIOXAPIC | PADCFG0_GPIROUTSCI); - value &= ~(PADCFG0_GPIROUTSMI | PADCFG0_GPIROUTNMI); - writel(value, padcfg0); -} - static int intel_gpio_request_enable(struct pinctrl_dev *pctldev, struct pinctrl_gpio_range *range, unsigned pin) @@ -387,6 +375,7 @@ static int intel_gpio_request_enable(str struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); void __iomem *padcfg0; unsigned long flags; + u32 value; raw_spin_lock_irqsave(&pctrl->lock, flags); @@ -396,7 +385,13 @@ static int intel_gpio_request_enable(str } padcfg0 = intel_get_padcfg(pctrl, pin, PADCFG0); - intel_gpio_set_gpio_mode(padcfg0); + /* Put the pad into GPIO mode */ + value = readl(padcfg0) & ~PADCFG0_PMODE_MASK; + /* Disable SCI/SMI/NMI generation */ + value &= ~(PADCFG0_GPIROUTIOXAPIC | PADCFG0_GPIROUTSCI); + value &= ~(PADCFG0_GPIROUTSMI | PADCFG0_GPIROUTNMI); + writel(value, padcfg0); + /* Disable TX buffer and enable RX (this will be input) */ __intel_gpio_set_direction(padcfg0, true); @@ -775,8 +770,6 @@ static int intel_gpio_irq_type(struct ir raw_spin_lock_irqsave(&pctrl->lock, flags); - intel_gpio_set_gpio_mode(reg); - value = readl(reg); value &= ~(PADCFG0_RXEVCFG_MASK | PADCFG0_RXINV);