summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2012-05-10Merge remote-tracking branch 'jwb/next' into nextBenjamin Herrenschmidt
Josh writes: << A few patches from Suzie for 47x kexec/kdump support, and some MSI patches from Mai La. >>
2012-05-09powerpc: Remove now unused _TIF_RUNLATCHTiejun Chen
'TIF_RUNLATCH' is already dropped from commit fe1952fc0afb9a2e4c79f103c08aef5d13db1873 powerpc: Rework runlatch code So '_TIF_RUNLATCH' should be removed as well. Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-05-09powerpc/windfarm: Fix crash on SMU based machine after i2c conversionBenjamin Herrenschmidt
We no longer get the device node in platform_data but instead where it belongs in struct device, so get it from there instead of blowing up. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-05-09Merge branch 'merge' into nextBenjamin Herrenschmidt
2012-05-09powerpc/irq: Make alignment & program interrupt behave the sameBenjamin Herrenschmidt
Alignment was the last user of the ENABLE_INTS macro, which we can now remove. All non-syscall exceptions now disable interrupts on entry, they get re-enabled conditionally from C code. Don't unconditionally re-enable in program check either, check the original context. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-05-09powerpc/irq: Fix bug with new lazy IRQ handling codeBenjamin Herrenschmidt
We had a case where we could turn on hard interrupts while leaving the PACA_IRQ_HARD_DIS bit set in the PACA. This can in turn cause a BUG_ON() to hit in __check_irq_replay() due to interrupt state getting out of sync. The assembly code was also way too convoluted. Instead, we now leave it to the C code to do the right thing which ends up being smaller and more readable. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-05-03powerpc/40x: Use {upper,lower}_32_bits for msi_physJosh Boyer
Fix a build error when -Werror is set: arch/powerpc/sysdev/ppc4xx_msi.c: In function ‘ppc4xx_setup_pcieh_hw’: arch/powerpc/sysdev/ppc4xx_msi.c:178:2: error: right shift count >= width of type [-Werror] Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2012-05-03powerpc/44x: Add PCI MSI node for Maui APM821xx SoC and Bluestone board in DTSMai La
Signed-off-by: Mai La <mla@apm.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2012-05-03powerpc/44x: Fix PCI MSI support for Maui APM821xx SoC and Bluestone boardMai La
This patch consists of: - Enable PCI MSI as default for Bluestone board - Change definition of number of MSI interrupts as it depends on SoC - Fix returning ENODEV as finding MSI node - Fix MSI physical high and low address - Keep MSI data logically Signed-off-by: Mai La <mla@apm.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2012-05-03powerpc/47x: Enable CRASH_DUMPSuzuki Poulose
Now that we have KEXEC and relocatable kernel working on 47x (!SMP) enable CRASH_DUMP. Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2012-05-03powerpc/47x: Kernel support for KEXECSuzuki Poulose
This patch adds support for creating 1:1 mapping for the PPC_47x during a KEXEC. The implementation is similar to that of the PPC440x which is described here : http://patchwork.ozlabs.org/patch/104323/ PPC_47x MMU : The 47x uses Unified TLB 1024 entries, with 4-way associative mapping (4 x 256 entries). The index to be used is calculated by the MMU by hashing the PID, EPN and TS. The software can choose to specify the way by setting bit 0(enable way select) and the way in bits 1-2 in the TLB Word 0. Implementation: The patch erases all the UTLB entries which includes the tlb covering the mapping for our code. The shadow TLB caches the mapping for the running code which helps us to continue the execution until we do isync/rfi. We then create a tmp mapping for the current code in the other address space (TS) and switch to it. Then we create a 1:1 mapping(EPN=RPN) for 0-2GiB in the original address space and switch to the new mapping. TODO: Add SMP support. Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2012-05-03powerpc/44x: Fix/Initialize PID to kernel PID before the TLB searchSuzuki Poulose
Initialize the PID register with kernel pid (0) before we start setting the TLB mapping for KEXEC. Also set the MMUCR[TID] to kernel PID. This was spotted while testing the kexec on ISS for 47x. ISS doesn't return a successful tlbsx for a kernel address with PID set to a user PID. Though the hardware/qemu/simics work fine. This patch is harmless and initializes the PID to 0 (kernel PID) which is usually the case during a normal kernel boot. This would fix the kexec on ISS for 440. I have tested this patch on sequoia board. Signed-off-by: Suzuki K Poulose <suzuki@in.ibm.com> Cc: Josh Boyer <jwboyer@gmail.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2012-05-03powerpc/windfarm: don't pass const strings to snprintfStephen Rothwell
Fixes these build warnings: drivers/macintosh/windfarm_smu_sat.c: In function 'wf_sat_probe': drivers/macintosh/windfarm_smu_sat.c:290:3: warning: passing argument 1 of 'snprintf' discards qualifiers from pointer target type include/linux/kernel.h:323:5: note: expected 'char *' but argument is of type 'const char *' drivers/macintosh/windfarm_smu_sat.c:317:3: warning: passing argument 1 of 'snprintf' discards qualifiers from pointer target type include/linux/kernel.h:323:5: note: expected 'char *' but argument is of type 'const char *' Introduced by commit e074d08e2b98 ("powerpc/windfarm: const'ify and add "priv" field to controls & sensors"). Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-05-03powerpc/windfarm: fix compiler warningStephen Rothwell
Fixes this warning: drivers/macintosh/windfarm_pm91.c: In function 'wf_smu_cpu_fans_tick': drivers/macintosh/windfarm_pm91.c:237:2: warning: passing argument 1 of 'wf_sensor_get' from incompatible pointer type drivers/macintosh/windfarm.h:124:19: note: expected 'struct wf_sensor *' but argument is of type 'struct wf_sensor **' Introduced by commit 33e6820b767a ("powerpc/windfarm: Add useful accessors"). Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Remove old powerpc specific ptrace getregs/setregs callsAnton Blanchard
PowerPC has non standard getregs calls that only dump the GPRs or FPRs and have their arguments reversed. commit e17666ba48f7 (ptrace updates & new, better requests) in 2.6.3 deprecated them and introduced more standard versions. It's been about 5 years and I know of no users of the old calls so lets remove them. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Use WARN instead of dump_stack when printing EEH error backtraceAnton Blanchard
When we get an EEH error we just print a backtrace with dump_stack which is rather cryptic. We really should print something before spewing out the backtrace. Also switch from dump_stack to WARN so we get more information about the fail - what modules were loaded, what process was running etc. This was useful information when debugging a recent EEH subsystem bug. The standard WARN output should also get picked up by monitoring tools like kerneloops. The register dump is of questionable value here but I figured it was better to use something standard and not roll my own. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Add 64-bit CPU targets for gccAnton Blanchard
Add a menu to select various 64-bit CPU targets for gcc. We default to -mtune=power7 and if gcc doesn't understand that we fallback to -mtune=power4. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Remove altivec fix for gcc versions before 4.0Anton Blanchard
Now we require gcc 4.0 on 64-bit we can remove the pre gcc 4.0 -maltivec workaround. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Require gcc 4.0 on 64-bitAnton Blanchard
Older versions of gcc had issues with using -maltivec together with -mcpu of a non altivec capable CPU. We work around it by specifying -mcpu=970, but the logic is complicated. In preparation for adding more -mcpu targets, remove the workaround and just require gcc 4.0 for 64-bit builds. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Remove CONFIG_POWER4_ONLYAnton Blanchard
Remove CONFIG_POWER4_ONLY, the option is badly named and only does two things: - It wraps the MMU segment table code. With feature fixups there is little downside to compiling this in. - It uses the newer mtocrf instruction in various assembly functions. Instead of making this a compile option just do it at runtime via a feature fixup. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/powermac: New windfarm driver for PowerMac G5 (AGP) and Xserve G5Benjamin Herrenschmidt
This replaces the old therm_pm72 using the same windfarm infrastructure that was used for other PowerMac G5 models. The fan speeds and sensors should now be visible in the same location in sysfs. The driver is split into separate core modules for PowerMac7,2 (and 7,3) and RackMac3,1, with a lot of the shared code now in the separate sensor and control modules. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/windfarm: Add Fan Control Unit controls for G5sBenjamin Herrenschmidt
The FCU operates the fans on the earlier generation G5 machines, this module will be used by upcoming windfarm drivers. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/windfarm: Updates to lm75 and max6690 sensorsBenjamin Herrenschmidt
This allows those modules to load on PowerMac7,2 PowerMac7,3 and RackMac3,1 and add the sensor name conversion for those machines. This will be used by the corresponding new windfarm modules for those machines. Note that since therm_pm72 is linked first, it will still take priority on those i2c devices if built-in. If using modules it will depend which is loaded first, but you should avoid building therm_pm72 if you are using the new windfarm drivers Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/windfarm: Add lm87 sensorBenjamin Herrenschmidt
For use by the upcoming windfarm_rm31 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/windfarm: Add ad7417 sensorBenjamin Herrenschmidt
For user by the upcoming windfarm_pm72 and windfarm_rm31 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/windfarm: Add useful accessorsBenjamin Herrenschmidt
Makes the code more readable Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/windfarm: Improve display of fan speeds in sysfsBenjamin Herrenschmidt
Controls registered as RPM and PWM fans are now displayed with the "RPM" or "%" suffix respectively to make it clearer to the user what the value actually means since the fan type isn't otherwise obvious. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/windfarm: Remove spurrious sysfs_attr_init()Benjamin Herrenschmidt
The windfarm core will do it, so this is a duplicate. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/windfarm: const'ify and add "priv" field to controls & sensorsBenjamin Herrenschmidt
const'ify the sensor ops and name and add a void* for use by the control and sensor drivers to point back to their private data, avoiding the need to create a wrapper data structure per sensor or control instance. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/pmac: Convert windfarm_smu_sat to new i2c probingBenjamin Herrenschmidt
This simplifies the driver to stop using the deprecated attach interface. While at it we also implement teardown properly and fix the refcounting by using a kref. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/pmac: Convert windfarm_max6690 to new i2c probingBenjamin Herrenschmidt
This simplifies the driver to stop using the deprecated attach interface Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/pmac: Convert windfarm_lm75 to new i2c probingBenjamin Herrenschmidt
This simplifies the driver to stop using the deprecated attach interface Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/pmac: Convert therm_adt746x to new i2c probingBenjamin Herrenschmidt
This simplifies the driver to stop using the deprecated attach interface, Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30i2c/powermac: Register i2c devices from device-treeBenjamin Herrenschmidt
This causes i2c-powermac to register i2c devices exposed in the device-tree, enabling new-style probing of devices. Note that we prefix the IDs with "MAC," in order to prevent the generic drivers from matching. This is done on purpose as we only want drivers specifically tested/designed to operate on powermacs to match. This removes the special case we had for the AMS driver, and updates the driver's match table instead. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Optimise enable_kernel_altivecAnton Blanchard
Add two optimisations to enable_kernel_altivec: - enable_kernel_altivec has already determined if we need to save the previous task's state but we call giveup_altivec in both cases, requiring an extra branch in giveup_altivec. Create giveup_altivec_notask which only turns on the VMX bit in the MSR. - We write the VMX MSR bit each time we call enable_kernel_altivec even it was already set. Check the bit and branch out if we have already set it. The classic case for this is vectored IO where we have to copy multiple buffers to or from userspace. The following testcase was used to confirm this patch improves performance: http://ozlabs.org/~anton/junkcode/copy_to_user.c Since the current breakpoint for using VMX in copy_tofrom_user is 4096 bytes, I'm using buffers of 4096 + 1 cacheline (4224) bytes. A benchmark of 16 entry readvs (-s 16): time copy_to_user -l 4224 -s 16 -i 1000000 completes 5.2% faster on a POWER7 PS700. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Remove empty giveup_altivec function on book3e CPUsAnton Blanchard
Use an empty inline instead of an empty function to implement giveup_altivec on book3e CPUs, similar to flush_altivec_to_thread. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Reformat lppaca.hAnton Blanchard
Reformat lppaca.h to match Linux coding standards. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Remove iseries specific fields in lppacaAnton Blanchard
Remove all the iseries specific fields in the lppaca. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Clean up lppaca->cede_latency_hintAnton Blanchard
We have a union containing fields from the old iseries hypervisor that has been reused for the cede latency hint. Since we no longer support iseries, remove the union completely. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Better scheduling of CR save code in system call pathAnton Blanchard
At the moment system call entry looks like: crclr so ... mfcr r9 ... std r9,_CCR(r1) commit bd19c8994a82 ([POWERPC] system call micro optimisation) put some space between the crclr and mfcr in order to avoid a stall. There is still a stall seen between the mfcr and std. We can avoid the crclr by doing it in a GPR with rlwinm which gives us more room to better schedule the sequence. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: No need to preserve count register across system callAnton Blanchard
The count register is volatile so we don't need to preserve it. Store zero to the entry in the exception frame. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: No need to save XER in a system callAnton Blanchard
The XER is a volatile register so there is no need to save and restore it over a system call - zero it out in the exception stack frame instead. This should fix a 5 cycle stall of the mfxer/std seen on POWER7. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc: Hide some system call labels from profile toolsAnton Blanchard
syscall_dotrace_cont and syscall_error_cont tend to complicate perf output so make them local. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30Merge remote-tracking branch 'geoff/for-powerpc' into nextBenjamin Herrenschmidt
2012-04-30tty/serial/pmac_zilog: Fix "nobody cared" IRQ messageLarry Finger
Following commit a79dd5a titled "tty/serial/pmac_zilog: Fix suspend & resume", my Powerbook G4 Titanium showed the following stack dump: [ 36.878225] irq 23: nobody cared (try booting with the "irqpoll" option) [ 36.878251] Call Trace: [ 36.878291] [dfff3f00] [c000984c] show_stack+0x7c/0x194 (unreliable) [ 36.878322] [dfff3f40] [c00a6868] __report_bad_irq+0x44/0xf4 [ 36.878339] [dfff3f60] [c00a6b04] note_interrupt+0x1ec/0x2ac [ 36.878356] [dfff3f80] [c00a48d0] handle_irq_event_percpu+0x250/0x2b8 [ 36.878372] [dfff3fd0] [c00a496c] handle_irq_event+0x34/0x54 [ 36.878389] [dfff3fe0] [c00a753c] handle_fasteoi_irq+0xb4/0x124 [ 36.878412] [dfff3ff0] [c000f5bc] call_handle_irq+0x18/0x28 [ 36.878428] [deef1f10] [c000719c] do_IRQ+0x114/0x1cc [ 36.878446] [deef1f40] [c0015868] ret_from_except+0x0/0x1c [ 36.878484] --- Exception: 501 at 0xf497610 [ 36.878489] LR = 0xfdc3dd0 [ 36.878497] handlers: [ 36.878510] [<c02b7424>] pmz_interrupt [ 36.878520] Disabling IRQ #23 From an E-mail exchange about this problem, Andreas Schwab noticed a typo that resulted in the wrong condition being tested. The patch also corrects 2 typos that incorrectly report why an error branch is being taken. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/pseries: Rivet CONFIG_EEH for pSeries platformGavin Shan
Recently, Ryan Wang tried to compile PPC pSeries platform without CONFIG_EEH and eventually run into errors. Nishanth Aravamudan helped to narrow down the root cause. Actually, the pSeries platform depends on CONFIG_EEH heavily and that won't work properly without EEH support. According to Ben's suggestion, the patch make CONFIG_EEH invisible and keep it as always selected on pSeries platform. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/irqdomain: Fix broken NR_IRQ referencesGrant Likely
The switch from using irq_map to irq_alloc_desc*() for managing irq number allocations introduced new bugs in some of the powerpc interrupt code. Several functions rely on the value of NR_IRQS to determine the maximum irq number that could get allocated. However, with sparse_irq and using irq_alloc_desc*() the maximum possible irq number is now specified with 'nr_irqs' which may be a number larger than NR_IRQS. This has caused breakage on powermac when CONFIG_NR_IRQS is set to 32. This patch removes most of the direct references to NR_IRQS in the powerpc code and replaces them with either a nr_irqs reference or by using the common for_each_irq_desc() macro. The powerpc-specific for_each_irq() macro is removed at the same time. Also, the Cell axon_msi driver is refactored to remove the global build assumption on the size of NR_IRQS and instead add a limit to the maximum irq number when calling irq_domain_add_nomap(). Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-30powerpc/8xx: Fix NR_IRQ bugs and refactor 8xx interrupt controllerGrant Likely
The mpc8xx driver uses a reference to NR_IRQS that is buggy. It uses NR_IRQs for the array size of the ppc_cached_irq_mask bitmap, but NR_IRQs could be smaller than the number of hardware irqs that ppc_cached_irq_mask tracks. Also, while fixing that problem, it became apparent that the interrupt controller only supports 32 interrupt numbers, but it is written as if it supports multiple register banks which is more complicated. This patch pulls out the buggy reference to NR_IRQs and fixes the size of the ppc_cached_irq_mask to match the number of HW irqs. It also drops the now-unnecessary code since ppc_cached_irq_mask is no longer an array. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-04-29Linux 3.4-rc5v3.4-rc5Linus Torvalds
2012-04-29Merge tag 'pm-for-3.4-rc5' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael J. Wysocki: "Fix for an issue causing hibernation to hang on systems with highmem (that practically means i386) due to broken memory management (bug introduced in 3.2, so -stable material) and PM documentation update making the freezer documentation follow the code again after some recent updates." * tag 'pm-for-3.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM / Freezer / Docs: Update documentation about freezing of tasks PM / Hibernate: fix the number of pages used for hibernate/thaw buffering