diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2007-05-01 22:32:59 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 17:59:07 -0700 |
commit | d95fd5fce88f05fd36004f2a0c317e665549e54c (patch) | |
tree | aa154c94a232800e913dd6bf5cca02cca7d2d434 /arch/m68k | |
parent | 217f6710c275118af1008bb1447d244be52d2dc3 (diff) | |
download | linux-d95fd5fce88f05fd36004f2a0c317e665549e54c.tar.gz linux-d95fd5fce88f05fd36004f2a0c317e665549e54c.tar.bz2 linux-d95fd5fce88f05fd36004f2a0c317e665549e54c.zip |
m68k: Mac II ADB fixes
Fix a crash caused by requests placed in the queue with the completed flag
already set. This lead to some ADB_SYNC requests returning early and their
request structs being popped off the stack while still queued. Stack corruption
ensued or an invalid request callback pointer was invoked or both. Eliminate
macii_retransmit() and its buggy implementation of macii_write(). Have
macii_queue_poll() fully initialise the request queues.
Fix a bug in macii_queue_poll() where the last_req pointer was not being set.
This caused some requests to leave the queue before being completed (and would
also corrupt the stack under certain conditions).
Fix a race in macii_start that could set the state machine to "reading" while
current_req was null.
No longer send poll commands with the ADBREQ_REPLY flag -- doing that caused
the replies to be stored in the request buffer where they were forgotten
about.
Don't autopoll by continuously sending new Talk commands. Get the controller to
do that for us. This reduces the ADB interrupt rate on an idle bus to about 5
per second. Only autopoll the devices that were probed.
Explicitly clear the interrupt flag when polling.
Use disable_irq rather than local_irq_save when polling.
Remove excess local_irq_save/restore pairs.
Improve bus timeout and service request detection.
Remove unused code (last_reply, adb_dir etc) and unneeded code (prefix_len,
first_byte etc).
Change TIP and TACK to their correct names on this ADB controller (ST_EVEN and
ST_ODD).
Add some commentry.
Add a generous quantity of sanity checks (BUG_ONs).
Let m68k macs use the adb_sync boot param too.
Tested on Mac II, Mac IIci, Quadra 650, Quadra 700 etc.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/kernel/setup.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index 9b307a5f4f22..610319356691 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -513,3 +513,13 @@ void check_bugs(void) } #endif /* !CONFIG_M68KFPU_EMU */ } + +#ifdef CONFIG_ADB +static int __init adb_probe_sync_enable (char *str) { + extern int __adb_probe_sync; + __adb_probe_sync = 1; + return 1; +} + +__setup("adb_sync", adb_probe_sync_enable); +#endif /* CONFIG_ADB */ |