* Re: MPC5200 boot giving "request_module: runaway loop modprobe binfmt-4c46" errors
From: gturnock @ 2006-07-10 13:48 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-embedded, gturnock
[-- Attachment #1: Type: text/html, Size: 2176 bytes --]
^ permalink raw reply
* Re: Linux v2.6.18-rc1
From: Will Schmidt @ 2006-07-10 13:21 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Steve Fox, linuxppc-dev, linux-kernel
In-Reply-To: <1152441242.4128.33.camel@localhost.localdomain>
On Sun, 2006-09-07 at 20:34 +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2006-07-07 at 10:41 -0500, Steve Fox wrote:
> > We've got a ppc64 machine that won't boot with this due to an IDE error.
>
> What machine precisely ?
I see a slightly more verbose version on a JS20 blade.
hda: dma_timer_expiry: dma status == 0x24
hda: DMA interrupt recovery
hda: lost interrupt
>
> > [snip]
> > Freeing unused kernel memory: 256k freed
> > running (1:2) /init autobench_args: ABAT:1152213829
> >
> > creating device nodes .hda: lost interrupt
> > hda: lost interrupt
> > hda: lost interrupt
> > hda: lost interrupt
> > hda: lost interrupt
> > hda: lost interrupt
> > hda: lost interrupt
> > hda: lost interrupt
> > hda: lost interrupt
> >
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] Make snd-aoa cope with lack of line-output-detect property
From: Johannes Berg @ 2006-07-10 13:11 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17586.19091.512322.908434@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
On Mon, 2006-07-10 at 22:39 +1000, Paul Mackerras wrote:
> The snd-aoa stuff falls over on my G4 powerbook (1.5GHz Albook) with a
> null pointer dereference in of_find_property. It turns out that this
> was because it couldn't find a device node for the line-output detect
> GPIO. This patch fixes it.
That's interesting. I thought I was running this code. Hmm :>
I should probably drop the get_irq function completely and do that in
line. And yes, that should be NO_IRQ I guess. I'll prepare a patch
later.
Thanks,
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: patches added to powerpc.git tree
From: Johannes Berg @ 2006-07-10 13:00 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17586.18872.10354.559506@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
On Mon, 2006-07-10 at 22:36 +1000, Paul Mackerras wrote:
> I assumed it would go via the alsa tree...
It couldn't because it depends on stuff that isn't in the alsa tree.
> Do you want it to go via the powerpc tree? I'm on vacation and 1000km
> from home, so the latency would be pretty long. :)
No, went through Andrew now.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [PATCH 15/20] [powerpc, netdevices] Constify & voidify get_property()
From: Paul Mackerras @ 2006-07-10 12:43 UTC (permalink / raw)
To: Jeremy Kerr; +Cc: linuxppc-dev, cbe-oss-dev
In-Reply-To: <200607101340.22068.jk@ozlabs.org>
Jeremy Kerr writes:
> Hm, that's odd - you mean the patch doesn't apply, or that it introduces
> incorrect whitepace? I can apply this patch (from patchwork or the list
> archives) without problems.
The git-applymbox script says the patch is corrupt, because several of
the context lines that should start with <space><tab> had the space
removed.
Paul.
^ permalink raw reply
* [PATCH] Make snd-aoa cope with lack of line-output-detect property
From: Paul Mackerras @ 2006-07-10 12:39 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev
The snd-aoa stuff falls over on my G4 powerbook (1.5GHz Albook) with a
null pointer dereference in of_find_property. It turns out that this
was because it couldn't find a device node for the line-output detect
GPIO. This patch fixes it.
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c
index 7ae0c0b..e35a1c6 100644
--- a/sound/aoa/core/snd-aoa-gpio-feature.c
+++ b/sound/aoa/core/snd-aoa-gpio-feature.c
@@ -112,7 +112,10 @@ static struct device_node *get_gpio(char
static void get_irq(struct device_node * np, int *irqptr)
{
- *irqptr = irq_of_parse_and_map(np, 0);
+ if (np)
+ *irqptr = irq_of_parse_and_map(np, 0);
+ else
+ *irqptr = -1; /* XXX should this be NO_IRQ? */
}
/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
@@ -322,7 +325,7 @@ static int ftr_set_notify(struct gpio_ru
return -EINVAL;
}
- if (irq == -1)
+ if (irq == -1) /* XXX should this be NO_IRQ? */
return -ENODEV;
mutex_lock(¬if->mutex);
^ permalink raw reply related
* Re: patches added to powerpc.git tree
From: Paul Mackerras @ 2006-07-10 12:36 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev
In-Reply-To: <1152272346.15068.39.camel@localhost>
Johannes Berg writes:
> I notice you haven't picked up Andreas' irq conversion fix, was that
> intentional? Or did I miss it going in elsewhere?
I assumed it would go via the alsa tree...
Do you want it to go via the powerpc tree? I'm on vacation and 1000km
from home, so the latency would be pretty long. :)
Paul.
^ permalink raw reply
* Re: Re: Failed to initialize the ethernet on PPC4 40GP
From: Denny @ 2006-07-10 11:41 UTC (permalink / raw)
To: stefan roese, linuxppc-embedded
In-Reply-To: <200607101242.29359.sr@denx.de>
[-- Attachment #1: Type: text/plain, Size: 647 bytes --]
Sorry, It is the UBoot question, I will address this to the UBoot maillist the next time!
After I add the environment valiable "ipaddr", this message disappeared,but the ethernet still not work (the MII on my custom board work on RMII mode).
u-boot => tftp 0x100000 u-boot.bin
miiphy_register: non unique device name 'ppc_4xx_eth0'
PHY speed read failed, assuming 10bT
PHY duplex read failed, assuming half duplex
ENET Speed is 10 Mbps - HALF duplex connection
TFTP from server 192.168.65.235; our IP address is 192.168.65.239
Filename 'u-boot.bin'.
Load address: 0x100000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
- Denny
[-- Attachment #2: Type: text/html, Size: 1119 bytes --]
^ permalink raw reply
* Re: [PATCH 6/6] Account for memmap and optionally the kernel image as holes
From: David Howells @ 2006-07-10 11:30 UTC (permalink / raw)
To: Mel Gorman
Cc: akpm, davej, tony.luck, linuxppc-dev, ak, bob.picco, linux-kernel,
linux-mm
In-Reply-To: <20060708111243.28664.74956.sendpatchset@skynet.skynet.ie>
Mel Gorman <mel@csn.ul.ie> wrote:
> +unsigned long __initdata dma_reserve;
Should this be static? Or should it be predeclared in a header file
somewhere?
David
^ permalink raw reply
* Re: Failed to initialize the ethernet on PPC4 40GP
From: Stefan Roese @ 2006-07-10 10:42 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <44B220CB.000108.31873@bj163app12.163.com>
Hi Denny,
On Monday 10 July 2006 11:41, Denny wrote:
> Does anyone ecounter this failure,it always tell me "No ethernet
> found", why?
Is this question linux or U-Boot related? If linux then you may have not
enabled the 4xx ethernet support in your kernel configuration. If U-Boot,
then please set the MAC addresses (ethaddr and eth1addr) and reset the board.
And if it really is an U-Boot question, you should address the correct
mailinglist.
Best regards,
Stefan
^ permalink raw reply
* Re: [Alsa-devel] snd-aoa: Add sound-layout-36 alias
From: Takashi Iwai @ 2006-07-10 10:22 UTC (permalink / raw)
To: Johannes Berg; +Cc: alsa-devel, linuxppc-dev list
In-Reply-To: <1152292943.4792.12.camel@localhost>
At Fri, 07 Jul 2006 19:22:23 +0200,
Johannes Berg wrote:
>
> On Fri, 2006-07-07 at 19:18 +0200, Andreas Schwab wrote:
> >
> > +MODULE_ALIAS("sound-layout-36");
>
> Heh. I just sent a patch (in my series) that adds all the ones that were
> still missing :)
Well, I haven't received new patches yet...
Takashi
^ permalink raw reply
* Failed to initialize the ethernet on PPC4 40GP
From: Denny @ 2006-07-10 9:41 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 95 bytes --]
HI,
Does anyone ecounter this failure,it always tell me "No ethernet found", why?
- Denny
[-- Attachment #2: Type: text/html, Size: 547 bytes --]
^ permalink raw reply
* Re: [POWERPC] Make OF interrupt tree parsing more strict
From: Benjamin Herrenschmidt @ 2006-07-10 9:24 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev list, Linus Torvalds, Paul Mackerras
In-Reply-To: <1152513753.1576.64.camel@localhost.localdomain>
On Mon, 2006-07-10 at 16:42 +1000, Benjamin Herrenschmidt wrote:
> This patch fixes a bit of boundchecking in the new Open Firmware
> interrupt tree parsing code. It's important that it fails when things
> aren't correct in order to trigger fallback mecanisms that are necessary
> to make some machines work properly.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Oh, and I forgot here:
From: Segher Boessenkool <segher@kernel.crashing.org>
Sorry about that !
> Index: linux-irq-work/arch/powerpc/kernel/prom_parse.c
> ===================================================================
> --- linux-irq-work.orig/arch/powerpc/kernel/prom_parse.c 2006-07-10 12:39:08.000000000 +1000
> +++ linux-irq-work/arch/powerpc/kernel/prom_parse.c 2006-07-10 12:43:51.000000000 +1000
> @@ -881,7 +881,7 @@
> intsize = *tmp;
>
> /* Check index */
> - if (index * intsize >= intlen)
> + if ((index + 1) * intsize > intlen)
> return -EINVAL;
>
> /* Get new specifier and map it */
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* pls help me!
From: zhangshaobo @ 2006-07-10 7:32 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1531 bytes --]
Hi, all
I meet a very difficult problem about ppc linux run on MPC5200. my
linux version is 2.4.18.
When i run my application for some time, the linux operation system
will reset to jump to the uboot and restart linux,. When it happen, I can
capture hreset and sreset signal using oscillograph. Additional, when linux
reset , it have two results: one is enter machine check exception and some
debug information is outputted, the other is nothing is to be outputted. The
debug information is following:
Machine check in kernel mode.
Caused by (from SRR1=41030): Transfer error ack signal
Oops: machine check, sig: 7
NIP: C009E934 XER: 00000000 LR: C009E924 SP: C014F1E0 REGS: c014f130 TRAP:
0200 Not tainted
MSR: 00041030 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 11
TASK = c014d480[0] 'swapper' Last syscall: 120
last math c3c30000 last altivec 00000000
GPR00: 00000001 C014F1E0 C014D480 00000083 00009032 00000000 00000000
00000010
GPR08: 00000000 40000000 00000000 00000000 C3E5E9E4 1010D5DC 03FCA000
007FFF6C
GPR16: 00000000 00000001 007FFF00 03FC4660 00001032 0014F350 00000000
C0176314
GPR24: C0176314 00000000 00000000 0000076C C0160000 F0000D8C 00000070
C3E5E960
Call backtrace:
C3E5EA68 C009F030 C001D9A4 C0019430 C00192BC C0018F80 C00057C0
C0003E40 C0005544 C0005558 C0003918 C0164590 000035F0
MPC5xxx_FEC_IEVENT_RFIFO_ERROR
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
Can you help me ? I will waiting for your answer , thanks anyway.
[-- Attachment #2: Type: text/html, Size: 11109 bytes --]
^ permalink raw reply
* Re: linux-2.6.17.4 and Xilinx Virtex
From: Grant Likely @ 2006-07-10 6:52 UTC (permalink / raw)
To: Sass, Ronald; +Cc: rsass, linuxppc-embedded list
In-Reply-To: <1A3FF4C9782A1249BDFC2FF2B5749C98150E1100@EXEVS01.its.uncc.edu>
Let's move this conversation over to the linuxppc-embedded mailing list
On 7/8/06, Sass, Ronald <rsass@uncc.edu> wrote:
>
> Hello Grant,
>
> I noticed that somewhere between 2.6.11 and 2.6.17 you started
> adding support to the Linux kernel for some Virtex-* based boards
> to the Linux kernel. I've got some hacked up kernel mods for the
> ML-310 (and soon) ML-410 boards that I am trying to clean up for
> sharing. I've never directly contributed to the kernel, so all of
> this is new to me. I had a couple of questions about the direction
> you are taking:
I've got some things that I still need to clean up. As it stands
right now, I've done some brain-dead stuff with the ppc_sys
infrastructure which I really should fix.
>
> (1) I noticed that you restructured
> arch/ppc/platforms/4xx/xparameters
> to support multiple boards. That's cool. Do you use XPS/EDK to
> update these files or do you just change the xparameters.h `by
> hand' for each base system?
No; unfortunately EDK does not support generating a BSP for linux 2.6.
I generate a 2.4 bsp into a clean directory and then copy
xparameters_ml300.h into the 2.6 tree.
> (2) I also noticed that the CONFIG_XILINX_VIRTEX_II_PRO (and files
> arch/ppc/platforms/4xx/virtex_ii_pro.[ch]) changed to
> be just
> CONFIG_XILINX_VIRTEX (and
> arch/ppc/platforms/4xx/virtex.[ch]).
> Is this change intended to be more generic to support V2P,
> V-4, and V-5 devices?
Yes
> (3) I also noticed that even though CONFIG_XILINX_VIRTEX was added,
> the option CONFIG_XILINX_VIRTEX_II_PRO is still in the .config
> file. As far as I can tell, the "VIRTEX_II_PRO" option is not
> referenced in the source. Should it be removed?
I don't think so; but others may disagree. The macro is convenient
for determining exactly which virtex part is being compiled for. Plus
it give a clean dependancy hierarchy from board->part->part family. I
left it in as a mirror to the XILINX_VIRTEX_4 macro which is in use.
>
> Thanks for taking the initative here! Do you know, is there anyone
> else trying to formally incorporate Xilinx boards into the stock
> kernel.org source tree?
I hear rumors that MontaVista will be merging their virtex-II/virtex-4
support into mainline real-soon-now.
Cheers,
g.
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* [POWERPC] Add cpufreq support for Xserve G5
From: Benjamin Herrenschmidt @ 2006-07-10 6:44 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev list
The Xserve G5 are capable of frequency switching like other desktop G5s.
This enables it. It also fix a Kconfig issue which prevented from
building the G5 cpufreq support if CONFIG_PMAC_SMU was not set (the
first version of that driver only worked with SMU based macs, but this
isn't the case anymore).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
This is an updated version of the patch currently in the powerpc.git
tree fixing
a stupid typo which broke cpufreq support on SMU based machines.
Index: linux-irq-work/arch/powerpc/Kconfig
===================================================================
--- linux-irq-work.orig/arch/powerpc/Kconfig 2006-07-06 16:43:32.000000000 +1000
+++ linux-irq-work/arch/powerpc/Kconfig 2006-07-06 16:53:36.000000000 +1000
@@ -504,7 +504,7 @@
config CPU_FREQ_PMAC64
bool "Support for some Apple G5s"
- depends on CPU_FREQ && PMAC_SMU && PPC64
+ depends on CPU_FREQ && PPC64
select CPU_FREQ_TABLE
help
This adds support for frequency switching on Apple iMac G5,
Index: linux-irq-work/arch/powerpc/platforms/powermac/cpufreq_64.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/platforms/powermac/cpufreq_64.c 2006-07-06 16:43:32.000000000 +1000
+++ linux-irq-work/arch/powerpc/platforms/powermac/cpufreq_64.c 2006-07-10 13:04:22.000000000 +1000
@@ -10,6 +10,8 @@
* that is iMac G5 and latest single CPU desktop.
*/
+#undef DEBUG
+
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
@@ -30,13 +32,7 @@
#include <asm/smu.h>
#include <asm/pmac_pfunc.h>
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(fmt...) printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
+#define DBG(fmt...) pr_debug(fmt)
/* see 970FX user manual */
@@ -82,8 +78,6 @@
/* Power mode data is an array of the 32 bits PCR values to use for
* the various frequencies, retrieved from the device-tree
*/
-static u32 *g5_pmode_data;
-static int g5_pmode_max;
static int g5_pmode_cur;
static void (*g5_switch_volt)(int speed_mode);
@@ -93,6 +87,11 @@
static DEFINE_MUTEX(g5_switch_mutex);
+#ifdef CONFIG_PMAC_SMU
+
+static u32 *g5_pmode_data;
+static int g5_pmode_max;
+
static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */
static int g5_fvt_count; /* number of op. points */
static int g5_fvt_cur; /* current op. point */
@@ -210,6 +209,16 @@
}
/*
+ * Fake voltage switching for platforms with missing support
+ */
+
+static void g5_dummy_switch_volt(int speed_mode)
+{
+}
+
+#endif /* CONFIG_PMAC_SMU */
+
+/*
* Platform function based voltage switching for PowerMac7,2 & 7,3
*/
@@ -248,6 +257,9 @@
struct pmf_args args;
u32 done = 0;
unsigned long timeout;
+ int rc;
+
+ DBG("g5_pfunc_switch_freq(%d)\n", speed_mode);
/* If frequency is going up, first ramp up the voltage */
if (speed_mode < g5_pmode_cur)
@@ -255,9 +267,12 @@
/* Do it */
if (speed_mode == CPUFREQ_HIGH)
- pmf_call_one(pfunc_cpu_setfreq_high, NULL);
+ rc = pmf_call_one(pfunc_cpu_setfreq_high, NULL);
else
- pmf_call_one(pfunc_cpu_setfreq_low, NULL);
+ rc = pmf_call_one(pfunc_cpu_setfreq_low, NULL);
+
+ if (rc)
+ printk(KERN_WARNING "cpufreq: pfunc switch error %d\n", rc);
/* It's an irq GPIO so we should be able to just block here,
* I'll do that later after I've properly tested the IRQ code for
@@ -296,13 +311,6 @@
return val ? CPUFREQ_HIGH : CPUFREQ_LOW;
}
-/*
- * Fake voltage switching for platforms with missing support
- */
-
-static void g5_dummy_switch_volt(int speed_mode)
-{
-}
/*
* Common interface to the cpufreq core
@@ -375,6 +383,8 @@
};
+#ifdef CONFIG_PMAC_SMU
+
static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
{
struct device_node *cpunode;
@@ -525,6 +535,9 @@
return rc;
}
+#endif /* CONFIG_PMAC_SMU */
+
+
static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
{
struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL;
@@ -533,6 +546,9 @@
u64 max_freq, min_freq, ih, il;
int has_volt = 1, rc = 0;
+ DBG("cpufreq: Initializing for PowerMac7,2, PowerMac7,3 and"
+ " RackMac3,1...\n");
+
/* Get first CPU node */
for (cpunode = NULL;
(cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {
@@ -636,6 +652,15 @@
*/
ih = *((u32 *)(eeprom + 0x10));
il = *((u32 *)(eeprom + 0x20));
+
+ /* Check for machines with no useful settings */
+ if (il == ih) {
+ printk(KERN_WARNING "cpufreq: No low frequency mode available"
+ " on this model !\n");
+ rc = -ENODEV;
+ goto bail;
+ }
+
min_freq = 0;
if (ih != 0 && il != 0)
min_freq = (max_freq * il) / ih;
@@ -643,7 +668,7 @@
/* Sanity check */
if (min_freq >= max_freq || min_freq < 1000) {
printk(KERN_ERR "cpufreq: Can't calculate low frequency !\n");
- rc = -ENODEV;
+ rc = -ENXIO;
goto bail;
}
g5_cpu_freqs[0].frequency = max_freq;
@@ -690,16 +715,10 @@
return rc;
}
-static int __init g5_rm31_cpufreq_init(struct device_node *cpus)
-{
- /* NYI */
- return 0;
-}
-
static int __init g5_cpufreq_init(void)
{
struct device_node *cpus;
- int rc;
+ int rc = 0;
cpus = of_find_node_by_path("/cpus");
if (cpus == NULL) {
@@ -708,12 +727,13 @@
}
if (machine_is_compatible("PowerMac7,2") ||
- machine_is_compatible("PowerMac7,3"))
+ machine_is_compatible("PowerMac7,3") ||
+ machine_is_compatible("RackMac3,1"))
rc = g5_pm72_cpufreq_init(cpus);
- else if (machine_is_compatible("RackMac3,1"))
- rc = g5_rm31_cpufreq_init(cpus);
+#ifdef CONFIG_PMAC_SMU
else
rc = g5_neo2_cpufreq_init(cpus);
+#endif /* CONFIG_PMAC_SMU */
of_node_put(cpus);
return rc;
^ permalink raw reply
* [POWERPC] Make OF interrupt tree parsing more strict
From: Benjamin Herrenschmidt @ 2006-07-10 6:42 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev list, Linus Torvalds, Paul Mackerras
This patch fixes a bit of boundchecking in the new Open Firmware
interrupt tree parsing code. It's important that it fails when things
aren't correct in order to trigger fallback mecanisms that are necessary
to make some machines work properly.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Index: linux-irq-work/arch/powerpc/kernel/prom_parse.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/kernel/prom_parse.c 2006-07-10 12:39:08.000000000 +1000
+++ linux-irq-work/arch/powerpc/kernel/prom_parse.c 2006-07-10 12:43:51.000000000 +1000
@@ -881,7 +881,7 @@
intsize = *tmp;
/* Check index */
- if (index * intsize >= intlen)
+ if ((index + 1) * intsize > intlen)
return -EINVAL;
/* Get new specifier and map it */
^ permalink raw reply
* [POWERPC] Fix SMU driver interrupt mapping
From: Benjamin Herrenschmidt @ 2006-07-10 6:39 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev list, Linus Torvalds, Paul Mackerras
The SMU driver tries to map an interrupt from the device-tree before the
interrupt controllers in the machine have been enumerated. This doesn't
work properly and cause machines like the Quad g5 to fail booting later
on when some drivers waits endlessly for an SMU request to complete.
This is the second problem preventing boot on the Quad g5. This fixes it
and also makes the SMU driver a bit more resilient to not having an
interrupt.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Index: linux-irq-work/drivers/macintosh/smu.c
===================================================================
--- linux-irq-work.orig/drivers/macintosh/smu.c 2006-07-10 12:39:08.000000000 +1000
+++ linux-irq-work/drivers/macintosh/smu.c 2006-07-10 12:41:01.000000000 +1000
@@ -75,9 +75,11 @@
struct of_device *of_dev;
int doorbell; /* doorbell gpio */
u32 __iomem *db_buf; /* doorbell buffer */
- int db_irq;
+ struct device_node *db_node;
+ unsigned int db_irq;
int msg;
- int msg_irq;
+ struct device_node *msg_node;
+ unsigned int msg_irq;
struct smu_cmd_buf *cmd_buf; /* command buffer virtual */
u32 cmd_buf_abs; /* command buffer absolute */
struct list_head cmd_list;
@@ -93,6 +95,7 @@
*/
static struct smu_device *smu;
static DEFINE_MUTEX(smu_part_access);
+static int smu_irq_inited;
static void smu_i2c_retry(unsigned long data);
@@ -257,6 +260,10 @@
smu_start_cmd();
spin_unlock_irqrestore(&smu->lock, flags);
+ /* Workaround for early calls when irq isn't available */
+ if (!smu_irq_inited || smu->db_irq == NO_IRQ)
+ smu_spinwait_cmd(cmd);
+
return 0;
}
EXPORT_SYMBOL(smu_queue_cmd);
@@ -478,14 +485,15 @@
smu->cmd_buf_abs = (u32)smu_cmdbuf_abs;
smu->cmd_buf = (struct smu_cmd_buf *)abs_to_virt(smu_cmdbuf_abs);
- np = of_find_node_by_name(NULL, "smu-doorbell");
- if (np == NULL) {
+ smu->db_node = of_find_node_by_name(NULL, "smu-doorbell");
+ if (smu->db_node == NULL) {
printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n");
goto fail;
}
- data = (u32 *)get_property(np, "reg", NULL);
+ data = (u32 *)get_property(smu->db_node, "reg", NULL);
if (data == NULL) {
- of_node_put(np);
+ of_node_put(smu->db_node);
+ smu->db_node = NULL;
printk(KERN_ERR "SMU: Can't find doorbell GPIO address !\n");
goto fail;
}
@@ -497,25 +505,21 @@
smu->doorbell = *data;
if (smu->doorbell < 0x50)
smu->doorbell += 0x50;
- smu->db_irq = irq_of_parse_and_map(np, 0);
-
- of_node_put(np);
/* Now look for the smu-interrupt GPIO */
do {
- np = of_find_node_by_name(NULL, "smu-interrupt");
- if (np == NULL)
+ smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt");
+ if (smu->msg_node == NULL)
break;
- data = (u32 *)get_property(np, "reg", NULL);
+ data = (u32 *)get_property(smu->msg_node, "reg", NULL);
if (data == NULL) {
- of_node_put(np);
+ of_node_put(smu->msg_node);
+ smu->msg_node = NULL;
break;
}
smu->msg = *data;
if (smu->msg < 0x50)
smu->msg += 0x50;
- smu->msg_irq = irq_of_parse_and_map(np, 0);
- of_node_put(np);
} while(0);
/* Doorbell buffer is currently hard-coded, I didn't find a proper
@@ -547,6 +551,19 @@
smu->i2c_timer.function = smu_i2c_retry;
smu->i2c_timer.data = (unsigned long)smu;
+ if (smu->db_node) {
+ smu->db_irq = irq_of_parse_and_map(smu->db_node, 0);
+ if (smu->db_irq == NO_IRQ)
+ printk(KERN_ERR "smu: failed to map irq for node %s\n",
+ smu->db_node->full_name);
+ }
+ if (smu->msg_node) {
+ smu->msg_irq = irq_of_parse_and_map(smu->msg_node, 0);
+ if (smu->msg_irq == NO_IRQ)
+ printk(KERN_ERR "smu: failed to map irq for node %s\n",
+ smu->msg_node->full_name);
+ }
+
/*
* Try to request the interrupts
*/
@@ -571,6 +588,7 @@
}
}
+ smu_irq_inited = 1;
return 0;
}
/* This has to be before arch_initcall as the low i2c stuff relies on the
@@ -742,6 +760,11 @@
if (fail && --cmd->retries > 0) {
DPRINTK("SMU: i2c failure, starting timer...\n");
BUG_ON(cmd != smu->cmd_i2c_cur);
+ if (!smu_irq_inited) {
+ mdelay(5);
+ smu_i2c_retry(0);
+ return;
+ }
mod_timer(&smu->i2c_timer, jiffies + msecs_to_jiffies(5));
return;
}
^ permalink raw reply
* [POWERPC] Fix MPIC OF tree parsing on Apple quad g5
From: Benjamin Herrenschmidt @ 2006-07-10 6:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev list, Linus Torvalds, Paul Mackerras
The quad g5 currently doesn't boot due to two problems. This patch fixes
the first one:
Apple new way of doing interrupt specifiers in OF for devices using the
HT APIC
isn't properly parsed by the new MPIC driver code.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Index: linux-irq-work/arch/powerpc/sysdev/mpic.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/sysdev/mpic.c 2006-07-10 12:39:08.000000000 +1000
+++ linux-irq-work/arch/powerpc/sysdev/mpic.c 2006-07-10 12:40:24.000000000 +1000
@@ -204,7 +204,7 @@
if (fixup->base == NULL)
return;
- DBG("startup_ht_interrupt(%u, %u) index: %d\n",
+ DBG("startup_ht_interrupt(0x%x, 0x%x) index: %d\n",
source, irqflags, fixup->index);
spin_lock_irqsave(&mpic->fixup_lock, flags);
/* Enable and configure */
@@ -227,7 +227,7 @@
if (fixup->base == NULL)
return;
- DBG("shutdown_ht_interrupt(%u, %u)\n", source, irqflags);
+ DBG("shutdown_ht_interrupt(0x%x, 0x%x)\n", source, irqflags);
/* Disable */
spin_lock_irqsave(&mpic->fixup_lock, flags);
@@ -588,8 +588,8 @@
struct irq_desc *desc = get_irq_desc(virq);
unsigned int vecpri, vold, vnew;
- pr_debug("mpic: set_irq_type(mpic:@%p,virq:%d,src:%d,type:0x%x)\n",
- mpic, virq, src, flow_type);
+ DBG("mpic: set_irq_type(mpic:@%p,virq:%d,src:0x%x,type:0x%x)\n",
+ mpic, virq, src, flow_type);
if (src >= mpic->irq_count)
return -EINVAL;
@@ -661,15 +661,16 @@
struct mpic *mpic = h->host_data;
struct irq_chip *chip;
- pr_debug("mpic: map virq %d, hwirq 0x%lx\n", virq, hw);
+ DBG("mpic: map virq %d, hwirq 0x%lx\n", virq, hw);
if (hw == MPIC_VEC_SPURRIOUS)
return -EINVAL;
+
#ifdef CONFIG_SMP
else if (hw >= MPIC_VEC_IPI_0) {
WARN_ON(!(mpic->flags & MPIC_PRIMARY));
- pr_debug("mpic: mapping as IPI\n");
+ DBG("mpic: mapping as IPI\n");
set_irq_chip_data(virq, mpic);
set_irq_chip_and_handler(virq, &mpic->hc_ipi,
handle_percpu_irq);
@@ -689,7 +690,7 @@
chip = &mpic->hc_ht_irq;
#endif /* CONFIG_MPIC_BROKEN_U3 */
- pr_debug("mpic: mapping to irq chip @%p\n", chip);
+ DBG("mpic: mapping to irq chip @%p\n", chip);
set_irq_chip_data(virq, mpic);
set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq);
@@ -713,11 +714,28 @@
};
*out_hwirq = intspec[0];
- if (intsize > 1 && intspec[1] < 4)
- *out_flags = map_mpic_senses[intspec[1]];
- else
+ if (intsize > 1) {
+ u32 mask = 0x3;
+
+ /* Apple invented a new race of encoding on machines with
+ * an HT APIC. They encode, among others, the index within
+ * the HT APIC. We don't care about it here since thankfully,
+ * it appears that they have the APIC already properly
+ * configured, and thus our current fixup code that reads the
+ * APIC config works fine. However, we still need to mask out
+ * bits in the specifier to make sure we only get bit 0 which
+ * is the level/edge bit (the only sense bit exposed by Apple),
+ * as their bit 1 means something else.
+ */
+ if (machine_is(powermac))
+ mask = 0x1;
+ *out_flags = map_mpic_senses[intspec[1] & mask];
+ } else
*out_flags = IRQ_TYPE_NONE;
+ DBG("mpic: xlate (%d cells: 0x%08x 0x%08x) to line 0x%lx sense 0x%x\n",
+ intsize, intspec[0], intspec[1], *out_hwirq, *out_flags);
+
return 0;
}
^ permalink raw reply
* [POWERPC] Fix trigger handling in the new irq code
From: Benjamin Herrenschmidt @ 2006-07-10 6:32 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev list, Linus Torvalds, Paul Mackerras
This patch slightly reworks the new irq code to fix a small design
error. I removed the passing of the trigger to the map() calls entirely,
it was not a good idea to have one call do two different things. It also
fixes a couple of corner cases.
Mapping a linux virtual irq to a physical irq now does only that.
Setting the trigger is a different action which has a different call.
The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just
return the virtual number that was already mapped. It was called before
to give an opportunity to change the trigger, but that was causing
issues as that could happen while the interrupt was in use by a device,
and because of the trigger change, map would potentially muck around
with things in a racy way. That was causing much burden on a given's
controller implementation of map() to get it right. This is much simpler
now. map() is only called on the initial mapping of an irq, meaning that
you know that this irq is _not_ being used. You can initialize the
hardware if you want (though you don't have to).
- Controllers that can handle different type of triggers
(level/edge/etc...) now implement the standard irq_chip->set_type() call
as defined by the generic code. That means that you can use the standard
set_irq_type() to configure an irq line manually if you wish or (though
I don't like that interface), pass explicit trigger flags to
request_irq() as defined by the generic kernel interfaces. Also, using
those interfaces guarantees that your controller set_type callback is
called with the descriptor lock held, thus providing locking against
activity on the same interrupt (including mask/unmask/etc...)
automatically. A result is that, for example, MPIC's own map()
implementation calls irq_set_type(NONE) to configure the hardware to the
default triggers.
- To allow the above, the irq_map array entry for the new mapped
interrupt
is now set before map() callback is called for the controller.
- The irq_create_of_mapping() (also used by irq_of_parse_and_map())
function for mapping interrupts from the device-tree now also call the
separate set_irq_type(), and only does so if there is a change in the
trigger type.
- While I was at it, I changed pci_read_irq_line() (which is the helper
I would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when
the DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know
wether the device has an interrupt at all, and the the
PCI_INTERRUPT_LINE
to get an interrupt number from the device. That number is then mapped
using the default controller, and the trigger is set to level low.
That default behaviour works for several platforms that don't have a
proper
interrupt tree like Pegasos. If it doesn't work for your platform, then
either provide a proper interrupt tree from the firmware so that
fallback
isn't needed, or don't call pci_read_irq_line()
- Add back a bit that got dropped by my main rework patch for properly
clearing
pending IPIs on pSeries when using a kexec
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Note: this patch is a pre-requisite for the next one fixing boot on the
Quad g5.
Please merge asap
Index: linux-irq-work/arch/powerpc/kernel/irq.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/kernel/irq.c 2006-07-07 17:49:20.000000000 +1000
+++ linux-irq-work/arch/powerpc/kernel/irq.c 2006-07-10 12:39:16.000000000 +1000
@@ -391,15 +391,14 @@
irq_map[i].host = host;
smp_wmb();
- /* Clear some flags */
- get_irq_desc(i)->status
- &= ~(IRQ_NOREQUEST | IRQ_LEVEL);
+ /* Clear norequest flags */
+ get_irq_desc(i)->status &= ~IRQ_NOREQUEST;
/* Legacy flags are left to default at this point,
* one can then use irq_create_mapping() to
* explicitely change them
*/
- ops->map(host, i, i, 0);
+ ops->map(host, i, i);
}
break;
case IRQ_HOST_MAP_LINEAR:
@@ -457,13 +456,11 @@
}
unsigned int irq_create_mapping(struct irq_host *host,
- irq_hw_number_t hwirq,
- unsigned int flags)
+ irq_hw_number_t hwirq)
{
unsigned int virq, hint;
- pr_debug("irq: irq_create_mapping(0x%p, 0x%lx, 0x%x)\n",
- host, hwirq, flags);
+ pr_debug("irq: irq_create_mapping(0x%p, 0x%lx)\n", host, hwirq);
/* Look for default host if nececssary */
if (host == NULL)
@@ -482,7 +479,6 @@
virq = irq_find_mapping(host, hwirq);
if (virq != IRQ_NONE) {
pr_debug("irq: -> existing mapping on virq %d\n", virq);
- host->ops->map(host, virq, hwirq, flags);
return virq;
}
@@ -504,18 +500,18 @@
}
pr_debug("irq: -> obtained virq %d\n", virq);
- /* Clear some flags */
- get_irq_desc(virq)->status &= ~(IRQ_NOREQUEST | IRQ_LEVEL);
+ /* Clear IRQ_NOREQUEST flag */
+ get_irq_desc(virq)->status &= ~IRQ_NOREQUEST;
/* map it */
- if (host->ops->map(host, virq, hwirq, flags)) {
+ smp_wmb();
+ irq_map[virq].hwirq = hwirq;
+ smp_mb();
+ if (host->ops->map(host, virq, hwirq)) {
pr_debug("irq: -> mapping failed, freeing\n");
irq_free_virt(virq, 1);
return NO_IRQ;
}
- smp_wmb();
- irq_map[virq].hwirq = hwirq;
- smp_mb();
return virq;
}
EXPORT_SYMBOL_GPL(irq_create_mapping);
@@ -525,25 +521,38 @@
{
struct irq_host *host;
irq_hw_number_t hwirq;
- unsigned int flags = IRQ_TYPE_NONE;
+ unsigned int type = IRQ_TYPE_NONE;
+ unsigned int virq;
if (controller == NULL)
host = irq_default_host;
else
host = irq_find_host(controller);
- if (host == NULL)
+ if (host == NULL) {
+ printk(KERN_WARNING "irq: no irq host found for %s !\n",
+ controller->full_name);
return NO_IRQ;
+ }
/* If host has no translation, then we assume interrupt line */
if (host->ops->xlate == NULL)
hwirq = intspec[0];
else {
if (host->ops->xlate(host, controller, intspec, intsize,
- &hwirq, &flags))
+ &hwirq, &type))
return NO_IRQ;
}
- return irq_create_mapping(host, hwirq, flags);
+ /* Create mapping */
+ virq = irq_create_mapping(host, hwirq);
+ if (virq == NO_IRQ)
+ return virq;
+
+ /* Set type if specified and different than the current one */
+ if (type != IRQ_TYPE_NONE &&
+ type != (get_irq_desc(virq)->status & IRQF_TRIGGER_MASK))
+ set_irq_type(virq, type);
+ return virq;
}
EXPORT_SYMBOL_GPL(irq_create_of_mapping);
Index: linux-irq-work/arch/powerpc/platforms/powermac/pci.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/platforms/powermac/pci.c 2006-07-07 17:49:20.000000000 +1000
+++ linux-irq-work/arch/powerpc/platforms/powermac/pci.c 2006-07-10 12:53:20.000000000 +1000
@@ -16,6 +16,7 @@
#include <linux/string.h>
#include <linux/init.h>
#include <linux/bootmem.h>
+#include <linux/irq.h>
#include <asm/sections.h>
#include <asm/io.h>
@@ -24,10 +25,7 @@
#include <asm/machdep.h>
#include <asm/pmac_feature.h>
#include <asm/grackle.h>
-#ifdef CONFIG_PPC64
-//#include <asm/iommu.h>
#include <asm/ppc-pci.h>
-#endif
#undef DEBUG
@@ -46,7 +44,6 @@
static struct pci_controller *u3_agp;
static struct pci_controller *u4_pcie;
static struct pci_controller *u3_ht;
-#define has_second_ohare 0
#else
static int has_second_ohare;
#endif /* CONFIG_PPC64 */
@@ -993,6 +990,7 @@
/* Read interrupt from the device-tree */
pci_read_irq_line(dev);
+#ifdef CONFIG_PPC32
/* Fixup interrupt for the modem/ethernet combo controller.
* on machines with a second ohare chip.
* The number in the device tree (27) is bogus (correct for
@@ -1002,8 +1000,11 @@
*/
if (has_second_ohare &&
dev->vendor == PCI_VENDOR_ID_DEC &&
- dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS)
- dev->irq = irq_create_mapping(NULL, 60, 0);
+ dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) {
+ dev->irq = irq_create_mapping(NULL, 60);
+ set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW);
+ }
+#endif /* CONFIG_PPC32 */
}
}
Index: linux-irq-work/arch/powerpc/platforms/powermac/pic.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/platforms/powermac/pic.c 2006-07-07 17:49:20.000000000 +1000
+++ linux-irq-work/arch/powerpc/platforms/powermac/pic.c 2006-07-08 09:37:18.000000000 +1000
@@ -291,7 +291,7 @@
}
static int pmac_pic_host_map(struct irq_host *h, unsigned int virq,
- irq_hw_number_t hw, unsigned int flags)
+ irq_hw_number_t hw)
{
struct irq_desc *desc = get_irq_desc(virq);
int level;
@@ -318,6 +318,7 @@
unsigned int *out_flags)
{
+ *out_flags = IRQ_TYPE_NONE;
*out_hwirq = *intspec;
return 0;
}
@@ -434,7 +435,7 @@
printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs);
#ifdef CONFIG_XMON
- setup_irq(irq_create_mapping(NULL, 20, 0), &xmon_action);
+ setup_irq(irq_create_mapping(NULL, 20), &xmon_action);
#endif
}
#endif /* CONFIG_PPC32 */
@@ -579,9 +580,10 @@
flags |= OF_IMAP_OLDWORLD_MAC;
if (get_property(of_chosen, "linux,bootx", NULL) != NULL)
flags |= OF_IMAP_NO_PHANDLE;
- of_irq_map_init(flags);
#endif /* CONFIG_PPC_32 */
+ of_irq_map_init(flags);
+
/* We first try to detect Apple's new Core99 chipset, since mac-io
* is quite different on those machines and contains an IBM MPIC2.
*/
Index: linux-irq-work/arch/powerpc/sysdev/mpic.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/sysdev/mpic.c 2006-07-07 17:49:20.000000000 +1000
+++ linux-irq-work/arch/powerpc/sysdev/mpic.c 2006-07-10 12:52:01.000000000 +1000
@@ -337,6 +337,17 @@
}
}
+#else /* CONFIG_MPIC_BROKEN_U3 */
+
+static inline int mpic_is_ht_interrupt(struct mpic *mpic, unsigned int source)
+{
+ return 0;
+}
+
+static void __init mpic_scan_ht_pics(struct mpic *mpic)
+{
+}
+
#endif /* CONFIG_MPIC_BROKEN_U3 */
@@ -405,11 +416,9 @@
unsigned int loops = 100000;
struct mpic *mpic = mpic_from_irq(irq);
unsigned int src = mpic_irq_to_hw(irq);
- unsigned long flags;
DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src);
- spin_lock_irqsave(&mpic_lock, flags);
mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) &
~MPIC_VECPRI_MASK);
@@ -420,7 +429,6 @@
break;
}
} while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK);
- spin_unlock_irqrestore(&mpic_lock, flags);
}
static void mpic_mask_irq(unsigned int irq)
@@ -428,11 +436,9 @@
unsigned int loops = 100000;
struct mpic *mpic = mpic_from_irq(irq);
unsigned int src = mpic_irq_to_hw(irq);
- unsigned long flags;
DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src);
- spin_lock_irqsave(&mpic_lock, flags);
mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) |
MPIC_VECPRI_MASK);
@@ -444,7 +450,6 @@
break;
}
} while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK));
- spin_unlock_irqrestore(&mpic_lock, flags);
}
static void mpic_end_irq(unsigned int irq)
@@ -512,8 +517,7 @@
mpic_ht_end_irq(mpic, src);
mpic_eoi(mpic);
}
-
-#endif /* CONFIG_MPIC_BROKEN_U3 */
+#endif /* !CONFIG_MPIC_BROKEN_U3 */
#ifdef CONFIG_SMP
@@ -560,47 +564,74 @@
mpic_physmask(cpus_addr(tmp)[0]));
}
-static unsigned int mpic_flags_to_vecpri(unsigned int flags, int *level)
+static unsigned int mpic_type_to_vecpri(unsigned int type)
{
- unsigned int vecpri;
-
/* Now convert sense value */
- switch(flags & IRQ_TYPE_SENSE_MASK) {
+ switch(type & IRQ_TYPE_SENSE_MASK) {
case IRQ_TYPE_EDGE_RISING:
- vecpri = MPIC_VECPRI_SENSE_EDGE |
- MPIC_VECPRI_POLARITY_POSITIVE;
- *level = 0;
- break;
+ return MPIC_VECPRI_SENSE_EDGE | MPIC_VECPRI_POLARITY_POSITIVE;
case IRQ_TYPE_EDGE_FALLING:
- vecpri = MPIC_VECPRI_SENSE_EDGE |
- MPIC_VECPRI_POLARITY_NEGATIVE;
- *level = 0;
- break;
+ case IRQ_TYPE_EDGE_BOTH:
+ return MPIC_VECPRI_SENSE_EDGE | MPIC_VECPRI_POLARITY_NEGATIVE;
case IRQ_TYPE_LEVEL_HIGH:
- vecpri = MPIC_VECPRI_SENSE_LEVEL |
- MPIC_VECPRI_POLARITY_POSITIVE;
- *level = 1;
- break;
+ return MPIC_VECPRI_SENSE_LEVEL | MPIC_VECPRI_POLARITY_POSITIVE;
case IRQ_TYPE_LEVEL_LOW:
default:
- vecpri = MPIC_VECPRI_SENSE_LEVEL |
- MPIC_VECPRI_POLARITY_NEGATIVE;
- *level = 1;
+ return MPIC_VECPRI_SENSE_LEVEL | MPIC_VECPRI_POLARITY_NEGATIVE;
}
- return vecpri;
+}
+
+static int mpic_set_irq_type(unsigned int virq, unsigned int flow_type)
+{
+ struct mpic *mpic = mpic_from_irq(virq);
+ unsigned int src = mpic_irq_to_hw(virq);
+ struct irq_desc *desc = get_irq_desc(virq);
+ unsigned int vecpri, vold, vnew;
+
+ pr_debug("mpic: set_irq_type(mpic:@%p,virq:%d,src:%d,type:0x%x)\n",
+ mpic, virq, src, flow_type);
+
+ if (src >= mpic->irq_count)
+ return -EINVAL;
+
+ if (flow_type == IRQ_TYPE_NONE)
+ if (mpic->senses && src < mpic->senses_count)
+ flow_type = mpic->senses[src];
+ if (flow_type == IRQ_TYPE_NONE)
+ flow_type = IRQ_TYPE_LEVEL_LOW;
+
+ desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
+ desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
+ if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
+ desc->status |= IRQ_LEVEL;
+
+ if (mpic_is_ht_interrupt(mpic, src))
+ vecpri = MPIC_VECPRI_POLARITY_POSITIVE |
+ MPIC_VECPRI_SENSE_EDGE;
+ else
+ vecpri = mpic_type_to_vecpri(flow_type);
+
+ vold = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI);
+ vnew = vold & ~(MPIC_VECPRI_POLARITY_MASK | MPIC_VECPRI_SENSE_MASK);
+ vnew |= vecpri;
+ if (vold != vnew)
+ mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, vnew);
+
+ return 0;
}
static struct irq_chip mpic_irq_chip = {
- .mask = mpic_mask_irq,
- .unmask = mpic_unmask_irq,
- .eoi = mpic_end_irq,
+ .mask = mpic_mask_irq,
+ .unmask = mpic_unmask_irq,
+ .eoi = mpic_end_irq,
+ .set_type = mpic_set_irq_type,
};
#ifdef CONFIG_SMP
static struct irq_chip mpic_ipi_chip = {
- .mask = mpic_mask_ipi,
- .unmask = mpic_unmask_ipi,
- .eoi = mpic_end_ipi,
+ .mask = mpic_mask_ipi,
+ .unmask = mpic_unmask_ipi,
+ .eoi = mpic_end_ipi,
};
#endif /* CONFIG_SMP */
@@ -611,6 +642,7 @@
.mask = mpic_mask_irq,
.unmask = mpic_unmask_ht_irq,
.eoi = mpic_end_ht_irq,
+ .set_type = mpic_set_irq_type,
};
#endif /* CONFIG_MPIC_BROKEN_U3 */
@@ -624,18 +656,12 @@
}
static int mpic_host_map(struct irq_host *h, unsigned int virq,
- irq_hw_number_t hw, unsigned int flags)
+ irq_hw_number_t hw)
{
- struct irq_desc *desc = get_irq_desc(virq);
- struct irq_chip *chip;
struct mpic *mpic = h->host_data;
- u32 v, vecpri = MPIC_VECPRI_SENSE_LEVEL |
- MPIC_VECPRI_POLARITY_NEGATIVE;
- int level;
- unsigned long iflags;
+ struct irq_chip *chip;
- pr_debug("mpic: map virq %d, hwirq 0x%lx, flags: 0x%x\n",
- virq, hw, flags);
+ pr_debug("mpic: map virq %d, hwirq 0x%lx\n", virq, hw);
if (hw == MPIC_VEC_SPURRIOUS)
return -EINVAL;
@@ -654,44 +680,23 @@
if (hw >= mpic->irq_count)
return -EINVAL;
- /* If no sense provided, check default sense array */
- if (((flags & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_NONE) &&
- mpic->senses && hw < mpic->senses_count)
- flags |= mpic->senses[hw];
-
- vecpri = mpic_flags_to_vecpri(flags, &level);
- if (level)
- desc->status |= IRQ_LEVEL;
+ /* Default chip */
chip = &mpic->hc_irq;
#ifdef CONFIG_MPIC_BROKEN_U3
/* Check for HT interrupts, override vecpri */
- if (mpic_is_ht_interrupt(mpic, hw)) {
- vecpri &= ~(MPIC_VECPRI_SENSE_MASK |
- MPIC_VECPRI_POLARITY_MASK);
- vecpri |= MPIC_VECPRI_POLARITY_POSITIVE;
+ if (mpic_is_ht_interrupt(mpic, hw))
chip = &mpic->hc_ht_irq;
- }
-#endif
-
- /* Reconfigure irq. We must preserve the mask bit as we can be called
- * while the interrupt is still active (This may change in the future
- * but for now, it is the case).
- */
- spin_lock_irqsave(&mpic_lock, iflags);
- v = mpic_irq_read(hw, MPIC_IRQ_VECTOR_PRI);
- vecpri = (v &
- ~(MPIC_VECPRI_POLARITY_MASK | MPIC_VECPRI_SENSE_MASK)) |
- vecpri;
- if (vecpri != v)
- mpic_irq_write(hw, MPIC_IRQ_VECTOR_PRI, vecpri);
- spin_unlock_irqrestore(&mpic_lock, iflags);
+#endif /* CONFIG_MPIC_BROKEN_U3 */
- pr_debug("mpic: mapping as IRQ, vecpri = 0x%08x (was 0x%08x)\n",
- vecpri, v);
+ pr_debug("mpic: mapping to irq chip @%p\n", chip);
set_irq_chip_data(virq, mpic);
set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq);
+
+ /* Set default irq type */
+ set_irq_type(virq, IRQ_TYPE_NONE);
+
return 0;
}
@@ -906,41 +911,16 @@
if (mpic->irq_count == 0)
mpic->irq_count = mpic->num_sources;
-#ifdef CONFIG_MPIC_BROKEN_U3
/* Do the HT PIC fixups on U3 broken mpic */
DBG("MPIC flags: %x\n", mpic->flags);
if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY))
mpic_scan_ht_pics(mpic);
-#endif /* CONFIG_MPIC_BROKEN_U3 */
for (i = 0; i < mpic->num_sources; i++) {
/* start with vector = source number, and masked */
- u32 vecpri = MPIC_VECPRI_MASK | i | (8 << MPIC_VECPRI_PRIORITY_SHIFT);
- int level = 1;
+ u32 vecpri = MPIC_VECPRI_MASK | i |
+ (8 << MPIC_VECPRI_PRIORITY_SHIFT);
- /* do senses munging */
- if (mpic->senses && i < mpic->senses_count)
- vecpri |= mpic_flags_to_vecpri(mpic->senses[i],
- &level);
- else
- vecpri |= MPIC_VECPRI_SENSE_LEVEL;
-
- /* deal with broken U3 */
- if (mpic->flags & MPIC_BROKEN_U3) {
-#ifdef CONFIG_MPIC_BROKEN_U3
- if (mpic_is_ht_interrupt(mpic, i)) {
- vecpri &= ~(MPIC_VECPRI_SENSE_MASK |
- MPIC_VECPRI_POLARITY_MASK);
- vecpri |= MPIC_VECPRI_POLARITY_POSITIVE;
- }
-#else
- printk(KERN_ERR "mpic: BROKEN_U3 set, but CONFIG doesn't match\n");
-#endif
- }
-
- DBG("setup source %d, vecpri: %08x, level: %d\n", i, vecpri,
- (level != 0));
-
/* init hw */
mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri);
mpic_irq_write(i, MPIC_IRQ_DESTINATION,
@@ -1154,7 +1134,7 @@
for (i = 0; i < 4; i++) {
unsigned int vipi = irq_create_mapping(mpic->irqhost,
- MPIC_VEC_IPI_0 + i, 0);
+ MPIC_VEC_IPI_0 + i);
if (vipi == NO_IRQ) {
printk(KERN_ERR "Failed to map IPI %d\n", i);
break;
Index: linux-irq-work/drivers/macintosh/macio_asic.c
===================================================================
--- linux-irq-work.orig/drivers/macintosh/macio_asic.c 2006-07-07 17:49:20.000000000 +1000
+++ linux-irq-work/drivers/macintosh/macio_asic.c 2006-07-08 09:36:20.000000000 +1000
@@ -330,7 +330,7 @@
{
unsigned int irq;
- irq = irq_create_mapping(NULL, line, 0);
+ irq = irq_create_mapping(NULL, line);
if (irq != NO_IRQ) {
dev->interrupt[index].start = irq;
dev->interrupt[index].flags = IORESOURCE_IRQ;
Index: linux-irq-work/include/asm-powerpc/irq.h
===================================================================
--- linux-irq-work.orig/include/asm-powerpc/irq.h 2006-07-07 17:49:20.000000000 +1000
+++ linux-irq-work/include/asm-powerpc/irq.h 2006-07-08 09:36:20.000000000 +1000
@@ -83,25 +83,24 @@
int (*match)(struct irq_host *h, struct device_node *node);
/* Create or update a mapping between a virtual irq number and a hw
- * irq number. This can be called several times for the same mapping
- * but with different flags, though unmap shall always be called
- * before the virq->hw mapping is changed.
+ * irq number. This is called only once for a given mapping.
*/
- int (*map)(struct irq_host *h, unsigned int virq,
- irq_hw_number_t hw, unsigned int flags);
+ int (*map)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw);
/* Dispose of such a mapping */
void (*unmap)(struct irq_host *h, unsigned int virq);
/* Translate device-tree interrupt specifier from raw format coming
* from the firmware to a irq_hw_number_t (interrupt line number) and
- * trigger flags that can be passed to irq_create_mapping().
- * If no translation is provided, raw format is assumed to be one cell
- * for interrupt line and default sense.
+ * type (sense) that can be passed to set_irq_type(). In the absence
+ * of this callback, irq_create_of_mapping() and irq_of_parse_and_map()
+ * will return the hw number in the first cell and IRQ_TYPE_NONE for
+ * the type (which amount to keeping whatever default value the
+ * interrupt controller has for that line)
*/
int (*xlate)(struct irq_host *h, struct device_node *ctrler,
u32 *intspec, unsigned int intsize,
- irq_hw_number_t *out_hwirq, unsigned int *out_flags);
+ irq_hw_number_t *out_hwirq, unsigned int *out_type);
};
struct irq_host {
@@ -193,25 +192,14 @@
* irq_create_mapping - Map a hardware interrupt into linux virq space
* @host: host owning this hardware interrupt or NULL for default host
* @hwirq: hardware irq number in that host space
- * @flags: flags passed to the controller. contains the trigger type among
- * others. Use IRQ_TYPE_* defined in include/linux/irq.h
*
* Only one mapping per hardware interrupt is permitted. Returns a linux
- * virq number. The flags can be used to provide sense information to the
- * controller (typically extracted from the device-tree). If no information
- * is passed, the controller defaults will apply (for example, xics can only
- * do edge so flags are irrelevant for some pseries specific irqs).
- *
- * The device-tree generally contains the trigger info in an encoding that is
- * specific to a given type of controller. In that case, you can directly use
- * host->ops->trigger_xlate() to translate that.
- *
- * It is recommended that new PICs that don't have existing OF bindings chose
- * to use a representation of triggers identical to linux.
+ * virq number.
+ * If the sense/trigger is to be specified, set_irq_type() should be called
+ * on the number returned from that call.
*/
extern unsigned int irq_create_mapping(struct irq_host *host,
- irq_hw_number_t hwirq,
- unsigned int flags);
+ irq_hw_number_t hwirq);
/***
@@ -295,7 +283,7 @@
*
* This function is identical to irq_create_mapping except that it takes
* as input informations straight from the device-tree (typically the results
- * of the of_irq_map_*() functions
+ * of the of_irq_map_*() functions.
*/
extern unsigned int irq_create_of_mapping(struct device_node *controller,
u32 *intspec, unsigned int intsize);
Index: linux-irq-work/arch/powerpc/kernel/ibmebus.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/kernel/ibmebus.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/kernel/ibmebus.c 2006-07-08 11:05:35.000000000 +1000
@@ -323,7 +323,7 @@
unsigned long irq_flags, const char * devname,
void *dev_id)
{
- unsigned int irq = irq_create_mapping(NULL, ist, 0);
+ unsigned int irq = irq_create_mapping(NULL, ist);
if (irq == NO_IRQ)
return -EINVAL;
Index: linux-irq-work/arch/powerpc/platforms/cell/interrupt.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/platforms/cell/interrupt.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/platforms/cell/interrupt.c 2006-07-08 09:41:01.000000000 +1000
@@ -159,7 +159,7 @@
if (iic_hosts[node] == NULL)
continue;
virq = irq_create_mapping(iic_hosts[node],
- iic_ipi_to_irq(ipi), 0);
+ iic_ipi_to_irq(ipi));
if (virq == NO_IRQ) {
printk(KERN_ERR
"iic: failed to map IPI %s on node %d\n",
@@ -197,7 +197,7 @@
}
static int iic_host_map(struct irq_host *h, unsigned int virq,
- irq_hw_number_t hw, unsigned int flags)
+ irq_hw_number_t hw)
{
if (hw < IIC_IRQ_IPI0)
set_irq_chip_and_handler(virq, &iic_chip, handle_fasteoi_irq);
Index: linux-irq-work/arch/powerpc/platforms/cell/spider-pic.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/platforms/cell/spider-pic.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/platforms/cell/spider-pic.c 2006-07-08 11:09:28.000000000 +1000
@@ -85,9 +85,6 @@
struct spider_pic *pic = spider_virq_to_pic(virq);
void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq);
- /* We use no locking as we should be covered by the descriptor lock
- * for access to invidual source configuration registers
- */
out_be32(cfg, in_be32(cfg) | 0x30000000u);
}
@@ -96,9 +93,6 @@
struct spider_pic *pic = spider_virq_to_pic(virq);
void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq);
- /* We use no locking as we should be covered by the descriptor lock
- * for access to invidual source configuration registers
- */
out_be32(cfg, in_be32(cfg) & ~0x30000000u);
}
@@ -120,26 +114,14 @@
out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf));
}
-static struct irq_chip spider_pic = {
- .typename = " SPIDER ",
- .unmask = spider_unmask_irq,
- .mask = spider_mask_irq,
- .ack = spider_ack_irq,
-};
-
-static int spider_host_match(struct irq_host *h, struct device_node *node)
-{
- struct spider_pic *pic = h->host_data;
- return node == pic->of_node;
-}
-
-static int spider_host_map(struct irq_host *h, unsigned int virq,
- irq_hw_number_t hw, unsigned int flags)
+static int spider_set_irq_type(unsigned int virq, unsigned int type)
{
- unsigned int sense = flags & IRQ_TYPE_SENSE_MASK;
- struct spider_pic *pic = h->host_data;
+ unsigned int sense = type & IRQ_TYPE_SENSE_MASK;
+ struct spider_pic *pic = spider_virq_to_pic(virq);
+ unsigned int hw = irq_map[virq].hwirq;
void __iomem *cfg = spider_get_irq_config(pic, hw);
- int level = 0;
+ struct irq_desc *desc = get_irq_desc(virq);
+ u32 old_mask;
u32 ic;
/* Note that only level high is supported for most interrupts */
@@ -157,29 +139,57 @@
break;
case IRQ_TYPE_LEVEL_LOW:
ic = 0x0;
- level = 1;
break;
case IRQ_TYPE_LEVEL_HIGH:
case IRQ_TYPE_NONE:
ic = 0x1;
- level = 1;
break;
default:
return -EINVAL;
}
+ /* Update irq_desc */
+ desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
+ desc->status |= type & IRQ_TYPE_SENSE_MASK;
+ if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
+ desc->status |= IRQ_LEVEL;
+
/* Configure the source. One gross hack that was there before and
* that I've kept around is the priority to the BE which I set to
* be the same as the interrupt source number. I don't know wether
* that's supposed to make any kind of sense however, we'll have to
* decide that, but for now, I'm not changing the behaviour.
*/
- out_be32(cfg, (ic << 24) | (0x7 << 16) | (pic->node_id << 4) | 0xe);
+ old_mask = in_be32(cfg) & 0x30000000u;
+ out_be32(cfg, old_mask | (ic << 24) | (0x7 << 16) |
+ (pic->node_id << 4) | 0xe);
out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff));
- if (level)
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ return 0;
+}
+
+static struct irq_chip spider_pic = {
+ .typename = " SPIDER ",
+ .unmask = spider_unmask_irq,
+ .mask = spider_mask_irq,
+ .ack = spider_ack_irq,
+ .set_type = spider_set_irq_type,
+};
+
+static int spider_host_match(struct irq_host *h, struct device_node *node)
+{
+ struct spider_pic *pic = h->host_data;
+ return node == pic->of_node;
+}
+
+static int spider_host_map(struct irq_host *h, unsigned int virq,
+ irq_hw_number_t hw)
+{
set_irq_chip_and_handler(virq, &spider_pic, handle_level_irq);
+
+ /* Set default irq type */
+ set_irq_type(virq, IRQ_TYPE_NONE);
+
return 0;
}
@@ -283,7 +293,7 @@
if (iic_host == NULL)
return NO_IRQ;
/* Manufacture an IIC interrupt number of class 2 */
- virq = irq_create_mapping(iic_host, 0x20 | unit, 0);
+ virq = irq_create_mapping(iic_host, 0x20 | unit);
if (virq == NO_IRQ)
printk(KERN_ERR "spider_pic: failed to map cascade !");
return virq;
Index: linux-irq-work/arch/powerpc/platforms/cell/spu_base.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/platforms/cell/spu_base.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/platforms/cell/spu_base.c 2006-07-08 11:05:01.000000000 +1000
@@ -583,9 +583,9 @@
spu->isrc = isrc = tmp[0];
/* Now map interrupts of all 3 classes */
- spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc, 0);
- spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc, 0);
- spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc, 0);
+ spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc);
+ spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc);
+ spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc);
/* Right now, we only fail if class 2 failed */
return spu->irqs[2] == NO_IRQ ? -EINVAL : 0;
Index: linux-irq-work/arch/powerpc/platforms/iseries/irq.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/platforms/iseries/irq.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/platforms/iseries/irq.c 2006-07-08 11:06:10.000000000 +1000
@@ -300,7 +300,7 @@
realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3)
+ function;
- return irq_create_mapping(NULL, realirq, IRQ_TYPE_NONE);
+ return irq_create_mapping(NULL, realirq);
}
#endif /* CONFIG_PCI */
@@ -341,7 +341,7 @@
}
static int iseries_irq_host_map(struct irq_host *h, unsigned int virq,
- irq_hw_number_t hw, unsigned int flags)
+ irq_hw_number_t hw)
{
set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq);
Index: linux-irq-work/arch/powerpc/platforms/pseries/ras.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/platforms/pseries/ras.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/platforms/pseries/ras.c 2006-07-08 11:06:34.000000000 +1000
@@ -93,8 +93,7 @@
for (i = 0; i < opicplen; i++) {
if (count > 15)
break;
- virqs[count] = irq_create_mapping(NULL, *(opicprop++),
- IRQ_TYPE_NONE);
+ virqs[count] = irq_create_mapping(NULL, *(opicprop++));
if (virqs[count] == NO_IRQ)
printk(KERN_ERR "Unable to allocate interrupt "
"number for %s\n", np->full_name);
Index: linux-irq-work/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/platforms/pseries/xics.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/platforms/pseries/xics.c 2006-07-09 14:09:57.000000000 +1000
@@ -502,16 +502,9 @@
}
static int xics_host_map_direct(struct irq_host *h, unsigned int virq,
- irq_hw_number_t hw, unsigned int flags)
+ irq_hw_number_t hw)
{
- unsigned int sense = flags & IRQ_TYPE_SENSE_MASK;
-
- pr_debug("xics: map_direct virq %d, hwirq 0x%lx, flags: 0x%x\n",
- virq, hw, flags);
-
- if (sense && sense != IRQ_TYPE_LEVEL_LOW)
- printk(KERN_WARNING "xics: using unsupported sense 0x%x"
- " for irq %d (h: 0x%lx)\n", flags, virq, hw);
+ pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);
get_irq_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq);
@@ -519,16 +512,9 @@
}
static int xics_host_map_lpar(struct irq_host *h, unsigned int virq,
- irq_hw_number_t hw, unsigned int flags)
+ irq_hw_number_t hw)
{
- unsigned int sense = flags & IRQ_TYPE_SENSE_MASK;
-
- pr_debug("xics: map_lpar virq %d, hwirq 0x%lx, flags: 0x%x\n",
- virq, hw, flags);
-
- if (sense && sense != IRQ_TYPE_LEVEL_LOW)
- printk(KERN_WARNING "xics: using unsupported sense 0x%x"
- " for irq %d (h: 0x%lx)\n", flags, virq, hw);
+ pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);
get_irq_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq);
@@ -757,7 +743,7 @@
{
unsigned int ipi;
- ipi = irq_create_mapping(xics_host, XICS_IPI, 0);
+ ipi = irq_create_mapping(xics_host, XICS_IPI);
BUG_ON(ipi == NO_IRQ);
/*
@@ -783,6 +769,14 @@
xics_set_cpu_priority(cpu, 0);
/*
+ * Clear IPI
+ */
+ if (firmware_has_feature(FW_FEATURE_LPAR))
+ lpar_qirr_info(cpu, 0xff);
+ else
+ direct_qirr_info(cpu, 0xff);
+
+ /*
* we need to EOI the IPI if we got here from kexec down IPI
*
* probably need to check all the other interrupts too
@@ -795,7 +789,7 @@
return;
desc = get_irq_desc(ipi);
if (desc->chip && desc->chip->eoi)
- desc->chip->eoi(XICS_IPI);
+ desc->chip->eoi(ipi);
/*
* Some machines need to have at least one cpu in the GIQ,
Index: linux-irq-work/arch/powerpc/sysdev/i8259.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/sysdev/i8259.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/sysdev/i8259.c 2006-07-08 09:39:38.000000000 +1000
@@ -169,7 +169,7 @@
}
static int i8259_host_map(struct irq_host *h, unsigned int virq,
- irq_hw_number_t hw, unsigned int flags)
+ irq_hw_number_t hw)
{
pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw);
@@ -177,7 +177,7 @@
if (hw == 2)
get_irq_desc(virq)->status |= IRQ_NOREQUEST;
- /* We use the level stuff only for now, we might want to
+ /* We use the level handler only for now, we might want to
* be more cautious here but that works for now
*/
get_irq_desc(virq)->status |= IRQ_LEVEL;
Index: linux-irq-work/drivers/char/hvsi.c
===================================================================
--- linux-irq-work.orig/drivers/char/hvsi.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/drivers/char/hvsi.c 2006-07-08 11:07:11.000000000 +1000
@@ -1299,7 +1299,7 @@
hp->inbuf_end = hp->inbuf;
hp->state = HVSI_CLOSED;
hp->vtermno = *vtermno;
- hp->virq = irq_create_mapping(NULL, irq[0], 0);
+ hp->virq = irq_create_mapping(NULL, irq[0]);
if (hp->virq == NO_IRQ) {
printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n",
__FUNCTION__, irq[0]);
Index: linux-irq-work/arch/powerpc/kernel/pci_64.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/kernel/pci_64.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/kernel/pci_64.c 2006-07-10 12:39:16.000000000 +1000
@@ -21,13 +21,13 @@
#include <linux/mm.h>
#include <linux/list.h>
#include <linux/syscalls.h>
+#include <linux/irq.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/pci-bridge.h>
#include <asm/byteorder.h>
-#include <asm/irq.h>
#include <asm/machdep.h>
#include <asm/ppc-pci.h>
@@ -1289,15 +1289,37 @@
DBG("Try to map irq for %s...\n", pci_name(pci_dev));
+ /* Try to get a mapping from the device-tree */
if (of_irq_map_pci(pci_dev, &oirq)) {
- DBG(" -> failed !\n");
- return -1;
- }
+ u8 line, pin;
- DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
- oirq.size, oirq.specifier[0], oirq.controller->full_name);
+ /* If that fails, lets fallback to what is in the config
+ * space and map that through the default controller. We
+ * also set the type to level low since that's what PCI
+ * interrupts are. If your platform does differently, then
+ * either provide a proper interrupt tree or don't use this
+ * function.
+ */
+ if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
+ return -1;
+ if (pin == 0)
+ return -1;
+ if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
+ line == 0xff) {
+ return -1;
+ }
+ DBG(" -> no map ! Using irq line %d from PCI config\n", line);
- virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size);
+ virq = irq_create_mapping(NULL, line);
+ if (virq != NO_IRQ)
+ set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
+ } else {
+ DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
+ oirq.size, oirq.specifier[0], oirq.controller->full_name);
+
+ virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
+ oirq.size);
+ }
if(virq == NO_IRQ) {
DBG(" -> failed to map !\n");
return -1;
Index: linux-irq-work/arch/powerpc/kernel/pci_32.c
===================================================================
--- linux-irq-work.orig/arch/powerpc/kernel/pci_32.c 2006-07-04 09:37:03.000000000 +1000
+++ linux-irq-work/arch/powerpc/kernel/pci_32.c 2006-07-10 12:40:09.000000000 +1000
@@ -11,6 +11,7 @@
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/bootmem.h>
+#include <linux/irq.h>
#include <asm/processor.h>
#include <asm/io.h>
@@ -18,7 +19,6 @@
#include <asm/sections.h>
#include <asm/pci-bridge.h>
#include <asm/byteorder.h>
-#include <asm/irq.h>
#include <asm/uaccess.h>
#include <asm/machdep.h>
@@ -1420,15 +1420,37 @@
DBG("Try to map irq for %s...\n", pci_name(pci_dev));
+ /* Try to get a mapping from the device-tree */
if (of_irq_map_pci(pci_dev, &oirq)) {
- DBG(" -> failed !\n");
- return -1;
- }
+ u8 line, pin;
+
+ /* If that fails, lets fallback to what is in the config
+ * space and map that through the default controller. We
+ * also set the type to level low since that's what PCI
+ * interrupts are. If your platform does differently, then
+ * either provide a proper interrupt tree or don't use this
+ * function.
+ */
+ if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
+ return -1;
+ if (pin == 0)
+ return -1;
+ if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
+ line == 0xff) {
+ return -1;
+ }
+ DBG(" -> no map ! Using irq line %d from PCI config\n", line);
- DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
- oirq.size, oirq.specifier[0], oirq.controller->full_name);
+ virq = irq_create_mapping(NULL, line);
+ if (virq != NO_IRQ)
+ set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
+ } else {
+ DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
+ oirq.size, oirq.specifier[0], oirq.controller->full_name);
- virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size);
+ virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
+ oirq.size);
+ }
if(virq == NO_IRQ) {
DBG(" -> failed to map !\n");
return -1;
^ permalink raw reply
* Re: [PATCH 15/20] [powerpc, netdevices] Constify & voidify get_property()
From: Jeremy Kerr @ 2006-07-10 3:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, cbe-oss-dev
In-Reply-To: <17582.14562.991790.920984@cargo.ozlabs.ibm.com>
Paul,
> For some reason, the whitespace got munged on this one.
Hm, that's odd - you mean the patch doesn't apply, or that it introduces
incorrect whitepace? I can apply this patch (from patchwork or the list
archives) without problems.
> There were some rejects on some of the other patches due to some of
> Ben H's patches. Please fix them and move the
> include/linux/platform_device.h change into the same patch as the
> drivers/base/platform.c change.
Sure thing. patches coming.
Jeremy
^ permalink raw reply
* Re: patches added to powerpc.git tree
From: Benjamin Herrenschmidt @ 2006-07-10 3:05 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17582.17835.641485.233064@cargo.ozlabs.ibm.com>
On Fri, 2006-07-07 at 21:29 +1000, Paul Mackerras wrote:
> The following patches have been pushed to the powerpc.git tree (master
> branch):
>
> Benjamin Herrenschmidt:
> [POWERPC] Workaround Pegasos incorrect ISA "ranges"
> [POWERPC] Fix 32 bits warning in prom_init.c
> [POWERPC] Fix non-MPIC CHRPs with CONFIG_SMP set
> [POWERPC] Fix default clock for udbg_16550
> [POWERPC] Fix legacy_serial.c error handling on 32 bits
> [POWERPC] Add briq support to CHRP
> [POWERPC] Add support for briq front panel
> [POWERPC] More offb/bootx fixes
> [POWERPC] Xserve G5 thermal control fixes
> [POWERPC] Add cpufreq support for Xserve G5
Can you drop the last one please ? (The cpufreq support for Xserve). I
have a bug in there, I'll send a fixed version later today.
Cheers,
Ben.
^ permalink raw reply
* Re: setup arch
From: Johannes Berg @ 2006-07-09 21:23 UTC (permalink / raw)
To: Paul Smith; +Cc: linuxppc-dev
In-Reply-To: <20060709170909.90774.qmail@web35812.mail.mud.yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 407 bytes --]
On Sun, 2006-07-09 at 10:09 -0700, Paul Smith wrote:
> Anyone have any ideas?
First figure out what kernel you're actually running (G5 isn't really a
kernel description). Then upgrade that to 2.6.17.
And your machine description also lacks detail. If it's a PowerMac11,2
(Apple Quad PowerMac) then I'll just note that I have one too and it's
working perfectly with kernel 2.6.17 :)
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* setup arch
From: Paul Smith @ 2006-07-09 17:09 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 2371 bytes --]
I hesitate to lay this one out here because you all
are way over my head. The regular forums have not
responded to this in any meaningful way.
Hi,
Box:
Quad 2.5 PPC
4.5 GB non ecc 533 Ram
RocketRaid2320
Nvida 6600 256mb
software resources:
install-ppc64-minimal-2006.0.iso
install-ppc64-minimal-2006.0.iso.DIGESTS
install-ppc64-minimal-2006.0.iso.CONTENTS
install-ppc64-universal-2006.0-32ul.iso
install-ppc64-universal-2006.0-32ul.iso.DIGESTS
install-ppc64-universal-2006.0-32ul.iso.CONTENTS
Checksum.app
I am still stuck on this installation attempt.
Here is a recap of the situation:
Both the minimal .iso
images(install-ppc64-minimal-2006.0.iso) and the
universal.iso(install-ppc64-universal-2006.0-32ul.iso)have
been checksummed and check out good.
I zereod out my cd media in both cases to make sure I
had no media damage that might cause corruption of the
images.
When I boot from either the minimal or uninversal ppc
64 ect. ect. I get to a black screen that says:
Welcome to the the Genntoo 2006 PPC install-CD. This
cd allows you to install on 64 bit apple and IBM
Hardware either a 32 or 64 bit user land, running on
top of a 64 bit kernal. Please refer to help on the cd
to learn more about this install-cd.
Gentoo Installation Handbook http://ppc64.gentoo.org
further info http;// ppc64gentoo.org
Bugs: "bugs.gentoo.org(Cc ppc64@gentoo.org)
IRC :#gentoo-ppc64 on IRC.freenode.net
pesss tab to shoow the kernals. welcome to yaboot
version 1.3.11
enter "help to get some basic usage information
Boot:
if I push enter it says "loading kernal"
Elf64 ramdisk loaded
(then something else real quick)
then I hang in a grey screen that says
Cf00100
MM Init
CF000012
MM Init Done
Cf000012
Setup Arch
The machine just hangs here with the fans running
pretty fast
When I press tab the kernal that is available is:
G5 G5-ttyS0,57600
I know you are not really supposed to guess when you
are asking for help but the above is all the hard data
I know to give.
I was looking at arch.app and it seems as if this is
the architecture part of the kernal.
Given that this is very new hardware is it possible
that there is either a bug in the image or that this
hardware is not yet supported?
Anyone have any ideas?
---------------------------------
Want to be your own boss? Learn how on Yahoo! Small Business.
[-- Attachment #2: Type: text/html, Size: 2949 bytes --]
^ permalink raw reply
* Re: [PATCH 0/6] Sizing zones and holes in an architecture independent manner V8
From: Mel Gorman @ 2006-07-09 15:32 UTC (permalink / raw)
To: Heiko Carstens
Cc: akpm, davej, tony.luck, linux-mm, ak, bob.picco, linux-kernel,
linuxppc-dev
In-Reply-To: <20060708114201.GA9419@osiris.boeblingen.de.ibm.com>
On Sat, 8 Jul 2006, Heiko Carstens wrote:
> On Sat, Jul 08, 2006 at 12:10:42PM +0100, Mel Gorman wrote:
>> There are differences in the zone sizes for x86_64 as the arch-specific code
>> for x86_64 accounts the kernel image and the starting mem_maps as memory
>> holes but the architecture-independent code accounts the memory as present.
>
> Shouldn't this be the same for all architectures?
The comment in the mail is inaccurate because patch 6/6 will account for
the kernel image and mem_map as holes for all architectures if it is
merged. The patch could be submitted independent of arch-independent
zone-sizing.
> Or to put it in other words:
> why does only x86_64 account the kernel image as memory hole?
>
>From Andi Kleen's mails in the thread "[PATCH 0/5] Sizing zones and holes
in an architecture independent manner V7"
>>> Begin extract <<<
> Why is it a performance regression if the image and memmap is accounted
> for as holes? How are those regions different from any other kernel
> allocation or bootmem allocations for example which are not accounted as
> holes?
They are comparatively big and cannot be freed.
>If you are sure that it makes a measurable difference to performance,
There was at least one benchmark/use case where it made a significant
difference, can't remember the exact numbers though.
It affects the low/high water marks in the VM zone balancer.
Especially for the 16MB DMA zone it can make a difference if you
account 4MB kernel in there or not.
>>> End extract <<<
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
^ 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