Skip to content

Commit eccc58c

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Five small fixes. Four in three drivers: qedi, lpfc and storvsc. The final one is labelled core, but merely adds a dh rdac entry for Lenovo systems" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: lpfc: Fix missing wakeups on abort threads scsi: storvsc: Reduce default ring buffer size to 128 Kbytes scsi: storvsc: Fix calculation of sub-channel count scsi: core: add new RDAC LENOVO/DE_Series device scsi: qedi: remove declaration of nvm_image from stack
2 parents faac51d + 4eb0153 commit eccc58c

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

drivers/scsi/lpfc/lpfc_scsi.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3878,10 +3878,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
38783878
* wake up the thread.
38793879
*/
38803880
spin_lock(&lpfc_cmd->buf_lock);
3881-
if (unlikely(lpfc_cmd->cur_iocbq.iocb_flag & LPFC_DRIVER_ABORTED)) {
3882-
lpfc_cmd->cur_iocbq.iocb_flag &= ~LPFC_DRIVER_ABORTED;
3883-
if (lpfc_cmd->waitq)
3884-
wake_up(lpfc_cmd->waitq);
3881+
lpfc_cmd->cur_iocbq.iocb_flag &= ~LPFC_DRIVER_ABORTED;
3882+
if (lpfc_cmd->waitq) {
3883+
wake_up(lpfc_cmd->waitq);
38853884
lpfc_cmd->waitq = NULL;
38863885
}
38873886
spin_unlock(&lpfc_cmd->buf_lock);

drivers/scsi/qedi/qedi_main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,10 +1392,8 @@ static void qedi_free_nvm_iscsi_cfg(struct qedi_ctx *qedi)
13921392

13931393
static int qedi_alloc_nvm_iscsi_cfg(struct qedi_ctx *qedi)
13941394
{
1395-
struct qedi_nvm_iscsi_image nvm_image;
1396-
13971395
qedi->iscsi_image = dma_alloc_coherent(&qedi->pdev->dev,
1398-
sizeof(nvm_image),
1396+
sizeof(struct qedi_nvm_iscsi_image),
13991397
&qedi->nvm_buf_dma, GFP_KERNEL);
14001398
if (!qedi->iscsi_image) {
14011399
QEDI_ERR(&qedi->dbg_ctx, "Could not allocate NVM BUF.\n");
@@ -2236,14 +2234,13 @@ static void qedi_boot_release(void *data)
22362234
static int qedi_get_boot_info(struct qedi_ctx *qedi)
22372235
{
22382236
int ret = 1;
2239-
struct qedi_nvm_iscsi_image nvm_image;
22402237

22412238
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO,
22422239
"Get NVM iSCSI CFG image\n");
22432240
ret = qedi_ops->common->nvm_get_image(qedi->cdev,
22442241
QED_NVM_IMAGE_ISCSI_CFG,
22452242
(char *)qedi->iscsi_image,
2246-
sizeof(nvm_image));
2243+
sizeof(struct qedi_nvm_iscsi_image));
22472244
if (ret)
22482245
QEDI_ERR(&qedi->dbg_ctx,
22492246
"Could not get NVM image. ret = %d\n", ret);

drivers/scsi/scsi_devinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ static struct {
238238
{"NETAPP", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
239239
{"LSI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
240240
{"ENGENIO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
241+
{"LENOVO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
241242
{"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36},
242243
{"SONY", "CD-ROM CDU-8001", NULL, BLIST_BORKEN},
243244
{"SONY", "TSL", NULL, BLIST_FORCELUN}, /* DDS3 & DDS4 autoloaders */

drivers/scsi/scsi_dh.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ static const struct scsi_dh_blist scsi_dh_blist[] = {
7575
{"NETAPP", "INF-01-00", "rdac", },
7676
{"LSI", "INF-01-00", "rdac", },
7777
{"ENGENIO", "INF-01-00", "rdac", },
78+
{"LENOVO", "DE_Series", "rdac", },
7879
{NULL, NULL, NULL },
7980
};
8081

drivers/scsi/storvsc_drv.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ enum storvsc_request_type {
385385
* This is the end of Protocol specific defines.
386386
*/
387387

388-
static int storvsc_ringbuffer_size = (256 * PAGE_SIZE);
388+
static int storvsc_ringbuffer_size = (128 * 1024);
389389
static u32 max_outstanding_req_per_channel;
390390

391391
static int storvsc_vcpus_per_sub_channel = 4;
@@ -668,13 +668,22 @@ static void handle_multichannel_storage(struct hv_device *device, int max_chns)
668668
{
669669
struct device *dev = &device->device;
670670
struct storvsc_device *stor_device;
671-
int num_cpus = num_online_cpus();
672671
int num_sc;
673672
struct storvsc_cmd_request *request;
674673
struct vstor_packet *vstor_packet;
675674
int ret, t;
676675

677-
num_sc = ((max_chns > num_cpus) ? num_cpus : max_chns);
676+
/*
677+
* If the number of CPUs is artificially restricted, such as
678+
* with maxcpus=1 on the kernel boot line, Hyper-V could offer
679+
* sub-channels >= the number of CPUs. These sub-channels
680+
* should not be created. The primary channel is already created
681+
* and assigned to one CPU, so check against # CPUs - 1.
682+
*/
683+
num_sc = min((int)(num_online_cpus() - 1), max_chns);
684+
if (!num_sc)
685+
return;
686+
678687
stor_device = get_out_stor_device(device);
679688
if (!stor_device)
680689
return;

0 commit comments

Comments
 (0)