shivprashant wrote: > hi, > i am writing pci express hotplug driver for mpc8315erdb(powerpc). the > driver uses PCI hotplug subsystem not pcie port bus driver. i am able to > do insertion and removal of pci express cards and confirm using 'lspci' > command. driver is working with SATA and PATA memory cards with some > minor modifications in the kernel. the problem i am facing now is when i > try to repeatedly insert and remove the kernel is crashing, although > non-fatal. normal insertion/removal works fine but repeated > insertion/removal fails. pls guide me where am i wrong or what changes i > should make to recover from pci errors. > > Following is the crash log when repeatedly inserting and removing the > PATA cards (i am using delkin 32GB cards), > scsi20 : pata_jmicron > scsi21 : pata_jmicron > ata21: PATA max UDMA/100 cmd 0xff7fa010 ctl 0xff7fa020 bmdma 0xff7fa000 > irq 21 > ata22: PATA max UDMA/100 cmd 0xff7fa018 ctl 0xff7fa024 bmdma 0xff7fa008 > irq 21 > PCIE Card Removed from Slot 0 > Oops: Machine check, sig: 7 [#1] > MPC831x RDB > last sysfs file: /sys/devices/pci0002:02/0002:02:00.0/0002:03:00.0/class > Modules linked in: > NIP: c00124c4 LR: c00124b0 CTR: c0017998 > REGS: cfad3cb0 TRAP: 0200 Not tainted (2.6.36.1) > MSR: 00049030 <EE,ME,IR,DR> CR: 22204084 XER: 20000000 > TASK = cfa9c030[1282] 'scsi_eh_20' THREAD: cfad2000 > GPR00: 00000000 cfad3d60 cfa9c030 00000000 cfad3d08 00e00000 a91e4fb9 > 00000001 > GPR08: c03fd688 fdef7000 fd6f7000 c042a0e0 00005a07 00020d78 c02fbd0c > ffffffff > GPR16: 00000000 00000000 00000000 00000004 c01ff498 00000001 cfac94c8 > cfac8000 > GPR24: c01fa87c 00000003 ffff2a2d cfac801c 00000001 00000000 cfac9430 > fd6f8012 > NIP [c00124c4] ioread8+0x2c/0x328 > LR [c00124b0] ioread8+0x18/0x328 > Call Trace: > [cfad3d60] [c002bccc] msleep+0x1c/0x34 (unreliable) > [cfad3d70] [c01fa77c] ata_sff_wait_after_reset+0x6c/0x16c > [cfad3da0] [c01fa934] ata_sff_softreset+0xb8/0x204 > [cfad3de0] [c01f2604] ata_do_reset+0xa0/0xb4 > [cfad3e00] [c01f33ac] ata_eh_reset+0x3e4/0xcf4 > [cfad3e80] [c01f59e8] ata_eh_recover+0x284/0x10e0 > [cfad3f00] [c01f6a0c] ata_do_eh+0x4c/0xb0 > [cfad3f20] [c01f926c] ata_sff_error_handler+0x110/0x140 > [cfad3f40] [c01f7680] ata_scsi_error+0x2ec/0x4e0 > [cfad3f70] [c01d2664] scsi_error_handler+0xc4/0x39c Looks the kernel thread, scsi_error_handler, is still invoked after already removed the actual SATA/PATA device. Then when this handler want to access this nonexistent PCI device IO address, the machine check exception is triggered on PPC. So maybe you should call kthread_stop(shost->ehandler) when hotplug out the device. And re-run this kthread when you insert that again. Tiejun > [cfad3fb0] [c0039d4c] kthread+0x7c/0x80 > [cfad3ff0] [c000f200] kernel_thread+0x4c/0x68 > Instruction dump: > 4e800020 9421fff0 7c0802a6 93e1000c 7c7f1b78 90010014 481835f5 2f830000 > 38600000 419e0018 7c0004ac 881f0000 <0c000000> 4c00012c 5403063e 80010014 > ---[ end trace fb9766f858e66ef2 ]--- > > > -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html