'cat /proc/asound/card0/codec0' cause kernel panic (battery mode)

Bug #1212160 reported by Yang Kun (YK)
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HWE Next
Fix Released
Undecided
David Henningsson
linux (Ubuntu)
Fix Released
High
David Henningsson
Nominated for Precise by Yang Kun (YK)
Nominated for Quantal by Yang Kun (YK)

Bug Description

Kernel panic if;
1. boot up system with battery mode (no AC connected)
2. insert HDMI cable
3. execute 'cat /proc/asound/card0/codec0'

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1212160

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Changed in hwe-next:
assignee: nobody → David Henningsson (diwic)
status: New → Triaged
Revision history for this message
David Henningsson (diwic) wrote :

The commit that I believe fixes this bug is

commit 8b8d654b55648561287bd8baca0f75f964a17038
Author: Takashi Iwai <email address hidden>
Date: Wed Jun 20 16:32:22 2012 +0200

    ALSA: hda - Move one-time init codes from generic_hdmi_init()

Upstream would like to confirm that it's really the generic_hdmi_init patch that fixes the OOPS and nothing else, before accepting it into stable tree. I've therefore made a special DKMS package which contains only the 3.5 kernel + the specific patch. Can you test it and verify that this fixes the OOPS? Thanks.

Revision history for this message
David Henningsson (diwic) wrote :
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

TEST CASE:
1. Install 12.04.2, boot to desktop and run update (3.5.0-43) on 201303-13027
2. Install the proprietary video driver (fglrx-updates)
3. Reboot in battery mode (no AC connected)
4. Insert HDMI cable
5. execute 'cat /proc/asound/card0/codec0'
6. Kernel panic occurred, caps lock LED flashing, reboot
7. Install the deb file from comment #3
8. Repeat 3-5

VERIFICATION DONE

Expected result:
1. Kernel panic should happen on step 6
2. It won't happen again after the deb file was installed

Actual result:
Kernel panic occurred as expected, the patch works as expected

Thanks

tags: added: 201303-13027 taipei-lab
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Anthony Wong (anthonywong) wrote :

Thanks PHLin for the test!

Revision history for this message
David Henningsson (diwic) wrote : Please backport "ALSA: hda - Move one-time init codes from generic_hdmi_init" to 3.4/3.5

Hi,

This is a real oldie, but better late than never.

A while back, I discovered that this patch would help against a kernel
panic when "cat /proc/asound/card0/codec0" was executed on this machine,
which was running an fglrx driver.

I asked for a stable backport, but Takashi wanted testing to make sure
this was actually fixed by the patch [1]. And now, several months later,
I have this confirmation [2].

The test was conducted on an 3.5 Ubuntu kernel, based on the 3.5
extended stable tree, but would apply equally well to 3.4.

I'm attaching the backported patch - it applied cleanly, I've just added
an extra section with an explanation.

--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

[1]
http://mailman.alsa-project.org/pipermail/alsa-devel/2013-March/060132.html

[2] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1212160/comments/4

Revision history for this message
Luis Henriques (henrix) wrote :
Download full text (4.2 KiB)

On Tue, Nov 12, 2013 at 01:33:11PM +0100, David Henningsson wrote:
> Hi,
>
> This is a real oldie, but better late than never.
>
> A while back, I discovered that this patch would help against a kernel
> panic when "cat /proc/asound/card0/codec0" was executed on this machine,
> which was running an fglrx driver.
>
> I asked for a stable backport, but Takashi wanted testing to make sure
> this was actually fixed by the patch [1]. And now, several months later,
> I have this confirmation [2].
>
> The test was conducted on an 3.5 Ubuntu kernel, based on the 3.5
> extended stable tree, but would apply equally well to 3.4.
>
> I'm attaching the backported patch - it applied cleanly, I've just added
> an extra section with an explanation.
>

Thank you David, I'll queue it for the 3.5 kernel.

Cheers,
--
Luis

> -- David Henningsson, Canonical Ltd. https://launchpad.net/~diwic
>
> [1]
> http://mailman.alsa-project.org/pipermail/alsa-devel/2013-March/060132.html
>
> [2] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1212160/comments/4

> From 76aabf83ca9c8cff2dd9e3bb5300e3778e0baf7d Mon Sep 17 00:00:00 2001
> From: Takashi Iwai <email address hidden>
> Date: Wed, 20 Jun 2012 16:32:22 +0200
> Subject: [PATCH] ALSA: hda - Move one-time init codes from
> generic_hdmi_init()
>
> The codes to initialize work struct or create a proc interface should
> be called only once and never although it's called many times through
> the init callback. Move that stuff into patch_generic_hdmi() so that
> it's called only once.
>
> Signed-off-by: Takashi Iwai <email address hidden>
>
> (cherry picked from commit 8b8d654b55648561287bd8baca0f75f964a17038)
>
> This is being backported to 3.4 and 3.5 due to prevention of kernel
> panic. The kernel panic was observed by executing
> 'cat /proc/asound/card0/codec0' on a particular machine, which was
> - running in battery mode
> - having an external HDMI monitor connected
> - running the fglrx driver.
>
> In short, the one-time init code initializes a delayed_work struct.
> Then, I believe the following happened:
> 1) the delayed_work was activated
> 2) the delayed_work struct was reinitialized by the init code
> 3) when the delayed_work timed out (ready to run the callback function),
> the kernel panic happened because the delayed_work struct had
> been corrupted in step 2.
>
> BugLink: https://bugs.launchpad.net/bugs/1212160
> Signed-off-by: David Henningsson <email address hidden>
> ---
> sound/pci/hda/patch_hdmi.c | 22 +++++++++++++++++-----
> 1 file changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index 02a6e3f..ef917bf 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -1282,23 +1282,34 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
> return 0;
> }
>
> -static int generic_hdmi_init(struct hda_codec *codec)
> +static int generic_hdmi_init_per_pins(struct hda_codec *codec)
> {
> struct hdmi_spec *spec = codec->spec;
> int pin_idx;
>
> for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
> struct hdmi_spec_per_pin *per_pin = &spec->pins[pin_idx];
...

Read more...

tags: added: patch
Changed in linux (Ubuntu):
status: Confirmed → Fix Committed
Changed in hwe-next:
status: Triaged → Fix Committed
Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-quantal' to 'verification-done-quantal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-quantal
Revision history for this message
David Henningsson (diwic) wrote :

Came from upstream stable.

tags: added: verification-done-quantal
removed: verification-needed-quantal
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.1 KiB)

This bug was fixed in the package linux - 3.5.0-45.68

---------------
linux (3.5.0-45.68) quantal; urgency=low

  [Steve Conklin]

  * Release Tracking Bug
    - LP: #1257035

  [ Kamal Mostafa ]

  * SAUCE: (no-up) drm/i915: i915.disable_pch_pwm overrides PCH_PWM_ENABLE
    quirk
    - LP: #1163720

  [ Upstream Kernel Changes ]

  * nfs: don't allow nfs_find_actor to match inodes of the wrong type
    - LP: #1257002
  * jfs: fix error path in ialloc
    - LP: #1257002
  * mac80211: drop spoofed packets in ad-hoc mode
    - LP: #1257002
  * mac80211: use sta_info_get_bss() for nl80211 tx and client probing
    - LP: #1257002
  * mac80211: update sta->last_rx on acked tx frames
    - LP: #1257002
  * iwlwifi: pcie: add SKUs for 6000, 6005 and 6235 series
    - LP: #1257002
  * libata: make ata_eh_qc_retry() bump scmd->allowed on bogus failures
    - LP: #1257002
  * mac80211: correctly close cancelled scans
    - LP: #1257002
  * rtlwifi: rtl8192cu: Fix error in pointer arithmetic
    - LP: #1257002
  * wireless: radiotap: fix parsing buffer overrun
    - LP: #1257002
  * drm/vmwgfx: Don't kill clients on VT switch
    - LP: #1257002
  * ecryptfs: Fix memory leakage in keystore.c
    - LP: #1257002
  * drm: Prevent overwriting from userspace underallocating core ioctl
    structs
    - LP: #1257002
  * drm: Pad drm_mode_get_connector to 64-bit boundary
    - LP: #1257002
  * drm/radeon/atom: workaround vbios bug in transmitter table on rs780
    - LP: #1257002
  * md: Fix skipping recovery for read-only arrays.
    - LP: #1257002
  * md: avoid deadlock when md_set_badblocks.
    - LP: #1257002
  * target/pscsi: fix return value check
    - LP: #1257002
  * parisc: Do not crash 64bit SMP kernels on machines with >= 4GB RAM
    - LP: #1257002
  * USB: serial: ftdi_sio: add id for Z3X Box device
    - LP: #1257002
  * clockevents: Sanitize ticks to nsec conversion
    - LP: #1257002
  * perf: Fix perf ring buffer memory ordering
    - LP: #1257002
  * xtensa: don't use alternate signal stack on threads
    - LP: #1257002
  * ASoC: dapm: Fix source list debugfs outputs
    - LP: #1257002
  * ASoC: wm_hubs: Add missing break in hp_supply_event()
    - LP: #1257002
  * uml: check length in exitcode_proc_write()
    - LP: #1257002
  * staging: ozwpan: prevent overflow in oz_cdev_write()
    - LP: #1257002
  * aacraid: missing capable() check in compat ioctl
    - LP: #1257002
  * staging: wlags49_h2: buffer overflow setting station name
    - LP: #1257002
  * Staging: bcm: info leak in ioctl
    - LP: #1257002
  * ALSA: fix oops in snd_pcm_info() caused by ASoC DPCM
    - LP: #1257002
  * lib/scatterlist.c: don't flush_kernel_dcache_page on slab page
    - LP: #1257002
  * scripts/kallsyms: filter symbols not in kernel address space
    - LP: #1257002
  * xen-netback: use jiffies_64 value to calculate credit timeout
    - LP: #1257002
  * net: flow_dissector: fail on evil iph->ihl
    - LP: #1257002
  * PCI/PM: Clear state_saved during suspend
    - LP: #1257002
  * ALSA: hda - Move one-time init codes from generic_hdmi_init()
    - LP: #1212160, #1257002
  * NFSv4: Fix a use-after-free situation in _nfs4_proc_getlk()
    - LP: #1257002
  * USB: mo...

Read more...

Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
Changed in hwe-next:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.