Hello Folks,

I am trying to write an SPI driver according to Scott Ellis's instructions on :

http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62

However, every time I try to insmod either his myspy.ko or adc.ko  driver, the gumstix segfaults.

I have followed the directions and added the 2 patches the linux/linx-omap-2.6.32 folder of the bitbake recipes and modified linux-omap3_2.6.32.bb so that bitbake executes the patches.  IE its source append is :
SRC_URI_append = " \
           file://${BOOT_SPLASH} \
           file://1-omap2-mcspi-cleanup-null-ref.patch;patch=1 \
           file://2-omap2-mcspi-use-transfer-speed-override.patch;patch=1 \
           "
When bitbake compiles the linux-omap3-2.6.32, it applies the patches according to the screen output.  I then took the kernel-image-2.6.32_2.6.32-r51.5_overo.ipk produced by bitbake and installed it on the latest console image from Sakoman's repository. 

opkg install kernel-image-2.6.32_2.6.32-r51.5_overo.ipk

I restart the gumstix, remove the ads7846 module,  and use insmod myspy.ko and get:

Unable to handle kernel NULL pointer dereference at virtual address 00000010
pgd = cfbb0000
[00000010] *pgd=8e47b031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1]
last sysfs file: /sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/size
Modules linked in: myspy(+) pvrsrvkm ipv6 libertas_sdio libertas lib80211 ads7846
CPU: 0    Not tainted  (2.6.32 #1)
PC is at omap2_mcspi_cleanup+0x20/0x94
LR is at omap2_mcspi_cleanup+0x14/0x94
pc : [<c0336654>]    lr : [<c0336648>]    psr: a0000013
sp : ceee1eb8  ip : 00000000  fp : 00000000
r10: 00000003  r9 : ceee0000  r8 : bf0d4792
r7 : cf8551c0  r6 : 00000000  r5 : c065f50c  r4 : cfad6080
r3 : 00000028  r2 : 00000000  r1 : 00000000  r0 : cf855280
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5387d  Table: 8fbb0019  DAC: 00000015
Process insmod (pid: 943, stack limit = 0xceee02f0)
Stack: (0xceee1eb8 to 0xceee2000)
1ea0:                                                       ffffffff cfad6080
1ec0: c065f50c 00000000 cf8551c0 c03357f8 00000000 c03010f0 cfad6088 c02ac5ec
1ee0: cfad60a4 c02ac590 00000000 c02ad390 cfad6080 ceee1f08 cfad6080 bf0d7170
1f00: 00000000 00000032 31697073 0000302e 00000000 00000000 fffffffc 00000000
1f20: bf0d49fc ceee0000 00000001 c014ee3c 00000000 c01364d8 00000033 c0643c18
1f40: c0643c0c ffffffff 00000000 bf0d49fc bf0d7000 00000000 c00f20c4 c00f1344
1f60: 00014b79 bf0d49fc 00000000 00012018 c00f20c4 00000000 bf0d49fc 00000000
1f80: 00012018 c0146cb8 00000003 ce4a7800 cee8aa40 4000e920 00020000 00012018
1fa0: 00000080 c00f1f40 4000e920 00020000 00012018 00014b79 00012008 00000001
1fc0: 4000e920 00020000 00012018 00000080 00012008 00000000 00000003 00000000
1fe0: bef24ed5 bef24c5c 00008e90 400e9264 60000010 00012018 00000000 00000000
[<c0336654>] (omap2_mcspi_cleanup+0x20/0x94) from [<c03357f8>] (spidev_release+0x1c/0x38)
[<c03357f8>] (spidev_release+0x1c/0x38) from [<c03010f0>] (device_release+0x50/0x7c)
[<c03010f0>] (device_release+0x50/0x7c) from [<c02ac5ec>] (kobject_release+0x5c/0x70)
[<c02ac5ec>] (kobject_release+0x5c/0x70) from [<c02ad390>] (kref_put+0x60/0x74)
[<c02ad390>] (kref_put+0x60/0x74) from [<bf0d7170>] (myspy_init+0x170/0x2b4 [myspy])
[<bf0d7170>] (myspy_init+0x170/0x2b4 [myspy]) from [<c00f1344>] (do_one_initcall+0x5c/0x1bc)
[<c00f1344>] (do_one_initcall+0x5c/0x1bc) from [<c0146cb8>] (sys_init_module+0xc0/0x1f0)
[<c0146cb8>] (sys_init_module+0xc0/0x1f0) from [<c00f1f40>] (ret_fast_syscall+0x0/0x2c)
Code: ebff35f2 e5d410b0 e59420b8 e3a03028 (e592c010)
---[ end trace 53ef9193a82365ce ]---
 overo Internal error: Oops: 17 [#1]
 overo last sysfs file: /sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/size
 overo Process insmod (pid: 943, stack limit = 0xceee02f0)
 overo Stack: (0xceee1eb8 to 0xceee2000)
 overo 1ea0:                                                       ffffffff cfad6080
 overo 1ec0: c065f50c 00000000 cf8551c0 c03357f8 00000000 c03010f0 cfad6088 c02ac5ec
 overo 1ee0: cfad60a4 c02ac590 00000000 c02ad390 cfad6080 ceee1f08 cfad6080 bf0d7170
 overo 1f00: 00000000 00000032 31697073 0000302e 00000000 00000000 fffffffc 00000000
 overo 1f20: bf0d49fc ceee0000 00000001 c014ee3c 00000000 c01364d8 00000033 c0643c18
 overo 1f40: c0643c0c ffffffff 00000000 bf0d49fc bf0d7000 00000000 c00f20c4 c00f1344
 overo 1f60: 00014b79 bf0d49fc 00000000 00012018 c00f20c4 00000000 bf0d49fc 00000000
 overo 1f80: 00012018 c0146cb8 00000003 ce4a7800 cee8aa40 4000e920 00020000 00012018
 overo 1fa0: 00000080 c00f1f40 4000e920 00020000 00012018 00014b79 00012008 00000001
 overo 1fc0: 4000e920 00020000 00012018 00000080 00012008 00000000 00000003 00000000
 overo 1fe0: bef24ed5 bef24c5c 00008e90 400e9264 60000010 00012018 00000000 00000000
 overo Code: ebff35f2 e5d410b0 e59420b8 e3a03028 (e592c010)
Segmentation fault

Could anyone point me in the right direction about how to fix this?   Did I not apply the patches/kernel upgrade correctly?

Thank you for the help,
Adam Stambler