* [PATCH] scsi: Fix bad use of udelay in atp870u.c
@ 2008-09-30 7:39 Martin Michlmayr
0 siblings, 0 replies; 4+ messages in thread
From: Martin Michlmayr @ 2008-09-30 7:39 UTC (permalink / raw)
To: linux-scsi
The ACARD driver calls udelay() with a value > 2000, which leads to
to the following compilation error on ARM:
ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined!
make[1]: *** [__modpost] Error 1
Fix this by using a combination of mdelay and udelay.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -1171,7 +1171,8 @@ wait_io1:
outw(val, tmport);
outb(2, 0x80);
TCM_SYNC:
- udelay(0x800);
+ mdelay(2);
+ udelay(48);
if ((inb(tmport) & 0x80) == 0x00) { /* bsy ? */
outw(0, tmport--);
outb(0, tmport);
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] scsi: Fix bad use of udelay in atp870u.c
@ 2008-10-16 8:21 Martin Michlmayr
2008-10-16 22:51 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Martin Michlmayr @ 2008-10-16 8:21 UTC (permalink / raw)
To: linux-scsi; +Cc: james.bottomley, akpm
The ACARD driver calls udelay() with a value > 2000, which leads to
to the following compilation error on ARM:
ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined!
make[1]: *** [__modpost] Error 1
Fix this by using a combination of mdelay and udelay.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -1171,7 +1171,8 @@ wait_io1:
outw(val, tmport);
outb(2, 0x80);
TCM_SYNC:
- udelay(0x800);
+ mdelay(2);
+ udelay(48);
if ((inb(tmport) & 0x80) == 0x00) { /* bsy ? */
outw(0, tmport--);
outb(0, tmport);
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: Fix bad use of udelay in atp870u.c
2008-10-16 8:21 [PATCH] scsi: Fix bad use of udelay in atp870u.c Martin Michlmayr
@ 2008-10-16 22:51 ` Andrew Morton
2008-10-17 5:48 ` Martin Michlmayr
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2008-10-16 22:51 UTC (permalink / raw)
To: Martin Michlmayr; +Cc: linux-scsi, james.bottomley, linux-arm-kernel
On Thu, 16 Oct 2008 10:21:46 +0200
Martin Michlmayr <tbm@cyrius.com> wrote:
> The ACARD driver calls udelay() with a value > 2000, which leads to
> to the following compilation error on ARM:
> ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined!
> make[1]: *** [__modpost] Error 1
> Fix this by using a combination of mdelay and udelay.
>
> Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
>
> --- a/drivers/scsi/atp870u.c
> +++ b/drivers/scsi/atp870u.c
> @@ -1171,7 +1171,8 @@ wait_io1:
> outw(val, tmport);
> outb(2, 0x80);
> TCM_SYNC:
> - udelay(0x800);
> + mdelay(2);
> + udelay(48);
> if ((inb(tmport) & 0x80) == 0x00) { /* bsy ? */
> outw(0, tmport--);
> outb(0, tmport);
>
hum. The code has been like that for many years - why was the
error only discovered now. Is that check in arm new?
If so, was it present in 2.6.27?
If so, does anyone actually use this driver on arm?
If so, we'll need this patch in 2.6.27.x as well.
?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: Fix bad use of udelay in atp870u.c
2008-10-16 22:51 ` Andrew Morton
@ 2008-10-17 5:48 ` Martin Michlmayr
0 siblings, 0 replies; 4+ messages in thread
From: Martin Michlmayr @ 2008-10-17 5:48 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-scsi, james.bottomley, linux-arm-kernel
* Andrew Morton <akpm@linux-foundation.org> [2008-10-16 15:51]:
> > + mdelay(2);
> > + udelay(48);
> > if ((inb(tmport) & 0x80) == 0x00) { /* bsy ? */
> > outw(0, tmport--);
> > outb(0, tmport);
> >
>
> hum. The code has been like that for many years - why was the
> error only discovered now. Is that check in arm new?
I don't think so. I cannot remember for sure, but I probably ran into
it when we started moving the Debian ARM kernels from a config file
that only selected a limited number of modules to a more generic
config file that enables as much as possible. I don't think anyone
cares about this one driver in particular, but it's hard to know which
modules users need, so we enable everything we can.
Anyway, we've carried a patch around since December 2007 that disables
this module on ARM because of this compilation error, but I'd like to
get this resolved in the mainline kernel.
> If so, was it present in 2.6.27?
> If so, does anyone actually use this driver on arm?
> If so, we'll need this patch in 2.6.27.x as well.
Nah, fixing it for 2.6.28 would be fine.
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-10-17 5:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-16 8:21 [PATCH] scsi: Fix bad use of udelay in atp870u.c Martin Michlmayr
2008-10-16 22:51 ` Andrew Morton
2008-10-17 5:48 ` Martin Michlmayr
-- strict thread matches above, loose matches on Subject: below --
2008-09-30 7:39 Martin Michlmayr
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.