From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752394AbdF3Irs (ORCPT ); Fri, 30 Jun 2017 04:47:48 -0400 Received: from mga11.intel.com ([192.55.52.93]:48274 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752187AbdF3IrR (ORCPT ); Fri, 30 Jun 2017 04:47:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,285,1496127600"; d="scan'208";a="105555299" Date: Fri, 30 Jun 2017 11:44:57 +0300 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Alan Stern , Kai-Heng Feng , Bjorn Helgaas , gregkh@linuxfoundation.org, USB list , LKML , "Rafael J. Wysocki" , linux-pm@vger.kernel.org Subject: Re: [PATCH v2] PCI / PM: Avoid using device_may_wakeup() for runtime PM Message-ID: <20170630084457.GS629@lahna.fi.intel.com> References: <2883450.A8OIi7Gmb8@aspire.rjw.lan> <2677722.OnHOCzR3UZ@aspire.rjw.lan> <2254362.EY9ByagAJb@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2254362.EY9ByagAJb@aspire.rjw.lan> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 30, 2017 at 12:37:00AM +0200, Rafael J. Wysocki wrote: > On Friday, June 23, 2017 02:58:11 PM Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > pci_target_state() calls device_may_wakeup() which checks whether > > or not the device may wake up the system from sleep states, but > > pci_target_state() is used for runtime PM too. > > > > Since runtime PM is expected to always enable remote wakeup if > > possible, modify pci_target_state() to take additional argument > > indicating whether or not it should look for a state from which > > the device can signal wakeup and pass either the return value > > of device_can_wakeup(), or "false" (if the device itself is not > > wakeup-capable) to it from the code related to runtime PM. > > > > While at it, fix the comment in pci_dev_run_wake() which is not > > about sleep states. > > > > Signed-off-by: Rafael J. Wysocki > > --- > > > > -> v2: > > > > Passing "true" as the second argument to pci_target_state() for runtime PM > > might trigger suboptimal state choices to be made, so pass the return value > > of device_can_wakeup() to it instead and pass "false" to it in pci_dev_run_wake(), > > because that assumes device_can_wakeup() to return "false" already. > > This was sent a week ago without any response so far. > > Any concerns? No concerns from me. Reviewed-by: Mika Westerberg From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mika Westerberg Subject: Re: [PATCH v2] PCI / PM: Avoid using device_may_wakeup() for runtime PM Date: Fri, 30 Jun 2017 11:44:57 +0300 Message-ID: <20170630084457.GS629@lahna.fi.intel.com> References: <2883450.A8OIi7Gmb8@aspire.rjw.lan> <2677722.OnHOCzR3UZ@aspire.rjw.lan> <2254362.EY9ByagAJb@aspire.rjw.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <2254362.EY9ByagAJb-yvgW3jdyMHm1GS7QM15AGw@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Rafael J. Wysocki" Cc: linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Bjorn Helgaas , Alan Stern , Kai-Heng Feng , Bjorn Helgaas , gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, USB list , LKML , "Rafael J. Wysocki" , linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-pm@vger.kernel.org On Fri, Jun 30, 2017 at 12:37:00AM +0200, Rafael J. Wysocki wrote: > On Friday, June 23, 2017 02:58:11 PM Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > pci_target_state() calls device_may_wakeup() which checks whether > > or not the device may wake up the system from sleep states, but > > pci_target_state() is used for runtime PM too. > > > > Since runtime PM is expected to always enable remote wakeup if > > possible, modify pci_target_state() to take additional argument > > indicating whether or not it should look for a state from which > > the device can signal wakeup and pass either the return value > > of device_can_wakeup(), or "false" (if the device itself is not > > wakeup-capable) to it from the code related to runtime PM. > > > > While at it, fix the comment in pci_dev_run_wake() which is not > > about sleep states. > > > > Signed-off-by: Rafael J. Wysocki > > --- > > > > -> v2: > > > > Passing "true" as the second argument to pci_target_state() for runtime PM > > might trigger suboptimal state choices to be made, so pass the return value > > of device_can_wakeup() to it instead and pass "false" to it in pci_dev_run_wake(), > > because that assumes device_can_wakeup() to return "false" already. > > This was sent a week ago without any response so far. > > Any concerns? No concerns from me. Reviewed-by: Mika Westerberg -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html