public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Linux Kernel List <linux-kernel@vger.kernel.org>,
	Linux PCI mailing list <linux-pci@atrey.karlin.mff.cuni.cz>
Subject: Re: /sys/bus/pci/drivers/<driver>/new_id
Date: Mon, 4 Dec 2006 14:58:54 -0800	[thread overview]
Message-ID: <20061204225854.GA9359@kroah.com> (raw)
In-Reply-To: <20061129211803.GB15186@flint.arm.linux.org.uk>

On Wed, Nov 29, 2006 at 09:18:04PM +0000, Russell King wrote:
> Unfortunately, the .../new_id feature does not work with the 8250_pci
> driver.
> 
> The reason for this comes down to the way .../new_id is implemented.
> When PCI tries to match a driver to a device, it checks the modules
> static device ID tables _before_ checking the dynamic new_id tables.
> 
> When a driver is capable of matching by ID, and falls back to matching
> by class (as 8250_pci does), this makes it absolutely impossible to
> specify a board by ID, and as such the correct driver_data value to
> use with it.
> 
> Let's say you have a serial board with vendor 0x1234 and device 0x5678.
> It's class is set to PCI_CLASS_COMMUNICATION_SERIAL.
> 
> On boot, this card is matched to the 8250_pci driver, which tries to
> probe it because it matched using the class entry.  The driver finds
> that it is unable to automatically detect the correct settings to use,
> so it returns -ENODEV.
> 
> You know that the information the driver needs is to match this card
> using a device_data value of '7'.  So you echo 1234 5678 0 0 0 0 7
> into new_id.
> 
> The kernel attempts to re-bind 8250_pci to this device.  However,
> because it scans the PCI driver tables, it _again_ matches the class
> entry which has the wrong device_data.  It fails.
> 
> End of story.  You can't support the card without rebuilding the
> kernel (or writing a specific PCI probe module to support it.)
> 
> So, can we make new_id override the driver-internal PCI ID tables?
> IOW, like this:

Yes, you are right, I'll add this to my queue.

thanks,

greg k-h

      reply	other threads:[~2006-12-04 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29 21:18 /sys/bus/pci/drivers/<driver>/new_id Russell King
2006-12-04 22:58 ` Greg KH [this message]

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=20061204225854.GA9359@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=rmk+lkml@arm.linux.org.uk \
    /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