From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA344C433E0 for ; Tue, 2 Jun 2020 15:25:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B186520757 for ; Tue, 2 Jun 2020 15:25:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbgFBPZ4 (ORCPT ); Tue, 2 Jun 2020 11:25:56 -0400 Received: from mga14.intel.com ([192.55.52.115]:37323 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgFBPZ4 (ORCPT ); Tue, 2 Jun 2020 11:25:56 -0400 IronPort-SDR: B1wyM2ReYPEAwfDFoGn8JOw4mtorvI1muWT/bmHwsbBzUSb4uPzK44Tj2yoai2fyDQazRHDZBT SS6aRy1kQBvw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2020 08:25:55 -0700 IronPort-SDR: 8G2Kl3wxqUb5fneDULn0yy2Ec9PNwlhKwRY7Yj0XjpyLnhQXYPhEmcmcQh29omLpiG8Q4dVFbU D6e9LRPKEsBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,464,1583222400"; d="scan'208";a="293615478" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004.fm.intel.com with ESMTP; 02 Jun 2020 08:25:53 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jg8nb-00ARtx-Vf; Tue, 02 Jun 2020 18:25:55 +0300 Date: Tue, 2 Jun 2020 18:25:55 +0300 From: Andy Shevchenko To: Hans de Goede Cc: Mika Westerberg , Linus Walleij , intel-gfx , linux-gpio@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] pinctrl: baytrail: Fix pin being driven low for a while on gpiod_get(..., GPIOD_OUT_HIGH) Message-ID: <20200602152555.GJ2428291@smile.fi.intel.com> References: <20200602122130.45630-1-hdegoede@redhat.com> <20200602152317.GI2428291@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200602152317.GI2428291@smile.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, Jun 02, 2020 at 06:23:17PM +0300, Andy Shevchenko wrote: > On Tue, Jun 02, 2020 at 02:21:30PM +0200, Hans de Goede wrote: ... > Wouldn't be simple below fix the issue? > > @@ -1171,14 +1171,10 @@ static int byt_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) > static int byt_gpio_direction_output(struct gpio_chip *chip, > unsigned int offset, int value) > { > - int ret = pinctrl_gpio_direction_output(chip->base + offset); > - > - if (ret) > - return ret; > - > + /* Set value first to avoid a glitch */ > byt_gpio_set(chip, offset, value); > > - return 0; > + return pinctrl_gpio_direction_output(chip->base + offset); > } > > > P.S. It's mangled, sorry. Cherrytrail does this way, btw, 549e783f6a1. -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E48A6C433DF for ; Tue, 2 Jun 2020 15:25:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C4C4A206E2 for ; Tue, 2 Jun 2020 15:25:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4C4A206E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D0086E121; Tue, 2 Jun 2020 15:25:58 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id C9C296E121 for ; Tue, 2 Jun 2020 15:25:56 +0000 (UTC) IronPort-SDR: iHr2kBoIBt6vk+U6sWheayI1thopa2SF0eQHUWe5CErBaKN8+/YksL/FU1hFtoJ3EmM04em1JV MnNNPuggxJ7g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2020 08:25:56 -0700 IronPort-SDR: 8G2Kl3wxqUb5fneDULn0yy2Ec9PNwlhKwRY7Yj0XjpyLnhQXYPhEmcmcQh29omLpiG8Q4dVFbU D6e9LRPKEsBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,464,1583222400"; d="scan'208";a="293615478" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004.fm.intel.com with ESMTP; 02 Jun 2020 08:25:53 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jg8nb-00ARtx-Vf; Tue, 02 Jun 2020 18:25:55 +0300 Date: Tue, 2 Jun 2020 18:25:55 +0300 From: Andy Shevchenko To: Hans de Goede Message-ID: <20200602152555.GJ2428291@smile.fi.intel.com> References: <20200602122130.45630-1-hdegoede@redhat.com> <20200602152317.GI2428291@smile.fi.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200602152317.GI2428291@smile.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: Re: [Intel-gfx] [PATCH] pinctrl: baytrail: Fix pin being driven low for a while on gpiod_get(..., GPIOD_OUT_HIGH) X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, Linus Walleij , Mika Westerberg , intel-gfx , stable@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Jun 02, 2020 at 06:23:17PM +0300, Andy Shevchenko wrote: > On Tue, Jun 02, 2020 at 02:21:30PM +0200, Hans de Goede wrote: ... > Wouldn't be simple below fix the issue? > > @@ -1171,14 +1171,10 @@ static int byt_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) > static int byt_gpio_direction_output(struct gpio_chip *chip, > unsigned int offset, int value) > { > - int ret = pinctrl_gpio_direction_output(chip->base + offset); > - > - if (ret) > - return ret; > - > + /* Set value first to avoid a glitch */ > byt_gpio_set(chip, offset, value); > > - return 0; > + return pinctrl_gpio_direction_output(chip->base + offset); > } > > > P.S. It's mangled, sorry. Cherrytrail does this way, btw, 549e783f6a1. -- With Best Regards, Andy Shevchenko _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx