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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E68F6C4167B for ; Wed, 29 Nov 2023 16:10:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230439AbjK2QKV (ORCPT ); Wed, 29 Nov 2023 11:10:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjK2QKT (ORCPT ); Wed, 29 Nov 2023 11:10:19 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B38ACD66; Wed, 29 Nov 2023 08:10:25 -0800 (PST) X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="397080488" X-IronPort-AV: E=Sophos;i="6.04,235,1695711600"; d="scan'208";a="397080488" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 08:10:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="772729723" X-IronPort-AV: E=Sophos;i="6.04,235,1695711600"; d="scan'208";a="772729723" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 08:10:22 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1r8N8l-00000000Tvw-3QdB; Wed, 29 Nov 2023 18:10:19 +0200 Date: Wed, 29 Nov 2023 18:10:19 +0200 From: Andy Shevchenko To: Boerge Struempfel Cc: Linus Walleij , Bartosz Golaszewski , Andrew Jeffery , Charles Keepax , Rob Herring , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, bstruempfel@ultratronik.de Subject: Re: [PATCH v3] gpiolib: sysfs: Fix error handling on failed export Message-ID: References: <20231129152307.28517-1-boerge.struempfel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231129152307.28517-1-boerge.struempfel@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2023 at 04:23:07PM +0100, Boerge Struempfel wrote: > If gpio_set_transitory() fails, we should free the GPIO again. Most > notably, the flag FLAG_REQUESTED has previously been set in > gpiod_request_commit(), and should be reset on failure. > > To my knowledge, this does not affect any current users, since the > gpio_set_transitory() mainly returns 0 and -ENOTSUPP, which is converted > to 0. However the gpio_set_transitory() function calles the .set_config() > function of the corresponding GPIO chip and there are some GPIO drivers in > which some (unlikely) branches return other values like -EPROBE_DEFER, > and -EINVAL. In these cases, the above mentioned FLAG_REQUESTED would not > be reset, which results in the pin being blocked until the next reboot. Thank you! Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko