public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Adam Belay <abelay@mit.edu>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: How should I handle device with two PNP-BIOS ids?
Date: Tue, 27 Jan 2009 08:52:51 -0700	[thread overview]
Message-ID: <200901270852.52153.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <20090127094255.fc038987.krzysztof.h1@wp.pl>

On Tuesday 27 January 2009 01:42:55 am Krzysztof Helt wrote:
> On Mon, 26 Jan 2009 15:13:31 -0700
> Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> > Systems with the old chip probably report the device with a single
> > PNP ID.  For PNPBIOS, that would be the "device product identifier."
> > For ACPI, it would be the _HID.
> > 
> > Systems with the new chip should report both PNP IDs.  The PNPBIOS
> > device product identifier or the ACPI _HID should be the new ID, and
> > the older ID for backward compatibility should be reported in the
> > PNPBIOS "compatible device identifiers" list or the ACPI _CID.
> > 
> > The driver would list both IDs in the pnp_device_id table, and it
> > looks like the driver probe routine gets called with the ID that
> > matched.
> > 
> > I don't see any drivers that actually do this, but I think the
> > probe routine should be able to look at the ID that matched and
> > determine whether the additional I/O range is present.
> 
> The laptop in question is the Dell Latitude CPi and it does not
> have ACPI only the PnP BIOS. 
> The both ids are reported as unrelated (two separate nodes in 
> the /sys/bus/pnp/).

Oh.  That sounds like a BIOS bug.  If there's only one actual
chip, the BIOS should not report it as two separate devices.
I guess it might report two devices if only one of them is
enabled at a time.  In that case, there might be a BIOS setup
switch to toggle between them.

Can you turn on CONFIG_PNP_DEBUG_MESSAGES and boot with the
pnp.debug kernel parameter?  Then collect the dmesg log and
the output of "grep . /sys/devices/pnp*/*/*".

> I don't know how to set up the "compatible device  
> identifiers" list. It is not defined in the include/linux/pnp.h.
> If I know that I will test this.

The compatible device identifiers list is built by the kernel
based on the information from the BIOS.  Drivers don't have to
worry about it.

> > Oops, looking at match_device() in drivers/pnp/driver.c, I think
> > we look at all the device IDs supported by the driver, but we only
> > look at the first ID associated with the device.  That means an old
> > driver that only knows about the old device ID would fail to claim
> > a new device (the new device will have the new ID first and old IDs
> > in the compatibility list).  That looks like a bug in the PNP core --
> > the old driver should be able to claim any new compatible devices.
> > 
> > Let me know if you think you're seeing this bug, and I'll look into
> > it some more.
> 
> Currently, I iterate over pnpbios_protocol to find out if the second 
> id exists. It is not elegant but works.

Can you point me to the driver?

If this is a BIOS defect, we might be able to write a quirk to work
around it so the driver doesn't have to get messy.

Bjorn

  reply	other threads:[~2009-01-27 15:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <497d80991ef709.35340258@wp.pl>
2009-01-26 22:13 ` How should I handle device with two PNP-BIOS ids? Bjorn Helgaas
2009-01-27  8:42   ` Krzysztof Helt
2009-01-27 15:52     ` Bjorn Helgaas [this message]
2009-01-27 17:10       ` Krzysztof Helt
2009-01-27 17:17       ` Ville Syrjälä
2009-02-05  0:00         ` Bjorn Helgaas

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=200901270852.52153.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=abelay@mit.edu \
    --cc=krzysztof.h1@wp.pl \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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