Skip to content

Commit

Permalink
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/jejb/scsi

Pull SCSI updates from James Bottomley:
 "This is mostly update of the usual drivers: qla2xxx, ufs, smartpqi,
  lpfc, hisi_sas, qedf, mpt3sas; plus a whole load of minor updates. The
  only core change this time around is the addition of request batching
  for virtio. Since batching requires an additional flag to use, it
  should be invisible to the rest of the drivers"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (264 commits)
  scsi: hisi_sas: Fix the conflict between device gone and host reset
  scsi: hisi_sas: Add BIST support for phy loopback
  scsi: hisi_sas: Add hisi_sas_debugfs_alloc() to centralise allocation
  scsi: hisi_sas: Remove some unused function arguments
  scsi: hisi_sas: Remove redundant work declaration
  scsi: hisi_sas: Remove hisi_sas_hw.slot_complete
  scsi: hisi_sas: Assign NCQ tag for all NCQ commands
  scsi: hisi_sas: Update all the registers after suspend and resume
  scsi: hisi_sas: Retry 3 times TMF IO for SAS disks when init device
  scsi: hisi_sas: Remove sleep after issue phy reset if sas_smp_phy_control() fails
  scsi: hisi_sas: Directly return when running I_T_nexus reset if phy disabled
  scsi: hisi_sas: Use true/false as input parameter of sas_phy_reset()
  scsi: hisi_sas: add debugfs auto-trigger for internal abort time out
  scsi: virtio_scsi: unplug LUNs when events missed
  scsi: scsi_dh_rdac: zero cdb in send_mode_select()
  scsi: fcoe: fix null-ptr-deref Read in fc_release_transport
  scsi: ufs-hisi: use devm_platform_ioremap_resource() to simplify code
  scsi: ufshcd: use devm_platform_ioremap_resource() to simplify code
  scsi: hisi_sas: use devm_platform_ioremap_resource() to simplify code
  scsi: ufs: Use kmemdup in ufshcd_read_string_desc()
  ...
  • Loading branch information
torvalds committed Sep 21, 2019
2 parents 3e414b5 + e74006e commit 10fd717
Show file tree
Hide file tree
Showing 130 changed files with 5,755 additions and 3,679 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Optional properties:
PHY reset from the UFS controller.
- resets : reset node register
- reset-names : describe reset node register, the "rst" corresponds to reset the whole UFS IP.
- reset-gpios : A phandle and gpio specifier denoting the GPIO connected
to the RESET pin of the UFS memory device.

Note: If above properties are not defined it can be assumed that the supply
regulators or clocks are always on.
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/qcom/sdm845-db845c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,8 @@
&ufs_mem_hc {
status = "okay";

reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;

vcc-supply = <&vreg_l20a_2p95>;
vcc-max-microamp = <800000>;
};
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/qcom/sdm845-mtp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@
&ufs_mem_hc {
status = "okay";

reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;

vcc-supply = <&vreg_l20a_2p95>;
vcc-max-microamp = <600000>;
};
Expand Down
9 changes: 3 additions & 6 deletions drivers/scsi/aic94xx/aic94xx_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,7 @@ static void asd_destroy_ha_caches(struct asd_ha_struct *asd_ha)
if (asd_ha->hw_prof.scb_ext)
asd_free_coherent(asd_ha, asd_ha->hw_prof.scb_ext);

if (asd_ha->hw_prof.ddb_bitmap)
kfree(asd_ha->hw_prof.ddb_bitmap);
kfree(asd_ha->hw_prof.ddb_bitmap);
asd_ha->hw_prof.ddb_bitmap = NULL;

for (i = 0; i < ASD_MAX_PHYS; i++) {
Expand Down Expand Up @@ -641,12 +640,10 @@ static int asd_create_global_caches(void)

static void asd_destroy_global_caches(void)
{
if (asd_dma_token_cache)
kmem_cache_destroy(asd_dma_token_cache);
kmem_cache_destroy(asd_dma_token_cache);
asd_dma_token_cache = NULL;

if (asd_ascb_cache)
kmem_cache_destroy(asd_ascb_cache);
kmem_cache_destroy(asd_ascb_cache);
asd_ascb_cache = NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/bfa/bfad_im.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port,
struct device *dev)
{
struct bfad_im_port_pointer *im_portp;
int error = 1;
int error;

mutex_lock(&bfad_mutex);
error = idr_alloc(&bfad_im_port_index, im_port, 0, 0, GFP_KERNEL);
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/bnx2fc/bnx2fc_fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev,
struct fc_lport *lport;
struct bnx2fc_interface *interface;
struct fcoe_ctlr *ctlr;
struct fc_frame_header *fh;
struct fcoe_rcv_info *fr;
struct fcoe_percpu_s *bg;
struct sk_buff *tmp_skb;
Expand Down Expand Up @@ -463,7 +462,6 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev,
goto err;

skb_set_transport_header(skb, sizeof(struct fcoe_hdr));
fh = (struct fc_frame_header *) skb_transport_header(skb);

fr = fcoe_dev_from_skb(skb);
fr->fr_dev = lport;
Expand Down
16 changes: 0 additions & 16 deletions drivers/scsi/bnx2fc/bnx2fc_hwi.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,6 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
u16 xid;
u32 frame_len, len;
struct bnx2fc_cmd *io_req = NULL;
struct fcoe_task_ctx_entry *task, *task_page;
struct bnx2fc_interface *interface = tgt->port->priv;
struct bnx2fc_hba *hba = interface->hba;
int task_idx, index;
Expand Down Expand Up @@ -711,9 +710,6 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)

task_idx = xid / BNX2FC_TASKS_PER_PAGE;
index = xid % BNX2FC_TASKS_PER_PAGE;
task_page = (struct fcoe_task_ctx_entry *)
hba->task_ctx[task_idx];
task = &(task_page[index]);

io_req = (struct bnx2fc_cmd *)hba->cmd_mgr->cmds[xid];
if (!io_req)
Expand Down Expand Up @@ -839,9 +835,6 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)

