summaryrefslogtreecommitdiff
path: root/drivers/scsi/fnic
Commit message (Collapse)AuthorAge
* scsi: fnic: do not call host reset from command abortHannes Reinecke2017-08-25
| | | | | | | | | | Command abort already returns FAILED, which will then be escalated to a host reset. So no need to call host_reset directly. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: fix format string overflow warningArnd Bergmann2017-08-07
| | | | | | | | | | | | | | | | | | The MSI interrupt name can require 11 bytes in addition to the device name, for a total of 23 bytes: drivers/scsi/fnic/fnic_isr.c: In function 'fnic_request_intr': drivers/scsi/fnic/fnic_isr.c:192:4: error: '-fcs-rq' directive writing 7 bytes into a region of size between 5 and 16 [-Werror=format-overflow=] "%.11s-fcs-rq", fnic->name); drivers/scsi/fnic/fnic_isr.c:206:3: note: 'sprintf' output between 12 and 23 bytes into a destination of size 16 sprintf(fnic->msix[FNIC_MSIX_ERR_NOTIFY].devname, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "%.11s-err-notify", fnic->name); This extends the buffer to fit any possible value. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds2017-07-06
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull SCSI updates from James Bottomley: "This is mostly updates of the usual suspects: lpfc, qla2xxx, bnx2fc, qedf, hpsa, hisi_sas, smartpqi, cxlflash, aacraid, csiostor along with a host of minor and miscellaneous changes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (276 commits) qla2xxx: Fix NVMe entry_type for iocb packet on BE system scsi: qla2xxx: avoid unused-function warning scsi: snic: fix a couple of spelling mistakes/typos scsi: qla2xxx: fix a bunch of typos and spelling mistakes scsi: lpfc: don't double count abort errors scsi: lpfc: spin_lock_irq() is not nestable scsi: hisi_sas: optimise DMA slot memory scsi: ibmvfc: constify dev_pm_ops structures. scsi: ibmvscsi: constify dev_pm_ops structures. scsi: cxlflash: Update debug prints in reset handlers scsi: cxlflash: Update send_tmf() parameters scsi: cxlflash: Avoid double free of character device scsi: Add STARGET_CREATED_REMOVE state to scsi_target_state scsi: ses: do not add a device to an enclosure if enclosure_add_links() fails. scsi: ufs: flush eh_work when eh_work scheduled. scsi: qla2xxx: Protect access to qpair members with qpair->qp_lock scsi: sun_esp: fix device reference leaks scsi: fnic: changing queue command to return result DID_IMM_RETRY when rport is init scsi: fnic: correct speed display and add support for 25,40 and 100G scsi: fnic: added timestamp reporting in fnic debug stats ...
| * scsi: fnic: changing queue command to return result DID_IMM_RETRY when rport ↵Satish Kharat2017-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | is init Currently the queue command returns DID_NO_CONNECT anytime the rport is not in RPORT_ST_READY state. Changing it to return DID_NO_CONNECT only when the rport is in RPORT_ST_DELETE state. When the rport is in one of the init states retruning DID_IMM_RETRY. Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: fnic: correct speed display and add support for 25,40 and 100GSatish Kharat2017-06-27
| | | | | | | | | | | | | | | | | | Setting speed based on the vinc device parameter read during linkup. Also adding support to display 25,40 and 100G Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: fnic: added timestamp reporting in fnic debug statsSatish Kharat2017-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Added the timestamps for 1. current timestamp 2. last fnic stats read timestamp 3. last fnic stats reset timestamp and the deltas since last stats read and last reset in fnic stats. fnic stats uses debugfs Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: fnic: Zero io_cmpl_skip on fw reset completionSatish Kharat2017-06-27
| | | | | | | | | | | | | | | | | | | | io_cmpl_skip keep track of number of completions to skip when stats are reset. If a fw_reset happens immediately after stats reset it could put it out of sync so need to reset io_cmpl_skip when fw reset is completed. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | networking: make skb_push & __skb_push return void pointersJohannes Berg2017-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) @@ expression SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - fn(SKB, LEN)[0] + *(u8 *)fn(SKB, LEN) Note that the last part there converts from push(...)[0] to the more idiomatic *(u8 *)push(...). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | networking: make skb_pull & friends return void pointersJohannes Berg2017-06-16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_pull, __skb_pull, skb_pull_inline, __pskb_pull_tail, __pskb_pull, pskb_pull }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_pull, __skb_pull, skb_pull_inline, __pskb_pull_tail, __pskb_pull, pskb_pull }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* scsi: fnic: bug fix for fip.fip_subcode in fnic_fcoe_send_vlan_reqSatish Kharat2017-03-23
| | | | | | | | | | This is a bug introduced when they moved the fip subcodes to central place. Was sending FIP_SC_VL_NOTE in fip.fip_subcode for VLAN request in fnic_fcoe_send_vlan_req. Change is to use FIP_SC_VL_REQ instead. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: Adding debug IO and Abort latency counter to fnic statsSatish Kharat2017-03-23
| | | | | | | | | | | | The IO and Abort latency counter counts the time taken to complete the IO and abort command into broad buckets. This is not intended for performance measurement, just a debug statistic. current_max_io_time tries to keep track of the maximum time an IO has taken to complete if it is > 30sec. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: Adding Check Condition counter to misc fnicstatsSatish Kharat2017-03-23
| | | | | | | | | Just a simple counter of number of check conditions encountered on that host. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: Avoid false out-of-order detection for aborted commandSatish Kharat2017-03-23
| | | | | | | | | | | If SCSI-ML has already issued abort on a command i.e FNIC_IOREQ_ABTS_PENDING is set and we get a IO completion, avoid this being flagged as out-of-order completion by setting the FNIC_IO_DONE flag in fnic_fcpio_icmnd_cmpl_handler Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: Fix for "Number of Active IOs" in fnicstats becoming negativeSatish Kharat2017-03-23
| | | | | | | | | Fixing the IO stats update (Active IOs and IO completion) to prevent "Number of Active IOs" from becoming negative in the fnistats output. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: minor cleanup in fnic_fcpio_itmf_cmpl_handler, removing else caseSatish Kharat2017-03-23
| | | | | | | | Getting rid of else case to make the flow look bit simpler. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: Ratelimit printks to avoid flooding when vlan is not set by the ↵Satish Kharat2017-03-23
| | | | | | | | | | | switch.i This is to avoid the log from being filled with vlan discovery messages when there is no vlan configured on the switch. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: switch to pci_alloc_irq_vectorsChristoph Hellwig2017-03-23
| | | | | | | | | Not a full cleanup for the IRQ code, for that we'd need to know if the max number of the various CQ types is going to stay 1 forever. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds2017-02-21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull SCSI updates from James Bottomley: "This update includes the usual round of major driver updates (ncr5380, ufs, lpfc, be2iscsi, hisi_sas, storvsc, cxlflash, aacraid, megaraid_sas, ...). There's also an assortment of minor fixes and the major update of switching a bunch of drivers to pci_alloc_irq_vectors from Christoph" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (188 commits) scsi: megaraid_sas: handle dma_addr_t right on 32-bit scsi: megaraid_sas: array overflow in megasas_dump_frame() scsi: snic: switch to pci_irq_alloc_vectors scsi: megaraid_sas: driver version upgrade scsi: megaraid_sas: Change RAID_1_10_RMW_CMDS to RAID_1_PEER_CMDS and set value to 2 scsi: megaraid_sas: Indentation and smatch warning fixes scsi: megaraid_sas: Cleanup VD_EXT_DEBUG and SPAN_DEBUG related debug prints scsi: megaraid_sas: Increase internal command pool scsi: megaraid_sas: Use synchronize_irq to wait for IRQs to complete scsi: megaraid_sas: Bail out the driver load if ld_list_query fails scsi: megaraid_sas: Change build_mpt_mfi_pass_thru to return void scsi: megaraid_sas: During OCR, if get_ctrl_info fails do not continue with OCR scsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool scsi: megaraid_sas: Remove unused pd_index from megasas_build_ld_nonrw_fusion scsi: megaraid_sas: megasas_return_cmd does not memset IO frame to zero scsi: megaraid_sas: max_fw_cmds are decremented twice, remove duplicate scsi: megaraid_sas: update can_queue only if the new value is less scsi: megaraid_sas: Change max_cmd from u32 to u16 in all functions scsi: megaraid_sas: set pd_after_lb from MR_BuildRaidContext and initialize pDevHandle to MR_DEVHANDLE_INVALID scsi: megaraid_sas: latest controller OCR capability from FW before sending shutdown DCMD ...
| * scsi: remove eh_timed_out methods in the transport templateChristoph Hellwig2017-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead define the timeout behavior purely based on the host_template eh_timed_out method and wire up the existing transport implementations in the host templates. This also clears up the confusion that the transport template method overrides the host template one, so some drivers have to re-override the transport template one. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: fnic: Avoid sending reset to firmware when another reset is in progressSatish Kharat2017-01-05
|/ | | | | | | | | This fix is to avoid calling fnic_fw_reset_handler through fnic_host_reset when a finc reset is alreay in progress. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: Correcting rport check location in fnic_queuecommand_lckSatish Kharat2016-11-16
| | | | | | | Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: use kernel's '%pM' format option to print MACAndy Shevchenko2016-11-08
| | | | | | | | | | | Instead of supplying each byte through stack let's use %pM specifier. Cc: Hiral Patel <hiralpat@cisco.com> Cc: Suma Ramars <sramars@cisco.com> Acked-by: Tom Tucker <tom@opengridcomputing.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: libfc: Replace ->lport_reset callback with function callHannes Reinecke2016-11-08
| | | | | | | | | | The ->lport_reset callback only ever had one implementation, which already is exported. So remove it and use the function directly. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: fnic: Use time64_t to represent trace timestampsDeepa Dinamani2016-11-08
| | | | | | | | | | | | | | | | | | Trace timestamps use struct timespec and CURRENT_TIME which are not y2038 safe. These timestamps are only part of the trace log on the machine and are not shared with the fnic. Replace then with y2038 safe struct timespec64 and ktime_get_real_ts64(), respectively. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Cc: Hiral Patel <hiralpat@cisco.com> Cc: Suma Ramars <sramars@cisco.com> Cc: Brian Uchino <buchino@cisco.com> Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: linux-scsi@vger.kernel.org Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* fnic: pci_dma_mapping_error() doesn't return an error codeDan Carpenter2016-07-20
| | | | | | | | pci_dma_mapping_error() returns true on error and false on success. Fixes: fd6ddfa4c1dd ('fnic: check pci_map_single() return value') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* fcoe: use enum for fip_modeHannes Reinecke2016-07-13
| | | | | | | | | The FIP mode is independent on the FIP state machine, so use a separate enum for that instead of overloading it with state machine values. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* fc_fip: Update to latest FC-BB-6 draftHannes Reinecke2016-07-13
| | | | | | | | | Update to latest FC-BB-6 draft to include FIP VN2VN VLAN notifications and additional flags. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* fnic: Using rport->dd_data to check rport online instead of rport_lookup.Satish Kharat2016-04-11
| | | | | | | | | | | | | | | When issuing I/O we check if rport is online through libfc rport_lookup() function which needs to be protected by mutex lock that cannot acquired in I/O context. The change is to use midlayer remote port s dd_data which is preserved until its devloss timeout and no protection is required. The the scsi_cmnd error code is expected to be in the left 16 bits of the result field. Changed to correct this. Fnic driver version changed from 1.6.0.20 to 1.6.0.21 Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Ewan Milne <emilne@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* fnic: Cleanup the I/O pending with fw and has timed out and is used to issue ↵Satish Kharat2016-04-11
| | | | | | | | | | | | | | | | | LUN reset In case of LUN reset, the device reset command is issued with one of the I/Os that has timed out on that LUN. The change is to also return this I/O with error status set to DID_RESET. In case when the reset is issued using the sg_reset tool (from sg3_utils) it is a new command and new_sc is set to 1. Fnic driver version changed from 1.6.0.19 to 1.6.0.20 [mkp: Fixed checkpatch warning] Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Ewan Milne <emilne@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* fnic: Fix to cleanup aborted IO to avoid device being offlined by mid-layerSatish Kharat2016-04-11
| | | | | | | | | | | | | | | | | If an I/O times out and an abort issued by host, if the abort is successful we need to set scsi status as DID_ABORT. Or else the mid-layer error handler which looks for this error code, will offline the device. Also if the original I/O is not found in fnic firmware, we will consider the abort as successful. The start_time assignment is moved because of the new goto. Fnic driver version changed from 1.6.0.17a to 1.6.0.19, version 1.6.0.18 has been skipped [mkp: Fixed checkpatch warning] Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* fnic: move printk()s outside of the critical code section.Maurizio Lombardi2016-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves a printk() outside of the code section where interrupt are disabled. In some cases a flood of error messages may cause a kernel panic. It also removes one of the printk()s because the same error message was printed twice. [709686.317197] Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 12 [709686.317200] CPU: 12 PID: 1963 Comm: systemd-journal Tainted: GF O-------------- 3.10.0-229.el7.x86_64 #1 [709686.317201] Hardware name: Cisco Systems Inc UCSB-B200-M3/UCSB-B200-M3, BIOS B200M3.2.2.3.6.030620151309 03/06/2015 [709686.317206] ffffffff8182b2e8 00000000392722ba ffff88046fcc5c48 ffffffff81603f36 [709686.317209] ffff88046fcc5cc8 ffffffff815fd7da 0000000000000010 ffff88046fcc5cd8 [709686.317211] ffff88046fcc5c78 00000000392722ba ffff88046fcc5c88 000000000000000c [709686.317212] Call Trace: [709686.317221] <NMI> [<ffffffff81603f36>] dump_stack+0x19/0x1b [709686.317223] [<ffffffff815fd7da>] panic+0xd8/0x1e7 [709686.317227] [<ffffffff8110a760>] ? watchdog_enable_all_cpus.part.2+0x40/0x40 [709686.317229] [<ffffffff8110a822>] watchdog_overflow_callback+0xc2/0xd0 [709686.317233] [<ffffffff8114c901>] __perf_event_overflow+0xa1/0x250 [709686.317235] [<ffffffff8114d404>] perf_event_overflow+0x14/0x20 [709686.317239] [<ffffffff810301fd>] intel_pmu_handle_irq+0x1fd/0x410 [709686.317242] [<ffffffff811908d1>] ? unmap_kernel_range_noflush+0x11/0x20 [709686.317246] [<ffffffff81373574>] ? ghes_copy_tofrom_phys+0x124/0x210 [709686.317249] [<ffffffff8160cfcb>] perf_event_nmi_handler+0x2b/0x50 [709686.317251] [<ffffffff8160c719>] nmi_handle.isra.0+0x69/0xb0 [709686.317252] [<ffffffff8160c830>] do_nmi+0xd0/0x340 [709686.317256] [<ffffffff8160bb71>] end_repeat_nmi+0x1e/0x2e [709686.317260] [<ffffffff812e24fd>] ? memcpy+0xd/0x110 [709686.317263] [<ffffffff812e24fd>] ? memcpy+0xd/0x110 [709686.317265] [<ffffffff812e24fd>] ? memcpy+0xd/0x110 [709686.317269] <<EOE>> [<ffffffff8132c297>] ? vgacon_scroll+0x2d7/0x330 [709686.317273] [<ffffffff813a086c>] scrup+0xfc/0x110 [709686.317275] [<ffffffff813a0920>] lf+0xa0/0xb0 [709686.317278] [<ffffffff813a1b32>] vt_console_print+0x2d2/0x420 [709686.317283] [<ffffffff8106f4a1>] call_console_drivers.constprop.15+0x91/0xf0 [709686.317287] [<ffffffff8107069f>] console_unlock+0x3bf/0x400 [709686.317291] [<ffffffff81070996>] vprintk_emit+0x2b6/0x530 [709686.317294] [<ffffffff815fd961>] printk_emit+0x44/0x5b [709686.317297] [<ffffffff81070d98>] devkmsg_writev+0x158/0x1d0 [709686.317303] [<ffffffff811c5ef9>] do_sync_readv_writev+0x79/0xd0 [709686.317307] [<ffffffff811c73ee>] do_readv_writev+0xce/0x260 [709686.317310] [<ffffffff811c8d18>] ? __sb_start_write+0x58/0x110 [709686.317314] [<ffffffff811c7615>] vfs_writev+0x35/0x60 [709686.317318] [<ffffffff811c776c>] SyS_writev+0x5c/0xd0 [709686.317322] [<ffffffff81613da9>] system_call_fastpath+0x16/0x1b Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Reviewed-by: Laurence Oberman <loberman@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: use host wide tags by defaultChristoph Hellwig2015-11-09
| | | | | | | | | | | | | This patch changes the !blk-mq path to the same defaults as the blk-mq I/O path by always enabling block tagging, and always using host wide tags. We've had blk-mq available for a few releases so bugs with this mode should have been ironed out, and this ensures we get better coverage of over tagging setup over different configs. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jens Axboe <axboe@kernel.dk> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
* fnic: check pci_map_single() return valueMaurizio Lombardi2015-10-27
| | | | | | | | | | | | | | | | the kernel prints some warnings when compiled with CONFIG_DMA_API_DEBUG. This is because the fnic driver doesn't check the return value of pci_map_single(). [ 11.942770] scsi host12: fnic [ 11.950811] ------------[ cut here ]------------ [ 11.950818] WARNING: at lib/dma-debug.c:937 check_unmap+0x47b/0x920() [ 11.950821] fnic 0000:0c:00.0: DMA-API: device driver failed to check map error[device address=0x0000002020a30040] [size=44 bytes] [mapped as single] Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed By: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
* fnic: Use the local variable instead of I/O flag to acquire io_req_lock in ↵Hiral Shah2015-08-18
| | | | | | | | | | | | | | | | | | | fnic_queuecommand() to avoid deadloack We added changes in fnic driver patch 1.6.0.16 to acquire io_req_lock in fnic_queuecommand() before issuing I/O so that io completion is serialized. But when releasing the lock we check for the I/O flag and this could be modified if IO abort occurs before I/O completion. In this case we wont release the lock and causes deadlock in some scenerios. Using the local variable to check the IO lock status will resolve the problem. Fixes: 41df7b02db82cf6c14f094757bac3830d10a827f Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Anil Chintalapati <achintal@cisco.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Cc: stable@vger.kernel.org Signed-off-by: James Bottomley <JBottomley@Odin.com>
* x86/mm: Decouple <linux/vmalloc.h> from <asm/io.h>Stephen Rothwell2015-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nothing in <asm/io.h> uses anything from <linux/vmalloc.h>, so remove it from there and fix up the resulting build problems triggered on x86 {64|32}-bit {def|allmod|allno}configs. The breakages were triggering in places where x86 builds relied on vmalloc() facilities but did not include <linux/vmalloc.h> explicitly and relied on the implicit inclusion via <asm/io.h>. Also add: - <linux/init.h> to <linux/io.h> - <asm/pgtable_types> to <asm/io.h> ... which were two other implicit header file dependencies. Suggested-by: David Miller <davem@davemloft.net> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> [ Tidied up the changelog. ] Acked-by: David Miller <davem@davemloft.net> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Vinod Koul <vinod.koul@intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Anton Vorontsov <anton@enomsg.org> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Colin Cross <ccross@android.com> Cc: David Vrabel <david.vrabel@citrix.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: James E.J. Bottomley <JBottomley@odin.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Kees Cook <keescook@chromium.org> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Kristen Carlson Accardi <kristen@linux.intel.com> Cc: Len Brown <lenb@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Suma Ramars <sramars@cisco.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
* fnic: IOMMU Fault occurs when IO and abort IO is out of orderAnil Chintalapati (achintal)2014-12-30
| | | | | | | | | | | | When I/O is aborted by mid-layer, fnic FW will complete the I/O before completing the abort task. In some cases abort request is completed before the I/O, which could lead to inconsistent driver and firmware states. In this case firmware reset would clear the inconsistent state. Signed-off-by: Anil Chintalapati <achintal@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* scsi: remove ->change_queue_type methodChristoph Hellwig2014-12-04
| | | | | | | | | | | | Since we got rid of ordered tag support in 2010 the prime use case of switching on and off ordered tags has been obsolete. The other function of enabling/disabling tagging entirely has only been correctly implemented by the 53c700 driver and isn't generally useful. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com Reviewed-by: Hannes Reinecke <hare@suse.de>
* scsi: drop reason argument from ->change_queue_depthChristoph Hellwig2014-11-24
| | | | | | | | | | | Drop the now unused reason argument from the ->change_queue_depth method. Also add a return value to scsi_adjust_queue_depth, and rename it to scsi_change_queue_depth now that it can be used as the default ->change_queue_depth implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
* scsi: avoid ->change_queue_depth indirection for queue full trackingChristoph Hellwig2014-11-24
| | | | | | | | | | | | | | | | | All drivers use the implementation for ramping the queue up and down, so instead of overloading the change_queue_depth method call the implementation diretly if the driver opts into it by setting the track_queue_depth flag in the host template. Note that a few drivers validated the new queue depth in their change_queue_depth method, but as we never go over the queue depth set during slave_configure or the sysfs file this isn't nessecary and can safely be removed. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Venkatesh Srinivas <venkateshs@google.com>
* Fnic: Fnic Driver crashed with NULL pointer referenceHiral Shah2014-11-20
| | | | | | | | | | | | | | When issuing I/O request, if the I/O completes before returning from fnic_queuecommand(), we may be referencing scsi_cmnd structure that may be freed by interrupt handler. Acquring IO lock would synchronize fnic_queuecommand and interrupt handler. - Increment fnic version from 1.6.0.15 to 1.6.0.16 Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Anil Chintalapati <achintal@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* Fnic: For Standalone C series, "sending VLAN request" message seen even if ↵Hiral Shah2014-11-20
| | | | | | | | | | | | | | | | | | the link is down When physical link between standalone C series and switch is down, the fip timer is not turned off and timer expiration will keep sending vlan request. It can be fixed by stopping the fip_timer and it will be restarted automatically when Link is up. - Increment fnic version from 1.6.0.14 to 1.6.0.15 Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Anil Chintalapati <achintal@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* Fnic: Improper resue of exchange IdsHiral Shah2014-11-20
| | | | | | | | | | | | | | | | | | | IOs belonging to an rport are aborted with Internal terminate option when rport goes offline. Any new IO issued to the rport during this time can reuse the terminated exchange which will cause inconsistent state of the exchange between local port and remote port. fc_rport_priv is set to RPORT_ST_DELETE before exchanges are aborted by libfc. Not issuing amy more I/O requests when RPORT_ST_DELETE is set, will avoid inconsistent state of the exchange between local port and remote port. - Increment fnic version from 1.6.0.13 to 1.6.0.14 Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Anil Chintalapati <achintal@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* Fnic: Memcopy only mimumum of data or trace bufferHiral Shah2014-11-20
| | | | | | | | | | | | | | In case of receive path, we do not have eth header or fcoe header available when we take a trace so we fill the fc trace buffer with 0xff for both values. We copy only mimimum of received data or trace buffer size - fc header - eth and fcoe header - Increment fnic version from 1.6.0.12 to 1.6.0.13 Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Anil Chintalapati <achintal@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* Fnic: Not probing all the vNICS via fnic_probe on bootHiral Shah2014-11-20
| | | | | | | | | | | | | In fnic_dev_wait, Wait for finish to complete at least three times in two seconds while loop before returning -ETIMEDOUT as sometime schedule_timeout_uninterruptible takes more than two seconds to wake up. - Increment fnic version from 1.6.0.11 to 1.6.0.12 Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Anil Chintalapati <achintal@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* scsi: don't force tagged_supported in driversChristoph Hellwig2014-11-12
| | | | | | | | | | Now that we also get proper values in cmd->request->tag for untagged commands, there is no need to force tagged_supported to on in drivers that need host-wide tags. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
* scsi: don't set tagging state from scsi_adjust_queue_depthChristoph Hellwig2014-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove the tagged argument from scsi_adjust_queue_depth, and just let it handle the queue depth. For most drivers those two are fairly separate, given that most modern drivers don't care about the SCSI "tagged" status of a command at all, and many old drivers allow queuing of multiple untagged commands in the driver. Instead we start out with the ->simple_tags flag set before calling ->slave_configure, which is how all drivers actually looking at ->simple_tags except for one worke anyway. The one other case looks broken, but I've kept the behavior as-is for now. Except for that we only change ->simple_tags from the ->change_queue_type, and when rejecting a tag message in a single driver, so keeping this churn out of scsi_adjust_queue_depth is a clear win. Now that the usage of scsi_adjust_queue_depth is more obvious we can also remove all the trivial instances in ->slave_alloc or ->slave_configure that just set it to the cmd_per_lun default. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: always assign block layer tags if enabledChristoph Hellwig2014-11-12
| | | | | | | | | | | | | Allow a driver to ask for block layer tags by setting .use_blk_tags in the host template, in which case it will always see a valid value in request->tag, similar to the behavior when using blk-mq. This means even SCSI "untagged" commands will now have a tag, which is especially useful when using a host-wide tag map. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de>
* scsi: remove abuses of scsi_populate_tagChristoph Hellwig2014-11-12
| | | | | | | | | | | | | Unless we want to build a SPI tag message we should just check SCMD_TAGGED instead of reverse engineering a tag type through the use of scsi_populate_tag_msg. Also rename the function to spi_populate_tag_msg, make it behave like the other spi message helpers, and move it to the spi transport class. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
* scsi: provide a generic change_queue_type methodChristoph Hellwig2014-11-12
| | | | | | | | | | | Most drivers use exactly the same implementation, so provide it as a library function. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de>
* Merge tag 'scsi-for-linus' of ↵Linus Torvalds2014-10-07
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "This patch set consists of the usual driver updates (megaraid_sas, arcmsr, be2iscsi, lpfc, mpt2sas, mpt3sas, qla2xxx, ufs) plus several assorted fixes and miscellaneous updates (including the pci_msix_enable_range() changes that have been pending for a while)" * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (202 commits) scsi: add a CONFIG_SCSI_MQ_DEFAULT option ufs: definitions for phy interface ufs: tune bkops while power managment events ufs: Add support for clock scaling using devfreq framework ufs: Add freq-table-hz property for UFS device ufs: Add support for clock gating ufs: refactor configuring power mode ufs: add UFS power management support ufs: introduce well known logical unit in ufs ufs: manually add well known logical units ufs: Active Power Mode - configuring bActiveICCLevel ufs: improve init sequence ufs: refactor query descriptor API support ufs: add voting support for host controller power ufs: Add clock initialization support ufs: Add regulator enable support ufs: Allow vendor specific initialization scsi: don't add scsi_device if its already visible scsi: fix the type for well known LUs scsi: fix comment in struct Scsi_Host definition ...