Commit a43cdf08 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc

* git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] cell: fix bugs found by sparse
  [POWERPC] spiderpic: enable new style devtree support
  [POWERPC] Update cell_defconfig
  [POWERPC] spufs: add infrastructure for finding elf objects
  [POWERPC] spufs: support new OF device tree format
  [POWERPC] spufs: add support for read/write on cntl
  [POWERPC] spufs: remove support for ancient firmware
  [POWERPC] spufs: make mailbox functions handle multiple elements
  [POWERPC] spufs: use correct pg_prot for mapping SPU local store
  [POWERPC] spufs: Add infrastructure needed for gang scheduling
  [POWERPC] spufs: implement error event delivery to user space
  [POWERPC] spufs: fix context switch during page fault
  [POWERPC] spufs: scheduler support for NUMA.
  [POWERPC] spufs: cell spu problem state mapping updates
parents 97d41e90 43b4f406
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.18-rc6
# Sun Sep 10 10:20:32 2006
# Linux kernel version: 2.6.18
# Wed Oct 4 15:30:50 2006
#
CONFIG_PPC64=y
CONFIG_64BIT=y
......@@ -22,6 +22,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_PPC_OF=y
CONFIG_PPC_UDBG_16550=y
# CONFIG_GENERIC_TBSYNC is not set
CONFIG_AUDIT_ARCH=y
# CONFIG_DEFAULT_UIMAGE is not set
#
......@@ -52,10 +53,11 @@ CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_IPC_NS is not set
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
CONFIG_SYSCTL=y
# CONFIG_UTS_NS is not set
# CONFIG_AUDIT is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
......@@ -63,7 +65,9 @@ CONFIG_CPUSETS=y
# CONFIG_RELAY is not set
CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
# CONFIG_EMBEDDED is not set
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
......@@ -72,12 +76,12 @@ CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_RT_MUTEXES=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SHMEM=y
CONFIG_SLAB=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
# CONFIG_SLOB is not set
......@@ -96,6 +100,7 @@ CONFIG_STOP_MACHINE=y
#
# Block layer
#
CONFIG_BLOCK=y
# CONFIG_BLK_DEV_IO_TRACE is not set
#
......@@ -115,12 +120,13 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
# Platform support
#
CONFIG_PPC_MULTIPLATFORM=y
# CONFIG_PPC_ISERIES is not set
# CONFIG_EMBEDDED6xx is not set
# CONFIG_APUS is not set
# CONFIG_PPC_PSERIES is not set
# CONFIG_PPC_ISERIES is not set
# CONFIG_PPC_PMAC is not set
# CONFIG_PPC_MAPLE is not set
# CONFIG_PPC_PASEMI is not set
CONFIG_PPC_CELL=y
CONFIG_PPC_CELL_NATIVE=y
CONFIG_PPC_IBM_CELL_BLADE=y
......@@ -142,7 +148,6 @@ CONFIG_MMIO_NVRAM=y
#
CONFIG_SPU_FS=m
CONFIG_SPU_BASE=y
CONFIG_SPUFS_MMAP=y
CONFIG_CBE_RAS=y
#
......@@ -158,7 +163,7 @@ CONFIG_PREEMPT_NONE=y
CONFIG_PREEMPT_BKL=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_MISC=m
CONFIG_FORCE_MAX_ZONEORDER=13
CONFIG_FORCE_MAX_ZONEORDER=9
# CONFIG_IOMMU_VMERGE is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_KEXEC=y
......@@ -168,6 +173,7 @@ CONFIG_NUMA=y
CONFIG_NODES_SHIFT=4
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
......@@ -178,12 +184,12 @@ CONFIG_HAVE_MEMORY_PRESENT=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_SPARSE=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_MIGRATION=y
CONFIG_RESOURCES_64BIT=y
CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
CONFIG_ARCH_MEMORY_PROBE=y
# CONFIG_PPC_64K_PAGES is not set
CONFIG_PPC_64K_PAGES=y
CONFIG_SCHED_SMT=y
CONFIG_PROC_DEVICETREE=y
# CONFIG_CMDLINE_BOOL is not set
......@@ -201,6 +207,7 @@ CONFIG_GENERIC_ISA_DMA=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCIEPORTBUS=y
# CONFIG_PCI_MULTITHREAD_PROBE is not set
# CONFIG_PCI_DEBUG is not set
#
......@@ -228,6 +235,7 @@ CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_NET_KEY is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
......@@ -249,7 +257,8 @@ CONFIG_INET_XFRM_MODE_TUNNEL=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_BIC=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
#
# IP: Virtual Server Configuration
......@@ -261,11 +270,15 @@ CONFIG_IPV6=y
CONFIG_INET6_AH=m
CONFIG_INET6_ESP=m
CONFIG_INET6_IPCOMP=m
# CONFIG_IPV6_MIP6 is not set
CONFIG_INET6_XFRM_TUNNEL=m
CONFIG_INET6_TUNNEL=m
CONFIG_INET6_XFRM_MODE_TRANSPORT=y
CONFIG_INET6_XFRM_MODE_TUNNEL=y
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
CONFIG_IPV6_TUNNEL=m
# CONFIG_IPV6_SUBTREES is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set
# CONFIG_NETWORK_SECMARK is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
......@@ -322,7 +335,6 @@ CONFIG_IP_NF_QUEUE=m
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
......@@ -434,6 +446,7 @@ CONFIG_BLK_DEV_AEC62XX=y
# CONFIG_BLK_DEV_CS5530 is not set
# CONFIG_BLK_DEV_HPT34X is not set
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_JMICRON is not set
# CONFIG_BLK_DEV_SC1200 is not set
# CONFIG_BLK_DEV_PIIX is not set
# CONFIG_BLK_DEV_IT821X is not set
......@@ -456,6 +469,12 @@ CONFIG_IDEDMA_AUTO=y
#
# CONFIG_RAID_ATTRS is not set
# CONFIG_SCSI is not set
# CONFIG_SCSI_NETLINK is not set
#
# Serial ATA (prod) and Parallel ATA (experimental) drivers
#
# CONFIG_ATA is not set
#
# Multi-device support (RAID and LVM)
......@@ -470,6 +489,7 @@ CONFIG_MD_RAID1=m
# CONFIG_MD_MULTIPATH is not set
# CONFIG_MD_FAULTY is not set
CONFIG_BLK_DEV_DM=m
# CONFIG_DM_DEBUG is not set
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
CONFIG_DM_MIRROR=m
......@@ -504,7 +524,7 @@ CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
CONFIG_BONDING=y
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
CONFIG_TUN=y
#
# ARCnet devices
......@@ -552,7 +572,7 @@ CONFIG_SKGE=m
# CONFIG_TIGON3 is not set
# CONFIG_BNX2 is not set
CONFIG_SPIDER_NET=m
# CONFIG_MV643XX_ETH is not set
# CONFIG_QLA3XXX is not set
#
# Ethernet (10000 Mbit)
......@@ -599,6 +619,7 @@ CONFIG_SPIDER_NET=m
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
#
# Userland interfaces
......@@ -865,6 +886,7 @@ CONFIG_INFINIBAND_USER_ACCESS=m
CONFIG_INFINIBAND_ADDR_TRANS=y
CONFIG_INFINIBAND_MTHCA=m
CONFIG_INFINIBAND_MTHCA_DEBUG=y
# CONFIG_INFINIBAND_AMSO1100 is not set
CONFIG_INFINIBAND_IPOIB=m
CONFIG_INFINIBAND_IPOIB_DEBUG=y
CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y
......@@ -916,7 +938,7 @@ CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
CONFIG_AUTOFS4_FS=m
# CONFIG_FUSE_FS is not set
#
......@@ -943,8 +965,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_RAMFS=y
......@@ -1084,6 +1108,7 @@ CONFIG_PLIST=y
# Kernel hacking
#
# CONFIG_PRINTK_TIME is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_KERNEL=y
......@@ -1102,6 +1127,7 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_FS=y
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_FORCED_INLINING is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_DEBUG_STACKOVERFLOW is not set
......@@ -1123,6 +1149,10 @@ CONFIG_IRQSTACKS=y
# Cryptographic options
#
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_HASH=y
# CONFIG_CRYPTO_MANAGER is not set
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
......@@ -1132,6 +1162,8 @@ CONFIG_CRYPTO_SHA1=m
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_WP512 is not set
# CONFIG_CRYPTO_TGR192 is not set
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_CBC=m
CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
......
......@@ -16,11 +16,6 @@ config SPU_BASE
bool
default n
config SPUFS_MMAP
bool
depends on SPU_FS && SPARSEMEM
default y
config CBE_RAS
bool "RAS features for bare metal Cell BE"
default y
......
......@@ -101,7 +101,7 @@ static void iic_ioexc_eoi(unsigned int irq)
static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc,
struct pt_regs *regs)
{
struct cbe_iic_regs *node_iic = desc->handler_data;
struct cbe_iic_regs __iomem *node_iic = (void __iomem *)desc->handler_data;
unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC;
unsigned long bits, ack;
int cascade;
......@@ -320,7 +320,7 @@ static int __init setup_iic(void)
struct device_node *dn;
struct resource r0, r1;
unsigned int node, cascade, found = 0;
struct cbe_iic_regs *node_iic;
struct cbe_iic_regs __iomem *node_iic;
const u32 *np;
for (dn = NULL;
......@@ -357,7 +357,11 @@ static int __init setup_iic(void)
cascade = irq_create_mapping(iic_host, cascade);
if (cascade == NO_IRQ)
continue;
set_irq_data(cascade, node_iic);
/*
* irq_data is a generic pointer that gets passed back
* to us later, so the forced cast is fine.
*/
set_irq_data(cascade, (void __force *)node_iic);
set_irq_chained_handler(cascade , iic_ioexc_cascade);
out_be64(&node_iic->iic_ir,
(1 << 12) /* priority */ |
......
......@@ -345,8 +345,8 @@ static int cell_map_iommu_hardcoded(int num_nodes)
/* node 0 */
iommu = &cell_iommus[0];
iommu->mapped_base = ioremap(0x20000511000, 0x1000);
iommu->mapped_mmio_base = ioremap(0x20000510000, 0x1000);
iommu->mapped_base = ioremap(0x20000511000ul, 0x1000);
iommu->mapped_mmio_base = ioremap(0x20000510000ul, 0x1000);
enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base);
......@@ -358,8 +358,8 @@ static int cell_map_iommu_hardcoded(int num_nodes)
/* node 1 */
iommu = &cell_iommus[1];
iommu->mapped_base = ioremap(0x30000511000, 0x1000);
iommu->mapped_mmio_base = ioremap(0x30000510000, 0x1000);
iommu->mapped_base = ioremap(0x30000511000ul, 0x1000);
iommu->mapped_mmio_base = ioremap(0x30000510000ul, 0x1000);
enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base);
......
......@@ -244,7 +244,6 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
int imaplen, intsize, unit;
struct device_node *iic;
#if 0 /* Enable that when we have a way to retreive the node as well */
/* First, we check wether we have a real "interrupts" in the device
* tree in case the device-tree is ever fixed
*/
......@@ -252,9 +251,8 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) {
virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
oirq.size);
goto bail;
return virq;
}
#endif
/* Now do the horrible hacks */
tmp = get_property(pic->of_node, "#interrupt-cells", NULL);
......@@ -369,7 +367,7 @@ void __init spider_init_IRQ(void)
} else if (device_is_compatible(dn, "sti,platform-spider-pic")
&& (chip < 2)) {
static long hard_coded_pics[] =
{ 0x24000008000, 0x34000008000 };
{ 0x24000008000ul, 0x34000008000ul};
r.start = hard_coded_pics[chip];
} else
continue;
......
......@@ -25,11 +25,13 @@
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/poll.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <asm/firmware.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <linux/mutex.h>
......@@ -46,21 +48,21 @@ EXPORT_SYMBOL_GPL(spu_priv1_ops);
static int __spu_trap_invalid_dma(struct spu *spu)
{
pr_debug("%s\n", __FUNCTION__);
force_sig(SIGBUS, /* info, */ current);
spu->dma_callback(spu, SPE_EVENT_INVALID_DMA);
return 0;
}
static int __spu_trap_dma_align(struct spu *spu)
{
pr_debug("%s\n", __FUNCTION__);
force_sig(SIGBUS, /* info, */ current);
spu->dma_callback(spu, SPE_EVENT_DMA_ALIGNMENT);
return 0;
}
static int __spu_trap_error(struct spu *spu)
{
pr_debug("%s\n", __FUNCTION__);
force_sig(SIGILL, /* info, */ current);
spu->dma_callback(spu, SPE_EVENT_SPE_ERROR);
return 0;
}
......@@ -317,7 +319,7 @@ static void spu_free_irqs(struct spu *spu)
free_irq(spu->irqs[2], spu);
}
static LIST_HEAD(spu_list);
static struct list_head spu_list[MAX_NUMNODES];
static DEFINE_MUTEX(spu_mutex);
static void spu_init_channels(struct spu *spu)
......@@ -354,32 +356,42 @@ static void spu_init_channels(struct spu *spu)
}
}
struct spu *spu_alloc(void)
struct spu *spu_alloc_node(int node)
{
struct spu *spu;
struct spu *spu = NULL;
mutex_lock(&spu_mutex);
if (!list_empty(&spu_list)) {
spu = list_entry(spu_list.next, struct spu, list);
if (!list_empty(&spu_list[node])) {
spu = list_entry(spu_list[node].next, struct spu, list);
list_del_init(&spu->list);
pr_debug("Got SPU %x %d\n", spu->isrc, spu->number);
} else {
pr_debug("No SPU left\n");
spu = NULL;
pr_debug("Got SPU %x %d %d\n",
spu->isrc, spu->number, spu->node);
spu_init_channels(spu);
}
mutex_unlock(&spu_mutex);
if (spu)
spu_init_channels(spu);
return spu;
}
EXPORT_SYMBOL_GPL(spu_alloc_node);
struct spu *spu_alloc(void)
{
struct spu *spu = NULL;
int node;
for (node = 0; node < MAX_NUMNODES; node++) {
spu = spu_alloc_node(node);
if (spu)
break;
}
return spu;
}
EXPORT_SYMBOL_GPL(spu_alloc);
void spu_free(struct spu *spu)
{
mutex_lock(&spu_mutex);
list_add_tail(&spu->list, &spu_list);
list_add_tail(&spu->list, &spu_list[spu->node]);
mutex_unlock(&spu_mutex);
}
EXPORT_SYMBOL_GPL(spu_free);
......@@ -566,7 +578,7 @@ static void spu_unmap(struct spu *spu)
}
/* This function shall be abstracted for HV platforms */
static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
static int __init spu_map_interrupts_old(struct spu *spu, struct device_node *np)
{
unsigned int isrc;
const u32 *tmp;
......@@ -590,7 +602,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
return spu->irqs[2] == NO_IRQ ? -EINVAL : 0;
}
static int __init spu_map_device(struct spu *spu, struct device_node *node)
static int __init spu_map_device_old(struct spu *spu, struct device_node *node)
{
const char *prop;
int ret;
......@@ -635,6 +647,88 @@ out:
return ret;
}
static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
{
struct of_irq oirq;
int ret;
int i;
for (i=0; i < 3; i++) {
ret = of_irq_map_one(np, i, &oirq);
if (ret)
goto err;
ret = -EINVAL;
spu->irqs[i] = irq_create_of_mapping(oirq.controller,
oirq.specifier, oirq.size);
if (spu->irqs[i] == NO_IRQ)
goto err;
}
return 0;
err:
pr_debug("failed to map irq %x for spu %s\n", *oirq.specifier, spu->name);
for (; i >= 0; i--) {
if (spu->irqs[i] != NO_IRQ)
irq_dispose_mapping(spu->irqs[i]);
}
return ret;
}
static int spu_map_resource(struct device_node *node, int nr,
void __iomem** virt, unsigned long *phys)
{
struct resource resource = { };
int ret;
ret = of_address_to_resource(node, 0, &resource);
if (ret)
goto out;
if (phys)
*phys = resource.start;
*virt = ioremap(resource.start, resource.end - resource.start);
if (!*virt)
ret = -EINVAL;
out:
return ret;
}
static int __init spu_map_device(struct spu *spu, struct device_node *node)
{
int ret = -ENODEV;
spu->name = get_property(node, "name", NULL);
if (!spu->name)
goto out;
ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store,
&spu->local_store_phys);
if (ret)
goto out;
ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem,
&spu->problem_phys);
if (ret)
goto out_unmap;
ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2,
NULL);
if (ret)
goto out_unmap;
if (!firmware_has_feature(FW_FEATURE_LPAR))
ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1,
NULL);
if (ret)
goto out_unmap;
return 0;
out_unmap:
spu_unmap(spu);
out:
pr_debug("failed to map spe %s: %d\n", spu->name, ret);
return ret;
}
struct sysdev_class spu_sysdev_class = {
set_kset_name("spu")
};
......@@ -688,6 +782,9 @@ static int __init create_spu(struct device_node *spe)
goto out;
ret = spu_map_device(spu, spe);
/* try old method */
if (ret)
ret = spu_map_device_old(spu, spe);
if (ret)
goto out_free;
......@@ -696,6 +793,8 @@ static int __init create_spu(struct device_node *spe)
if (spu->nid == -1)
spu->nid = 0;
ret = spu_map_interrupts(spu, spe);
if (ret)
ret = spu_map_interrupts_old(spu, spe);
if (ret)
goto out_unmap;
spin_lock_init(&spu->register_lock);
......@@ -706,13 +805,13 @@ static int __init create_spu(struct device_node *spe)
spu->number = number++;
ret = spu_request_irqs(spu);
if (ret)
goto out_unmap;
goto out_unlock;
ret = spu_create_sysdev(spu);
if (ret)
goto out_free_irqs;
list_add(&spu->list, &spu_list);
list_add(&spu->list, &spu_list[spu->node]);
mutex_unlock(&spu_mutex);
pr_debug(KERN_DEBUG "Using SPE %s %02x %p %p %p %p %d\n",
......@@ -722,9 +821,9 @@ static int __init create_spu(struct device_node *spe)
out_free_irqs:
spu_free_irqs(spu);
out_unmap:
out_unlock:
mutex_unlock(&spu_mutex);
out_unmap:
spu_unmap(spu);
out_free:
kfree(spu);
......@@ -745,9 +844,13 @@ static void destroy_spu(struct spu *spu)
static void cleanup_spu_base(void)
{
struct spu *spu, *tmp;
int node;
mutex_lock(&spu_mutex);
list_for_each_entry_safe(spu, tmp, &spu_list, list)
destroy_spu(spu);
for (node = 0; node < MAX_NUMNODES; node++) {
list_for_each_entry_safe(spu, tmp, &spu_list[node], list)
destroy_spu(spu);
}
mutex_unlock(&spu_mutex);