Skip to content

Commit a3b4924

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley: "This is the set of stuff that didn't quite make the initial pull and a set of fixes for stuff which did. The new stuff is basically lpfc (nvme), qedi and aacraid. The fixes cover a lot of previously submitted stuff, the most important of which probably covers some of the failing irq vectors allocation and other fallout from having the SCSI command allocated as part of the block allocation functions" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (59 commits) scsi: qedi: Fix memory leak in tmf response processing. scsi: aacraid: remove redundant zero check on ret scsi: lpfc: use proper format string for dma_addr_t scsi: lpfc: use div_u64 for 64-bit division scsi: mac_scsi: Fix MAC_SCSI=m option when SCSI=m scsi: cciss: correct check map error. scsi: qla2xxx: fix spelling mistake: "seperator" -> "separator" scsi: aacraid: Fixed expander hotplug for SMART family scsi: mpt3sas: switch to pci_alloc_irq_vectors scsi: qedf: fixup compilation warning about atomic_t usage scsi: remove scsi_execute_req_flags scsi: merge __scsi_execute into scsi_execute scsi: simplify scsi_execute_req_flags scsi: make the sense header argument to scsi_test_unit_ready mandatory scsi: sd: improve TUR handling in sd_check_events scsi: always zero sshdr in scsi_normalize_sense scsi: scsi_dh_emc: return success in clariion_std_inquiry() scsi: fix memory leak of sdpk on when gd fails to allocate scsi: sd: make sd_devt_release() static scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework. ...
2 parents 0b94da8 + 42a70ab commit a3b4924

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+22404
-3220
lines changed

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10336,6 +10336,12 @@ L: linux-scsi@vger.kernel.org
1033610336
S: Supported
1033710337
F: drivers/scsi/qedi/
1033810338

10339+
QLOGIC QL41xxx FCOE DRIVER
10340+
M: QLogic-Storage-Upstream@cavium.com
10341+
L: linux-scsi@vger.kernel.org
10342+
S: Supported
10343+
F: drivers/scsi/qedf/
10344+
1033910345
QNX4 FILESYSTEM
1034010346
M: Anders Larsen <al@alarsen.net>
1034110347
W: http://www.alarsen.net/linux/qnx4fs/

drivers/ata/libata-scsi.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
600600
u8 args[4], *argbuf = NULL, *sensebuf = NULL;
601601
int argsize = 0;
602602
enum dma_data_direction data_dir;
603+
struct scsi_sense_hdr sshdr;
603604
int cmd_result;
604605

605606
if (arg == NULL)
@@ -648,7 +649,7 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
648649
/* Good values for timeout and retries? Values below
649650
from scsi_ioctl_send_command() for default case... */
650651
cmd_result = scsi_execute(scsidev, scsi_cmd, data_dir, argbuf, argsize,
651-
sensebuf, (10*HZ), 5, 0, NULL);
652+
sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL);
652653

653654
if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */
654655
u8 *desc = sensebuf + 8;
@@ -657,9 +658,6 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
657658
/* If we set cc then ATA pass-through will cause a
658659
* check condition even if no error. Filter that. */
659660
if (cmd_result & SAM_STAT_CHECK_CONDITION) {
660-
struct scsi_sense_hdr sshdr;
661-
scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
662-
&sshdr);
663661
if (sshdr.sense_key == RECOVERED_ERROR &&
664662
sshdr.asc == 0 && sshdr.ascq == 0x1d)
665663
cmd_result &= ~SAM_STAT_CHECK_CONDITION;
@@ -707,6 +705,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
707705
int rc = 0;
708706
u8 scsi_cmd[MAX_COMMAND_SIZE];
709707
u8 args[7], *sensebuf = NULL;
708+
struct scsi_sense_hdr sshdr;
710709
int cmd_result;
711710

712711
if (arg == NULL)
@@ -734,7 +733,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
734733
/* Good values for timeout and retries? Values below
735734
from scsi_ioctl_send_command() for default case... */
736735
cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0,
737-
sensebuf, (10*HZ), 5, 0, NULL);
736+
sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL);
738737

