* Re: Setting I&D cache enable in the same mtspr instruction
From: Roger Larsson @ 2006-05-29 12:15 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <B9FFC3F97441D04093A504CEA31B7C41A62B2F@msilexch01.marvell.com>
Is the patch reversed?
diff -Naur old new > patch
And what about comments, are they all still valid?
"enable and invalidate caches" is now only Data cache...
In cases when I am writing code like this I try to
include the reason why it is not "optimized" together
in one write... (or soon someone will do that optimization).
/RogerL
^ permalink raw reply
* RE: Setting I&D cache enable in the same mtspr instruction
From: Assaf Hoffman @ 2006-05-29 12:37 UTC (permalink / raw)
To: Roger Larsson, linuxppc-embedded; +Cc: Ronen Shitrit
[-- Attachment #1: Type: text/plain, Size: 879 bytes --]
Hi,
Attached...
-----Original Message-----
From: linuxppc-embedded-bounces+hoffman=marvell.com@ozlabs.org
[mailto:linuxppc-embedded-bounces+hoffman=marvell.com@ozlabs.org] On
Behalf Of Roger Larsson
Sent: Monday, May 29, 2006 3:15 PM
To: linuxppc-embedded@ozlabs.org
Subject: Re: Setting I&D cache enable in the same mtspr instruction
Importance: Low
Is the patch reversed?
diff -Naur old new > patch
And what about comments, are they all still valid?
"enable and invalidate caches" is now only Data cache...
In cases when I am writing code like this I try to
include the reason why it is not "optimized" together
in one write... (or soon someone will do that optimization).
/RogerL
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
[-- Attachment #2: cpu_setup_6xx.patch --]
[-- Type: application/octet-stream, Size: 1114 bytes --]
--- ../downloads/kernels/linux-2.6.12.6/arch/ppc/kernel/cpu_setup_6xx_patch.S 2006-05-29 15:31:24.000000000 +0300
+++ ../downloads/kernels/linux-2.6.12.6/arch/ppc/kernel/cpu_setup_6xx.S 2005-08-29 19:55:27.000000000 +0300
@@ -77,29 +77,19 @@
blr
/* Enable caches for 603's, 604, 750 & 7400 */
-
-/*
- * HID0[ICFI] and HID0[DCFI] must NOT both be set with the same mtspr
- * instruction, due to the synchronization requirements
- */
-
setup_common_caches:
mfspr r11,SPRN_HID0
- ori r8,r11,HID0_DCE
andi. r0,r11,HID0_DCE
+ ori r11,r11,HID0_ICE|HID0_DCE
+ ori r8,r11,HID0_ICFI
bne 1f /* don't invalidate the D-cache */
ori r8,r8,HID0_DCI /* unless it wasn't enabled */
1: sync
mtspr SPRN_HID0,r8 /* enable and invalidate caches */
- sync
- ori r8,r11,HID0_ICE|HID0_DCE|HID0_ICFI
- isync /* An isync must precede the setting */
- /* of the HID0[ICFI] in order for the */
- /* setting to take effect. */
sync
- mtspr SPRN_HID0,r8 /* enable and invalidate Instruction cache */
+ mtspr SPRN_HID0,r11 /* enable caches */
sync
-
+ isync
blr
/* 604, 604e, 604ev, ...
^ permalink raw reply
* Re: Re: PPC exception 0x320
From: jeanwelly @ 2006-05-29 14:22 UTC (permalink / raw)
To: Becky Bruce; +Cc: linuxppc-embedded@ozlabs.org
In-Reply-To: <4819ACC0-1281-487B-B290-C55071E1EC27@freescale.com>
SGkgQmVja3kgQnJ1Y2UsDQpTb3JyeSBmb3IgbGF0ZSByZXNwb25zZS4gSSBnb3QgbWFpbCB0cmFm
ZmljLi4uDQoNCkkgZW5jb3VudGVyZWQgdGhlIGV4Y2VwdGlvbiAweDMyMCB3aGljaCBjYXVzZWQg
dGhlIFBQQyBjYXJkIGNyYXNoLiBCYXNlZCBvbiBteSB1bmRlcnN0YW5kaW5nLCBJIHRoaW5rIGV4
Y2VwdGlvbiBpcyBhIEhXIGJlaGF2aW91ciwgc28gSSBndWVzcyB0aGVyZSBtYXliZSBleGlzdCBz
b21lIHJlZmVyZW5jZSBvbiBhbGwgdGhlIHN1cHBvcnRlZCBleGNlcHRpb25zIG9mIHNvbWUgdmVy
c2lvbiBvZiBQUEMuIERvIHlvdSBrbm93IHRoaXM/DQoNCk15IHN5c3RlbSB0YWtlIHRoYXQgZXhj
ZXB0aW9uIGFzIGFuICJ1bmtub3duIGV4Y2VwdGlvbiIgYW5kIGNyYXNoIHRoZSBjYXJkLiBTbywg
SSB0aGluayB0aGUgZXhjZXB0aW9uIGlzIGZyb20gdGhlIFBQQyBDUFUsIGJ1dCBkb24ndCB0aGUg
Y29uY3JldGUgbWVhbmluZ3MuDQoNCkFwcHJlY2lhdGUgeW91ciBzdWdnZXN0aW9ucy4NCi0tLQ0K
SmVhbndlbGx5DQoNCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCg0K
PklzIHRoZXJlIHNvbWUgZXJyb3IgbWVzc2FnZSB5b3UgY2FuIHNob3cgbWU/DQo+DQo+LUINCj4N
Cj5PbiBBcHIgMjUsIDIwMDYsIGF0IDEwOjAzIEFNLCBqZWFud2VsbHkgd3JvdGU6DQo+DQo+PiBI
aSBCZWNreSBCcnVjZSwNCj4+IEknbSB1c2luZyBQUEMgNzUwLi4uIEp1c3QgYXMgeW91IHNhaWQs
IDB4MzAwIGlzIGZvciBEU0ksIGFuZCBJICANCj4+IGd1ZXNzIHRoZXkgYXJlIGEgc2V0IG9mIGV4
Y2VwdGlvbnMsIG5vdCBqdXN0IG9uZS4gQW5kIDB4MzIwIGlzIG9uZSAgDQo+PiBvZiB0aGVtLg0K
Pj4gSSBnb3QgYSBib2FyZCBjcmFzaCwgYW5kIFBQQyBhbGFybWVkIGV4Y2VwdGlvbiAweDMyMC4g
Q291bGQgeW91ICANCj4+IHNob3cgbWUgdGhlIG1lY2hhbmlzbSBvZiBoYW5kbGluZyBvZiBhIHNw
ZWNpYWwgZXhjZXB0aW9uIG5vdCBvbmUgc2V0Lg0KPj4gCQ0KPj4NCj4+ID09PT09PT0gMjAwNi0w
NC0yNSAwMjo1MzozNSDE+tTawLTQxdbQ0LS1wKO6PT09PT09PQ0KPj4NCj4+PiBDb3VsZCB5b3Ug
dHJ5IHRvIGJlIG1vcmUgc3BlY2lmaWM/ICBXaGF0IHByb2Nlc3NvciBkbyB5b3UgaGF2ZSwgd2hh
dA0KPj4+IGxpbnV4IHZlcnNpb24gYXJlIHlvdSBydW5uaW5nLCBhbmQgd2hhdCBkbyB5b3UgbWVh
biBleGFjdGx5IHdoZW4geW91DQo+Pj4gc2F5IHlvdSAiZW5jb3VudGVyZWQgUFBDIGV4Y2VwdGlv
biAweDMyMCI/ICBBcyBmYXIgYXMgSSBrbm93LCB0aGUNCj4+PiBwb3dlcnBjIGFyY2hpdGVjdHVy
ZSBkb2VzIG5vdCBkZWZpbmUgYW4gZXhjZXB0aW9uIDB4MzIwLiAgMHgzMDAgaXMNCj4+PiB1c3Vh
bGx5IERTSSBvbiBjbGFzc2ljIHBvd2VycGMgcGFydHMuICBCb29rRSBwYXJ0cyBoYW5kbGUgdGhp
bmdzDQo+Pj4gZGlmZmVyZW50bHkuDQo+Pj4NCj4+PiBUaGFua3MsDQo+Pj4gLUJlY2t5DQo+Pj4N
Cj4+PiBPbiBBcHIgMjQsIDIwMDYsIGF0IDg6NTEgQU0sIGplYW53ZWxseSB3cm90ZToNCj4+Pg0K
Pj4+PiBIaSwNCj4+Pj4gSSBlbmNvdW50ZXJlZCBQUEMgZXhjZXB0aW9uIDB4MzIwLCBidXQgZG9u
J3Qga25vdyB3aGF0IGl0IGZvci4gQW55DQo+Pj4+IG9uZSBjb3VsZCBoZWxwIG1lIG9uIHRoaXM/
DQo+Pj4+IFRoYW5rcyENCj4+Pj4gIAkJCQkNCj4+Pj4NCj4+Pj4goaGhoaGhoaGhoaGhoaGhoWpl
YW53ZWxseQ0KPj4+PiChoaGhoaGhoaGhoaGhoaGhamVhbndlbGx5QDEyNi5jb20NCj4+Pj4goaGh
oaGhoaGhoaGhoaGhoaGhoaEyMDA2LTA0LTI0DQo+Pj4+IF9fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fDQo+Pj4+IExpbnV4cHBjLWVtYmVkZGVkIG1haWxpbmcg
bGlzdA0KPj4+PiBMaW51eHBwYy1lbWJlZGRlZEBvemxhYnMub3JnDQo+Pj4+IGh0dHBzOi8vb3ps
YWJzLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2xpbnV4cHBjLWVtYmVkZGVkDQo+Pj4NCj4+Pg0KPj4+
IC4NCj4+DQo+PiA9ID0gPSA9ID0gPSA9ID0gPSA9ID0gPSA9ID0gPSA9ID0gPSA9ID0NCj4+IAkJ
CQ0KPj4NCj4+IKGhoaGhoaGhoaGhoaGhoaHWwg0KPj4gwPGjoQ0KPj4NCj4+IAkJCQkNCj4+IKGh
oaGhoaGhoaGhoaGhoaFqZWFud2VsbHkNCj4+IKGhoaGhoaGhoaGhoaGhoaFqZWFud2VsbHlAMTI2
LmNvbQ0KPj4goaGhoaGhoaGhoaGhoaGhoaGhoaEyMDA2LTA0LTI1DQo+Pg0KPg0KPg0KPi4NCg0K
PSA9ID0gPSA9ID0gPSA9ID0gPSA9ID0gPSA9ID0gPSA9ID0gPSA9DQoJCQkNCg0KoaGhoaGhoaGh
oaGhoaGhodbCDQrA8aOhDQogDQoJCQkJIA0KoaGhoaGhoaGhoaGhoaGhoWplYW53ZWxseQ0KoaGh
oaGhoaGhoaGhoaGhoWplYW53ZWxseUAxMjYuY29tDQqhoaGhoaGhoaGhoaGhoaGhoaGhoTIwMDYt
MDUtMjkNCg0K
^ permalink raw reply
* Re: [PATCH] Compile failure fix for ppc on 2.6.17-rc4-mm3 (2nd attempt)
From: Mel Gorman @ 2006-05-29 15:49 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, vgoyal, linux-kernel
In-Reply-To: <20060526094924.10efc515.akpm@osdl.org>
On (26/05/06 09:49), Andrew Morton didst pronounce:
> mel@csn.ul.ie (Mel Gorman) wrote:
> >
> > (Resending with Andrew's email address correct this time)
> >
> > For the last few -mm releases, kernels built for an old RS6000 failed to
> > compile with the message;
> >
> > arch/powerpc/kernel/built-in.o(.init.text+0x77b4): In function `vrsqrtefp':
> > : undefined reference to `__udivdi3'
> > arch/powerpc/kernel/built-in.o(.init.text+0x7800): In function `vrsqrtefp':
> > : undefined reference to `__udivdi3'
> > make: *** [.tmp_vmlinux1] Error 1
>
> A function with a name like that doesn't _deserve_ to compile.
>
heh
> But actually vrsqrtefp() doesn't call __udivdi3 - the error lies somewhere
> else in the kernel and the toolchain gets it wrong, so we don't know where.
>
It explains why I couldn't find where vrsqrtefp() was.
> The way I usually hunt this problem down is to build the .s files (make
> arch/powerpc/kernel/foo.s) and then grep around, find the offending C
> function.
>
That was a good idea, thanks. It showed that check_for_io_childs() in
arch/powerpc/kernel/pci_32.c was the real problem. A quick look showed
that is was doing divisions on resource_type_t which was 64 bits with my
.config. Selecting CONFIG_RESOURCES_32BIT made the problem go away. This
option is introduced by the kconfigurable-resources-* patches so I've cc'd
Vivek Goyal to comment on the potential fixes below.
> > 2.6.17-rc5 is not affected but I didn't search for the culprit patch in
> > -mm. The following patch adds an implementation of __udivdi3 for plain old
> > ppc32. This may not be the correct fix as Google tells me that __udivdi3
> > has been replaced by calls to do_div() in a number of cases. There was no
> > obvious way to do that for vrsqrtefp, hence this workaround. The patch should
> > be acked, rejected or replaced by a ppc expert.
>
> Yes, we've traditionally avoided adding the 64-bit divide library functions.
Understandable. The fixes are obvious in this case. Easiest is for users to
set CONFIG_RESOURCES_32BIT manually although the kernel build error is not
very obvious. A fairly easy bodge is to default CONFIG_RESOURCES_32BIT to Y
when building PPC32 but a determined user may still fail to build a kernel. A
slightly riskier option is this patch that replaces a potential 64 bit divide
with a do_div call. The patch has been successfully boot-tested on a RS6000.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.17-rc4-mm3-clean/arch/powerpc/kernel/pci_32.c linux-2.6.17-rc4-mm3-resources-32/arch/powerpc/kernel/pci_32.c
--- linux-2.6.17-rc4-mm3-clean/arch/powerpc/kernel/pci_32.c 2006-05-29 15:55:52.000000000 +0100
+++ linux-2.6.17-rc4-mm3-resources-32/arch/powerpc/kernel/pci_32.c 2006-05-29 15:53:43.000000000 +0100
@@ -1115,7 +1115,9 @@ check_for_io_childs(struct pci_bus *bus,
int rc = 0;
#define push_end(res, size) do { unsigned long __sz = (size) ; \
- res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \
+ resource_size_t farEnd = (res->end + __sz); \
+ do_div(farEnd, (__sz + 1)); \
+ res->end = farEnd * (__sz + 1) + __sz; \
} while (0)
list_for_each_entry(dev, &bus->devices, bus_list) {
^ permalink raw reply
* Linux kernel thread with Linux 2.6.x
From: Laurent Lagrange @ 2006-05-29 15:35 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <000001c65d85$5e699890$5201a8c0@GEG2400>
Hello everybody,
I'm writing a custom network driver based on a MPC8260 FCC device for a
2.6.9 linux kernel.
In this driver, I need to use specific buffer allocation functions which use
down and up semaphore functions.
As the interrupt handler can't be scheduled, I have made a kernel thread
which waits forever on a semaphore.
This semaphore is set when a received packet interrupt occured. All that
mechanism works but the performances
are very poor.
Is there any solution to increase the kthread priority in the scheduler ?
Is there another solution than the semaphore to quickly wake up a kthread ?
Thanks a lot for your help.
Laurent
^ permalink raw reply
* Re: [PATCH] Compile failure fix for ppc on 2.6.17-rc4-mm3 (2nd attempt)
From: Segher Boessenkool @ 2006-05-29 16:22 UTC (permalink / raw)
To: Mel Gorman; +Cc: Andrew Morton, linuxppc-dev, vgoyal, linux-kernel
In-Reply-To: <20060529154923.GA9025@skynet.ie>
>>> arch/powerpc/kernel/built-in.o(.init.text+0x77b4): In function
>>> `vrsqrtefp':
>>> : undefined reference to `__udivdi3'
>>> arch/powerpc/kernel/built-in.o(.init.text+0x7800): In function
>>> `vrsqrtefp':
>>> : undefined reference to `__udivdi3'
>>> make: *** [.tmp_vmlinux1] Error 1
>>
>> A function with a name like that doesn't _deserve_ to compile.
Would vector_reciprocal_square_root_estimate_floating_point() be any
better...
Anyway, this is just a machine insn mnemonic, so the function name is
fine
I believe.
> #define push_end(res, size) do { unsigned long __sz = (size) ; \
> - res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \
> + resource_size_t farEnd = (res->end + __sz); \
> + do_div(farEnd, (__sz + 1)); \
> + res->end = farEnd * (__sz + 1) + __sz; \
> } while (0)
Size here is a) a misnomer (size + 1 is the actual size) and b) always
a power
of two minus one. So instead, do
#define push_end(res, mask) res->end = -(-res->end & ~(unsigned
long)mask)
(with a do { } while(0) armour if you prefer).
Segher
^ permalink raw reply
* Re: Linux kernel thread with Linux 2.6.x
From: Thiago Galesi @ 2006-05-29 17:13 UTC (permalink / raw)
To: Laurent Lagrange; +Cc: linuxppc-embedded
In-Reply-To: <000201c68335$7c594b90$5201a8c0@GEG2400>
>
> As the interrupt handler can't be scheduled, I have made a kernel thread
> which waits forever on a semaphore.
> This semaphore is set when a received packet interrupt occured.
You should look into tasklets for this. Not that your system is not
OK, but, as you said it, it's not fast enough.
Note that you still have some limitations using tasklets, but it's
more flexible than Interrupt handlers.
^ permalink raw reply
* Re: [PATCH] Compile failure fix for ppc on 2.6.17-rc4-mm3 (2nd attempt)
From: Mel Gorman @ 2006-05-29 17:38 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Andrew Morton, linuxppc-dev, vgoyal, linux-kernel
In-Reply-To: <2ebd96e4a7ea753273b2c5f856ba8c7a@kernel.crashing.org>
On Mon, 29 May 2006, Segher Boessenkool wrote:
>>>> arch/powerpc/kernel/built-in.o(.init.text+0x77b4): In function
>>>> `vrsqrtefp':
>>>> : undefined reference to `__udivdi3'
>>>> arch/powerpc/kernel/built-in.o(.init.text+0x7800): In function
>>>> `vrsqrtefp':
>>>> : undefined reference to `__udivdi3'
>>>> make: *** [.tmp_vmlinux1] Error 1
>>>
>>> A function with a name like that doesn't _deserve_ to compile.
>
> Would vector_reciprocal_square_root_estimate_floating_point() be any
> better...
> Anyway, this is just a machine insn mnemonic, so the function name is fine
> I believe.
>
>> #define push_end(res, size) do { unsigned long __sz = (size) ; \
>> - res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \
>> + resource_size_t farEnd = (res->end + __sz); \
>> + do_div(farEnd, (__sz + 1)); \
>> + res->end = farEnd * (__sz + 1) + __sz; \
>> } while (0)
>
> Size here is a) a misnomer (size + 1 is the actual size) and b) always a
> power
> of two minus one. So instead, do
>
> #define push_end(res, mask) res->end = -(-res->end & ~(unsigned long)mask)
>
> (with a do { } while(0) armour if you prefer).
>
It's not doing the same as the old code so is your suggested fix a correct
replacement?
For example, given 0xfff for size the current code rounds res->end to the
next 0x1000 boundary and adds 0xfff. Your propose fix just rounds it to
the next 0x1000 if I'm reading it correctly but is what the code was meant
to do in the first place? Using masks, the equivilant of the current code
is something like;
#define push_end(res, mask) do { \
res->end = -(-res->end & ~(unsigned long)mask); \
res->end += mask; \
} while (0)
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
^ permalink raw reply
* Re: [PATCH] Compile failure fix for ppc on 2.6.17-rc4-mm3 (2nd attempt)
From: Segher Boessenkool @ 2006-05-29 17:56 UTC (permalink / raw)
To: Mel Gorman; +Cc: Andrew Morton, linuxppc-dev, vgoyal, linux-kernel
In-Reply-To: <Pine.LNX.4.64.0605291825500.11234@skynet.skynet.ie>
>>> #define push_end(res, size) do { unsigned long __sz = (size) ; \
>>> - res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \
>>> + resource_size_t farEnd = (res->end + __sz); \
>>> + do_div(farEnd, (__sz + 1)); \
>>> + res->end = farEnd * (__sz + 1) + __sz; \
>>> } while (0)
>>
>> Size here is a) a misnomer (size + 1 is the actual size) and b)
>> always a power
>> of two minus one. So instead, do
>>
>> #define push_end(res, mask) res->end = -(-res->end & ~(unsigned
>> long)mask)
>>
>> (with a do { } while(0) armour if you prefer).
>>
>
> It's not doing the same as the old code so is your suggested fix a
> correct replacement?
>
> For example, given 0xfff for size the current code rounds res->end to
> the next 0x1000 boundary and adds 0xfff. Your propose fix just rounds
> it to the next 0x1000 if I'm reading it correctly but is what the code
> was meant to do in the first place? Using masks, the equivilant of the
> current code is something like;
>
> #define push_end(res, mask) do { \
> res->end = -(-res->end & ~(unsigned long)mask); \
> res->end += mask; \
> } while (0)
Yeah forgot a bit, this looks fine.
Segher
^ permalink raw reply
* Re: [PATCH] powerpc: add dmesg command to xmon
From: Olaf Hering @ 2006-05-29 17:58 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds, Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200605281812.09308.arnd@arndb.de>
On Sun, May 28, Arnd Bergmann wrote:
> On Sunday 28 May 2006 14:07, Olaf Hering wrote:
> > > This whole function looks fishy to me. It seems unnecessarily rude to me to
> > > use kallsyms_lookup_name in order to get at a static variable from another
> > > file. Can't you instead add a global function to kernel/printk.c to return
> > > the buffer?
> >
> > Its possible, but it wont end up in Linus tree.
>
> Hmm, so the idea is that because Linus doesn't like kernel debuggers, we just
> obfuscate the code for any improvements to xmon and hope he doesn't notice?
So lets just ask again for support in generic code for a dmesg command in xmon:
http://lkml.org/lkml/2004/10/28/32
vs. these 2 patches
http://ozlabs.org/pipermail/linuxppc-dev/2006-May/023261.html
http://lkml.org/lkml/2006/5/29/55
or no dmesg at all.
^ permalink raw reply
* Re: [PATCH] Compile failure fix for ppc on 2.6.17-rc4-mm3 (2nd attempt)
From: Mel Gorman @ 2006-05-29 19:05 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Andrew Morton, linuxppc-dev, vgoyal, linux-kernel
In-Reply-To: <c6414fc4b2c627791a49085bf8eea7e8@kernel.crashing.org>
On (29/05/06 19:56), Segher Boessenkool didst pronounce:
> >>> #define push_end(res, size) do { unsigned long __sz = (size) ; \
> >>>- res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \
> >>>+ resource_size_t farEnd = (res->end + __sz); \
> >>>+ do_div(farEnd, (__sz + 1)); \
> >>>+ res->end = farEnd * (__sz + 1) + __sz; \
> >>> } while (0)
> >>
> >>Size here is a) a misnomer (size + 1 is the actual size) and b)
> >>always a power
> >>of two minus one. So instead, do
> >>
> >>#define push_end(res, mask) res->end = -(-res->end & ~(unsigned
> >>long)mask)
> >>
> >>(with a do { } while(0) armour if you prefer).
> >>
> >
> >It's not doing the same as the old code so is your suggested fix a
> >correct replacement?
> >
> >For example, given 0xfff for size the current code rounds res->end to
> >the next 0x1000 boundary and adds 0xfff. Your propose fix just rounds
> >it to the next 0x1000 if I'm reading it correctly but is what the code
> >was meant to do in the first place? Using masks, the equivilant of the
> >current code is something like;
> >
> >#define push_end(res, mask) do { \
> > res->end = -(-res->end & ~(unsigned long)mask); \
> > res->end += mask; \
> >} while (0)
>
> Yeah forgot a bit, this looks fine.
>
Ok. The following patch has been successfully boot tested on the same machine
with 64 bit resource_size_t. Because the mask is assumed to be a
power-of-two - 1, I added a comment and a BUG_ON() to be sure.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.17-rc4-mm3-clean/arch/powerpc/kernel/pci_32.c linux-2.6.17-rc4-mm3-resources-32/arch/powerpc/kernel/pci_32.c
--- linux-2.6.17-rc4-mm3-clean/arch/powerpc/kernel/pci_32.c 2006-05-29 15:55:52.000000000 +0100
+++ linux-2.6.17-rc4-mm3-resources-32/arch/powerpc/kernel/pci_32.c 2006-05-29 19:09:36.000000000 +0100
@@ -1114,8 +1114,16 @@ check_for_io_childs(struct pci_bus *bus,
int i;
int rc = 0;
-#define push_end(res, size) do { unsigned long __sz = (size) ; \
- res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \
+ /*
+ * Assuming mask is a power of two - 1, push_end
+ * moves res->end to the end of the next
+ * mask-aligned boundary.
+ * e.g. res->end of 0x1fff moves to 0x2fff
+ */
+#define push_end(res, mask) do { \
+ BUG_ON( ((mask+1) & mask) != 0); \
+ res->end = -(-res->end & ~(unsigned long)mask); \
+ res->end += mask; \
} while (0)
list_for_each_entry(dev, &bus->devices, bus_list) {
^ permalink raw reply
* [RFC/PATCH 0/8] Overhaul of virt IRQ configuration. / Kill ppc64_interrupt_controller.
From: Michal Ostrowski @ 2006-05-29 20:41 UTC (permalink / raw)
To: linuxppc-dev
The following set of patches is aimed at killing the
ppc64_interrupt_controller global variable, and similarly that various
global variables used to tweak the parameters of virtual IRQ re-mapping.
Instead each platform can use a single function to configure IRQ
re-mapping in "init_early()".
Platforms can choose the default configuration (which is to
say identity mappings of IRQ vectors 0..511) or specify their own
configuration: an offset (for ISA vectors), the range that is to be
identity mapped and the range of vectors that may be arbitrarily
re-mapper.
This allows us to remove the special-casing based on
ppc64_interrupt_controller in virt_irq_create_mapping().
Subsequently most uses of ppc64_interrupt_controller are on
configuration paths where we can typically obtain comparable information
by alternate means.
In the end, only pSeries-specific code must be aware of the choice of
PIC and it will check to see if an MPIC has been initialized (and if
not, assume XICS). (Thus no platforms beyond pSeries are affected.)
This code has been tested on pSeries LPAR, G5, and Maple. I'll be
re-testing it on a Power3 with MPIC shortly once a system for testing
becomes available again.
--
Michal Ostrowski <mostrows@watson.ibm.com>
^ permalink raw reply
* [PATCH 1/8] Formalize virtual-IRQ remapping configuration.
From: mostrows @ 2006-05-29 20:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
Instead of setting various global various to configure the behavior of
virtual-IRQ remapping, each platform has the option of calling
virt_irq_config() in "init_early" to specify:
- the offset to be used (i.e. NUM_ISA_INTERRUPTS)
- the number of interrupt vectors which are to be mapped 1-1
- the number of interrupt vectors that may be arbitrarily remapped
If virt_irq_config() is not called, the default configuration will be
used (512 identity-mapped interrupts with no offset).
--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
arch/powerpc/kernel/irq.c | 62 ++++++++++++++++----------------
arch/powerpc/kernel/prom.c | 4 --
arch/powerpc/kernel/setup_64.c | 6 +++
arch/powerpc/platforms/iseries/setup.c | 3 +-
arch/powerpc/platforms/pseries/setup.c | 10 +++++
include/asm-powerpc/irq.h | 30 +++++++++++----
6 files changed, 70 insertions(+), 45 deletions(-)
2f99449cbcacf67694e38698ec9860f86ba052e2
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 57d560c..efcb859 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -268,32 +268,35 @@ void __init init_IRQ(void)
#define UNDEFINED_IRQ 0xffffffff
unsigned int virt_irq_to_real_map[NR_IRQS];
-/*
- * Don't use virtual irqs 0, 1, 2 for devices.
- * The pcnet32 driver considers interrupt numbers < 2 to be invalid,
- * and 2 is the XICS IPI interrupt.
- * We limit virtual irqs to __irq_offet_value less than virt_irq_max so
- * that when we offset them we don't end up with an interrupt
- * number >= virt_irq_max.
- */
-#define MIN_VIRT_IRQ 3
-
-unsigned int virt_irq_max;
+static unsigned int min_virt_irq;
static unsigned int max_virt_irq;
static unsigned int nr_virt_irqs;
void
-virt_irq_init(void)
+virt_irq_config(unsigned int offset,
+ unsigned int num_shifted, unsigned int num_remapped)
{
- int i;
+ __irq_offset_value = offset;
+ min_virt_irq = num_shifted;
+ max_virt_irq = num_shifted + num_remapped - 1;
+ nr_virt_irqs = num_remapped;
- if ((virt_irq_max == 0) || (virt_irq_max > (NR_IRQS - 1)))
- virt_irq_max = NR_IRQS - 1;
- max_virt_irq = virt_irq_max - __irq_offset_value;
- nr_virt_irqs = max_virt_irq - MIN_VIRT_IRQ + 1;
+ BUG_ON(max_virt_irq + __irq_offset_value > (NR_IRQS-1));
+}
+void
+virt_irq_init(void)
+{
+ int i;
for (i = 0; i < NR_IRQS; i++)
virt_irq_to_real_map[i] = UNDEFINED_IRQ;
+
+ /* Configure the default mappings; don't remap interrupts,
+ * use 1-1 virt <-> real mappings. Subsequently platforms may
+ * choose to call virt_irq_config with their own custom settings.
+ */
+ virt_irq_config(0, NR_IRQS, 0);
+
}
/* Create a mapping for a real_irq if it doesn't already exist.
@@ -304,30 +307,25 @@ int virt_irq_create_mapping(unsigned int
unsigned int virq, first_virq;
static int warned;
- if (ppc64_interrupt_controller == IC_OPEN_PIC)
- return real_irq; /* no mapping for openpic (for now) */
-
- if (ppc64_interrupt_controller == IC_CELL_PIC)
- return real_irq; /* no mapping for iic either */
-
- /* don't map interrupts < MIN_VIRT_IRQ */
- if (real_irq < MIN_VIRT_IRQ) {
+ /* don't map interrupts < min_virt_irq */
+ if (real_irq < min_virt_irq) {
virt_irq_to_real_map[real_irq] = real_irq;
return real_irq;
}
- /* map to a number between MIN_VIRT_IRQ and max_virt_irq */
+ /* map to a number between min_virt_irq and max_virt_irq */
virq = real_irq;
if (virq > max_virt_irq)
- virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ;
+ virq = (virq % nr_virt_irqs) + min_virt_irq;
/* search for this number or a free slot */
first_virq = virq;
while (virt_irq_to_real_map[virq] != UNDEFINED_IRQ) {
if (virt_irq_to_real_map[virq] == real_irq)
return virq;
+
if (++virq > max_virt_irq)
- virq = MIN_VIRT_IRQ;
+ virq = min_virt_irq;
if (virq == first_virq)
goto nospace; /* oops, no free slots */
}
@@ -338,8 +336,10 @@ int virt_irq_create_mapping(unsigned int
nospace:
if (!warned) {
printk(KERN_CRIT "Interrupt table is full\n");
- printk(KERN_CRIT "Increase virt_irq_max (currently %d) "
- "in your kernel sources and rebuild.\n", virt_irq_max);
+ printk(KERN_CRIT "Modify kernel sources to call "
+ "virt_irq_config() with a larger value "
+ "of \"num_remapped\" (currently %d) and rebuild.\n",
+ nr_virt_irqs);
warned = 1;
}
return NO_IRQ;
@@ -358,7 +358,7 @@ unsigned int real_irq_to_virt_slowpath(u
virq = real_irq;
if (virq > max_virt_irq)
- virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ;
+ virq = (virq % nr_virt_irqs) + min_virt_irq;
first_virq = virq;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 9a07f97..bfbe6a7 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -472,10 +472,6 @@ void __init finish_device_tree(void)
DBG(" -> finish_device_tree\n");
-#ifdef CONFIG_PPC64
- /* Initialize virtual IRQ map */
- virt_irq_init();
-#endif
scan_interrupt_controllers();
/*
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4467c49..4669179 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -389,6 +389,12 @@ void __init setup_system(void)
*/
check_for_initrd();
+
+ /* Configure default setting for virtual IRQ remapping.
+ * ppc_md.init_early() may reconfigure this with virt_irq_config()
+ */
+ virt_irq_init();
+
/*
* Do some platform specific early initializations, that includes
* setting up the hash table pointers. It also sets up some interrupt-mapping
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index a6fd9be..6a7d04b 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -688,8 +688,9 @@ static int __init iseries_probe(void)
/*
* The Hypervisor only allows us up to 256 interrupt
* sources (the irq number is passed in a u8).
+ * This call provides us with vectors 0 .. 255 without remapping.
*/
- virt_irq_max = 255;
+ virt_irq_config(0, 256, 0);
return 1;
}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 5f79f01..9d22265 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -270,7 +270,6 @@ static void __init pSeries_discover_pic
* Setup interrupt mapping options that are needed for finish_device_tree
* to properly parse the OF interrupt tree & do the virtual irq mapping
*/
- __irq_offset_value = NUM_ISA_INTERRUPTS;
ppc64_interrupt_controller = IC_INVALID;
for (np = NULL; (np = of_find_node_by_name(np, "interrupt-controller"));) {
typep = (char *)get_property(np, "compatible", NULL);
@@ -286,6 +285,15 @@ static void __init pSeries_discover_pic
printk("pSeries_discover_pic: failed to recognize"
" interrupt-controller\n");
+ /*
+ * Don't use virtual irqs 0, 1, 2 for devices.
+ * The pcnet32 driver considers interrupt numbers < 2 to be invalid,
+ * and 2 is the XICS IPI interrupt.
+ */
+
+ virt_irq_config(NUM_ISA_INTERRUPTS, 3,
+ NR_IRQS - (3 + NUM_ISA_INTERRUPTS));
+
}
static void pSeries_mach_cpu_die(void)
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 7bc6d73..f2adbc0 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -54,18 +54,32 @@
*/
extern unsigned int virt_irq_to_real_map[NR_IRQS];
-/* The maximum virtual IRQ number that we support. This
- * can be set by the platform and will be reduced by the
- * value of __irq_offset_value. It defaults to and is
- * capped by (NR_IRQS - 1).
- */
-extern unsigned int virt_irq_max;
-
/* Create a mapping for a real_irq if it doesn't already exist.
* Return the virtual irq as a convenience.
*/
int virt_irq_create_mapping(unsigned int real_irq);
-void virt_irq_init(void);
+
+/* Initializes the virtual IRQ re-mapping, before ppc_md.init_early() */
+extern void virt_irq_init(void);
+
+/* virt_irq_config - Configure the division of the virtual IRQ space.
+ * Each platform may call this to set it's own specific
+ * IRQ remapping parameters.
+ * @offset: offset of remapped space (i.e. NUM_ISA_INTERRUPTS).
+ * @num_shifted: number of vectors to be simply shifted to account for
+ * the offset with no other remapping.
+ * @num_remapper: number of vectors that may be arbitrarily remapped.
+ *
+ * Virtual IRQ vectors will have the following mappings to the IRQ vectors
+ * as seen by the approrpiate interrupt controller:
+ * 0 .. offset-1 -> 0 .. offset-1 (1-1 mapping)
+ * offset .. offset+num_shifted-1 -> 0 .. num_shifted-1 (shift by offset)
+ * offset+num_shifted .. offset+num_shifted+num_remapped-1 ->
+ * arbitrary mappings to real irq as required.
+ */
+extern void virt_irq_config(unsigned int offset,
+ unsigned int num_linear,
+ unsigned int num_remapped);
static inline unsigned int virt_irq_to_real(unsigned int virt_irq)
{
--
1.1.4.g0b63-dirty
^ permalink raw reply related
* [PATCH 2/8] PIC discovery re-organization.
From: mostrows @ 2006-05-29 20:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
Change pSeries_discover_pic() to simply return the PIC type, rather
than setting the global "ppc64_interrupt_controller" value. They type of
controller present will be passed down as an argument to functions
that need it.
--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
arch/powerpc/platforms/pseries/setup.c | 36 +++++++++++++++++---------------
1 files changed, 19 insertions(+), 17 deletions(-)
3675f032e1b03d6f000ffb08b2487ee9aa44fa2d
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 9d22265..33ae521 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -83,6 +83,7 @@ int fwnmi_active; /* TRUE if an FWNMI h
static void pseries_shared_idle_sleep(void);
static void pseries_dedicated_idle_sleep(void);
+static int pSeries_discover_pic(void);
struct mpic *pSeries_mpic;
@@ -195,8 +196,11 @@ static void pseries_lpar_enable_pmcs(voi
static void __init pSeries_setup_arch(void)
{
+ int int_ctrl = pSeries_discover_pic();
+ ppc64_interrupt_controller = int_ctrl;
+
/* Fixup ppc_md depending on the type of interrupt controller */
- if (ppc64_interrupt_controller == IC_OPEN_PIC) {
+ if (int_ctrl == IC_OPEN_PIC) {
ppc_md.init_IRQ = pSeries_init_mpic;
ppc_md.get_irq = mpic_get_irq;
/* Allocate the mpic now, so that find_and_init_phbs() can
@@ -261,39 +265,30 @@ static int __init pSeries_init_panel(voi
}
arch_initcall(pSeries_init_panel);
-static void __init pSeries_discover_pic(void)
+static int __init pSeries_discover_pic(void)
{
struct device_node *np;
char *typep;
-
/*
* Setup interrupt mapping options that are needed for finish_device_tree
* to properly parse the OF interrupt tree & do the virtual irq mapping
*/
- ppc64_interrupt_controller = IC_INVALID;
+ int int_ctrl = IC_INVALID;
for (np = NULL; (np = of_find_node_by_name(np, "interrupt-controller"));) {
typep = (char *)get_property(np, "compatible", NULL);
if (strstr(typep, "open-pic")) {
- ppc64_interrupt_controller = IC_OPEN_PIC;
+ int_ctrl = IC_OPEN_PIC;
break;
} else if (strstr(typep, "ppc-xicp")) {
- ppc64_interrupt_controller = IC_PPC_XIC;
+ int_ctrl = IC_PPC_XIC;
break;
}
}
- if (ppc64_interrupt_controller == IC_INVALID)
+ if (int_ctrl == IC_INVALID)
printk("pSeries_discover_pic: failed to recognize"
" interrupt-controller\n");
- /*
- * Don't use virtual irqs 0, 1, 2 for devices.
- * The pcnet32 driver considers interrupt numbers < 2 to be invalid,
- * and 2 is the XICS IPI interrupt.
- */
-
- virt_irq_config(NUM_ISA_INTERRUPTS, 3,
- NR_IRQS - (3 + NUM_ISA_INTERRUPTS));
-
+ return int_ctrl;
}
static void pSeries_mach_cpu_die(void)
@@ -346,7 +341,14 @@ static void __init pSeries_init_early(vo
iommu_init_early_pSeries();
- pSeries_discover_pic();
+ /*
+ * Don't use virtual irqs 0, 1, 2 for devices.
+ * The pcnet32 driver considers interrupt numbers < 2 to be invalid,
+ * and 2 is the XICS IPI interrupt.
+ */
+
+ virt_irq_config(NUM_ISA_INTERRUPTS, 3,
+ NR_IRQS - (3 + NUM_ISA_INTERRUPTS));
DBG(" <- pSeries_init_early()\n");
}
--
1.1.4.g0b63-dirty
^ permalink raw reply related
* [PATCH 3/8] Avoid use of ppc64_interrupt_controller.
From: mostrows @ 2006-05-29 20:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
xics_irq_8259_cascade being a valid (non -1) value is sufficient criteria
for registering the cascade interrupt vector.
--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
arch/powerpc/platforms/pseries/xics.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
35c3db8657f7716ae93d7423ce49f32a5f008359
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 2d60ea3..0fae097 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -82,8 +82,8 @@ struct xics_ipl {
static struct xics_ipl __iomem *xics_per_cpu[NR_CPUS];
-static int xics_irq_8259_cascade = 0;
-static int xics_irq_8259_cascade_real = 0;
+static int xics_irq_8259_cascade = -1; /* default to invalid value*/
+static int xics_irq_8259_cascade_real = -1;
static unsigned int default_server = 0xFF;
static unsigned int default_distrib_server = 0;
static unsigned int interrupt_server_size = 8;
@@ -571,8 +571,7 @@ nextnode:
*/
static int __init xics_setup_i8259(void)
{
- if (ppc64_interrupt_controller == IC_PPC_XIC &&
- xics_irq_8259_cascade != -1) {
+ if (xics_irq_8259_cascade != -1) {
if (request_irq(irq_offset_up(xics_irq_8259_cascade),
no_action, 0, "8259 cascade", NULL))
printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 "
--
1.1.4.g0b63-dirty
^ permalink raw reply related
* [PATCH 6/8] Avoid use of ppc64_interrupt_controller.
From: mostrows @ 2006-05-29 20:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
Checking the pSeries_mpic pointer will tell us if we have an MPIC
(and if not we assume XICS).
--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
arch/powerpc/platforms/pseries/setup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
b8d30cee0f0257489bb79c3d36f0afc39b8e63e6
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 38bf976..4ff127b 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -536,7 +536,7 @@ static void pseries_kexec_cpu_down(int c
}
}
- if (ppc64_interrupt_controller == IC_OPEN_PIC)
+ if (pSeries_mpic)
mpic_teardown_this_cpu(secondary);
else
xics_teardown_cpu(secondary);
--
1.1.4.g0b63-dirty
^ permalink raw reply related
* [PATCH 4/8] Avoid use of ppc64_interrupt_controller.
From: mostrows @ 2006-05-29 20:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
Existence of "/platform-open-pic" is asserted by pSeries_setup_mpic if
an mpic interrupt controller exists. Thus pSeries_mpic is non-NULL
only if the opprop value obtained here is good. Hence, no need to
check ppc64_intrerrupt_controller.
--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
arch/powerpc/kernel/rtas_pci.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
3a5eaf5436e0c413e154a933867ff5a09c019e3c
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 57b539a..e1dbd53 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -301,10 +301,8 @@ unsigned long __init find_and_init_phbs(
unsigned int *opprop = NULL;
struct device_node *root = of_find_node_by_path("/");
- if (ppc64_interrupt_controller == IC_OPEN_PIC) {
- opprop = (unsigned int *)get_property(root,
- "platform-open-pic", NULL);
- }
+ /* If pSeries_mpic is non-NULL, it's because opprop is non-0. */
+ opprop = (unsigned int *)get_property(root, "platform-open-pic", NULL);
root_size_cells = prom_n_size_cells(root);
@@ -324,7 +322,7 @@ unsigned long __init find_and_init_phbs(
pci_setup_phb_io(phb, index == 0);
#ifdef CONFIG_PPC_PSERIES
/* XXX This code need serious fixing ... --BenH */
- if (ppc64_interrupt_controller == IC_OPEN_PIC && pSeries_mpic) {
+ if (pSeries_mpic) {
int addr = root_size_cells * (index + 2) - 1;
mpic_assign_isu(pSeries_mpic, index, opprop[addr]);
}
--
1.1.4.g0b63-dirty
^ permalink raw reply related
* [PATCH 5/8] Avoid use of ppc64_interrupt_controller.
From: mostrows @ 2006-05-29 20:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
smp_init_pSeries() will use an XICS, unless it is told to explicitly
use an MPIC.
Checking for built-in support of the detect PIC is now consolidated in
pSeries_setup_arch. (Eventually it should be possible to avoid building
code for a PIC if support for it has not been enabled.)
--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
arch/powerpc/platforms/pseries/setup.c | 28 +++++++++++++++++++++-------
arch/powerpc/platforms/pseries/smp.c | 15 +++------------
include/asm-powerpc/smp.h | 6 +++++-
3 files changed, 29 insertions(+), 20 deletions(-)
c294c06d77fbe3be12a705595ecd95f93054943e
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 33ae521..38bf976 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -153,6 +153,9 @@ static void __init pSeries_setup_mpic(vo
struct device_node *root;
int irq_count;
+ ppc_md.init_IRQ = pSeries_init_mpic;
+ ppc_md.get_irq = mpic_get_irq;
+
/* Find the Open PIC if present */
root = of_find_node_by_path("/");
opprop = (unsigned int *) get_property(root, "platform-open-pic", NULL);
@@ -199,21 +202,32 @@ static void __init pSeries_setup_arch(vo
int int_ctrl = pSeries_discover_pic();
ppc64_interrupt_controller = int_ctrl;
+
/* Fixup ppc_md depending on the type of interrupt controller */
- if (int_ctrl == IC_OPEN_PIC) {
- ppc_md.init_IRQ = pSeries_init_mpic;
- ppc_md.get_irq = mpic_get_irq;
+ switch (int_ctrl) {
+ case IC_OPEN_PIC:
+#ifndef CONFIG_MPIC
+ panic("Kernel not configured for MPIC interrupt controller.");
+#else
/* Allocate the mpic now, so that find_and_init_phbs() can
* fill the ISUs */
pSeries_setup_mpic();
- } else {
+ smp_init_pSeries(1);
+#endif
+ break;
+ case IC_PPC_XIC:
+#ifndef CONFIG_XICS
+ panic("Kernel not configured for XICS interrupt controller.");
+#else
ppc_md.init_IRQ = xics_init_IRQ;
ppc_md.get_irq = xics_get_irq;
+ smp_init_pSeries(0);
+#endif
+ break;
+ default:
+ panic("Invalid interrupt controller");
}
-#ifdef CONFIG_SMP
- smp_init_pSeries();
-#endif
/* openpic global configuration register (64-bit format). */
/* openpic Interrupt Source Unit pointer (64-bit format). */
/* python0 facility area (mmio) (64-bit format) REAL address. */
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 3cf78a6..ef8676f 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -417,25 +417,16 @@ static struct smp_ops_t pSeries_xics_smp
#endif
/* This is called very early */
-void __init smp_init_pSeries(void)
+void __init smp_init_pSeries(int uses_mpic)
{
int i;
DBG(" -> smp_init_pSeries()\n");
- switch (ppc64_interrupt_controller) {
-#ifdef CONFIG_MPIC
- case IC_OPEN_PIC:
+ if (uses_mpic) {
smp_ops = &pSeries_mpic_smp_ops;
- break;
-#endif
-#ifdef CONFIG_XICS
- case IC_PPC_XIC:
+ } else {
smp_ops = &pSeries_xics_smp_ops;
- break;
-#endif
- default:
- panic("Invalid interrupt controller");
}
#ifdef CONFIG_HOTPLUG_CPU
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index 4a716f7..11f1830 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -75,7 +75,7 @@ extern cpumask_t cpu_sibling_map[NR_CPUS
#define PPC_MSG_DEBUGGER_BREAK 3
void smp_init_iSeries(void);
-void smp_init_pSeries(void);
+void smp_init_pSeries(int uses_mpic);
void smp_init_cell(void);
void smp_setup_cpu_maps(void);
@@ -86,6 +86,10 @@ extern void __cpu_die(unsigned int cpu);
/* for UP */
#define smp_setup_cpu_maps()
+#define smp_init_pSeries(uses_mpic) do {} while(0)
+#define smp_init_iSeries() do {} while(0)
+#define smp_init_cell() do {} while(0)
+
#endif /* CONFIG_SMP */
#ifdef CONFIG_PPC64
--
1.1.4.g0b63-dirty
^ permalink raw reply related
* [PATCH 7/8] Cleaner checks for MPIC on pSeries.
From: mostrows @ 2006-05-29 20:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
Instead of checking the pSeries_mpic pointer, use a wrapper
(pSeries_uses_mpic()) that tells us what we want to know.
--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
arch/powerpc/kernel/rtas_pci.c | 2 +-
arch/powerpc/platforms/pseries/setup.c | 2 +-
include/asm-powerpc/mpic.h | 6 ++++++
3 files changed, 8 insertions(+), 2 deletions(-)
082a93566e954ce0cc945b89aced0b28feb7ee60
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index e1dbd53..2a6b729 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -322,7 +322,7 @@ unsigned long __init find_and_init_phbs(
pci_setup_phb_io(phb, index == 0);
#ifdef CONFIG_PPC_PSERIES
/* XXX This code need serious fixing ... --BenH */
- if (pSeries_mpic) {
+ if (pSeries_uses_mpic()) {
int addr = root_size_cells * (index + 2) - 1;
mpic_assign_isu(pSeries_mpic, index, opprop[addr]);
}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 4ff127b..551da6a 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -536,7 +536,7 @@ static void pseries_kexec_cpu_down(int c
}
}
- if (pSeries_mpic)
+ if (pSeries_uses_mpic())
mpic_teardown_this_cpu(secondary);
else
xics_teardown_cpu(secondary);
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index 6b9e781..1f1b2eb 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -287,5 +287,11 @@ extern int mpic_get_irq(struct pt_regs *
/* global mpic for pSeries */
extern struct mpic *pSeries_mpic;
+#ifdef CONFIG_MPIC
+#define pSeries_uses_mpic() (pSeries_mpic != NULL)
+#else
+#define pSeries_uses_mpic() 0
+#endif
+
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_MPIC_H */
--
1.1.4.g0b63-dirty
^ permalink raw reply related
* [PATCH 8/8] Kill the ppc64_interrupt_controller global symbol.
From: mostrows @ 2006-05-29 20:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
--
Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
arch/powerpc/kernel/irq.c | 1 -
arch/powerpc/kernel/setup_64.c | 2 --
arch/powerpc/platforms/cell/setup.c | 2 --
arch/powerpc/platforms/iseries/setup.c | 2 --
arch/powerpc/platforms/maple/setup.c | 3 ---
arch/powerpc/platforms/powermac/setup.c | 3 ---
arch/powerpc/platforms/pseries/setup.c | 15 +++++++++++----
include/asm-powerpc/irq.h | 11 -----------
8 files changed, 11 insertions(+), 28 deletions(-)
5a0403834813838657ce9a3b762203f6479f36fa
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index efcb859..bee60d5 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -89,7 +89,6 @@ extern atomic_t ipi_sent;
EXPORT_SYMBOL(irq_desc);
int distribute_irqs = 1;
-u64 ppc64_interrupt_controller;
#endif /* CONFIG_PPC64 */
int show_interrupts(struct seq_file *p, void *v)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4669179..f791bcc 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -445,8 +445,6 @@ void __init setup_system(void)
printk("-----------------------------------------------------\n");
printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
- printk("ppc64_interrupt_controller = 0x%ld\n",
- ppc64_interrupt_controller);
printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size());
printk("ppc64_caches.dcache_line_size = 0x%x\n",
ppc64_caches.dline_size);
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 6574b22..e1cf54e 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -117,8 +117,6 @@ static void __init cell_init_early(void)
cell_init_iommu();
- ppc64_interrupt_controller = IC_CELL_PIC;
-
DBG(" <- cell_init_early()\n");
}
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 6a7d04b..ca623c5 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -303,8 +303,6 @@ static void __init iSeries_init_early(vo
{
DBG(" -> iSeries_init_early()\n");
- ppc64_interrupt_controller = IC_ISERIES;
-
#if defined(CONFIG_BLK_DEV_INITRD)
/*
* If the init RAM disk has been configured and there is
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 24c0aef..592972c 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -204,9 +204,6 @@ static void __init maple_init_early(void
*/
hpte_init_native();
- /* Setup interrupt mapping options */
- ppc64_interrupt_controller = IC_OPEN_PIC;
-
iommu_init_early_dart();
DBG(" <- maple_init_early\n");
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 4d15e39..2b2dc75 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -609,9 +609,6 @@ static void __init pmac_init_early(void)
udbg_adb_init(!!strstr(cmd_line, "btextdbg"));
#ifdef CONFIG_PPC64
- /* Setup interrupt mapping options */
- ppc64_interrupt_controller = IC_OPEN_PIC;
-
iommu_init_early_dart();
#endif
}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 551da6a..a85b810 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -83,7 +83,15 @@ int fwnmi_active; /* TRUE if an FWNMI h
static void pseries_shared_idle_sleep(void);
static void pseries_dedicated_idle_sleep(void);
-static int pSeries_discover_pic(void);
+
+/*
+ * List of interrupt controller identifiers; possible return values from
+ * pSeries_discover_pic().
+ */
+#define IC_INVALID 0
+#define IC_OPEN_PIC 1
+#define IC_PPC_XIC 2
+static int pSeries_discover_pic(void);
struct mpic *pSeries_mpic;
@@ -200,9 +208,7 @@ static void pseries_lpar_enable_pmcs(voi
static void __init pSeries_setup_arch(void)
{
int int_ctrl = pSeries_discover_pic();
- ppc64_interrupt_controller = int_ctrl;
-
/* Fixup ppc_md depending on the type of interrupt controller */
switch (int_ctrl) {
case IC_OPEN_PIC:
@@ -279,7 +285,8 @@ static int __init pSeries_init_panel(voi
}
arch_initcall(pSeries_init_panel);
-static int __init pSeries_discover_pic(void)
+
+static int __init pSeries_discover_pic(void)
{
struct device_node *np;
char *typep;
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index f2adbc0..66cfeab 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -88,17 +88,6 @@ static inline unsigned int virt_irq_to_r
extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq);
-/*
- * List of interrupt controllers.
- */
-#define IC_INVALID 0
-#define IC_OPEN_PIC 1
-#define IC_PPC_XIC 2
-#define IC_CELL_PIC 3
-#define IC_ISERIES 4
-
-extern u64 ppc64_interrupt_controller;
-
#else /* 32-bit */
#if defined(CONFIG_40x)
--
1.1.4.g0b63-dirty
^ permalink raw reply related
* Re: [PATCH 7/8] Cleaner checks for MPIC on pSeries.
From: Olof Johansson @ 2006-05-29 20:50 UTC (permalink / raw)
To: mostrows; +Cc: linuxppc-dev
In-Reply-To: <11489353263834-git-send-email-mostrows@watson.ibm.com>
On Mon, May 29, 2006 at 04:42:06PM -0400, mostrows@watson.ibm.com wrote:
> Instead of checking the pSeries_mpic pointer, use a wrapper
> (pSeries_uses_mpic()) that tells us what we want to know.
You might as well kill the SillyCaps while you're at it.
-Olof
> --
> Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
>
> ---
>
> arch/powerpc/kernel/rtas_pci.c | 2 +-
> arch/powerpc/platforms/pseries/setup.c | 2 +-
> include/asm-powerpc/mpic.h | 6 ++++++
> 3 files changed, 8 insertions(+), 2 deletions(-)
>
> 082a93566e954ce0cc945b89aced0b28feb7ee60
> diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
> index e1dbd53..2a6b729 100644
> --- a/arch/powerpc/kernel/rtas_pci.c
> +++ b/arch/powerpc/kernel/rtas_pci.c
> @@ -322,7 +322,7 @@ unsigned long __init find_and_init_phbs(
> pci_setup_phb_io(phb, index == 0);
> #ifdef CONFIG_PPC_PSERIES
> /* XXX This code need serious fixing ... --BenH */
> - if (pSeries_mpic) {
> + if (pSeries_uses_mpic()) {
> int addr = root_size_cells * (index + 2) - 1;
> mpic_assign_isu(pSeries_mpic, index, opprop[addr]);
> }
> diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
> index 4ff127b..551da6a 100644
> --- a/arch/powerpc/platforms/pseries/setup.c
> +++ b/arch/powerpc/platforms/pseries/setup.c
> @@ -536,7 +536,7 @@ static void pseries_kexec_cpu_down(int c
> }
> }
>
> - if (pSeries_mpic)
> + if (pSeries_uses_mpic())
> mpic_teardown_this_cpu(secondary);
> else
> xics_teardown_cpu(secondary);
> diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
> index 6b9e781..1f1b2eb 100644
> --- a/include/asm-powerpc/mpic.h
> +++ b/include/asm-powerpc/mpic.h
> @@ -287,5 +287,11 @@ extern int mpic_get_irq(struct pt_regs *
> /* global mpic for pSeries */
> extern struct mpic *pSeries_mpic;
>
> +#ifdef CONFIG_MPIC
> +#define pSeries_uses_mpic() (pSeries_mpic != NULL)
> +#else
> +#define pSeries_uses_mpic() 0
> +#endif
> +
> #endif /* __KERNEL__ */
> #endif /* _ASM_POWERPC_MPIC_H */
> --
> 1.1.4.g0b63-dirty
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [RFC/PATCH 0/8] Overhaul of virt IRQ configuration. / Kill ppc64_interrupt_controller.
From: Benjamin Herrenschmidt @ 2006-05-29 21:28 UTC (permalink / raw)
To: Michal Ostrowski; +Cc: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
On Mon, 2006-05-29 at 16:41 -0400, Michal Ostrowski wrote:
> The following set of patches is aimed at killing the
> ppc64_interrupt_controller global variable, and similarly that various
> global variables used to tweak the parameters of virtual IRQ re-mapping.
> Instead each platform can use a single function to configure IRQ
> re-mapping in "init_early()".
.../...
Hi ! Interesting.. I've start looking at reworking that with a slightly
different approach though...
We need irq controller instances (which we get from the genirq patch
from Ingo & Thomas Gleixner), and we decided that interrupt controller
nodes are mandatory in the device-tree thus we can do something like:
- Each interrupt controller instance, when allocated, requests a certain
number of interrupts and gets that allocated (gets an offset allocated).
It can locally use the virtual irq remapping too, I'm still toying with
the best way to deal with that. This interrupt controller structure is
associated to the device-node of the controller (or the root node of the
tree if no controller node is found)
- Interrupt 0..15 are reserved. 0 is always invalid. Only ISA PICs that
carry legacy devices can request those (by passing a special flag to the
allocation routine). Any other gets remapped (including powermac MPICs).
That will avoid endless problems that we never properly solved with
legacy drivers and the fact that Linus decided that 0 should be the
invalid interrupt number on all platforms
- Provide in prom_parse.c functions for obtaining the PIC node and
local interrupt number of a given device based on a passed-in array
matching the semantics of an "interrupts" property and a parent node.
Along with a helper that may just take a child node. The former is
needed for PCI devices that have no device node. Provide a
pci_ppc_map_interrupt() that takes a pci_dev and does the interrupt
mapping, either by using the standard OF approach if a device-node is
present, or walking up the PCI tree while doing standard swizzling until
it reaches a device node
- Mapping from a virtual number to a local number can be done by a
helper that does the offset and possible virq mapping if requested by
the controller. Same goes with inverse mapping. Mapping is done locally
by the controller code using that helper.
Ben.
^ permalink raw reply
* Re: [RFC/PATCH 0/8] Overhaul of virt IRQ configuration. / Kill ppc64_interrupt_controller.
From: Paul Mackerras @ 2006-05-29 21:56 UTC (permalink / raw)
To: Michal Ostrowski; +Cc: linuxppc-dev
In-Reply-To: <1148935262.25048.31.camel@brick>
Michal Ostrowski writes:
> Platforms can choose the default configuration (which is to
> say identity mappings of IRQ vectors 0..511) or specify their own
> configuration: an offset (for ISA vectors), the range that is to be
Given that the decree has come down from on high that irq 0 is always
to mean "none" or "no IRQ", I have been thinking that we should use
the ISA offset everywhere, even on machines without any ISA hardware.
Paul.
^ permalink raw reply
* Re: [Done] Re: snd-aoa: Sound gone after snd-aoa updates, on PB5,8
From: Wolfgang Pfeiffer @ 2006-05-29 22:17 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Johannes Berg
In-Reply-To: <1148869725.3918.12.camel@localhost.localdomain>
Hi All
Sorry for responding a bit late: I had to leave the house today ...
On Mon, May 29, 2006 at 12:28:45PM +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2006-05-29 at 04:17 +0200, Wolfgang Pfeiffer wrote:
> > On Mon, May 29, 2006 at 04:00:27AM +0200, Wolfgang Pfeiffer wrote:
> > >
> > > Hi
> > >
> > > After some updates from http://johannes.sipsolutions.net/snd-aoa.git/
> > > in the last few hours/minutes sound's gone here. Without changing
> > > sound settings intentionally here.
> > >
> > >
> >
> > On Debian/unstable:
> > After downgrading libasound2 from 1.0.11-6 to 1.0.11-3 I have sound
> > again: 1.0.11-6 was, IINM, installed a few hours ago, which
> > - as it seems - broke sound here.
>
> Have you tested that it wasn't just the renaming/re-ordering of some
> controls ? Alsa is pretty bad with that, you may just have to go back to
> alsamixer and reset some controls after updating the driver.
That's what I tried after reading your mail:
$ apt-cache policy libasound2
libasound2:
Installed: 1.0.11-6
Candidate: 1.0.11-6
The problem is: with libasound2 1.0.11-6 I cannot even *start*
alsamixer:
------------------------
$ alsamixer
ALSA lib control.c:816:(snd_ctl_open_noupdate) Invalid CTL default
alsamixer: function snd_ctl_open failed for default: No such file or directory
-------------------------
----------------------------
$ alsamixer -c 0
ALSA lib control.c:816:(snd_ctl_open_noupdate) Invalid CTL hw:0
alsamixer: function snd_ctl_open failed for hw:0: No such file or directory
---------------------------
amixer:
------------------------
$ amixer -dD controls
ALSA lib control.c:816:(snd_ctl_open_noupdate) Invalid CTL controls
amixer: Mixer attach controls error: No such file or directory
---------------------------
But the last 2 examples may hint amixer at least sees some sound card:
---------------
$ amixer -c 1 controls
Invalid card number.
Usage: amixer <options> [command]
Available options:
[ ... ]
---------------------
-------------------
$ amixer -c 0 controls
ALSA lib control.c:816:(snd_ctl_open_noupdate) Invalid CTL hw:0
amixer: Control hw:0 open error: No such file or directory
-----------------------
Suggestions? Did I miss something?
Thanks in anticipation
Best Regards
Wolfgang
--
Wolfgang Pfeiffer: /ICQ: 286585973/ + + + /AIM: crashinglinux/
http://profiles.yahoo.com/wolfgangpfeiffer
Key ID: E3037113
http://keyserver.mine.nu/pks/lookup?search=0xE3037113&fingerprint=on
^ permalink raw reply
* Re: [RFC/PATCH 0/8] Overhaul of virt IRQ configuration. / Kill ppc64_interrupt_controller.
From: Michal Ostrowski @ 2006-05-29 23:08 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1148938117.5959.24.camel@localhost.localdomain>
On Tue, 2006-05-30 at 07:28 +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2006-05-29 at 16:41 -0400, Michal Ostrowski wrote:
> > The following set of patches is aimed at killing the
> > ppc64_interrupt_controller global variable, and similarly that various
> > global variables used to tweak the parameters of virtual IRQ re-mapping.
> > Instead each platform can use a single function to configure IRQ
> > re-mapping in "init_early()".
>
> .../...
>
> Hi ! Interesting.. I've start looking at reworking that with a slightly
> different approach though...
>
I'm in total agreement with your assessment of where things should go.
My main motivation here was to kill ppc64_interrupt_controller and to
consolidate our knowledge of the requirements of the different platforms
into a single interface (i.e. virt_irq_config).
As such I see this patch as either a first step, or clean-up along-side,
the changes you're considering.
I did consider at first making more changes than published here; in
particular to address the offsetting issue you and Paul have commented
on.
Current code such as:
virq = virt_irq_create_mapping(irq[0]);
...
np->intrs[intrcount].line = irq_offset_up(virq);
Should be more like:
np->intrs[intrcount].line = virt_irq_create_mapping(irq[0]);
(Where the knowledge regarding all remapping/offsetting is embedded
behind the remapping interfaces. We should kill irq_offset_{up,down}
and replace them with things such as real_irq_to_virt() and
virt_irq_to_real().)
The patches I've sent out were not intended to deal with this, as I
wanted to keep the change set focused and small. However, things similar
to what you've outlined I've been keeping in mind as potential follow-on
work; and I had intended these patches to facilitate that.
--
Michal Ostrowski <mostrows@watson.ibm.com>
^ 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