Re: [PATCH 0/6] Clean up the sdio_uart driver and fix the tty code

Alan Cox
2009-11-03T12:04:46Z

> With this folded in, the card does work with the full series applied.
> However the kernel is now crashing when the card is pulled out while
> some process is reading from the device. This used to behave well
> before. I don't have time to investigate that one right now though.

Going through it I found one assumption in the tty_port code that wanted
fixing. We would release the port and then try to change the modem lines.

The dtr_rts method didn't claim the function which in conjunction with
that made it crash.

Also the hangup checked your old port->opened which now never got set.

I am scratching my head over some of the other stuff I found however. In
particular port->func can be set to NULL when the device is removed.

The claim method takes the mutex, checks if it is NULL and acts
accordingly but it releases the mutex, which makes it useless as the code
then uses port->func. If I move the release of the mutex to the
release_func method then that fixes almost all cases.

The one I'm stuck on is this

CPU1 CPU2

sdio_uart_irq
sdio_uart_port_remove
port->func = NULL;
sdio_in
BUG_ON

I'm not sure what the required rules on the irq disable/remove are meant
to be here ?

Alan