aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_transport_sas.c
AgeCommit message (Collapse)Author
2007-07-21[SCSI] bsg: make class backlinksJames Bottomley
Currently, bsg doesn't make class backlinks (a process whereby you'd get a link to bsg in the device directory in the same way you get one for sg). This is because the bsg device is uninitialised, so the class device has nothing it can attach to. The fix is to make the bsg device point to the cdevice of the entity creating the bsg, necessitating changing the bsg_register_queue() prototype into a form that takes the generic device. Acked-by: FUJITA Tomonori <tomof@acm.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20[SCSI] scsi_transport_sas: add destructor for bsgJames Bottomley
There's currently no destructor for the bsg components. If you insert and remove the module, you see the bsg devices building up and up. This patch adds the destructor in the correct place in the transport class so that the bsg and request queue are removed just before the device destruction. Acked-by: FUJITA Tomonori <tomof@acm.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-18[SCSI] transport_sas: add SAS management protocol supportFUJITA Tomonori
The sas transport class attaches one bsg device to every SAS object (host, device, expander, etc). LLDs can define a function to handle SMP requests via sas_function_template::smp_handler. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-02-17Fix typos concerning hierarchyUwe Kleine-König
heirarchical, hierachical -> hierarchical heirarchy, hierachy -> hierarchy Signed-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-01-27[SCSI] libsas: Check return values of sysfs_create_linkDarrick J. Wong
Get rid of: "warning: ignoring return value of sysfs_create_link..." Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-01-27[SCSI] libsas: Clean up discovery failure handler codeDarrick J. Wong
sas_rphy_delete does two things: it removes the sas_rphy from the transport layer and frees the sas_rphy. This can be broken down into two functions, sas_rphy_remove and sas_rphy_free; sas_rphy_remove is of interest to sas_discover_root_expander because it calls functions that require sas_rphy_add as a prerequisite and can fail (namely sas_discover_expander). In that case, sas_discover_root_expander needs to be able to undo the effects of sas_rphy_add yet leave the job of freeing the sas_rphy to the caller of sas_discover_root_expander. This patch also removes some unnecessary code from sas_discover_end_dev to eliminate an unnecessary cycle of sas_notify_lldd_gone/found for SAS devices, thus eliminating a sas_rphy_remove call (and fixing a race condition where a SCSI target scan can come in between the gone and found call). It also moves the sas_rphy_free calls into sas_discover_domain and sas_ex_discover_end_dev to complement the sas_rphy_allocation via sas_get_port_device. This patch does not change the semantics of sas_rphy_delete. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-01-27[SCSI] aic94xx: fix typos and update verison numberAlexis Bruemmer
fix typos and bump version number Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Alexis Bruemmer <alexisb@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-01-13[SCSI] libsas: sysfs phy control attributes should not be S_IWUGODarrick J. Wong
Allowing the phy reset controls to be world-triggerable does not seem like a terribly good idea because SAS devices can be disrupted (and ATA devices are really disrupted) by a phy reset. By default only root should be able to do things like that. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-01-13[SCSI] libsas: Use SCAN_WILD_CARD instead of ~0Darrick J. Wong
Magic number cleanup. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-01-13[SCSI] libsas: Add a sysfs knob to enable/disable a phyDarrick J. Wong
This patch lets a user arbitrarily enable or disable a phy via sysfs. Potential applications include shutting down a phy to replace one lane of wide port, and (more importantly) providing a method for the libata SATL to control the phy. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-12-04[PATCH] severing module.h->sched.hAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-09-07[SCSI] scsi_transport_sas: make minimum and maximum linkrate settable quantitiesJames Bottomley
According to SPEC, the minimum_linkrate and maximum_linkrate should be settable by the user. This patch introduces a callback that allows the sas class to pass these settings on to the driver. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-08-27[SCSI] scsi_transport_sas: remove local_attached flagJames Bottomley
This flag denotes local attachment of the phy. There are two problems with it: 1) It's actually redundant ... you can get the same information simply by seeing whether a host is the phys parent 2) we condition a lot of phy parameters on it on the false assumption that we can only control local phys. I'm wiring up phy resets in the aic94xx now, and it will be able to reset non-local phys as well. I fixed 2) by moving the local check into the reset and stats function of the mptsas, since that seems to be the only HBA that can't (currently) control non-local phys. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-07-12[SCSI] scsi_transport_sas: kill the use of channel James Bottomley
Using the port_id for the channel is completely unnecessary since the host_id/target_id are constructed to be globally unique. Also move the mptsas driver on to virtual channel 1 for its raid devices. Acked-by: "Moore, Eric" <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-07-12[SCSI] scsi_transport_sas: add expander backlinkJames Bottomley
This patch adds the ability to add a backlink to a particular port. The idea is to represent properly ports on expanders that are used specifically for linking to the parent device in the topology. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-07-09[SCSI] scsi_transport_sas: add unindexed portsJames Bottomley
Some SAS HBAs don't want to go to the trouble of tracking port numbers, so they'd simply like to say "add this port and give it a number". This is especially beneficial from the hotplug point of view, since tracking ports and the available number space can be a real pain. The current implementation uses an incrementing number per expander to add the port on. However, since there can never be more ports than there are phys, a later implementation will try to be more intelligent about this. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-06-28[SCSI] scsi_transport_sas: introduce a sas_port entityJames Bottomley
this patch introduces a port object, separates out ports and phys, with ports becoming the primary objects of the tree. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-06-12[SCSI] scsi_transport_sas: fix panic in sas_free_rphyJames Bottomley
This is a hold over from the end device/expander conversion. Apparently the rphy list pointer is never initialised, so list_del() on the uninitialised pointer can panic the system Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-06-10Merge ../linux-2.6James Bottomley
2006-06-10[SCSI] drivers/scsi: Use ARRAY_SIZE macroTobias Klauser
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of the macro. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-05-20[SCSI] scsi_transport_sas: make write attrs writeableEric Moore
A couple write attributes in sas transport layer have a small bug that prevents them from being written to. Those attributes are the link_reset and write_reset. This is due the store field being set to NULL. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-05-20[SCSI] scsi_transport_sas; fix user_scanJames Bottomley
the user_scan() callback currently has the potential to identify the wrong device in the presence of expanders. This is because it finds the first device with a matching target_id, which might be an expander. Fix this by making it look specifically for end devices. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-04-14[SCSI] scsi_transport_sas: don't scan a non-existent end deviceJames Bottomley
Any end device that can't support any of the scanning protocols shouldn't be scanned, so set its id to -1 to prevent scsi_scan_target() being called for it. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-04-13[SCSI] expose sas internal class for the domain transportJames Bottomley
necessary to make the domain class use the internal structures Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-04-13[SCSI] sas transport: ref count updateMike Anderson
Fix puts so that release functions will be called. Signed-off-by: Mike Anderson <andmike@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-19[SCSI] eliminate rphy allocation in favour of expander/end device allocationJames Bottomley
This allows the removal of the contained flag and also does a bit of class renaming (sas_rphy->sas_device). Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-14[SCSI] add preliminary expander support to the sas transport classJames Bottomley
This patch makes expanders appear as labelled objects with properties in the SAS tree. I've also modified the phy code to make expander phys appear labelled by host number, expander number and phy index. So, for my current config, you see something like this in sysfs: /sys/class/scsi_host/host1/device/phy-1:4/expander-1:0/phy-1-0:12/rphy-1:0-12/target1:0:1 And the expander properties are: jejb@sparkweed> cd /sys/class/sas_expander/expander-1\:0/ jejb@sparkweed> for f in *; do echo -n $f ": "; cat $f; done component_id : 29024 component_revision_id : 4 component_vendor_id : VITESSE device : cat: device: Is a directory level : 0 product_id : VSC7160 Eval Brd product_rev : 4 uevent : cat: uevent: Permission denied vendor_id : VITESSE Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-09[SCSI] add missing transport_container_unregister in sas classJames Bottomley
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-06[PATCH] convert aic94xx over to using the sas transport end deviceJames Bottomley
Begin introducing the concept of sas remote devices that have an rphy embedded. The first one (this) is a simple end device. All that an end device really does is have port mode page parameters contained. The next and more complex piece will be expander remote devices. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-03[SCSI] make some sas class properties optionalJames Bottomley
aic94xx doesn't have a use for the bay or enclosure identifiers. Also, I think it's not going to need a get_linkerrors(), so wire up all of these exported properties as conditional on the underlying function support. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-02[SCSI] add 6.0 Gbit phy definitions to the sas transport classJames Bottomley
I don't think these exist in silicon yet, but the aic94xx driver has a register setting for them. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27[SCSI] sas: add support for enclosure and bad ID rphy attributesChristoph Hellwig
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-27[SCSI] SCSI core kmalloc2kzallocJes Sorensen
Change the core SCSI code to use kzalloc rather than kmalloc+memset where possible. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-31[SCSI] scsi_transport_sas.c: display port identifierMoore, Eric
This patch displays the port identifier on the folder attribute; located in the middle digit. /sys/class/sas_rphy/rphy-%x:%x:%x The port identifier is basically the unique identifier for each sas domain. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-14[SCSI] scsi_transport_sas: mapping the rphy channel equal to the port identifierMoore, Eric
We will be mapping the RAID volumes in mptsas to a reserved channel that is one larger than the anticapated number of ports on the direct attached host adapter. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-14[SCSI] remove target parent limitiationChristoph Hellwig
When James Smart fixed the issue of the userspace scan atributes crashing the system with the FC transport class he added a patch to let the transport class check if the parent is valid for a given transport class. When adding support for the integrated raid of fusion sas devices we ran into a problem with that, as it didn't allow adding virtual raid volumes without the transport class knowing about it. So this patch adds a user_scan attribute instead, that takes over from scsi_scan_host_selected if the transport class sets it and thus lets the transport class control the user-initiated scanning. As this plugs the hole about user-initiated scanning the target_parent hook goes away and we rely on callers of the scanning routines to do something sensible. For SAS this meant I had to switch from a spinlock to a mutex to synchronize the topology linked lists, in FC they were completely unsynchronized which seems wrong. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-14[SCSI] sas: fix removal of devices behind expandersChristoph Hellwig
We need to iterate over all children when removing and expander, else stale objects will be around after host removal. This fixes the oops Eric Moore saw when removing and reloading mptsas. Also don't try the scsi_remove_target call unless operating on an end device. The current unconditional call is harmless but confusing. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-12[SCSI] sas: clear parent->rphy in sas_rphy_deleteChristoph Hellwig
We need to clear the backpointer on rphy removal, else we'll run into problems with host removal after a device has been hot unplugged. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-11-07[PATCH] fix remaining missing includesTim Schmielau
Fix more include file problems that surfaced since I submitted the previous fix-missing-includes.patch. This should now allow not to include sched.h from module.h, which is done by a followup patch. Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-28[SCSI] sas: add support for PHY resetsChristoph Hellwig
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28[SCSI] sas: add flag for locally attached PHYsChristoph Hellwig
Add a flag to mark a PHY as attached to the HBA as opposed to beeing on an expander. This is needed because various features are only supported on those. This is a crude hack, the proper fix would be to use different classes for host-attached vs expander phys. I'm looking into that. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-28[SCSI] scsi_transport_sas: support link error attributesChristoph Hellwig
For now supporting the ->get_linkerrors method is mandatory. I'll probably be beaten to implement the .show_foo variables and different types of attributes soon.. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-25[SCSI] sas: fix remote phy removalChristoph Hellwig
Brown paperbag bug: sas_rphy_delete was ordered completely wrong. Fix it up to be the same order as sas_phy_delete or fc_rport_terminate and fix rphy objects that leaked after module removal. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-09[SCSI] SAS transport class: fixup prototype of sas_host_setupJames Bottomley
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-09[SCSI] SAS transport classChristoph Hellwig
The SAS transport class contains common code to deal with SAS HBAs, an aproximated representation of SAS topologies in the driver model, and various sysfs attributes to expose these topologies and managment interfaces to userspace. In addition to the basic SCSI core objects this transport class introduces two additional intermediate objects: The SAS PHY as represented by struct sas_phy defines an "outgoing" PHY on a SAS HBA or Expander, and the SAS remote PHY represented by struct sas_rphy defines an "incoming" PHY on a SAS Expander or end device. Note that this is purely a software concept, the underlying hardware for a PHY and a remote PHY is the exactly the same. There is no concept of a SAS port in this code, users can see what PHYs form a wide port based on the port_identifier attribute, which is the same for all PHYs in a port. This submission doesn't handle hot-plug addition or removal of SAS devices and thus doesn't do scanning in a workqueue yet, that will be added in phase2 after this submission. In a third phase I will add additional managment infrastructure. I think this submission is ready for 2.6.14, but additional comments are of course very welcome. I'd like to thanks James Smart a lot for his very useful input on the design. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>