aboutsummaryrefslogtreecommitdiff
path: root/drivers/s390/scsi/zfcp_erp.c
AgeCommit message (Collapse)Author
2007-05-08[SCSI] zfcp: clear adapter failed flag if an fsf request times out.Heiko Carstens
Must clear adapter failed flag if an fsf request times out. This is necessary because on link down situations the failed flags gets set but the QDIO queues are still up. Since an adapter reopen will be skipped if the failed flag is set an adapter_reopen that is issued on fsf request timeout has no effect if the local link is down. Might lead to locked up system if the SCSI stack is waiting for abort completion. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-08[SCSI] zfcp: rework request ID management.Heiko Carstens
Simplify request ID management and make sure that frequently used functions are inlined. Also fix a memory leak in zfcp_adapter_enqueue() which only gets hit in error handling. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-08[SCSI] zfcp: Fix deadlock between zfcp ERP and SCSIChristof Schmitt
The SCSI stack requires low level drivers to register and unregister devices. For zfcp this leads to the situation where zfcp calls the SCSI stack, the SCSI tries to scan the new device and the scan SCSI command fails. This would require the zfcp erp, but the erp thread is already blocked in the register call. The fix is to make sure that the calls from the ERP thread to the SCSI stack do not block the ERP thread. In detail: 1) Use a workqueue to avoid blocking of the scsi_scan_target calls. 2) When removing a unit make sure that no scsi_scan_target call is pending. 3) Replace scsi_flush_work with scsi_target_unblock. This avoids blocking and has the same result. Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-08[SCSI] zfcp: print S_ID and D_ID with 3 bytesChristof Schmitt
S_ID and D_ID are defined in the FCP spec as 3 byte fields. Change the output in zfcp print statements accordingly to print them with only 3 bytes. Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-04-01[SCSI] zfcp: fix initialization of FSF timerChristof Schmitt
Correctly initialize the timer for FSF requests with jiffies + timeout. Cc: Swen Schillig <swen@vnet.ibm.com> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-02-10Merge branch 'linus'James Bottomley
Conflicts: drivers/scsi/ipr.c Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-02-10[SCSI] zfcp: removed wrong commentSwen Schillig
commit 07a105136f07f0cf1b476383e43033b8a65e13ff Author: Swen Schillig <swen@vnet.ibm.com> Date: Fri Feb 9 09:58:09 2007 +0100 removed wrong comment Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-02-10[SCSI] zfcp: use of uninitialized variableSwen Schillig
commit 988d955c3314336d716a9208f3d565b06f262e07 Author: Swen Schillig <swen@vnet.ibm.com> Date: Fri Feb 9 09:40:11 2007 +0100 Use of uninitialized variable. ERP action might not be finished accordingly. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-02-05[S390] Get rid of a lot of sparse warnings.Heiko Carstens
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2006-10-10[PATCH] drivers/s390 misc sparse annotationsAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-23[SCSI] zfcp: fix: avoid removal of fsf reqs before qdio queues are downAndreas Herrmann
Fix the fix ... One of my previous fixes introduced removal of all fsf requests in zfcp's eh_host_reset_handler. But this must not happen before qdio queues are shut down. So, I revert the changes of zfcp_scsi_eh_host_reset_handler. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-09-23[SCSI] zfcp: introduce struct timer_list in struct zfcp_fsf_reqAndreas Herrmann
This instance will be used whenever a timer is needed for a request by zfcp. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-08-06[SCSI] zfcp: minor erp bug fixesAndreas Herrmann
Bug fixes for zfcp's erp: - trigger adapter reopen if do_QDIO fails - avoid erp deadlock if registration of scsi target or remote port hang - do not treat as error if exchange port data fails - decrease timeout for target reset and aborts - mark unit failed if slave_destroy is called Additionally some code cleanup was done: - made some functions void when retval is not of interest - shortened initialization of zfcp's host_template - corrected some comments Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-08-06[SCSI] zfcp: improve management of request IDsVolker Sameske
Improve request handling. Use hash table to manage request IDs. Signed-off-by: Volker Sameske <sameske@de.ibm.com> Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-07-03[PATCH] zfcp: fix incorrect usage of erp_lockHeiko Carstens
================================= [ INFO: inconsistent lock state ] --------------------------------- inconsistent {hardirq-on-W} -> {in-hardirq-W} usage. swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes: (&adapter->erp_lock){+-..}, at: [<000000000026c7f8>] zfcp_erp_async_handler+0x3c/0x70 {hardirq-on-W} state was registered at: [<000000000005f33e>] __lock_acquire+0x30a/0xed0 [<00000000000604ae>] lock_acquire+0x9a/0xc8 [<000000000035a7ae>] _write_lock+0x4e/0x68 [<000000000026d822>] zfcp_erp_adapter_strategy_generic+0x286/0xd94 [<000000000026fd72>] zfcp_erp_strategy_do_action+0x91e/0x1a94 [<0000000000271a3a>] zfcp_erp_thread+0x21a/0x1568 [<0000000000019096>] kernel_thread_starter+0x6/0xc [<0000000000019090>] kernel_thread_starter+0x0/0xc irq event stamp: 12078 hardirqs last enabled at (12077): [<0000000000019416>] cpu_idle+0x206/0x250 hardirqs last disabled at (12078): [<0000000000020458>] io_no_vtime+0xc/0x1c softirqs last enabled at (12072): [<0000000000040b62>] __do_softirq+0x13a/0x180 softirqs last disabled at (12059): [<000000000001fd58>] do_softirq+0xec/0xf0 other info that might help us debug this: no locks held by swapper/0. stack backtrace: 00000000012bb648 0000000000000002 0000000000000000 00000000012bb758 00000000012bb6c0 0000000000399122 0000000000399122 0000000000016b0a 0000000000000000 0000000000000001 0000000000000000 00000000004660e8 0000000000000000 000000000000000d 00000000012bb6b8 00000000012bb730 0000000000368b90 0000000000016b0a 00000000012bb6b8 00000000012bb708 Call Trace: ([<0000000000016a26>] show_trace+0x76/0xdc) [<0000000000016b2c>] show_stack+0xa0/0xd0 [<0000000000016b8a>] dump_stack+0x2e/0x3c [<000000000005e3da>] print_usage_bug+0x27e/0x290 [<000000000005e934>] mark_lock+0x548/0x6c0 [<000000000005fb0c>] __lock_acquire+0xad8/0xed0 [<00000000000604ae>] lock_acquire+0x9a/0xc8 [<000000000035a662>] _write_lock_irqsave+0x62/0x80 [<000000000026c7f8>] zfcp_erp_async_handler+0x3c/0x70 [<0000000000279178>] zfcp_fsf_req_dispatch+0xd8/0x1fa8 [<000000000027e538>] zfcp_fsf_req_complete+0x104/0xe4c [<0000000000274534>] zfcp_qdio_reqid_check+0xf4/0x178 [<000000000027469e>] zfcp_qdio_response_handler+0xe6/0x430 [<0000000000219dd4>] tiqdio_thinint_handler+0xd20/0x213c [<000000000020229a>] do_adapter_IO+0xb2/0xc0 [<0000000000206f32>] do_IRQ+0x136/0x16c [<0000000000020462>] io_no_vtime+0x16/0x1c [<0000000000019432>] cpu_idle+0x222/0x250 ([<0000000000019416>] cpu_idle+0x206/0x250) [<000000000001405a>] rest_init+0x5a/0x68 [<0000000000536998>] start_kernel+0x39c/0x3dc [<0000000000013046>] _stext+0x46/0x1000 Fix incorrect usage of erp_lock. Using the write_lock() variant is wrong, since this might lead to deadlocks. Acked-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-26spelling fixesAndreas Mohr
acquired (aquired) contiguous (contigious) successful (succesful, succesfull) surprise (suprise) whether (weather) some other misspellings Signed-off-by: Andreas Mohr <andi@lisas.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-05-28[SCSI] zfcp: make use of fc_remote_port_delete when target port is unavailableAndreas Herrmann
If zfcp's port erp fails we now call fc_remote_port_delete. This helps to avoid offlined scsi devices if scsi commands time out due to path failures. When an adapter erp fails we call fc_remote_port_delete for all ports on that adapter. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-05-28[SCSI] zfcp: evaluate plogi payload to set maxframe_size, supported_classes ↵Ralph Wuerthner
of rports Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-05-28[SCSI] zfcp: (cleanup) removed superfluous macros, struct members, typedefsAndreas Herrmann
Removed some macros, struct members and typedefs which were unused or not necessary. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-05-28[SCSI] zfcp: (cleanup) kmalloc/kzalloc replacementAndreas Herrmann
Replace kmalloc/memset by kzalloc or kcalloc. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-05-28[SCSI] zfcp: (cleanup) remove useless commentsAndreas Herrmann
Removed some useless comments. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-05-28[SCSI] zfcp: (cleanup) shortened copyright and author informationAndreas Herrmann
Copyright update, shortened file headers, shortened author information. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-09[SCSI] zfcp: fix device registration issuesAndreas Herrmann
The patch fixes following issues: (1) Replace scsi_add_device with scsi_scan_target. (Thus the rport instead of the scsi_host becomes parent of a scsi_target again.) (2) Avoid scsi_device allocation during registration of an remote port. (Would be done during fc_scsi_scan_rport.) (3) Fix queuecommand behaviour when an zfcp unit is blocked. (Call scsi_done with DID_NO_CONNECT instead of returning SCSI_MLQUEUE_DEVICE_BUSY otherwise we might end up waiting for completion in blk_execute_rq for ever.) Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-12[SCSI] zfcp: fix: avoid race between fc_remote_port_add and scsi_add_deviceAndreas Herrmann
Flush workqueue of a scsi host after a remote port for that host is registered at the fc transport class. Otherwise immediate registration of a scsi device on that host is racy. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-12[SCSI] zfcp: fix adapter erp when link is unpluggedAndreas Herrmann
Remove endless polling for replug of the local link. Just wait for link up notification. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-02-01[PATCH] s390: Remove CVS generated informationHeiko Carstens
- Remove all CVS generated information like e.g. revision IDs from drivers/s390 and include/asm-s390 (none present in arch/s390). - Add newline at end of arch/s390/lib/Makefile to avoid diff message. Acked-by: Andreas Herrmann <aherrman@de.ibm.com> Acked-by: Frank Pavlic <pavlic@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-15spelling: s/appropiate/appropriate/Adrian Bunk
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-01-14[SCSI] zfcp: transport class adaptations IIAndreas Herrmann
Replaced zfcp adapter attributes with fc_host attributes: fc_topology by port_type, physical_wwpn by permanent_port_name. Make use of fc_host attribute supported_speeds. Removed zfcp adapter attribute physical_s_id. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-01[SCSI] zfcp: fix adapter initializationAndreas Herrmann
Fixed various problems in opening sequence of adapters which was previously changed with NPIV support: o corrected handling when exchange port data function is not supported, otherwise adapters on z900 cannot be opened anymore o corrected setup of timer for exchange port data if called from error recovery o corrected check of return code of exchange config data Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-01[SCSI] zfcp: fix spinlock initializationHeiko Carstens
Move initialization of locks and lists to adapter allocation function. Otherwise we might end up with some uninitialized locks, like e.g. the erp locks which only will be inititialized if an error recovery thread for an adapter will be started. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-19[SCSI] zfcp: add additional fc_host attributesAndreas Herrmann
this patch adds some fc host attributes and removes its equivalents from the zfcp_adapter structure and zfcp specific sysfs subtree. Furthermore it removes superfluous calls to fc_remort_port_delete when an adapter is set offline because rports will be removed by fc_remove_host anyway. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-19[SCSI] zfcp: provide support for NPIVMaxim Shchetynin
N_Port ID Virtualization (NPIV) allows a single FCP port to appear as multiple, distinct ports providing separate port identification. NPIV is supported by FC HBAs on System z9. zfcp was adapted to support this new feature. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-19[SCSI] zfcp: fix race conditions when accessing erp_action listsAndreas Herrmann
o always use locking when changing erp_action lists, o avoid escalation to ERP_ACTION_REOPEN_PORT_FORCED if erp_action is still in use for ERP_ACTION_REOPEN_PORT Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-08-27[PATCH] zfcp: add rports to enable scsi_add_device to work againAndreas Herrmann
This patch fixes a severe problem with 2.6.13-rc7. Due to recent SCSI changes it is not possible to add any LUNs to the zfcp device driver anymore. With registration of remote ports this is fixed. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Acked-by: James Bottomley <jejb@steeleye.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-13[SCSI] zfcp: fix handling of port boxed and lun boxed fsf statesAndreas Herrmann
From: Maxim Shchetynin <maxim@de.ibm.com> Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-13[SCSI] zfcp: fix bug during adapter shutdownAndreas Herrmann
Fixes a race between zfcp_fsf_req_dismiss_all and zfcp_qdio_reqid_check. During adapter shutdown it occurred that a request was cleaned up twice. First during its normal completion. Second when dismiss_all was called. The fix is to serialize access to fsf request list between zfcp_fsf_req_dismiss_all and zfcp_qdio_reqid_check and delete a fsf request from the list if its completion is triggered. (Additionally a rwlock was replaced by a spinlock and fsf_req_cleanup was eliminated.) Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-13[SCSI] zfcp: fix: problem in send_els_handler when D_ID assignment changesAndreas Herrmann
From: Maxim Shchetynin <maxim@de.ibm.com> Fixes a bug in zfcp_send_els_handler. If D_ID assignments for ports are changing between initiation of one ELS request and its completion the wrong port might be accessed in the completion for that ELS request. Thus a pointer to the port has to be passed for ELS requests to identify the port structure if required. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-13[SCSI] zfcp: fix: allow more time for adapter initializationAndreas Herrmann
From: Maxim Shchetynin <maxim@de.ibm.com> Extend the time for adapter initialization: In case of protocol status HOST_CONNECTION_INITIALIZING for the exchange config data command do a first retry in 1 second, then double the sleep time for each following retry until recovery exceeds 2 minutes. The old behaviour of allowing 6 retries with .5 seconds delay between retries was insufficient and qdio queues were shut down too erarly. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-04-18zfcp: add point-2-point support
From: Andreas Herrmann <aherrman@de.ibm.com> This patch mainly introduces support for point-2-point topology. From: Heiko Carstens <heiko.carstens@de.ibm.com> From: Maxim Shchetynin <maxim@de.ibm.com> From: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-04-16Linux-2.6.12-rc2Linus Torvalds
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!