[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111223202635.GA20991@andromeda.dapyr.net>
Date: Fri, 23 Dec 2011 16:26:35 -0400
From: Konrad Rzeszutek Wilk <konrad@...nok.org>
To: Dave Jones <davej@...hat.com>,
Linux Kernel <linux-kernel@...r.kernel.org>,
linux-pm@...r.kernel.org
Subject: Re: Print PCI device in power management warning.
On Fri, Dec 23, 2011 at 01:16:26PM -0500, Dave Jones wrote:
> 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. This adds a printk before the BUG.
Well, and adds a BUG!
> This still isn't perfect (automated tools like abrt will still miss it)
> but we can at least ask the user to look through their dmesg when
> we get these traces reported.
>
> Signed-off-by: Dave Jones <davej@...hat.com>
>
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index 12d1e81..b638244 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -604,7 +604,12 @@ 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);
> + if (ret && drv->driver.pm) {
> + printk(KERN_WARNING "pci: %s has both legacy and new PM support.\n",
> + drv->name);
> + BUG();
Um, so this will hang the machine.
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?
> + }
> +
>
> return ret;
> }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists