public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-pci@vger.kernel.org, Len Brown <lenb@kernel.org>,
	Igor Mammedov <imammedo@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Woody Suwalski <terraluna977@gmail.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH] PCI: acpiphp: Log more slot and notification details
Date: Tue, 8 Aug 2023 15:58:00 -0500	[thread overview]
Message-ID: <20230808205800.GA332785@bhelgaas> (raw)
In-Reply-To: <CAJZ5v0jc5dn+6WtH6O30EeJfGDLewiLaAY9YJEAO6d_n+Uv7ig@mail.gmail.com>

On Tue, Aug 08, 2023 at 09:39:22PM +0200, Rafael J. Wysocki wrote:
> On Tue, Aug 8, 2023 at 9:27 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > From: Bjorn Helgaas <bhelgaas@google.com>
> >
> > When registering an acpiphp slot, log the slot name in the same style as
> > pciehp and include the PCI bus/device and whether a device is present or
> > the slot is empty.
> >
> > When handling an ACPI notification, log the PCI bus/device and notification
> > type.
> >
> > Sample dmesg log diff:
> >
> >     ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
> >   - acpiphp: Slot [3] registered
> >   - acpiphp: Slot [4] registered
> >     PCI host bridge to bus 0000:00
> >     pci 0000:00:03.0: [8086:100e] type 00 class 0x020000
> >     <ACPI Device Check notification>
> >     pci 0000:00:04.0: [8086:100e] type 00 class 0x020000
> >
> >     ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
> >   + acpiphp: pci 0000:00:03 Slot(3) registered (enabled)
> >   + acpiphp: pci 0000:00:04 Slot(4) registered (empty)
> >     PCI host bridge to bus 0000:00
> >     pci 0000:00:03.0: [8086:100e] type 00 class 0x020000
> >     <ACPI Device Check notification>
> >   + acpiphp: pci 0000:00:04 Slot(4) Device Check
> >     pci 0000:00:04.0: [8086:100e] type 00 class 0x020000
> > ...

> > @@ -793,6 +804,14 @@ static void hotplug_event(u32 type, struct acpiphp_context *context)
> >
> >         pci_lock_rescan_remove();
> >
> > +       pr_info("pci %04x:%02x:%02x Slot(%s) %s\n",
> > +               pci_domain_nr(slot->bus), slot->bus->number,
> > +               slot->device, slot_name(slot->slot),
> > +               type == ACPI_NOTIFY_BUS_CHECK ? "Bus Check" :
> > +               type == ACPI_NOTIFY_DEVICE_CHECK ? "Device Check" :
> > +               type == ACPI_NOTIFY_EJECT_REQUEST ? "Eject Request" :
> > +               "Notification");
> 
> pr_debug() perhaps?
> 
> On systems that don't have any hotplug problems these messages will
> just be filling the kernel log unnecessarily.

If these notifications are really common, pr_debug() sounds like the
right thing.  I assumed that they would not be common, e.g., they
would happen for user-time things like dock/undock, plug/unplug,
suspend/resume, etc.

In pciehp, we use _info for attention button presses, presence detect
changes, link up/down, and I assumed the ACPI notify events would
roughly correspond to those.  No?

Bjorn

  reply	other threads:[~2023-08-08 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 19:27 [PATCH] PCI: acpiphp: Log more slot and notification details Bjorn Helgaas
2023-08-08 19:39 ` Rafael J. Wysocki
2023-08-08 20:58   ` Bjorn Helgaas [this message]
2023-08-08 21:31     ` Rafael J. Wysocki
2023-08-09  9:21 ` Igor Mammedov

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=20230808205800.GA332785@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=imammedo@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=rafael@kernel.org \
    --cc=terraluna977@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox