Commit 55652400 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "Six minor and error leg fixes, plus one major change: the reversion of
  scsi-mq as the default.

  We're doing the latter temporarily (with a backport to stable) to give
  us time to fix all the issues that turned up with this default before
  trying again"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: cxgb4i: call neigh_event_send() to update MAC address
  Revert "scsi: default to scsi-mq"
  scsi: sd_zbc: Write unlock zone from sd_uninit_cmnd()
  scsi: aacraid: Fix out of bounds in aac_get_name_resp
  scsi: csiostor: fail probe if fw does not support FCoE
  scsi: megaraid_sas: fix error handle in megasas_probe_one
parents 98b9f8a4 71eb2ac5
...@@ -47,6 +47,17 @@ config SCSI_NETLINK ...@@ -47,6 +47,17 @@ config SCSI_NETLINK
default n default n
depends on NET depends on NET
config SCSI_MQ_DEFAULT
bool "SCSI: use blk-mq I/O path by default"
depends on SCSI
---help---
This option enables the new blk-mq based I/O path for SCSI
devices by default. With the option the scsi_mod.use_blk_mq
module/boot option defaults to Y, without it to N, but it can
still be overridden either way.
If unsure say N.
config SCSI_PROC_FS config SCSI_PROC_FS
bool "legacy /proc/scsi/ support" bool "legacy /proc/scsi/ support"
depends on SCSI && PROC_FS depends on SCSI && PROC_FS
......
...@@ -549,7 +549,9 @@ static void get_container_name_callback(void *context, struct fib * fibptr) ...@@ -549,7 +549,9 @@ static void get_container_name_callback(void *context, struct fib * fibptr)
if ((le32_to_cpu(get_name_reply->status) == CT_OK) if ((le32_to_cpu(get_name_reply->status) == CT_OK)
&& (get_name_reply->data[0] != '\0')) { && (get_name_reply->data[0] != '\0')) {
char *sp = get_name_reply->data; char *sp = get_name_reply->data;
sp[sizeof(((struct aac_get_name_resp *)NULL)->data)] = '\0'; int data_size = FIELD_SIZEOF(struct aac_get_name_resp, data);
sp[data_size - 1] = '\0';
while (*sp == ' ') while (*sp == ' ')
++sp; ++sp;
if (*sp) { if (*sp) {
...@@ -579,12 +581,15 @@ static void get_container_name_callback(void *context, struct fib * fibptr) ...@@ -579,12 +581,15 @@ static void get_container_name_callback(void *context, struct fib * fibptr)
static int aac_get_container_name(struct scsi_cmnd * scsicmd) static int aac_get_container_name(struct scsi_cmnd * scsicmd)
{ {
int status; int status;
int data_size;
struct aac_get_name *dinfo; struct aac_get_name *dinfo;
struct fib * cmd_fibcontext; struct fib * cmd_fibcontext;
struct aac_dev * dev; struct aac_dev * dev;
dev = (struct aac_dev *)scsicmd->device->host->hostdata; dev = (struct aac_dev *)scsicmd->device->host->hostdata;
data_size = FIELD_SIZEOF(struct aac_get_name_resp, data);
cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
aac_fib_init(cmd_fibcontext); aac_fib_init(cmd_fibcontext);
...@@ -593,7 +598,7 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd) ...@@ -593,7 +598,7 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd)
dinfo->command = cpu_to_le32(VM_ContainerConfig); dinfo->command = cpu_to_le32(VM_ContainerConfig);
dinfo->type = cpu_to_le32(CT_READ_NAME); dinfo->type = cpu_to_le32(CT_READ_NAME);
dinfo->cid = cpu_to_le32(scmd_id(scsicmd)); dinfo->cid = cpu_to_le32(scmd_id(scsicmd));
dinfo->count = cpu_to_le32(sizeof(((struct aac_get_name_resp *)NULL)->data)); dinfo->count = cpu_to_le32(data_size - 1);
status = aac_fib_send(ContainerCommand, status = aac_fib_send(ContainerCommand,
cmd_fibcontext, cmd_fibcontext,
......
...@@ -2274,7 +2274,7 @@ struct aac_get_name_resp { ...@@ -2274,7 +2274,7 @@ struct aac_get_name_resp {
__le32 parm3; __le32 parm3;
__le32 parm4; __le32 parm4;
__le32 parm5; __le32 parm5;
u8 data[16]; u8 data[17];
}; };
#define CT_CID_TO_32BITS_UID 165 #define CT_CID_TO_32BITS_UID 165
......
...@@ -3845,8 +3845,10 @@ csio_hw_start(struct csio_hw *hw) ...@@ -3845,8 +3845,10 @@ csio_hw_start(struct csio_hw *hw)
if (csio_is_hw_ready(hw)) if (csio_is_hw_ready(hw))
return 0; return 0;
else else if (csio_match_state(hw, csio_hws_uninit))
return -EINVAL; return -EINVAL;
else
return -ENODEV;
} }
int int
......
...@@ -969,11 +969,15 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -969,11 +969,15 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
pci_set_drvdata(pdev, hw); pci_set_drvdata(pdev, hw);
if (csio_hw_start(hw) != 0) { rv = csio_hw_start(hw);
if (rv) {
if (rv == -EINVAL) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to start FW, continuing in debug mode.\n"); "Failed to start FW, continuing in debug mode.\n");
return 0; return 0;
} }
goto err_lnode_exit;
}
sprintf(hw->fwrev_str, "%u.%u.%u.%u\n", sprintf(hw->fwrev_str, "%u.%u.%u.%u\n",
FW_HDR_FW_VER_MAJOR_G(hw->fwrev), FW_HDR_FW_VER_MAJOR_G(hw->fwrev),
......
...@@ -1635,6 +1635,9 @@ static int init_act_open(struct cxgbi_sock *csk) ...@@ -1635,6 +1635,9 @@ static int init_act_open(struct cxgbi_sock *csk)
goto rel_resource; goto rel_resource;
} }
if (!(n->nud_state & NUD_VALID))
neigh_event_send(n, NULL);
csk->atid = cxgb4_alloc_atid(lldi->tids, csk); csk->atid = cxgb4_alloc_atid(lldi->tids, csk);
if (csk->atid < 0) { if (csk->atid < 0) {
pr_err("%s, NO atid available.\n", ndev->name); pr_err("%s, NO atid available.\n", ndev->name);
......
...@@ -6228,8 +6228,8 @@ static int megasas_probe_one(struct pci_dev *pdev, ...@@ -6228,8 +6228,8 @@ static int megasas_probe_one(struct pci_dev *pdev,
fail_start_aen: fail_start_aen:
fail_io_attach: fail_io_attach:
megasas_mgmt_info.count--; megasas_mgmt_info.count--;
megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
megasas_mgmt_info.max_index--; megasas_mgmt_info.max_index--;
megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
instance->instancet->disable_intr(instance); instance->instancet->disable_intr(instance);
megasas_destroy_irqs(instance); megasas_destroy_irqs(instance);
......
...@@ -800,7 +800,11 @@ MODULE_LICENSE("GPL"); ...@@ -800,7 +800,11 @@ MODULE_LICENSE("GPL");
module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR); module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels"); MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels");
#ifdef CONFIG_SCSI_MQ_DEFAULT
bool scsi_use_blk_mq = true; bool scsi_use_blk_mq = true;
#else
bool scsi_use_blk_mq = false;
#endif
module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO); module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO);
static int __init init_scsi(void) static int __init init_scsi(void)
......
...@@ -1277,6 +1277,9 @@ static void sd_uninit_command(struct scsi_cmnd *SCpnt) ...@@ -1277,6 +1277,9 @@ static void sd_uninit_command(struct scsi_cmnd *SCpnt)
{ {
struct request *rq = SCpnt->request; struct request *rq = SCpnt->request;
if (SCpnt->flags & SCMD_ZONE_WRITE_LOCK)
sd_zbc_write_unlock_zone(SCpnt);
if (rq->rq_flags & RQF_SPECIAL_PAYLOAD) if (rq->rq_flags & RQF_SPECIAL_PAYLOAD)
__free_page(rq->special_vec.bv_page); __free_page(rq->special_vec.bv_page);
......
...@@ -294,6 +294,9 @@ int sd_zbc_write_lock_zone(struct scsi_cmnd *cmd) ...@@ -294,6 +294,9 @@ int sd_zbc_write_lock_zone(struct scsi_cmnd *cmd)
test_and_set_bit(zno, sdkp->zones_wlock)) test_and_set_bit(zno, sdkp->zones_wlock))
return BLKPREP_DEFER; return BLKPREP_DEFER;
WARN_ON_ONCE(cmd->flags & SCMD_ZONE_WRITE_LOCK);
cmd->flags |= SCMD_ZONE_WRITE_LOCK;
return BLKPREP_OK; return BLKPREP_OK;
} }
...@@ -302,9 +305,10 @@ void sd_zbc_write_unlock_zone(struct scsi_cmnd *cmd) ...@@ -302,9 +305,10 @@ void sd_zbc_write_unlock_zone(struct scsi_cmnd *cmd)
struct request *rq = cmd->request; struct request *rq = cmd->request;
struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);
if (sdkp->zones_wlock) { if (sdkp->zones_wlock && cmd->flags & SCMD_ZONE_WRITE_LOCK) {
unsigned int zno = sd_zbc_zone_no(sdkp, blk_rq_pos(rq)); unsigned int zno = sd_zbc_zone_no(sdkp, blk_rq_pos(rq));
WARN_ON_ONCE(!test_bit(zno, sdkp->zones_wlock)); WARN_ON_ONCE(!test_bit(zno, sdkp->zones_wlock));
cmd->flags &= ~SCMD_ZONE_WRITE_LOCK;
clear_bit_unlock(zno, sdkp->zones_wlock); clear_bit_unlock(zno, sdkp->zones_wlock);
smp_mb__after_atomic(); smp_mb__after_atomic();
} }
...@@ -335,9 +339,6 @@ void sd_zbc_complete(struct scsi_cmnd *cmd, ...@@ -335,9 +339,6 @@ void sd_zbc_complete(struct scsi_cmnd *cmd,
case REQ_OP_WRITE_ZEROES: case REQ_OP_WRITE_ZEROES:
case REQ_OP_WRITE_SAME: case REQ_OP_WRITE_SAME:
/* Unlock the zone */
sd_zbc_write_unlock_zone(cmd);
if (result && if (result &&
sshdr->sense_key == ILLEGAL_REQUEST && sshdr->sense_key == ILLEGAL_REQUEST &&
sshdr->asc == 0x21) sshdr->asc == 0x21)
......
...@@ -57,6 +57,7 @@ struct scsi_pointer { ...@@ -57,6 +57,7 @@ struct scsi_pointer {
/* for scmd->flags */ /* for scmd->flags */
#define SCMD_TAGGED (1 << 0) #define SCMD_TAGGED (1 << 0)
#define SCMD_UNCHECKED_ISA_DMA (1 << 1) #define SCMD_UNCHECKED_ISA_DMA (1 << 1)
#define SCMD_ZONE_WRITE_LOCK (1 << 2)
struct scsi_cmnd { struct scsi_cmnd {
struct scsi_request req; struct scsi_request req;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment