* [PATCH] first batch of shost sysfs fixes
@ 2003-05-07 13:03 Christoph Hellwig
2003-05-07 14:09 ` Mike Anderson
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2003-05-07 13:03 UTC (permalink / raw)
To: James.Bottomley, andmike; +Cc: linux-scsi
(a) scsi_check_device_busy() is unused now, kill it. Btw, although I
love to see this this really means we need to imply a
scsi_set_device_offline (or even better scsi_set_host_offline)
in scsi_remove_host now..
(b) make shost_class static to scsi_sysfs.c, with the new device model
changes no LLDD needs this anymore
(c) move private prototypes where they belong.
BTW, Mike, did I miss something or will your changes make every driver
converted to scsi_add_host & co OOPS on removal now?
--- 1.60/drivers/scsi/hosts.c Thu May 1 20:10:59 2003
+++ edited/drivers/scsi/hosts.c Wed May 7 14:40:26 2003
@@ -193,52 +193,6 @@
return 0;
}
-static int scsi_check_device_busy(struct scsi_device *sdev)
-{
- struct Scsi_Host *shost = sdev->host;
- struct scsi_cmnd *scmd;
- unsigned long flags;
-
- /*
- * Loop over all of the commands associated with the
- * device. If any of them are busy, then set the state
- * back to inactive and bail.
- */
- spin_lock_irqsave(&sdev->list_lock, flags);
- list_for_each_entry(scmd, &sdev->cmd_list, list) {
- if (scmd->request && scmd->request->rq_status != RQ_INACTIVE)
- goto active;
-
- /*
- * No, this device is really free. Mark it as such, and
- * continue on.
- */
- scmd->state = SCSI_STATE_DISCONNECTING;
- if (scmd->request)
- scmd->request->rq_status = RQ_SCSI_DISCONNECTING;
- }
- spin_unlock_irqrestore(&sdev->list_lock, flags);
-
- return 0;
-
-active:
- printk(KERN_ERR "SCSI device not inactive - rq_status=%d, target=%d, "
- "pid=%ld, state=%d, owner=%d.\n",
- scmd->request->rq_status, scmd->device->id,
- scmd->pid, scmd->state, scmd->owner);
-
- list_for_each_entry(sdev, &shost->my_devices, siblings) {
- list_for_each_entry(scmd, &sdev->cmd_list, list) {
- if (scmd->request->rq_status == RQ_SCSI_DISCONNECTING)
- scmd->request->rq_status = RQ_INACTIVE;
- }
- }
-
- spin_unlock_irqrestore(&sdev->list_lock, flags);
- printk(KERN_ERR "Device busy???\n");
- return 1;
-}
-
/**
* scsi_remove_host - check a scsi host for release and release
* @shost: a pointer to a scsi host to release
--- 1.61/drivers/scsi/hosts.h Thu May 1 20:17:11 2003
+++ edited/drivers/scsi/hosts.h Wed May 7 14:25:40 2003
@@ -590,16 +590,4 @@
return NULL;
}
-/*
- * sysfs support
- */
-extern int scsi_upper_driver_register(struct Scsi_Device_Template *);
-extern void scsi_upper_driver_unregister(struct Scsi_Device_Template *);
-extern int scsi_sysfs_add_host(struct Scsi_Host *, struct device *);
-extern void scsi_sysfs_remove_host(struct Scsi_Host *);
-
-extern void scsi_free_sdev(struct scsi_device *);
-
-extern struct class shost_class;
-
#endif
--- 1.1/drivers/scsi/scsi_priv.h Sun Apr 27 02:40:32 2003
+++ edited/drivers/scsi/scsi_priv.h Wed May 7 14:25:01 2003
@@ -107,15 +108,17 @@
/* scsi_scan.c */
extern void scsi_scan_host(struct Scsi_Host *shost);
extern void scsi_forget_host(struct Scsi_Host *shost);
+extern void scsi_free_sdev(struct scsi_device *);
/* scsi_sysfs.c */
extern int scsi_device_register(struct scsi_device *);
extern void scsi_device_unregister(struct scsi_device *);
extern int scsi_upper_driver_register(struct Scsi_Device_Template *);
extern void scsi_upper_driver_unregister(struct Scsi_Device_Template *);
+extern int scsi_sysfs_add_host(struct Scsi_Host *, struct device *);
+extern void scsi_sysfs_remove_host(struct Scsi_Host *);
extern int scsi_sysfs_register(void);
extern void scsi_sysfs_unregister(void);
-
/*
* dev_info: for the black/white list in the old scsi_static_device_list
--- 1.33/drivers/scsi/scsi_syms.c Thu May 1 18:44:51 2003
+++ edited/drivers/scsi/scsi_syms.c Wed May 7 14:24:01 2003
@@ -107,8 +105,3 @@
*/
EXPORT_SYMBOL(scsi_add_timer);
EXPORT_SYMBOL(scsi_delete_timer);
-
-/*
- * sysfs support
- */
-EXPORT_SYMBOL(shost_class);
--- 1.13/drivers/scsi/scsi_sysfs.c Mon May 5 00:48:20 2003
+++ edited/drivers/scsi/scsi_sysfs.c Wed May 7 14:23:49 2003
@@ -53,7 +53,7 @@
&class_device_attr_unchecked_isa_dma,
};
-struct class shost_class = {
+static struct class shost_class = {
.name = "scsi_host",
};
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] first batch of shost sysfs fixes
2003-05-07 13:03 [PATCH] first batch of shost sysfs fixes Christoph Hellwig
@ 2003-05-07 14:09 ` Mike Anderson
2003-05-08 13:48 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: Mike Anderson @ 2003-05-07 14:09 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: James.Bottomley, linux-scsi
Christoph Hellwig [hch@lst.de] wrote:
> BTW, Mike, did I miss something or will your changes make every driver
> converted to scsi_add_host & co OOPS on removal now?
>
Yes (this is my bad in scsi_host_release), except for scsi_debug. I
think I should come up with a solution that will not cause changing the
~20 callers (at least for this change).
Post you mail the other day I was reworking the whole patch to correct this and
align somewhat with you previous mail. I am reworking the patch against
the merged scsi-misc-2.5.
-andmike
--
Michael Anderson
andmike@us.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] first batch of shost sysfs fixes
2003-05-07 14:09 ` Mike Anderson
@ 2003-05-08 13:48 ` James Bottomley
0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2003-05-08 13:48 UTC (permalink / raw)
To: Mike Anderson; +Cc: Christoph Hellwig, SCSI Mailing List
On Wed, 2003-05-07 at 10:09, Mike Anderson wrote:
> Christoph Hellwig [hch@lst.de] wrote:
> > BTW, Mike, did I miss something or will your changes make every driver
> > converted to scsi_add_host & co OOPS on removal now?
> >
>
> Yes (this is my bad in scsi_host_release), except for scsi_debug. I
> think I should come up with a solution that will not cause changing the
> ~20 callers (at least for this change).
>
> Post you mail the other day I was reworking the whole patch to correct this and
> align somewhat with you previous mail. I am reworking the patch against
> the merged scsi-misc-2.5.
So could you two get this fixed soon? I can't push the tree without the
fix (although I could revert the sysfs class changes). It would also be
nice then to have documentation explaining to driver writers exactly how
they were supposed to be using this mechanism (as a diff to the
scsi_mid_low_api.txt)
James
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-08 13:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-07 13:03 [PATCH] first batch of shost sysfs fixes Christoph Hellwig
2003-05-07 14:09 ` Mike Anderson
2003-05-08 13:48 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox