All of lore.kernel.org
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hp.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, joe@perches.com,
	isimatu.yasuaki@jp.fujitsu.com, liuj97@gmail.com,
	srivatsa.bhat@linux.vnet.ibm.com, prarit@redhat.com,
	imammedo@redhat.com, vijaymohan.pandarathil@hp.com
Subject: Re: [PATCH v3 2/4] ACPI: Update CPU hotplug messages
Date: Fri, 27 Jul 2012 11:18:37 -0600	[thread overview]
Message-ID: <1343409517.3010.575.camel@misato.fc.hp.com> (raw)
In-Reply-To: <CAErSpo5r5W-Yf-eo6o7zW71qYhUiX-3Xu-X76em-GFNWPCmm+g@mail.gmail.com>

On Fri, 2012-07-27 at 10:05 -0600, Bjorn Helgaas wrote:
> On Thu, Jul 26, 2012 at 8:39 PM, Toshi Kani <toshi.kani@hp.com> wrote:
> > On Thu, 2012-07-26 at 13:23 -0600, Bjorn Helgaas wrote:
> >> On Wed, Jul 25, 2012 at 5:12 PM, Toshi Kani <toshi.kani@hp.com> wrote:
> 
> >> > @@ -560,8 +565,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
> >> >          */
> >> >         if (per_cpu(processor_device_array, pr->id) != NULL &&
> >> >             per_cpu(processor_device_array, pr->id) != device) {
> >> > -               printk(KERN_WARNING "BIOS reported wrong ACPI id "
> >> > -                       "for the processor\n");
> >> > +               pr_warn("BIOS reported wrong ACPI id for the processor\n");
> >>
> >> And this.
> >
> > Changed to use dev_warn().
> 
> Is there additional information you could print here, like the pr->id?
>  I don't understand the data structures here, so maybe there isn't.

Good point.  Yes, we should print pr->id so that we can check if the id
value is wrong.  I will make this change later since I would likely
touch this file again. :)  For now, I'd like to settle the patches
unless there is a major issue.

> >> > @@ -727,17 +731,19 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
> >> >                                   "received ACPI_NOTIFY_EJECT_REQUEST\n"));
> >> >
> >> >                 if (acpi_bus_get_device(handle, &device)) {
> >> > -                       pr_err(PREFIX "Device don't exist, dropping EJECT\n");
> >> > +                       acpi_pr_err(handle,
> >> > +                               "Device don't exist, dropping EJECT\n");
> >> >                         break;
> >> >                 }
> >> >                 if (!acpi_driver_data(device)) {
> >> > -                       pr_err(PREFIX "Driver data is NULL, dropping EJECT\n");
> >> > +                       acpi_pr_err(handle,
> >> > +                               "Driver data is NULL, dropping EJECT\n");
> >>
> >> And this.
> >
> > No change since it is called directly from the handler.
> 
> True, but by this point, we have a valid acpi_device *, don't we?  We
> called acpi_driver_data(device), which requires "device" to be valid.

Right.  But we need to print ACPI device path in order to be able to
analyze from the log file.  Hence, I am keeping acpi_pr_<level> in the
error paths of the handler itself.  Any subsequent functions call
dev_<level>() when device is valid.  In this particular case,
acpi_driver_data() does not call dev_<level>() when its return value is
NULL, but most other cases are changed to call dev_<level>().

> >> >                         break;
> >> >                 }
> >> >
> >> >                 ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
> >> >                 if (!ej_event) {
> >> > -                       pr_err(PREFIX "No memory, dropping EJECT\n");
> >> > +                       acpi_pr_err(handle, "No memory, dropping EJECT\n");
> >>
> >> And this.
> >
> > No change since it is called directly from the handler.
> >
> >> >                         break;
> >> >                 }
> >> >
> >> > @@ -847,7 +853,7 @@ static acpi_status acpi_processor_hotadd_init(struct acpi_processor *pr)
> >> >          * and do it when the CPU gets online the first time
> >> >          * TBD: Cleanup above functions and try to do this more elegant.
> >> >          */
> >> > -       printk(KERN_INFO "CPU %d got hotplugged\n", pr->id);
> >> > +       pr_info("CPU %d got hotplugged\n", pr->id);
> >>
> >> And this.  The caller (acpi_processor_get_info()) has an acpi_device
> >> *, so we should be able to use it here.
> >
> > I think pr_info() is fine since it is a normal message and already has
> > CPU number in the message.
> 
> Is there another message that correlates the device name
> ("ACPI0007:xx") with the CPU number?  That correlation seems useful.
> My mindset is that a driver should *always* use dev_<level>() when
> possible, but I won't belabor the point.

That's a good point.  This CPU number is used for cpu# file
under /sys/devices/system/cpu, but I do not think there is a good way to
correlate this number to the device name.  This is also the case for all
CPUs launched at boot-time.  At boot-time, all CPUs are launched from
the MADT table, and the code has no knowledge about processor objects.
Typically, cpu# and device instance# are same at boot-time, though.  I
will think about this issue further.

Thanks,
-Toshi

> 
> Bjorn



  reply	other threads:[~2012-07-27 17:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 23:12 [PATCH v3 0/4] ACPI: hotplug messages improvement Toshi Kani
2012-07-25 23:12 ` [PATCH v3 1/4] ACPI: Add acpi_pr_<level>() interfaces Toshi Kani
2012-07-26 19:22   ` Bjorn Helgaas
2012-07-26 20:58     ` Toshi Kani
2012-07-26 21:37       ` Bjorn Helgaas
2012-07-26 21:43         ` Joe Perches
2012-07-26 21:50           ` Bjorn Helgaas
2012-07-26 21:57             ` Joe Perches
2012-07-27  3:32               ` Toshi Kani
2012-07-27  3:27             ` Toshi Kani
2012-07-26 21:50         ` Toshi Kani
2012-07-25 23:12 ` [PATCH v3 2/4] ACPI: Update CPU hotplug messages Toshi Kani
2012-07-26 19:23   ` Bjorn Helgaas
2012-07-27  2:39     ` Toshi Kani
2012-07-27 16:05       ` Bjorn Helgaas
2012-07-27 17:18         ` Toshi Kani [this message]
2012-07-25 23:12 ` [PATCH v3 3/4] ACPI: Update Memory " Toshi Kani
2012-07-26 19:23   ` Bjorn Helgaas
2012-07-27  2:50     ` Toshi Kani
2012-07-25 23:12 ` [PATCH v3 4/4] ACPI: Update Container " Toshi Kani
2012-07-26 19:23   ` Bjorn Helgaas
2012-07-27  2:52     ` Toshi Kani
2012-07-25 23:31 ` [PATCH v3 0/4] ACPI: hotplug messages improvement Joe Perches
2012-07-25 23:34   ` Toshi Kani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343409517.3010.575.camel@misato.fc.hp.com \
    --to=toshi.kani@hp.com \
    --cc=bhelgaas@google.com \
    --cc=imammedo@redhat.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=joe@perches.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuj97@gmail.com \
    --cc=prarit@redhat.com \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=vijaymohan.pandarathil@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.