lkml.org 
[lkml]   [2011]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Print PCI device in power management warning.
On 12/23/2011 12:46 PM, Dave Jones wrote:
> On Fri, Dec 23, 2011 at 04:26:35PM -0400, Konrad Rzeszutek Wilk wrote:
>
> > don't you just want:
> >
> > WARN(ret && drv->driver.pm, "pci: %s Has both legacy and new PM
> > support!\n", drv_name(drv));
> >
> > which will do what it previously does and also add the message you
> > wanted to add?
>
> close. Not sure what drv_name() is, but I don't seem to have it in my tree.
> This works though..
>
> ---
>
> When the WARN_ON in pci_has_legacy_pm_support() triggers, we get
> users filing backtraces, but it's not obvious which driver is
> triggering the trace. Printing the driver name in addition to the trace
> should make these easier to debug.
>
> Signed-off-by: Dave Jones <davej@redhat.com>
>
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index 12d1e81..8af9ff2 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -604,7 +604,7 @@ static bool pci_has_legacy_pm_support(struct pci_dev *pci_dev)
> * supported as well. Drivers are supposed to support either the
> * former, or the latter, but not both at the same time.
> */
> - WARN_ON(ret && drv->driver.pm);
> + WARN(ret && drv->driver.pm, "pci: %s Has both legacy and new PM support!\n", drv->name);

has

and why not cc: linux-pci?


>
> return ret;
> }
> --


--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***


\
 
 \ /
  Last update: 2011-12-23 22:07    [W:0.028 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site