Re: [PATCH 4/4] sysfs: make suicidal nodes just do it directly

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Tejun Heo <htejun@...>
Cc: <ebiederm@...>, <greg@...>, <stern@...>, <kay.sievers@...>, <linux-kernel@...>, <rusty@...>
Date: Thursday, September 20, 2007 - 5:24 am

On Thu, 20 Sep 2007 16:26:15 +0900,
Tejun Heo <htejun@gmail.com> wrote:


Just browsing through this (I'll review and do some tests later), but
you missed drivers/s390/cio/device.c::ccw_device_remove_disconnected().

Following (not event compile tested) patch (which is basically a revert
of 59a8a6e227cf0bc42e5be741ebfea97c222ab9ef) should take care of it.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

---
 drivers/s390/cio/device.c |   51 +++++++++-------------------------------------
 1 files changed, 10 insertions(+), 41 deletions(-)

--- linux-2.6.orig/drivers/s390/cio/device.c
+++ linux-2.6/drivers/s390/cio/device.c
@@ -288,62 +288,31 @@ static void ccw_device_unregister(struct
 		device_del(&cdev->dev);
 }
 
-static void ccw_device_remove_orphan_cb(struct device *dev)
-{
-	struct ccw_device *cdev = to_ccwdev(dev);
-
-	ccw_device_unregister(cdev);
-	put_device(&cdev->dev);
-}
-
-static void ccw_device_remove_sch_cb(struct device *dev)
-{
-	struct subchannel *sch;
-
-	sch = to_subchannel(dev);
-	css_sch_device_unregister(sch);
-	/* Reset intparm to zeroes. */
-	sch->schib.pmcw.intparm = 0;
-	cio_modify(sch);
-	put_device(&sch->dev);
-}
-
 static void
 ccw_device_remove_disconnected(struct ccw_device *cdev)
 {
+	struct subchannel *sch;
 	unsigned long flags;
-	int rc;
 
 	/*
 	 * Forced offline in disconnected state means
 	 * 'throw away device'.
 	 */
 	if (ccw_device_is_orphan(cdev)) {
-		/*
-		 * Deregister ccw device.
-		 * Unfortunately, we cannot do this directly from the
-		 * attribute method.
-		 */
+		/* Deregister ccw device. */
 		spin_lock_irqsave(cdev->ccwlock, flags);
 		cdev->private->state = DEV_STATE_NOT_OPER;
 		spin_unlock_irqrestore(cdev->ccwlock, flags);
-		rc = device_schedule_callback(&cdev->dev,
-					      ccw_device_remove_orphan_cb);
-		if (rc)
-			CIO_MSG_EVENT(2, "Couldn't unregister orphan "
-				      "0.%x.%04x\n",
-				      cdev->private->dev_id.ssid,
-				      cdev->private->dev_id.devno);
+		ccw_device_unregister(cdev);
+		put_device(&cdev->dev);
 		return;
 	}
-	/* Deregister subchannel, which will kill the ccw device. */
-	rc = device_schedule_callback(cdev->dev.parent,
-				      ccw_device_remove_sch_cb);
-	if (rc)
-		CIO_MSG_EVENT(2, "Couldn't unregister disconnected device "
-			      "0.%x.%04x\n",
-			      cdev->private->dev_id.ssid,
-			      cdev->private->dev_id.devno);
+	sch = to_subchannel(cdev->dev.parent);
+	css_sch_device_unregister(sch);
+	/* Reset intparm to zeroes. */
+	sch->schib.pmcw.intparm = 0;
+	cio_modify(sch);
+	put_device(&sch->dev);
 }
 
 /**
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCHSET 2/4] sysfs: allow suicide, Tejun Heo, (Thu Sep 20, 3:26 am)
Re: [PATCHSET 2/4] sysfs: allow suicide, Greg KH, (Tue Sep 25, 6:02 pm)
Re: [PATCH 4/4] sysfs: make suicidal nodes just do it directly, Cornelia Huck, (Thu Sep 20, 5:24 am)
Re: [PATCH 1/4] module: implement module_inhibit_unload() , Jonathan Corbet, (Mon Sep 24, 6:00 pm)
Re: [PATCH 1/4] module: implement module_inhibit_unload(), Rusty Russell, (Tue Sep 25, 7:41 pm)
Re: [PATCH 1/4] module: implement module_inhibit_unload(), Rusty Russell, (Mon Sep 24, 7:42 pm)
Re: [PATCH 1/4] module: implement module_inhibit_unload(), Rusty Russell, (Mon Sep 24, 10:12 pm)
Re: [PATCH 1/4] module: implement module_inhibit_unload(), Rusty Russell, (Mon Sep 24, 11:21 pm)
Re: [PATCH 1/4] module: implement module_inhibit_unload(), Rusty Russell, (Tue Sep 25, 12:38 am)
Re: [PATCH 1/4] module: implement module_inhibit_unload(), Rusty Russell, (Tue Sep 25, 4:50 am)
Re: [PATCH 1/4] module: implement module_inhibit_unload(), Cornelia Huck, (Tue Sep 25, 4:01 am)