aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_sas.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-05-04Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds1-2/+6
Pull SCSI updates from James Bottomley: "This update includes the usual round of major driver updates (hisi_sas, ufs, fnic, cxlflash, be2iscsi, ipr, stex). There's also the usual amount of cosmetic and spelling stuff" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (155 commits) scsi: qla4xxx: fix spelling mistake: "Tempalate" -> "Template" scsi: stex: make S6flag static scsi: mac_esp: fix to pass correct device identity to free_irq() scsi: aacraid: pci_alloc_consistent() failures on ARM64 scsi: ufs: make ufshcd_get_lists_status() register operation obvious scsi: ufs: use MASK_EE_STATUS scsi: mac_esp: Replace bogus memory barrier with spinlock scsi: fcoe: make fcoe_e_d_tov and fcoe_r_a_tov static scsi: sd_zbc: Do not write lock zones for reset scsi: sd_zbc: Remove superfluous assignments scsi: sd: sd_zbc: Rename sd_zbc_setup_write_cmnd scsi: Improve scsi_get_sense_info_fld scsi: sd: Cleanup sd_done sense data handling scsi: sd: Improve sd_completed_bytes scsi: sd: Fix function descriptions scsi: mpt3sas: remove redundant wmb scsi: mpt: Move scsi_remove_host() out of mptscsih_remove_host() scsi: sg: reset 'res_in_use' after unlinking reserved array scsi: mvumi: remove code handling zero scsi_sg_count(scmd) case scsi: fusion: fix spelling mistake: "Persistancy" -> "Persistency" ...
2017-04-26scsi_transport_sas: always pass 0 error to blk_end_request_allChristoph Hellwig1-1/+1
The SAS transport queues are only used by bsg, and bsg always looks at the scsi_request results and never add the error passed in the end_io callback. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-04-21scsi: sas: move scsi_remove_host call into sas_remove_hostJohannes Thumshirn1-2/+6
Move scsi_remove_host call into sas_remove_host and remove it from SAS HBA drivers, so we don't mess up the ordering. This solves an issue with double deleting sysfs entries that was introduced by the change of sysfs behaviour from commit bcdde7e221a8 ("sysfs: make __sysfs_remove_dir() recursive"). [mkp: addressed checkpatch complaints] Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Suggested-by: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Cc: James Bottomley <jejb@linux.vnet.ibm.com> Cc: Jinpu Wang <jinpu.wang@profitbricks.com> Cc: John Garry <john.garry@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jinpu Wang <jinpu.wang@profitbricks.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-04-20scsi: introduce a result field in struct scsi_requestChristoph Hellwig1-1/+1
This passes on the scsi_cmnd result field to users of passthrough requests. Currently we abuse req->errors for this purpose, but that field will go away in its current form. Note that the old IDE code abuses the errors field in very creative ways and stores all kinds of different values in it. I didn't dare to touch this magic, so the abuses are brought forward 1:1. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-02-27scripts/spelling.txt: add "intialization" pattern and fix typo instancesMasahiro Yamada1-1/+1
Fix typos and add the following to the scripts/spelling.txt: intialization||initialization The "inintialization" in drivers/acpi/spcr.c is a different pattern but I fixed it as well in this commit. Link: http://lkml.kernel.org/r/1481573103-11329-16-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-21scsi_transport_sas: fix BSG ioctl memory corruptionOmar Sandoval1-8/+16
The end_device and sas_host devices support BSG ioctls, but the request_queue allocated for them isn't set up to allocate the struct scsi_request payload. This leads to memory corruption in the call to scsi_req_init() in bsg_map_hdr(), since it will memset past the end of the allocated request. Fix it by setting ->cmd_size on the allocated request_queue. Fixes: 82ed4db499b8 ("block: split scsi_request out of struct request") Signed-off-by: Omar Sandoval <osandov@fb.com> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-01-27block: split scsi_request out of struct requestChristoph Hellwig1-0/+5
And require all drivers that want to support BLOCK_PC to allocate it as the first thing of their private data. To support this the legacy IDE and BSG code is switched to set cmd_size on their queues to let the block layer allocate the additional space. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2016-08-18scsi: sas: remove is_sas_attached()Johannes Thumshirn1-16/+0
As there are no more users of is_sas_attached() left, remove it. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: James E.J. Bottomley <jejb@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-11scsi: disable automatic target scanHannes Reinecke1-3/+4
On larger installations it is useful to disable automatic LUN scanning, and only add the required LUNs via udev rules. This can speed up bootup dramatically. This patch introduces a new scan module parameter value 'manual', which works like 'none', but can be overridden by setting the 'rescan' value from scsi_scan_target to 'SCSI_SCAN_MANUAL'. And it updates all relevant callers to set the 'rescan' value to 'SCSI_SCAN_MANUAL' if invoked via the 'scan' option in sysfs. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Tested-by: Laurence Oberman <loberman@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-03-14scsi_transport_sas: add 'scsi_target_id' sysfs attributeHannes Reinecke1-0/+2
There is no way to detect the scsi_target_id for any given SAS remote port, so add a new sysfs attribute 'scsi_target_id'. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Manoj Kumar <manoj@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-18scsi_transport_sas: add function to get SAS endpoint addressJames Bottomley1-0/+14
For a device known to be SAS connected, this will return the endpoint address. This is useful for getting the SAS address of SATA devices. Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2015-12-18scsi_transport_sas: add is_sas_attached() functionJames Bottomley1-0/+16
Adds a function designed to be callable any time (regardless of whether the transport attributes are configured or not) which returns true if the device is attached over a SAS transport. The design of this function is that transport specific functions can be embedded within a if (is_sas_attached(sdev)) { ... } which would be compiled out (and thus eliminate the symbols) if SAS is not configured. Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2015-09-06scsi_transport_sas: Remove check for SAS expander when querying bay/enclosure IDs.Jordan Hargrave1-10/+0
Dell Server backplanes can report bay/enclosure IDs without an expander present. This patch allows the bay/enclosure IDs to be propagaged to sysfs.we Signed-off-by: Jordan Hargrave <jordan_hargrave@dell.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2014-07-17scsi: use 64-bit LUNsHannes Reinecke1-1/+1
The SCSI standard defines 64-bit values for LUNs, and large arrays employing large or hierarchical LUN numbers become more and more common. So update the linux SCSI stack to use 64-bit LUN numbers. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@infradead.org> Reviewed-by: Ewan Milne <emilne@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-05-22[SCSI] scsi_transport_sas: move bsg destructor into sas_rphy_removeJoe Lawrence1-2/+1
The recent change in sysfs, bcdde7e221a8750f9b62b6d0bd31b72ea4ad9309 "sysfs: make __sysfs_remove_dir() recursive" revealed an asymmetric rphy device creation/deletion sequence in scsi_transport_sas: modprobe mpt2sas sas_rphy_add device_add A rphy->dev device_add B sas_device transport class device_add C sas_end_device transport class device_add D bsg class rmmod mpt2sas sas_rphy_delete sas_rphy_remove device_del B device_del C device_del A sysfs_remove_group recursive sysfs dir removal sas_rphy_free device_del D warning where device A is the parent of B, C, and D. When sas_rphy_free tries to unregister the bsg request queue (device D above), the ensuing sysfs cleanup discovers that its sysfs group has already been removed and emits a warning, "sysfs group... not found for kobject 'end_device-X:0'". Since bsg creation is a side effect of sas_rphy_add, move its complementary removal call into sas_rphy_remove. This imposes the following tear-down order for the devices above: D, B, C, A. Note the sas_device and sas_end_device transport class devices (B and C above) are created and destroyed both via the list match traversal in attribute_container_device_trigger, so the order in which they are handled is fixed. This is fine as long as they are deleted before their parent device. Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com> Acked-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-12-01[SCSI] scsi_transport_sas: add 12GB definitions for mpt3sasSreekanth Reddy1-0/+1
[jejb: split this core change into a separate patch] Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@lsi.com> Reviewed-by: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-02-29[SCSI] scsi_transport_sas: 'enable' phys on resetDan Williams1-0/+1
If userspace requests a phy reset, treat that as a request for the phy to be enabled since that is the effect on hardware. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-02-29[SCSI] libsas: fix sas_find_local_phy(), take phy referencesDan Williams1-0/+23
In the direct-attached case this routine returns the phy on which this device was first discovered. Which is broken if we want to support wide-targets, as this phy reference can become stale even though the port is still active. In the expander-attached case this routine tries to lookup the phy by scanning the attached sas addresses of the parent expander, and BUG_ONs if it can't find it. However since eh and the libsas workqueue run independently we can still be attempting device recovery via eh after libsas has recorded the device as detached. This is even easier to hit now that eh is blocked while device domain rediscovery takes place, and that libata is fed more timed out commands increasing the chances that it will try to recover the ata device. Arrange for dev->phy to always point to a last known good phy, it may be stale after the port is torn down, but it will catch up for wide port reconfigurations, and never be NULL. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-02-19[SCSI] libsas: perform sas-transport resets in shost->workq contextDan Williams1-1/+17
Extend the sas transport class to allow transport users to attach extra data to a sas_phy (->hostdata). Use this area in libsas to move resets to workq context in preparation for scheduling ata device resets through libata-eh. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-02-19[SCSI] libsas: prevent domain rediscovery competing with ata error handlingDan Williams1-3/+15
libata error handling provides for a timeout for link recovery. libsas must not rescan for previously known devices in this interval otherwise it may remove a device that is simply waiting for its link to recover. Let libata-eh make the determination of when the link is stable and prevent libsas (host workqueue) from taking action while this determination is pending. Using a mutex (ha->disco_mutex) to flush and disable revalidation while eh is running requires any discovery action that may block on eh be moved to its own context outside the lock. Probing ATA devices explicitly waits on ata-eh and the cache-flush-io issued during device removal may also pend awaiting eh completion. Essentially any rphy add/remove activity needs to run outside the lock. This adds two new cleanup states for sas_unregister_domain_devices() 'allocated-but-not-probed', and 'flagged-for-destruction'. In the 'allocated-but-not-probed' state dev->rphy points to a rphy that is known to have not been through a sas_rphy_add() event. At domain teardown check if this device is still pending probe and cleanup accordingly. Similarly if a device has already been queued for removal then sas_unregister_domain_devices has nothing to do. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-02[SCSI] libsas: disable scanning lun > 0 on ata devicesDan Williams1-2/+8
Currently mvsas and pm8001 have custom ->slave_alloc implementations to achieve this. Uplevel it for all libsas drivers as isci encounters problems with atapi devices when scanning past lun0. Just do what Darrick suggested [1], and limit the scan for ata devices. [1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2 Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-03-10block: remove per-queue pluggingJens Axboe1-5/+1
Code has been converted over to the new explicit on-stack plugging, and delay users have been converted to use the new API for that. So lets kill off the old plugging along with aops->sync_page(). Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-02-08[SCSI] scsi_transport_sas: add support for transport layer retries (TLR)James Bottomley1-6/+97
The mpt2sas driver wants to use transport layer retries (TLR) so the simplest thing to do seems to be to add the enabling flags and checks to the SAS transport class, since they're a SAS specific protocol feature. Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa1-3/+3
That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-08-22[SCSI] scsi_transport_sas: fix incorrect duplicate setup of max_physJames Bottomley1-4/+0
There are two setup places for max_phys in scsi_transport_sas.c; one incorrectly places a NULL into host_attrs instead of port_attrs. Remove it. Reported-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-06-21scsi_transport_sas: needs to call blk_end_request_all for SMP requestsFUJITA Tomonori1-2/+2
We need to call blk_end_request_all to complete SMP requests properly. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-11block: implement and enforce request peek/start/fetchTejun Heo1-3/+1
Till now block layer allowed two separate modes of request execution. A request is always acquired from the request queue via elv_next_request(). After that, drivers are free to either dequeue it or process it without dequeueing. Dequeue allows elv_next_request() to return the next request so that multiple requests can be in flight. Executing requests without dequeueing has its merits mostly in allowing drivers for simpler devices which can't do sg to deal with segments only without considering request boundary. However, the benefit this brings is dubious and declining while the cost of the API ambiguity is increasing. Segment based drivers are usually for very old or limited devices and as converting to dequeueing model isn't difficult, it doesn't justify the API overhead it puts on block layer and its more modern users. Previous patches converted all block low level drivers to dequeueing model. This patch completes the API transition by... * renaming elv_next_request() to blk_peek_request() * renaming blkdev_dequeue_request() to blk_start_request() * adding blk_fetch_request() which is combination of peek and start * disallowing completion of queued (not started) requests * applying new API to all LLDs Renamings are for consistency and to break out of tree code so that it's apparent that out of tree drivers need updating. [ Impact: block request issue API cleanup, no functional change ] Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Mike Miller <mike.miller@hp.com> Cc: unsik Kim <donari75@gmail.com> Cc: Paul Clements <paul.clements@steeleye.com> Cc: Tim Waugh <tim@cyberelk.net> Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Cc: David S. Miller <davem@davemloft.net> Cc: Laurent Vivier <Laurent@lvivier.info> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Borislav Petkov <petkovbb@googlemail.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Alex Dubov <oakad@yahoo.com> Cc: Pierre Ossman <drzeus@drzeus.cx> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Markus Lidel <Markus.Lidel@shadowconnect.com> Cc: Stefan Weinhuber <wein@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Pete Zaitcev <zaitcev@redhat.com> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-01-02[SCSI] struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers1-20/+22
[jejb: limit ioctl to returning 20 characters to avoid overrun on long device names and add a few more conversions] Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-27[SCSI] replace __FUNCTION__ with __func__Harvey Harrison1-2/+2
[jejb: fixed up a ton of missed conversions. All of you are on notice this has happened, driver trees will now need to be rebased] Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: SCSI List <linux-scsi@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-29block: make queue flags non-atomicNick Piggin1-2/+1
We can save some atomic ops in the IO path, if we clearly define the rules of how to modify the queue flags. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-04-22[SCSI] scsi_transport_sas: fix the lifetime of sas bsg objectsFUJITA Tomonori1-2/+20
scsi_transport_sas calls blk_cleanup_queue too early for bsg queues. If a user holds a sas_host, end_device, or expander device open, remove the device, then send a request to it, we get a kernel crash. We need to call blk_cleanup_queue in the release callback as we do with scsi devices. This patch moves blk_cleanup_queue to sas_expander_release and sas_end_device_release from sas_bsg_remove. sas_host can't use the release callback in struct device so use bsg's release callback. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-22[SCSI] bsg: add release callback supportFUJITA Tomonori1-1/+1
This patch adds release callback support, which is called when a bsg device goes away. bsg_register_queue() takes a pointer to a callback function. This feature is useful for stuff like sas_host that can't use the release callback in struct device. If a caller doesn't need bsg's release callback, it can call bsg_register_queue() with NULL pointer (e.g. scsi devices can use release callback in struct device so they don't need bsg's callback). With this patch, bsg uses kref for refcounts on bsg devices instead of get/put_device in fops->open/release. bsg calls put_device and the caller's release callback (if it was registered) in kref_put's release. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-19SCSI: convert struct class_device to struct deviceTony Jones1-69/+88
It's big, but there doesn't seem to be a way to split it up smaller... Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Roland Dreier <rolandd@cisco.com> Cc: Sean Hefty <sean.hefty@intel.com> Cc: Hal Rosenstock <hal.rosenstock@gmail.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-03drivers/scsi/: Spelling fixesJoe Perches1-1/+1
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Acked-by: James Smart <james.smart@emulex.com> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Acked-by: David Somayajulu <david.somayajulu@qlogic.com> Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
2008-01-11[SCSI] libsas, bsg: pass errors through correctlyJames Bottomley1-0/+1
Currently in BSG, errors returned in req->errors aren't passed back to the calling programme (either via SG_IO or via read/write). Fix this, while preserving the SCSI convention of returning status in req->errors. Now update libsas to return errors correctly instead of to ignore them. Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-11[SCSI] Add Documentation and integrate into docbook buildRob Landley1-19/+21
Add Documentation/DocBook/scsi_midlayer.tmpl, add to Makefile, and update lots of kerneldoc comments in drivers/scsi/*. Updated with comments from Stefan Richter, Stephen M. Cameron, James Bottomley and Randy Dunlap. Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2007-07-21[SCSI] bsg: make class backlinksJames Bottomley1-14/+18
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 Bottomley1-1/+35
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 Tomonori1-0/+85
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önig1-2/+2
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. Wong1-4/+22
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. Wong1-14/+19
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 Bruemmer1-1/+1
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. Wong1-2/+2
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. Wong1-1/+1
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. Wong1-0/+51
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 Viro1-0/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-09-07[SCSI] scsi_transport_sas: make minimum and maximum linkrate settable quantitiesJames Bottomley1-6/+67
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 Bottomley1-8/+2
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 Bottomley1-5/+3
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>