Re: [PATCH v5 7/8] thunderbolt: Power down controller when idle

From: Bjorn Helgaas
Date: Mon Feb 13 2017 - 17:57:47 EST


On Sun, Feb 12, 2017 at 05:31:30PM +0100, Lukas Wunner wrote:
> On Sat, Jan 28, 2017 at 05:32:37PM -0600, Bjorn Helgaas wrote:
> > On Sun, Jan 15, 2017 at 09:03:45PM +0100, Lukas Wunner wrote:

> > > +#define pr_fmt(fmt) KBUILD_MODNAME " %s: " fmt, dev_name(dev)
> [...]
> > > + /* prevent interrupts during system sleep transition */
> > > + if (ACPI_FAILURE(acpi_disable_gpe(NULL, power->wake_gpe))) {
> > > + pr_err("cannot disable wake GPE, resuming\n");
> >
> > Can you use dev_err() here and below? This is related to a specific
> > device, and it'd be nice to know which one.
>
> See above, the device name is included in pr_fmt. The reason to use
> pr_err() instead of dev_err() is to get the error message prefixed
> with "thunderbolt" instead of "pcieport". Recall that this function
> is executed in the context of the upstream bridge, whose driver name
> is pcieport. I would like to prevent people from grepping the portdrv
> code for the error message. You're the second person to raise this
> question (Andy Shevchenko made the same comment on an earlier version
> of this patch), so I've now added a comment to explain it.

Oh, right, I missed the sneaky dev_name(dev) in pr_fmt(). I guess we
may have a mix of "pcieport" and "thunderbolt" messages related to
the same device, which is sort of sub-optimal, but maybe the best we
can do for now.

Bjorn