Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3973192rdh; Tue, 28 Nov 2023 08:29:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHdZHmaxLDmiTsfH865SJLxkclpVsxrgU84eTuyiSDIte30i4uNHMJat67SKyhhHKRLplt X-Received: by 2002:a17:90b:3b4e:b0:285:9912:a4b0 with SMTP id ot14-20020a17090b3b4e00b002859912a4b0mr11307001pjb.24.1701188966482; Tue, 28 Nov 2023 08:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701188966; cv=none; d=google.com; s=arc-20160816; b=liwi0uHQ5+Ri/iveW6U00hvO2qIwdCIBRyWhdIdqftOnbSxExLDVXnGELeuY3bQI5f 6wgman3TLVqmhY1FmAZJmxJ4ZV0mv2oc6OYaIn7ILiL1kNU9za+4pGfgkaI+SwwdPeLR J00jCCMX1yp/R7mKDzbHmfMqbI5vTUoU40SIhCU4TRsYGebPEjpque7Qil/FX+0axzy2 IdN/7quSmvNb1blVWqyxaylQoE2OTUC+Zwyrlc/nPXwrvuv1uRZTU+iuHJm0SCnwpoTf 66DlpTB/NfQG98VV8zMgZR5yypQPdng0NrcJSrYEChwlGNxYGE+TW3d0Tt5CYtaHyZqN EUcQ== 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=GXDupRXnXdXW8rCt5UDFY6BCkuG+K/vJegbeZTdxS5Y=; fh=R1rKugWqNe1fHYsvQuf50ppeOgrjKcNTVxMd82IsrMU=; b=pLnZRebV1tmvLB7Rst9+6qEk+QFTkyztiJhgNPykWE8VmOMcFwRe0zZlKvV2TTCgSc crImYqiRnfoHT4NnZN/o1HHq3/snW5E2klu70lRNu7obN1lcL2/k2MciEF9yVqiktX/3 FgtPhNmERrUYBe/d4xjY2sYYXIBm8cg7kFmJL+YV+ves1FkDwm+Eg24RxnV5R9FPyFth FPOQ0FEEvxsxQmhfDxuNTCYjqkIqcBXfOOxGhVhn1ROB5bplR7XGyrrZNiusdJrDe8af KZqiKVknVOu759DK1ggnNak88obuILeqOPDRINkitNfsM2OlPJID1jCCx6Z/rLpdSEaG zrQw== 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:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id a22-20020a17090a8c1600b002859d376d2csi9435510pjo.29.2023.11.28.08.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 08:29:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id E39E8804C67E; Tue, 28 Nov 2023 08:29:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229779AbjK1Q3L (ORCPT + 99 others); Tue, 28 Nov 2023 11:29:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232957AbjK1Q3L (ORCPT ); Tue, 28 Nov 2023 11:29:11 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53FB4D4B; Tue, 28 Nov 2023 08:29:16 -0800 (PST) X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="11654321" X-IronPort-AV: E=Sophos;i="6.04,234,1695711600"; d="scan'208";a="11654321" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2023 08:29:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="797625148" X-IronPort-AV: E=Sophos;i="6.04,234,1695711600"; d="scan'208";a="797625148" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga008.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2023 08:29:14 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1r80xT-00000000D0T-0zzl; Tue, 28 Nov 2023 18:29:11 +0200 Date: Tue, 28 Nov 2023 18:29:10 +0200 From: Andy Shevchenko To: Boerge Struempfel Cc: Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, bstruempfel@ultratronik.de Subject: Re: [PATCH v2] gpiolib: sysfs: Fix error handling on failed export Message-ID: References: <20231128141321.51669-1-boerge.struempfel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231128141321.51669-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 28 Nov 2023 08:29:24 -0800 (PST) On Tue, Nov 28, 2023 at 03:13:21PM +0100, Boerge Struempfel wrote: > If gpio_set_transitory() fails, we should free the gpio again. Most gpio --> GPIO descriptor (I already mentioned capitalization in v1 review) > 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 gpio --> GPIO > which some (unlikely) branches return other values like -EPROBE_DEFER, > and EINVAL. In these cases, the above mentioned FLAG_REQUESTED would not -EINVAL > be reset, which results in the pin being blocked until the next reboot. Fixes tag? (`git log --no-merges --grep "Fixes:" will show you examples) -- With Best Regards, Andy Shevchenko