All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <dvrabel@arcom.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: greg@kroah.com
Subject: [patch] PCI: Add is_bridge to pci_dev to allow fixups to disable bridge functionality.
Date: Tue, 19 Oct 2004 12:22:49 +0100	[thread overview]
Message-ID: <4174F909.1040804@arcom.com> (raw)

Hi,

This patch allows device fixups to force the PCI subsystem to ignore 
bridges and hence not allocate resources to them.

I have an IXP425 (ARM) board with a CardBus controller on it (of which 
only the PC card interfaces are used).  The problem is that the PCI 
memory window is too small to fit in all the bridge resources and the 
rest of the PCI devices and up being unconfigured.  With this patch, and 
a fixup to clear is_bridge, this doesn't happen.

The plan was to make the CardBus driver (drivers/pcmcia/yenta_socket.c) 
honour the is_bridge flag and not bother with CardBus stuff if it's cleared.

2004-10-19  David Vrabel <dvrabel@arcom.com>

	* Add is_bridge to struct pci_dev to allow PCI device fixups to
	disable bridge functionality.

Index: linux-2.6-armbe/drivers/pci/probe.c
===================================================================
--- linux-2.6-armbe.orig/drivers/pci/probe.c	2004-10-14 
11:26:38.000000000 +0100
+++ linux-2.6-armbe/drivers/pci/probe.c	2004-10-19 12:00:00.000000000 +0100
@@ -610,6 +610,8 @@
  	dev->devfn = devfn;
  	dev->hdr_type = hdr_type & 0x7f;
  	dev->multifunction = !!(hdr_type & 0x80);
+	dev->is_bridge = (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE
+			  || dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
  	dev->vendor = l & 0xffff;
  	dev->device = (l >> 16) & 0xffff;
  	dev->cfg_size = pci_cfg_space_size(dev);
@@ -718,8 +720,7 @@
  	pcibios_fixup_bus(bus);
  	for (pass=0; pass < 2; pass++)
  		list_for_each_entry(dev, &bus->devices, bus_list) {
-			if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
-			    dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+			if  (dev->is_bridge)
  				max = pci_scan_bridge(bus, dev, max, pass);
  		}

Index: linux-2.6-armbe/include/linux/pci.h
===================================================================
--- linux-2.6-armbe.orig/include/linux/pci.h	2004-10-14 
11:26:38.000000000 +0100
+++ linux-2.6-armbe/include/linux/pci.h	2004-10-14 11:43:24.000000000 +0100
@@ -532,6 +532,7 @@
  	/* These fields are used by common fixups */
  	unsigned int	transparent:1;	/* Transparent PCI bridge */
  	unsigned int	multifunction:1;/* Part of multi-function device */
+	unsigned int	is_bridge:1;	/* A PCI or CardBus bridge */
  	/* keep track of device state */
  	unsigned int	is_enabled:1;	/* pci_enable_device has been called */
  	unsigned int	is_busmaster:1; /* device is busmaster */

             reply	other threads:[~2004-10-19 11:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-19 11:22 David Vrabel [this message]
2004-10-30  3:23 ` [patch] PCI: Add is_bridge to pci_dev to allow fixups to disable bridge functionality Greg KH
2004-11-01 10:59   ` David Vrabel
2004-11-01 11:34     ` Russell King

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=4174F909.1040804@arcom.com \
    --to=dvrabel@arcom.com \
    --cc=greg@kroah.com \
    --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 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.