I'm configuring a GPIO as an input for an interrupt for a network device driver. It works fine the first time around as I bring the interface up. But if I 'reboot' the board, the next time I bring the interface up a seg fault occurs. I'm using an IMX35 running a version of Linux 2.6.31.
Unhandled fault: imprecise external abort (0xc06) at 0x00000000
Internal error: : c06 [#1] PREEMPT
PC is at mxc_request_iomux+0x2c/0x154
It looks to be a read of 0x00 if I understand the above, but I am new at Linux device drivers. Here is how I am configuring the driver.
pad_setting = PAD_CTL_DRV_3_3V | PAD_CTL_HYS_CMOS | PAD_CTL_PKE_NONE | PAD_CTL_100K_PD | PAD_CTL_ODE_CMOS |
PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW;
I also have
but not sure if the above two lines are really needed.
when the interface is brought down. Whether I bring the interface down or not, the seg fault still occurs. The only way to bring the interface up without a seg fault is to totally power off the board. I've looked into mxc_request_iomux() but I can't see anywhere within that would cause a seg fault.
It seems like something needs to be unconfigured prior to rebooting since a power off fixes it, but I can't seem to find out what.
Any ideas on what to do?