- Sep 19, 2007
-
-
Andre Detsch authored
Affinity reference point location (gang->aff_ref_spu) is reset when the whole gang is descheduled. However, the last member of a gang can be descheduled while we are trying to schedule another member of the gang. This was leading to a race condition, and the code was using gang->aff_ref_spu in an unsafe manner. By holding the gang->aff_mutex a little bit longer, and increment gang->aff_sched_count (which controls when gang->aff_ref_spu should be reset) a little bit earlier, the problem is fixed. Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Sebastian Siewior authored
According to the comment in spufs_init_isolated_loader(), the isolated loader should be aligned on a 16 byte boundary. ARCH_{KMALLOC,SLAB}_MINALIGN is not defined so only 8 byte alignment is guaranteed. This enforces alignment via __get_free_pages. Signed-off-by:
Sebastian Siewior <sebastian@breakpoint.cc> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Jeremy Kerr authored
Based on an initial patch from Sebastian Siewior <sebastian@breakpoint.cc> spu_harvest isn't used, remove it. Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Jeremy Kerr authored
do_spu_create doesn't need the asmlinkage qualifier; remove it. Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Sebastian Siewior authored
There are a few symbols used only in one file within spufs; this change makes them static where suitable. Signed-off-by:
Sebastian Siewior <sebastian@breakpoint.cc> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Sep 13, 2007
-
-
Michael Ellerman authored
The most common match semantic is an exact match based on the device node. So provide a default implementation that does this, and hook it up if no match routine is specified. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
The majority of irq_host implementations (3 out of 4) are associated with a device_node, and need to stash it somewhere. Rather than having it somewhere different for each host, add an optional device_node pointer to the irq_host structure. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Sep 10, 2007
-
-
Masato Noguchi authored
The Cell BE Architecture spec states that the SPU MFC Class 0 interrupt is edge-triggered. The current spu interrupt handler assumes this behavior and does not clear the interrupt status. The PS3 hypervisor visualizes all SPU interrupts as level, and on return from the interrupt handler the hypervisor will deliver a new virtual interrupt for any unmasked interrupts which for which the status has not been cleared. This fix clears the interrupt status in the interrupt handler. Signed-off-by:
Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by:
Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Acked-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Aug 30, 2007
-
-
Andre Detsch authored
This fixes a major bug which was happening when a SPU thread advances its execution right after being restored to a SPU. A potentially outdated NPC value was being (re)written to the SPU. So, spu_run_init, in this case, was either not doing anything relevant, or breaking the execution of the SPU thread. This fixes a common problem of losing a mailbox write when it was done to a saved context. Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Arnd Bergmann authored
When a process writes into the inbound spu mailbox (wbox) while the context is saved, we accidentally break the contents of the mb_stat_R register by clearing other entries of the mailbox status register. This can cause the user side to hang. This change fixes the problem by only altering the appropriate bits of the mailbox status register during a backing-store write. Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Aug 29, 2007
-
-
Christian Krafft authored
This fixes a regression introduced with 2.6.23-rc4 after on some confusion about the device tree interfaces. IBM QS21 device trees provide "physical-id", so we changed the code to run on that and remain compatible with all IBM machines. However, the Toshiba Celleb device tree provides the "unit-id" property, which was in the Linux code, but never used in this way on IBM hardware. Legacy device tree used the reg property for the physical id of an spe. This patch fixes find_spu_unit_number to look for the spu id in that order. The length is checked to avoid misinterpretation in case the attributes unit-id or reg do not contain the id. Signed-off-by:
Christian Krafft <krafft@de.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Cc: Jeremy Kerr <jk@ozlabs.org>
-
- Aug 25, 2007
-
-
Arnd Bergmann authored
The Cell Broadband Engine has a method of injecting a system-reset-exception from an external source into the operating system, which should trigger the regular behaviour of entering xmon or kdump. Unfortunately, the exception handler cannot distinguish it from other interrupt causes by the SRR1 register, which gets used for this on Power 6 and others. IBM Blade servers that want to support triggering the system reset exception using a pinhole button in the front panel therefore use an extra register to determine the reset cause. Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> -- Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Christian Krafft authored
Legacy device tree used the reg property for the physical id of an spe. On newer device tree layouts the reg property contains the "correct" value in the reg attribute. So there has been intoduced the "physical-id" on newer devicetree layouts. The id is stored by spu_manage into the spu struct as spe_id. cbe_thermal has been changed to use the spu->spe_id. There's no need for the thermal code to check devicetree attributes for itself. Signed-off-by:
Christian Krafft <krafft@de.ibm.com> Cc: Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Aug 15, 2007
-
-
Jeremy Kerr authored
At present, spu_create with an invalid neighbo(u)r will return -ENOSYS, not -EBADF, but only when spufs.o is built as a module. This change adds the appropriate errno, making the behaviour the same as the built-in case. Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Acked-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Aug 10, 2007
-
-
Andre Detsch authored
This patch moves affinity initialization code from spu_base.c to a new spu_management_of_ops function (init_affinity), which is empty in the case of PS3. This fixes a linking problem that was happening when compiling for PS3. Also, some small code style changes were made. Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Geoff Levand <geoffrey.levand@am.sony.com> Acked-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Aug 03, 2007
-
-
Andre Detsch authored
This patch fixes affinity reference point placement, which was not being done in some situations, after the introduction of node_allowed() calls. The previously used parameter, 'ctx', is just the iterator of the previous list_for_each_entry_reverse loop, and its value might be invalid at the end of the loop. Also, the right context to seek for information when defining the reference ctx location _is_ the reference ctx. Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Jul 26, 2007
-
-
Christoph Hellwig authored
Currently we calculate the first timeslice for every context incorrectly - alloc_spu_context calls spu_set_timeslice before we set ctx->prio so we always calculate the longest possible timeslice for the lowest possible priority. This patch makes sure to update the schedule-related fields before calculating the timeslice and also makes sure we update the timeslice for a non-running context when entering spu_run so a priority change affects the context as soon as possible. Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Masato Noguchi authored
We currently initialize cbe_spu_info[].spus in both init_spu_base and spu_sched_init. The initialise in spu_sched_init clears the SPU list, so we end up with no physical SPUs. Because of this, the spu_run syscall will block forever. This change removes the unnecessary initialization in spu_sched_init. Signed-off-by:
Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Jul 24, 2007
-
-
Christoph Hellwig authored
spufs.h now has two enums for the sched_flags leading to identical values for SPU_SCHED_WAS_ACTIVE and SPU_SCHED_NOTIFY_ACTIVE. Merge them into a single enum as they were in the IBM development tree. Signed-off-by:
Christoph Hellwig <hch@lst.de> Acked-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Jul 22, 2007
-
-
Al Viro authored
Fix a mismerge in commit 8b6f50ef: "spufs: make signal-notification files readonly for NOSCHED contexts", where structs got duplicated. Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk> Acked-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Jeremy Kerr authored
Reading from the signal{1,2} files requires a spu_acquire_saved, so make these files write-only for contexts created with SPU_CREATE_NOSCHED. Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Acked-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Jul 20, 2007
-
-
Christoph Hellwig authored
This sorts out the various lists and related locks in the spu code. In detail: - the per-node free_spus and active_list are gone. Instead struct spu gained an alloc_state member telling whether the spu is free or not - the per-node spus array is now locked by a per-node mutex, which takes over from the global spu_lock and the per-node active_mutex - the spu_alloc* and spu_free function are gone as the state change is now done inline in the spufs code. This allows some more sharing of code for the affinity vs normal case and more efficient locking - some little refactoring in the affinity code for this locking scheme Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Bob Nelson authored
From: Maynard Johnson <mpjohn@us.ibm.com> This patch updates the existing arch/powerpc/oprofile/op_model_cell.c to add in the SPU profiling capabilities. In addition, a 'cell' subdirectory was added to arch/powerpc/oprofile to hold Cell-specific SPU profiling code. Exports spu_set_profile_private_kref and spu_get_profile_private_kref which are used by OProfile to store private profile information in spufs data structures. Also incorporated several fixes from other patches (rrn). Check pointer returned from kzalloc. Eliminated unnecessary cast. Better error handling and cleanup in the related area. 64-bit unsigned long parameter was being demoted to 32-bit unsigned int and eventually promoted back to unsigned long. Signed-off-by:
Carl Love <carll@us.ibm.com> Signed-off-by:
Maynard Johnson <mpjohn@us.ibm.com> Signed-off-by:
Bob Nelson <rrnelson@us.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Acked-by:
Paul Mackerras <paulus@samba.org>
-
Bob Nelson authored
From: Maynard Johnson <mpjohn@us.ibm.com> This patch adds to the capability of spu_switch_event_register so that the caller is also notified of currently active SPU tasks. Exports spu_switch_event_register and spu_switch_event_unregister so that OProfile can get access to the notifications provided. Signed-off-by:
Maynard Johnson <mpjohn@us.ibm.com> Signed-off-by:
Carl Love <carll@us.ibm.com> Signed-off-by:
Bob Nelson <rrnelson@us.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com> Acked-by:
Paul Mackerras <paulus@samba.org>
-
Christoph Hellwig authored
Sort out the locking mess in spu_base and document the current rules. As an added benefit spu_alloc* and spu_free don't block anymore. Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Arnd Bergmann authored
This patch links spus according to their physical position using information provided by the firmware through a special vicinity device-tree property. This property is present in current version of Malta firmware. Example of vicinity properties for a node in Malta: Node: Vicinity property contains phandles of: spe@0 [ spe@100000 , mic-tm@50a000 ] spe@100000 [ spe@0 , spe@200000 ] spe@200000 [ spe@100000 , spe@300000 ] spe@300000 [ spe@200000 , bif0@512000 ] spe@80000 [ spe@180000 , mic-tm@50a000 ] spe@180000 [ spe@80000 , spe@280000 ] spe@280000 [ spe@180000 , spe@380000 ] spe@380000 [ spe@280000 , bif0@512000 ] Only spe@* have a vicinity property (e.g., bif0@512000 and mic-tm@50a000 do not have it). Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Arnd Bergmann authored
This patch makes the scheduller honor affinity information for each context being scheduled. If the context has no affinity information, behaviour is unchanged. If there are affinity information, context is schedulled to be run on the exact spu recommended by the affinity placement algorithm. Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Arnd Bergmann authored
This patch provides the spu affinity placement logic for the spufs scheduler. Each time a gang is going to be scheduled, the placement of a reference context is defined. The placement of all other contexts with affinity from the gang is defined based on this reference context location and on a precomputed displacement offset. Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Arnd Bergmann authored
This patch adds support for additional flags at spu_create, which relate to the establishment of affinity between contexts and contexts to memory. A fourth, optional, parameter is supported. This parameter represent a affinity neighbor of the context being created, and is used when defining SPU-SPU affinity. Affinity is represented as a doubly linked list of spu_contexts. Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Arnd Bergmann authored
This patch allows the use of spu affinity on QS20, whose original FW does not provide affinity information. This is done through two hardcoded arrays, and by reading the reg property from each spu. Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Arnd Bergmann authored
This patch adds affinity data to each spu instance. A doubly linked list is created, meant to connect the spus in the physical order they are placed in the BE. SPUs near to memory should be marked as having memory affinity. Adjustments of the fields acording to FW properties is done in separate patches, one for CPBW, one for Malta (patch for Malta under testing). Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Arnd Bergmann authored
Addition of a spufs-global "cbe_info" array. Each entry contains information about one Cell/B.E. node, namelly: * list of spus (both free and busy spus are in this list); * list of free spus (replacing the static spu_list from spu_base.c) * number of spus; * number of reserved (non scheduleable) spus. SPE affinity implementation actually requires only access to one spu per BE node (since it implements its own pointer to walk through the other spus of the ring) and the number of scheduleable spus (n_spus - non_sched_spus) However having this more general structure can be useful for other functionalities, concentrating per-cbe statistics / data. Signed-off-by:
Andre Detsch <adetsch@br.ibm.com> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Masato Noguchi authored
spu_sched->bitmap has MAX_PRIO(=140) width in bits.However, since ff80a77f, sched_find_first_bit() only supports 100-bit bitmaps. Thus, spu_sched->bitmap should be treated by generic find_first_bit(). Signed-off-by:
Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Jeremy Kerr authored
From: Sebastian Siewior <cbe-oss-dev@ml.breakpoint.cc> The 'file' argument is unused in spufs_run_spu(). This change removes it. Signed-off-by:
Sebastian Siewior <sebastian@breakpoint.cc> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Masato Noguchi authored
The SPU decrementer should be restored after the LSCSA DMA has completed. Signed-off-by:
Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Masato Noguchi authored
No need to halt the SPE decrementer at context restore step 47, it will be done in step 7. Signed-off-by:
Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Masato Noguchi authored
At save step 8, the mfc control register in the CSA should be written _only_ with Sc and Sm bits (at least MFC_CNTL[Dh] should be set to 0) Signed-off-by:
Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Masato Noguchi authored
The decr_status in the LSCSA is valid only in the sequence of context restore. Thus, it's nonsense to read and/or write it through spufs. This patch changes decr_status node to access MFC_CNTL[Ds] in the CSA. Signed-off-by:
Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Masato Noguchi authored
The decr_status in the LSCSA is confusedly used as two meanings: * SPU decrementer was running * SPU decrementer was wrapped as a result of adjust and the code to set decr_status is missing. This patch fixes these problems by using the decr_status argument as a set of flags. This requires a rebuild of the shipped spu_restore code. Signed-off-by:
Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-
Masato Noguchi authored
The following steps are not needed in the SPE context save/restore paths: Save Step 12: save_mfc_decr() save suspend_time to CSA (It will be done by step 14) save ch 7 (decrementer value will be saved in LSCSA by spe-side step 10) Restore Step 59: restore_ch_part1() restore ch 1 (it will be done by spe-side step 15) This change removes the unnecessary steps. Signed-off-by:
Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Arnd Bergmann <arnd.bergmann@de.ibm.com>
-