Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1882257pxb; Mon, 8 Mar 2021 08:34:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYWfbOBP/YCZhqXc9kDghMB0ZH/9KkLcBuOsM4vLgdSUqyUz4X8JuJ/xmHoRN8gKcygk6a X-Received: by 2002:a17:907:d09:: with SMTP id gn9mr9495317ejc.538.1615221247276; Mon, 08 Mar 2021 08:34:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615221247; cv=none; d=google.com; s=arc-20160816; b=Dki+Nza/G0XjgFllYflVlA59kDTtWejBK5/UO3jVpJ5g3WykSl4SraaOpq2o7rZHiG 4ms0ks9Sks+GWWDa5xiw1+X+5KetAbtovA2CButZuMcL1KEUxYFRekOsZRBIIPQOS1/c uoUCmIw0PtYceRH9SNnvIKle0ltyPDdIYb7pMOEiqp2QNxbuYD1kkCGcLjdiiDXQKWcb uwSgmaXoLTcnWn13iPeo+DevI34R8K9dz3ayBg4jRFx5XutNZ5FERTssteR0BrxXJvGu JKkeNluk3gsFqN/3I8XjQ+zhNize1UZaxlEHZbYy1KjsC4o6Z2/hD3dz02bQLznb645a eTFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=7Z26hMCr+RGw1SnEZC68bnGFlcfWW24WiNUmgsFYJp4=; b=aZLxR+h/loHicamG+Xr6sbRLD0raiTdauUVDZ+UL3Qoguh+l7F34BsYjgadCuRc2wK 9l6jqxjckmpm98FxTKaSKA7FvK+qKa0OWYapwF2UZElJpWQmRvS96ScNrW+Zd8loNxp8 DrtbjeXgS1CF8S3OqgA50HqiTUUit0pJGgkZcKZVTsS/s185s4IIPvBUlZ7H8A4jatMn hx/HibWg2gReW3k6GL3LgkxBLr1+mVDdwLOxbtxtzKCPRVPHF/bunAtJ40sB2u4VjQnR rdp6A18GJIdbGSZd6Rj8SooE7gGQ1ExscBAHBeanyz+PlciypnVpkNcqhlfX5aKziWLa fhMw== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bg8si7326407ejb.155.2021.03.08.08.33.43; Mon, 08 Mar 2021 08:34:07 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229928AbhCHQcP (ORCPT + 99 others); Mon, 8 Mar 2021 11:32:15 -0500 Received: from mga05.intel.com ([192.55.52.43]:33438 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbhCHQbz (ORCPT ); Mon, 8 Mar 2021 11:31:55 -0500 IronPort-SDR: 1ce0V+Q2AHiFFQnu2w0Pb3p4PkpLzrXgYPR+SWBecR1hKNNqW3W1R4jdyfzyMExsTqn1Qove8s xvl3+eM6LWEw== X-IronPort-AV: E=McAfee;i="6000,8403,9917"; a="273088144" X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="273088144" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 08:31:45 -0800 IronPort-SDR: FFkRJrRrrmmdp9w/IFmdmunuya4Dr+U70+lf896ro74basjMCreJ0dPxWJCmTUM0SsUGWa/Gt2 YucmS4w4C+jw== X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="402881389" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 08:31:43 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lJInE-00ArC6-VL; Mon, 08 Mar 2021 18:31:40 +0200 Date: Mon, 8 Mar 2021 18:31:40 +0200 From: Andy Shevchenko To: Maximilian Luz Cc: Mika Westerberg , Linus Walleij , Daniel Scally , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Revert "pinctrl: intel: Split intel_pinctrl_add_padgroups() for better maintenance" Message-ID: References: <20210308152505.3762055-1-luzmaximilian@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 08, 2021 at 05:35:59PM +0200, Andy Shevchenko wrote: > On Mon, Mar 08, 2021 at 04:25:05PM +0100, Maximilian Luz wrote: > > Following commit 036e126c72eb ("pinctrl: intel: Split > > intel_pinctrl_add_padgroups() for better maintenance"), > > gpiochip_get_desc() is broken on some Kaby Lake R devices (specifically > > a Microsoft Surface Book 2), returning -EINVAL for GPIOs that in reality > > should be there (they are defined in ACPI and have been accessible > > previously). Due to this, gpiod_get() fails with -ENOENT. > > > > Reverting this commit fixes that issue and the GPIOs in question are > > accessible again. > > I would like to have more information. > Can you enable PINCTRL and GPIO debug options in the kernel, and show dmesg > output (when kernel command line has 'ignore_loglevel' option) for both working > and non-working cases? > > Also if it's possible to have DSDT.dsl of the device in question along with > output of `grep -H 15 /sys/bus/acpi/devices/*/status`. > > > There is probably a better option than straight up reverting this, so > > consider this more of a bug-report. > > Indeed. Can you test if the below helps (probably you have to apply it by editing the file manually): --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -1392,6 +1392,7 @@ static int intel_pinctrl_add_padgroups_by_size(struct intel_pinctrl *pctrl, gpps[i].size = min(gpp_size, npins); npins -= gpps[i].size; + gpps[i].gpio_base = gpps[i].base; gpps[i].padown_num = padown_num; -- With Best Regards, Andy Shevchenko