Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5373649imm; Tue, 18 Sep 2018 08:32:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZclumN4K6FOkQZGTvhsmmbWDgDF9FuOlI8KsB9HMoREeTp+pfOTqRrbtRRJa9sx+Pr4Kq/ X-Received: by 2002:a17:902:5a4e:: with SMTP id f14-v6mr30454343plm.311.1537284740139; Tue, 18 Sep 2018 08:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537284740; cv=none; d=google.com; s=arc-20160816; b=nbsp7XwwtxwTqkB2ghZHIGYqgZP5zjf0xJ6x2rmb/OREd7EAVV57QfLHdgG/ehe2tT qEbvcMLF4E8qS5m7Z2AaYomwF9yTRQdm0nPKH3zz2nJBMG45hKzxhYT1ib5nPYee+3Ww XtFHQgdYHBNPv84waJhdAUg7QyTTM1Wmk8HVr2kHsYslIUFm8yBJw8eJCVE9i4Zdfk2q G6oVugSGHmUrB7iKuY6jt0i1EvrxWs6qdyy6h3iqZjU00870Z7XroJDggwMrVUX796ZV G/cuRbztG8quccaW+3fnYJRPKxhmtsm0XbsUljhMonSnoaZRQGZWHB2M/KBjx3VymhAG xz5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=A7dpJqVrbVxkxfdFh1oRfr99GObWO5Fs7KyQLpYQNkw=; b=Z73j9zoso7dAfRow7op6SzqilC23tDrYbmU3ZBnJAOGMnMe8flojjKLCgaZsjLT+AG 8q7DFPeO9TsES/WOAc94OB+A6M7pUe9mfLMA1HRZ6NcxNUwWqSJ23MkLvQhAYdcGP28b 82IICR6MVAh+6Msi6O+oqKQRrYBrHI/RggpUgOAu0/ujalTDpuLW7Rf/7gVvxEhuo+Ap Xb3C4bcgb/VUNBQ8G5/79p1Pv+nthQntpkdRs/3UGpC++d8CZpyMkoeIiKMvfJ5pfew3 uebGqbS7YMjVb01CKS15blFy6g98BZz9c2q5NdWVLBZ7bPmLqFgHk4CVfSIo8iGdukh6 wUJw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5-v6si17938069ply.193.2018.09.18.08.32.00; Tue, 18 Sep 2018 08:32:20 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729872AbeIRVEe (ORCPT + 99 others); Tue, 18 Sep 2018 17:04:34 -0400 Received: from mga05.intel.com ([192.55.52.43]:43273 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728065AbeIRVEd (ORCPT ); Tue, 18 Sep 2018 17:04:33 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2018 08:31:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,390,1531810800"; d="scan'208";a="74236927" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by orsmga008.jf.intel.com with SMTP; 18 Sep 2018 08:31:24 -0700 Received: by lahna (sSMTP sendmail emulation); Tue, 18 Sep 2018 18:31:23 +0300 Date: Tue, 18 Sep 2018 18:31:23 +0300 From: Mika Westerberg To: Rajat Jain Cc: Andy Shevchenko , Linus Walleij , linux-gpio@vger.kernel.org, Linux Kernel Mailing List , casey.g.bowman@intel.com, "Atwood, Matthew S" Subject: Re: pinctrl-icelake: driver writes to wrong offsets? Message-ID: <20180918153123.GK14465@lahna.fi.intel.com> References: <20180917081249.GM14465@lahna.fi.intel.com> <20180918083157.GC14465@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180918083157.GC14465@lahna.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 18, 2018 at 11:31:57AM +0300, Mika Westerberg wrote: > > As you can see in the above example, when I export the pins and change > > the directions from "in" to "out" PADCFG get updated correctly for pin > > 18, but when writing the value, it is the PADCFG for pin 42 that gets > > updated which is incorrect. > > It looks like we are missing translation (call intel_gpio_to_pin()) in > intel_gpio_set(), intel_gpio_get() and intel_gpio_get_direction(). IIRC > gpiolib handles the translation but here it seems not. Strange. > > > So this looks like a driver issue to me. Please let me know if I need > > to file a bug on bugzilla for this. > > I agree, definitely driver issue. Please file bugzilla about this (add > me and Andy there as well) and we'll investigate. If you have not yet filed bugzilla about this then I don't think there is need anymore as I think I have a fix already. It turns out with the custom GPIO base (Ice Lake, Cannon Lake) the translation is missing completely in ->get(), ->set() and ->get_direction() operations. I'll send a proper patch shortly.