This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

gpio debounce

Hello,


I have custom 8148 board, in which 3 are gpio keys, when I enable debounce on them I get this crash.

Uncompressing Linux... done, booting the kernel.
Trying to install type control for IRQ375
Trying to set irq flags for IRQ375
omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
Cannot clk_get ck_32
Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa032150
Internal error: : 1028 [#1]
last sysfs file:
Modules linked in:
CPU: 0    Not tainted  (2.6.37 #1)
PC is at gpio_debounce+0xf4/0x140
LR is at gpio_debounce+0xb0/0x140
pc : [<800511e4>]    lr : [<800511a0>]    psr: 20000093
sp : c583bda8  ip : c583bda8  fp : c583bdcc
r10: fa032154  r9 : 8047dc48  r8 : 00000001
r7 : 00800000  r6 : a0000013  r5 : fa032150  r4 : c5836434
r3 : 00000006  r2 : 000003c8  r1 : 0000007c  r0 : 00000081
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 80004019  DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc583a2e8)
Stack: (0xc583bda8 to 0xc583c000)
bda0:                   c5836434 20000013 00000017 00007530 8047e1e4 c5043494
bdc0: c583bdec c583bdd0 801add34 800510fc c5059000 c5043400 00000000 8047e078
bde0: c583be44 c583bdf0 80369318 801adcb4 8041cce0 c5043458 c5bff900 00000001
be00: 8047e1a4 00000040 00000000 8041cce7 8047dc50 00000002 c583be34 8047dc50
be20: 8047dc50 804ac214 801d820c 804a4048 00000000 00000000 c583be54 c583be48
be40: 801d9078 80369128 c583be74 c583be58 801d809c 801d9068 0000000a 804ac214
be60: 8047dc50 8047dc50 c583be8c c583be78 801d823c 801d7fe8 00000000 c583be90
be80: c583beb4 c583be90 801d6efc 801d8218 c581cf48 c5bac534 8047dc50 00000000
bea0: 8047dc84 00000001 c583bed4 c583beb8 801d7f88 801d6eb4 00000001 8047dc50
bec0: 00000000 8047dc58 c583bee4 c583bed8 801d77c4 801d7f28 c583bf2c c583bee8
bee0: 801d5864 801d77a4 8047dc48 8002c2c0 800643ac 00000001 c583bf20 c583bf08
bf00: 801d45f8 8047dc48 00000000 800643ac 00000001 00000000 00000000 00000000
bf20: c583bf4c c583bf30 801d94d4 801d553c 8047dc48 8002c2c0 800643ac 00000001
bf40: c583bf64 c583bf50 801d955c 801d93e4 c583a000 00000000 c583bf8c c583bf68
bf60: 801d97f0 801d9548 c583a000 8002b0b0 8002b0ec 800643ac 8000d458 00000000
bf80: c583bf9c c583bf90 8000d470 801d97d4 c583bfd4 c583bfa0 80030414 8000d464
bfa0: c583bfbc 00000176 8049c680 800643ac c583bfd4 8002b0b0 8002b0ec 800643ac
bfc0: 00000013 00000000 c583bff4 c583bfd8 80008a48 80030360 00000000 00000000
bfe0: 00000000 800089a4 00000000 c583bff8 800643ac 800089b0 ffcf7ee3 b6dfd7b9
Backtrace:
[<800510f0>] (gpio_debounce+0x0/0x140) from [<801add34>] (gpio_set_debounce+0x8c/0xa0)
[<801adca8>] (gpio_set_debounce+0x0/0xa0) from [<80369318>] (gpio_keys_probe+0x1fc/0x474)
 r7:8047e078 r6:00000000 r5:c5043400 r4:c5059000
[<8036911c>] (gpio_keys_probe+0x0/0x474) from [<801d9078>] (platform_drv_probe+0x1c/0x20)
[<801d905c>] (platform_drv_probe+0x0/0x20) from [<801d809c>] (driver_probe_device+0xc0/0x19c)
[<801d7fdc>] (driver_probe_device+0x0/0x19c) from [<801d823c>] (__device_attach+0x30/0x4c)
 r6:8047dc50 r5:8047dc50 r4:804ac214 r3:0000000a
[<801d820c>] (__device_attach+0x0/0x4c) from [<801d6efc>] (bus_for_each_drv+0x54/0x9c)
 r5:c583be90 r4:00000000
[<801d6ea8>] (bus_for_each_drv+0x0/0x9c) from [<801d7f88>] (device_attach+0x6c/0x98)
 r7:00000001 r6:8047dc84 r5:00000000 r4:8047dc50
[<801d7f1c>] (device_attach+0x0/0x98) from [<801d77c4>] (bus_probe_device+0x2c/0x48)
 r6:8047dc58 r5:00000000 r4:8047dc50 r3:00000001
[<801d7798>] (bus_probe_device+0x0/0x48) from [<801d5864>] (device_add+0x334/0x4c8)
[<801d5530>] (device_add+0x0/0x4c8) from [<801d94d4>] (platform_device_add+0xfc/0x164)
[<801d93d8>] (platform_device_add+0x0/0x164) from [<801d955c>] (platform_device_register+0x20/0x24)
 r7:00000001 r6:800643ac r5:8002c2c0 r4:8047dc48
[<801d953c>] (platform_device_register+0x0/0x24) from [<801d97f0>] (platform_add_devices+0x28/0x64)
 r4:00000000 r3:c583a000
[<801d97c8>] (platform_add_devices+0x0/0x64) from [<8000d470>] (omap_init_gpio_keys+0x18/0x24)
 r8:00000000 r7:8000d458 r6:800643ac r5:8002b0ec r4:8002b0b0
r3:c583a000
[<8000d458>] (omap_init_gpio_keys+0x0/0x24) from [<80030414>] (do_one_initcall+0xc0/0x194)
[<80030354>] (do_one_initcall+0x0/0x194) from [<80008a48>] (kernel_init+0xa4/0x150)
 r8:00000000 r7:00000013 r6:800643ac r5:8002b0ec r4:8002b0b0
[<800089a4>] (kernel_init+0x0/0x150) from [<800643ac>] (do_exit+0x0/0x5ec)
 r5:800089a4 r4:00000000
Code: e3530006 02855e15 12855050 e3580000 (e5953000)

Thanks,

Mike

  • Hi Mike,

    Do you have normal kernel boot up when you revert back your gpio debaunce changes?

    Can you provide us these changes?

    BR
    Pavel
  • Hi,

    Following is the log:

    Uncompressing Linux... done, booting the kernel.
    Linux version 2.6.37+ (mike@tango-charlie) (gcc version 4.7.4 (crosstool-NG 1.21.0) ) #13 Wed Apr 20 15:13:44 BST 2016
    CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
    CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
    Machine: ti8148evm
    ti81xx_reserve: ### Reserved DDR region @fbf00000
    reserved size = 52428800 at 0x0
    FB: Reserving 52428800 bytes SDRAM for VRAM
    Memory policy: ECC disabled, Data cache writeback
    OMAP chip is TI8148 3.0
    SRAM: Mapped pa 0x402f1000 to va 0xfe400000 size: 0xf000
    Built 1 zonelists in Zone order, mobility grouping on. Total pages: 391040
    PID hash table entries: 4096 (order: 2, 16384 bytes)
    Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    Memory: 364MB 270MB 908MB 1MB = 1543MB total
    Memory: 1561308k/1561308k available, 70948k reserved, 832512K highmem
    Virtual kernel memory layout:
    vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
    DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
    vmalloc : 0xc6800000 - 0xf8000000 ( 792 MB)
    lowmem : 0x80000000 - 0xc6000000 (1120 MB)
    pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
    modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
    .init : 0x80008000 - 0x80030000 ( 160 kB)
    .text : 0x80030000 - 0x8047e000 (4408 kB)
    .data : 0x8047e000 - 0x804c1600 ( 270 kB)
    SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    NR_IRQS:375
    omap_hwmod: gpio1: softreset failed (waited 10000 usec)
    omap_hwmod: gpio2: softreset failed (waited 10000 usec)
    omap_hwmod: gpio3: softreset failed (waited 10000 usec)
    omap_hwmod: gpio4: softreset failed (waited 10000 usec)
    IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    Total of 128 interrupts on 1 active controller
    GPMC revision 6.0
    Trying to install interrupt handler for IRQ368
    Trying to install interrupt handler for IRQ369
    Trying to install interrupt handler for IRQ370
    Trying to install interrupt handler for IRQ371
    Trying to install interrupt handler for IRQ372
    Trying to install interrupt handler for IRQ373
    Trying to install interrupt handler for IRQ374
    Trying to install type control for IRQ375
    Trying to set irq flags for IRQ375
    OMAP clockevent source: GPTIMER1 at 20000000 Hz
    Console: colour dummy device 80x30
    Calibrating delay loop... 999.42 BogoMIPS (lpj=4997120)
    pid_max: default: 32768 minimum: 301
    Security Framework initialized
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    devtmpfs: initialized
    TI81XX: Map 0xfbf00000 to 0xfe500000 for dram barrier
    TI81XX: Map 0x40300000 to 0xfe600000 for sram barrier
    omap_voltage_early_init: voltage driver support not added
    regulator: core version 0.5
    regulator: dummy:
    NET: Registered protocol family 16
    omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
    omap_voltage_add_dev: VDD specified does not exist!
    OMAP GPIO hardware version 0.1
    OMAP GPIO hardware version 0.1
    OMAP GPIO hardware version 0.1
    OMAP GPIO hardware version 0.1
    Cannot clk_get ck_32
    Debugfs: Only enabling/disabling deep sleep and wakeup timer is supported now
    registered ti81xx_vpss device
    registered ti81xx on-chip HDMI device
    NSS Crypto DMA hardware revision 1.9 @ IRQ 116
    bio: create slab <bio-0> at 0
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    USBSS revision 4ea2080b
    registerd cppi-dma Intr @ IRQ 17
    Cppi41 Init Done
    omap_i2c omap_i2c.3: bus 3 rev4.0 at 100 kHz
    Advanced Linux Sound Architecture Driver Version 1.0.23.
    Switching to clocksource gp timer
    musb-hdrc: version 6.0, host, debug=0
    musb-hdrc musb-hdrc.0: dma type: dma-cppi41
    MUSB controller-0 revision 4ea20800
    usb2phy: computed values rxcalib(15)DACs(30 14 15)
    usb2phy: override computed values rxcalib(15)DACs(30 14 15)
    usb2phy_config: musb(0) rxcalib done, rxcalib read value 6f6f5d7e
    musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    musb-hdrc musb-hdrc.0: USB Host mode controller at c681e000 using DMA, IRQ 18
    musb-hdrc musb-hdrc.1: dma type: dma-cppi41
    MUSB controller-1 revision 4ea20800
    usb2phy: computed values rxcalib(15)DACs(29 13 15)
    usb2phy: override computed values rxcalib(15)DACs(29 13 15)
    usb2phy_config: musb(1) rxcalib done, rxcalib read value 6f6edb7e
    musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 1 port detected
    musb-hdrc musb-hdrc.1: USB Host mode controller at c682a800 using DMA, IRQ 19
    NET: Registered protocol family 2
    IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
    TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
    TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
    TCP: Hash tables configured (established 131072 bind 65536)
    TCP reno registered
    UDP hash table entries: 512 (order: 1, 8192 bytes)
    UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
    NET: Registered protocol family 1
    NetWinder Floating Point Emulator V0.97 (double precision)
    PMU: registered new PMU device of type 0
    omap-iommu omap-iommu.0: ducati registered
    omap-iommu omap-iommu.1: sys registered
    highmem bounce pool size: 64 pages
    msgmni has been set to 1423
    io scheduler noop registered
    io scheduler deadline registered
    io scheduler cfq registered (default)
    Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0
    console [ttyO0] enabled
    omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
    omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
    omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
    omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
    omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
    brd: module loaded
    loop: module loaded
    omap2-nand driver initializing
    ONFI param page 0 valid
    ONFI flash detected
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron NAND 512MiB 3,3V 8-bit)
    omap2-nand: detected x8 NAND flash
    Creating 1 MTD partitions on "omap2-nand.0":
    0x000000000000-0x000000020000 : "U-Boot-min-1"
    tun: Universal TUN/TAP device driver, 1.6
    tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
    usbcore: registered new interface driver cdc_ether
    usbcore: registered new interface driver dm9601
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    mice: PS/2 mouse device common for all mice
    input: gpio-keys as /devices/platform/gpio-keys/input/input0
    input: pwm-beeper as /devices/platform/pwm-beeper/input/input1
    omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
    i2c /dev entries driver
    OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
    nss_aes_mod_init: loading NSS AES driver
    nss-aes nss-aes: NSS AES hw accel rev: 3.2 (context 0 @0x41140000)
    nss-aes nss-aes: NSS AES hw accel rev: 3.2 (context 1 @0x41141000)
    nss-aes nss-aes: NSS AES hw accel rev: 3.2 (context 2 @0x411a0000)
    nss-aes nss-aes: NSS AES hw accel rev: 3.2 (context 3 @0x411a1000)
    nss_aes_probe: probe() done
    nss_des_mod_init: loading NSS DES driver
    nss-des nss-des: NSS DES hw accel rev: 2.2 (context 0 @0x41160000)
    nss-des nss-des: NSS DES hw accel rev: 2.2 (context 1 @0x41161000)
    nss_des_probe: probe() done
    nss_sham_mod_init: loading NSS SHA/MD5 driver
    nss-sham nss-sham: NSS SHA/MD5 hw accel rev: 4.03 (context 0 @0x41100000)
    nss-sham nss-sham: NSS SHA/MD5 hw accel rev: 4.03 (context 1 @0x41101000)
    nss-sham nss-sham: NSS SHA/MD5 hw accel rev: 4.03 (context 2 @0x411c0000)
    nss-sham nss-sham: NSS SHA/MD5 hw accel rev: 4.03 (context 3 @0x411c1000)
    nss_sham_probe: probe() done
    notify_init : notify drivercreated for remote proc id 2 at physical Address 0xbf900000
    mmc0: card claims to support voltages below the defined range. These will be ignored.
    mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
    mmc0: new high speed SDIO card at address 0001
    asoc: adau1373-aif1 <-> davinci-mcasp.2 mapping ok
    ALSA device list:
    #0: TI81XX EVM
    GACT probability NOT on
    Mirror/redirect action on
    u32 classifier
    Performance counters on
    input device check on
    Actions configured
    Netfilter messages via NETLINK v0.30.
    nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
    ctnetlink v0.93: registering with nfnetlink.
    ip_tables: (C) 2000-2006 Netfilter Core Team
    arp_tables: (C) 2002 David S. Miller
    TCP cubic registered
    NET: Registered protocol family 10
    NET: Registered protocol family 17
    Bridge firewalling registered
    Ebtables v2.0 registered
    Registering the dns_resolver key type
    VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    omap_voltage_late_init: Voltage driver support not added
    Power Management for TI81XX.
    omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:01 UTC (946684801)
    Waiting for root device /dev/mmcblk0p2...
    mmc1: new SDHC card at address b368
    mmcblk0: mmc1:b368 FFFFF 3.74 GiB
    mmcblk0: p1 p2
    EXT4-fs (mmcblk0p2): recovery complete
    EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    VFS: Mounted root (ext4 filesystem) on device 179:2.
    devtmpfs: mounted
    Freeing init memory: 160K
    <30>systemd[1]: systemd 204 running in system mode. (-PAM +LIBWRAP -AUDIT -SELINUX +IMA +SYSVINIT -LIBCRYPTSETUP -GCRYPT +ACL -XZ)


    changes which make it crash is just setting the debounce_interval to 30 (gpio_keys_button)

    Thanks,
    Mike
  • mike A said:
    Following is the log

    Is this the log when you do not apply the gpio debounce settings?

    mike A said:
    changes which make it crash is just setting the debounce_interval to 30 (gpio_keys_button)

    In which file you make this change? Can you share the code?

    Regards,
    Pavel

  • Mike,

    Make sure also the GPIO interface and debounce clocks are active/on:

    ./rtc_divider_ck/audio_prcm_clkin_ck/sysclk18_ck/gpio1_dbck/rate ==> 32768
    ./rtc_divider_ck/audio_prcm_clkin_ck/sysclk18_ck/gpio234_dbck/gpio2_dbck/rate ==> 32768
    ./rtc_divider_ck/audio_prcm_clkin_ck/sysclk18_ck/gpio234_dbck/gpio3_dbck/rate ==> 32768
    ./rtc_divider_ck/audio_prcm_clkin_ck/sysclk18_ck/gpio234_dbck/gpio4_dbck/rate ==> 32768
    ./rtc_divider_ck/audio_prcm_clkin_ck/sysclk18_ck/gpio234_dbck/rate ==> 32768

    ./osc0_clkin_ck/l3_dpll_clkin_ck/l3_dpll_ck/sysclk4_ck/sysclk6_ck/gpio1_ick/rate ==> 100000000
    ./osc0_clkin_ck/l3_dpll_clkin_ck/l3_dpll_ck/sysclk4_ck/sysclk6_ck/gpio234_ick/gpio2_ick/rate ==> 100000000
    ./osc0_clkin_ck/l3_dpll_clkin_ck/l3_dpll_ck/sysclk4_ck/sysclk6_ck/gpio234_ick/gpio3_ick/rate ==> 100000000
    ./osc0_clkin_ck/l3_dpll_clkin_ck/l3_dpll_ck/sysclk4_ck/sysclk6_ck/gpio234_ick/gpio4_ick/rate ==> 100000000
    ./osc0_clkin_ck/l3_dpll_clkin_ck/l3_dpll_ck/sysclk4_ck/sysclk6_ck/gpio234_ick/rate ==> 100000000

    See the below wiki for more info regarding clock management:
    processors.wiki.ti.com/.../TI81XX_PSP_PM_CLOCK_FRAMEWORK_User_Guide

    Which GPIO exactly you are using (GPIO0, GPIO1, GPIO2 or GPIO3)?

    Regards,
    Pavel
  • Hi,

    Mike,had you solve the problem?What is the reason?

    BR,

    vefone