08 Sep, 2013

1 commit

  • commit fb615499f0ad28ed74201c1cdfddf9e64e205424 upstream.

    The recent commit to delay the release of kobject triggered NULL
    dereferences of opti9xx drivers. The cause is that all
    snd-opti92x-ad1848, snd-opti92x-cs4231 and snd-opti93x drivers
    register the PnP card driver with the very same name, and also
    snd-opti92x-ad1848 and -cs4231 drivers register the ISA driver with
    the same name, too. When these drivers are built in, quick
    "register-release-and-re-register" actions occur, and this results in
    Oops because of the same name is assigned to the kobject.

    The fix is simply to assign individual names. As a bonus, by using
    KBUILD_MODNAME, the patch reduces more lines than it adds.

    The fix is based on the suggestion by Russell King.

    Reported-and-tested-by: Fengguang Wu
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

07 Dec, 2012

2 commits


30 Oct, 2012

1 commit


25 Oct, 2012

1 commit


21 Oct, 2012

1 commit

  • snd_miro_probe is a static function that is only called twice in the file
    that defines it. At each call site, its argument is freed using
    snd_card_free. Thus, there is no need for snd_miro_probe to call
    snd_card_free on its argument on any of its error exit paths.

    Because snd_card_free both reads the fields of its argument and kfrees its
    argments, the results of the second snd_card_free should be unpredictable.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @r@
    identifier f,free,a;
    parameter list[n] ps;
    type T;
    expression e;
    @@

    f(ps,T a,...) {
    ... when any
    when != a = e
    if(...) { ... free(a); ... return ...; }
    ... when any
    }

    @@
    identifier r.f,r.free;
    expression x,a;
    expression list[r.n] xs;
    @@

    * x = f(xs,a,...);
    if (...) { ... free(a); ... return ...; }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Takashi Iwai

    Julia Lawall
     

06 Oct, 2012

1 commit

  • A simplified version of the semantic patch that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @r1@
    statement S;
    position p,p1;
    @@
    S@p1;@p

    @script:python r2@
    p << r1.p;
    p1 << r1.p1;
    @@
    if p[0].line != p1[0].line_end:
    cocci.include_match(False)
    @@
    position r1.p;
    @@
    -;@p
    //

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Takashi Iwai

    Peter Senna Tschudin
     

29 Aug, 2012

2 commits

  • 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
    Signed-off-by: Takashi Iwai

    David Flater
     
  • Need to merge the fixes regarding EPSS.

    Conflicts:
    sound/pci/hda/hda_codec.c

    Takashi Iwai
     

24 Aug, 2012

1 commit

  • sound/isa/cmi8328.c: In function 'snd_cmi8328_remove':
    sound/isa/cmi8328.c:416:24: error: 'cmi' undeclared (first use in this function)
    sound/isa/cmi8328.c:416:24: note: each undeclared identifier is reported only once for each function it appears in
    make[3]: *** [sound/isa/cmi8328.o] Error 1

    Reported-by: Randy Dunlap
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

21 Aug, 2012

2 commits

  • Introduce snd-cmi8328 driver for C-Media CMI8328-based sound cards, such as
    AudioExcel AV500.

    It supports PCM playback and capture (full-duplex) through wss_lib, gameport,
    OPL3 and MPU401. The AV500 card has onboard Dream wavetable synth connected
    to the MPU401 port and Aux 1 input internally which works too.
    The CDROM interface is not supported (as the drivers for these CDROMs were
    removed from the kernel some time ago).

    A separate driver is needed because CMI8328 is completely different chip to
    CMI8329/CMI8330. It's configured by magic registers (there's no PnP). Sound is
    provided by a real WSS codec (CS4231A) and the SB part is just a SB Pro
    emulation (for DOS games, useless for Linux).

    When SB is enabled, the CMI8328 chip disables access to the WSS codec,
    emulates SoundBlaster on one side and outputs sound data to the codec - so SB
    and WSS can't work together with this card. The WSS codec can do full duplex
    by itself so there's no need for crazy things like snd-cmi8330 does
    (combining SB and WSS parts into one driver).

    Signed-off-by: Ondrej Zary
    Signed-off-by: Takashi Iwai

    Ondrej Zary
     
  • snd_card_als100_probe() does not set pcm field in struct snd_sb.
    As a result, PCM is not suspended and applications don't know that they need
    to resume the playback.

    Tested with Labway A381-F20 card (ALS120).

    Signed-off-by: Ondrej Zary
    Signed-off-by: Takashi Iwai

    Ondrej Zary
     

20 Aug, 2012

2 commits


06 Aug, 2012

1 commit


03 Aug, 2012

1 commit


30 Jul, 2012

