From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932595AbcA2Pvy (ORCPT ); Fri, 29 Jan 2016 10:51:54 -0500 Received: from mail-yk0-f179.google.com ([209.85.160.179]:34924 "EHLO mail-yk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932179AbcA2Pvu (ORCPT ); Fri, 29 Jan 2016 10:51:50 -0500 MIME-Version: 1.0 In-Reply-To: References: <1452181575-9206-1-git-send-email-tomeu.vizoso@collabora.com> <1452181575-9206-3-git-send-email-tomeu.vizoso@collabora.com> Date: Fri, 29 Jan 2016 17:51:49 +0200 Message-ID: Subject: Re: [PATCH v12 2/4] PM / Domains: add setter for dev.pm_domain From: Andy Shevchenko To: Tomeu Vizoso Cc: "linux-pm@vger.kernel.org" , Alan Stern , "Rafael J. Wysocki" , martyn.welch@collabora.co.uk, Ulf Hansson , Daniel Kurtz , David Airlie , Tomas Winkler , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dri-devel@lists.freedesktop.org, Russell King , Greg Kroah-Hartman , Kevin Hilman , Tony Lindgren , Len Brown , Linux OMAP Mailing List , Pavel Machek , linux-arm Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 29, 2016 at 5:38 PM, Andy Shevchenko wrote: > On Thu, Jan 7, 2016 at 5:46 PM, Tomeu Vizoso wrote: >> Adds a function that sets the pointer to dev_pm_domain in struct device >> and that warns if the device has already finished probing. The reason >> why we want to enforce that is because in the general case that can >> cause problems and also that we can simplify code quite a bit if we can >> always assume that. >> >> This patch also changes all current code that directly sets the >> dev.pm_domain pointer. > > >> --- a/drivers/acpi/acpi_lpss.c >> +++ b/drivers/acpi/acpi_lpss.c > >> @@ -875,13 +876,14 @@ static int acpi_lpss_platform_notify(struct notifier_block *nb, >> >> switch (action) { >> case BUS_NOTIFY_BIND_DRIVER: >> - pdev->dev.pm_domain = &acpi_lpss_pm_domain; >> + dev_pm_domain_set(&pdev->dev, &acpi_lpss_pm_domain); >> break; >> case BUS_NOTIFY_DRIVER_NOT_BOUND: >> case BUS_NOTIFY_UNBOUND_DRIVER: >> pdev->dev.pm_domain = NULL; > > Missed? > >> break; >> case BUS_NOTIFY_ADD_DEVICE: >> + dev_pm_domain_set(&pdev->dev, &acpi_lpss_pm_domain); >> if (pdata->dev_desc->flags & LPSS_LTR) >> return sysfs_create_group(&pdev->dev.kobj, >> &lpss_attr_group); >> @@ -889,6 +891,7 @@ static int acpi_lpss_platform_notify(struct notifier_block *nb, >> case BUS_NOTIFY_DEL_DEVICE: >> if (pdata->dev_desc->flags & LPSS_LTR) >> sysfs_remove_group(&pdev->dev.kobj, &lpss_attr_group); >> + dev_pm_domain_set(&pdev->dev, NULL); >> break; >> default: >> break; > > This looks wrong. I didn't test yet, but I have concerns here. Why did > you add those calls? Okay, for first glance it seems working on Intel Braswell. But can yoyu point me out what was going on before this patch? -- With Best Regards, Andy Shevchenko