linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ] drivers/base/bus.c - export reprobe
@ 2006-03-14  0:52 Moore, Eric
  2006-03-14 15:34 ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Moore, Eric @ 2006-03-14  0:52 UTC (permalink / raw)
  To: linux-scsi, linux-kernel; +Cc: James.Bottomley, hch, gregkh

[-- 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);
 
 
 /*

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14  0:52 [PATCH ] drivers/base/bus.c - export reprobe Moore, Eric
@ 2006-03-14 15:34 ` Greg KH
  2006-03-14 17:08   ` Christoph Hellwig
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2006-03-14 15:34 UTC (permalink / raw)
  To: Moore, Eric; +Cc: linux-scsi, linux-kernel, James.Bottomley, hch

On Mon, Mar 13, 2006 at 05:52:40PM -0700, Moore, Eric wrote:
> 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>

base64 for the attachment with DOS line ends?  ugh, can you please fix
this up and resend?

Also, it looks like USB needs to call this function, (based on the
comment)?  Care to switch that code over to have it use it too?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 15:34 ` Greg KH
@ 2006-03-14 17:08   ` Christoph Hellwig
  2006-03-14 17:19     ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2006-03-14 17:08 UTC (permalink / raw)
  To: Greg KH; +Cc: Moore, Eric, linux-scsi, linux-kernel, James.Bottomley, hch

On Tue, Mar 14, 2006 at 07:34:55AM -0800, Greg KH wrote:
> Also, it looks like USB needs to call this function, (based on the
> comment)?  Care to switch that code over to have it use it too?

what comment do you think indicates that?  It's needed for raid drivers
that

  a) expose physical volumes but set the no_uld_attach flag to hide them
     from sd
  b) allow only raid volume creation/deletion so this flag may be set/cleared
     at runtime

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 17:08   ` Christoph Hellwig
@ 2006-03-14 17:19     ` Greg KH
  2006-03-14 17:25       ` Christoph Hellwig
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2006-03-14 17:19 UTC (permalink / raw)
  To: Christoph Hellwig, Moore, Eric, linux-scsi, linux-kernel,
	James.Bottomley, hch

On Tue, Mar 14, 2006 at 05:08:55PM +0000, Christoph Hellwig wrote:
> On Tue, Mar 14, 2006 at 07:34:55AM -0800, Greg KH wrote:
> > Also, it looks like USB needs to call this function, (based on the
> > comment)?  Care to switch that code over to have it use it too?
> 
> what comment do you think indicates that?  It's needed for raid drivers
> that

I saw the:

+       if (dev->driver) {^M
+               if (dev->parent)        /* Needed for USB */^M
+                       down(&dev->parent->sem);^M

portion and thought it came from USB core code somewhere.  Or are you
referring to the need for USB-storage here?

> 
>   a) expose physical volumes but set the no_uld_attach flag to hide them
>      from sd
>   b) allow only raid volume creation/deletion so this flag may be set/cleared
>      at runtime

Ok, fair enough, just was a bit confused.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 17:19     ` Greg KH
@ 2006-03-14 17:25       ` Christoph Hellwig
  2006-03-14 17:29         ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2006-03-14 17:25 UTC (permalink / raw)
  To: Greg KH
  Cc: Christoph Hellwig, Moore, Eric, linux-scsi, linux-kernel,
	James.Bottomley, hch

On Tue, Mar 14, 2006 at 09:19:51AM -0800, Greg KH wrote:
> I saw the:
> 
> +       if (dev->driver) {^M
> +               if (dev->parent)        /* Needed for USB */^M
> +                       down(&dev->parent->sem);^M
> 
> portion and thought it came from USB core code somewhere.  Or are you
> referring to the need for USB-storage here?

It's copied from a runtime close to this one in the driver core.
Unfortunately it's not easily sharable so I duplicated those few lines.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 17:25       ` Christoph Hellwig
@ 2006-03-14 17:29         ` Greg KH
  2006-03-14 17:43           ` James Bottomley
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2006-03-14 17:29 UTC (permalink / raw)
  To: Christoph Hellwig, Moore, Eric, linux-scsi, linux-kernel,
	James.Bottomley, hch

On Tue, Mar 14, 2006 at 05:25:43PM +0000, Christoph Hellwig wrote:
> On Tue, Mar 14, 2006 at 09:19:51AM -0800, Greg KH wrote:
> > I saw the:
> > 
> > +       if (dev->driver) {^M
> > +               if (dev->parent)        /* Needed for USB */^M
> > +                       down(&dev->parent->sem);^M
> > 
> > portion and thought it came from USB core code somewhere.  Or are you
> > referring to the need for USB-storage here?
> 
> It's copied from a runtime close to this one in the driver core.
> Unfortunately it's not easily sharable so I duplicated those few lines.

Ah, ok, that makes more sense.

Eric, care to resend without the mime crud so I can apply it?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 17:29         ` Greg KH
@ 2006-03-14 17:43           ` James Bottomley
  2006-03-14 17:57             ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: James Bottomley @ 2006-03-14 17:43 UTC (permalink / raw)
  To: Greg KH; +Cc: Christoph Hellwig, Moore, Eric, linux-scsi, linux-kernel, hch

On Tue, 2006-03-14 at 09:29 -0800, Greg KH wrote:
> Ah, ok, that makes more sense.
> 
> Eric, care to resend without the mime crud so I can apply it?

Actually, would it be OK if you sign off on this and I take it via the
scsi tree?  Otherwise there'll be a nasty cross dependency between
scsi-misc and usb and I'll spend the next week explaining what trees you
need to pull in to get scsi-misc to build.

Thanks,

James

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 17:43           ` James Bottomley
@ 2006-03-14 17:57             ` Greg KH
  2006-03-14 22:43               ` James Bottomley
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2006-03-14 17:57 UTC (permalink / raw)
  To: James Bottomley
  Cc: Christoph Hellwig, Moore, Eric, linux-scsi, linux-kernel, hch

On Tue, Mar 14, 2006 at 11:43:30AM -0600, James Bottomley wrote:
> On Tue, 2006-03-14 at 09:29 -0800, Greg KH wrote:
> > Ah, ok, that makes more sense.
> > 
> > Eric, care to resend without the mime crud so I can apply it?
> 
> Actually, would it be OK if you sign off on this and I take it via the
> scsi tree?  Otherwise there'll be a nasty cross dependency between
> scsi-misc and usb and I'll spend the next week explaining what trees you
> need to pull in to get scsi-misc to build.

Sure, that makes a lot of sense:

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Oh, and please make that scsi wrapper function either
EXPORT_SYMBOL_GPL() or an inline function or macro.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 17:57             ` Greg KH
@ 2006-03-14 22:43               ` James Bottomley
  0 siblings, 0 replies; 14+ messages in thread
From: James Bottomley @ 2006-03-14 22:43 UTC (permalink / raw)
  To: Greg KH; +Cc: Christoph Hellwig, Moore, Eric, linux-scsi, linux-kernel, hch

On Tue, 2006-03-14 at 09:57 -0800, Greg KH wrote:
> On Tue, Mar 14, 2006 at 11:43:30AM -0600, James Bottomley wrote:
> > Actually, would it be OK if you sign off on this and I take it via the
> > scsi tree?  Otherwise there'll be a nasty cross dependency between
> > scsi-misc and usb and I'll spend the next week explaining what trees you
> > need to pull in to get scsi-misc to build.
> 
> Sure, that makes a lot of sense:
> 
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

OK, got it in scsi-misc, thanks.

> Oh, and please make that scsi wrapper function either
> EXPORT_SYMBOL_GPL() or an inline function or macro.

I've put it in as an inline function.

James



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 22:01 Moore, Eric
@ 2006-03-14 22:31 ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2006-03-14 22:31 UTC (permalink / raw)
  To: Moore, Eric
  Cc: James Bottomley, Christoph Hellwig, linux-scsi, linux-kernel, hch

On Tue, Mar 14, 2006 at 03:01:05PM -0700, Moore, Eric wrote:
> On Tuesday, March 14, 2006 10:58 AM,  Greg KH wrote:
> 
> > 
> > Sure, that makes a lot of sense:
> > 
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> > 
> > Oh, and please make that scsi wrapper function either
> > EXPORT_SYMBOL_GPL() or an inline function or macro.
> > 
> > thanks,
> > 
> 
> 
> Here we go again (hopefully no managled this time).

Nope, still in base64 :(

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH ] drivers/base/bus.c - export reprobe
@ 2006-03-14 22:01 Moore, Eric
  2006-03-14 22:31 ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Moore, Eric @ 2006-03-14 22:01 UTC (permalink / raw)
  To: Greg KH, James Bottomley; +Cc: Christoph Hellwig, linux-scsi, linux-kernel, hch

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

On Tuesday, March 14, 2006 10:58 AM,  Greg KH wrote:

> 
> Sure, that makes a lot of sense:
> 
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> 
> Oh, and please make that scsi wrapper function either
> EXPORT_SYMBOL_GPL() or an inline function or macro.
> 
> thanks,
> 


Here we go again (hopefully no managled this time).

I'll repost the other patch with EXPORT_SYMBOL_GPL.

Eric Moore


[-- Attachment #2: rescan_device --]
[-- Type: application/octet-stream, Size: 1596 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);
 
 
 /*

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 16:18 Moore, Eric
  2006-03-14 16:27 ` Jan-Benedict Glaw
@ 2006-03-14 16:50 ` Greg KH
  1 sibling, 0 replies; 14+ messages in thread
From: Greg KH @ 2006-03-14 16:50 UTC (permalink / raw)
  To: Moore, Eric; +Cc: linux-scsi, linux-kernel, James.Bottomley, hch

On Tue, Mar 14, 2006 at 09:18:18AM -0700, Moore, Eric wrote:
> On Tuesday, March 14, 2006 8:35 AM,  Greg KH wrote:
> 
> > 
> > base64 for the attachment with DOS line ends?  ugh, can you please fix
> > this up and resend?
> > 
> 
> Here is repost of patch due to dos line endings.

Nope, still there, and still in base64 :(

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH ] drivers/base/bus.c - export reprobe
  2006-03-14 16:18 Moore, Eric
@ 2006-03-14 16:27 ` Jan-Benedict Glaw
  2006-03-14 16:50 ` Greg KH
  1 sibling, 0 replies; 14+ messages in thread
From: Jan-Benedict Glaw @ 2006-03-14 16:27 UTC (permalink / raw)
  To: Moore, Eric; +Cc: Greg KH, linux-scsi, linux-kernel, James.Bottomley, hch

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

On Tue, 2006-03-14 09:18:18 -0700, Moore, Eric <Eric.Moore@lsil.com> wrote:
> On Tuesday, March 14, 2006 8:35 AM,  Greg KH wrote:
> > base64 for the attachment with DOS line ends?  ugh, can you please fix
> > this up and resend?
> 
> Here is repost of patch due to dos line endings.

Mangled again...

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH ] drivers/base/bus.c - export reprobe
@ 2006-03-14 16:18 Moore, Eric
  2006-03-14 16:27 ` Jan-Benedict Glaw
  2006-03-14 16:50 ` Greg KH
  0 siblings, 2 replies; 14+ messages in thread
From: Moore, Eric @ 2006-03-14 16:18 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-scsi, linux-kernel, James.Bottomley, hch

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

On Tuesday, March 14, 2006 8:35 AM,  Greg KH wrote:

> 
> base64 for the attachment with DOS line ends?  ugh, can you please fix
> this up and resend?
> 

Here is repost of patch due to dos line endings.



[-- 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);
 
 
 /*

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-03-14 22:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-14  0:52 [PATCH ] drivers/base/bus.c - export reprobe Moore, Eric
2006-03-14 15:34 ` 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

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).