mc13892 LED driver oopses on trigger action

Bug #531696 reported by Jeremy Kerr on 2010-03-04
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-fsl-imx51 (Ubuntu)
High
Bryan Wu

Bug Description

Setting a LED trigger event on a babbage board will cause an oops when that trigger occurs:

 echo mmc0 | sudo dd of=/sys/class/leds/pmic_ledsb/trigger
 sudo dd if=/dev/mmcblk0 of=/dev/null

The led_classdev's brightness_set function is called from an atomic context, but the mc13892 LED driver's brightness_set callback may sleep, resulting in the recursive oops.

Patch attached.

Jeremy Kerr (jk-ozlabs) wrote :
Changed in linux-fsl-imx51 (Ubuntu):
assignee: nobody → Bryan Wu (cooloney)
Jeremy Kerr (jk-ozlabs) wrote :

The attached patch does a bit of rework to enable the driver to use a workqueue. If we need a less intrusive (but more hacky) patch, let me know.

Bryan Wu (cooloney) wrote :
Download full text (13.8 KiB)

Thanks Jeremy,

I tested this patch on my board, it fixed the oops.

--
root@babbage:/home/roc# echo mmc0 > /sys/class/leds/pmic_ledsb/trigger
root@babbage:/home/roc# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 152459812 3217744 141497536 3% /
none 234164 196 233968 1% /dev
none 238992 1068 237924 1% /dev/shm
none 238992 104 238888 1% /var/run
none 238992 0 238992 0% /var/lock
none 238992 0 238992 0% /lib/init/rw
/dev/mmcblk0p2 645280 625424 19856 97% /media/4B46-D221_
root@babbage:/home/roc# dmesg
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.31-605-imx51 (root@roc-desktop) (gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) ) #8 Thu Mar 4 14:13:15 CST 2010 (Ubuntu 2.6.31-605.8-imx51)
CPU: ARMv7 Processor [412fc081] revision 1 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Freescale MX51 Babbage Board
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 122880
free_area_init_node: node 0, pgdat c06692dc, node_mem_map c06eb000
  DMA zone: 128 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 16256 pages, LIFO batch:3
  Normal zone: 832 pages used for memmap
  Normal zone: 105664 pages, LIFO batch:31
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 121920
Kernel command line: root=UUID=e35b9b48-cd90-45ce-9dd5-3a186f4f9a7b ro console=tty0 console=ttymxc0,115200'
PID hash table entries: 2048 (order: 11, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
allocated 2457600 bytes of page_cgroup
please try 'cgroup_disable=memory' option if you don't want memory cgroups
Memory: 480MB = 480MB total
Memory: 468132KB available (6104K code, 744K data, 184K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:272
MXC IRQ initialized
Console: colour dummy device 80x30
console [tty0] enabled
Calibrating delay loop... 799.53 BogoMIPS (lpj=3997696)
Security Framework initialized
AppArmor: AppArmor initialized
Mount-cache hash table entries: 512
Initializing cgroup subsys ns
Initializing cgroup subsys cpuacct
Initializing cgroup subsys memory
Initializing cgroup subsys freezer
Initializing cgroup subsys net_cls
CPU: Testing write buffer coherency: ok
tmpfs: No value for mount option 'mode'
devtmpfs: initialized
regulator: core version 0.5
NET: Registered protocol family 16
CPU is i.MX51 Revision 2.0
MXC GPIO hardware
iomux_config_mux: Warning: iomux pin config changed, reg=fb0a8134, prev=0x1 new=0x3
IRAM READY
mxc_init_dvfs_per initialised
Using SDMA I.API
MXC DMA API initialized
bio: create slab <bio-0> at 0
SCSI subsystem initialized
libata version 3.00 loaded.
CSPI: mxc_spi-0 probed
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
MXC I2C driver
MXC I2C driver
MXC HS I2C driver
IPU DMFC NO...

Changed in linux-fsl-imx51 (Ubuntu):
importance: Undecided → High
status: New → In Progress
tags: added: patch
Bryan Wu (cooloney) wrote :
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-fsl-imx51 - 2.6.31-605.9

---------------
linux-fsl-imx51 (2.6.31-605.9) lucid; urgency=low

  [ Andy Whitcroft ]

  * Revert "include modules.builtin in the binary debs"
  * include modules.builtin in the binary debs

  [ Bryan Wu ]

  * SAUCE: IMX51: skip ATA PASS THROUGH command for USB storage disk from
    JMicron
    - LP: #499881

  [ Upstream Kernel Changes ]

  * ARM: 5677/1: ARM support for
    TIF_RESTORE_SIGMASK/pselect6/ppoll/epoll_pwait
    - LP: #319729
  * leds/mc13892: Use workqueue for setting LED brightness
    - LP: #531696
  * ARM: 5882/1: ARM: Fix uncompress code compile for different defines of
    flush(void)
    - LP: #319240
  * ARM: 5884/1: arm: Fix DCC console for v7
    - LP: #319240
  * ARM: 5885/1: arm: Flush TLB entries in setup_mm_for_reboot()
    - LP: #319240
  * ARM: 5886/1: arm: Fix cpu_proc_fin() for proc-v7.S and make kexec work
    - LP: #319240
  * ARM: 5888/1: arm: Update comments in cacheflush.h and remove
    unnecessary V6 and V7 comments
    - LP: #319240
  * arm: disable L2 cache in the v7 finish function
  * arm: invalidate TLBs when enabling mmu
 -- Andy Whitcroft <email address hidden> Tue, 09 Mar 2010 13:52:16 +0000

Changed in linux-fsl-imx51 (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers