Merge branch 'fixes' into misc
This commit is contained in:
commit
2441500a41
@ -47,6 +47,17 @@ config SCSI_NETLINK
|
||||
default n
|
||||
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
|
||||
bool "legacy /proc/scsi/ support"
|
||||
depends on SCSI && PROC_FS
|
||||
|
@ -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)
|
||||
&& (get_name_reply->data[0] != '\0')) {
|
||||
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 == ' ')
|
||||
++sp;
|
||||
if (*sp) {
|
||||
@ -579,21 +581,25 @@ static void get_container_name_callback(void *context, struct fib * fibptr)
|
||||
static int aac_get_container_name(struct scsi_cmnd * scsicmd)
|
||||
{
|
||||
int status;
|
||||
int data_size;
|
||||
struct aac_get_name *dinfo;
|
||||
struct fib * cmd_fibcontext;
|
||||
struct aac_dev * dev;
|
||||
|
||||
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);
|
||||
|
||||
aac_fib_init(cmd_fibcontext);
|
||||
dinfo = (struct aac_get_name *) fib_data(cmd_fibcontext);
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
|
||||
dinfo->command = cpu_to_le32(VM_ContainerConfig);
|
||||
dinfo->type = cpu_to_le32(CT_READ_NAME);
|
||||
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,
|
||||
cmd_fibcontext,
|
||||
@ -606,10 +612,8 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd)
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS) {
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk(KERN_WARNING "aac_get_container_name: aac_fib_send failed with status: %d.\n", status);
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
@ -720,6 +724,7 @@ static void _aac_probe_container1(void * context, struct fib * fibptr)
|
||||
|
||||
dinfo->count = cpu_to_le32(scmd_id(scsicmd));
|
||||
dinfo->type = cpu_to_le32(FT_FILESYS);
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
@ -731,9 +736,7 @@ static void _aac_probe_container1(void * context, struct fib * fibptr)
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS)
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
else if (status < 0) {
|
||||
if (status < 0 && status != -EINPROGRESS) {
|
||||
/* Inherit results from VM_NameServe, if any */
|
||||
dresp->status = cpu_to_le32(ST_OK);
|
||||
_aac_probe_container2(context, fibptr);
|
||||
@ -761,6 +764,7 @@ static int _aac_probe_container(struct scsi_cmnd * scsicmd, int (*callback)(stru
|
||||
dinfo->count = cpu_to_le32(scmd_id(scsicmd));
|
||||
dinfo->type = cpu_to_le32(FT_FILESYS);
|
||||
scsicmd->SCp.ptr = (char *)callback;
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
@ -772,10 +776,9 @@ static int _aac_probe_container(struct scsi_cmnd * scsicmd, int (*callback)(stru
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS) {
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (status < 0) {
|
||||
scsicmd->SCp.ptr = NULL;
|
||||
aac_fib_complete(fibptr);
|
||||
@ -1121,6 +1124,7 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd)
|
||||
dinfo->command = cpu_to_le32(VM_ContainerConfig);
|
||||
dinfo->type = cpu_to_le32(CT_CID_TO_32BITS_UID);
|
||||
dinfo->cid = cpu_to_le32(scmd_id(scsicmd));
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
cmd_fibcontext,
|
||||
@ -1133,10 +1137,8 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd)
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS) {
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk(KERN_WARNING "aac_get_container_serial: aac_fib_send failed with status: %d.\n", status);
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
@ -2330,16 +2332,14 @@ static int aac_read(struct scsi_cmnd * scsicmd)
|
||||
* Alocate and initialize a Fib
|
||||
*/
|
||||
cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
|
||||
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
status = aac_adapter_read(cmd_fibcontext, scsicmd, lba, count);
|
||||
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS) {
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk(KERN_WARNING "aac_read: aac_fib_send failed with status: %d.\n", status);
|
||||
/*
|
||||
@ -2424,16 +2424,14 @@ static int aac_write(struct scsi_cmnd * scsicmd)
|
||||
* Allocate and initialize a Fib then setup a BlockWrite command
|
||||
*/
|
||||
cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
|
||||
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
status = aac_adapter_write(cmd_fibcontext, scsicmd, lba, count, fua);
|
||||
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS) {
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk(KERN_WARNING "aac_write: aac_fib_send failed with status: %d\n", status);
|
||||
/*
|
||||
@ -2583,6 +2581,7 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd)
|
||||
synchronizecmd->cid = cpu_to_le32(scmd_id(scsicmd));
|
||||
synchronizecmd->count =
|
||||
cpu_to_le32(sizeof(((struct aac_synchronize_reply *)NULL)->data));
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
|
||||
/*
|
||||
* Now send the Fib to the adapter
|
||||
@ -2598,10 +2597,8 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd)
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS) {
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk(KERN_WARNING
|
||||
"aac_synchronize: aac_fib_send failed with status: %d.\n", status);
|
||||
@ -2661,6 +2658,7 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd)
|
||||
pmcmd->cid = cpu_to_le32(sdev_id(sdev));
|
||||
pmcmd->parm = (scsicmd->cmnd[1] & 1) ?
|
||||
cpu_to_le32(CT_PM_UNIT_IMMEDIATE) : 0;
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
|
||||
/*
|
||||
* Now send the Fib to the adapter
|
||||
@ -2676,10 +2674,8 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd)
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS) {
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
aac_fib_free(cmd_fibcontext);
|
||||
@ -3198,10 +3194,11 @@ static int query_disk(struct aac_dev *dev, void __user *arg)
|
||||
return -EBUSY;
|
||||
if (copy_from_user(&qd, arg, sizeof (struct aac_query_disk)))
|
||||
return -EFAULT;
|
||||
if (qd.cnum == -1)
|
||||
if (qd.cnum == -1) {
|
||||
if (qd.id < 0 || qd.id >= dev->maximum_num_containers)
|
||||
return -EINVAL;
|
||||
qd.cnum = qd.id;
|
||||
else if ((qd.bus == -1) && (qd.id == -1) && (qd.lun == -1))
|
||||
{
|
||||
} else if ((qd.bus == -1) && (qd.id == -1) && (qd.lun == -1)) {
|
||||
if (qd.cnum < 0 || qd.cnum >= dev->maximum_num_containers)
|
||||
return -EINVAL;
|
||||
qd.instance = dev->scsi_host_ptr->host_no;
|
||||
@ -3686,16 +3683,14 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
|
||||
* Allocate and initialize a Fib then setup a BlockWrite command
|
||||
*/
|
||||
cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
|
||||
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
status = aac_adapter_scsi(cmd_fibcontext, scsicmd);
|
||||
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS) {
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk(KERN_WARNING "aac_srb: aac_fib_send failed with status: %d\n", status);
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
@ -3733,15 +3728,14 @@ static int aac_send_hba_fib(struct scsi_cmnd *scsicmd)
|
||||
if (!cmd_fibcontext)
|
||||
return -1;
|
||||
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
status = aac_adapter_hba(cmd_fibcontext, scsicmd);
|
||||
|
||||
/*
|
||||
* Check that the command queued to the controller
|
||||
*/
|
||||
if (status == -EINPROGRESS) {
|
||||
scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
|
||||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
pr_warn("aac_hba_cmd_req: aac_fib_send failed with status: %d\n",
|
||||
status);
|
||||
|
@ -2275,7 +2275,7 @@ struct aac_get_name_resp {
|
||||
__le32 parm3;
|
||||
__le32 parm4;
|
||||
__le32 parm5;
|
||||
u8 data[16];
|
||||
u8 data[17];
|
||||
};
|
||||
|
||||
#define CT_CID_TO_32BITS_UID 165
|
||||
|
@ -2624,12 +2624,11 @@ static struct fcoe_transport bnx2fc_transport = {
|
||||
};
|
||||
|
||||
/**
|
||||
* bnx2fc_percpu_thread_create - Create a receive thread for an
|
||||
* online CPU
|
||||
* bnx2fc_cpu_online - Create a receive thread for an online CPU
|
||||
*
|
||||
* @cpu: cpu index for the online cpu
|
||||
*/
|
||||
static void bnx2fc_percpu_thread_create(unsigned int cpu)
|
||||
static int bnx2fc_cpu_online(unsigned int cpu)
|
||||
{
|
||||
struct bnx2fc_percpu_s *p;
|
||||
struct task_struct *thread;
|
||||
@ -2639,15 +2638,17 @@ static void bnx2fc_percpu_thread_create(unsigned int cpu)
|
||||
thread = kthread_create_on_node(bnx2fc_percpu_io_thread,
|
||||
(void *)p, cpu_to_node(cpu),
|
||||
"bnx2fc_thread/%d", cpu);
|
||||
if (IS_ERR(thread))
|
||||
return PTR_ERR(thread);
|
||||
|
||||
/* bind thread to the cpu */
|
||||
if (likely(!IS_ERR(thread))) {
|
||||
kthread_bind(thread, cpu);
|
||||
p->iothread = thread;
|
||||
wake_up_process(thread);
|
||||
}
|
||||
kthread_bind(thread, cpu);
|
||||
p->iothread = thread;
|
||||
wake_up_process(thread);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bnx2fc_percpu_thread_destroy(unsigned int cpu)
|
||||
static int bnx2fc_cpu_offline(unsigned int cpu)
|
||||
{
|
||||
struct bnx2fc_percpu_s *p;
|
||||
struct task_struct *thread;
|
||||
@ -2661,7 +2662,6 @@ static void bnx2fc_percpu_thread_destroy(unsigned int cpu)
|
||||
thread = p->iothread;
|
||||
p->iothread = NULL;
|
||||
|
||||
|
||||
/* Free all work in the list */
|
||||
list_for_each_entry_safe(work, tmp, &p->work_list, list) {
|
||||
list_del_init(&work->list);
|
||||
@ -2673,20 +2673,6 @@ static void bnx2fc_percpu_thread_destroy(unsigned int cpu)
|
||||
|
||||
if (thread)
|
||||
kthread_stop(thread);
|
||||
}
|
||||
|
||||
|
||||
static int bnx2fc_cpu_online(unsigned int cpu)
|
||||
{
|
||||
printk(PFX "CPU %x online: Create Rx thread\n", cpu);
|
||||
bnx2fc_percpu_thread_create(cpu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bnx2fc_cpu_dead(unsigned int cpu)
|
||||
{
|
||||
printk(PFX "CPU %x offline: Remove Rx thread\n", cpu);
|
||||
bnx2fc_percpu_thread_destroy(cpu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2761,30 +2747,16 @@ static int __init bnx2fc_mod_init(void)
|
||||
spin_lock_init(&p->fp_work_lock);
|
||||
}
|
||||
|
||||
get_online_cpus();
|
||||
|
||||
for_each_online_cpu(cpu)
|
||||
bnx2fc_percpu_thread_create(cpu);
|
||||
|
||||
rc = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN,
|
||||
"scsi/bnx2fc:online",
|
||||
bnx2fc_cpu_online, NULL);
|
||||
rc = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "scsi/bnx2fc:online",
|
||||
bnx2fc_cpu_online, bnx2fc_cpu_offline);
|
||||
if (rc < 0)
|
||||
goto stop_threads;
|
||||
goto stop_thread;
|
||||
bnx2fc_online_state = rc;
|
||||
|
||||
cpuhp_setup_state_nocalls(CPUHP_SCSI_BNX2FC_DEAD, "scsi/bnx2fc:dead",
|
||||
NULL, bnx2fc_cpu_dead);
|
||||
put_online_cpus();
|
||||
|
||||
cnic_register_driver(CNIC_ULP_FCOE, &bnx2fc_cnic_cb);
|
||||
|
||||
return 0;
|
||||
|
||||
stop_threads:
|
||||
for_each_online_cpu(cpu)
|
||||
bnx2fc_percpu_thread_destroy(cpu);
|
||||
put_online_cpus();
|
||||
stop_thread:
|
||||
kthread_stop(l2_thread);
|
||||
free_wq:
|
||||
destroy_workqueue(bnx2fc_wq);
|
||||
@ -2803,7 +2775,6 @@ static void __exit bnx2fc_mod_exit(void)
|
||||
struct fcoe_percpu_s *bg;
|
||||
struct task_struct *l2_thread;
|
||||
struct sk_buff *skb;
|
||||
unsigned int cpu = 0;
|
||||
|
||||
/*
|
||||
* NOTE: Since cnic calls register_driver routine rtnl_lock,
|
||||
@ -2844,16 +2815,7 @@ static void __exit bnx2fc_mod_exit(void)
|
||||
if (l2_thread)
|
||||
kthread_stop(l2_thread);
|
||||
|
||||
get_online_cpus();
|
||||
/* Destroy per cpu threads */
|
||||
for_each_online_cpu(cpu) {
|
||||
bnx2fc_percpu_thread_destroy(cpu);
|
||||
}
|
||||
|
||||
cpuhp_remove_state_nocalls(bnx2fc_online_state);
|
||||
cpuhp_remove_state_nocalls(CPUHP_SCSI_BNX2FC_DEAD);
|
||||
|
||||
put_online_cpus();
|
||||
cpuhp_remove_state(bnx2fc_online_state);
|
||||
|
||||
destroy_workqueue(bnx2fc_wq);
|
||||
/*
|
||||
|
@ -1008,6 +1008,28 @@ static struct bnx2fc_work *bnx2fc_alloc_work(struct bnx2fc_rport *tgt, u16 wqe)
|
||||
return work;
|
||||
}
|
||||
|
||||
/* Pending work request completion */
|
||||
static void bnx2fc_pending_work(struct bnx2fc_rport *tgt, unsigned int wqe)
|
||||
{
|
||||
unsigned int cpu = wqe % num_possible_cpus();
|
||||
struct bnx2fc_percpu_s *fps;
|
||||
struct bnx2fc_work *work;
|
||||
|
||||
fps = &per_cpu(bnx2fc_percpu, cpu);
|
||||
spin_lock_bh(&fps->fp_work_lock);
|
||||
if (fps->iothread) {
|
||||
work = bnx2fc_alloc_work(tgt, wqe);
|
||||
if (work) {
|
||||
list_add_tail(&work->list, &fps->work_list);
|
||||
wake_up_process(fps->iothread);
|
||||
spin_unlock_bh(&fps->fp_work_lock);
|
||||
return;
|
||||
}
|
||||
}
|
||||
spin_unlock_bh(&fps->fp_work_lock);
|
||||
bnx2fc_process_cq_compl(tgt, wqe);
|
||||
}
|
||||
|
||||
int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt)
|
||||
{
|
||||
struct fcoe_cqe *cq;
|
||||
@ -1042,28 +1064,7 @@ int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt)
|
||||
/* Unsolicited event notification */
|
||||
bnx2fc_process_unsol_compl(tgt, wqe);
|
||||
} else {
|
||||
/* Pending work request completion */
|
||||
struct bnx2fc_work *work = NULL;
|
||||
struct bnx2fc_percpu_s *fps = NULL;
|
||||
unsigned int cpu = wqe % num_possible_cpus();
|
||||
|
||||
fps = &per_cpu(bnx2fc_percpu, cpu);
|
||||
spin_lock_bh(&fps->fp_work_lock);
|
||||
if (unlikely(!fps->iothread))
|
||||
goto unlock;
|
||||
|
||||
work = bnx2fc_alloc_work(tgt, wqe);
|
||||
if (work)
|
||||
list_add_tail(&work->list,
|
||||
&fps->work_list);
|
||||
unlock:
|
||||
spin_unlock_bh(&fps->fp_work_lock);
|
||||
|
||||
/* Pending work request completion */
|
||||
if (fps->iothread && work)
|
||||
wake_up_process(fps->iothread);
|
||||
else
|
||||
bnx2fc_process_cq_compl(tgt, wqe);
|
||||
bnx2fc_pending_work(tgt, wqe);
|
||||
num_free_sqes++;
|
||||
}
|
||||
cqe++;
|
||||
|
@ -404,12 +404,11 @@ int bnx2i_get_stats(void *handle)
|
||||
|
||||
|
||||
/**
|
||||
* bnx2i_percpu_thread_create - Create a receive thread for an
|
||||
* online CPU
|
||||
* bnx2i_cpu_online - Create a receive thread for an online CPU
|
||||
*
|
||||
* @cpu: cpu index for the online cpu
|
||||
*/
|
||||
static void bnx2i_percpu_thread_create(unsigned int cpu)
|
||||
static int bnx2i_cpu_online(unsigned int cpu)
|
||||
{
|
||||
struct bnx2i_percpu_s *p;
|
||||
struct task_struct *thread;
|
||||
@ -419,16 +418,17 @@ static void bnx2i_percpu_thread_create(unsigned int cpu)
|
||||
thread = kthread_create_on_node(bnx2i_percpu_io_thread, (void *)p,
|
||||
cpu_to_node(cpu),
|
||||
"bnx2i_thread/%d", cpu);
|
||||
if (IS_ERR(thread))
|
||||
return PTR_ERR(thread);
|
||||
|
||||
/* bind thread to the cpu */
|
||||
if (likely(!IS_ERR(thread))) {
|
||||
kthread_bind(thread, cpu);
|
||||
p->iothread = thread;
|
||||
wake_up_process(thread);
|
||||
}
|
||||
kthread_bind(thread, cpu);
|
||||
p->iothread = thread;
|
||||
wake_up_process(thread);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void bnx2i_percpu_thread_destroy(unsigned int cpu)
|
||||
static int bnx2i_cpu_offline(unsigned int cpu)
|
||||
{
|
||||
struct bnx2i_percpu_s *p;
|
||||
struct task_struct *thread;
|
||||
@ -451,19 +451,6 @@ static void bnx2i_percpu_thread_destroy(unsigned int cpu)
|
||||
spin_unlock_bh(&p->p_work_lock);
|
||||
if (thread)
|
||||
kthread_stop(thread);
|
||||
}
|
||||
|
||||
static int bnx2i_cpu_online(unsigned int cpu)
|
||||
{
|
||||
pr_info("bnx2i: CPU %x online: Create Rx thread\n", cpu);
|
||||
bnx2i_percpu_thread_create(cpu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bnx2i_cpu_dead(unsigned int cpu)
|
||||
{
|
||||
pr_info("CPU %x offline: Remove Rx thread\n", cpu);
|
||||
bnx2i_percpu_thread_destroy(cpu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -511,27 +498,14 @@ static int __init bnx2i_mod_init(void)
|
||||
p->iothread = NULL;
|
||||
}
|
||||
|
||||
get_online_cpus();
|
||||
|
||||
for_each_online_cpu(cpu)
|
||||
bnx2i_percpu_thread_create(cpu);
|
||||
|
||||
err = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN,
|
||||
"scsi/bnx2i:online",
|
||||
bnx2i_cpu_online, NULL);
|
||||
err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "scsi/bnx2i:online",
|
||||
bnx2i_cpu_online, bnx2i_cpu_offline);
|
||||
if (err < 0)
|
||||
goto remove_threads;
|
||||
goto unreg_driver;
|
||||
bnx2i_online_state = err;
|
||||
|
||||
cpuhp_setup_state_nocalls(CPUHP_SCSI_BNX2I_DEAD, "scsi/bnx2i:dead",
|
||||
NULL, bnx2i_cpu_dead);
|
||||
put_online_cpus();
|
||||
return 0;
|
||||
|
||||
remove_threads:
|
||||
for_each_online_cpu(cpu)
|
||||
bnx2i_percpu_thread_destroy(cpu);
|
||||
put_online_cpus();
|
||||
unreg_driver:
|
||||
cnic_unregister_driver(CNIC_ULP_ISCSI);
|
||||
unreg_xport:
|
||||
iscsi_unregister_transport(&bnx2i_iscsi_transport);
|
||||
@ -551,7 +525,6 @@ out:
|
||||
static void __exit bnx2i_mod_exit(void)
|
||||
{
|
||||
struct bnx2i_hba *hba;
|
||||
unsigned cpu = 0;
|
||||
|
||||
mutex_lock(&bnx2i_dev_lock);
|
||||
while (!list_empty(&adapter_list)) {
|
||||
@ -569,14 +542,7 @@ static void __exit bnx2i_mod_exit(void)
|
||||
}
|
||||
mutex_unlock(&bnx2i_dev_lock);
|
||||
|
||||
get_online_cpus();
|
||||
|
||||
for_each_online_cpu(cpu)
|
||||
bnx2i_percpu_thread_destroy(cpu);
|
||||
|
||||
cpuhp_remove_state_nocalls(bnx2i_online_state);
|
||||
cpuhp_remove_state_nocalls(CPUHP_SCSI_BNX2I_DEAD);
|
||||
put_online_cpus();
|
||||
cpuhp_remove_state(bnx2i_online_state);
|
||||
|
||||
iscsi_unregister_transport(&bnx2i_iscsi_transport);
|
||||
cnic_unregister_driver(CNIC_ULP_ISCSI);
|
||||
|
@ -3845,8 +3845,10 @@ csio_hw_start(struct csio_hw *hw)
|
||||
|
||||
if (csio_is_hw_ready(hw))
|
||||
return 0;
|
||||
else
|
||||
else if (csio_match_state(hw, csio_hws_uninit))
|
||||
return -EINVAL;
|
||||
else
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -970,10 +970,14 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
pci_set_drvdata(pdev, hw);
|
||||
|
||||
if (csio_hw_start(hw) != 0) {
|
||||
dev_err(&pdev->dev,
|
||||
"Failed to start FW, continuing in debug mode.\n");
|
||||
return 0;
|
||||
rv = csio_hw_start(hw);
|
||||
if (rv) {
|
||||
if (rv == -EINVAL) {
|
||||
dev_err(&pdev->dev,
|
||||
"Failed to start FW, continuing in debug mode.\n");
|
||||
return 0;
|
||||
}
|
||||
goto err_lnode_exit;
|
||||
}
|
||||
|
||||
sprintf(hw->fwrev_str, "%u.%u.%u.%u\n",
|
||||
|
@ -1635,6 +1635,9 @@ static int init_act_open(struct cxgbi_sock *csk)
|
||||
goto rel_resource;
|
||||
}
|
||||
|
||||
if (!(n->nud_state & NUD_VALID))
|
||||
neigh_event_send(n, NULL);
|
||||
|
||||
csk->atid = cxgb4_alloc_atid(lldi->tids, csk);
|
||||
if (csk->atid < 0) {
|
||||
pr_err("%s, NO atid available.\n", ndev->name);
|
||||
|
@ -3351,6 +3351,16 @@ static void ipr_worker_thread(struct work_struct *work)
|
||||
return;
|
||||
}
|
||||
|
||||
if (ioa_cfg->scsi_unblock) {
|
||||
ioa_cfg->scsi_unblock = 0;
|
||||
ioa_cfg->scsi_blocked = 0;
|
||||
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
|
||||
scsi_unblock_requests(ioa_cfg->host);
|
||||
spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
|
||||
if (ioa_cfg->scsi_blocked)
|
||||
scsi_block_requests(ioa_cfg->host);
|
||||
}
|
||||
|
||||
if (!ioa_cfg->scan_enabled) {
|
||||
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
|
||||
return;
|
||||
@ -4935,6 +4945,7 @@ static int ipr_slave_configure(struct scsi_device *sdev)
|
||||
}
|
||||
if (ipr_is_vset_device(res)) {
|
||||
sdev->scsi_level = SCSI_SPC_3;
|
||||
sdev->no_report_opcodes = 1;
|
||||
blk_queue_rq_timeout(sdev->request_queue,
|
||||
IPR_VSET_RW_TIMEOUT);
|
||||
blk_queue_max_hw_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS);
|
||||
@ -7211,9 +7222,8 @@ static int ipr_ioa_bringdown_done(struct ipr_cmnd *ipr_cmd)
|
||||
ENTER;
|
||||
if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) {
|
||||
ipr_trace;
|
||||
spin_unlock_irq(ioa_cfg->host->host_lock);
|
||||
scsi_unblock_requests(ioa_cfg->host);
|
||||
spin_lock_irq(ioa_cfg->host->host_lock);
|
||||
ioa_cfg->scsi_unblock = 1;
|
||||
schedule_work(&ioa_cfg->work_q);
|
||||
}
|
||||
|
||||
ioa_cfg->in_reset_reload = 0;
|
||||
@ -7287,13 +7297,7 @@ static int ipr_ioa_reset_done(struct ipr_cmnd *ipr_cmd)
|
||||
list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
|
||||
wake_up_all(&ioa_cfg->reset_wait_q);
|
||||
|
||||
spin_unlock(ioa_cfg->host->host_lock);
|
||||
scsi_unblock_requests(ioa_cfg->host);
|
||||
spin_lock(ioa_cfg->host->host_lock);
|
||||
|
||||
if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].allow_cmds)
|
||||
scsi_block_requests(ioa_cfg->host);
|
||||
|
||||
ioa_cfg->scsi_unblock = 1;
|
||||
schedule_work(&ioa_cfg->work_q);
|
||||
LEAVE;
|
||||
return IPR_RC_JOB_RETURN;
|
||||
@ -9249,8 +9253,11 @@ static void _ipr_initiate_ioa_reset(struct ipr_ioa_cfg *ioa_cfg,
|
||||
spin_unlock(&ioa_cfg->hrrq[i]._lock);
|
||||
}
|
||||
wmb();
|
||||
if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa)
|
||||
if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) {
|
||||
ioa_cfg->scsi_unblock = 0;
|
||||
ioa_cfg->scsi_blocked = 1;
|
||||
scsi_block_requests(ioa_cfg->host);
|
||||
}
|
||||
|
||||
ipr_cmd = ipr_get_free_ipr_cmnd(ioa_cfg);
|
||||
ioa_cfg->reset_cmd = ipr_cmd;
|
||||
@ -9306,9 +9313,8 @@ static void ipr_initiate_ioa_reset(struct ipr_ioa_cfg *ioa_cfg,
|
||||
wake_up_all(&ioa_cfg->reset_wait_q);
|
||||
|
||||
if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) {
|
||||
spin_unlock_irq(ioa_cfg->host->host_lock);
|
||||
scsi_unblock_requests(ioa_cfg->host);
|
||||
spin_lock_irq(ioa_cfg->host->host_lock);
|
||||
ioa_cfg->scsi_unblock = 1;
|
||||
schedule_work(&ioa_cfg->work_q);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
|
@ -1488,6 +1488,8 @@ struct ipr_ioa_cfg {
|
||||
u8 cfg_locked:1;
|
||||
u8 clear_isr:1;
|
||||
u8 probe_done:1;
|
||||
u8 scsi_unblock:1;
|
||||
u8 scsi_blocked:1;
|
||||
|
||||
u8 revid;
|
||||
|
||||
|
@ -6240,8 +6240,8 @@ static int megasas_probe_one(struct pci_dev *pdev,
|
||||
fail_start_aen:
|
||||
fail_io_attach:
|
||||
megasas_mgmt_info.count--;
|
||||
megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
|
||||
megasas_mgmt_info.max_index--;
|
||||
megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
|
||||
|
||||
instance->instancet->disable_intr(instance);
|
||||
megasas_destroy_irqs(instance);
|
||||
|
@ -526,7 +526,8 @@ struct fip_vlan {
|
||||
#define QEDF_WRITE (1 << 0)
|
||||
#define MAX_FIBRE_LUNS 0xffffffff
|
||||
|
||||
#define QEDF_MAX_NUM_CQS 8
|
||||
#define MIN_NUM_CPUS_MSIX(x) min_t(u32, x->dev_info.num_cqs, \
|
||||
num_online_cpus())
|
||||
|
||||
/*
|
||||
* PCI function probe defines
|
||||
|
@ -489,7 +489,7 @@ static void qedf_srr_compl(struct qedf_els_cb_arg *cb_arg)
|
||||
|
||||
/* If a SRR times out, simply free resources */
|
||||
if (srr_req->event == QEDF_IOREQ_EV_ELS_TMO)
|
||||
goto out_free;
|
||||
goto out_put;
|
||||
|
||||
/* Normalize response data into struct fc_frame */
|
||||
mp_req = &(srr_req->mp_req);
|
||||
@ -501,7 +501,7 @@ static void qedf_srr_compl(struct qedf_els_cb_arg *cb_arg)
|
||||
if (!fp) {
|
||||
QEDF_ERR(&(qedf->dbg_ctx),
|
||||
"fc_frame_alloc failure.\n");
|
||||
goto out_free;
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
/* Copy frame header from firmware into fp */
|
||||
@ -526,9 +526,10 @@ static void qedf_srr_compl(struct qedf_els_cb_arg *cb_arg)
|
||||
}
|
||||
|
||||
fc_frame_free(fp);
|
||||
out_free:
|
||||
out_put:
|
||||
/* Put reference for original command since SRR completed */
|
||||
kref_put(&orig_io_req->refcount, qedf_release_cmd);
|
||||
out_free:
|
||||
kfree(cb_arg);
|
||||
}
|
||||
|
||||
@ -780,7 +781,7 @@ static void qedf_rec_compl(struct qedf_els_cb_arg *cb_arg)
|
||||
|
||||
/* If a REC times out, free resources */
|
||||
if (rec_req->event == QEDF_IOREQ_EV_ELS_TMO)
|
||||
goto out_free;
|
||||
goto out_put;
|
||||
|
||||
/* Normalize response data into struct fc_frame */
|
||||
mp_req = &(rec_req->mp_req);
|
||||
@ -792,7 +793,7 @@ static void qedf_rec_compl(struct qedf_els_cb_arg *cb_arg)
|
||||
if (!fp) {
|
||||
QEDF_ERR(&(qedf->dbg_ctx),
|
||||
"fc_frame_alloc failure.\n");
|
||||
goto out_free;
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
/* Copy frame header from firmware into fp */
|
||||
@ -884,9 +885,10 @@ static void qedf_rec_compl(struct qedf_els_cb_arg *cb_arg)
|
||||
|
||||
out_free_frame:
|
||||
fc_frame_free(fp);
|
||||
out_free:
|
||||
out_put:
|
||||
/* Put reference for original command since REC completed */
|
||||
kref_put(&orig_io_req->refcount, qedf_release_cmd);
|
||||
out_free:
|
||||
kfree(cb_arg);
|
||||
}
|
||||
|
||||
|
@ -2797,11 +2797,9 @@ static int qedf_set_fcoe_pf_param(struct qedf_ctx *qedf)
|
||||
* we allocation is the minimum off:
|
||||
*
|
||||
* Number of CPUs
|
||||
* Number of MSI-X vectors
|
||||
* Max number allocated in hardware (QEDF_MAX_NUM_CQS)
|
||||
* Number allocated by qed for our PCI function
|
||||
*/
|
||||
qedf->num_queues = min((unsigned int)QEDF_MAX_NUM_CQS,
|
||||
num_online_cpus());
|
||||
qedf->num_queues = MIN_NUM_CPUS_MSIX(qedf);
|
||||
|
||||
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, "Number of CQs is %d.\n",
|
||||
qedf->num_queues);
|
||||
@ -2999,6 +2997,13 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
|
||||
goto err1;
|
||||
}
|
||||
|
||||
/* Learn information crucial for qedf to progress */
|
||||
rc = qed_ops->fill_dev_info(qedf->cdev, &qedf->dev_info);
|
||||
if (rc) {
|
||||
QEDF_ERR(&(qedf->dbg_ctx), "Failed to dev info.\n");
|
||||
goto err1;
|
||||
}
|
||||
|
||||
/* queue allocation code should come here
|
||||
* order should be
|
||||
* slowpath_start
|
||||
@ -3014,13 +3019,6 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
|
||||
}
|
||||
qed_ops->common->update_pf_params(qedf->cdev, &qedf->pf_params);
|
||||
|
||||
/* Learn information crucial for qedf to progress */
|
||||
rc = qed_ops->fill_dev_info(qedf->cdev, &qedf->dev_info);
|
||||
if (rc) {
|
||||
QEDF_ERR(&(qedf->dbg_ctx), "Failed to dev info.\n");
|
||||
goto err1;
|
||||
}
|
||||
|
||||
/* Record BDQ producer doorbell addresses */
|
||||
qedf->bdq_primary_prod = qedf->dev_info.primary_dbq_rq_addr;
|
||||
qedf->bdq_secondary_prod = qedf->dev_info.secondary_bdq_rq_addr;
|
||||
|
@ -1576,7 +1576,7 @@ struct qedi_cmd *qedi_get_cmd_from_tid(struct qedi_ctx *qedi, u32 tid)
|
||||
{
|
||||
struct qedi_cmd *cmd = NULL;
|
||||
|
||||
if (tid > MAX_ISCSI_TASK_ENTRIES)
|
||||
if (tid >= MAX_ISCSI_TASK_ENTRIES)
|
||||
return NULL;
|
||||
|
||||
cmd = qedi->itt_map[tid].p_cmd;
|
||||
|
@ -318,6 +318,8 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
|
||||
return -EINVAL;
|
||||
if (start > ha->optrom_size)
|
||||
return -EINVAL;
|
||||
if (size > ha->optrom_size - start)
|
||||
size = ha->optrom_size - start;
|
||||
|
||||
mutex_lock(&ha->optrom_mutex);
|
||||
switch (val) {
|
||||
@ -343,8 +345,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
|
||||
}
|
||||
|
||||
ha->optrom_region_start = start;
|
||||
ha->optrom_region_size = start + size > ha->optrom_size ?
|
||||
ha->optrom_size - start : size;
|
||||
ha->optrom_region_size = start + size;
|
||||
|
||||
ha->optrom_state = QLA_SREADING;
|
||||
ha->optrom_buffer = vmalloc(ha->optrom_region_size);
|
||||
@ -417,8 +418,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
|
||||
}
|
||||
|
||||
ha->optrom_region_start = start;
|
||||
ha->optrom_region_size = start + size > ha->optrom_size ?
|
||||
ha->optrom_size - start : size;
|
||||
ha->optrom_region_size = start + size;
|
||||
|
||||
ha->optrom_state = QLA_SWRITING;
|
||||
ha->optrom_buffer = vmalloc(ha->optrom_region_size);
|
||||
|
@ -401,9 +401,6 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
|
||||
for (i = 0; i < vha->hw->max_req_queues; i++) {
|
||||
struct req_que *req = vha->hw->req_q_map[i];
|
||||
|
||||
if (!test_bit(i, vha->hw->req_qid_map))
|
||||
continue;
|
||||
|
||||
if (req || !buf) {
|
||||
length = req ?
|
||||
req->length : REQUEST_ENTRY_CNT_24XX;
|
||||
@ -418,9 +415,6 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
|
||||
for (i = 0; i < vha->hw->max_rsp_queues; i++) {
|
||||
struct rsp_que *rsp = vha->hw->rsp_q_map[i];
|
||||
|
||||
if (!test_bit(i, vha->hw->rsp_qid_map))
|
||||
continue;
|
||||
|
||||
if (rsp || !buf) {
|
||||
length = rsp ?
|
||||
rsp->length : RESPONSE_ENTRY_CNT_MQ;
|
||||
@ -664,9 +658,6 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
|
||||
for (i = 0; i < vha->hw->max_req_queues; i++) {
|
||||
struct req_que *req = vha->hw->req_q_map[i];
|
||||
|
||||
if (!test_bit(i, vha->hw->req_qid_map))
|
||||
continue;
|
||||
|
||||
if (req || !buf) {
|
||||
qla27xx_insert16(i, buf, len);
|
||||
qla27xx_insert16(1, buf, len);
|
||||
@ -679,9 +670,6 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
|
||||
for (i = 0; i < vha->hw->max_rsp_queues; i++) {
|
||||
struct rsp_que *rsp = vha->hw->rsp_q_map[i];
|
||||
|
||||
if (!test_bit(i, vha->hw->rsp_qid_map))
|
||||
continue;
|
||||
|
||||
if (rsp || !buf) {
|
||||
qla27xx_insert16(i, buf, len);
|
||||
qla27xx_insert16(1, buf, len);
|
||||
|
@ -780,7 +780,11 @@ MODULE_LICENSE("GPL");
|
||||
module_param(scsi_logging_level, int, S_IRUGO|S_IWUSR);
|
||||
MODULE_PARM_DESC(scsi_logging_level, "a bit mask of logging levels");
|
||||
|
||||
#ifdef CONFIG_SCSI_MQ_DEFAULT
|
||||
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);
|
||||
|
||||
static int __init init_scsi(void)
|
||||
|
@ -1277,6 +1277,9 @@ static void sd_uninit_command(struct scsi_cmnd *SCpnt)
|
||||
{
|
||||
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)
|
||||
__free_page(rq->special_vec.bv_page);
|
||||
|
||||
|
@ -294,6 +294,9 @@ int sd_zbc_write_lock_zone(struct scsi_cmnd *cmd)
|
||||
test_and_set_bit(zno, sdkp->zones_wlock))
|
||||
return BLKPREP_DEFER;
|
||||
|
||||
WARN_ON_ONCE(cmd->flags & SCMD_ZONE_WRITE_LOCK);
|
||||
cmd->flags |= SCMD_ZONE_WRITE_LOCK;
|
||||
|
||||
return BLKPREP_OK;
|
||||
}
|
||||
|
||||
@ -302,9 +305,10 @@ void sd_zbc_write_unlock_zone(struct scsi_cmnd *cmd)
|
||||
struct request *rq = cmd->request;
|
||||
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));
|
||||
WARN_ON_ONCE(!test_bit(zno, sdkp->zones_wlock));
|
||||
cmd->flags &= ~SCMD_ZONE_WRITE_LOCK;
|
||||
clear_bit_unlock(zno, sdkp->zones_wlock);
|
||||
smp_mb__after_atomic();
|
||||
}
|
||||
@ -335,9 +339,6 @@ void sd_zbc_complete(struct scsi_cmnd *cmd,
|
||||
case REQ_OP_WRITE_ZEROES:
|
||||
case REQ_OP_WRITE_SAME:
|
||||
|
||||
/* Unlock the zone */
|
||||
sd_zbc_write_unlock_zone(cmd);
|
||||
|
||||
if (result &&
|
||||
sshdr->sense_key == ILLEGAL_REQUEST &&
|
||||
sshdr->asc == 0x21)
|
||||
|
@ -106,7 +106,7 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,
|
||||
|
||||
ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen,
|
||||
NULL, SES_TIMEOUT, SES_RETRIES, NULL);
|
||||
if (unlikely(!ret))
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
|
||||
recv_page_code = ((unsigned char *)buf)[0];
|
||||
|
@ -751,35 +751,6 @@ sg_new_write(Sg_fd *sfp, struct file *file, const char __user *buf,
|
||||
return count;
|
||||
}
|
||||
|
||||
static bool sg_is_valid_dxfer(sg_io_hdr_t *hp)
|
||||
{
|
||||
switch (hp->dxfer_direction) {
|
||||
case SG_DXFER_NONE:
|
||||
if (hp->dxferp || hp->dxfer_len > 0)
|
||||
return false;
|
||||
return true;
|
||||
case SG_DXFER_FROM_DEV:
|
||||
/*
|
||||
* for SG_DXFER_FROM_DEV we always set dxfer_len to > 0. dxferp
|
||||
* can either be NULL or != NULL so there's no point in checking
|
||||
* it either. So just return true.
|
||||
*/
|
||||
return true;
|
||||
case SG_DXFER_TO_DEV:
|
||||
case SG_DXFER_TO_FROM_DEV:
|
||||
if (!hp->dxferp || hp->dxfer_len == 0)
|
||||
return false;
|
||||
return true;
|
||||
case SG_DXFER_UNKNOWN:
|
||||
if ((!hp->dxferp && hp->dxfer_len) ||
|
||||
(hp->dxferp && hp->dxfer_len == 0))
|
||||
return false;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
sg_common_write(Sg_fd * sfp, Sg_request * srp,
|
||||
unsigned char *cmnd, int timeout, int blocking)
|
||||
@ -800,7 +771,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
|
||||
"sg_common_write: scsi opcode=0x%02x, cmd_size=%d\n",
|
||||
(int) cmnd[0], (int) hp->cmd_len));
|
||||
|
||||
if (!sg_is_valid_dxfer(hp))
|
||||
if (hp->dxfer_len >= SZ_256M)
|
||||
return -EINVAL;
|
||||
|
||||
k = sg_start_req(srp, cmnd);
|
||||
@ -1050,7 +1021,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
|
||||
read_lock_irqsave(&sfp->rq_list_lock, iflags);
|
||||
val = 0;
|
||||
list_for_each_entry(srp, &sfp->rq_list, entry) {
|
||||
if (val > SG_MAX_QUEUE)
|
||||
if (val >= SG_MAX_QUEUE)
|
||||
break;
|
||||
memset(&rinfo[val], 0, SZ_SG_REQ_INFO);
|
||||
rinfo[val].req_state = srp->done + 1;
|
||||
|
@ -4299,11 +4299,11 @@ static int st_probe(struct device *dev)
|
||||
kref_init(&tpnt->kref);
|
||||
tpnt->disk = disk;
|
||||
disk->private_data = &tpnt->driver;
|
||||
disk->queue = SDp->request_queue;
|
||||
/* SCSI tape doesn't register this gendisk via add_disk(). Manually
|
||||
* take queue reference that release_disk() expects. */
|
||||
if (!blk_get_queue(disk->queue))
|
||||
if (!blk_get_queue(SDp->request_queue))
|
||||
goto out_put_disk;
|
||||
disk->queue = SDp->request_queue;
|
||||
tpnt->driver = &st_template;
|
||||
|
||||
tpnt->device = SDp;
|
||||
|
@ -1640,6 +1640,8 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
|
||||
put_cpu();
|
||||
|
||||
if (ret == -EAGAIN) {
|
||||
if (payload_sz > sizeof(cmd_request->mpb))
|
||||
kfree(payload);
|
||||
/* no more space */
|
||||
return SCSI_MLQUEUE_DEVICE_BUSY;
|
||||
}
|
||||
|
@ -39,8 +39,6 @@ enum cpuhp_state {
|
||||
CPUHP_PCI_XGENE_DEAD,
|
||||
CPUHP_IOMMU_INTEL_DEAD,
|
||||
CPUHP_LUSTRE_CFS_DEAD,
|
||||
CPUHP_SCSI_BNX2FC_DEAD,
|
||||
CPUHP_SCSI_BNX2I_DEAD,
|
||||
CPUHP_WORKQUEUE_PREP,
|
||||
CPUHP_POWER_NUMA_PREPARE,
|
||||
CPUHP_HRTIMERS_PREPARE,
|
||||
|
@ -57,6 +57,7 @@ struct scsi_pointer {
|
||||
/* for scmd->flags */
|
||||
#define SCMD_TAGGED (1 << 0)
|
||||
#define SCMD_UNCHECKED_ISA_DMA (1 << 1)
|
||||
#define SCMD_ZONE_WRITE_LOCK (1 << 2)
|
||||
#define SCMD_INITIALIZED (1 << 3)
|
||||
/* flags preserved across unprep / reprep */
|
||||
#define SCMD_PRESERVED_FLAGS (SCMD_UNCHECKED_ISA_DMA | SCMD_INITIALIZED)
|
||||
|
Loading…
Reference in New Issue
Block a user