Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6545473imu; Wed, 14 Nov 2018 03:18:14 -0800 (PST) X-Google-Smtp-Source: AJdET5e4b7l20ydtLKKil/u7vxDqE9uBgzXR4ZhIcmf4Q4WIAFXgQOv6abBvGN1grGjEnjjdvO2i X-Received: by 2002:a17:902:9a9:: with SMTP id 38-v6mr1541256pln.180.1542194294884; Wed, 14 Nov 2018 03:18:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542194294; cv=none; d=google.com; s=arc-20160816; b=Tf3fEOn2Xv5dCYnrOaM/mQ1qkvX4e0Ifzk6MtDjbRhpPyYIJi6BQtXxNp8PgLVQfTn IF90Ns/avkgYSJ6MIZ59cCxFmgLyA/yt3QeAIT0UXSqr/jQE8cTRdji5vq9Z0rFkZvXR hirvQ2k5Et2yzQxv8Bh/X6qbK7PuoFsplP3Zr9NMFWbAode3XbDjsFza5ywHU87hBlHC XR7OMrayE4hFoh4Qc0BIOclHUZnE2zIkgCu2DnRaTwk7+b2HdyN9tKGs6VNvpcaeKGgM oH3XzX0f/NOH39wrW/7ufr9Y7xiJsEEKsGg8mN9Psz46YSHRdY/WV9VV1npjwr7U9uco Grjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5R5R/K7nuIycToQkxWlXuKp4h7yvntH8REYpXFPi/HA=; b=emVOfg+9gst0x5NL4n186lCwLKa+cq1hQTga4qmdsSlzV4NF9G/RSno4bQK7fIZpsr P+LR1Mc240XTEPEc+S68SOW8hdsldx2wQLa943mYtil1P9H9BaXIxJF3ZB7Wdcua+Zf6 9uOfR8E+rM2M1ACGipeegzvLxj9v9sUcEn7I/x0whlxO4SNP+8EysmFce1957snGDQZ7 ATyxXCn2JO0AR105b7LdP/4rlt2CBc/zBF3JgzjeEeshM9cJUed5Q68jaKV697JAwFVD LjA+miklFwmDJozHbRRQ8BVpopCqufgjUU+iWnwNmY6zNWAlSK/06KHHut31P0y0Bxdb /Ksg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rSt0gxXV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i64-v6si25713991pli.135.2018.11.14.03.17.59; Wed, 14 Nov 2018 03:18:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rSt0gxXV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728391AbeKNVU0 (ORCPT + 99 others); Wed, 14 Nov 2018 16:20:26 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:43309 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbeKNVU0 (ORCPT ); Wed, 14 Nov 2018 16:20:26 -0500 Received: by mail-qk1-f194.google.com with SMTP id r71so24962778qkr.10; Wed, 14 Nov 2018 03:17:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=5R5R/K7nuIycToQkxWlXuKp4h7yvntH8REYpXFPi/HA=; b=rSt0gxXVoTrhRK2WCJmgZDFZlhIhm6t+OzAi4LlmL23+L0lSd5eoZ51ynAwUVHcR/u w5rlz4lnCkdvbPdyf4dfCVpHI+g6xPQIzeRz8b2tXYPOaJ+rO3Y11Nd52W9erj9gPF8H 8YDbHvCf2vNFqDHpBAWw4crIcHXfyuYQjsdT1UNrJ9VfgxoqUsSsQut8CZrQ/3Z9S4vq 9sKJmQplh4oE3azpljW4JfhNyX2i7FsuYeDlqU+ie2rsu/VywoHnmPBscItvvAh9tQXp AWKlMYyZp/7xeqKvpFyv6Qqp1ydZ03Q/OiHWos30e9fhzLpIpY7Gq4dgeh6zC0dYn7fA aBtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=5R5R/K7nuIycToQkxWlXuKp4h7yvntH8REYpXFPi/HA=; b=WCcM04neOuFngFJA3XSHObzwEigr91hyp/toKgTkiywMFiTJRczRLORBkXec452ZEE TnycphmTHqbImKnM14m/WCEpOV7bzdHCTTr2N0GU4MY28kw4S98PS9paRPJyOXVn2Ogx GEo/5XstC2JCA91okD84HUrZAke1MNzsKQd9lCoDmUnuMCdFq904mrJVQTPuYBgQnTy/ GoM3AFhahnvlS/st/apr4pEduAGCTTgE7JwiZn0KfceeYaPGHyIs0vBA4vNP31bkdGxc Saj+d/1/OfTOwmziQPinOL6I/wPFFKKsGy50RN4jYC3tqMpradsVB+IJxvNmnxG8F6UU 9hpw== X-Gm-Message-State: AGRZ1gIzs3SQDb7YEHY9VCfLd5h5Lz38dwgW1oPFYW67wxqK6CgUuGOb cWv62kqEphhOJgmsRvny7Ynd6fbfxv7VnKT0CGk= X-Received: by 2002:a0c:d268:: with SMTP id o37mr1338653qvh.136.1542194255302; Wed, 14 Nov 2018 03:17:35 -0800 (PST) MIME-Version: 1.0 References: <20181110181101.24557-1-andriy.shevchenko@linux.intel.com> <20181110181101.24557-2-andriy.shevchenko@linux.intel.com> <5BE8C821.5080002@samsung.com> <5BEB63C3.1020504@samsung.com> <5BEBE741.6050101@samsung.com> <20181114093652.GK10650@smile.fi.intel.com> <5BEBEF7C.7060003@samsung.com> <5BEC018E.8020102@samsung.com> In-Reply-To: <5BEC018E.8020102@samsung.com> From: Andy Shevchenko Date: Wed, 14 Nov 2018 13:17:23 +0200 Message-ID: Subject: Re: [PATCH v1 2/5] extcon: Return -EPROBE_DEFER when extcon device is not found To: Chanwoo Choi Cc: MyungJoo Ham , USB , Felipe Balbi , Guenter Roeck , "Krogerus, Heikki" , rogerq@ti.com, Linux PM , "Rafael J. Wysocki" , Sebastian Reichel , Linux OMAP Mailing List , Darren Hart , Platform Driver , Greg Kroah-Hartman , Linux Kernel Mailing List , Chen-Yu Tsai , Hans de Goede Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 14, 2018 at 1:05 PM Chanwoo Choi wrote: > On 2018=EB=85=84 11=EC=9B=94 14=EC=9D=BC 19:20, Andy Shevchenko wrote: > > On Wed, Nov 14, 2018 at 11:48 AM Chanwoo Choi w= rote: > >> On 2018=EB=85=84 11=EC=9B=94 14=EC=9D=BC 18:36, Andy Shevchenko wrote: > >>> On Wed, Nov 14, 2018 at 06:13:37PM +0900, Chanwoo Choi wrote: > >>>> On 2018=EB=85=84 11=EC=9B=94 14=EC=9D=BC 17:35, Andy Shevchenko wrot= e: > >>>>> On Wed, Nov 14, 2018 at 1:53 AM Chanwoo Choi wrote: > >>>>> > >>>>>> I was thinking about again to change from NULL to EPROBE_DEFER. > >>>>>> > >>>>>> extcon_get_extcon_dev() function was almost called in the probe fu= nction. > >>>>>> But, this function might be called on other position instead of pr= obe. > >>>>> > >>>>> *Might be* sounds like a theoretical thing, care to share what is i= n you mind? > >>>>> Current users and more important the new coming one are *all* doing= the same. > >>>>> > >>>>>> ENODEV is more correct error instead of EPROBE_DEFER. > >>>>> > >>>>> So, you are proposing to continue duplicating conversion from ENODE= V > >>>>> to EPROBE_DEFER in *each* caller? > >>>> > >>>> The extcon core don't know the caller situation is in either probe()= or other position > >>>> in the caller driver. The caller driver should decide the kind of er= ror value > >>>> by using the return value of extcon_get_extcon_dev(). > >>>> > >>>> extcon_get_extcon_dev() function cannot be modified for only one cas= e. > >>>> If some device driver call extcon_get_extcon_dev() out of probe() fu= ction, > >>>> EPROBE_DEFER is not always correct. > >>> > >>> I agree with this, but look at the current state of affairs. All user= s do the same. > >>> If we need to have another case we may consider this later. > >> > >> Because we know the potential wrong case of this change, I can't agree= this change. > >> If extcon_get_extcon_dev() returns ENODEV instead of EPROBE_DEFER, > >> it is clear and then there are no problem on both current and future. > > > > Changing NULL to -ENODEV is a trading bad to worse. > > I would not go that way, so, it's your call. > > If you think that this change is not necessary, just keep the current cod= e > without the modification. Not only this, the useless churn for no benefit to anyone, except some *theoretical* cases no one saw. > Please drop this patch on next version. I will. > >>> API inside the kernel are not carved in the stone. > > > > Only can repeat myself (see above). While I see *theoretical* > > rationale on your side, mine has *practical* proofs. > > So, I'm giving up on this and will duplicate same what it's done in 4 > > current callers. > > > > I think that it is more important for removing the potential wrong case > instead of removing the duplicate code. The many device drivers already > decided the proper error value by using the return value of function of > kernel framework. The API has been introduced back in 2012. commit 74c5d09bd562edc220d6e076b8f1e118819c178f Author: Donggeun Kim Date: Fri Apr 20 14:16:24 2012 +0900 So, you are insisting that 6.5 years of use in a way people are using it is wrong? I don't know what might change your mind, but for me it's a clear win-win to switch to deferred probe error code based on the *practical* evidence. But as I said, I gave up now. P.S. I still disagree with your arguments in relation to de facto use of an= API. --=20 With Best Regards, Andy Shevchenko