All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] scsi host sysfs support [1/4]
@ 2003-04-14 18:39 Mike Anderson
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Anderson @ 2003-04-14 18:39 UTC (permalink / raw)
  To: linux-hotplug

-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 = {

_


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [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
  0 siblings, 1 reply; 2+ 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] 2+ messages in thread

end of thread, other threads:[~2003-04-14 18:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-14 18:39 [RFC] scsi host sysfs support [1/4] Mike Anderson
  -- strict thread matches above, loose matches on Subject: below --
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.