Sfoglia il codice sorgente

[S390] cio: quiesce subchannel in io_subchannel_remove

Ensure that there will be no more interrupts for an
unregistered device by using the same quiesce and disable loop
as in io_subchannel_shutdown.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Sebastian Ott 15 anni fa
parent
commit
6e9a0f67de
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 9 1
      drivers/s390/cio/device.c

+ 9 - 1
drivers/s390/cio/device.c

@@ -1059,6 +1059,8 @@ out_schedule:
 	return 0;
 	return 0;
 }
 }
 
 
+static void io_subchannel_quiesce(struct subchannel *);
+
 static int
 static int
 io_subchannel_remove (struct subchannel *sch)
 io_subchannel_remove (struct subchannel *sch)
 {
 {
@@ -1068,6 +1070,7 @@ io_subchannel_remove (struct subchannel *sch)
 	cdev = sch_get_cdev(sch);
 	cdev = sch_get_cdev(sch);
 	if (!cdev)
 	if (!cdev)
 		goto out_free;
 		goto out_free;
+	io_subchannel_quiesce(sch);
 	/* Set ccw device to not operational and drop reference. */
 	/* Set ccw device to not operational and drop reference. */
 	spin_lock_irqsave(cdev->ccwlock, flags);
 	spin_lock_irqsave(cdev->ccwlock, flags);
 	sch_set_cdev(sch, NULL);
 	sch_set_cdev(sch, NULL);
@@ -1150,7 +1153,7 @@ static int io_subchannel_chp_event(struct subchannel *sch,
 	return 0;
 	return 0;
 }
 }
 
 
-static void io_subchannel_shutdown(struct subchannel *sch)
+static void io_subchannel_quiesce(struct subchannel *sch)
 {
 {
 	struct ccw_device *cdev;
 	struct ccw_device *cdev;
 	int ret;
 	int ret;
@@ -1182,6 +1185,11 @@ out_unlock:
 	spin_unlock_irq(sch->lock);
 	spin_unlock_irq(sch->lock);
 }
 }
 
 
+static void io_subchannel_shutdown(struct subchannel *sch)
+{
+	io_subchannel_quiesce(sch);
+}
+
 static int device_is_disconnected(struct ccw_device *cdev)
 static int device_is_disconnected(struct ccw_device *cdev)
 {
 {
 	if (!cdev)
 	if (!cdev)