aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_cmds.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-19scsi: be2iscsi: Include null char in SET_HOST_DATAJitendra Bhivare1-1/+1
FW needs NULL terminated driver version string. Signed-off-by: Ketan Mukadam <ketan.mukadam@broadcom.com> Reviewed-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-10-11scsi: be2iscsi: Remove A-circumflex character in copyright markingJitendra Bhivare1-1/+1
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-10-11scsi: be2iscsi: Fix misc static analysis errorsJitendra Bhivare1-1/+0
The patch fixes errors reported by tools like smatch: - removes unused structure fields - removes dead code - fixes code identation Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-10-11scsi: be2iscsi: Add cmd to set host dataJitendra Bhivare1-0/+46
Provide driver version in host data to FW. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-10-11scsi: be2iscsi: Fix _modify_eq_delay buffer overflowJitendra Bhivare1-3/+3
beiscsi_modify_eq_delay is using embedded command to send request of 788 bytes in 236 bytes buffer. Non-embedded command needs to be used in such cases. Use mgmt_alloc_cmd_data fn modified to allow passing of subsystem. Use mgmt_exec_nonemb_cmd fn modified to allow setting of callback. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-03-27scsi: be2iscsi: Update CopyrightJitendra Bhivare1-7/+4
Update Broadcom Copyright markings in all files. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-03-27scsi: be2iscsi: Check tag in beiscsi_mccq_compl_waitJitendra Bhivare1-0/+6
scsi host12: BS_1377 : mgmt_invalidate_connection Failed for cid=256 BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 IP: [<ffffffff81332ebf>] __list_add+0xf/0xc0 PGD 0 Oops: 0000 [#1] SMP Modules linked in: ... CPU: 9 PID: 1542 Comm: iscsid Tainted: G ------------ T 3.10.0-514.el7.x86_64 #1 Hardware name: HP ProLiant DL360 Gen9/ProLiant DL360 Gen9, BIOS P89 09/12/2016 task: ffff88076f310fb0 ti: ffff88076bba8000 task.ti: ffff88076bba8000 RIP: 0010:[<ffffffff81332ebf>] [<ffffffff81332ebf>] __list_add+0xf/0xc0 RSP: 0018:ffff88076bbab8e8 EFLAGS: 00010046 RAX: 0000000000000246 RBX: ffff88076bbab990 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff880468badf58 RDI: ffff88076bbab990 RBP: ffff88076bbab900 R08: 0000000000000246 R09: 00000000000020de R10: 0000000000000000 R11: ffff88076bbab5be R12: 0000000000000000 R13: ffff880468badf58 R14: 000000000001adb0 R15: ffff88076f310fb0 FS: 00007f377124a880(0000) GS:ffff88046fa40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000008 CR3: 0000000771318000 CR4: 00000000001407e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Stack: ffff88076bbab990 ffff880468badf50 0000000000000001 ffff88076bbab938 ffffffff810b128b 0000000000000246 00000000cf9b7040 ffff880468bac7a0 0000000000000000 ffff880468bac7a0 ffff88076bbab9d0 ffffffffa05a6ea3 Call Trace: [<ffffffff810b128b>] prepare_to_wait+0x7b/0x90 [<ffffffffa05a6ea3>] beiscsi_mccq_compl_wait+0x153/0x330 [be2iscsi] [<ffffffff810b1600>] ? wake_up_atomic_t+0x30/0x30 [<ffffffffa05981b1>] beiscsi_ep_disconnect+0x91/0x2d0 [be2iscsi] [<ffffffffa0202ffa>] iscsi_if_ep_disconnect.isra.14+0x5a/0x70 [scsi_transport_iscsi] [<ffffffffa02042fb>] iscsi_if_recv_msg+0x113b/0x14a0 [scsi_transport_iscsi] [<ffffffff811dffd8>] ? __kmalloc_node_track_caller+0x58/0x290 [<ffffffffa02046ee>] iscsi_if_rx+0x8e/0x1f0 [scsi_transport_iscsi] [<ffffffff815a351d>] netlink_unicast+0xed/0x1b0 [<ffffffff815a38fe>] netlink_sendmsg+0x31e/0x690 [<ffffffff815a03e4>] ? netlink_rcv_wake+0x44/0x60 [<ffffffff815a19e3>] ? netlink_recvmsg+0x1e3/0x450 beiscsi_mccq_compl_wait gets called even when MCC tag allocation failed for mgmt_invalidate_connection. mcc_wait is not initialized for tag 0 so causes crash in prepare_to_wait. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Chris Leech <cleech@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-01-05scsi: be2iscsi: Remove unused struct membersJitendra Bhivare1-4/+4
Fix errors reported in static analysis. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-01-05scsi: be2iscsi: Fix iSCSI cmd cleanup IOCTLJitendra Bhivare1-15/+18
Prepare the IOCTL with appropriate sizes of buffers of V0 and V1. Set missing chute number in V1 IOCTL. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Update copyright informationJitendra Bhivare1-2/+2
Change the copyright to: Copyright © xxxx - 2016 Broadcom Update email.ids: @avagotech.com - @broadcom.com Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Add FUNCTION_RESET during driver unloadJitendra Bhivare1-1/+1
Driver unload should call COMMON_FUNCTION_RESET. For TPE feature, this ensures that FW has knowledge about driver getting unloaded and can reset its bit vector. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Add TPE recovery featureJitendra Bhivare1-1/+172
After UE is detected, check for recoverable error by reading SLIPORT SEMAPHORE register. If transient parity error i.e. 0xExxx then schedule recovery work on driver wq. FLag this error to prevent any transactions for the duration of ue2rp to restart polling. After that, if FW becomes ready then recover port. Wake up processes in wq before going offline. Wait for process to execute before cleaning up. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Add V1 of EPFW cleanup IOCTLJitendra Bhivare1-47/+49
mgmt_epfw_cleanup does not implement v1 of OPCODE_COMMON_ISCSI_CLEANUP IOCTL for SkyHawk. Replace use of MCCQ with BMBX for issuing the IOCTL. Remove be_mcc_compl_poll which is no longer needed. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Fix POST check and reset sequenceJitendra Bhivare1-129/+121
SLIPORT FUNCTION_RESET does not reset the chip. So POST status needs to be checked before issuing FUNCTION_RESET. The completion of FUNCTION_RESET is indicated in BMBX Rdy bit. be_cmd_fw_initialize too needs to be done before issuing any cmd to FW. be_cmd_fw_initialize is renamed as beiscsi_cmd_special_wrb. Rearrange and rename few functions in init and cleanup path. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Move functions to right filesJitendra Bhivare1-11/+263
beiscsi_fail_session is defined in be_cmds.c: move it to be_iscsi.c Move card configuration commands to be_cmds.c. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Add IOCTL to check UER supportedJitendra Bhivare1-14/+44
BE3 and SH cards can recover from transient parity errors treated earlier as unrecoverable errors. Add IOCTL to query FW support for this feature. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Fix to add timer for UE detectionJitendra Bhivare1-0/+7
UE detection in health check is done in a work scheduled in global wq. UE caused due to transient parity errors are recoverable and reported within 1s. If this check for TPE gets delayed, PF0 might initiate soft-reset and then status of UE recoverable is lost. Handle UE detection in timer routine. Move out EQ delay update work from health check. Make the IOCTL for EQ delay update non-blocking as the completion status is ignored. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Fix to make boot discovery non-blockingJitendra Bhivare1-65/+96
Boot work involves: 1. Find and fetch configured boot session and its handle. 2. Attempt to open the session if its not. 3. Get the session details for boot kset creation. 4. Logout of that session owned by FW. 5. Create boot kset for session details. All these actions were done in blocking call with retries in global wq. Other works in wq suffered if the IOCTLs stalled or timed out. This change moves all the boot work to make it non-blocking. The work queued in global wq just issues the IOCTL depending on the action to be taken and mcc wq schedules work depending on status of the IOCTL. Initial boot_work is started on link and ASYNC event. The other code changes move all boot related functions in one place and follow naming conventions. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Fix checks for HBA in error stateJitendra Bhivare1-11/+17
Save ue_detected and fw_timeout errors in state field of beiscsi_hba. BEISCSI_HBA_RUNNING BEISCSI_HBA_LINK_UP BEISCSI_HBA_BOOT_FOUND BEISCSI_HBA_PCI_ERR BEISCSI_HBA_FW_TIMEOUT BEISCSI_HBA_IN_UE Make sure no PCI transaction happens once in error state. Add checks in IO path to detect HBA in error. Skip hwi_purge_eq step which can't be done in error state. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Remove alloc_mcc_tag & beiscsi_pci_soft_resetJitendra Bhivare1-76/+0
alloc_mcc_tag was replaced with alloc_mcc_wrb and is no more used. beiscsi_pci_soft_reset is not used at all and won't be needed. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Reduce driver load/unload timeJitendra Bhivare1-1/+2
Driver takes significant time to load 1m:20s and unload 40s. Checkpatch script threw warning: WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt To eliminate this warning msleep(1) was replaced with msleep(20) before submitting. msleep(20) in init and uninit path for creation and destroying of number of WRBQs, CQs, and EQs is adding to load/unload time. Replace msleep with schedule_timeout_uninterruptible of 1ms as its enough in most cases. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-08-23scsi: be2iscsi: Replace _bh version for mcc_lock spinlockJitendra Bhivare1-4/+4
This got unnecessarily introduced with other changes in previous commits. mcc_lock is taken only in process contexts. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Couple MCC tag and WRB alloc and freeJitendra Bhivare1-29/+74
WARN_ON(atomic_read(&mccq->used) >= mccq->len) seen when FW gets into UE. MCCQ overflow is happening because driver discards any new request and frees up the tag. The tag allocation controls the number of MCC WRB posted. It is being replenished but WRBs are not hence the WARN_ON. Allocation and freeing of WRB and tags for MCC is now done in one place. This helps to achieve proper accounting of WRB indices and MCC tags. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Cleanup processing of BMBX completionJitendra Bhivare1-39/+36
Remove confusingly named be_mcc_compl_is_new and be_mcc_compl_use functions in processing of BMBX. Rearrange beiscsi_process_mbox_compl function. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix be_mcc_compl_poll to use tag_stateJitendra Bhivare1-45/+47
be_mcc_compl_poll waits till 'used' count of MCC WRBQ is zero. This is to determine the completion of an MCC sent. Change function to poll for the tag of MCC sent, instead, and wait till its tag_state is cleared. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Remove be_mbox_notify_wait functionJitendra Bhivare1-75/+4
be_mbox_notify_wait does exactly same thing as be_mbox_notify. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Rename MCC and BMBX processing functionsJitendra Bhivare1-19/+19
beiscsi_mccq_compl -> beiscsi_mccq_compl_wait - indicate blocking call. be_mcc_wait_compl -> be_mcc_compl_poll - indicate polling for completion. be_mbox_db_ready_wait -> be_mbox_db_ready_poll - indicate polling for RDY. be_mcc_compl_process -> beiscsi_process_mbox_compl - indicate BMBX compl. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Remove redundant MCC processing codeJitendra Bhivare1-107/+58
be_mcc_compl_process_isr is removed. MCC CQ processing is done only in beiscsi_process_mcc_cq and MCC CQE processing is done only in beiscsi_process_mcc_compl. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Use macros for MCC WRB and CQE fieldsJitendra Bhivare1-19/+21
Rename mcc_numtag to mcc_tag_status. MCC CQE status is processed using macros already defined in be_cmds.h. Add MCC_Q_WRB_ and MCC_Q_CMD_TAG_MASK macros to map to already defined CQE_STATUS_ macros to be consistent when posting MCC. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Remove unused mcc_cq_lockJitendra Bhivare1-2/+0
mcc_cq_lock spin_lock is used only in beiscsi_process_mcc which is called only when all interrupts are disabled from mgmt_epfw_cleanup during unloading of driver. There is no other context where there can be contention for the processing of CQ. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix async link event processingJitendra Bhivare1-25/+23
Use only port_link_status only to determine link state change. Only bit 0 is used to get the state. Remove code for processing port_fault. Fixed get_nic_conf structure definition. Removed rsvd[23] field in be_cmd_get_nic_conf_resp. Moved definitions of struct field values below the field. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix to process 25G link speed info from FWJitendra Bhivare1-0/+1
Async link event provides port_speed info. Cache the port_speed info and use the same to report in ISCSI_HOST_PARAM_PORT_SPEED query. Removed link status query IOCTL used to do the same. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix IOPOLL implementationJitendra Bhivare1-1/+1
OS not responding when running 2 port traffic on 72 CPUs system. be2iscsi IRQs gets affined to CPU0 when irqbalancer is disabled. be_iopoll processing completions in BLOCK_IOPOLL_SOFTIRQ hogged CPU0. 1. Use budget to exit the polling loop. beiscsi_process_cq didn't honour it. 2. Rearming of EQ is done only after iopoll completes. [mkp: Fixed up blk_iopoll -> irq_poll transition] Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix return value for MCC completionJitendra Bhivare1-1/+1
Change return value of completed MCC EBUSY to EINVAL. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix to handle misconfigured optics eventsJitendra Bhivare1-61/+103
Log messages for misconfigured transceivers reported by FW. Register async events that driver handles using MCC_CREATE_EXT ioctl. Errors messages for faulted/uncertified/unqualified optics are logged. Added IOCTL to get port_name to be displayed in error message. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix to remove shutdown entry pointJitendra Bhivare1-14/+3
Null pointer dereference in shutdown path after taking dump. Shutdown path is not needed as FW comes up clean every time during probe after issuing FUNCTION reset MBOX command. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Set mbox timeout to 30sJitendra Bhivare1-2/+3
FW recommended timeout for all mbox command is 30s. Use msleep instead mdelay to relinquish CPU when polling for mbox completion. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix to synchronize tag allocation using spin_lockJitendra Bhivare1-2/+4
alloc_mcc_tag needs to be done under mcc_lock. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix to use atomic bit operations for tag_stateJitendra Bhivare1-55/+56
beiscsi_mccq_compl sets MCC_TAG_STATE_TIMEOUT before setting up tag_mem_state. be_mcc_compl_process_isr checks for MCC_TAG_STATE_TIMEOUT first then accesses tag_mem_state which might be still getting populated in the process context. Fix: Set MCC_TAG_STATE_TIMEOUT after tag_mem_state is populated. Removed MCC_TAG_STATE_COMPLETED. When posted its in running state and the running state is cleared in be_mcc_compl_process_isr. be_mcc_notify now takes tag argument to set it to running state. Use bit operations for tag_state. Use barriers before setting the state. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix mbox synchronization replacing spinlock with mutexJitendra Bhivare1-36/+37
This is second part of actual fix for soft lockup. All mbox cmds issued using BMBX and MCC are synchronized using mutex mbox_lock instead of spin_lock. Used mutex_lock_interruptible where ever possible. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Shane Seymour <shane.seymour@hpe.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23be2iscsi: Fix soft lockup in mgmt_get_all_if_id path using bmbxJitendra Bhivare1-31/+29
We are taking mbox_lock spinlock which disables pre-emption before we poll for mbox completion. Waiting there with spinlock held in excess of 20s will cause soft lockup. Actual fix is to change mbox_lock to mutex. The changes are done in phases. This is the first part. 1. Changed mgmt_get_all_if_id to use MCC where after posting lock is released. 2. Changed be_mbox_db_ready_wait to busy wait for 12s max and removed wait_event_timeout. Added error handling code for IO reads. OPCODE_COMMON_QUERY_FIRMWARE_CONFIG mbox command takes 8s time when unreachable boot targets configured. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-10-27be2iscsi: Revert ownership to EmulexKetan Mukadam1-2/+2
We would like to get the following updates in: Revert ownership to "Emulex" from "Avago Technologies" Signed-off-by: Ketan Mukadam <ketan.mukadam@avagotech.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-05-25be2iscsi : Fix the retry count for boot targetsJohn Soni Jose1-0/+4
Increment the retry count to get the boot target info when port async event is received by the driver. Update sysfs enteries with the boot target parameters. Signed-off-by: Minh Tran <minhduc.tran@emulex.com> Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-05-18MAINTAINERS, be2iscsi: change email domainMinh Tran1-3/+3
be2iscsi change of ownership from Emulex to Avago Technologies recently. We like to get the following updates in: changed "Emulex" to "Avago Technologies", changed email addresses from "emulex.com" to "avagotech.com", updated MAINTAINER list for be2iscsi driver. Signed-off-by: Minh Tran <minh.tran@avagotech.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@avagotech.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-03-06treewide: Fix typo in printk messagesMasanari Iida1-1/+1
This patch fix spelling typo in printk messages. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-09-16be2iscsi: Fix updating the boot enteries in sysfsJayamohan Kallickal1-2/+36
During port async event driver should check if there is any boot target configured on the adapter. Update sysfs enteries with the boot target parameters. Signed-off-by: Minh Tran <minhduc.tran@emulex.com> Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-16be2iscsi: Fix the copyright yearJayamohan Kallickal1-1/+1
Change the copyright year to 2014 Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-03-15[SCSI] be2iscsi: Fix the session cleanup when reboot/shutdown happensJayamohan Kallickal1-1/+16
In iSCSI Boot scenario, when machine is reboot/shutdown phase the active sessions are not closed. Driver queue cleanup is done as part of unload and device is disabled. Sessions are still active, iSCSI commands are issued from session which comes to driver, as driver cleanup and device disabled there is kernel stack dump with errors. Fix is invoking iscsi_session_failure with ISCSI_ERR_INVALID_HOST on all the active sessions when shutdown routine is called. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec.Jayamohan Kallickal1-13/+1
The doorbel format has been updated to support additonal functionalities of SKH-R adapter. These changes are made such that older FW also works fine. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] be2iscsi: Fix handling timed out MBX completion from FWJayamohan Kallickal1-22/+68
When an MBX command timeout happens,the resources associated with the MBX command were freed. If FW were to give the response to host after the timeout value set by driver then driver crashes as the MBX Cmd resources were already freed. This patch fixes this issue by maintaing a state flag for each of the MBX command posted/timedout/completed. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>