Skip to content

Commit f3e59ff

Browse files
oberparVasily Gorbik
authored andcommitted
s390/vmur: remove unnecessary BUG statement
An existing BUG statement in vmur's interrupt handler triggers if: 1. An online vmur device is removed (e.g. due to driver unload, manual unbind or channel-report words indicating hypervisor-side device removal) 2. Device deactivation fails due to firmware/hypervisor error, leaving subchannel enabled for interrupts + drvdata=NULL 3. Interrupt occurs This situation is highly unlikely and not a clear indication of a general system error that would warrant stopping the full Linux system. Also it can be prevented completely by clearing the interrupt handler when unsetting a vmur device's drvdata. Replace the BUG statement in vmur's interrupt handler by clearing the interrupt handler callback during device removal. Also move the initial setting of the interrupt handler callback under lock for consistency reasons. Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 03785a6 commit f3e59ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/s390/char/vmur.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ static void ur_int_handler(struct ccw_device *cdev, unsigned long intparm,
293293
return;
294294
}
295295
urd = dev_get_drvdata(&cdev->dev);
296-
BUG_ON(!urd);
297296
/* On special conditions irb is an error pointer */
298297
if (IS_ERR(irb))
299298
urd->io_request_rc = PTR_ERR(irb);
@@ -809,7 +808,6 @@ static int ur_probe(struct ccw_device *cdev)
809808
rc = -ENOMEM;
810809
goto fail_urdev_put;
811810
}
812-
cdev->handler = ur_int_handler;
813811

814812
/* validate virtual unit record device */
815813
urd->class = get_urd_class(urd);
@@ -823,6 +821,7 @@ static int ur_probe(struct ccw_device *cdev)
823821
}
824822
spin_lock_irq(get_ccwdev_lock(cdev));
825823
dev_set_drvdata(&cdev->dev, urd);
824+
cdev->handler = ur_int_handler;
826825
spin_unlock_irq(get_ccwdev_lock(cdev));
827826

828827
mutex_unlock(&vmur_mutex);
@@ -963,6 +962,7 @@ static void ur_remove(struct ccw_device *cdev)
963962
spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
964963
urdev_put(dev_get_drvdata(&cdev->dev));
965964
dev_set_drvdata(&cdev->dev, NULL);
965+
cdev->handler = NULL;
966966
spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
967967

968968
mutex_unlock(&vmur_mutex);

0 commit comments

Comments
 (0)