Hello,
On Sat, Nov 9, 2013 at 1:52 PM, Martin Vogt <[email protected]> wrote:
> No. I think the GPF only happens if an application has an open
> file descriptor.
> Just tested ~5 dis/reconnect USB without problem,
> started an application which opens i2c-7 USB disconnect->crash.
I have modified i2cdev_release in i2c-dev.c to:
static int i2cdev_release(struct inode *inode, struct file *file)
{
struct i2c_client *client = file->private_data;
pr_debug("i2c-dev: i2cdev_release -1:%p\n",client);
pr_debug("i2c-dev: i2cdev_release -1a:%p\n",client->adapter);
return 0; // DO NOTHING
i2c_put_adapter(client->adapter);
pr_debug("i2c-dev: i2cdev_release -2\n");
kfree(client);
file->private_data = NULL;
pr_debug("i2c-dev: i2cdev_release -3\n");
return 0;
}
with this the kernel crash is gone.
Thus not calling i2c_put_adapter(client->adapter); helps.
Both pointers (client,client->adapter) are not NULL, but I cannot
say if they contain anything still valid.
But even doing the call to i2c_put_adapter and modifing it to:
void i2c_put_adapter(struct i2c_adapter *adap)
{
pr_debug("i2c-dev: i2c_put_adapter:\n");
//module_put(adap->owner);
}
crashes the kernel. which is strange because its a NOP.
Btw: if the crash occurs a reboot is not necessary.
For testing I have removed the i2c-dev module with:
rmmod -f i2c-dev
regards,
Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html