linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Moore, Eric" <Eric.Moore@lsil.com>
To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: James.Bottomley@SteelEye.com, hch@lst.de, gregkh@novell.com
Subject: [PATCH ] drivers/base/bus.c - export reprobe
Date: Mon, 13 Mar 2006 17:52:40 -0700	[thread overview]
Message-ID: <F331B95B72AFFB4B87467BE1C8E9CF5F36D829@NAMAIL2.ad.lsil.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

Request for exporting device_reprobe - 

Adding support for exposing hidden raid components 
for sg interface. The sdev->no_uld_attach flag
will set set accordingly.

The sas module supports adding/removing raid
volumes using online storage management application
interface.  

This patch was provided to me by Christoph Hellwig.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>

[-- Attachment #2: rescan_device --]
[-- Type: application/octet-stream, Size: 1641 bytes --]

Index: scsi-misc-2.6/drivers/base/bus.c
===================================================================
--- scsi-misc-2.6.orig/drivers/base/bus.c	2006-03-04 13:07:40.000000000 +0100
+++ scsi-misc-2.6/drivers/base/bus.c	2006-03-07 21:06:59.000000000 +0100
@@ -536,6 +536,28 @@
 	bus_for_each_dev(bus, NULL, NULL, bus_rescan_devices_helper);
 }
 
+/**
+ * device_reprobe - remove driver for a device and probe for a new driver
+ * @dev: the device to reprobe
+ *
+ * This function detaches the attached driver (if any) for the given
+ * device and restarts the driver probing process.  It is intended
+ * to use if probing criteria changed during a devices lifetime and
+ * driver attachment should change accordingly.
+ */
+void device_reprobe(struct device *dev)
+{
+	if (dev->driver) {
+		if (dev->parent)        /* Needed for USB */
+			down(&dev->parent->sem);
+		device_release_driver(dev);
+		if (dev->parent)
+			up(&dev->parent->sem);
+	}
+
+	bus_rescan_devices_helper(dev, NULL);
+}
+EXPORT_SYMBOL_GPL(device_reprobe);
 
 struct bus_type * get_bus(struct bus_type * bus)
 {
Index: scsi-misc-2.6/include/linux/device.h
===================================================================
--- scsi-misc-2.6.orig/include/linux/device.h	2006-03-04 13:07:49.000000000 +0100
+++ scsi-misc-2.6/include/linux/device.h	2006-03-07 20:53:43.000000000 +0100
@@ -378,6 +378,7 @@
 extern void device_release_driver(struct device * dev);
 extern int  device_attach(struct device * dev);
 extern void driver_attach(struct device_driver * drv);
+extern void device_reprobe(struct device *dev);
 
 
 /*

             reply	other threads:[~2006-03-14  0:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14  0:52 Moore, Eric [this message]
2006-03-14 15:34 ` [PATCH ] drivers/base/bus.c - export reprobe Greg KH
2006-03-14 17:08   ` Christoph Hellwig
2006-03-14 17:19     ` Greg KH
2006-03-14 17:25       ` Christoph Hellwig
2006-03-14 17:29         ` Greg KH
2006-03-14 17:43           ` James Bottomley
2006-03-14 17:57             ` Greg KH
2006-03-14 22:43               ` James Bottomley
2006-03-14 16:18 Moore, Eric
2006-03-14 16:27 ` Jan-Benedict Glaw
2006-03-14 16:50 ` Greg KH
2006-03-14 22:01 Moore, Eric
2006-03-14 22:31 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F331B95B72AFFB4B87467BE1C8E9CF5F36D829@NAMAIL2.ad.lsil.com \
    --to=eric.moore@lsil.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=gregkh@novell.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).