Received: by 10.192.165.148 with SMTP id m20csp814122imm; Fri, 27 Apr 2018 07:58:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp8FTTdHUVCTdNDtFAlZuNje7A3yR1ivrouXSh3PDlGG02F1t92UlBRGT9SvuRCLIRl/5Ma X-Received: by 2002:a63:b253:: with SMTP id t19-v6mr2476773pgo.212.1524841082806; Fri, 27 Apr 2018 07:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524841082; cv=none; d=google.com; s=arc-20160816; b=m6g5LscZOlYlW4iDy/m0opdVAHF15L7m3+Yqs4gBzMNgdZqsR2YlbCX66x2e263LoL cZIZRMRF6xZLiSv99R2X/PnQyaQZGlXjGKz+8ZYRdXLdaXxq2lu+Rc1iIvmiwiSYA1Rb oKsJUIb41NGrVIQcDlhxXOjA33yPGInrIyxLFn7w4eMTf9Li+p4OA7Au5oPr0Oco4/+H AbOrTO0mijTBpwhNVHcBeabWOb8PqCFWnH+471iQLH50zs/YRmQOWs0DqlJ1s/Qp1Jj4 8ZDkrWK6of5z6KzTsuBCmRv34RKCBMUY3R/tBgwFelrW5ESH2wiB1dgOI6ZmBpeAo3MM 3sUw== 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=4vYLdSS67PtdjQFwxYYNYtNX8o6ym8gMD+cEYhBv21o=; b=iJWMR+L54e8LjH+Uw6AbMn02HaFpzKtZQzSuf8MVAblQ3uTWSwuZbTS4pfdeQY7Ouc y9P6F9Lmjoxx4L5+CgE2EiUXIrtZRJ59JP9KqfJ1ydMLanrl2CgMafrOJM2v5c+p8bsL 1lPfK7YjHegsvlGqhDwxGStlK8mIMV7eOi1/OTfruD5x7KRMpY0Okq4DB0pW54wT7o+X LN6xaG84IoLPDLmaQd2OLzKApD66uMX1vCc/yG34WZuJxgmuGEXYh8xBRygYl3hp+a0X 7j7kaq0NvTYu/Wn88KW8zRE54ifsvXJbfXY159hCiMlZZ+yLRwszFfrVk9HpH8yWQ6KK SXFA== 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 s1-v6si1365119pgb.281.2018.04.27.07.57.48; Fri, 27 Apr 2018 07:58:02 -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 S934092AbeD0OGP (ORCPT + 99 others); Fri, 27 Apr 2018 10:06:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:52122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934043AbeD0OGB (ORCPT ); Fri, 27 Apr 2018 10:06:01 -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 9EAAB21890; Fri, 27 Apr 2018 14:06:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EAAB21890 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.14 01/80] Revert "pinctrl: intel: Initialize GPIO properly when used through irqchip" Date: Fri, 27 Apr 2018 15:57:54 +0200 Message-Id: <20180427135732.999030511@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135732.928644313@linuxfoundation.org> References: <20180427135732.928644313@linuxfoundation.org> User-Agent: quilt/0.65 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.14-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 @@ -427,18 +427,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) @@ -446,6 +434,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); @@ -455,7 +444,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); @@ -940,8 +935,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);