Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp632031imm; Wed, 4 Jul 2018 03:19:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdGVTxu5PA15Z3RsyEM3mAkZKSk6/Z3TKFAkhANSlOESgQLCDkFKBDeFxc9M0oNj1T/fsrr X-Received: by 2002:a65:5004:: with SMTP id f4-v6mr1384020pgo.54.1530699588726; Wed, 04 Jul 2018 03:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530699588; cv=none; d=google.com; s=arc-20160816; b=S+oKAcrJw95MPU5lYBDHpi1HSP2B4HSEE3gyRCePlN3AZ8cOyiy7XI+6SjAFmuoOh4 0sONCcjrg0iqKsEApNDeJ/X7UF3J5YJZNlaAAr1eL7RGWn0shRT9Wa6nwWtHJ2aaAVZh tKGw7WoXV1rlKf0J0dFG7cdEowNAMoX46uZXgbe3vLKTglj7+oBM0O9wbpzZSZlZJ3Ou HafaENMQOjnSDzNDS1L+K22iK8850CRyOyeuoRx+pln/RsxRqeHyj8BCNQ0HVSo01//+ MI223pWnyzK036+G/maFlnYbfntMwknu+j+dG1UxvWB5oJ3SzYO68oKxjAMnpsidJ9Ij sXMA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QJXZxLLHGBCZNxtl3WVSx/9AbqZPOCV0+PaciXJCnEA=; b=jXG9az8r5Sj+UxqyJDoA7cVzb0cS8obMwjs/e33uqO5B+Lj8U5QMmR8cg61jIjthFG FG18wz6jF8X004fgxofwTKHRKSkVqaYnEPavm6kgv9XNL65p3xm6x6CUiCm2DiknyqeK MjF4Lv2J6zQhusSxS/XERsE9dFBYGOEyAE+e4Iw5WNOwgeS9TcLK77/2jnEdb/eYcsvX EnrtbKJKAQCcwC1/+TgO1xPgvCVdbiukg7sp3FtY5bvfsn4Xm0azTHJ+2YjgJEQtlvgs P4YeSWj7BBx3FqxFTFOkEHVmqxVA8uLPn1zw+Pe+qgGZ1t/KKfa6BMoX2yg/Ixucch6P SeuA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i190-v6si2707571pgc.348.2018.07.04.03.19.33; Wed, 04 Jul 2018 03:19: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934671AbeGDKSh (ORCPT + 99 others); Wed, 4 Jul 2018 06:18:37 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:64515 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934134AbeGDKSc (ORCPT ); Wed, 4 Jul 2018 06:18:32 -0400 Received: from 79.184.254.38.ipv4.supernova.orange.pl (79.184.254.38) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id 95ef34fe818df8e9; Wed, 4 Jul 2018 12:18:29 +0200 From: "Rafael J. Wysocki" To: Pingfan Liu Cc: Grygorii Strashko , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Christoph Hellwig , Bjorn Helgaas , Dave Young , linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Linux PM Subject: Re: [PATCHv3 3/4] drivers/base: clean up the usage of devices_kset_move_last() Date: Wed, 04 Jul 2018 12:17:06 +0200 Message-ID: <2842715.a5PfnD4e6X@aspire.rjw.lan> In-Reply-To: References: <1530600642-25090-1-git-send-email-kernelfans@gmail.com> <3375966.ydPZj5TMVj@aspire.rjw.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, July 4, 2018 6:40:09 AM CEST Pingfan Liu wrote: > On Tue, Jul 3, 2018 at 10:28 PM Rafael J. Wysocki wrote: > > > > On Tuesday, July 3, 2018 8:50:41 AM CEST Pingfan Liu wrote: > > > Clean up the referring to the code in commit 52cdbdd49853 ("driver core: > > > correct device's shutdown order"). So later we can revert it safely. > > > > > > Cc: Greg Kroah-Hartman > > > Cc: Rafael J. Wysocki > > > Cc: Grygorii Strashko > > > Cc: Christoph Hellwig > > > Cc: Bjorn Helgaas > > > Cc: Dave Young > > > Cc: linux-pci@vger.kernel.org > > > Cc: linuxppc-dev@lists.ozlabs.org > > > Signed-off-by: Pingfan Liu > > > --- > > > drivers/base/core.c | 7 ------- > > > 1 file changed, 7 deletions(-) > > > > > > diff --git a/drivers/base/core.c b/drivers/base/core.c > > > index 684b994..db3deb8 100644 > > > --- a/drivers/base/core.c > > > +++ b/drivers/base/core.c > > > @@ -127,13 +127,6 @@ static int device_reorder_to_tail(struct device *dev, void *not_used) > > > { > > > struct device_link *link; > > > > > > - /* > > > - * Devices that have not been registered yet will be put to the ends > > > - * of the lists during the registration, so skip them here. > > > - */ > > > - if (device_is_registered(dev)) > > > - devices_kset_move_last(dev); > > > - > > > if (device_pm_initialized(dev)) > > > device_pm_move_last(dev); > > > > You can't do this. > > > > If you do it, that will break power management in some situations. > > > Could you shed light on it? I had a quick browsing of pm code, but it > is a big function, and I got lost in it. > If the above code causes failure, then does it imply that the seq in > devices_kset should be the same as dpm_list? Generally, yes it should. > But in device_shutdown(), it only intersect with pm by > pm_runtime_get_noresume(dev) and pm_runtime_barrier(dev). How do these > function affect the seq in dpm_list? They are not related to dpm_list directly. However, if you shut down a supplier device before its consumer and that involves power management, then the consumer shutdown may fail and lock up the system I asked you elsewhere to clearly describe the problem you are trying to address. Please do that in the first place. Thanks, Rafael