1 commit

  • This will fix the following oops:

    [ 6.169981] genirq: Flags mismatch irq 5. 00000000 (ES1688) vs. 00000000 (ES1688)
    [ 6.170851] Pid: 1, comm: swapper Not tainted 3.5.0-00004-gceee0e9 #14
    [ 6.170851] Call Trace:
    [ 6.170851] [] ? __setup_irq+0x3c7/0x420
    [ 6.170851] [] ? request_threaded_irq+0x76/0x140
    [ 6.170851] [] ? snd_es1688_ioctl+0x10/0x10
    [ 6.170851] [] ? request_threaded_irq+0xb2/0x140
    [ 6.170851] [] ? snd_es1688_create+0x96/0x330
    [ 6.170851] [] ? snd_gusextreme_probe+0x18d/0x5a2
    [ 6.170851] [] ? __driver_attach+0x80/0x80
    [ 6.170851] [] ? sysfs_create_link+0xf/0x20
    [ 6.170851] [] ? __driver_attach+0x80/0x80
    [ 6.170851] [] ? isa_bus_probe+0x12/0x20
    [ 6.170851] [] ? driver_probe_device+0x55/0x1c0
    [ 6.170851] [] ? _raw_spin_unlock+0xf/0x30
    [ 6.170851] [] ? klist_next+0x6a/0xe0
    [ 6.170851] [] ? isa_bus_match+0x21/0x40
    [ 6.170851] [] ? bus_for_each_drv+0x34/0x70
    [ 6.170851] [] ? device_attach+0x7b/0x90
    [ 6.170851] [] ? __driver_attach+0x80/0x80
    [ 6.170851] [] ? bus_probe_device+0x5f/0x80
    [ 6.170851] [] ? device_add+0x573/0x620
    [ 6.170851] [] ? complete_all+0x40/0x60
    [ 6.170851] [] ? _raw_spin_unlock_irqrestore+0x1a/0x30
    [ 6.170851] [] ? isa_register_driver+0xb6/0x150
    [ 6.170851] [] ? alsa_card_gusmax_init+0xf/0xf
    [ 6.170851] [] ? do_one_initcall+0x7f/0x12b
    [ 6.170851] [] ? kernel_init+0x112/0x1a9
    [ 6.170851] [] ? do_early_param+0x77/0x77
    [ 6.170851] [] ? do_one_initcall+0x12b/0x12b
    [ 6.170851] [] ? kernel_thread_helper+0x6/0xd
    [ 6.190170] es1688: can't grab IRQ 5
    [ 6.190613] genirq: Flags mismatch irq 5. 00000000 (ES1688) vs. 00000000 (ES1688)
    [ 6.191566] Pid: 1, comm: swapper Not tainted 3.5.0-00004-gceee0e9 #14
    [ 6.192394] Call Trace:
    [ 6.192685] [] ? __setup_irq+0x3c7/0x420
    [ 6.193342] [] ? request_threaded_irq+0x76/0x140
    [ 6.194081] [] ? snd_es1688_ioctl+0x10/0x10
    [ 6.194607] [] ? request_threaded_irq+0xb2/0x140
    [ 6.194607] [] ? snd_es1688_create+0x96/0x330
    [ 6.194607] [] ? snd_gusextreme_probe+0x18d/0x5a2
    [ 6.194607] [] ? __driver_attach+0x80/0x80
    [ 6.194607] [] ? sysfs_create_link+0xf/0x20
    [ 6.194607] [] ? __driver_attach+0x80/0x80
    [ 6.194607] [] ? isa_bus_probe+0x12/0x20
    [ 6.194607] [] ? driver_probe_device+0x55/0x1c0
    [ 6.194607] [] ? _raw_spin_unlock+0xf/0x30
    [ 6.194607] [] ? klist_next+0x6a/0xe0
    [ 6.194607] [] ? isa_bus_match+0x21/0x40
    [ 6.194607] [] ? bus_for_each_drv+0x34/0x70
    [ 6.194607] [] ? device_attach+0x7b/0x90
    [ 6.194607] [] ? __driver_attach+0x80/0x80
    [ 6.194607] [] ? bus_probe_device+0x5f/0x80
    [ 6.194607] [] ? device_add+0x573/0x620
    [ 6.194607] [] ? complete_all+0x40/0x60
    [ 6.194607] [] ? _raw_spin_unlock_irqrestore+0x1a/0x30
    [ 6.194607] [] ? isa_register_driver+0xb6/0x150
    [ 6.194607] [] ? alsa_card_gusmax_init+0xf/0xf
    [ 6.194607] [] ? do_one_initcall+0x7f/0x12b
    [ 6.194607] [] ? kernel_init+0x112/0x1a9
    [ 6.194607] [] ? do_early_param+0x77/0x77
    [ 6.194607] [] ? do_one_initcall+0x12b/0x12b
    [ 6.194607] [] ? kernel_thread_helper+0x6/0xd
    [ 6.210779] es1688: can't grab IRQ 5
    [ 6.211305] gusextreme: probe of gusextreme.0 failed with error -16

    Signed-off-by: Daniel Mack
    Signed-off-by: Fengguang Wu
    Signed-off-by: Takashi Iwai

    Fengguang Wu
     

17 Jul, 2012

2 commits


16 Jul, 2012

