public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz,
	greg@kroah.com
Subject: Re: [RFC][PATCH 1/4] PCI legacy I/O port free driver - Introduce pci_set_bar_mask*()
Date: Wed, 15 Feb 2006 21:33:02 +0900	[thread overview]
Message-ID: <43F31F7E.4050705@jp.fujitsu.com> (raw)
In-Reply-To: <20060215090732.GA15898@flint.arm.linux.org.uk>

Russell King wrote:
> On Wed, Feb 15, 2006 at 03:03:56PM +0900, Kenji Kaneshige wrote:
> 
>>Andrew Morton wrote:
>>
>>>Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> wrote:
>>>
>>>
>>>>This patch introduces a new interface pci_select_resource() for PCI
>>>>device drivers to tell kernel what resources they want to use.
>>>
>>>
>>>It'd be nice if we didn't need to introduce any new API functions for this.
>>>If we could just do:
>>>
>>>struct pci_something pci_something_table[] = {
>>>	...
>>>	{
>>>		...
>>>		.dont_allocate_io_space = 1,
>>>		...
>>>	},
>>>	...
>>>};
>>>
>>>within each driver which wants it.
>>>
>>>But I can't think of a suitable per-device-id structure with which we can
>>>do that :(
>>>
>>>
>>
>>My another idea was to use pci quirks. In this approach, we don't
>>need to introduce any new API. But I gave up this idea because it
>>looked abuse of pci quirks.
>>
>>Anyway, I try to think about new ideas we don't need to introduce
>>any new API.
> 
> 
> What about pci_enable_device_bars() ?
> 

Yes, it's one option (In fact, my first idea was using it),
though we need to move the following lines into
pci_enable_device_bars() from pci_enable_device().

        pci_fixup_device(pci_fixup_enable, dev);
        dev->is_enabled = 1;

Actually, IIRC, there are one or two existing drivers using it.
In addition to pci_enable_device_bars(), we can use
pci_request_region() for requesting each region instead of using
pci_request_regions().

The reason I didn't use this option was I thought we would need
bigger changes to drivers if we use pci_enable_devie_bars() and
pci_request_region(). For example, if we use pci_request_region()
for requesting the specific regions and if an error occurs
while doing that, we need to release only the regions we succeeded
in requesting. I think this is a little bit troublesome for driver
writers. In adition, though this is my personal opinion, only one
API to enable devices (e.g. pci_enable_device()) looks nice to me.
Anyway, I think it would be nice if we can solve the problem by
as small changes as possible to the existing drivers.
How do you think?

Thanks,
Kenji Kaneshige

  reply	other threads:[~2006-02-15 12:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-14  6:03 [RFC][PATCH 0/4] PCI legacy I/O port free driver Kenji Kaneshige
2006-02-14  6:06 ` [RFC][PATCH 1/4] PCI legacy I/O port free driver - Introduce pci_set_bar_mask*() Kenji Kaneshige
2006-02-15  5:07   ` Andrew Morton
2006-02-15  6:03     ` Kenji Kaneshige
2006-02-15  9:07       ` Russell King
2006-02-15 12:33         ` Kenji Kaneshige [this message]
2006-02-14  6:07 ` [RFC][PATCH 2/4] PCI legacy I/O port free driver - Update Documantion/pci.txt Kenji Kaneshige
2006-02-14  6:09 ` [RFC][PATCH 3/4] PCI legacy I/O port free driver - Make Intel e1000 driver legacy I/O port free Kenji Kaneshige
2006-02-14  6:10 ` [RFC][PATCH 4/4] PCI legacy I/O port free driver - Make Emulex lpfc " Kenji Kaneshige
2006-02-14  9:32 ` [RFC][PATCH 0/4] PCI legacy I/O port free driver Andi Kleen
2006-02-15  3:16   ` 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=43F31F7E.4050705@jp.fujitsu.com \
    --to=kaneshige.kenji@jp.fujitsu.com \
    --cc=akpm@osdl.org \
    --cc=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