task_idx = xid / BNX2FC_TASKS_PER_PAGE;
index = xid % BNX2FC_TASKS_PER_PAGE;
task_page = (struct fcoe_task_ctx_entry *)
interface->hba->task_ctx[task_idx];
task = &(task_page[index]);
io_req = (struct bnx2fc_cmd *)hba->cmd_mgr->cmds[xid];
if (!io_req)
goto ret_warn_rqe;
Expand Down Expand Up @@ -1122,7 +1115,6 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba,
struct fcoe_kcqe *ofld_kcqe)
{
struct bnx2fc_rport *tgt;
struct fcoe_port *port;
struct bnx2fc_interface *interface;
u32 conn_id;
u32 context_id;
Expand All @@ -1136,7 +1128,6 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba,
}
BNX2FC_TGT_DBG(tgt, "Entered ofld compl - context_id = 0x%x\n",
ofld_kcqe->fcoe_conn_context_id);
port = tgt->port;
interface = tgt->port->priv;
if (hba != interface->hba) {
printk(KERN_ERR PFX "ERROR:ofld_cmpl: HBA mis-match\n");
Expand Down Expand Up @@ -1463,10 +1454,7 @@ void bnx2fc_init_seq_cleanup_task(struct bnx2fc_cmd *seq_clnp_req,
{
struct scsi_cmnd *sc_cmd = orig_io_req->sc_cmd;
struct bnx2fc_rport *tgt = seq_clnp_req->tgt;
struct bnx2fc_interface *interface = tgt->port->priv;
struct fcoe_bd_ctx *bd = orig_io_req->bd_tbl->bd_tbl;
struct fcoe_task_ctx_entry *orig_task;
struct fcoe_task_ctx_entry *task_page;
struct fcoe_ext_mul_sges_ctx *sgl;
u8 task_type = FCOE_TASK_TYPE_SEQUENCE_CLEANUP;
u8 orig_task_type;
Expand Down Expand Up @@ -1528,10 +1516,6 @@ void bnx2fc_init_seq_cleanup_task(struct bnx2fc_cmd *seq_clnp_req,
orig_task_idx = orig_xid / BNX2FC_TASKS_PER_PAGE;
index = orig_xid % BNX2FC_TASKS_PER_PAGE;

task_page = (struct fcoe_task_ctx_entry *)
interface->hba->task_ctx[orig_task_idx];
orig_task = &(task_page[index]);

/* Multiple SGEs were used for this IO */
sgl = &task->rxwr_only.union_ctx.read_info.sgl_ctx.sgl;
sgl->mul_sgl.cur_sge_addr.lo = (u32)phys_addr;
Expand Down
7 changes: 0 additions & 7 deletions drivers/scsi/bnx2fc/bnx2fc_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,6 @@ int bnx2fc_initiate_abts(struct bnx2fc_cmd *io_req)
int bnx2fc_initiate_seq_cleanup(struct bnx2fc_cmd *orig_io_req, u32 offset,
enum fc_rctl r_ctl)
{
struct fc_lport *lport;
struct bnx2fc_rport *tgt = orig_io_req->tgt;
struct bnx2fc_interface *interface;
struct fcoe_port *port;
Expand All @@ -948,7 +947,6 @@ int bnx2fc_initiate_seq_cleanup(struct bnx2fc_cmd *orig_io_req, u32 offset,

port = orig_io_req->port;
interface = port->priv;
lport = port->lport;

cb_arg = kzalloc(sizeof(struct bnx2fc_els_cb_arg), GFP_ATOMIC);
if (!cb_arg) {
Expand Down Expand Up @@ -999,7 +997,6 @@ int bnx2fc_initiate_seq_cleanup(struct bnx2fc_cmd *orig_io_req, u32 offset,

int bnx2fc_initiate_cleanup(struct bnx2fc_cmd *io_req)
{
struct fc_lport *lport;
struct bnx2fc_rport *tgt = io_req->tgt;
struct bnx2fc_interface *interface;
struct fcoe_port *port;
Expand All @@ -1015,7 +1012,6 @@ int bnx2fc_initiate_cleanup(struct bnx2fc_cmd *io_req)

port = io_req->port;
interface = port->priv;
lport = port->lport;

cleanup_io_req = bnx2fc_elstm_alloc(tgt, BNX2FC_CLEANUP);
if (!cleanup_io_req) {
Expand Down Expand Up @@ -1927,8 +1923,6 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req,
struct fcoe_fcp_rsp_payload *fcp_rsp;
struct bnx2fc_rport *tgt = io_req->tgt;
struct scsi_cmnd *sc_cmd;
struct Scsi_Host *host;


/* scsi_cmd_cmpl is called with tgt lock held */

Expand Down Expand Up @@ -1957,7 +1951,6 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req,
/* parse fcp_rsp and obtain sense data from RQ if available */
bnx2fc_parse_fcp_rsp(io_req, fcp_rsp, num_rq);

host = sc_cmd->device->host;
if (!sc_cmd->SCp.ptr) {
printk(KERN_ERR PFX "SCp.ptr is NULL\n");
return;
Expand Down
8 changes: 2 additions & 6 deletions drivers/scsi/csiostor/csio_wr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,6 @@ csio_wr_fixup_host_params(struct csio_hw *hw)
u32 fl_align = clsz < 32 ? 32 : clsz;
u32 pack_align;
u32 ingpad, ingpack;
int pcie_cap;

csio_wr_reg32(hw, HOSTPAGESIZEPF0_V(s_hps) | HOSTPAGESIZEPF1_V(s_hps) |
HOSTPAGESIZEPF2_V(s_hps) | HOSTPAGESIZEPF3_V(s_hps) |
Expand Down Expand Up @@ -1347,18 +1346,15 @@ csio_wr_fixup_host_params(struct csio_hw *hw)
* multiple of the Maximum Payload Size.
*/
pack_align = fl_align;
pcie_cap = pci_find_capability(hw->pdev, PCI_CAP_ID_EXP);
if (pcie_cap) {
if (pci_is_pcie(hw->pdev)) {
u32 mps, mps_log;
u16 devctl;

/* The PCIe Device Control Maximum Payload Size field
* [bits 7:5] encodes sizes as powers of 2 starting at
* 128 bytes.
*/
pci_read_config_word(hw->pdev,
pcie_cap + PCI_EXP_DEVCTL,
&devctl);
pcie_capability_read_word(hw->pdev, PCI_EXP_DEVCTL, &devctl);
mps_log = ((devctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5) + 7;
mps = 1 << mps_log;
if (mps > pack_align)
Expand Down
12 changes: 10 additions & 2 deletions drivers/scsi/cxlflash/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,10 +753,13 @@ static void term_intr(struct cxlflash_cfg *cfg, enum undo_level level,
/* SISL_MSI_ASYNC_ERROR is setup only for the primary HWQ */
if (index == PRIMARY_HWQ)
cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 3, hwq);
/* fall through */
case UNMAP_TWO:
cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 2, hwq);
/* fall through */
case UNMAP_ONE:
cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 1, hwq);
/* fall through */
case FREE_IRQ:
cfg->ops->free_afu_irqs(hwq->ctx_cookie);
/* fall through */
Expand Down Expand Up @@ -973,14 +976,18 @@ static void cxlflash_remove(struct pci_dev *pdev)
switch (cfg->init_state) {
case INIT_STATE_CDEV:
cxlflash_release_chrdev(cfg);
/* fall through */
case INIT_STATE_SCSI:
cxlflash_term_local_luns(cfg);
scsi_remove_host(cfg->host);
/* fall through */
case INIT_STATE_AFU:
term_afu(cfg);
/* fall through */
case INIT_STATE_PCI:
cfg->ops->destroy_afu(cfg->afu_cookie);
pci_disable_device(pdev);
/* fall through */
case INIT_STATE_NONE:
free_mem(cfg);
scsi_host_put(cfg->host);
Expand Down Expand Up @@ -2353,11 +2360,11 @@ static int send_afu_cmd(struct afu *afu, struct sisl_ioarcb *rcb)
cxlflash_schedule_async_reset(cfg);
break;
}
/* fall through to retry */
/* fall through - to retry */
case -EAGAIN:
if (++nretry < 2)
goto retry;
/* fall through to exit */
/* fall through - to exit */
default:
break;
}
Expand Down Expand Up @@ -3017,6 +3024,7 @@ static ssize_t num_hwqs_store(struct device *dev,
wait_event(cfg->reset_waitq, cfg->state != STATE_RESET);
if (cfg->state == STATE_NORMAL)
goto retry;
/* else, fall through */
default:
/* Ideally should not happen */
dev_err(dev, "%s: Device is not ready, state=%d\n",
Expand Down
2 changes: 2 additions & 0 deletions drivers/scsi/device_handler/scsi_dh_rdac.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,8 @@ static void send_mode_select(struct work_struct *work)
spin_unlock(&ctlr->ms_lock);

retry:
memset(cdb, 0, sizeof(cdb));

data_size = rdac_failover_get(ctlr, &list, cdb);

RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, "
Expand Down
13 changes: 4 additions & 9 deletions drivers/scsi/esas2r/esas2r_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,14 +762,10 @@ u32 esas2r_get_uncached_size(struct esas2r_adapter *a)

static void esas2r_init_pci_cfg_space(struct esas2r_adapter *a)
{
int pcie_cap_reg;

pcie_cap_reg = pci_find_capability(a->pcid, PCI_CAP_ID_EXP);
if (pcie_cap_reg) {
if (pci_is_pcie(a->pcid)) {
u16 devcontrol;

pci_read_config_word(a->pcid, pcie_cap_reg + PCI_EXP_DEVCTL,
&devcontrol);
pcie_capability_read_word(a->pcid, PCI_EXP_DEVCTL, &devcontrol);

if ((devcontrol & PCI_EXP_DEVCTL_READRQ) >
PCI_EXP_DEVCTL_READRQ_512B) {
Expand All @@ -778,9 +774,8 @@ static void esas2r_init_pci_cfg_space(struct esas2r_adapter *a)

devcontrol &= ~PCI_EXP_DEVCTL_READRQ;
devcontrol |= PCI_EXP_DEVCTL_READRQ_512B;
pci_write_config_word(a->pcid,
pcie_cap_reg + PCI_EXP_DEVCTL,
devcontrol);
pcie_capability_write_word(a->pcid, PCI_EXP_DEVCTL,
devcontrol);
}
}
}
Expand Down
14 changes: 5 additions & 9 deletions drivers/scsi/esas2r/esas2r_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,6 @@ static int hba_ioctl_callback(struct esas2r_adapter *a,

struct atto_hba_get_adapter_info *gai =
&hi->data.get_adap_info;
int pcie_cap_reg;

if (hi->flags & HBAF_TUNNEL) {
hi->status = ATTO_STS_UNSUPPORTED;
Expand All @@ -784,17 +783,14 @@ static int hba_ioctl_callback(struct esas2r_adapter *a,
gai->pci.dev_num = PCI_SLOT(a->pcid->devfn);
gai->pci.func_num = PCI_FUNC(a->pcid->devfn);

pcie_cap_reg = pci_find_capability(a->pcid, PCI_CAP_ID_EXP);
if (pcie_cap_reg) {
if (pci_is_pcie(a->pcid)) {
u16 stat;
u32 caps;

pci_read_config_word(a->pcid,
pcie_cap_reg + PCI_EXP_LNKSTA,
&stat);
pci_read_config_dword(a->pcid,
pcie_cap_reg + PCI_EXP_LNKCAP,
&caps);
pcie_capability_read_word(a->pcid, PCI_EXP_LNKSTA,
&stat);
pcie_capability_read_dword(a->pcid, PCI_EXP_LNKCAP,
&caps);

gai->pci.link_speed_curr =
(u8)(stat & PCI_EXP_LNKSTA_CLS);
Expand Down
17 changes: 11 additions & 6 deletions drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,15 +1250,21 @@ static int __init fcoe_if_init(void)
/* attach to scsi transport */
fcoe_nport_scsi_transport =
fc_attach_transport(&fcoe_nport_fc_functions);
if (!fcoe_nport_scsi_transport)
goto err;

fcoe_vport_scsi_transport =
fc_attach_transport(&fcoe_vport_fc_functions);

if (!fcoe_nport_scsi_transport) {
printk(KERN_ERR "fcoe: Failed to attach to the FC transport\n");
return -ENODEV;
}
if (!fcoe_vport_scsi_transport)
goto err_vport;

return 0;

err_vport:
fc_release_transport(fcoe_nport_scsi_transport);
err:
printk(KERN_ERR "fcoe: Failed to attach to the FC transport\n");
return -ENODEV;
}

/**
Expand Down Expand Up @@ -1617,7 +1623,6 @@ static inline int fcoe_filter_frames(struct fc_lport *lport,
else
fr_flags(fp) |= FCPHF_CRC_UNCHECKED;

fh = (struct fc_frame_header *) skb_transport_header(skb);
fh = fc_frame_header_get(fp);
if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA && fh->fh_type == FC_TYPE_FCP)
return 0;
Expand Down
Loading

0 comments on commit 10fd717

Please sign in to comment.