]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
qdio: clear shared DSCI before scheduling the queue handler
authorJan Glauber <jang@linux.vnet.ibm.com>
Sun, 24 Jul 2011 08:48:00 +0000 (10:48 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 18:40:44 +0000 (11:40 -0700)
commit002c956aab560a58367bf6bc804548d219a5eb45
tree60d11daf80de763f8fa38dddc211cbf3599b8235
parentcfdf7986b6398049c35f8eb6e236d2387ee7ae14
qdio: clear shared DSCI before scheduling the queue handler

commit b02f0c2ea25781e0f94b4fc8f6f85582057857b3 upstream.

The following race can occur with qdio devices that use the shared device
state change indicator:

Device (Shared DSCI)    CPU0                            CPU1
===============================================================================

1. DSCI 0 => 1,
   INT pending
                        2. Thinint handler
                        * si_used = 1
                        * Inbound tasklet_schedule
                        * DSCI 1 => 0

3. DSCI 0 => 1,
   INT pending

                                                        4. Thinint handler
                                                        * si_used = 1
                                                        * Inbound tasklet_schedu
le
                                                           => NOP

                        5. Inbound tasklet run

6. DSCI = 1,
   INT surpressed

                                                        7. DSCI 1 => 0

The race would lead to a stall where new data in the input queue is
not recognized so the device stops working in case of no further traffic.

Fix the race by resetting the DSCI before scheduling the inbound tasklet
so the device generates an interrupt if new data arrives in the above
scenario in step 6.

Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/s390/cio/qdio_thinint.c