2 commits

  • Yamaha OPL3-SAx chips don't resume properly when playback is running -
    garbage is played after resume. Restoring the CS4231_PLAYBK_FORMAT register
    last fixes the problem.

    Signed-off-by: Ondrej Zary
    Signed-off-by: Takashi Iwai

    Ondrej Zary
     
  • By setting SNDRV_PCM_INFO_RESUME, wss_lib claims that it can restore the card
    state fully on resume. But in fact, it can't as DMA is not restored so any
    playback/capture running during suspend will fail to continue after resume.

    Remove SNDRV_PCM_INFO_RESUME flag from pcm info field to fix the problem.

    Signed-off-by: Ondrej Zary
    Signed-off-by: Takashi Iwai

    Ondrej Zary
     

18 Jun, 2012

1 commit

  • MED3931 card did not work (failed with "OPTI chip not found") because
    snd-opti9xx gets mc_indir_index from pnp by adding 2 to the pnp-reported port.
    It probably works for some cards but not for this one. Datasheet says that
    the port is always at 0xe?e so just force the lowest nibble to be 0xe.

    Also this card powers up with (ugly) 3D sound enabled. As there's no mixer
    control for this, just disable it.

    Signed-off-by: Ondrej Zary
    Signed-off-by: Takashi Iwai

    Ondrej Zary
     

23 May, 2012

1 commit

  • Pull trivial updates from Jiri Kosina:
    "As usual, it's mostly typo fixes, redundant code elimination and some
    documentation updates."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits)
    edac, mips: don't change code that has been removed in edac/mips tree
    xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer
    lib: Change mail address of Oskar Schirmer
    net: Change mail address of Oskar Schirmer
    arm/m68k: Change mail address of Sebastian Hess
    i2c: Change mail address of Oskar Schirmer
    net: Fix tcp_build_and_update_options comment in struct tcp_sock
    atomic64_32.h: fix parameter naming mismatch
    Kconfig: replace "--- help ---" with "---help---"
    c2port: fix bogus Kconfig "default no"
    edac: Fix spelling errors.
    qla1280: Remove redundant NULL check before release_firmware() call
    remoteproc: remove redundant NULL check before release_firmware()
    qla2xxx: Remove redundant NULL check before release_firmware() call.
    aic94xx: Get rid of redundant NULL check before release_firmware() call
    tehuti: delete redundant NULL check before release_firmware()
    qlogic: get rid of a redundant test for NULL before call to release_firmware()
    bna: remove redundant NULL test before release_firmware()
    tg3: remove redundant NULL test before release_firmware() call
    typhoon: get rid of redundant conditional before all to release_firmware()
    ...

    Linus Torvalds
     

10 Apr, 2012

1 commit


09 Apr, 2012

1 commit


29 Mar, 2012

1 commit

  • Fix module parameter data type to eliminate build warnings.

    sound/isa/opti9xx/opti92x-ad1848.c:87:1: warning: return from incompatible pointer type
    sound/isa/opti9xx/opti92x-ad1848.c:87:1: warning: return from incompatible pointer type

    Signed-off-by: Randy Dunlap
    Signed-off-by: Takashi Iwai

    Randy Dunlap
     

28 Mar, 2012

1 commit


06 Feb, 2012

1 commit


19 Dec, 2011

1 commit

  • module_param(bool) used to counter-intuitively take an int. In
    fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
    trick.

    It's time to remove the int/unsigned int option. For this version
    it'll simply give a warning, but it'll break next kernel version.

    Signed-off-by: Rusty Russell
    Signed-off-by: Takashi Iwai

    Rusty Russell
     

01 Nov, 2011

4 commits


22 Sep, 2011

1 commit

  • Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
    We run all interrupt handlers with interrupts disabled
    and we even check and yell when an interrupt handler
    returns with interrupts enabled (see commit [b738a50a:
    genirq: Warn when handler enables interrupts]).

    So now this flag is a NOOP and can be removed.

    Signed-off-by: Yong Zhang
    Acked-by: Peter Ujfalusi
    Acked-by: Mark Brown
    Signed-off-by: Takashi Iwai

    Yong Zhang
     

14 Sep, 2011

1 commit

  • The semantics of snd_mpu401_uart_new()'s interrupt parameters are
    somewhat counterintuitive: To prevent the function from allocating its
    own interrupt, either the irq number must be invalid, or the irq_flags
    parameter must be zero. At the same time, the irq parameter being
    invalid specifies that the mpu401 code has to work without an interrupt
    allocated by the caller. This implies that, if there is an interrupt
    and it is allocated by the caller, the irq parameter must be set to
    a valid-looking number which then isn't actually used.

    With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value,
    which forces us to handle the parameters differently.

    This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the
    device interrupt is handled by the caller, and makes the allocation of
    the interrupt to depend only on the irq parameter. As suggested by
    Takashi, the irq_flags parameter was dropped because, when used, it had
    the constant value IRQF_DISABLED.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

27 Jul, 2011

1 commit


31 Mar, 2011

1 commit


02 Nov, 2010

1 commit

  • "gadget", "through", "command", "maintain", "maintain", "controller", "address",
    "between", "initiali[zs]e", "instead", "function", "select", "already",
    "equal", "access", "management", "hierarchy", "registration", "interest",
    "relative", "memory", "offset", "already",

    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Jiri Kosina

    Uwe Kleine-König
     

09 Sep, 2010

1 commit


08 Sep, 2010

1 commit