Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4653387rdh; Wed, 29 Nov 2023 07:14:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4Pk58HPY4ei1fXmj7Y4RG5yRv59CqmQsCM1WU7HkfY/iRxN7DbnpH+jrtDWQ8R3QsAmnn X-Received: by 2002:a05:6a00:2449:b0:68f:b015:ea99 with SMTP id d9-20020a056a00244900b0068fb015ea99mr24016651pfj.10.1701270862901; Wed, 29 Nov 2023 07:14:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701270862; cv=none; d=google.com; s=arc-20160816; b=VxRexwe9F4Rx+UHN6rI7iS/1iM7pjK9jVMqoVbZCunnPrBFi/MThNaoHCXPOAz3u7/ Iu9HPssZfFna1gKxTlT3BndgUf2Usa88asXKv+gmRXpTYrOIgsMUs/yZPfGGar4k0gZp YD2zswZruiDthdBXqiq8ClbbDmvxVQoXW28FS9mFbfwnpjP2LYm8awu2j9IPR5lGuind n/+ISLMjcDfYZIdwxC6QiHdoeseOvOz529pHsqkzs72osggVhqKdjnQ2XZ9u+1gZq7Qr 1QrNxmDjFiVaNdNGINMQb694A9u5XEThjR5hXGNdMNhde3XixmkDbl8q45waNuatWfPf 7IjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0iIKWxGyiRbf3SG4rKDTOqBlNDSA1cc3f6H9uieYbWQ=; fh=NX667JbrJLLJ0T+0eX9fdQyM23UKqwCWsDHrXFG7LhU=; b=SogOYs8SMGcjcn3z6PyIefnRY4pyK1vUlRq8kGH9R/E796ZXGQhMrz7su3gHLHxmjw CWtG3u2b48g6RI1iqQr0dwxZ460nNdc0FtpU35xmIlNdcs2uKaGx+1TIjDCZXkf9Mznv Kac7sJOGQTvHhF8u9V/0Q5LSPk2bwNxlt55WzIZ5CHg58D4M0G5g7ymgrvFPafAd+iwT DDznS3OaLynrqrJ7jELZi26kg4yMAFmk0JKPIbaV5p5SAA/nMv39bz2Kk+cR+3z5RP83 0Ano8qxmq77jI6tklabhGAjd/yGHO+eKj7+ng9teV36vMHWnsZSIEBCuOa6iYlmpth5J cNDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cKrlOYww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y28-20020a634b1c000000b005be1ee5dfc7si13978908pga.9.2023.11.29.07.14.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 07:14:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cKrlOYww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 6DA7E80215E3; Wed, 29 Nov 2023 07:14:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234733AbjK2PNw (ORCPT + 99 others); Wed, 29 Nov 2023 10:13:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234568AbjK2PNu (ORCPT ); Wed, 29 Nov 2023 10:13:50 -0500 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA2DD5D; Wed, 29 Nov 2023 07:13:56 -0800 (PST) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5bdfbd69bd5so779647a12.1; Wed, 29 Nov 2023 07:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701270836; x=1701875636; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0iIKWxGyiRbf3SG4rKDTOqBlNDSA1cc3f6H9uieYbWQ=; b=cKrlOYww7cA9oC9eVtKWVO866JjR4DizsLqiWArerFVlB4p3vTGDlnoA2hQ8FuHyeS uydfCRImVLOf7TZP2fxOjXFXEsnbqTjTBt29tBkl8qCym/EHJLqQqbuU7FV0pyalum4V oEKw2RF/Kl718uN/Ij8Z58xwZsj+sXjuuSPaBMJw/mUAlGE/j43wL6nD0iEu7lRpJ5qQ rRojGhhBzHSuGWgNMAIgfKsgLaVtQxm9Sx9N5Ipz6Xq9nys7iEuynJUPtw8o1ONbZcDQ Brsvqq/d+DKWhnG0Y5rwGjoN0TXliFxpYoPJ8RlKU1A9rhsy7M5jm1JaoD+4mW0ABad/ OExw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701270836; x=1701875636; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0iIKWxGyiRbf3SG4rKDTOqBlNDSA1cc3f6H9uieYbWQ=; b=ufaLlVf6Q2xA9e0pWddQoBks3GwiC3xzoy3Ax/ggGef50aZn7Z2fputDHc3cWvFVSc 6+qFVPlgd5fszGQOfZOp80ez5C4I8NKzFSS3atpIvAlH/GtJeixSCS1uOe+MJsQW3iyQ oY7tMMyOJnBxs8AA8BKiMQCzZoFX4QRfKgmIrvJDfaSiz22wxIBdhE+plznlHYf/cAS3 IS/t1eoDhBAQETHxrSDA0N2f6H1xdGHR3JPOwvh2Db15g7YenvifFsJv+veC0KvAjTbX OfQBw15A2gf7FjBWblN91cFq4Nmf1Sn3gTM2n1oCJAoyiOlef44t+eGi+Y2FkzQUy6lk trgw== X-Gm-Message-State: AOJu0Ywl7k3ua4e5xv4BnRptfOQkErmE7XGzrrIIZGdYGvRmrGT4uEJI 5OYOJN3HC53ziVe/0ALosLPVEukp3/LRn0r0vUI= X-Received: by 2002:a17:90a:ad04:b0:285:a161:ad8f with SMTP id r4-20020a17090aad0400b00285a161ad8fmr19998927pjq.21.1701270835659; Wed, 29 Nov 2023 07:13:55 -0800 (PST) MIME-Version: 1.0 References: <20231128141321.51669-1-boerge.struempfel@gmail.com> In-Reply-To: From: =?UTF-8?B?QsO2cmdlIFN0csO8bXBmZWw=?= Date: Wed, 29 Nov 2023 16:13:44 +0100 Message-ID: Subject: Re: [PATCH v2] gpiolib: sysfs: Fix error handling on failed export To: Andy Shevchenko Cc: Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, bstruempfel@ultratronik.de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 07:14:20 -0800 (PST) Hello Andy Thanks again for your feedback. On Tue, Nov 28, 2023 at 5:29=E2=80=AFPM Andy Shevchenko w= rote: > > 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) > I'm sorry, I misunderstood your comment "GPIO" in the v1 review. I fixed it= for the next version. > > 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 converte= d > > 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 > thanks > > which some (unlikely) branches return other values like -EPROBE_DEFER, > > and EINVAL. In these cases, the above mentioned FLAG_REQUESTED would no= t > > -EINVAL > thanks, I missed that, when I added the minus to all the other Error codes. > > 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) > I thought it was optional. But I have added it for the next version. > -- > With Best Regards, > Andy Shevchenko > >