Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1723958pxj; Wed, 19 May 2021 12:22:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2hSNqDElhxsPdNnbCkxmxKDk675GDURmZHA33BET7JATjO6CNrDEGPBaWs65djdHQ2/TM X-Received: by 2002:a92:c884:: with SMTP id w4mr683522ilo.117.1621452138397; Wed, 19 May 2021 12:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621452138; cv=none; d=google.com; s=arc-20160816; b=zjy8Nx0RFrcbQRFLVSxDmxymcKpDVfwkuX+dPadn1EDK8e3cuhUuY8d5oJpNXePYtl QBxNh8nitJFrrXltgaPMDk8f+bm6rjEpcOTCnXzBhMQoUTNLT6Qb9wc5bUfD8ScYfVW0 VDsEktsmo6xDd7hrXPC7DV95KURDaHTOuwkV/6PTYuiMwl246tub1s4qoaCVKhaoYIo5 SXJEhzr/hmRfXG565YAomWDp1pE7BvAOlTsD9WUhUE0T2uQPJUQMnNNarwfWf/ajPbnz F7xjlT+mvuxYO4t235GJBB6rqw57ajtk4QTIf0AcW7JjbiLQgrWUPhjuYWCsVF/Fp0pj OdNg== 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 :ironport-sdr:ironport-sdr; bh=YlVcT+DNs3wvqlhbodYl5oe+taHXrJRjMBIzIcgRYuA=; b=e0ZwMVthIeCbEH9sPHqMzWBVWOH5ZHEf7qog54PjTHyOCyEXBDTKclwpXsYZ0Jeasb Hj7hp17JEceSd7IPULzWWDP5nhUR1/dopH56FlOmpvvs8CoJwpgDXivXAERobtXOHWmj wv9F+CRcvkucqzxFCjWGzrSu90yZh5i6w/E0ULnhtaJXMAEStujQ8xriaXbaddISAlVK nSHbYNBHqkh4ozJAuOKZyr4rAaJUaIQ1P3LLfvH6nn0XAdK32Tnee2TpCHW89cyCTBiK 4l7dsVtPFvGFQfhrGcc66xvOMlBFdx0/CJpH7MVKM1OEpg6NOvlD8BGqQUyBiLuaFtbf kNrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si501021ilm.86.2021.05.19.12.22.05; Wed, 19 May 2021 12:22:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245169AbhESIcH (ORCPT + 99 others); Wed, 19 May 2021 04:32:07 -0400 Received: from mga03.intel.com ([134.134.136.65]:34329 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244959AbhESIcF (ORCPT ); Wed, 19 May 2021 04:32:05 -0400 IronPort-SDR: 6C5Dr4t6r5QknYSrDgPH67vi2+5zfgCMIVi70gZoBbpEPZnKZrG36eTG9s5s6REuWDWjEeIDsv pvglub9W1ilg== X-IronPort-AV: E=McAfee;i="6200,9189,9988"; a="200982647" X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="200982647" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 01:30:28 -0700 IronPort-SDR: xTbh/GsgBHbPnnZtHA1+mOELbVKlC/3T0j19wwWAqm+E0gXXDO5KhBmbHh4vlGtg9yJd7K12zi I3AlsE9jcqcw== X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="405414713" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 01:30:25 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1ljHaw-00DAuF-4V; Wed, 19 May 2021 11:30:22 +0300 Date: Wed, 19 May 2021 11:30:22 +0300 From: Andy Shevchenko To: Kent Gibson Cc: Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Suresh Balakrishnan Subject: Re: [PATCH v1 1/2] gpiolib: Never return internal error codes to user space Message-ID: References: <20210518155013.45622-1-andriy.shevchenko@linux.intel.com> <20210518232451.GA7362@sol> <20210519080434.GA22854@sol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210519080434.GA22854@sol> 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, May 19, 2021 at 04:04:34PM +0800, Kent Gibson wrote: > On Wed, May 19, 2021 at 10:45:16AM +0300, Andy Shevchenko wrote: > > On Wed, May 19, 2021 at 07:24:51AM +0800, Kent Gibson wrote: > > > On Tue, May 18, 2021 at 06:50:12PM +0300, Andy Shevchenko wrote: > > > > Currently it's possible that character device interface may return > > > > the error codes which are not supposed to be seen by user space. > > > > In this case it's EPROBE_DEFER. > > > > > > > > Wrap it to return -ENODEV instead as sysfs does. > > > > > > Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines") > > > > Fixes: 61f922db7221 ("gpio: userspace ABI for reading GPIO line events") > > > > Fixes: 3c0d9c635ae2 ("gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL") > > > > ... > > > > > You immediately revert this patch in patch 2. > > > My understanding is that is not allowed within a patch set. > > > > > Why split the patches instead of going direct to the new helper? > > > > It's for backporting to make it easier. (I deliberately left the context above) > > > > I can fold them if maintainers think it's okay to do. > > > > Not sure what the constraints are on backporting, but wouldn't it be > simpler and cleaner to backport the new helper? Logically (and ideally) it would be three different patches: 1) introduce helper 2) use helper 3) fix places where it's needed to be done But the above scheme doesn't fit backporting idea (we don't backport new features and APIs without really necessity). So, the options left are: Option a: One patch (feels a bit like above) Option b: Two patches like in this series (yes, you are correct about disadvantages) > But, as you say, it is the maintainers' call. -- With Best Regards, Andy Shevchenko