* [PATCH 09/19] [POWERPC] iSeries: remove one layer of IO routines
From: Stephen Rothwell @ 2007-12-06 14:53 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/pci.c | 68 +++++++++------------------------
1 files changed, 19 insertions(+), 49 deletions(-)
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 105b23d..8844d3e 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -382,7 +382,7 @@ static inline struct device_node *xlate_iomm_address(
* On MM I/O error, all ones are returned and iSeries_pci_IoError is cal
* else, data is returned in Big Endian format.
*/
-static u8 iSeries_read_byte(const volatile void __iomem *addr)
+static u8 iseries_readb(const volatile void __iomem *addr)
{
u64 bar_offset;
u64 dsa;
@@ -400,7 +400,7 @@ static u8 iSeries_read_byte(const volatile void __iomem *addr)
return ret.value;
}
-static u16 iSeries_read_word(const volatile void __iomem *addr)
+static u16 iseries_readw_be(const volatile void __iomem *addr)
{
u64 bar_offset;
u64 dsa;
@@ -419,7 +419,7 @@ static u16 iSeries_read_word(const volatile void __iomem *addr)
return ret.value;
}
-static u32 iSeries_read_long(const volatile void __iomem *addr)
+static u32 iseries_readl_be(const volatile void __iomem *addr)
{
u64 bar_offset;
u64 dsa;
@@ -442,7 +442,7 @@ static u32 iSeries_read_long(const volatile void __iomem *addr)
* Write MM I/O Instructions for the iSeries
*
*/
-static void iSeries_write_byte(u8 data, volatile void __iomem *addr)
+static void iseries_writeb(u8 data, volatile void __iomem *addr)
{
u64 bar_offset;
u64 dsa;
@@ -458,7 +458,7 @@ static void iSeries_write_byte(u8 data, volatile void __iomem *addr)
} while (check_return_code("WWB", dn, &retry, rc) != 0);
}
-static void iSeries_write_word(u16 data, volatile void __iomem *addr)
+static void iseries_writew_be(u16 data, volatile void __iomem *addr)
{
u64 bar_offset;
u64 dsa;
@@ -474,7 +474,7 @@ static void iSeries_write_word(u16 data, volatile void __iomem *addr)
} while (check_return_code("WWW", dn, &retry, rc) != 0);
}
-static void iSeries_write_long(u32 data, volatile void __iomem *addr)
+static void iseries_writel_be(u32 data, volatile void __iomem *addr)
{
u64 bar_offset;
u64 dsa;
@@ -490,54 +490,24 @@ static void iSeries_write_long(u32 data, volatile void __iomem *addr)
} while (check_return_code("WWL", dn, &retry, rc) != 0);
}
-static u8 iseries_readb(const volatile void __iomem *addr)
-{
- return iSeries_read_byte(addr);
-}
-
static u16 iseries_readw(const volatile void __iomem *addr)
{
- return le16_to_cpu(iSeries_read_word(addr));
+ return le16_to_cpu(iseries_readw_be(addr));
}
static u32 iseries_readl(const volatile void __iomem *addr)
{
- return le32_to_cpu(iSeries_read_long(addr));
-}
-
-static u16 iseries_readw_be(const volatile void __iomem *addr)
-{
- return iSeries_read_word(addr);
-}
-
-static u32 iseries_readl_be(const volatile void __iomem *addr)
-{
- return iSeries_read_long(addr);
-}
-
-static void iseries_writeb(u8 data, volatile void __iomem *addr)
-{
- iSeries_write_byte(data, addr);
+ return le32_to_cpu(iseries_readl_be(addr));
}
static void iseries_writew(u16 data, volatile void __iomem *addr)
{
- iSeries_write_word(cpu_to_le16(data), addr);
+ iseries_writew_be(cpu_to_le16(data), addr);
}
static void iseries_writel(u32 data, volatile void __iomem *addr)
{
- iSeries_write_long(cpu_to_le32(data), addr);
-}
-
-static void iseries_writew_be(u16 data, volatile void __iomem *addr)
-{
- iSeries_write_word(data, addr);
-}
-
-static void iseries_writel_be(u32 data, volatile void __iomem *addr)
-{
- iSeries_write_long(data, addr);
+ iseries_writel(cpu_to_le32(data), addr);
}
static void iseries_readsb(const volatile void __iomem *addr, void *buf,
@@ -545,7 +515,7 @@ static void iseries_readsb(const volatile void __iomem *addr, void *buf,
{
u8 *dst = buf;
while(count-- > 0)
- *(dst++) = iSeries_read_byte(addr);
+ *(dst++) = iseries_readb(addr);
}
static void iseries_readsw(const volatile void __iomem *addr, void *buf,
@@ -553,7 +523,7 @@ static void iseries_readsw(const volatile void __iomem *addr, void *buf,
{
u16 *dst = buf;
while(count-- > 0)
- *(dst++) = iSeries_read_word(addr);
+ *(dst++) = iseries_readw_be(addr);
}
static void iseries_readsl(const volatile void __iomem *addr, void *buf,
@@ -561,7 +531,7 @@ static void iseries_readsl(const volatile void __iomem *addr, void *buf,
{
u32 *dst = buf;
while(count-- > 0)
- *(dst++) = iSeries_read_long(addr);
+ *(dst++) = iseries_readl_be(addr);
}
static void iseries_writesb(volatile void __iomem *addr, const void *buf,
@@ -569,7 +539,7 @@ static void iseries_writesb(volatile void __iomem *addr, const void *buf,
{
const u8 *src = buf;
while(count-- > 0)
- iSeries_write_byte(*(src++), addr);
+ iseries_writeb(*(src++), addr);
}
static void iseries_writesw(volatile void __iomem *addr, const void *buf,
@@ -577,7 +547,7 @@ static void iseries_writesw(volatile void __iomem *addr, const void *buf,
{
const u16 *src = buf;
while(count-- > 0)
- iSeries_write_word(*(src++), addr);
+ iseries_writew_be(*(src++), addr);
}
static void iseries_writesl(volatile void __iomem *addr, const void *buf,
@@ -585,7 +555,7 @@ static void iseries_writesl(volatile void __iomem *addr, const void *buf,
{
const u32 *src = buf;
while(count-- > 0)
- iSeries_write_long(*(src++), addr);
+ iseries_writel_be(*(src++), addr);
}
static void iseries_memset_io(volatile void __iomem *addr, int c,
@@ -594,7 +564,7 @@ static void iseries_memset_io(volatile void __iomem *addr, int c,
volatile char __iomem *d = addr;
while (n-- > 0)
- iSeries_write_byte(c, d++);
+ iseries_writeb(c, d++);
}
static void iseries_memcpy_fromio(void *dest, const volatile void __iomem *src,
@@ -604,7 +574,7 @@ static void iseries_memcpy_fromio(void *dest, const volatile void __iomem *src,
const volatile char __iomem *s = src;
while (n-- > 0)
- *d++ = iSeries_read_byte(s++);
+ *d++ = iseries_readb(s++);
}
static void iseries_memcpy_toio(volatile void __iomem *dest, const void *src,
@@ -614,7 +584,7 @@ static void iseries_memcpy_toio(volatile void __iomem *dest, const void *src,
volatile char __iomem *d = dest;
while (n-- > 0)
- iSeries_write_byte(*s++, d++);
+ iseries_writeb(*s++, d++);
}
/* We only set MMIO ops. The default PIO ops will be default
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 10/19] [POWERPC] iSeries: remove pci_dn dependency from iSeries_Device_Information
From: Stephen Rothwell @ 2007-12-06 14:54 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/pci.c | 3 ++-
arch/powerpc/platforms/iseries/pci.h | 3 ++-
arch/powerpc/platforms/iseries/vpdinfo.c | 17 ++---------------
3 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 8844d3e..3cf51c6 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -218,7 +218,8 @@ void __init iSeries_pci_final_fixup(void)
pdev->sysdata = node;
PCI_DN(node)->pcidev = pdev;
allocate_device_bars(pdev);
- iSeries_Device_Information(pdev, num_dev);
+ iSeries_Device_Information(pdev, num_dev, pdn->busno,
+ pdn->bussubno);
iommu_devnode_init_iSeries(pdev, node);
}
iSeries_activate_IRQs();
diff --git a/arch/powerpc/platforms/iseries/pci.h b/arch/powerpc/platforms/iseries/pci.h
index 730986b..3cb18fa 100644
--- a/arch/powerpc/platforms/iseries/pci.h
+++ b/arch/powerpc/platforms/iseries/pci.h
@@ -58,7 +58,8 @@ static inline u64 iseries_ds_addr(struct device_node *node)
+ ((u64)0x10 << 32);
}
-extern void iSeries_Device_Information(struct pci_dev*, int);
+extern void iSeries_Device_Information(struct pci_dev *PciDev, int count,
+ u16 bus, HvSubBusNumber subbus);
#ifdef CONFIG_PCI
extern void iSeries_pci_final_fixup(void);
#else
diff --git a/arch/powerpc/platforms/iseries/vpdinfo.c b/arch/powerpc/platforms/iseries/vpdinfo.c
index 9f83878..25dc0bb 100644
--- a/arch/powerpc/platforms/iseries/vpdinfo.c
+++ b/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -31,7 +31,6 @@
#include <asm/types.h>
#include <asm/resource.h>
#include <asm/abs_addr.h>
-#include <asm/pci-bridge.h>
#include <asm/iseries/hv_types.h>
#include "pci.h"
@@ -244,25 +243,13 @@ out_free:
* PCI: Bus 0, Device 26, Vendor 0x12AE Frame 1, Card C10 Ethernet
* controller
*/
-void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
+void __init iSeries_Device_Information(struct pci_dev *PciDev, int count,
+ u16 bus, HvSubBusNumber subbus)
{
- struct device_node *DevNode = PciDev->sysdata;
- struct pci_dn *pdn;
- u16 bus;
u8 frame = 0;
char card[4];
- HvSubBusNumber subbus;
HvAgentId agent;
- if (DevNode == NULL) {
- printk("%d. PCI: iSeries_Device_Information DevNode is NULL\n",
- count);
- return;
- }
-
- pdn = PCI_DN(DevNode);
- bus = pdn->busno;
- subbus = pdn->bussubno;
agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 11/19] [POWERPC] iSeries: iseries_ds_addr is only used in pci.c
From: Stephen Rothwell @ 2007-12-06 14:55 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/pci.c | 11 +++++++++++
arch/powerpc/platforms/iseries/pci.h | 13 +------------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 3cf51c6..b46d8c5 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -69,6 +69,17 @@ static const char pci_io_text[] = "iSeries PCI I/O";
static DEFINE_SPINLOCK(iomm_table_lock);
/*
+ * Generate a Direct Select Address for the Hypervisor
+ */
+static inline u64 iseries_ds_addr(struct device_node *node)
+{
+ struct pci_dn *pdn = PCI_DN(node);
+
+ return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40)
+ + ((u64)0x10 << 32);
+}
+
+/*
* iomm_table_allocate_entry
*
* Adds pci_dev entry in address translation table
diff --git a/arch/powerpc/platforms/iseries/pci.h b/arch/powerpc/platforms/iseries/pci.h
index 3cb18fa..3af9cf1 100644
--- a/arch/powerpc/platforms/iseries/pci.h
+++ b/arch/powerpc/platforms/iseries/pci.h
@@ -30,7 +30,7 @@
* End Change Activity
*/
-#include <asm/pci-bridge.h>
+#include <asm/iseries/hv_types.h>
struct pci_dev; /* For Forward Reference */
@@ -47,17 +47,6 @@ struct pci_dev; /* For Forward Reference */
#define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7)
#define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7)
-/*
- * Generate a Direct Select Address for the Hypervisor
- */
-static inline u64 iseries_ds_addr(struct device_node *node)
-{
- struct pci_dn *pdn = PCI_DN(node);
-
- return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40)
- + ((u64)0x10 << 32);
-}
-
extern void iSeries_Device_Information(struct pci_dev *PciDev, int count,
u16 bus, HvSubBusNumber subbus);
#ifdef CONFIG_PCI
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 12/19] [POWERPC] iSeries: reduce dependence on pci_dn bussubno
From: Stephen Rothwell @ 2007-12-06 14:56 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/pci.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index b46d8c5..7e00e35 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -190,6 +190,7 @@ void __init iSeries_pci_final_fixup(void)
for_each_pci_dev(pdev) {
struct pci_dn *pdn;
const u32 *agent;
+ const u32 *sub_bus;
node = find_device_node(pdev->bus->number, pdev->devfn);
printk("pci dev %p (%x.%x), node %p\n", pdev,
@@ -202,23 +203,23 @@ void __init iSeries_pci_final_fixup(void)
pdn = PCI_DN(node);
agent = of_get_property(node, "linux,agent-id", NULL);
- if (pdn && agent) {
- u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
- pdn->bussubno);
+ sub_bus = of_get_property(node, "linux,subbus", NULL);
+ if (pdn && agent && sub_bus) {
+ u8 irq = iSeries_allocate_IRQ(pdn->busno, 0, *sub_bus);
int err;
- err = HvCallXm_connectBusUnit(pdn->busno, pdn->bussubno,
+ err = HvCallXm_connectBusUnit(pdn->busno, *sub_bus,
*agent, irq);
if (err)
pci_log_error("Connect Bus Unit",
- pdn->busno, pdn->bussubno, *agent, err);
+ pdn->busno, *sub_bus, *agent, err);
else {
err = HvCallPci_configStore8(pdn->busno,
- pdn->bussubno, *agent,
+ *sub_bus, *agent,
PCI_INTERRUPT_LINE, irq);
if (err)
pci_log_error("PciCfgStore Irq Failed!",
- pdn->busno, pdn->bussubno,
+ pdn->busno, *sub_bus,
*agent, err);
else
pdev->irq = irq;
@@ -229,8 +230,7 @@ void __init iSeries_pci_final_fixup(void)
pdev->sysdata = node;
PCI_DN(node)->pcidev = pdev;
allocate_device_bars(pdev);
- iSeries_Device_Information(pdev, num_dev, pdn->busno,
- pdn->bussubno);
+ iSeries_Device_Information(pdev, num_dev, pdn->busno, *sub_bus);
iommu_devnode_init_iSeries(pdev, node);
}
iSeries_activate_IRQs();
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 13/19] [POWERPC] iSeries: make pcibios_final_fixup not depend on pci_dn
From: Stephen Rothwell @ 2007-12-06 14:58 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/pci.c | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 7e00e35..4bcf446 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -188,39 +188,36 @@ void __init iSeries_pci_final_fixup(void)
printk("pcibios_final_fixup\n");
for_each_pci_dev(pdev) {
- struct pci_dn *pdn;
const u32 *agent;
const u32 *sub_bus;
+ unsigned char bus = pdev->bus->number;
- node = find_device_node(pdev->bus->number, pdev->devfn);
- printk("pci dev %p (%x.%x), node %p\n", pdev,
- pdev->bus->number, pdev->devfn, node);
+ node = find_device_node(bus, pdev->devfn);
+ printk("pci dev %p (%x.%x), node %p\n", pdev, bus,
+ pdev->devfn, node);
if (!node) {
printk("PCI: Device Tree not found for 0x%016lX\n",
(unsigned long)pdev);
continue;
}
- pdn = PCI_DN(node);
agent = of_get_property(node, "linux,agent-id", NULL);
sub_bus = of_get_property(node, "linux,subbus", NULL);
- if (pdn && agent && sub_bus) {
- u8 irq = iSeries_allocate_IRQ(pdn->busno, 0, *sub_bus);
+ if (agent && sub_bus) {
+ u8 irq = iSeries_allocate_IRQ(bus, 0, *sub_bus);
int err;
- err = HvCallXm_connectBusUnit(pdn->busno, *sub_bus,
+ err = HvCallXm_connectBusUnit(bus, *sub_bus,
*agent, irq);
if (err)
pci_log_error("Connect Bus Unit",
- pdn->busno, *sub_bus, *agent, err);
+ bus, *sub_bus, *agent, err);
else {
- err = HvCallPci_configStore8(pdn->busno,
- *sub_bus, *agent,
- PCI_INTERRUPT_LINE, irq);
+ err = HvCallPci_configStore8(bus, *sub_bus,
+ *agent, PCI_INTERRUPT_LINE, irq);
if (err)
pci_log_error("PciCfgStore Irq Failed!",
- pdn->busno, *sub_bus,
- *agent, err);
+ bus, *sub_bus, *agent, err);
else
pdev->irq = irq;
}
@@ -230,7 +227,7 @@ void __init iSeries_pci_final_fixup(void)
pdev->sysdata = node;
PCI_DN(node)->pcidev = pdev;
allocate_device_bars(pdev);
- iSeries_Device_Information(pdev, num_dev, pdn->busno, *sub_bus);
+ iSeries_Device_Information(pdev, num_dev, bus, *sub_bus);
iommu_devnode_init_iSeries(pdev, node);
}
iSeries_activate_IRQs();
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 14/19] [POWERPC] Inline pci_setup_pci_controller as it has become trivial
From: Stephen Rothwell @ 2007-12-06 14:59 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
and it becomes clear that we should use zalloc_maybe_bootmem.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/pci-common.c | 22 ++++++----------------
1 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 0bf969e..252dd1e 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -54,27 +54,17 @@ static int global_phb_number; /* Global phb counter */
resource_size_t isa_mem_base = 0;
-/*
- * pci_controller(phb) initialized common variables.
- */
-static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
-{
- memset(hose, 0, sizeof(struct pci_controller));
-
- spin_lock(&hose_spinlock);
- hose->global_number = global_phb_number++;
- list_add_tail(&hose->list_node, &hose_list);
- spin_unlock(&hose_spinlock);
-}
-
-struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
+struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
{
struct pci_controller *phb;
- phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
+ phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
if (phb == NULL)
return NULL;
- pci_setup_pci_controller(phb);
+ spin_lock(&hose_spinlock);
+ phb->global_number = global_phb_number++;
+ list_add_tail(&phb->list_node, &hose_list);
+ spin_unlock(&hose_spinlock);
phb->arch_data = dev;
phb->is_dynamic = mem_init_done;
#ifdef CONFIG_PPC64
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 15/19] [POWERPC] iSeries: call iSeries_pcibios_init from setup_arch
From: Stephen Rothwell @ 2007-12-06 15:00 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/pci_64.c | 3 ---
arch/powerpc/platforms/iseries/pci.h | 4 +++-
arch/powerpc/platforms/iseries/setup.c | 2 ++
include/asm-powerpc/ppc-pci.h | 3 ---
4 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 13a3615..b58f091 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -519,9 +519,6 @@ static int __init pcibios_init(void)
*/
ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
- if (firmware_has_feature(FW_FEATURE_ISERIES))
- iSeries_pcibios_init();
-
printk(KERN_DEBUG "PCI: Probing PCI hardware\n");
/* Scan all of the recorded PCI controllers. */
diff --git a/arch/powerpc/platforms/iseries/pci.h b/arch/powerpc/platforms/iseries/pci.h
index 3af9cf1..b142873 100644
--- a/arch/powerpc/platforms/iseries/pci.h
+++ b/arch/powerpc/platforms/iseries/pci.h
@@ -50,9 +50,11 @@ struct pci_dev; /* For Forward Reference */
extern void iSeries_Device_Information(struct pci_dev *PciDev, int count,
u16 bus, HvSubBusNumber subbus);
#ifdef CONFIG_PCI
+extern void iSeries_pcibios_init(void);
extern void iSeries_pci_final_fixup(void);
#else
-static void iSeries_pci_final_fixup(void) { }
+static inline void iSeries_pcibios_init(void) { }
+static inline void iSeries_pci_final_fixup(void) { }
#endif
#endif /* _PLATFORMS_ISERIES_PCI_H */
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 2175a71..5616219 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -495,6 +495,8 @@ static void __init iSeries_setup_arch(void)
itVpdAreas.xSlicMaxLogicalProcs);
printk("Max physical processors = %d\n",
itVpdAreas.xSlicMaxPhysicalProcs);
+
+ iSeries_pcibios_init();
}
static void iSeries_show_cpuinfo(struct seq_file *m)
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h
index fda5e3d..854ab71 100644
--- a/include/asm-powerpc/ppc-pci.h
+++ b/include/asm-powerpc/ppc-pci.h
@@ -46,9 +46,6 @@ extern void init_pci_config_tokens (void);
extern unsigned long get_phb_buid (struct device_node *);
extern int rtas_setup_phb(struct pci_controller *phb);
-/* From iSeries PCI */
-extern void iSeries_pcibios_init(void);
-
extern unsigned long pci_probe_only;
/* ---- EEH internal-use-only related routines ---- */
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 16/19] [POWERPC] iSeries: hose->buid is always zero for iSeries
From: Stephen Rothwell @ 2007-12-06 15:01 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
so remove a firmware feature test.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/pci_64.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index b58f091..42ff9c9 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -581,12 +581,8 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
/* Decide whether to display the domain number in /proc */
int pci_proc_domain(struct pci_bus *bus)
{
- if (firmware_has_feature(FW_FEATURE_ISERIES))
- return 0;
- else {
- struct pci_controller *hose = pci_bus_to_host(bus);
- return hose->buid != 0;
- }
+ struct pci_controller *hose = pci_bus_to_host(bus);
+ return hose->buid != 0;
}
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 17/19] [POWERPC] remove some iSeries platform checks from the PCI code
From: Stephen Rothwell @ 2007-12-06 15:03 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/pci_64.c | 23 ++++++++---------------
arch/powerpc/platforms/iseries/pci.c | 2 ++
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 42ff9c9..acf1219 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -31,7 +31,6 @@
#include <asm/byteorder.h>
#include <asm/machdep.h>
#include <asm/ppc-pci.h>
-#include <asm/firmware.h>
#ifdef DEBUG
#include <asm/udbg.h>
@@ -197,9 +196,6 @@ static void __init pcibios_claim_of_setup(void)
{
struct pci_bus *b;
- if (firmware_has_feature(FW_FEATURE_ISERIES))
- return;
-
list_for_each_entry(b, &pci_root_buses, node)
pcibios_claim_one_bus(b);
}
@@ -477,8 +473,7 @@ void __devinit scan_phb(struct pci_controller *hose)
bus->secondary = hose->first_busno;
hose->bus = bus;
- if (!firmware_has_feature(FW_FEATURE_ISERIES))
- pcibios_map_io_space(bus);
+ pcibios_map_io_space(bus);
bus->resource[0] = res = &hose->io_resource;
if (res->flags && request_resource(&ioport_resource, res)) {
@@ -527,15 +522,13 @@ static int __init pcibios_init(void)
pci_bus_add_devices(hose->bus);
}
- if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
- if (pci_probe_only)
- pcibios_claim_of_setup();
- else
- /* FIXME: `else' will be removed when
- pci_assign_unassigned_resources() is able to work
- correctly with [partially] allocated PCI tree. */
- pci_assign_unassigned_resources();
- }
+ if (pci_probe_only)
+ pcibios_claim_of_setup();
+ else
+ /* FIXME: `else' will be removed when
+ pci_assign_unassigned_resources() is able to work
+ correctly with [partially] allocated PCI tree. */
+ pci_assign_unassigned_resources();
/* Call machine dependent final fixup */
if (ppc_md.pcibios_fixup)
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 4bcf446..db0a17e 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -646,6 +646,8 @@ void __init iSeries_pcibios_init(void)
/* Install IO hooks */
ppc_pci_io = iseries_pci_io;
+ pci_probe_only = 1;
+
/* iSeries has no IO space in the common sense, it needs to set
* the IO base to 0
*/
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 18/19] [POWERPC] Don't special case pci_domain_nr() for iSeries
From: Stephen Rothwell @ 2007-12-06 15:04 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/pci-common.c | 9 ++-------
arch/powerpc/platforms/iseries/pci.c | 2 ++
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 252dd1e..e0d4a2a 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -118,15 +118,10 @@ int pcibios_vaddr_is_ioport(void __iomem *address)
*/
int pci_domain_nr(struct pci_bus *bus)
{
- if (firmware_has_feature(FW_FEATURE_ISERIES))
- return 0;
- else {
- struct pci_controller *hose = pci_bus_to_host(bus);
+ struct pci_controller *hose = pci_bus_to_host(bus);
- return hose->global_number;
- }
+ return hose->global_number;
}
-
EXPORT_SYMBOL(pci_domain_nr);
#ifdef CONFIG_PPC_OF
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index db0a17e..3071a30 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -673,6 +673,8 @@ void __init iSeries_pcibios_init(void)
phb = pcibios_alloc_controller(node);
if (phb == NULL)
continue;
+ /* All legacy iSeries PHBs are in domain zero */
+ phb->global_number = 0;
phb->pci_mem_offset = bus;
phb->first_busno = bus;
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* [PATCH 19/19] [POWERPC] pci_controller->arch_data really is a struct device_node *
From: Stephen Rothwell @ 2007-12-06 15:05 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/pci_32.c | 6 +++---
arch/powerpc/kernel/pci_64.c | 6 ++----
arch/powerpc/kernel/pci_dn.c | 2 +-
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 2 +-
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 2 +-
arch/powerpc/platforms/powermac/pci.c | 2 +-
arch/powerpc/platforms/pseries/iommu.c | 2 +-
include/asm-powerpc/pci-bridge.h | 5 +++--
8 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index e1151b5..3a05f4f 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -661,8 +661,8 @@ pcibios_make_OF_bus_map(void)
/* For each hose, we begin searching bridges */
list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
- struct device_node* node;
- node = (struct device_node *)hose->arch_data;
+ struct device_node* node = hose->arch_data;
+
if (!node)
continue;
make_one_node_map(node, hose->first_busno);
@@ -813,7 +813,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
hose = pci_find_hose_for_OF_device(node);
if (!hose || !hose->arch_data)
return -ENODEV;
- if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
+ if (!scan_OF_pci_childs(hose->arch_data->child,
find_OF_pci_device_filter, (void *)node))
return -ENODEV;
reg = of_get_property(node, "reg", NULL);
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index acf1219..b452031 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -612,8 +612,7 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
if (hose->io_base_alloc == 0)
return 0;
- DBG("IO unmapping for PHB %s\n",
- ((struct device_node *)hose->arch_data)->full_name);
+ DBG("IO unmapping for PHB %s\n", hose->arch_data->full_name);
DBG(" alloc=0x%p\n", hose->io_base_alloc);
/* This is a PHB, we fully unmap the IO area */
@@ -672,8 +671,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
hose->io_base_virt = (void __iomem *)(area->addr +
hose->io_base_phys - phys_page);
- DBG("IO mapping for PHB %s\n",
- ((struct device_node *)hose->arch_data)->full_name);
+ DBG("IO mapping for PHB %s\n", hose->arch_data->full_name);
DBG(" phys=0x%016lx, virt=0x%p (alloc=0x%p)\n",
hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
DBG(" size=0x%016lx (alloc=0x%016lx)\n",
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index b483903..f326e91 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -133,7 +133,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
*/
void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb)
{
- struct device_node * dn = (struct device_node *) phb->arch_data;
+ struct device_node *dn = phb->arch_data;
struct pci_dn *pdn;
/* PHB nodes themselves must not match */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 59c121a..d084829 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -123,7 +123,7 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
struct device_node* node;
struct resource rsrc;
- node = (struct device_node *)hose->arch_data;
+ node = hose->arch_data;
of_address_to_resource(node, 0, &rsrc);
if ((rsrc.start & 0xfffff) == primary_phb_addr) {
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 32a531a..49b2bee 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -116,7 +116,7 @@ static int mpc86xx_exclude_device(struct pci_controller *hose,
struct device_node* node;
struct resource rsrc;
- node = (struct device_node *)hose->arch_data;
+ node = hose->arch_data;
of_address_to_resource(node, 0, &rsrc);
if ((rsrc.start & 0xfffff) == 0x8000) {
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index ec49099..472f44b 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -778,7 +778,7 @@ static void __init setup_u4_pcie(struct pci_controller* hose)
static void __init setup_u3_ht(struct pci_controller* hose)
{
- struct device_node *np = (struct device_node *)hose->arch_data;
+ struct device_node *np = hose->arch_data;
struct pci_controller *other = NULL;
int i, cur;
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index ebb9313..a446e0b 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -251,7 +251,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
const unsigned long *basep;
const u32 *sizep;
- node = (struct device_node *)phb->arch_data;
+ node = phb->arch_data;
basep = of_get_property(node, "linux,tce-base", NULL);
sizep = of_get_property(node, "linux,tce-size", NULL);
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index beb09b5..4bad3e7 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -11,6 +11,8 @@
#include <linux/list.h>
#include <linux/ioport.h>
+struct device_node;
+
/*
* Structure of a PCI controller (host bridge)
*/
@@ -20,7 +22,7 @@ struct pci_controller {
#ifdef CONFIG_PPC64
int node;
#endif
- void *arch_data;
+ struct device_node *arch_data;
struct list_head list_node;
struct device *parent;
@@ -130,7 +132,6 @@ extern void __init update_bridge_resource(struct pci_dev *dev,
* by device_node->data.
*/
struct iommu_table;
-struct device_node;
struct pci_dn {
int busno; /* pci bus number */
--
1.5.3.7
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* Re: Powerpc PCI cleanups (mainly iSeries)
From: Stephen Rothwell @ 2007-12-06 15:07 UTC (permalink / raw)
To: ppc-dev
In-Reply-To: <20071206180045.0eb1db98.sfr@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 527 bytes --]
On Thu, 6 Dec 2007 18:00:45 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> I started out looking for ways to remove our dependencies on pci_dn and
> got sidetracked into clening up the iSeries PCI code. The intention of
> the following set of patches is that there be no semantic changes
> (mostly).
Some of these will clearly conflict with Benh's PCI work. We will sot
that out between us. :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [PATCH] IB/ehca: Serialize HCA-related hCalls on POWER5
From: Joachim Fenkes @ 2007-12-06 15:07 UTC (permalink / raw)
To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
Cc: Stefan Roscher, Christoph Raisch, Marcus Eder
All firmware versions on POWER5 systems have a locking issue in the
HCA-related hCalls that can cause loss of Infiniband connectivity if
allocate and free calls happen in parallel. This may for example be caused
if two processes are using OpenMPI in parallel.
Circumvent this by serializing all HCA-related hCalls on POWER5.
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
We tested this patch, especially the autodetection, and it works okay.
Please review and apply for 2.6.24-rc5 - thanks!
drivers/infiniband/hw/ehca/ehca_main.c | 16 ++++++++++++++++
drivers/infiniband/hw/ehca/hcp_if.c | 28 +++++++++++-----------------
2 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 90d4334..8f33d06 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -43,6 +43,9 @@
#ifdef CONFIG_PPC_64K_PAGES
#include <linux/slab.h>
#endif
+
+#include <asm/cputable.h>
+
#include "ehca_classes.h"
#include "ehca_iverbs.h"
#include "ehca_mrmw.h"
@@ -66,6 +69,7 @@ int ehca_poll_all_eqs = 1;
int ehca_static_rate = -1;
int ehca_scaling_code = 0;
int ehca_mr_largepage = 1;
+int ehca_lock_hcalls = -1;
module_param_named(open_aqp1, ehca_open_aqp1, int, S_IRUGO);
module_param_named(debug_level, ehca_debug_level, int, S_IRUGO);
@@ -77,6 +81,7 @@ module_param_named(poll_all_eqs, ehca_poll_all_eqs, int, S_IRUGO);
module_param_named(static_rate, ehca_static_rate, int, S_IRUGO);
module_param_named(scaling_code, ehca_scaling_code, int, S_IRUGO);
module_param_named(mr_largepage, ehca_mr_largepage, int, S_IRUGO);
+module_param_named(lock_hcalls, ehca_lock_hcalls, bool, S_IRUGO);
MODULE_PARM_DESC(open_aqp1,
"AQP1 on startup (0: no (default), 1: yes)");
@@ -102,6 +107,9 @@ MODULE_PARM_DESC(scaling_code,
MODULE_PARM_DESC(mr_largepage,
"use large page for MR (0: use PAGE_SIZE (default), "
"1: use large page depending on MR size");
+MODULE_PARM_DESC(lock_hcalls,
+ "serialize all hCalls made by the driver "
+ "(default: autodetect)");
DEFINE_RWLOCK(ehca_qp_idr_lock);
DEFINE_RWLOCK(ehca_cq_idr_lock);
@@ -924,6 +932,14 @@ int __init ehca_module_init(void)
printk(KERN_INFO "eHCA Infiniband Device Driver "
"(Version " HCAD_VERSION ")\n");
+ /* Autodetect hCall locking -- we can't read the firmware version
+ * directly, but we know that starting with POWER6, all firmware
+ * versions are good.
+ */
+ if (ehca_lock_hcalls == -1)
+ ehca_lock_hcalls = !(cur_cpu_spec->cpu_user_features
+ & PPC_FEATURE_ARCH_2_05);
+
ret = ehca_create_comp_pool();
if (ret) {
ehca_gen_err("Cannot create comp pool.");
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c
index c16a213..331b5e8 100644
--- a/drivers/infiniband/hw/ehca/hcp_if.c
+++ b/drivers/infiniband/hw/ehca/hcp_if.c
@@ -89,6 +89,7 @@
#define HCALL9_REGS_FORMAT HCALL7_REGS_FORMAT " r11=%lx r12=%lx"
static DEFINE_SPINLOCK(hcall_lock);
+extern int ehca_lock_hcalls;
static u32 get_longbusy_msecs(int longbusy_rc)
{
@@ -120,26 +121,21 @@ static long ehca_plpar_hcall_norets(unsigned long opcode,
unsigned long arg7)
{
long ret;
- int i, sleep_msecs, do_lock;
- unsigned long flags;
+ int i, sleep_msecs;
+ unsigned long flags = 0;
ehca_gen_dbg("opcode=%lx " HCALL7_REGS_FORMAT,
opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
- /* lock H_FREE_RESOURCE(MR) against itself and H_ALLOC_RESOURCE(MR) */
- if ((opcode == H_FREE_RESOURCE) && (arg7 == 5)) {
- arg7 = 0; /* better not upset firmware */
- do_lock = 1;
- }
-
for (i = 0; i < 5; i++) {
- if (do_lock)
+ /* serialize hCalls to work around firmware issue */
+ if (ehca_lock_hcalls)
spin_lock_irqsave(&hcall_lock, flags);
ret = plpar_hcall_norets(opcode, arg1, arg2, arg3, arg4,
arg5, arg6, arg7);
- if (do_lock)
+ if (ehca_lock_hcalls)
spin_unlock_irqrestore(&hcall_lock, flags);
if (H_IS_LONG_BUSY(ret)) {
@@ -174,24 +170,22 @@ static long ehca_plpar_hcall9(unsigned long opcode,
unsigned long arg9)
{
long ret;
- int i, sleep_msecs, do_lock;
+ int i, sleep_msecs;
unsigned long flags = 0;
ehca_gen_dbg("INPUT -- opcode=%lx " HCALL9_REGS_FORMAT, opcode,
arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
- /* lock H_ALLOC_RESOURCE(MR) against itself and H_FREE_RESOURCE(MR) */
- do_lock = ((opcode == H_ALLOC_RESOURCE) && (arg2 == 5));
-
for (i = 0; i < 5; i++) {
- if (do_lock)
+ /* serialize hCalls to work around firmware issue */
+ if (ehca_lock_hcalls)
spin_lock_irqsave(&hcall_lock, flags);
ret = plpar_hcall9(opcode, outs,
arg1, arg2, arg3, arg4, arg5,
arg6, arg7, arg8, arg9);
- if (do_lock)
+ if (ehca_lock_hcalls)
spin_unlock_irqrestore(&hcall_lock, flags);
if (H_IS_LONG_BUSY(ret)) {
@@ -821,7 +815,7 @@ u64 hipz_h_free_resource_mr(const struct ipz_adapter_handle adapter_handle,
return ehca_plpar_hcall_norets(H_FREE_RESOURCE,
adapter_handle.handle, /* r4 */
mr->ipz_mr_handle.handle, /* r5 */
- 0, 0, 0, 0, 5);
+ 0, 0, 0, 0, 0);
}
u64 hipz_h_reregister_pmr(const struct ipz_adapter_handle adapter_handle,
--
1.5.2
^ permalink raw reply related
* Re: dtc: Remove space from flex command line
From: Jon Loeliger @ 2007-12-06 15:19 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071206020750.GE17577@localhost.localdomain>
So, like, the other day David Gibson mumbled:
> Author: Geoff Levand <geoffrey.levand@am.sony.com>
>
> Apparently some versions of flex don't correctly parse the -o
> parameter, if there's a space between the -o and its argument. So,
> this patch removes it.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Applied.
Note, the way to specify the Author of a git patch is to
include the "From: Name <addr>" line at the beginning of
the patch's log message.
Oh, and, the author's SOB should be there too...? :-)
Thanks,
jdl
^ permalink raw reply
* Re: dtc: More detailed testing of tree checks
From: Jon Loeliger @ 2007-12-06 15:20 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071206055655.GC19927@localhost.localdomain>
So, like, the other day David Gibson mumbled:
> This patch modifies the dtc-checkfails.sh testcase wrapper so that
> instead of testing just that dtc fails with a particular error code on
> the sample input, it scans dtc's stderr output looking for a message
> that dtc failed a specific check or checks. This has several advantages:
> - It means we more precisely check dtc's checking behaviour
> - It means we can check for generation of warnings using the
> same script
> - It means we can test cases where dtc should generate
> multiple errors or warnings from different checks
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Applied.
jdl
^ permalink raw reply
* Re: dtc: Migrate "one cell" checks to new framework
From: Jon Loeliger @ 2007-12-06 15:20 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071206055945.GD19927@localhost.localdomain>
So, like, the other day David Gibson mumbled:
> This patch converts to the new tree checking framework those checks
> which verify that certain properties (#address-cells and #size-cells)
> are exactly one cell in size, when present.
>
> We also drop the old-style check for "linux,phandle" being one cell,
> since that is already implied in the the existing new-style checks on
> the linux,phandle property.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Applied.
jdl
^ permalink raw reply
* Re: dtc: Migrate "string property" checks to new framework
From: Jon Loeliger @ 2007-12-06 15:20 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071206060107.GE19927@localhost.localdomain>
So, like, the other day David Gibson mumbled:
> This patch converts to the new tree checking framework those checks
> which verify that certain properties (device_type, model) have a
> string value, when present.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Applied.
jdl
^ permalink raw reply
* Re: dtc: Remove obsolete check_properties() function
From: Jon Loeliger @ 2007-12-06 15:21 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071206060404.GF19927@localhost.localdomain>
So, like, the other day David Gibson mumbled:
> After the last couple of patches converting various old-style semantic
> checks to the new framework, the only thing that the old-style
> check_properties() function still checks is that the size of "reg"
> properties is a multiple of the cell size.
>
> This patch removes check_properties() and all related code and data.
> The check on the size of reg properties is folded into the existing
> check for the format of "reg" properties (still old-style for the time
> being).
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Applied.
jdl
^ permalink raw reply
* Re: [PATCH] windfarm: add PowerMac 12,1 support
From: Étienne Bersac @ 2007-12-06 15:30 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1196904050.7132.36.camel@thilivren>
[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]
Hi,
> + /* First, locate the params for this model */
> + for (i = 0; i < PM121_NUM_CONFIGS; i++) {
> + param = &(pm121_sys_all_params[loop_id][i]);
> + if (param->model_id == pm121_mach_model)
> + break;
> + }
> +
> + /* No params found, put fans to max */
> + if (param == NULL) {
> + printk(KERN_WARNING "pm121: %s fan config not found "
> + " for this machine model\n",
> + loop_names[loop_id]);
> + goto fail;
> + }
This part might be buggy. param NULL only when PM121_NUM_CONFIGS is 0.
The original code was :
+ for (i = 0; i < PM121_NUM_CONFIGS; i++) {
+ if (pm121_sys_all_params[loop_id][i].model_id == pm121_mach_model) {
+ param = &(pm121_sys_all_params[loop_id][i]);
+ break;
+ }
+ }
But the line is wider than 80 chars. An alternative would be :
+ for (i = 0; i < PM121_NUM_CONFIGS; i++) {
+ param = &(pm121_sys_all_params[loop_id][i]);
+ if (param->model_id == pm121_mach_model)
+ break;
+ else
+ param = NULL;
+ }
I wonder if that's more readable.
Regards,
Étienne.
--
E Ultreïa !
[-- Attachment #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH v2] qe: add ability to upload QE firmware
From: Arnd Bergmann @ 2007-12-06 15:31 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
In-Reply-To: <47580F43.7020404@freescale.com>
On Thursday 06 December 2007, Timur Tabi wrote:
> > I'm not trying to convince you of this if it's completely pointless for
> > all your systems, just want to make sure you're aware of this option,
> > because spending a few extra code lines on it now may save you some tro=
uble
> > if you need this later.
>=20
> Um, I think I'm a little confused as to what your point is. =A0My code is=
just a=20
> generic QE firmware uploader.
My point is that you could have some extra code that calls your
qe_upload_firmware() when the device tree contains the blob but the boot
loader did not already load it. This helps e.g. for the case where you
want to be able to install a generic Linux distribution that is not
able to ship with your firmware blob in the kernel or the root file system.
Putting the blob in the device tree makes it easier to get to a running
system then.
You can argue that the boot loader can always load the firmware in the
first place, but then you wouldn't need an implementation of
qe_upload_firmware in the kernel any more.
Arnd <><
^ permalink raw reply
* Re: [PATCH v2] qe: add ability to upload QE firmware
From: Timur Tabi @ 2007-12-06 15:46 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200712061631.19485.arnd@arndb.de>
Arnd Bergmann wrote:
> My point is that you could have some extra code that calls your
> qe_upload_firmware() when the device tree contains the blob but the boot
> loader did not already load it.
The current design of the 'firmware' node is such that if present, that means
that the firmware has already been uploaded.
We can't use the device tree to tell the kernel which firmware to upload,
because that is determined exclusively by the user's application. The drivers
are ultimately responsible for deciding which firmware to use.
> This helps e.g. for the case where you
> want to be able to install a generic Linux distribution that is not
> able to ship with your firmware blob in the kernel or the root file system.
> Putting the blob in the device tree makes it easier to get to a running
> system then.
But where would the blob come from? Probably from flash or a TFTP server. In
that case, the boot loader can still handle it.
> You can argue that the boot loader can always load the firmware in the
> first place, but then you wouldn't need an implementation of
> qe_upload_firmware in the kernel any more.
You might want to do runtime swapping of firmwares. One of the drawbacks of the
QE microcode design is that you can only have one microcode uploaded at a time.
If you need to have two different microcodes (e.g. Soft-UART and
interworking), then you need to merge the source code for those two into a new
microcode and compile that.
You might need to do full reset of the QE, which would require re-uploading.
You might not know until after the kernel boots which firmware you want.
In reality, having the boot loader load the firmware will usually be the
preferred approach, because that's simpler. Having it in both U-Boot and the
kernel covers all situations, though. There would be no need for the bootloader
to pass the firmware to the kernel.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: Powerpc PCI cleanups (mainly iSeries)
From: Josh Boyer @ 2007-12-06 15:44 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev
In-Reply-To: <20071207020726.8c0ea12b.sfr@canb.auug.org.au>
On Fri, 7 Dec 2007 02:07:26 +1100
Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> On Thu, 6 Dec 2007 18:00:45 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > I started out looking for ways to remove our dependencies on pci_dn and
> > got sidetracked into clening up the iSeries PCI code. The intention of
> > the following set of patches is that there be no semantic changes
> > (mostly).
>
> Some of these will clearly conflict with Benh's PCI work. We will sot
> that out between us. :-)
In the meantime...
My tree is going to carry BenH's patches since they're obviously
important to 4xx. If these conflicts get sorted out soon, that would
be good :). At some point I'm going to start sending stuff to Paul.
josh
^ permalink raw reply
* Re: [PATCH] IB/ehca: Serialize HCA-related hCalls on POWER5
From: Arnd Bergmann @ 2007-12-06 15:48 UTC (permalink / raw)
To: linuxppc-dev
Cc: Joachim Fenkes, LKML, OF-EWG, Christoph Raisch, Marcus Eder,
OF-General, Stefan Roscher
In-Reply-To: <200712061607.20004.fenkes@de.ibm.com>
On Thursday 06 December 2007, Joachim Fenkes wrote:
> =A0=A0=A0=A0=A0=A0=A0=A0printk(KERN_INFO "eHCA Infiniband Device Driver "
> =A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 "(Version " HCAD_VERSION ")\n");
> =A0
> +=A0=A0=A0=A0=A0=A0=A0/* Autodetect hCall locking -- we can't read the fi=
rmware version
> +=A0=A0=A0=A0=A0=A0=A0 * directly, but we know that starting with POWER6,=
all firmware
> +=A0=A0=A0=A0=A0=A0=A0 * versions are good.
> +=A0=A0=A0=A0=A0=A0=A0 */
> +=A0=A0=A0=A0=A0=A0=A0if (ehca_lock_hcalls =3D=3D -1)
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0ehca_lock_hcalls =3D !(cur_=
cpu_spec->cpu_user_features
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 & PPC_FEATURE_ARCH_2_05);
> +
> =A0=A0=A0=A0=A0=A0=A0=A0ret =3D ehca_create_comp_pool();
> =A0=A0=A0=A0=A0=A0=A0=A0if (ret) {
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0ehca_gen_err("Cannot crea=
te comp pool.");
We already talked about this yesterday, but I still feel that checking the
instruction set of the CPU should not be used to determine whether a
specific device driver implementation is used int hypervisor.
At the very least, I think you should change this to read the hypervisor
version number from the device tree, though the ideal solution would be
to have the absence of this bug encoded in the device node for the ehca
device itself.
Regarding the performance problem, have you checked whether converting all
your spin_lock_irqsave to spin_lock/spin_lock_irq improves your performance
on the older machines? Maybe it's already fast enough that way.
Arnd <><
^ permalink raw reply
* Re: [PATCH v2] qe: add ability to upload QE firmware
From: Arnd Bergmann @ 2007-12-06 15:58 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
In-Reply-To: <4758193B.5080707@freescale.com>
On Thursday 06 December 2007, Timur Tabi wrote:
> In reality, having the boot loader load the firmware will usually be the=
=20
> preferred approach, because that's simpler. =A0Having it in both U-Boot a=
nd the=20
> kernel covers all situations, though. =A0There would be no need for the b=
ootloader=20
> to pass the firmware to the kernel.
Ok, looks you were right from the start (again), thanks for your patience
explaining this to me.
Arnd <><
^ permalink raw reply
* Re: [PATCH v2] qe: add ability to upload QE firmware
From: Kumar Gala @ 2007-12-06 16:02 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev, Arnd Bergmann
In-Reply-To: <47581C58.8060906@freescale.com>
On Dec 6, 2007, at 9:59 AM, Timur Tabi wrote:
> Arnd Bergmann wrote:
>
>> Ok, looks you were right from the start (again), thanks for your
>> patience
>> explaining this to me.
>
> No problem. No all I need is for Kumar to apply the patches!
When I wait you come up with a new version.. so I'm waiting to see if
v3 comes out :)
- k
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox