Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp505210ybb; Sat, 28 Mar 2020 04:14:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs1NeQznQTTzNir0rgyLjPS5B3OwYoNX1JbZ2DmNyA8Mq8QCe7hFaKLAyE+5BIZSVmjJ2eV X-Received: by 2002:a4a:da03:: with SMTP id e3mr3086581oou.4.1585394063739; Sat, 28 Mar 2020 04:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585394063; cv=none; d=google.com; s=arc-20160816; b=gPJIQjI15IPbeBjjJ9Mv3a74c71CFx2rU9g5CMbucTVD//0k5ZevdHOVlrn7efNDVX 55AIL5gpq9yUfOv81ibRtbhxOh+9GY3HXxGVcgDn5P+A33OtBDOOx7/qQrRY1S5U8ey7 FAkZSHVqLthTcmEqoRFKFk7wOdJGuaZhb1B81hH+z04N5GgwHYrx0ob9pzyQSAMBuuPg ULLlh8DGxGL2JAtLBnyaLQqOoGTvGXGjlPQRkWh3zHuMWpAOrtdsG9YjVIUykdtN4AWL z151Z34tJlJCaXMMb0AaXGJApxBMQF7TBj7y2mUIpTCl+cwRhUTGoTSen7bRsd1jdpaN UBew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JHKDu3SHaGK6jliTTjKmnnyNvNI2zpe4g9Mnvcse/6U=; b=q+bAxu56FB9C+JZFtz+3mCMp2cxMeoViQI4j7mqZND2eokz18q2+phh1ZmiNEbnFzL iR1OP99bhU/+6UmZZX//24Pu/qMPUCYz2DB5YJAwlkcWJ3pGP1C6dhFaSINWqED3UYAE mO0mWRHpG6w31j4jKCjfQck2WfG5C+8Wo9FwgzmRQYEICxGVuQLOrAl9+n++vcWiJlD9 uqg8tDL1F4+4UC0ufk92lQsAQPdgMp168WjyrsX4fjjXI7bZXj6RWr1NEbDdgSZSg4HK +sdQ7cYMDiTQriQk32ReSyrye14mPRJu2E+tDsaaJQpPawp2P3A8Jc1D1LO/xsolpxyV 4vKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JjZXpr+f; 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 y5si2833130oiy.150.2020.03.28.04.14.10; Sat, 28 Mar 2020 04:14:23 -0700 (PDT) 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=JjZXpr+f; 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 S1726265AbgC1LNy (ORCPT + 99 others); Sat, 28 Mar 2020 07:13:54 -0400 Received: from mail-pj1-f67.google.com ([209.85.216.67]:39142 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbgC1LNy (ORCPT ); Sat, 28 Mar 2020 07:13:54 -0400 Received: by mail-pj1-f67.google.com with SMTP id z3so4394144pjr.4; Sat, 28 Mar 2020 04:13:54 -0700 (PDT) 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; bh=JHKDu3SHaGK6jliTTjKmnnyNvNI2zpe4g9Mnvcse/6U=; b=JjZXpr+faWoFwnjljT/0aLpOMDk8TEgnmJo5L/tJtSac1bSLEI/7nzIMDDflEAndud t04+2fwxNWfa0/yVL2EOOrh+dJBumrDRR1PUQO2nZ4GqhHxiSMvwhStGoyOmQNv+tgPn ieKULnxkXw0O7XA0pzo4/0XtZf3KuaKGcq8BQF3aEviBvQHf3ICILu1RyallfDi6BzbD wLZXwJzSL27Kn/ygUc2MQoul2uuqnmnW6rtwEZBP3lNiEGgIOSfsVgDbzRu7GcodnI7T lDuUoDF5AqRN4qTNX75v7s4odfqgWZbZFzNDq6/u4fD7K6DMu2A4jfMZw+GawwCHXnGL ODEQ== 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; bh=JHKDu3SHaGK6jliTTjKmnnyNvNI2zpe4g9Mnvcse/6U=; b=f9/Nl03TiRGUEFkuRWC+5SHJoJexdTtGIczpxwQeiAbnQgHXh6NKKzLctlINJGCqwe vtMoGIvnrKa19ca4jXCXjk5pJHjVUi01YR9xPn2IrEiQrspYQGd0QSTfxmBg1SU7ab4d m9mvz+qp+27S3gHe4g8Vyz4+YkmtATBOKtSGNscPB9zowgUtBscf6GpkCabI7zxMY09g VqWK7j/l/7Ae8G6aJhCVzR//+4OylL0Dfuygf696XppDpaalI70Sg8QOIwyn2g8pVbKn oDhfOmTDTk4EuBzIF9E67R4AK8kUNe8JtDP+6EXA511EoSoIGKICjVY0hdj9bH86bR1C IWXQ== X-Gm-Message-State: ANhLgQ2MyhmuyzlG6Ao5NpMxex0wm4Y3qyqNVx/XWRN7L3c2zRKYNW0Y Hnj34NBQ7FQlm6nrbe03TOisS2aWFmlXDEAXh70= X-Received: by 2002:a17:902:7c05:: with SMTP id x5mr3440708pll.255.1585394033590; Sat, 28 Mar 2020 04:13:53 -0700 (PDT) MIME-Version: 1.0 References: <20200327170132.17275-1-grant.likely@arm.com> <2885b440-77a5-f2be-7524-d5fba2b0c08a@arm.com> In-Reply-To: From: Andy Shevchenko Date: Sat, 28 Mar 2020 13:13:42 +0200 Message-ID: Subject: Re: [PATCH] Add documentation on meaning of -EPROBE_DEFER To: Saravana Kannan Cc: Grant Likely , Linux Doc Mailing List , LKML , nd , Jonathan Corbet , Greg Kroah-Hartman , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 28, 2020 at 1:57 AM Saravana Kannan wrote: > On Fri, Mar 27, 2020 at 4:25 PM Grant Likely wrote: > > On 27/03/2020 18:10, Saravana Kannan wrote: > > > On Fri, Mar 27, 2020 at 10:01 AM Grant Likely wrote: > > >> > > >> Add a bit of documentation on what it means when a driver .probe() hook > > >> returns the -EPROBE_DEFER error code, including the limitation that > > >> -EPROBE_DEFER should be returned as early as possible, before the driver > > >> starts to register child devices. ... > > >> +Optionally, probe() may return -EPROBE_DEFER if the driver depends on > > >> +resources that are not yet available (e.g., supplied by a driver that > > >> +hasn't initialized yet). The driver core will put the device onto the > > >> +deferred probe list and will try to call it again later. If a driver > > >> +must defer, it should return -EPROBE_DEFER as early as possible to > > >> +reduce the amount of time spent on setup work that will need to be > > >> +unwound and reexecuted at a later time. > > >> + > > >> +.. warning:: > > >> + -EPROBE_DEFER must not be returned if probe() has already created > > >> + child devices, even if those child devices are removed again > > >> + in a cleanup path. If -EPROBE_DEFER is returned after a child > > >> + device has been registered, it may result in an infinite loop of > > >> + .probe() calls to the same driver. > > > > > > The infinite loop is a current implementation behavior. Not an > > > intentional choice. So, maybe we can say the behavior is undefined > > > instead? Why? *Good* documentation must describe the actual behaviour, not hide it. > > If you feel strongly about it, but I don't have any problem with > > documenting it as the current implementation behaviour, and then > > changing the text if that ever changes. > > Assuming Greg is okay with this doc update, I'm kinda leaning towards > "undefined" I think it should not distort the reality. > because if documented as "infinite loop" people might be > hesitant towards removing that behavior. This is funny argument. Won't we do kernel better? > But I'll let Greg make the > final call. Not going to NACK for this point. -- With Best Regards, Andy Shevchenko