739738
if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */
740739
u8 *desc = sensebuf + 8;
@@ -743,9 +742,6 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
743742
/* If we set cc then ATA pass-through will cause a
744743
* check condition even if no error. Filter that. */
745744
if (cmd_result & SAM_STAT_CHECK_CONDITION) {
746-
struct scsi_sense_hdr sshdr;
747-
scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
748-
&sshdr);
749745
if (sshdr.sense_key == RECOVERED_ERROR &&
750746
sshdr.asc == 0 && sshdr.ascq == 0x1d)
751747
cmd_result &= ~SAM_STAT_CHECK_CONDITION;

drivers/block/cciss.c

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static void cciss_unmap_sg_chain_block(ctlr_info_t *h, CommandList_struct *c)
348348
pci_unmap_single(h->pdev, temp64.val, chain_sg->Len, PCI_DMA_TODEVICE);
349349
}
350350

351-
static void cciss_map_sg_chain_block(ctlr_info_t *h, CommandList_struct *c,
351+
static int cciss_map_sg_chain_block(ctlr_info_t *h, CommandList_struct *c,
352352
SGDescriptor_struct *chain_block, int len)
353353
{
354354
SGDescriptor_struct *chain_sg;
@@ -359,8 +359,16 @@ static void cciss_map_sg_chain_block(ctlr_info_t *h, CommandList_struct *c,
359359
chain_sg->Len = len;
360360
temp64.val = pci_map_single(h->pdev, chain_block, len,
361361
PCI_DMA_TODEVICE);
362+
if (dma_mapping_error(&h->pdev->dev, temp64.val)) {
363+
dev_warn(&h->pdev->dev,
364+
"%s: error mapping chain block for DMA\n",
365+
__func__);
366+
return -1;
367+
}
362368
chain_sg->Addr.lower = temp64.val32.lower;
363369
chain_sg->Addr.upper = temp64.val32.upper;
370+
371+
return 0;
364372
}
365373

366374
#include "cciss_scsi.c" /* For SCSI tape support */
@@ -3369,15 +3377,31 @@ static void do_cciss_request(struct request_queue *q)
33693377
temp64.val = (__u64) pci_map_page(h->pdev, sg_page(&tmp_sg[i]),
33703378
tmp_sg[i].offset,
33713379
tmp_sg[i].length, dir);
3380+
if (dma_mapping_error(&h->pdev->dev, temp64.val)) {
3381+
dev_warn(&h->pdev->dev,
3382+
"%s: error mapping page for DMA\n", __func__);
3383+
creq->errors = make_status_bytes(SAM_STAT_GOOD,
3384+
0, DRIVER_OK,
3385+
DID_SOFT_ERROR);
3386+
cmd_free(h, c);
3387+
return;
3388+
}
33723389
curr_sg[sg_index].Addr.lower = temp64.val32.lower;
33733390
curr_sg[sg_index].Addr.upper = temp64.val32.upper;
33743391
curr_sg[sg_index].Ext = 0; /* we are not chaining */
33753392
++sg_index;
33763393
}
3377-
if (chained)
3378-
cciss_map_sg_chain_block(h, c, h->cmd_sg_list[c->cmdindex],
3394+
if (chained) {
3395+
if (cciss_map_sg_chain_block(h, c, h->cmd_sg_list[c->cmdindex],
33793396
(seg - (h->max_cmd_sgentries - 1)) *
3380-
sizeof(SGDescriptor_struct));
3397+
sizeof(SGDescriptor_struct))) {
3398+
creq->errors = make_status_bytes(SAM_STAT_GOOD,
3399+
0, DRIVER_OK,
3400+
DID_SOFT_ERROR);
3401+
cmd_free(h, c);
3402+
return;
3403+
}
3404+
}
33813405

33823406
/* track how many SG entries we are using */
33833407
if (seg > h->maxSG)

drivers/scsi/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,11 +1235,13 @@ config SCSI_QLOGICPTI
12351235
source "drivers/scsi/qla2xxx/Kconfig"
12361236
source "drivers/scsi/qla4xxx/Kconfig"
12371237
source "drivers/scsi/qedi/Kconfig"
1238+
source "drivers/scsi/qedf/Kconfig"
12381239

12391240
config SCSI_LPFC
12401241
tristate "Emulex LightPulse Fibre Channel Support"
12411242
depends on PCI && SCSI
12421243
depends on SCSI_FC_ATTRS
1244+
depends on NVME_FC && NVME_TARGET_FC
12431245
select CRC_T10DIF
12441246
help
12451247
This lpfc driver supports the Emulex LightPulse
@@ -1478,7 +1480,7 @@ config ATARI_SCSI
14781480

14791481
config MAC_SCSI
14801482
tristate "Macintosh NCR5380 SCSI"
1481-
depends on MAC && SCSI=y
1483+
depends on MAC && SCSI
14821484
select SCSI_SPI_ATTRS
14831485
help
14841486
This is the NCR 5380 SCSI controller included on most of the 68030

drivers/scsi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ obj-$(CONFIG_FCOE) += fcoe/
4141
obj-$(CONFIG_FCOE_FNIC) += fnic/
4242
obj-$(CONFIG_SCSI_SNIC) += snic/
4343
obj-$(CONFIG_SCSI_BNX2X_FCOE) += libfc/ fcoe/ bnx2fc/
44+
obj-$(CONFIG_QEDF) += qedf/
4445
obj-$(CONFIG_ISCSI_TCP) += libiscsi.o libiscsi_tcp.o iscsi_tcp.o
4546
obj-$(CONFIG_INFINIBAND_ISER) += libiscsi.o
4647
obj-$(CONFIG_ISCSI_BOOT_SYSFS) += iscsi_boot_sysfs.o

drivers/scsi/aacraid/aachba.c

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for"
294294
"deregistering them. This is typically adjusted for heavily burdened"
295295
" systems.");
296296

