kernel-ark/sound/isa/sb
David Flater 1338fc97d0 ALSA: emu8000: fix emu8000 DRAM sized 512 KiB too small
v2:  Fixed result still wrong in the case of 512 KiB DRAM.  Oops.

Applicable to 3.5.3 mainline.

In emu8000.c, size_dram determines the amount of memory on the sound card by
doing write/readback tests starting at 512 KiB and incrementing by 512 KiB.
On success, detected_size is updated to the successful address and testing
continues.  On failure, the loop is immediately exited.  The resulting
detected_size is 512 KiB too small except in two special cases:

1. If there is no memory, the initial 0 value of detected_size is used, which
   is correct.
2. If the address space wraps around, detected_size is updated before the
   bailout, so the result is correct.

The patch corrects all cases and was tested with an AWE64 Gold.  Before:
  EMU8000 [0x620]: 3584 Kb on-board memory detected
  asfxload 4GMGSMT.SF2 (4174814 B) fails.
After:
  EMU8000 [0x620]: 4096 Kb on-board memory detected
  asfxload 4GMGSMT.SF2 succeeds.

I do not have a card with 512 KiB to test with, but by forcibly enabling the
added conditional I verified on the AWE64 Gold that it detects 512 KiB
(successfully reading from the first memory location) and does not hang the
card.

C.f. Bug 46451 https://bugzilla.kernel.org/show_bug.cgi?id=46451

Signed-off-by: David Flater <dave@flaterco.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28 19:58:12 +02:00
..
emu8000_callback.c sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed 2011-10-31 19:31:22 -04:00
emu8000_local.h [ALSA] Remove sound/driver.h 2008-01-31 17:29:48 +01:00
emu8000_patch.c ALSA: emu8000: Remove duplicate linux/moduleparam.h include from emu8000_patch.c 2012-02-06 10:22:54 +01:00
emu8000_pcm.c ALSA: sb: check get_user() return value 2010-07-29 12:24:22 +02:00
emu8000_synth.c sound: Add module.h to the previously silent sound users 2011-10-31 19:31:21 -04:00
emu8000.c ALSA: emu8000: fix emu8000 DRAM sized 512 KiB too small 2012-08-28 19:58:12 +02:00
jazz16.c ALSA: module_param: make bool parameters really bool 2011-12-19 10:34:41 +01:00
Makefile ALSA: Merge es1688 and es968 drivers 2010-05-10 09:49:30 +02:00
sb8_main.c sound: Add module.h to the previously silent sound users 2011-10-31 19:31:21 -04:00
sb8_midi.c [ALSA] Remove sound/driver.h 2008-01-31 17:29:48 +01:00
sb8.c ALSA: module_param: make bool parameters really bool 2011-12-19 10:34:41 +01:00
sb16_csp.c sound: Add module.h to the previously silent sound users 2011-10-31 19:31:21 -04:00
sb16_main.c sound: Add module.h to the previously silent sound users 2011-10-31 19:31:21 -04:00
sb16.c ALSA: module_param: make bool parameters really bool 2011-12-19 10:34:41 +01:00
sb_common.c sound: Add module.h to the previously silent sound users 2011-10-31 19:31:21 -04:00
sb_mixer.c ALSA: jazz16: Add support for Media Vision Jazz16 chipset 2009-12-21 12:09:22 +01:00
sbawe.c