Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4693821rdh; Wed, 29 Nov 2023 08:10:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBHWTcmN94aLhgxA+wD6vQQA7SEst4l1b4/sN/gq0ZUcQ1fuY2axhFcEmRDW2VK3TotUeN X-Received: by 2002:a05:6a20:9150:b0:18b:9682:59e9 with SMTP id x16-20020a056a20915000b0018b968259e9mr19327689pzc.21.1701274243847; Wed, 29 Nov 2023 08:10:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701274243; cv=none; d=google.com; s=arc-20160816; b=am6Yia9M5DGZwQdP+UZU9sbudYHfzBSOZCfWy/RllOn3qYdhghM/cbUH3SWooHNBR/ dyUvxG3H0KDAEBf271NP7nVrfQgpdqH1vIrKA/cbdF9PEmdzkywH3k0LAtClGvvUtxKh n44lAZdwqGOFcDsyabUqLJfIHDfFgbfgM6Z3vW0dFf2qq6hY7OoBP9UWuMJS0qnV2HEa f+4wA4fp5DGuHUy+nC4wa8bjNNSkEchaQ9muKBSD+VOQ2IVNsM2qK905YDvMkKeNyUFL 6L5Jqzvzaj05o68sW6T8g9ZOFyeheiR27fC8EMwYUU1tJkfup2VBP7SaNJHAUaw/iy2Z maLQ== 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; bh=Z7/ijJ91o/dFQOBdNavG+0G3cVwxH+u8g2OA3bJV4Fs=; fh=TeczMB/YaDZnJA5avnHlsdqoyg86MHJ1RBRmk5YMeIM=; b=yNTVwojVPdlcL+A+mrakN4fp5/PMhYHHO0McjyTWu+eah89WTMumFcY49Tl8d3ExVm lRiOHrzjjATtsxmtxqpTV4egD3QBe/xqhdcjFTdchCyFB/CFHhbFX6HR0Zo6xWz6xrEc QR3tx9nzf7XGOy5537OtXTCeYrTltdXF40W02ddRSK2RdFGxzif87sXi1oJwZDwAtfFD pG8GFE1FOCem6odFP6C5fUI/aTBHmmEEGecwYQngX4Gj1dWf4edWSLHH7Y5EFKsCrWKA kBDqEg8VAFfoiGi2HYMRvr47itxsqbiChOD2nRvLdMJC54rYUQ8x9kE+S1M526nos1+1 Pl1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id z15-20020aa7888f000000b006c98123e8acsi14978713pfe.24.2023.11.29.08.10.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 08:10:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C9B13804F470; Wed, 29 Nov 2023 08:10:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbjK2QKU (ORCPT + 99 others); Wed, 29 Nov 2023 11:10:20 -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 X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 29 Nov 2023 08:10:36 -0800 (PST) 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