Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp568011imm; Mon, 9 Jul 2018 06:58:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpctIALpBhXwItnLUan/bgYLdozgK3Jax4vWGJxKdUDPGUU7Erix3jDoVffhoPHWn+j9FWvh X-Received: by 2002:a65:52cc:: with SMTP id z12-v6mr19168610pgp.69.1531144728975; Mon, 09 Jul 2018 06:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531144728; cv=none; d=google.com; s=arc-20160816; b=vhplA8CpHco2Q33jCU9L31K+niWgqKC0scv0u7Nt42bbXDD9KOwiSx4F/dFbRQRadh HMJqyhQyg70ZC4AiC0asgNrYfZJmihc9wy6v232mgO4j/1Kn6vMQxf5/bY0IKY2onNAu cs06d+l6UXleb953UnUYggxrCJ8f35bzzSPLpevo9oRRc09uYT/YhHIH1fcMG+d+fAwS 3H3MetfGfx6ELmQmmZeOQBR4tqhVL8n5qTQNmKlGfZQT6Uj42f871Hv60JlVsHNKlUUo KnjqALFHpldL274WxjruvtqWb++CJjy1xTSxzSB9u/bG37ZpOODHmQgvlpn1naNtfIRi PyHA== 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 :arc-authentication-results; bh=e5IG2t5Mzhwos36ff7qsPwYHJMWObFoEvgBP/1DlqnM=; b=x2gCPZNtA+79s55/1CUYxskrzZiwqP6ySpWJb43Ic2cbkSgAZZ7owA5LjObQC5rmgQ eXP23wxzDG9P5a9SIoSTrMuCsxg7pRQFiWhuOsCwl3hn0/YVyFWcifbh7p3sndjVIoTS UGfv/+u0OI2PX1wjuYsNVnfDeOgWCRWq9LEI0x+sFFIysp6ROOR1Z0X/l098qYjYOPQ9 G52+DXLU6Zn43gTmJGXwPBo1NyPnR+nXMn3e961ma5Vm8zBHXKdm4A7llfMylaiOqQM8 +zxZqMj/cPpE33RqxNmtmyAvJf7QSFE/paZZ6XNqhW/dPMD2zPdcFQQ9nuMHWlAsxyue S2Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QklHNlPl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t66-v6si15982689pfg.292.2018.07.09.06.58.34; Mon, 09 Jul 2018 06:58:48 -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=@google.com header.s=20161025 header.b=QklHNlPl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932855AbeGIN5v (ORCPT + 99 others); Mon, 9 Jul 2018 09:57:51 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:43112 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932436AbeGIN5s (ORCPT ); Mon, 9 Jul 2018 09:57:48 -0400 Received: by mail-yb0-f194.google.com with SMTP id x10-v6so7205470ybl.10 for ; Mon, 09 Jul 2018 06:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e5IG2t5Mzhwos36ff7qsPwYHJMWObFoEvgBP/1DlqnM=; b=QklHNlPl7VgGYZ+cZybld4uAQloIk1Dmw3W3/aDk52r/W/mKCTsQoi9ZuNsbHPvA9N 4MR/tPisQwaUW+i7l/md8y1z5QQUCvGsYzPTnMIGFSs/GnhVowRykhmVVMcyxYfnp47+ dDHUvKDg7M5QpR0Ezls5rvUpRYYQxwu5Xynxea9wDRX9YJS4ZnpWE0t/1yYHNpC6MMIm OcWCq9sqiAkoM7Xqprv53VmKbunFdsfra+XfCjXbtpa8/yXHHc6ZRAVg50Mii4crr1YY OnYf5scl4wf6RtvoPycqYaDgzWmSoE/bSczhHGQFHmKZhyUAy6NKKG3oFa1cUMpmMVaO lf0Q== 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=e5IG2t5Mzhwos36ff7qsPwYHJMWObFoEvgBP/1DlqnM=; b=g4dugX+GZsfswyOsYo7u9O1c5Mbsdc2W3j+9nuBc+b7R2Ak3Qb20qksf0enri3Ow0L 59aRRvfmoNtXT7VbM2UZibtxkr/YN5kssUYzyrUgi25fBTl1restxl9AGKmzHTsfYuTe mKk2zUh94p+GHSrXupUpZJZ+xMsS+9GvFktij7Etu8HQpgfiuSs+gGRrGugEUYCKeQZa DHs7+/i+msQGXCz3WJ2mad8txBZxXldjn6A+fefGS3QiAjDuXDb/DBk07pTUmrkENp0g WF+OFoJ624f45ErlhPO/YuavKzkRGJ5Ci0iq2BQI6VD6yXa9xfBGHqWXIScW4tz+nGoP 9ozg== X-Gm-Message-State: APt69E2TbNiScz0DLBYRP5tY3s06bHK8D+HIPd/Tdvhyuc3ct+r+HWoi HZXVMxZU+0Lf5MtwUzJsd0lyFePhPyQv78JCIE0N X-Received: by 2002:a25:adcb:: with SMTP id d11-v6mr11392413ybe.73.1531144667595; Mon, 09 Jul 2018 06:57:47 -0700 (PDT) MIME-Version: 1.0 References: <1530600642-25090-1-git-send-email-kernelfans@gmail.com> <2108146.dv4EAOf6IP@aspire.rjw.lan> <8816662.k3KXbdkA2e@aspire.rjw.lan> In-Reply-To: <8816662.k3KXbdkA2e@aspire.rjw.lan> From: Bjorn Helgaas Date: Mon, 9 Jul 2018 08:57:36 -0500 Message-ID: Subject: Re: [PATCH] driver core: Drop devices_kset_move_last() call from really_probe() To: "Rafael J. Wysocki" Cc: Greg Kroah-Hartman , kernelfans@gmail.com, Linux Kernel Mailing List , Grygorii Strashko , Christoph Hellwig , Bjorn Helgaas , dyoung@redhat.com, linux-pci@vger.kernel.org, Lukas Wunner , Linux PM list 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 Fri, Jul 6, 2018 at 5:01 AM Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > The devices_kset_move_last() call in really_probe() is a mistake > as it may cause parents to follow children in the devices_kset list > which then causes system shutdown to fail. Namely, if a device has > children before really_probe() is called for it (which is not > uncommon), that call will cause it to be reordered after the children > in the devices_kset list and the ordering of that list will not > reflect the correct device shutdown order. > > Also it causes the devices_kset list to be constantly reordered > until all drivers have been probed which is totally pointless > overhead in the majority of cases. > > For that reason, revert the really_probe() modifications made by > commit 52cdbdd49853. I'm sure you've considered this, but I can't figure out whether this patch will reintroduce the problem that was solved by 52cdbdd49853. That patch updated two places: (1) really_probe(), the change you're reverting here, and (2) device_move(). device_move() is only called from 4-5 places, none of which look related to the problem fixed by 52cdbdd49853, so it seems like that problem was probably resolved by the hunk you're reverting. > Fixes: 52cdbdd49853 (driver core: correct device's shutdown order) > Link: https://lore.kernel.org/lkml/CAFgQCTt7VfqM=UyCnvNFxrSw8Z6cUtAi3HUwR4_xPAc03SgHjQ@mail.gmail.com/ > Reported-by: Pingfan Liu > Signed-off-by: Rafael J. Wysocki > --- > drivers/base/dd.c | 8 -------- > 1 file changed, 8 deletions(-) > > Index: linux-pm/drivers/base/dd.c > =================================================================== > --- linux-pm.orig/drivers/base/dd.c > +++ linux-pm/drivers/base/dd.c > @@ -434,14 +434,6 @@ re_probe: > goto probe_failed; > } > > - /* > - * Ensure devices are listed in devices_kset in correct order > - * It's important to move Dev to the end of devices_kset before > - * calling .probe, because it could be recursive and parent Dev > - * should always go first > - */ > - devices_kset_move_last(dev); > - > if (dev->bus->probe) { > ret = dev->bus->probe(dev); > if (ret) >