mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
vfio: ccw: process ssch with interrupts disabled
When we call ssch, an interrupt might already be pending once we return from the START SUBCHANNEL instruction. Therefore we need to make sure interrupts are disabled while holding the subchannel lock until after we're done with our processing. Cc: [email protected] #v4.12+ Reviewed-by: Dong Jia Shi <[email protected]> Acked-by: Halil Pasic <[email protected]> Acked-by: Pierre Morel <[email protected]> Signed-off-by: Cornelia Huck <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
This commit is contained in:
parent
2317b07d05
commit
3368e547c5
1 changed files with 12 additions and 7 deletions
|
|
@ -20,12 +20,12 @@ static int fsm_io_helper(struct vfio_ccw_private *private)
|
|||
int ccode;
|
||||
__u8 lpm;
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
sch = private->sch;
|
||||
|
||||
spin_lock_irqsave(sch->lock, flags);
|
||||
private->state = VFIO_CCW_STATE_BUSY;
|
||||
spin_unlock_irqrestore(sch->lock, flags);
|
||||
|
||||
orb = cp_get_orb(&private->cp, (u32)(addr_t)sch, sch->lpm);
|
||||
|
||||
|
|
@ -38,10 +38,12 @@ static int fsm_io_helper(struct vfio_ccw_private *private)
|
|||
* Initialize device status information
|
||||
*/
|
||||
sch->schib.scsw.cmd.actl |= SCSW_ACTL_START_PEND;
|
||||
return 0;
|
||||
ret = 0;
|
||||
break;
|
||||
case 1: /* Status pending */
|
||||
case 2: /* Busy */
|
||||
return -EBUSY;
|
||||
ret = -EBUSY;
|
||||
break;
|
||||
case 3: /* Device/path not operational */
|
||||
{
|
||||
lpm = orb->cmd.lpm;
|
||||
|
|
@ -51,13 +53,16 @@ static int fsm_io_helper(struct vfio_ccw_private *private)
|
|||
sch->lpm = 0;
|
||||
|
||||
if (cio_update_schib(sch))
|
||||
return -ENODEV;
|
||||
|
||||
return sch->lpm ? -EACCES : -ENODEV;
|
||||
ret = -ENODEV;
|
||||
else
|
||||
ret = sch->lpm ? -EACCES : -ENODEV;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return ccode;
|
||||
ret = ccode;
|
||||
}
|
||||
spin_unlock_irqrestore(sch->lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void fsm_notoper(struct vfio_ccw_private *private,
|
||||
|
|
|
|||
Loading…
Reference in a new issue