297+
int aac_fib_dump;
298+
module_param(aac_fib_dump, int, 0644);
299+
MODULE_PARM_DESC(aac_fib_dump, "Dump controller fibs prior to IOP_RESET 0=off, 1=on");
300+
297301
int numacb = -1;
298302
module_param(numacb, int, S_IRUGO|S_IWUSR);
299303
MODULE_PARM_DESC(numacb, "Request a limit to the number of adapter control"
@@ -311,7 +315,7 @@ module_param(update_interval, int, S_IRUGO|S_IWUSR);
311315
MODULE_PARM_DESC(update_interval, "Interval in seconds between time sync"
312316
" updates issued to adapter.");
313317

314-
int check_interval = 24 * 60 * 60;
318+
int check_interval = 60;
315319
module_param(check_interval, int, S_IRUGO|S_IWUSR);
316320
MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health"
317321
" checks.");
@@ -483,7 +487,7 @@ int aac_get_containers(struct aac_dev *dev)
483487
if (status >= 0) {
484488
dresp = (struct aac_get_container_count_resp *)fib_data(fibptr);
485489
maximum_num_containers = le32_to_cpu(dresp->ContainerSwitchEntries);
486-
if (fibptr->dev->supplement_adapter_info.SupportedOptions2 &
490+
if (fibptr->dev->supplement_adapter_info.supported_options2 &
487491
AAC_OPTION_SUPPORTED_240_VOLUMES) {
488492
maximum_num_containers =
489493
le32_to_cpu(dresp->MaxSimpleVolumes);
@@ -639,13 +643,16 @@ static void _aac_probe_container2(void * context, struct fib * fibptr)
639643
fsa_dev_ptr = fibptr->dev->fsa_dev;
640644
if (fsa_dev_ptr) {
641645
struct aac_mount * dresp = (struct aac_mount *) fib_data(fibptr);
646+
__le32 sup_options2;
647+
642648
fsa_dev_ptr += scmd_id(scsicmd);
649+
sup_options2 =
650+
fibptr->dev->supplement_adapter_info.supported_options2;
643651

644652
if ((le32_to_cpu(dresp->status) == ST_OK) &&
645653
(le32_to_cpu(dresp->mnt[0].vol) != CT_NONE) &&
646654
(le32_to_cpu(dresp->mnt[0].state) != FSCS_HIDDEN)) {
647-
if (!(fibptr->dev->supplement_adapter_info.SupportedOptions2 &
648-
AAC_OPTION_VARIABLE_BLOCK_SIZE)) {
655+
if (!(sup_options2 & AAC_OPTION_VARIABLE_BLOCK_SIZE)) {
649656
dresp->mnt[0].fileinfo.bdevinfo.block_size = 0x200;
650657
fsa_dev_ptr->block_size = 0x200;
651658
} else {
@@ -688,7 +695,7 @@ static void _aac_probe_container1(void * context, struct fib * fibptr)
688695
int status;
689696

690697
dresp = (struct aac_mount *) fib_data(fibptr);
691-
if (!(fibptr->dev->supplement_adapter_info.SupportedOptions2 &
698+
if (!(fibptr->dev->supplement_adapter_info.supported_options2 &
692699
AAC_OPTION_VARIABLE_BLOCK_SIZE))
693700
dresp->mnt[0].capacityhigh = 0;
694701
if ((le32_to_cpu(dresp->status) != ST_OK) ||
@@ -705,7 +712,7 @@ static void _aac_probe_container1(void * context, struct fib * fibptr)
705712

706713
dinfo = (struct aac_query_mount *)fib_data(fibptr);
707714

708-
if (fibptr->dev->supplement_adapter_info.SupportedOptions2 &
715+
if (fibptr->dev->supplement_adapter_info.supported_options2 &
709716
AAC_OPTION_VARIABLE_BLOCK_SIZE)
710717
dinfo->command = cpu_to_le32(VM_NameServeAllBlk);
711718
else
@@ -745,7 +752,7 @@ static int _aac_probe_container(struct scsi_cmnd * scsicmd, int (*callback)(stru
745752

746753
dinfo = (struct aac_query_mount *)fib_data(fibptr);
747754

748-
if (fibptr->dev->supplement_adapter_info.SupportedOptions2 &
755+
if (fibptr->dev->supplement_adapter_info.supported_options2 &
749756
AAC_OPTION_VARIABLE_BLOCK_SIZE)
750757
dinfo->command = cpu_to_le32(VM_NameServeAllBlk);
751758
else
@@ -896,12 +903,14 @@ char * get_container_type(unsigned tindex)
896903
static void setinqstr(struct aac_dev *dev, void *data, int tindex)
897904
{
898905
struct scsi_inq *str;
906+
struct aac_supplement_adapter_info *sup_adap_info;
899907

908+
sup_adap_info = &dev->supplement_adapter_info;
900909
str = (struct scsi_inq *)(data); /* cast data to scsi inq block */
901910
memset(str, ' ', sizeof(*str));
902911

903-
if (dev->supplement_adapter_info.AdapterTypeText[0]) {
904-
char * cp = dev->supplement_adapter_info.AdapterTypeText;
912+
if (sup_adap_info->adapter_type_text[0]) {
913+
char *cp = sup_adap_info->adapter_type_text;
905914
int c;
906915
if ((cp[0] == 'A') && (cp[1] == 'O') && (cp[2] == 'C'))
907916
inqstrcpy("SMC", str->vid);
@@ -911,8 +920,7 @@ static void setinqstr(struct aac_dev *dev, void *data, int tindex)
911920
++cp;
912921
c = *cp;
913922
*cp = '\0';
914-
inqstrcpy (dev->supplement_adapter_info.AdapterTypeText,
915-
str->vid);
923+
inqstrcpy(sup_adap_info->adapter_type_text, str->vid);
916924
*cp = c;
917925
while (*cp && *cp != ' ')
918926
++cp;
@@ -1675,8 +1683,8 @@ int aac_issue_bmic_identify(struct aac_dev *dev, u32 bus, u32 target)
16751683
if (!identify_resp)
16761684
goto fib_free_ptr;
16771685

1678-
vbus = (u32)le16_to_cpu(dev->supplement_adapter_info.VirtDeviceBus);
1679-
vid = (u32)le16_to_cpu(dev->supplement_adapter_info.VirtDeviceTarget);
1686+
vbus = (u32)le16_to_cpu(dev->supplement_adapter_info.virt_device_bus);
1687+
vid = (u32)le16_to_cpu(dev->supplement_adapter_info.virt_device_target);
16801688

16811689
aac_fib_init(fibptr);
16821690

@@ -1815,9 +1823,9 @@ int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan)
18151823
}
18161824

18171825
vbus = (u32) le16_to_cpu(
1818-
dev->supplement_adapter_info.VirtDeviceBus);
1826+
dev->supplement_adapter_info.virt_device_bus);
18191827
vid = (u32) le16_to_cpu(
1820-
dev->supplement_adapter_info.VirtDeviceTarget);
1828+
dev->supplement_adapter_info.virt_device_target);
18211829

18221830
aac_fib_init(fibptr);
18231831

@@ -1893,7 +1901,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
18931901
}
18941902
memcpy(&dev->adapter_info, info, sizeof(*info));
18951903

1896-
dev->supplement_adapter_info.VirtDeviceBus = 0xffff;
1904+
dev->supplement_adapter_info.virt_device_bus = 0xffff;
18971905
if (dev->adapter_info.options & AAC_OPT_SUPPLEMENT_ADAPTER_INFO) {
18981906
struct aac_supplement_adapter_info * sinfo;
18991907

@@ -1961,7 +1969,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
19611969
}
19621970

19631971
if (!dev->sync_mode && dev->sa_firmware &&
1964-
dev->supplement_adapter_info.VirtDeviceBus != 0xffff) {
1972+
dev->supplement_adapter_info.virt_device_bus != 0xffff) {
19651973
/* Thor SA Firmware -> CISS_REPORT_PHYSICAL_LUNS */
19661974
rcode = aac_report_phys_luns(dev, fibptr, AAC_INIT);
19671975
}
@@ -1976,8 +1984,8 @@ int aac_get_adapter_info(struct aac_dev* dev)
19761984
(tmp>>16)&0xff,
19771985
tmp&0xff,
19781986
le32_to_cpu(dev->adapter_info.kernelbuild),
1979-
(int)sizeof(dev->supplement_adapter_info.BuildDate),
1980-
dev->supplement_adapter_info.BuildDate);
1987+
(int)sizeof(dev->supplement_adapter_info.build_date),
1988+
dev->supplement_adapter_info.build_date);
19811989
tmp = le32_to_cpu(dev->adapter_info.monitorrev);
19821990
printk(KERN_INFO "%s%d: monitor %d.%d-%d[%d]\n",
19831991
dev->name, dev->id,
@@ -1993,22 +2001,23 @@ int aac_get_adapter_info(struct aac_dev* dev)
19932001
shost_to_class(dev->scsi_host_ptr), buffer))
19942002
printk(KERN_INFO "%s%d: serial %s",
19952003
dev->name, dev->id, buffer);
1996-
if (dev->supplement_adapter_info.VpdInfo.Tsid[0]) {
2004+
if (dev->supplement_adapter_info.vpd_info.tsid[0]) {
19972005
printk(KERN_INFO "%s%d: TSID %.*s\n",
19982006
dev->name, dev->id,
1999-
(int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid),
2000-
dev->supplement_adapter_info.VpdInfo.Tsid);
2007+
(int)sizeof(dev->supplement_adapter_info
2008+
.vpd_info.tsid),
2009+
dev->supplement_adapter_info.vpd_info.tsid);
20012010
}
20022011
if (!aac_check_reset || ((aac_check_reset == 1) &&
2003-
(dev->supplement_adapter_info.SupportedOptions2 &
2012+
(dev->supplement_adapter_info.supported_options2 &
20042013
AAC_OPTION_IGNORE_RESET))) {
20052014
printk(KERN_INFO "%s%d: Reset Adapter Ignored\n",
20062015
dev->name, dev->id);
20072016
}
20082017
}
20092018

20102019
dev->cache_protected = 0;
2011-
dev->jbod = ((dev->supplement_adapter_info.FeatureBits &
2020+
dev->jbod = ((dev->supplement_adapter_info.feature_bits &
20122021
AAC_FEATURE_JBOD) != 0);
20132022
dev->nondasd_support = 0;
20142023
dev->raid_scsi_mode = 0;
@@ -2631,7 +2640,7 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd)
26312640
struct scsi_device *sdev = scsicmd->device;
26322641
struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata;
26332642

2634-
if (!(aac->supplement_adapter_info.SupportedOptions2 &
2643+
if (!(aac->supplement_adapter_info.supported_options2 &
26352644
AAC_OPTION_POWER_MANAGEMENT)) {
26362645
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
26372646
SAM_STAT_GOOD;

0 commit comments

Comments
 (0)