LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Grant Grundler <grundler@parisc-linux.org>,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
	Andrew Morton <akpm@osdl.org>, Greg KH <greg@kroah.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-pci@atrey.karlin.mff.cuni.cz
Subject: Re: [PATCH 0/4] PCI legacy I/O port free driver (take4)
Date: Thu, 2 Mar 2006 19:13:05 +0000
Message-ID: <20060302191305.GF28895@flint.arm.linux.org.uk> (raw)
In-Reply-To: <44073593.60703@pobox.com>

On Thu, Mar 02, 2006 at 01:12:35PM -0500, Jeff Garzik wrote:
> Russell King wrote:
> >It's not really "I/O port resource allocation" though - the resources
> >have already been allocated and potentially programmed into the BARs
> >well before the driver gets anywhere near the device.
> [...]
> >Are you implying that somehow resources are allocated at pci_enable_device
> >time?  If so, shouldn't we be thinking of moving completely to that model
> >rather than having yet-another-pci-setup-model.
> 
> Actually, that's has been the rule ever since the cardbus days: 
> resources -- bars and irqs -- should not be considered allocated until 
> after pci_enable_device().

However, practically, cardbus have always had and continue to have their
resources setup prior to driver probe.

> Documentation/pci.txt reflects this reality as well:
> 
> >3. Enabling and disabling devices
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >   Before you do anything with the device you've found, you need to enable
> >it by calling pci_enable_device() which enables I/O and memory regions of
> >the device, allocates an IRQ if necessary, assigns missing resources if
> >needed and wakes up the device if it was in suspended state. Please note
> >that this function can fail.
> 
> Any PCI driver that presumes -anything- about resources before calling 
> pci_enable_device() is buggy, and that's been the case for many years. 
> Some platform-specific PCI drivers violate this with special knowledge, 
> but overall that's the rule.

Nevertheless, my basic point that the no_ioport solution only addresses
one problem area, while being far too late for the other methods still
stands.

Maybe the setup-* stuff needs to be rewritten (in which case cardbus
will also convert to the "new" system automatically)?

Given the problems of allocating resources for bridges inside cardbus
cards, it would be nice if this could happen, so the limited IO range
provided to cardbus could be more efficiently (and selectively) used.

Wouldn't you think that's a sane idea?

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

  reply index

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02 15:12 Kenji Kaneshige
2006-03-02 15:14 ` [PATCH 1/4] PCI legacy I/O port free driver (take4) - Add no_ioport flag into pci_dev Kenji Kaneshige
2006-03-02 15:16 ` [PATCH 2/4] PCI legacy I/O port free driver (take4) - Update Documentation/pci.txt Kenji Kaneshige
2006-03-02 15:18 ` [PATCH 3/4] PCI legacy I/O port free driver (take4) - Make Intel e1000 driver legacy I/O port free Kenji Kaneshige
2006-03-02 15:20 ` [PATCH 4/4] PCI legacy I/O port free driver (take4) - Make Emulex lpfc " Kenji Kaneshige
2006-03-02 15:50 ` [PATCH 0/4] PCI legacy I/O port free driver (take4) Russell King
2006-03-02 16:23   ` Kenji Kaneshige
2006-03-02 16:41     ` Greg KH
2006-03-02 17:24   ` Grant Grundler
2006-03-02 18:00     ` Russell King
2006-03-02 18:12       ` Jeff Garzik
2006-03-02 19:13         ` Russell King [this message]
2006-03-02 20:01           ` Jeff Garzik
2006-03-02 19:23       ` Grant Grundler
2006-03-02 19:34     ` Russell King
2006-03-02 19:50       ` Roland Dreier
2006-03-03  3:17       ` Kenji Kaneshige
2006-03-03  6:59         ` Kenji Kaneshige
2006-03-06  1:38           ` Kenji Kaneshige
2006-03-10  2:10       ` Adam Belay
2006-03-10  4:10         ` Kenji Kaneshige
2006-03-10  7:49           ` Russell King
2006-03-10  8:33         ` Russell King
2006-03-13  5:47           ` 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=20060302191305.GF28895@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=grundler@parisc-linux.org \
    --cc=jgarzik@pobox.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git