* [PATCH 9/14] ps3: add interrupt alloc for outlets
@ 2007-01-25 2:40 Geoff Levand
2007-01-25 3:55 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 5+ messages in thread
From: Geoff Levand @ 2007-01-25 2:40 UTC (permalink / raw)
To: paulus; +Cc: Geert Uytterhoeven, linuxppc-dev
From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
PS3 interrupt core update:
- Add ps3_alloc_irq() and ps3_free_irq(), to allocate a virtual interrupt
number for an interrupt outlet, which is needed by the PS3 GPU frame
buffer device and audio drivers
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
arch/powerpc/platforms/ps3/interrupt.c | 12 ++++++++++++
include/asm-powerpc/ps3.h | 3 +++
2 files changed, 15 insertions(+)
--- ps3-linux-dev.orig/arch/powerpc/platforms/ps3/interrupt.c
+++ ps3-linux-dev/arch/powerpc/platforms/ps3/interrupt.c
@@ -412,6 +412,18 @@ int ps3_free_spe_irq(unsigned int virq)
return 0;
}
+int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet,
+ unsigned int *virq)
+{
+ return ps3_connect_irq(cpu, outlet, virq);
+}
+
+int ps3_free_irq(unsigned int virq)
+{
+ ps3_disconnect_irq(virq);
+ return 0;
+}
+
#define PS3_INVALID_OUTLET ((irq_hw_number_t)-1)
#define PS3_PLUG_MAX 63
--- ps3-linux-dev.orig/include/asm-powerpc/ps3.h
+++ ps3-linux-dev/include/asm-powerpc/ps3.h
@@ -163,6 +163,9 @@ int ps3_free_vuart_irq(unsigned int virq
int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id,
unsigned int class, unsigned int *virq);
int ps3_free_spe_irq(unsigned int virq);
+int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet,
+ unsigned int *virq);
+int ps3_free_irq(unsigned int virq);
/* lv1 result codes */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 9/14] ps3: add interrupt alloc for outlets
2007-01-25 2:40 [PATCH 9/14] ps3: add interrupt alloc for outlets Geoff Levand
@ 2007-01-25 3:55 ` Benjamin Herrenschmidt
2007-01-25 13:41 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-25 3:55 UTC (permalink / raw)
To: Geoff Levand; +Cc: Geert Uytterhoeven, linuxppc-dev, paulus
> +int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet,
> + unsigned int *virq)
> +{
> + return ps3_connect_irq(cpu, outlet, virq);
> +}
> +
> +int ps3_free_irq(unsigned int virq)
> +{
> + ps3_disconnect_irq(virq);
> + return 0;
> +}
> +
> #define PS3_INVALID_OUTLET ((irq_hw_number_t)-1)
> #define PS3_PLUG_MAX 63
I'm not too fan of this... those 2 functions do strictly -nothing- other
than export the ones they call (not even changing arguments).
So why not export ps3_connect_irq / ps3_disconnect_irq directly ?
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 9/14] ps3: add interrupt alloc for outlets
2007-01-25 3:55 ` Benjamin Herrenschmidt
@ 2007-01-25 13:41 ` Geert Uytterhoeven
2007-01-25 23:56 ` Geoff Levand
2007-01-26 2:48 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2007-01-25 13:41 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, paulus
On Thu, 25 Jan 2007, Benjamin Herrenschmidt wrote:
> > +int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet,
> > + unsigned int *virq)
> > +{
> > + return ps3_connect_irq(cpu, outlet, virq);
> > +}
> > +
> > +int ps3_free_irq(unsigned int virq)
> > +{
> > + ps3_disconnect_irq(virq);
> > + return 0;
> > +}
> > +
> > #define PS3_INVALID_OUTLET ((irq_hw_number_t)-1)
> > #define PS3_PLUG_MAX 63
>
> I'm not too fan of this... those 2 functions do strictly -nothing- other
> than export the ones they call (not even changing arguments).
>
> So why not export ps3_connect_irq / ps3_disconnect_irq directly ?
You're right. Originally they were all but trivial wrappers, but the recent
interrupt improvements have changed this.
Do you have a preference which names to keep?
1. ps3_connect_irq() and ps3_disconnect_irq() resemble the LV1 calls they
make,
2. ps3_alloc_irq() and ps3_free_irq() resemble the other
ps3_{alloc,free}_*_irq() names.
Personally I favor the latter.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 9/14] ps3: add interrupt alloc for outlets
2007-01-25 13:41 ` Geert Uytterhoeven
@ 2007-01-25 23:56 ` Geoff Levand
2007-01-26 2:48 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 5+ messages in thread
From: Geoff Levand @ 2007-01-25 23:56 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: paulus, linuxppc-dev
Geert Uytterhoeven wrote:
> On Thu, 25 Jan 2007, Benjamin Herrenschmidt wrote:
>> > +int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet,
>> > + unsigned int *virq)
>> > +{
>> > + return ps3_connect_irq(cpu, outlet, virq);
>> > +}
>> > +
>> > +int ps3_free_irq(unsigned int virq)
>> > +{
>> > + ps3_disconnect_irq(virq);
>> > + return 0;
>> > +}
>> > +
>> > #define PS3_INVALID_OUTLET ((irq_hw_number_t)-1)
>> > #define PS3_PLUG_MAX 63
>>
>> I'm not too fan of this... those 2 functions do strictly -nothing- other
>> than export the ones they call (not even changing arguments).
>>
>> So why not export ps3_connect_irq / ps3_disconnect_irq directly ?
>
> You're right. Originally they were all but trivial wrappers, but the recent
> interrupt improvements have changed this.
>
> Do you have a preference which names to keep?
>
> 1. ps3_connect_irq() and ps3_disconnect_irq() resemble the LV1 calls they
> make,
> 2. ps3_alloc_irq() and ps3_free_irq() resemble the other
> ps3_{alloc,free}_*_irq() names.
I think ps3_connect_irq() and ps3_disconnect_irq() are not consistent with
the existing routines, so I would perfer not to use those. I'll post a new
patch that makes this change.
-Geoff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 9/14] ps3: add interrupt alloc for outlets
2007-01-25 13:41 ` Geert Uytterhoeven
2007-01-25 23:56 ` Geoff Levand
@ 2007-01-26 2:48 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-26 2:48 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linuxppc-dev, paulus
> Do you have a preference which names to keep?
>
> 1. ps3_connect_irq() and ps3_disconnect_irq() resemble the LV1 calls they
> make,
> 2. ps3_alloc_irq() and ps3_free_irq() resemble the other
> ps3_{alloc,free}_*_irq() names.
>
> Personally I favor the latter.
Well, I think connect is a better illustration of the semantic. They
don't only alloc/free, since also connect. I think alloc/free is
actually confusing. Or maybe ps3_alloc_and_connect_irq() :-)
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-01-26 2:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 2:40 [PATCH 9/14] ps3: add interrupt alloc for outlets Geoff Levand
2007-01-25 3:55 ` Benjamin Herrenschmidt
2007-01-25 13:41 ` Geert Uytterhoeven
2007-01-25 23:56 ` Geoff Levand
2007-01-26 2:48 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).