linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/16] ps3: system bus minor mmio fix
@ 2007-01-27  3:07 Geoff Levand
  2007-01-27 20:06 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Geoff Levand @ 2007-01-27  3:07 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Fix two minor bugs in the PS3 system bus mmio region code.  First, on error or
when freeing a region, retain the bus_addr and len fields to allow subsequent
calls to create the region.  Second, correct the region address argument to the
lv1_unmap_device_mmio_region() call.

Fixes modprobe/rmmod of some drivers.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>

---
 drivers/ps3/system-bus.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

--- ps3-linux-dev.orig/drivers/ps3/system-bus.c
+++ ps3-linux-dev/drivers/ps3/system-bus.c
@@ -50,7 +50,7 @@ int ps3_mmio_region_create(struct ps3_mm
 	if (result) {
 		pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n",
 			__func__, __LINE__, ps3_result(result));
-		r->lpar_addr = r->len = r->bus_addr = 0;
+		r->lpar_addr = 0;
 	}
 
 	dump_mmio_region(r);
@@ -62,13 +62,13 @@ int ps3_free_mmio_region(struct ps3_mmio
 	int result;
 
 	result = lv1_unmap_device_mmio_region(r->did.bus_id, r->did.dev_id,
-		r->bus_addr);
+		r->lpar_addr);
 
 	if (result)
 		pr_debug("%s:%d: lv1_unmap_device_mmio_region failed: %s\n",
 			__func__, __LINE__, ps3_result(result));
 
-	r->lpar_addr = r->len = r->bus_addr = 0;
+	r->lpar_addr = 0;
 	return result;
 }
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/16] ps3: system bus minor mmio fix
  2007-01-27  3:07 [PATCH 4/16] ps3: system bus minor mmio fix Geoff Levand
@ 2007-01-27 20:06 ` Benjamin Herrenschmidt
  2007-01-28  8:42   ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-27 20:06 UTC (permalink / raw)
  To: Geoff Levand; +Cc: linuxppc-dev, Paul Mackerras

On Fri, 2007-01-26 at 19:07 -0800, Geoff Levand wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> Fix two minor bugs in the PS3 system bus mmio region code.  First, on error or
> when freeing a region, retain the bus_addr and len fields to allow subsequent
> calls to create the region.  Second, correct the region address argument to the
> lv1_unmap_device_mmio_region() call.

Note that I personally think that drivers/ps3 is a very wrong place for
the ps3 system bus. It should stay in arch/powerpc/platform/ps3

Ben.

> Fixes modprobe/rmmod of some drivers.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
> Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
> 
> ---
>  drivers/ps3/system-bus.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> --- ps3-linux-dev.orig/drivers/ps3/system-bus.c
> +++ ps3-linux-dev/drivers/ps3/system-bus.c
> @@ -50,7 +50,7 @@ int ps3_mmio_region_create(struct ps3_mm
>  	if (result) {
>  		pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n",
>  			__func__, __LINE__, ps3_result(result));
> -		r->lpar_addr = r->len = r->bus_addr = 0;
> +		r->lpar_addr = 0;
>  	}
>  
>  	dump_mmio_region(r);
> @@ -62,13 +62,13 @@ int ps3_free_mmio_region(struct ps3_mmio
>  	int result;
>  
>  	result = lv1_unmap_device_mmio_region(r->did.bus_id, r->did.dev_id,
> -		r->bus_addr);
> +		r->lpar_addr);
>  
>  	if (result)
>  		pr_debug("%s:%d: lv1_unmap_device_mmio_region failed: %s\n",
>  			__func__, __LINE__, ps3_result(result));
>  
> -	r->lpar_addr = r->len = r->bus_addr = 0;
> +	r->lpar_addr = 0;
>  	return result;
>  }
>  
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/16] ps3: system bus minor mmio fix
  2007-01-27 20:06 ` Benjamin Herrenschmidt
@ 2007-01-28  8:42   ` Christoph Hellwig
  2007-01-29 19:32     ` Geoff Levand
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2007-01-28  8:42 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras

On Sun, Jan 28, 2007 at 07:06:57AM +1100, Benjamin Herrenschmidt wrote:
> On Fri, 2007-01-26 at 19:07 -0800, Geoff Levand wrote:
> > From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > 
> > Fix two minor bugs in the PS3 system bus mmio region code.  First, on error or
> > when freeing a region, retain the bus_addr and len fields to allow subsequent
> > calls to create the region.  Second, correct the region address argument to the
> > lv1_unmap_device_mmio_region() call.
> 
> Note that I personally think that drivers/ps3 is a very wrong place for
> the ps3 system bus. It should stay in arch/powerpc/platform/ps3

Yes, absolutely.  We should not spreads things all over the tree do
make understanding the code even more difficult than all the lv1
braindamage already makes it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/16] ps3: system bus minor mmio fix
  2007-01-28  8:42   ` Christoph Hellwig
@ 2007-01-29 19:32     ` Geoff Levand
  2007-01-29 20:16       ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Geoff Levand @ 2007-01-29 19:32 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Paul Mackerras, linuxppc-dev

Christoph Hellwig wrote:
> On Sun, Jan 28, 2007 at 07:06:57AM +1100, Benjamin Herrenschmidt wrote:
>> Note that I personally think that drivers/ps3 is a very wrong place for
>> the ps3 system bus. It should stay in arch/powerpc/platform/ps3
> 
> Yes, absolutely.  We should not spreads things all over the tree do
> make understanding the code even more difficult than all the lv1
> braindamage already makes it.

I'm really disappointed that you both feel that way.  Why didn't you say so several
months ago when I first posted that?  I also don't think it is a good place, since
I need to expose a bunch of platform specifics in asm-powerpc/ps3.h, which would
better stay in my platform/ps3/platform.h.  When I had that stuff in the platform
directory there was criticism that it shouldn't go there, so I moved it out.  I'll
make a patch for RFC and see what happens.

-Geoff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/16] ps3: system bus minor mmio fix
  2007-01-29 19:32     ` Geoff Levand
@ 2007-01-29 20:16       ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-29 20:16 UTC (permalink / raw)
  To: Geoff Levand; +Cc: linuxppc-dev, Paul Mackerras

On Mon, 2007-01-29 at 11:32 -0800, Geoff Levand wrote:
> Christoph Hellwig wrote:
> > On Sun, Jan 28, 2007 at 07:06:57AM +1100, Benjamin Herrenschmidt wrote:
> >> Note that I personally think that drivers/ps3 is a very wrong place for
> >> the ps3 system bus. It should stay in arch/powerpc/platform/ps3
> > 
> > Yes, absolutely.  We should not spreads things all over the tree do
> > make understanding the code even more difficult than all the lv1
> > braindamage already makes it.
> 
> I'm really disappointed that you both feel that way.  Why didn't you say so several
> months ago when I first posted that?  

I overlooked it. It's not the end of the world, easy enough to move
them. Sorry about that.

> I also don't think it is a good place, since
> I need to expose a bunch of platform specifics in asm-powerpc/ps3.h, which would
> better stay in my platform/ps3/platform.h.  When I had that stuff in the platform
> directory there was criticism that it shouldn't go there, so I moved it out.  I'll
> make a patch for RFC and see what happens.

Ben.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-29 20:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-27  3:07 [PATCH 4/16] ps3: system bus minor mmio fix Geoff Levand
2007-01-27 20:06 ` Benjamin Herrenschmidt
2007-01-28  8:42   ` Christoph Hellwig
2007-01-29 19:32     ` Geoff Levand
2007-01-29 20:16       ` 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).