From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: Greg KH <greg@kroah.com>, Jeff Garzik <jgarzik@pobox.com>,
Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz,
akpm@osdl.org, rmk+lkml@arm.linux.org.uk
Subject: Re: [PATCH 3/6] PCI legacy I/O port free driver (take2) - Add device_flags into pci_device_id
Date: Wed, 22 Feb 2006 11:34:30 +0900 [thread overview]
Message-ID: <43FBCDB6.4090909@jp.fujitsu.com> (raw)
In-Reply-To: <20060222001142.GA31605@kroah.com>
Greg KH wrote:
> On Tue, Feb 21, 2006 at 07:09:08PM -0500, Jeff Garzik wrote:
>
>>Andi Kleen wrote:
>>
>>>On Tuesday 21 February 2006 22:55, Jeff Garzik wrote:
>>>
>>>
>>>
>>>>It doesn't matter how easily its added, it is the wrong place to add
>>>>such things.
>>>>
>>>>This is what the various functions called during pci_driver::probe() do...
>>>
>>>
>>>The problem is that at least on the e1000 it only applies to some of the
>>>many PCI-IDs it supports. So the original patch had an long ugly switch
>>>with PCI IDs to check it. I suggested to use driver_data for it then,
>>>but Kenji-San ended up with this new field. I actually like the idea
>>>of the new field because it would allow to add such things very easily
>>>without adding lots of code.
>>>
>>>it's not an uncommon situation. e.g. consider driver A which supports
>>>a lot of PCI-IDs but MSI only works on a few of them. How do you
>>>handle this? Add an ugly switch that will bitrot? Or put all the
>>>information into a single place which is the pci_device_id array.
>>
>>You do what tons of other drivers do, and indicate this via driver_data.
>> An enumerated type in driver_data can be used to uniquely identify any
>>device or set of devices.
>>
>>No need to add anything.
>
>
> Yes, I agree, use driver_data, it's simpler, and keeps the PCI core
> clean.
>
> thanks,
>
> greg k-h
>
Hi,
Thank you very much for all of the comments.
The reason why I added the new field into struct pci_device_id is
as follows, though these are already explained completely by Andi.
- By adding the new field instead of using driver_data, drivers
can pass the flags to the kernel directly. That is, drivers
don't need to call any new APIs to tell something to the kernel
after checking their own driver_data in their .probe().
- This new field can be used not only for ioport but also
other purpose (e.g. MSI).
But according to the discussion, it doesn't look a good idea to add
the new field into pci_device_id this time. So I'll update my patches
to use the driver_data field instead.
Thanks,
Kenji Kaneshige
next prev parent reply other threads:[~2006-02-22 2:37 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-21 6:26 [PATCH 0/6] PCI legacy I/O port free driver (take2) Kenji Kaneshige
2006-02-21 6:28 ` [PATCH 1/6] PCI legacy I/O port free driver (take2) - Add no_ioport flag into pci_dev Kenji Kaneshige
2006-02-21 21:01 ` Greg KH
2006-02-21 6:29 ` [PATCH 2/6] PCI legacy I/O port free driver (take2) - Fix minor bug in store_new_id() Kenji Kaneshige
2006-02-21 6:30 ` [PATCH 3/6] PCI legacy I/O port free driver (take2) - Add device_flags into pci_device_id Kenji Kaneshige
2006-02-21 13:57 ` Andi Kleen
2006-02-21 20:56 ` Greg KH
2006-02-21 20:59 ` Andi Kleen
2006-02-21 21:10 ` Greg KH
2006-02-21 21:31 ` Andi Kleen
2006-02-21 21:55 ` Jeff Garzik
2006-02-21 22:06 ` Andi Kleen
2006-02-22 0:09 ` Jeff Garzik
2006-02-22 0:11 ` Greg KH
2006-02-22 2:34 ` Kenji Kaneshige [this message]
2006-02-23 2:37 ` Benjamin Herrenschmidt
2006-02-23 6:33 ` Kenji Kaneshige
2006-02-21 6:31 ` [PATCH 4/6] PCI legacy I/O port free driver (take2) - Update Documentation/pci.txt Kenji Kaneshige
2006-02-21 6:32 ` [PATCH 5/6] PCI legacy I/O port free driver (take2) - Make Intel e1000 driver legacy I/O port free Kenji Kaneshige
2006-02-21 6:33 ` [PATCH 6/6] PCI legacy I/O port free driver (take2) - Make Emulex lpfc " Kenji Kaneshige
2006-02-21 20:56 ` Greg KH
2006-02-23 2:34 ` [PATCH 0/6] PCI legacy I/O port free driver (take2) Benjamin Herrenschmidt
2006-02-23 5:58 ` Kenji Kaneshige
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=43FBCDB6.4090909@jp.fujitsu.com \
--to=kaneshige.kenji@jp.fujitsu.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=jgarzik@pobox.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 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.