spi_mpc83xx driver question

Reeve Yang yang.reeve at gmail.com
Fri Dec 29 11:46:00 EST 2006


Hi there,

I'm developing mmc driver based on spi_mpc83xx driver. Our mmc card is
connect through SPI to mpc8343E. Now the SPI controller is up, but
protocol driver has problem. I have following piece of code:

static struct spi_driver spimmc_driver = {
    .driver = {
        .name = "spimmc",
        .bus  = &spi_bus_type,
        .owner = THIS_MODULE,
    },
    .probe = spimmc_probe,
    .remove = __devexit_p(spimmc_remove),
    .suspend = spimmc_suspend,
    .resume = spimmc_resume,
};

static int __init spimmc_init (void)
{
    return spi_register_driver(&spimmc_driver);
}
module_init(spimmc_init);

Looking at sysfs, the spimmc driver is there, but ".probe" has never
been called. My question is, how this "probe" callback get called
during init? What could be the reason for that guy not being called?

If I call spimmc_probe driectly from spi_mpc83xx.c (for experiment),
kernel failure happened during boot:

[   26.484876] Badness in kref_get at lib/kref.c:32
[   26.489627] Call trace: [c0004fb0]  [c0005200]  [c00048d0]
[c00e3ad0]  [c010a780]  [c010af94]  [c013beec]  [c013b064]  [c013df68]
 [c0256474]  [c010bea
[   26.508407] Oops: kernel access of bad area, sig: 11 [#1]

I really need help from someone to explain it....

Thanks.

- Reeve



More information about the Linuxppc-dev mailing list