- pci-add-pci_assign_resource_fixed-allow-fixed-address.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     PCI: Add pci_assign_resource_fixed -- allow fixed address assignments

has been removed from the -mm tree.  Its filename is

     pci-add-pci_assign_resource_fixed-allow-fixed-address.patch

This patch was probably dropped from -mm because
it has now been merged into a subsystem tree or
into Linus's tree, or because it was folded into
its parent patch in the -mm tree.

------------------------------------------------------
Subject: PCI: Add pci_assign_resource_fixed -- allow fixed address assignments
From: Kumar Gala <galak@xxxxxxxxxxxxxxxxxxx>


On some embedded systems the PCI address for hotplug devices are not only
known a priori but are required to be at a given PCI address for other
master in the system to be able to access.

An example of such a system would be an FPGA which is setup from user space
after the system has booted.  The FPGA may be access by DSPs in the system
and those DSPs expect the FPGA at a fixed PCI address.

Added pci_assign_resource_fixed() as a way to allow assignment of the PCI
devices's BARs at fixed PCI addresses.

Signed-off-by: Kumar Gala <galak@xxxxxxxxxxxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/pci/setup-res.c |   40 ++++++++++++++++++++++++++++++++++++++
 include/linux/pci.h     |    1 
 2 files changed, 41 insertions(+)

diff -puN drivers/pci/setup-res.c~pci-add-pci_assign_resource_fixed-allow-fixed-address drivers/pci/setup-res.c
--- devel/drivers/pci/setup-res.c~pci-add-pci_assign_resource_fixed-allow-fixed-address	2006-05-11 15:18:13.000000000 -0700
+++ devel-akpm/drivers/pci/setup-res.c	2006-05-11 15:18:13.000000000 -0700
@@ -160,6 +160,46 @@ int pci_assign_resource(struct pci_dev *
 	return ret;
 }
 
+#ifdef CONFIG_EMBEDDED
+int pci_assign_resource_fixed(struct pci_dev *dev, int resno)
+{
+	struct pci_bus *bus = dev->bus;
+	struct resource *res = dev->resource + resno;
+	unsigned int type_mask;
+	int i, ret = -EBUSY;
+
+	type_mask = IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_PREFETCH;
+
+	for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
+		struct resource *r = bus->resource[i];
+		if (!r)
+			continue;
+
+		/* type_mask must match */
+		if ((res->flags ^ r->flags) & type_mask)
+			continue;
+
+		ret = request_resource(r, res);
+
+		if (ret == 0)
+			break;
+	}
+
+	if (ret) {
+		printk(KERN_ERR "PCI: Failed to allocate %s resource "
+				"#%d:%llx@%llx for %s\n",
+			res->flags & IORESOURCE_IO ? "I/O" : "mem",
+			resno, (unsigned long long)(res->end - res->start + 1),
+			(unsigned long long)res->start, pci_name(dev));
+	} else if (resno < PCI_BRIDGE_RESOURCES) {
+		pci_update_resource(dev, res, resno);
+	}
+
+	return ret;
+}
+EXPORT_SYMBOL(pci_assign_resource_fixed);
+#endif
+
 /* Sort resources by alignment */
 void __devinit
 pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
diff -puN include/linux/pci.h~pci-add-pci_assign_resource_fixed-allow-fixed-address include/linux/pci.h
--- devel/include/linux/pci.h~pci-add-pci_assign_resource_fixed-allow-fixed-address	2006-05-11 15:18:13.000000000 -0700
+++ devel-akpm/include/linux/pci.h	2006-05-11 15:18:13.000000000 -0700
@@ -496,6 +496,7 @@ int pci_set_dma_mask(struct pci_dev *dev
 int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
 void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
 int pci_assign_resource(struct pci_dev *dev, int i);
+int pci_assign_resource_fixed(struct pci_dev *dev, int i);
 void pci_restore_bars(struct pci_dev *dev);
 int pci_select_bars(struct pci_dev *dev, unsigned long flags);
 
_

Patches currently in -mm which might be from galak@xxxxxxxxxxxxxxxxxxx are

i2c-pca954x-i2c-mux-driver.patch
i2c-mpc-fix-up-error-handling.patch
i2c-pca954x-fix-initial-access-to-first-mux-switch-port.patch
git-powerpc.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux