* [RFC] scsi host sysfs support [0/4]
@ 2003-04-14 18:37 Mike Anderson
2003-04-14 18:39 ` [RFC] scsi host sysfs support [1/4] Mike Anderson
2003-04-14 23:02 ` [RFC] scsi host sysfs support [0/4] Patrick Mochel
0 siblings, 2 replies; 9+ messages in thread
From: Mike Anderson @ 2003-04-14 18:37 UTC (permalink / raw)
To: linux-scsi; +Cc: mochel, linux-hotplug-devel, mdharm-scsi
This patch set is against 2.5.67 current. It will not apply to scsi-miscs-2.5
as the decl_subsys macro has added a third argument.
This patch set changes the sysfs support for scsi hosts.
- Removes the previous support of shost_devclass device class.
- Modifies scsi_debug to support the new order of object cleanup and also
changes the structure of sdebug_host_info to help in object cleanup.
- Creates a scsi subsystem. This is rooted at the top of the sysfs tree.
- Creates a scsi_host subsystem under the scsi subsystem. Modified the
cleanup in scsi remove host. Switched to a kobject embedded in
scsi_host. If a driver has not be converted to the driver model or does
not use the scsi_set_device call it will still show up in the scsi_host
subsystem, but will not have a symlink to the parent.
The usage of driver model classes for scsi hosts was removed because many
of our drivers have not been converted to the driver model so this gave an
inconsistent model to count on for cleanup and migration of some the
procfs support. I tried adding some fake structures to use classes, but it
failed to cleanup properly do to asymmetric cleanup interfaces in the core
code and also did not seem like the correct direction to go.
This change allows for host cleanup when sysfs references drop to zero
(there still needs be work done on scsi mid get / put calls).
I have tested the insmod / rmmod cycle with scsi_debug and booted with the
ips and aic drivers.
Current Known Issues:
- Current users of scsi_remove_host will need to have there
cleanup reordered to support the restoration of the call to the
Scsi_Host_Template release.
- Callers of scsi_set_device should be migrated off this interface
if possible.
- Need better name for symlink than adapter.
Example tree:
[root@elm3a49 sys]# tree -d scsi
scsi
`-- scsi_host
|-- host0
| |-- 0:0:0:0
| | |-- 0:0:0:0:gen
| | `-- block -> ../../../../block/sda
| |-- 0:0:15:0
| | `-- 0:0:15:0:gen
| |-- 0:0:1:0
| | |-- 0:0:1:0:gen
| | `-- block -> ../../../../block/sdb
| |-- 0:1:15:0
| | `-- 0:1:15:0:gen
| `-- adapter -> ../../../devices/pci0/00:09.0
|-- host1
| `-- adapter -> ../../../devices/pci1/01:03.0
|-- host3
| |-- 3:0:0:0
| | |-- 3:0:0:0:gen
| | `-- block -> ../../../../block/sdc
| `-- adapter -> ../../../devices/pseudo_0/adapter0
`-- host4
|-- 4:0:0:0
| |-- 4:0:0:0:gen
| `-- block -> ../../../../block/sdd
|-- 4:0:4:0
| |-- 4:0:4:0:gen
| |-- 4:0:4:0:mt
| |-- 4:0:4:0:mta
| |-- 4:0:4:0:mtan
| |-- 4:0:4:0:mtl
| |-- 4:0:4:0:mtln
| |-- 4:0:4:0:mtm
| |-- 4:0:4:0:mtmn
| `-- 4:0:4:0:mtn
|-- 4:0:5:0
| |-- 4:0:5:0:gen
| `-- block -> ../../../../block/sr0
`-- adapter -> ../../../devices/pci1/01:03.1
-andmike
--
Michael Anderson
andmike@us.ibm.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC] scsi host sysfs support [1/4]
2003-04-14 18:37 [RFC] scsi host sysfs support [0/4] Mike Anderson
@ 2003-04-14 18:39 ` Mike Anderson
2003-04-14 18:40 ` [RFC] scsi host sysfs support [2/4] Mike Anderson
2003-04-14 23:02 ` [RFC] scsi host sysfs support [0/4] Patrick Mochel
1 sibling, 1 reply; 9+ messages in thread
From: Mike Anderson @ 2003-04-14 18:39 UTC (permalink / raw)
To: linux-scsi, mochel, linux-hotplug-devel, mdharm-scsi
-andmike
--
Michael Anderson
andmike@us.ibm.com
DESC
This patch removes the shost_devclass device class support that was
previously added, but incomplete.
EDESC
drivers/acorn/scsi/acornscsi.c | 1 -
drivers/acorn/scsi/arxescsi.c | 1 -
drivers/acorn/scsi/cumana_1.c | 1 -
drivers/acorn/scsi/cumana_2.c | 1 -
drivers/acorn/scsi/eesox.c | 1 -
drivers/acorn/scsi/oak.c | 1 -
drivers/acorn/scsi/powertec.c | 1 -
drivers/scsi/hosts.h | 1 -
drivers/scsi/scsi_debug.c | 1 -
drivers/scsi/scsi_syms.c | 4 ----
drivers/scsi/scsi_sysfs.c | 25 -------------------------
11 files changed, 38 deletions(-)
diff -puN drivers/acorn/scsi/acornscsi.c~shost-devclass-clean drivers/acorn/scsi/acornscsi.c
--- sysfs-bleed-2.5/drivers/acorn/scsi/acornscsi.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/acorn/scsi/acornscsi.c Mon Apr 14 10:11:07 2003
@@ -3110,7 +3110,6 @@ static struct ecard_driver acornscsi_dri
.remove = __devexit_p(acornscsi_remove),
.id_table = acornscsi_cids,
.drv = {
- .devclass = &shost_devclass,
.name = "acornscsi",
},
};
diff -puN drivers/acorn/scsi/arxescsi.c~shost-devclass-clean drivers/acorn/scsi/arxescsi.c
--- sysfs-bleed-2.5/drivers/acorn/scsi/arxescsi.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/acorn/scsi/arxescsi.c Mon Apr 14 10:11:07 2003
@@ -397,7 +397,6 @@ static struct ecard_driver arxescsi_driv
.remove = __devexit_p(arxescsi_remove),
.id_table = arxescsi_cids,
.drv = {
- .devclass = &shost_devclass,
.name = "arxescsi",
},
};
diff -puN drivers/acorn/scsi/cumana_1.c~shost-devclass-clean drivers/acorn/scsi/cumana_1.c
--- sysfs-bleed-2.5/drivers/acorn/scsi/cumana_1.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/acorn/scsi/cumana_1.c Mon Apr 14 10:11:07 2003
@@ -334,7 +334,6 @@ static struct ecard_driver cumanascsi1_d
.remove = __devexit_p(cumanascsi1_remove),
.id_table = cumanascsi1_cids,
.drv = {
- .devclass = &shost_devclass,
.name = "cumanascsi1",
},
};
diff -puN drivers/acorn/scsi/cumana_2.c~shost-devclass-clean drivers/acorn/scsi/cumana_2.c
--- sysfs-bleed-2.5/drivers/acorn/scsi/cumana_2.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/acorn/scsi/cumana_2.c Mon Apr 14 10:11:07 2003
@@ -572,7 +572,6 @@ static struct ecard_driver cumanascsi2_d
.remove = __devexit_p(cumanascsi2_remove),
.id_table = cumanascsi2_cids,
.drv = {
- .devclass = &shost_devclass,
.name = "cumanascsi2",
},
};
diff -puN drivers/acorn/scsi/eesox.c~shost-devclass-clean drivers/acorn/scsi/eesox.c
--- sysfs-bleed-2.5/drivers/acorn/scsi/eesox.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/acorn/scsi/eesox.c Mon Apr 14 10:11:07 2003
@@ -679,7 +679,6 @@ static struct ecard_driver eesoxscsi_dri
.remove = __devexit_p(eesoxscsi_remove),
.id_table = eesoxscsi_cids,
.drv = {
- .devclass = &shost_devclass,
.name = "eesoxscsi",
},
};
diff -puN drivers/acorn/scsi/oak.c~shost-devclass-clean drivers/acorn/scsi/oak.c
--- sysfs-bleed-2.5/drivers/acorn/scsi/oak.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/acorn/scsi/oak.c Mon Apr 14 10:11:07 2003
@@ -192,7 +192,6 @@ static struct ecard_driver oakscsi_drive
.remove = __devexit_p(oakscsi_remove),
.id_table = oakscsi_cids,
.drv = {
- .devclass = &shost_devclass,
.name = "oakscsi",
},
};
diff -puN drivers/acorn/scsi/powertec.c~shost-devclass-clean drivers/acorn/scsi/powertec.c
--- sysfs-bleed-2.5/drivers/acorn/scsi/powertec.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/acorn/scsi/powertec.c Mon Apr 14 10:11:07 2003
@@ -475,7 +475,6 @@ static struct ecard_driver powertecscsi_
.remove = __devexit_p(powertecscsi_remove),
.id_table = powertecscsi_cids,
.drv = {
- .devclass = &shost_devclass,
.name = "powertecscsi",
},
};
diff -puN drivers/scsi/hosts.h~shost-devclass-clean drivers/scsi/hosts.h
--- sysfs-bleed-2.5/drivers/scsi/hosts.h~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/hosts.h Mon Apr 14 10:11:07 2003
@@ -612,7 +612,6 @@ static inline Scsi_Device *scsi_find_dev
extern int scsi_upper_driver_register(struct Scsi_Device_Template *);
extern void scsi_upper_driver_unregister(struct Scsi_Device_Template *);
-extern struct device_class shost_devclass;
#endif
/*
diff -puN drivers/scsi/scsi_debug.c~shost-devclass-clean drivers/scsi/scsi_debug.c
--- sysfs-bleed-2.5/drivers/scsi/scsi_debug.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi_debug.c Mon Apr 14 10:11:07 2003
@@ -183,7 +183,6 @@ static struct device_driver sdebug_drive
.name = sdebug_proc_name,
.probe = sdebug_driver_probe,
.remove = sdebug_driver_remove,
- .devclass = &shost_devclass,
};
static const int check_condition_result =
diff -puN drivers/scsi/scsi_syms.c~shost-devclass-clean drivers/scsi/scsi_syms.c
--- sysfs-bleed-2.5/drivers/scsi/scsi_syms.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi_syms.c Mon Apr 14 10:11:07 2003
@@ -108,7 +108,3 @@ extern int scsi_delete_timer(Scsi_Cmnd *
EXPORT_SYMBOL(scsi_add_timer);
EXPORT_SYMBOL(scsi_delete_timer);
-/*
- * sysfs support
- */
-EXPORT_SYMBOL(shost_devclass);
diff -puN drivers/scsi/scsi_sysfs.c~shost-devclass-clean drivers/scsi/scsi_sysfs.c
--- sysfs-bleed-2.5/drivers/scsi/scsi_sysfs.c~shost-devclass-clean Mon Apr 14 10:11:07 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi_sysfs.c Mon Apr 14 10:11:07 2003
@@ -52,34 +52,10 @@ static struct device_attribute *const sh
&dev_attr_unchecked_isa_dma,
};
-/**
- * scsi_host_class_name_show - copy out the SCSI host name
- * @dev: device to check
- * @page: copy data into this area
- * @count: number of bytes to copy
- * @off: start at this offset in page
- * Return:
- * number of bytes written into page.
- **/
-static ssize_t scsi_host_class_name_show(struct device *dev, char *page)
-{
- struct Scsi_Host *shost;
-
- shost = to_scsi_host(dev);
-
- if (!shost)
- return 0;
-
- return snprintf(page, 20, "scsi%d\n", shost->host_no);
-}
-
-DEVICE_ATTR(class_name, S_IRUGO, scsi_host_class_name_show, NULL);
-
static int scsi_host_class_add_dev(struct device * dev)
{
int i;
- device_create_file(dev, &dev_attr_class_name);
for (i = 0; i < ARRAY_SIZE(shost_attrs); i++)
device_create_file(dev, shost_attrs[i]);
@@ -92,7 +68,6 @@ static void scsi_host_class_rm_dev(struc
for (i = 0; i < ARRAY_SIZE(shost_attrs); i++)
device_remove_file(dev, shost_attrs[i]);
- device_remove_file(dev, &dev_attr_class_name);
}
struct device_class shost_devclass = {
_
^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC] scsi host sysfs support [2/4]
2003-04-14 18:39 ` [RFC] scsi host sysfs support [1/4] Mike Anderson
@ 2003-04-14 18:40 ` Mike Anderson
2003-04-14 18:41 ` [RFC] scsi host sysfs support [3/4] Mike Anderson
0 siblings, 1 reply; 9+ messages in thread
From: Mike Anderson @ 2003-04-14 18:40 UTC (permalink / raw)
To: linux-scsi, mochel, linux-hotplug-devel, mdharm-scsi
-andmike
--
Michael Anderson
andmike@us.ibm.com
DESC
This patch changes the structure of sdebug_host_info and changes the
method / order of driver model cleanup.
EDESC
drivers/scsi/scsi_debug.c | 199 ++++++++++++++++++++++------------------------
drivers/scsi/scsi_debug.h | 2
2 files changed, 100 insertions(+), 101 deletions(-)
diff -puN drivers/scsi/scsi_debug.c~scsi_debug-sysfs drivers/scsi/scsi_debug.c
--- sysfs-bleed-2.5/drivers/scsi/scsi_debug.c~scsi_debug-sysfs Mon Apr 14 10:11:19 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi_debug.c Mon Apr 14 10:11:19 2003
@@ -144,10 +144,13 @@ struct sdebug_dev_info {
struct sdebug_host_info {
struct list_head host_list;
struct Scsi_Host *shost;
- struct device *dev;
+ struct device dev;
struct list_head dev_info_list;
};
+#define to_sdebug_host(d) \
+ container_of(d, struct sdebug_host_info, dev)
+
static LIST_HEAD(sdebug_host_list);
static spinlock_t sdebug_host_list_lock = SPIN_LOCK_UNLOCKED;
@@ -224,22 +227,6 @@ static struct bus_type pseudo_lld_bus;
static int scsi_debug_register_driver(struct device_driver *);
static int scsi_debug_unregister_driver(struct device_driver *);
-static struct sdebug_host_info *
- sdebug_shost_to_host_info(struct Scsi_Host *shost)
-{
- struct sdebug_host_info * sdbg_host, * found = NULL;
-
- spin_lock(&sdebug_host_list_lock);
- list_for_each_entry(sdbg_host, &sdebug_host_list, host_list) {
- if (sdbg_host->shost == shost) {
- found = sdbg_host;
- break;
- }
- }
- spin_unlock(&sdebug_host_list_lock);
- return found;
-}
-
static unsigned char * scatg2virt(const struct scatterlist * sclp)
{
if (NULL == sclp)
@@ -938,9 +925,9 @@ static struct sdebug_dev_info * devInfoR
if (devip)
return devip;
- sdbg_host = sdebug_shost_to_host_info(sdev->host);
+ sdbg_host = *(struct sdebug_host_info **) sdev->host->hostdata;
if(! sdbg_host) {
- printk(KERN_ERR "Unable to locate host info\n");
+ printk(KERN_ERR "Host info NULL\n");
return NULL;
}
list_for_each_entry(devip, &sdbg_host->dev_info_list, dev_list) {
@@ -1040,7 +1027,7 @@ static int scsi_debug_bus_reset(struct s
printk(KERN_INFO "scsi_debug: bus_reset\n");
++num_bus_resets;
if (SCpnt && ((sdp = SCpnt->device)) && ((hp = sdp->host))) {
- sdbg_host = sdebug_shost_to_host_info(hp);
+ sdbg_host = ( struct sdebug_host_info *) hp->hostdata;
if (sdbg_host) {
list_for_each_entry(dev_info,
&sdbg_host->dev_info_list,
@@ -1521,8 +1508,11 @@ static int __init scsi_debug_init(void)
static void __exit scsi_debug_exit(void)
{
- /* free up adapters here ?? */
+ int k;
+
stop_all_queued();
+ for (k = 0; k < scsi_debug_add_host; k++)
+ sdebug_remove_adapter();
do_remove_driverfs_files();
scsi_debug_unregister_driver(&sdebug_driverfs_driver);
bus_unregister(&pseudo_lld_bus);
@@ -1566,35 +1556,74 @@ static int scsi_debug_unregister_driver(
static void sdebug_release_adapter(struct device * dev)
{
- kfree(dev);
+ struct sdebug_host_info *sdbg_host;
+
+ sdbg_host = to_sdebug_host(dev);
+ kfree(sdbg_host);
}
static int sdebug_add_adapter()
{
- struct device * dev;
- int error;
+ int k, devs_per_host;
+ int error = 0;
+ struct sdebug_host_info *sdbg_host;
+ struct sdebug_dev_info *sdbg_devinfo;
+ struct list_head *lh, *lh_sf;
- dev = kmalloc(sizeof(*dev),GFP_KERNEL);
- if (NULL == dev) {
+ sdbg_host = kmalloc(sizeof(*sdbg_host),GFP_KERNEL);
+
+ if (NULL == sdbg_host) {
printk(KERN_ERR "%s: out of memory at line %d\n",
__FUNCTION__, __LINE__);
return -ENOMEM;
}
- memset(dev, 0, sizeof(*dev));
- dev->bus = &pseudo_lld_bus;
- dev->parent = &pseudo_primary;
- dev->release = &sdebug_release_adapter;
- sprintf(dev->name, "scsi debug adapter");
- sprintf(dev->bus_id, "adapter%d", scsi_debug_add_host);
+ memset(sdbg_host, 0, sizeof(*sdbg_host));
+ INIT_LIST_HEAD(&sdbg_host->dev_info_list);
+
+ devs_per_host = scsi_debug_num_tgts * scsi_debug_max_luns;
+ for (k = 0; k < devs_per_host; k++) {
+ sdbg_devinfo = kmalloc(sizeof(*sdbg_devinfo),GFP_KERNEL);
+ if (NULL == sdbg_devinfo) {
+ printk(KERN_ERR "%s: out of memory at line %d\n",
+ __FUNCTION__, __LINE__);
+ error = -ENOMEM;
+ goto clean1;
+ }
+ memset(sdbg_devinfo, 0, sizeof(*sdbg_devinfo));
+ sdbg_devinfo->sdbg_host = sdbg_host;
+ list_add_tail(&sdbg_devinfo->dev_list,
+ &sdbg_host->dev_info_list);
+ }
+
+ spin_lock(&sdebug_host_list_lock);
+ list_add_tail(&sdbg_host->host_list, &sdebug_host_list);
+ spin_unlock(&sdebug_host_list_lock);
- error = device_register(dev);
+ sdbg_host->dev.bus = &pseudo_lld_bus;
+ sdbg_host->dev.parent = &pseudo_primary;
+ sdbg_host->dev.release = &sdebug_release_adapter;
+ sprintf(sdbg_host->dev.name, "scsi debug adapter");
+ sprintf(sdbg_host->dev.bus_id, "adapter%d", scsi_debug_add_host);
+
+ error = device_register(&sdbg_host->dev);
if (error)
- kfree(dev);
- else
- ++scsi_debug_add_host;
+ goto clean2;
+ ++scsi_debug_add_host;
+ return error;
+
+clean2:
+ list_for_each_safe(lh, lh_sf, &sdbg_host->dev_info_list) {
+ sdbg_devinfo = list_entry(lh, struct sdebug_dev_info,
+ dev_list);
+ list_del(&sdbg_devinfo->dev_list);
+ kfree(sdbg_devinfo);
+ }
+
+clean1:
+ kfree(sdbg_host);
return error;
}
@@ -1603,51 +1632,29 @@ static void sdebug_remove_adapter()
struct sdebug_host_info * sdbg_host = NULL;
spin_lock(&sdebug_host_list_lock);
- if (!list_empty(&sdebug_host_list))
+ if (!list_empty(&sdebug_host_list)) {
sdbg_host = list_entry(sdebug_host_list.prev,
struct sdebug_host_info, host_list);
+ list_del(&sdbg_host->host_list);
+ }
spin_unlock(&sdebug_host_list_lock);
- device_unregister(sdbg_host->dev);
+ if (!sdbg_host)
+ return;
+
+ device_unregister(&sdbg_host->dev);
--scsi_debug_add_host;
}
static int sdebug_driver_probe(struct device * dev)
{
- int k, devs_per_host;
int error = 0;
struct sdebug_host_info *sdbg_host;
- struct sdebug_dev_info *sdbg_devinfo;
- struct list_head *lh, *lh_sf;
struct Scsi_Host *hpnt;
- sdbg_host = kmalloc(sizeof(*sdbg_host),GFP_KERNEL);
- if (NULL == sdbg_host) {
- printk(KERN_ERR "%s: out of memory at line %d\n",
- __FUNCTION__, __LINE__);
- return -ENOMEM;
- }
- memset(sdbg_host, 0, sizeof(*sdbg_host));
-
- INIT_LIST_HEAD(&sdbg_host->dev_info_list);
+ sdbg_host = to_sdebug_host(dev);
- devs_per_host = scsi_debug_num_tgts * scsi_debug_max_luns;
- for (k = 0; k < devs_per_host; k++) {
- sdbg_devinfo = kmalloc(sizeof(*sdbg_devinfo),GFP_KERNEL);
- if (NULL == sdbg_devinfo) {
- printk(KERN_ERR "%s: out of memory at line %d\n",
- __FUNCTION__, __LINE__);
- error = -ENOMEM;
- }
- memset(sdbg_devinfo, 0, sizeof(*sdbg_devinfo));
- sdbg_devinfo->sdbg_host = sdbg_host;
- list_add_tail(&sdbg_devinfo->dev_list,
- &sdbg_host->dev_info_list);
- }
-
- list_add_tail(&sdbg_host->host_list, &sdebug_host_list);
-
- hpnt = scsi_register(&sdebug_driver_template, 0);
+ hpnt = scsi_register(&sdebug_driver_template, sizeof(sdbg_host));
if (NULL == hpnt) {
printk(KERN_ERR "%s: scsi_register failed\n", __FUNCTION__);
error = -ENODEV;
@@ -1655,14 +1662,14 @@ static int sdebug_driver_probe(struct de
}
sdbg_host->shost = hpnt;
- sdbg_host->dev = dev;
+ *((struct sdebug_host_info **)hpnt->hostdata) = sdbg_host;
if ((hpnt->this_id >= 0) && (scsi_debug_num_tgts > hpnt->this_id))
hpnt->max_id = scsi_debug_num_tgts + 1;
else
hpnt->max_id = scsi_debug_num_tgts;
hpnt->max_lun = scsi_debug_max_luns;
- error = scsi_add_host(hpnt, sdbg_host->dev);
+ error = scsi_add_host(hpnt, &sdbg_host->dev);
if (error) {
printk(KERN_ERR "%s: scsi_add_host failed\n", __FUNCTION__);
error = -ENODEV;
@@ -1675,47 +1682,24 @@ static int sdebug_driver_probe(struct de
clean2:
scsi_unregister(hpnt);
clean1:
- list_for_each_safe(lh, lh_sf, &sdbg_host->dev_info_list) {
- sdbg_devinfo = list_entry(lh, struct sdebug_dev_info,
- dev_list);
- list_del(&sdbg_devinfo->dev_list);
- kfree(sdbg_devinfo);
- }
-
kfree(sdbg_host);
return error;
}
-static int sdebug_driver_remove(struct device * dev)
+static int scsi_debug_release(struct Scsi_Host * shost)
{
struct list_head *lh, *lh_sf;
struct sdebug_dev_info *sdbg_devinfo;
- struct sdebug_host_info *sdbg_host, *found = NULL;
-
- spin_lock(&sdebug_host_list_lock);
- list_for_each_entry(sdbg_host, &sdebug_host_list, host_list) {
- if (sdbg_host->dev == dev) {
- list_del(&sdbg_host->host_list);
- found = sdbg_host;
- break;
- }
- }
- spin_unlock(&sdebug_host_list_lock);
-
- if (!found) {
- printk(KERN_ERR "%s: sdebug_host_info not found\n",
- __FUNCTION__);
- return -ENODEV;
- }
+ struct sdebug_host_info *sdbg_host;
+ sdbg_host = *(struct sdebug_host_info **)shost->hostdata;
+ scsi_unregister(shost);
- if (scsi_remove_host(sdbg_host->shost)) {
- printk(KERN_ERR "%s: scsi_remove_host failed\n", __FUNCTION__);
- return -EBUSY;
- }
-
- scsi_unregister(sdbg_host->shost);
+ if (!sdbg_host) {
+ printk(KERN_ERR "Unable to locate host info\n");
+ return 0;
+ }
list_for_each_safe(lh, lh_sf, &sdbg_host->dev_info_list) {
sdbg_devinfo = list_entry(lh, struct sdebug_dev_info,
@@ -1724,7 +1708,20 @@ static int sdebug_driver_remove(struct d
kfree(sdbg_devinfo);
}
- kfree(sdbg_host);
+ return 0;
+
+}
+
+static int sdebug_driver_remove(struct device * dev)
+{
+ struct sdebug_host_info *sdbg_host;
+
+ sdbg_host = to_sdebug_host(dev);
+
+ if (sdbg_host && scsi_remove_host(sdbg_host->shost)) {
+ printk(KERN_ERR "%s: scsi_remove_host failed\n", __FUNCTION__);
+ return -EBUSY;
+ }
return 0;
}
diff -puN drivers/scsi/scsi_debug.h~scsi_debug-sysfs drivers/scsi/scsi_debug.h
--- sysfs-bleed-2.5/drivers/scsi/scsi_debug.h~scsi_debug-sysfs Mon Apr 14 10:11:19 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi_debug.h Mon Apr 14 10:11:19 2003
@@ -16,6 +16,7 @@ static int scsi_debug_device_reset(struc
static int scsi_debug_host_reset(struct scsi_cmnd *);
static int scsi_debug_proc_info(char *, char **, off_t, int, int, int);
static const char * scsi_debug_info(struct Scsi_Host *);
+static int scsi_debug_release(struct Scsi_Host *);
/*
* This driver is written for the lk 2.5 series
@@ -27,6 +28,7 @@ static const char * scsi_debug_info(stru
static Scsi_Host_Template sdebug_driver_template = {
.proc_info = scsi_debug_proc_info,
.name = "SCSI DEBUG",
+ .release = scsi_debug_release,
.info = scsi_debug_info,
.slave_alloc = scsi_debug_slave_alloc,
.slave_configure = scsi_debug_slave_configure,
_
^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC] scsi host sysfs support [3/4]
2003-04-14 18:40 ` [RFC] scsi host sysfs support [2/4] Mike Anderson
@ 2003-04-14 18:41 ` Mike Anderson
2003-04-14 18:42 ` [RFC] scsi host sysfs support [4/4] Mike Anderson
0 siblings, 1 reply; 9+ messages in thread
From: Mike Anderson @ 2003-04-14 18:41 UTC (permalink / raw)
To: linux-scsi, mochel, linux-hotplug-devel, mdharm-scsi
-andmike
--
Michael Anderson
andmike@us.ibm.com
DESC
This patch adds a scsi subsystem to the sysfs tree.
EDESC
drivers/scsi/scsi_sysfs.c | 3 +++
1 files changed, 3 insertions(+)
diff -puN drivers/scsi/scsi_sysfs.c~sysfs-scsi-subsys drivers/scsi/scsi_sysfs.c
--- sysfs-bleed-2.5/drivers/scsi/scsi_sysfs.c~sysfs-scsi-subsys Mon Apr 14 10:11:35 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi_sysfs.c Mon Apr 14 10:11:35 2003
@@ -107,10 +107,12 @@ static struct bus_type scsi_bus_type = {
.match = scsi_bus_match,
};
+static decl_subsys(scsi, NULL);
int scsi_sysfs_register(void)
{
bus_register(&scsi_bus_type);
+ subsystem_register(&scsi_subsys);
devclass_register(&shost_devclass);
return 0;
@@ -119,6 +121,7 @@ int scsi_sysfs_register(void)
void scsi_sysfs_unregister(void)
{
devclass_unregister(&shost_devclass);
+ subsystem_unregister(&scsi_subsys);
bus_unregister(&scsi_bus_type);
}
_
^ permalink raw reply [flat|nested] 9+ messages in thread
* [RFC] scsi host sysfs support [4/4]
2003-04-14 18:41 ` [RFC] scsi host sysfs support [3/4] Mike Anderson
@ 2003-04-14 18:42 ` Mike Anderson
0 siblings, 0 replies; 9+ messages in thread
From: Mike Anderson @ 2003-04-14 18:42 UTC (permalink / raw)
To: linux-scsi, mochel, linux-hotplug-devel, mdharm-scsi
-andmike
--
Michael Anderson
andmike@us.ibm.com
DESC
Create a scsi_host subsystem under the scsi subsystem. Modified
scsi remove host cleanup.
EDESC
drivers/scsi/hosts.c | 24 +----
drivers/scsi/hosts.h | 11 +-
drivers/scsi/scsi_scan.c | 4
drivers/scsi/scsi_sysfs.c | 200 +++++++++++++++++++++++++++++++++-------------
4 files changed, 160 insertions(+), 79 deletions(-)
diff -puN drivers/scsi/hosts.c~sysfs-scsi-hosts drivers/scsi/hosts.c
--- sysfs-bleed-2.5/drivers/scsi/hosts.c~sysfs-scsi-hosts Mon Apr 14 10:11:59 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/hosts.c Mon Apr 14 10:11:59 2003
@@ -191,16 +191,6 @@ static int scsi_host_legacy_release(stru
return 0;
}
-static int scsi_remove_legacy_host(struct Scsi_Host *shost)
-{
- int error;
-
- error = scsi_remove_host(shost);
- if (!error)
- (*shost->hostt->release)(shost);
- return 0;
-}
-
static int scsi_check_device_busy(struct scsi_device *sdev)
{
struct Scsi_Host *shost = sdev->host;
@@ -266,11 +256,8 @@ int scsi_remove_host(struct Scsi_Host *s
list_for_each_entry(sdev, &shost->my_devices, siblings)
sdev->online = FALSE;
- list_for_each_entry(sdev, &shost->my_devices, siblings)
- if (scsi_check_device_busy(sdev))
- return 1;
-
scsi_forget_host(shost);
+ scsi_sysfs_remove_host(shost);
return 0;
}
@@ -291,10 +278,9 @@ int scsi_add_host(struct Scsi_Host *shos
printk(KERN_INFO "scsi%d : %s\n", shost->host_no,
sht->info ? sht->info(shost) : sht->name);
- if (dev) {
- dev->class_data = shost;
- shost->host_gendev = dev;
- }
+ error = scsi_sysfs_add_host(shost, dev);
+ if (error)
+ return error;
scsi_scan_host(shost);
@@ -523,7 +509,7 @@ out_of_space:
**/
int scsi_unregister_host(Scsi_Host_Template *shost_tp)
{
- scsi_tp_for_each_host(shost_tp, scsi_remove_legacy_host);
+ scsi_tp_for_each_host(shost_tp, scsi_remove_host);
return 0;
}
diff -puN drivers/scsi/hosts.h~sysfs-scsi-hosts drivers/scsi/hosts.h
--- sysfs-bleed-2.5/drivers/scsi/hosts.h~sysfs-scsi-hosts Mon Apr 14 10:11:59 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/hosts.h Mon Apr 14 10:49:25 2003
@@ -487,9 +487,10 @@ struct Scsi_Host
unsigned int max_host_blocked;
/*
- * Support for driverfs filesystem
+ * Support for sysfs
*/
struct device *host_gendev;
+ struct kobject kobj;
/*
* We should ensure that this is aligned, both for better performance
@@ -500,8 +501,9 @@ struct Scsi_Host
__attribute__ ((aligned (sizeof(unsigned long))));
};
-#define to_scsi_host(d) d->class_data
-
+#define to_scsi_host(d) \
+ container_of(d, struct Scsi_Host, kobj)
+
/*
* These two functions are used to allocate and free a pseudo device
* which will connect to the host adapter itself rather than any
@@ -537,6 +539,7 @@ static inline struct device *scsi_get_de
*/
extern void scsi_scan_host(struct Scsi_Host *);
extern void scsi_forget_host(struct Scsi_Host *);
+extern void scsi_free_sdev(struct scsi_device *);
struct Scsi_Device_Template
@@ -611,6 +614,8 @@ static inline Scsi_Device *scsi_find_dev
*/
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 *);
#endif
diff -puN drivers/scsi/scsi_sysfs.c~sysfs-scsi-hosts drivers/scsi/scsi_sysfs.c
--- sysfs-bleed-2.5/drivers/scsi/scsi_sysfs.c~sysfs-scsi-hosts Mon Apr 14 10:11:59 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi_sysfs.c Mon Apr 14 10:27:20 2003
@@ -14,6 +14,20 @@
#include "scsi.h"
#include "hosts.h"
+struct shost_attribute {
+ struct attribute attr;
+ ssize_t(*show) (struct Scsi_Host *, char *);
+ ssize_t (*store)(struct device *, const char *, size_t);
+};
+
+#define to_shost_attr(_attr) container_of(_attr,struct shost_attribute,attr)
+
+#define SHOST_ATTR(_name,_mode,_show,_store) \
+struct shost_attribute shost_attr_##_name = { \
+ .attr = {.name = __stringify(_name), .mode = _mode }, \
+ .show = _show, \
+ .store = _store, \
+};
/*
* shost_show_function: macro to create an attr function that can be used to
@@ -21,10 +35,9 @@
*/
#define shost_show_function(field, format_string) \
static ssize_t \
-show_##field (struct device *dev, char *buf) \
+show_##field (struct Scsi_Host * shost, char *buf) \
{ \
- struct Scsi_Host *shost = to_scsi_host(dev); \
- return snprintf (buf, 20, format_string, shost->field); \
+ return snprintf (buf, 20, format_string, shost->field); \
}
/*
@@ -32,8 +45,24 @@ show_##field (struct device *dev, char *
* read only field.
*/
#define shost_rd_attr(field, format_string) \
- shost_show_function(field, format_string) \
-static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL)
+ shost_show_function(field, format_string) \
+static SHOST_ATTR(field, S_IRUGO, show_##field, NULL)
+
+static ssize_t
+shost_attr_show(struct kobject * kobj, struct attribute *attr, char *buf)
+{
+ struct Scsi_Host *shost = to_scsi_host(kobj);
+ struct shost_attribute *shost_attr = to_shost_attr(attr);
+ ssize_t ret = 0;
+
+ if (shost_attr->show)
+ ret = shost_attr->show(shost, buf);
+ return ret;
+}
+
+static struct sysfs_ops shost_attr_ops = {
+ .show = shost_attr_show,
+};
/*
* Create the actual show/store functions and data structures.
@@ -44,36 +73,12 @@ shost_rd_attr(cmd_per_lun, "%hd\n");
shost_rd_attr(sg_tablesize, "%hu\n");
shost_rd_attr(unchecked_isa_dma, "%d\n");
-static struct device_attribute *const shost_attrs[] = {
- &dev_attr_unique_id,
- &dev_attr_host_busy,
- &dev_attr_cmd_per_lun,
- &dev_attr_sg_tablesize,
- &dev_attr_unchecked_isa_dma,
-};
-
-static int scsi_host_class_add_dev(struct device * dev)
-{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(shost_attrs); i++)
- device_create_file(dev, shost_attrs[i]);
-
- return 0;
-}
-
-static void scsi_host_class_rm_dev(struct device * dev)
-{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(shost_attrs); i++)
- device_remove_file(dev, shost_attrs[i]);
-}
-
-struct device_class shost_devclass = {
- .name = "scsi-host",
- .add_device = scsi_host_class_add_dev,
- .remove_device = scsi_host_class_rm_dev,
+static struct attribute * shost_attrs[] = {
+ &shost_attr_unique_id.attr,
+ &shost_attr_host_busy.attr,
+ &shost_attr_cmd_per_lun.attr,
+ &shost_attr_sg_tablesize.attr,
+ &shost_attr_unchecked_isa_dma.attr,
};
/**
@@ -101,29 +106,11 @@ static int scsi_bus_match(struct device
return 0;
}
-
static struct bus_type scsi_bus_type = {
.name = "scsi",
.match = scsi_bus_match,
};
-static decl_subsys(scsi, NULL);
-
-int scsi_sysfs_register(void)
-{
- bus_register(&scsi_bus_type);
- subsystem_register(&scsi_subsys);
- devclass_register(&shost_devclass);
-
- return 0;
-}
-
-void scsi_sysfs_unregister(void)
-{
- devclass_unregister(&shost_devclass);
- subsystem_unregister(&scsi_subsys);
- bus_unregister(&scsi_bus_type);
-}
/**
* scsi_upper_driver_register - register upper level driver.
@@ -272,6 +259,18 @@ static struct device_attribute * const s
&dev_attr_rescan,
};
+
+static void scsi_device_release(struct device *dev)
+{
+ struct scsi_device *sdev;
+
+ sdev = to_scsi_device(dev);
+ if (!sdev)
+ return;
+ printk("%s: sdev: %s\n", __FUNCTION__, dev->bus_id);
+ scsi_free_sdev(sdev);
+}
+
/**
* scsi_device_register - register a scsi device with the scsi bus
* @sdev: scsi_device to register
@@ -285,8 +284,9 @@ int scsi_device_register(struct scsi_dev
sprintf(sdev->sdev_driverfs_dev.bus_id,"%d:%d:%d:%d",
sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
- sdev->sdev_driverfs_dev.parent = sdev->host->host_gendev;
+ sdev->sdev_driverfs_dev.kobj.parent = &sdev->host->kobj;
sdev->sdev_driverfs_dev.bus = &scsi_bus_type;
+ sdev->sdev_driverfs_dev.release = scsi_device_release;
error = device_register(&sdev->sdev_driverfs_dev);
if (error)
@@ -314,3 +314,95 @@ void scsi_device_unregister(struct scsi_
device_remove_file(&sdev->sdev_driverfs_dev, sdev_attrs[i]);
device_unregister(&sdev->sdev_driverfs_dev);
}
+
+static void scsi_host_release(struct kobject *kobj)
+{
+ struct Scsi_Host *shost;
+
+ shost = to_scsi_host(kobj);
+ if (!shost)
+ return;
+ printk("%s: kobj: %s\n", __FUNCTION__, kobj->name);
+ shost->hostt->release(shost);
+}
+
+static struct kobj_type ktype_scsi_host = {
+ .release = scsi_host_release,
+ .sysfs_ops = &shost_attr_ops,
+ .default_attrs = shost_attrs,
+};
+
+static decl_subsys(scsi_host, &ktype_scsi_host, NULL);
+
+/**
+ * scsi_sysfs_add_host - add scsi host to subsystem
+ * @shost: scsi host struct to add to subsystem
+ * @dev: parent struct device pointer
+ *
+ **/
+int scsi_sysfs_add_host(struct Scsi_Host *shost, struct device *dev)
+{
+ int error;
+ struct device *link_dev = (dev) ? dev : shost->host_gendev;
+
+ snprintf(shost->kobj.name, KOBJ_NAME_LEN, "host%d",
+ shost->host_no);
+ kobj_set_kset_s(shost, scsi_host_subsys);
+ error = kobject_register(&shost->kobj);
+ if (error)
+ return error;
+ if (link_dev) {
+ error = sysfs_create_link(&shost->kobj,
+ &link_dev->kobj,
+ "adapter");
+ if (error)
+ goto clean;
+ }
+ return error;
+
+clean:
+ kobject_unregister(&shost->kobj);
+ return error;
+}
+
+/**
+ * scsi_sysfs_remove_host - remove scsi host from subsystem
+ * @shost: scsi host to remove from subsystem
+ **/
+void scsi_sysfs_remove_host(struct Scsi_Host *shost)
+{
+ kobject_unregister(&shost->kobj);
+}
+
+static decl_subsys(scsi, NULL, NULL);
+
+int scsi_sysfs_register(void)
+{
+ int error;
+
+ error = bus_register(&scsi_bus_type);
+ if (error)
+ return error;
+ error = subsystem_register(&scsi_subsys);
+ if (error)
+ goto cleanup_bus_reg;
+ kset_set_kset_s(&scsi_host_subsys, scsi_subsys);
+ error = subsystem_register(&scsi_host_subsys);
+ if (error)
+ goto cleanup_sub_reg;
+
+ return 0;
+
+cleanup_sub_reg:
+ subsystem_unregister(&scsi_subsys);
+cleanup_bus_reg:
+ bus_unregister(&scsi_bus_type);
+ return error;
+}
+
+void scsi_sysfs_unregister(void)
+{
+ subsystem_unregister(&scsi_host_subsys);
+ subsystem_unregister(&scsi_subsys);
+ bus_unregister(&scsi_bus_type);
+}
diff -puN drivers/scsi/scsi_scan.c~sysfs-scsi-hosts drivers/scsi/scsi_scan.c
--- sysfs-bleed-2.5/drivers/scsi/scsi_scan.c~sysfs-scsi-hosts Mon Apr 14 10:11:59 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi_scan.c Mon Apr 14 10:11:59 2003
@@ -489,7 +489,7 @@ out:
* Undo the actions in scsi_alloc_sdev, including removing @sdev from
* the list, and freeing @sdev.
**/
-static void scsi_free_sdev(struct scsi_device *sdev)
+void scsi_free_sdev(struct scsi_device *sdev)
{
list_del(&sdev->siblings);
list_del(&sdev->same_target_siblings);
@@ -1706,8 +1706,6 @@ int scsi_remove_device(struct scsi_devic
devfs_unregister(sdev->de);
scsi_device_unregister(sdev);
-
- scsi_free_sdev(sdev);
return 0;
}
_
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC] scsi host sysfs support [0/4]
2003-04-14 18:37 [RFC] scsi host sysfs support [0/4] Mike Anderson
2003-04-14 18:39 ` [RFC] scsi host sysfs support [1/4] Mike Anderson
@ 2003-04-14 23:02 ` Patrick Mochel
2003-04-14 23:47 ` Mike Anderson
1 sibling, 1 reply; 9+ messages in thread
From: Patrick Mochel @ 2003-04-14 23:02 UTC (permalink / raw)
To: Mike Anderson; +Cc: linux-scsi, linux-hotplug-devel, mdharm-scsi
On Mon, 14 Apr 2003, Mike Anderson wrote:
> This patch set is against 2.5.67 current. It will not apply to scsi-miscs-2.5
> as the decl_subsys macro has added a third argument.
>
> This patch set changes the sysfs support for scsi hosts.
> - Removes the previous support of shost_devclass device class.
>
> - Modifies scsi_debug to support the new order of object cleanup and also
> changes the structure of sdebug_host_info to help in object cleanup.
>
> - Creates a scsi subsystem. This is rooted at the top of the sysfs tree.
No. Period.
This will not fly. Not now, and not ever.
> - Creates a scsi_host subsystem under the scsi subsystem. Modified the
> cleanup in scsi remove host. Switched to a kobject embedded in
> scsi_host. If a driver has not be converted to the driver model or does
> not use the scsi_set_device call it will still show up in the scsi_host
> subsystem, but will not have a symlink to the parent.
>
> The usage of driver model classes for scsi hosts was removed because many
> of our drivers have not been converted to the driver model so this gave an
> inconsistent model to count on for cleanup and migration of some the
> procfs support. I tried adding some fake structures to use classes, but it
> failed to cleanup properly do to asymmetric cleanup interfaces in the core
> code and also did not seem like the correct direction to go.
Then you need to fix the code, or do some work to fix up the class
support. You have no right to promote scsi to a top-level subsystem, and I
will not support. I'll not even read the rest of the patches.
I realize that block and net are top-level subsystems. They are there for
two reasons - 1) they _are_ that important, and 2) they're temporary steps
to them being converted to classes.
I realize that you think SCSI is just as important as block devices or net
devices, but it's just not true for most systems, and I will not open the
flood gates for you to abuse even more interfaces.
Thanks,
-pat
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC] scsi host sysfs support [0/4]
2003-04-14 23:02 ` [RFC] scsi host sysfs support [0/4] Patrick Mochel
@ 2003-04-14 23:47 ` Mike Anderson
2003-04-14 23:48 ` Patrick Mochel
0 siblings, 1 reply; 9+ messages in thread
From: Mike Anderson @ 2003-04-14 23:47 UTC (permalink / raw)
To: Patrick Mochel; +Cc: linux-scsi, linux-hotplug-devel, mdharm-scsi
Patrick Mochel [mochel@osdl.org] wrote:
> Then you need to fix the code, or do some work to fix up the class
> support. You have no right to promote scsi to a top-level subsystem, and I
> will not support. I'll not even read the rest of the patches.
>
To fix the LLDDs would force drivers that have a parent bus not converted
to the driver model to take on a excessive amount of code to show up as a
class (properly).
I also believed the "pseudo" driver I had to create to use classes was a
abuse of the interface. I will look into the changes happening with
classes.
> I realize that block and net are top-level subsystems. They are there for
> two reasons - 1) they _are_ that important, and 2) they're temporary steps
> to them being converted to classes.
>
Where are the attributes written down for evaluating important vs not
important subsystems.
> I realize that you think SCSI is just as important as block devices or net
> devices, but it's just not true for most systems, and I will not open the
> flood gates for you to abuse even more interfaces.
What interfaces am I abusing. I have used api's documented by you.
-andmike
--
Michael Anderson
andmike@us.ibm.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC] scsi host sysfs support [0/4]
2003-04-14 23:47 ` Mike Anderson
@ 2003-04-14 23:48 ` Patrick Mochel
2003-04-15 0:25 ` Mike Anderson
0 siblings, 1 reply; 9+ messages in thread
From: Patrick Mochel @ 2003-04-14 23:48 UTC (permalink / raw)
To: Mike Anderson; +Cc: linux-scsi, linux-hotplug-devel, mdharm-scsi
On Mon, 14 Apr 2003, Mike Anderson wrote:
> Patrick Mochel [mochel@osdl.org] wrote:
> > Then you need to fix the code, or do some work to fix up the class
> > support. You have no right to promote scsi to a top-level subsystem, and I
> > will not support. I'll not even read the rest of the patches.
> >
>
> To fix the LLDDs would force drivers that have a parent bus not converted
> to the driver model to take on a excessive amount of code to show up as a
> class (properly).
Then convert them to the driver model.
> > I realize that block and net are top-level subsystems. They are there for
> > two reasons - 1) they _are_ that important, and 2) they're temporary steps
> > to them being converted to classes.
> >
>
> Where are the attributes written down for evaluating important vs not
> important subsystems.
They're not - they're completely subjective, and I reserve the right to
reserve that right. Basically, only subsystems that are always present
should be in the top-level directory.
Sure, networking may not always be present, but that case is rare, and as
I said before, it's on its way to becoming a device class.
But, taking a step back, is SCSI a bus type? Yes, then it should go under
bus/scsi/. You can implement an object under there, just as you would
under scsi/
> > I realize that you think SCSI is just as important as block devices or net
> > devices, but it's just not true for most systems, and I will not open the
> > flood gates for you to abuse even more interfaces.
>
> What interfaces am I abusing. I have used api's documented by you.
Hopefully none ATM, though that doesn't count the code I've seen in the
past.
-pat
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC] scsi host sysfs support [0/4]
2003-04-14 23:48 ` Patrick Mochel
@ 2003-04-15 0:25 ` Mike Anderson
0 siblings, 0 replies; 9+ messages in thread
From: Mike Anderson @ 2003-04-15 0:25 UTC (permalink / raw)
To: Patrick Mochel; +Cc: linux-scsi, linux-hotplug-devel, mdharm-scsi
Patrick Mochel [mochel@osdl.org] wrote:
> > To fix the LLDDs would force drivers that have a parent bus not converted
> > to the driver model to take on a excessive amount of code to show up as a
> > class (properly).
>
> Then convert them to the driver model.
>
In past evaluations this looked like a large task, and was not a
requirement for getting the ref counting / release capabilities we
needed. Even though you did not like where the kobject was rooted the
parent / child and release functionality appears to be working.
> But, taking a step back, is SCSI a bus type? Yes, then it should go under
> bus/scsi/. You can implement an object under there, just as you would
> under scsi/
>
Ok I could root scsi_host under /bus/scsi.
-andmike
--
Michael Anderson
andmike@us.ibm.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-04-15 0:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-14 18:37 [RFC] scsi host sysfs support [0/4] Mike Anderson
2003-04-14 18:39 ` [RFC] scsi host sysfs support [1/4] Mike Anderson
2003-04-14 18:40 ` [RFC] scsi host sysfs support [2/4] Mike Anderson
2003-04-14 18:41 ` [RFC] scsi host sysfs support [3/4] Mike Anderson
2003-04-14 18:42 ` [RFC] scsi host sysfs support [4/4] Mike Anderson
2003-04-14 23:02 ` [RFC] scsi host sysfs support [0/4] Patrick Mochel
2003-04-14 23:47 ` Mike Anderson
2003-04-14 23:48 ` Patrick Mochel
2003-04-15 0:25 ` Mike Anderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox