Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3521716pxb; Mon, 24 Jan 2022 11:18:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZY+EzXXQ29BS2AamXPOS8dybGuR351vF5rd+WIeDQrltagfD7il6+L1kCz3/jS+by7BuW X-Received: by 2002:a17:90a:ac0d:: with SMTP id o13mr2198783pjq.127.1643051932057; Mon, 24 Jan 2022 11:18:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643051932; cv=none; d=google.com; s=arc-20160816; b=YJSpHxOPRRJWmIJxm1rY26VMSRkiKDNfHA3evkT7hKOtUgo/zNWnDum9KA5kcn8OSm iu8fKfuKZVtQCXkQlfxY0mOBiSsa3Urina9qyIpXd2yCgBm1SckphdaXcaGsP748mqdz dVACbgSnqMpW1Yslo6NGJ1/xSqEtzhuID4CRdgDudvGY4/0o9XDmvtHe/w1gP2KFDrXL pEpGYneErJwyhO9zo7b2V6CQxc3VaKZWb07wAe0AFKNExhxZ7hXLKOFrvmNa4kcqXvqq KonI/KhVOt5xGCS+NqA8Sz0ZiJ68pxSd44htJ882EY8zat9RzZeqZv5GQ2F1XcvMR4uH 6Eiw== 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 :dkim-signature; bh=bbeMFJJU8c/dVtS/TErxma0l5yktrIgE+dLVFjIZshM=; b=hIA9LYPTWDKsFfgh8wXwtmE5cn4djw5XgQucjyVjaqNOAnY3ZEdLpbpqX1doY/Tu9Y yIUd96IA837/fV++DTBygViwcGePhPL2/aYqpfvvJ+lWyVRpI51/F7PBZuWa+djLnXOj NZ3M/r2BMgP32D2XO99W2gXQwGTHD16fvAAVj6d2sUQdb49w+ZMGBQsVJG4t5/ICBNiu fyzB96wBRfsbRwkZJDDB7OpqasyfhKSKTdmO9yFCK68WJcSC/BUSXYin9ebFbBQa30qn pBExJbW66YRz8w6OHlzOfYhs9CxpWotHCQCB04mQ+VB8Lv0NB6sRx5Qyj48da25AR0yJ uxTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a5iZ+wfo; 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=pass (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 d4si14508473pfj.223.2022.01.24.11.18.37; Mon, 24 Jan 2022 11:18:52 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=a5iZ+wfo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243174AbiAXNiG (ORCPT + 99 others); Mon, 24 Jan 2022 08:38:06 -0500 Received: from mga05.intel.com ([192.55.52.43]:10476 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242805AbiAXNiF (ORCPT ); Mon, 24 Jan 2022 08:38:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643031485; x=1674567485; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=a1PvZoXdi3eZ4pNxeDvVQM8Mgu1K/7QAjtKXbKbV6xk=; b=a5iZ+wfowl1QoAkaq8WEVMzchJJ5WZvbi1TIZrPQpEbXIcN+36Tt8L09 gJZovggf570T0Xa+SMKshUV2jFMOsKJiLytKC7s7n3CTac+hlFnW++EWZ /fi+G5GFmuTtCbNHCkzo4c6ZNbAAX0AOjphz8H8GnDK7A3VIYabird6wq zKD+Ja0W+fIYpq58eKCnl7Pa7Y6Oc70r5QTSY+UBzKZYFVtG62Lzw1+NP WmFc3ujdfyRVD6nvkOpADL+GM8lRkmlf38EPJptIFfh3coElB2vQmS5yX t7IkCeb7yvG+9GwI2muCwfSaAgC1HJMvcfXTxWaoptHCvZ/CthLCcE2Cw Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10236"; a="332398208" X-IronPort-AV: E=Sophos;i="5.88,311,1635231600"; d="scan'208";a="332398208" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 05:38:04 -0800 X-IronPort-AV: E=Sophos;i="5.88,311,1635231600"; d="scan'208";a="479074173" Received: from smile.fi.intel.com ([10.237.72.61]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 05:38:02 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nBzWh-00Du6c-MU; Mon, 24 Jan 2022 15:36:55 +0200 Date: Mon, 24 Jan 2022 15:36:55 +0200 From: Andy Shevchenko To: Mika Westerberg Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko , Linus Walleij , Kane Chen Subject: Re: [PATCH v1 1/1] pinctrl: intel: Fix a glitch when updating IRQ flags on a preconfigured line Message-ID: References: <20220119181915.27519-1-andriy.shevchenko@linux.intel.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 Thu, Jan 20, 2022 at 09:44:52AM +0200, Mika Westerberg wrote: > On Wed, Jan 19, 2022 at 08:19:15PM +0200, Andy Shevchenko wrote: > > The commit af7e3eeb84e2 ("pinctrl: intel: Disable input and output buffer > > when switching to GPIO") hadn't taken into account an update of the IRQ > > flags scenario. > > > > When updating the IRQ flags on the preconfigured line the ->irq_set_type() > > is called again. In such case the sequential Rx buffer configuration > > changes may trigger a falling or rising edge interrupt that may lead, > > on some platforms, to an undesired event. > > > > This may happen because each of intel_gpio_set_gpio_mode() and > > __intel_gpio_set_direction() updates the pad configuration with a different > > value of the GPIORXDIS bit. Notable, that the intel_gpio_set_gpio_mode() is > > called only for the pads that are configured as an input. Due to this fact, > > integrate the logic of __intel_gpio_set_direction() call into the > > intel_gpio_set_gpio_mode() so that the Rx buffer won't be disabled and > > immediately re-enabled. > > > > Fixes: af7e3eeb84e2 ("pinctrl: intel: Disable input and output buffer when switching to GPIO") > > Reported-by: Kane Chen > > Signed-off-by: Andy Shevchenko > > Acked-by: Mika Westerberg > > Please mark this for stable too. Pushed to my review and testing queue with the Grace Kao's tag, thanks! -- With Best Regards, Andy Shevchenko