* [PATCH] [MMC] Fix base address configuration in wbsd
@ 2006-08-06 20:22 Pierre Ossman
2006-08-06 20:48 ` Russell King
0 siblings, 1 reply; 11+ messages in thread
From: Pierre Ossman @ 2006-08-06 20:22 UTC (permalink / raw)
To: rmk+lkml; +Cc: Pierre Ossman, linux-kernel
There were some confusion about base I/O variables in the wbsd driver.
Seems like things have been working on shear luck so far. The global 'io'
variable (used when manually configuring the resources) was used instead of
the local 'base' variable.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
---
drivers/mmc/wbsd.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c
index 8a30ef3..ce86887 100644
--- a/drivers/mmc/wbsd.c
+++ b/drivers/mmc/wbsd.c
@@ -41,7 +41,7 @@ #include <asm/scatterlist.h>
#include "wbsd.h"
#define DRIVER_NAME "wbsd"
-#define DRIVER_VERSION "1.5"
+#define DRIVER_VERSION "1.6"
#define DBG(x...) \
pr_debug(DRIVER_NAME ": " x)
@@ -1439,13 +1439,13 @@ static int __devinit wbsd_scan(struct wb
static int __devinit wbsd_request_region(struct wbsd_host *host, int base)
{
- if (io & 0x7)
+ if (base & 0x7)
return -EINVAL;
if (!request_region(base, 8, DRIVER_NAME))
return -EIO;
- host->base = io;
+ host->base = base;
return 0;
}
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH] [MMC] Fix base address configuration in wbsd
2006-08-06 20:22 [PATCH] [MMC] Fix base address configuration in wbsd Pierre Ossman
@ 2006-08-06 20:48 ` Russell King
2006-08-06 20:57 ` Pierre Ossman
0 siblings, 1 reply; 11+ messages in thread
From: Russell King @ 2006-08-06 20:48 UTC (permalink / raw)
To: Pierre Ossman; +Cc: Pierre Ossman, linux-kernel
On Sun, Aug 06, 2006 at 10:22:23PM +0200, Pierre Ossman wrote:
> There were some confusion about base I/O variables in the wbsd driver.
> Seems like things have been working on shear luck so far. The global 'io'
> variable (used when manually configuring the resources) was used instead of
> the local 'base' variable.
Applied, thanks.
Shouldn't "base" be something other than "int" (eg, unsigned long) ?
Also, wbsd_init() takes base, irq, dma but passes wbsd_request_resources
io, irq and dma? I suspect more fixes are on their way... 8)
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] [MMC] Fix base address configuration in wbsd
2006-08-06 20:48 ` Russell King
@ 2006-08-06 20:57 ` Pierre Ossman
2006-08-06 21:05 ` Russell King
2006-08-06 21:13 ` Randy.Dunlap
0 siblings, 2 replies; 11+ messages in thread
From: Pierre Ossman @ 2006-08-06 20:57 UTC (permalink / raw)
To: linux-kernel
Russell King wrote:
> On Sun, Aug 06, 2006 at 10:22:23PM +0200, Pierre Ossman wrote:
>> There were some confusion about base I/O variables in the wbsd driver.
>> Seems like things have been working on shear luck so far. The global 'io'
>> variable (used when manually configuring the resources) was used instead of
>> the local 'base' variable.
>
> Applied, thanks.
>
> Shouldn't "base" be something other than "int" (eg, unsigned long) ?
unsigned short would probably be the right<tm> thing as the resource is
16 bits. I haven't seen it as big enough issue to warrant a patch.
> Also, wbsd_init() takes base, irq, dma but passes wbsd_request_resources
> io, irq and dma? I suspect more fixes are on their way... 8)
*sigh*
And I thought this brown paper bag was just temporary...
Rgds
Pierre
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] [MMC] Fix base address configuration in wbsd
2006-08-06 20:57 ` Pierre Ossman
@ 2006-08-06 21:05 ` Russell King
2006-08-06 21:29 ` Pierre Ossman
2006-08-06 21:13 ` Randy.Dunlap
1 sibling, 1 reply; 11+ messages in thread
From: Russell King @ 2006-08-06 21:05 UTC (permalink / raw)
To: Pierre Ossman; +Cc: linux-kernel
On Sun, Aug 06, 2006 at 10:57:35PM +0200, Pierre Ossman wrote:
> Russell King wrote:
> > On Sun, Aug 06, 2006 at 10:22:23PM +0200, Pierre Ossman wrote:
> >> There were some confusion about base I/O variables in the wbsd driver.
> >> Seems like things have been working on shear luck so far. The global 'io'
> >> variable (used when manually configuring the resources) was used instead of
> >> the local 'base' variable.
> >
> > Applied, thanks.
> >
> > Shouldn't "base" be something other than "int" (eg, unsigned long) ?
>
> unsigned short would probably be the right<tm> thing as the resource is
> 16 bits. I haven't seen it as big enough issue to warrant a patch.
Is that a safe assumption to make? Is this only ever going to appear/be
used on x86?
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] [MMC] Fix base address configuration in wbsd
2006-08-06 21:05 ` Russell King
@ 2006-08-06 21:29 ` Pierre Ossman
2006-08-06 21:35 ` Ben Dooks
0 siblings, 1 reply; 11+ messages in thread
From: Pierre Ossman @ 2006-08-06 21:29 UTC (permalink / raw)
To: linux-kernel
Russell King wrote:
> Is that a safe assumption to make? Is this only ever going to appear/be
> used on x86?
>
>
It's designed for ISA, so I think so. In the event that a version of
this model appears that has a larger I/O base, then the configure
registers will have been reordered (to make room for any extra address
bytes), so the driver will not work out-of-box anyway.
Rgds
Pierre
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] [MMC] Fix base address configuration in wbsd
2006-08-06 21:29 ` Pierre Ossman
@ 2006-08-06 21:35 ` Ben Dooks
2006-08-06 21:52 ` Pierre Ossman
0 siblings, 1 reply; 11+ messages in thread
From: Ben Dooks @ 2006-08-06 21:35 UTC (permalink / raw)
To: Pierre Ossman; +Cc: linux-kernel
On Sun, Aug 06, 2006 at 11:29:49PM +0200, Pierre Ossman wrote:
> Russell King wrote:
> > Is that a safe assumption to make? Is this only ever going to appear/be
> > used on x86?
> >
> >
>
> It's designed for ISA, so I think so. In the event that a version of
> this model appears that has a larger I/O base, then the configure
> registers will have been reordered (to make room for any extra address
> bytes), so the driver will not work out-of-box anyway.
ISA is very easy to glue to the simple IO busses on many
systems such as ARM.
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] [MMC] Fix base address configuration in wbsd
2006-08-06 21:35 ` Ben Dooks
@ 2006-08-06 21:52 ` Pierre Ossman
2006-08-06 23:32 ` Alan Cox
0 siblings, 1 reply; 11+ messages in thread
From: Pierre Ossman @ 2006-08-06 21:52 UTC (permalink / raw)
To: Ben Dooks; +Cc: linux-kernel
Ben Dooks wrote:
> ISA is very easy to glue to the simple IO busses on many
> systems such as ARM.
>
>
Sorry, my intention wasn't to assert that it was only to be used on x86
but that the 16-bit assumption was safe.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] [MMC] Fix base address configuration in wbsd
2006-08-06 21:52 ` Pierre Ossman
@ 2006-08-06 23:32 ` Alan Cox
2006-08-06 23:19 ` Pierre Ossman
0 siblings, 1 reply; 11+ messages in thread
From: Alan Cox @ 2006-08-06 23:32 UTC (permalink / raw)
To: Pierre Ossman; +Cc: Ben Dooks, linux-kernel
Ar Sul, 2006-08-06 am 23:52 +0200, ysgrifennodd Pierre Ossman:
> Sorry, my intention wasn't to assert that it was only to be used on x86
> but that the 16-bit assumption was safe.
Your ISA bus mappings on a non x86 processor are likely to be 32bit MMIO
-> PIO windows in memory space.
Alan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] [MMC] Fix base address configuration in wbsd
2006-08-06 23:32 ` Alan Cox
@ 2006-08-06 23:19 ` Pierre Ossman
0 siblings, 0 replies; 11+ messages in thread
From: Pierre Ossman @ 2006-08-06 23:19 UTC (permalink / raw)
To: Alan Cox; +Cc: Ben Dooks, linux-kernel
Alan Cox wrote:
> Ar Sul, 2006-08-06 am 23:52 +0200, ysgrifennodd Pierre Ossman:
>
>> Sorry, my intention wasn't to assert that it was only to be used on x86
>> but that the 16-bit assumption was safe.
>>
>
> Your ISA bus mappings on a non x86 processor are likely to be 32bit MMIO
> -> PIO windows in memory space.
>
>
Since we configure the device, the PIO address must not be subject to
translation. If it is, then we must know how the translation is done.
As this is a rather crappy chip which nobody in their right mind would
use, we'll cross that bridge when/if someone decides to use it in a
system that doesn't behave like x86.
Rgds
Pierre
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] [MMC] Fix base address configuration in wbsd
2006-08-06 20:57 ` Pierre Ossman
2006-08-06 21:05 ` Russell King
@ 2006-08-06 21:13 ` Randy.Dunlap
2006-08-06 21:30 ` Pierre Ossman
1 sibling, 1 reply; 11+ messages in thread
From: Randy.Dunlap @ 2006-08-06 21:13 UTC (permalink / raw)
To: Pierre Ossman; +Cc: linux-kernel
On Sun, 06 Aug 2006 22:57:35 +0200 Pierre Ossman wrote:
> Russell King wrote:
> > On Sun, Aug 06, 2006 at 10:22:23PM +0200, Pierre Ossman wrote:
> >> There were some confusion about base I/O variables in the wbsd driver.
> >> Seems like things have been working on shear luck so far. The global 'io'
> >> variable (used when manually configuring the resources) was used instead of
> >> the local 'base' variable.
> >
> > Applied, thanks.
> >
> > Shouldn't "base" be something other than "int" (eg, unsigned long) ?
>
> unsigned short would probably be the right<tm> thing as the resource is
> 16 bits. I haven't seen it as big enough issue to warrant a patch.
and why not <resource_size_t> ?
> > Also, wbsd_init() takes base, irq, dma but passes wbsd_request_resources
> > io, irq and dma? I suspect more fixes are on their way... 8)
>
> *sigh*
>
> And I thought this brown paper bag was just temporary...
---
~Randy
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-08-06 23:19 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-06 20:22 [PATCH] [MMC] Fix base address configuration in wbsd Pierre Ossman
2006-08-06 20:48 ` Russell King
2006-08-06 20:57 ` Pierre Ossman
2006-08-06 21:05 ` Russell King
2006-08-06 21:29 ` Pierre Ossman
2006-08-06 21:35 ` Ben Dooks
2006-08-06 21:52 ` Pierre Ossman
2006-08-06 23:32 ` Alan Cox
2006-08-06 23:19 ` Pierre Ossman
2006-08-06 21:13 ` Randy.Dunlap
2006-08-06 21:30 ` Pierre Ossman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox