Skip to content

Commit abf04af

Browse files
committed
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley: "This is just a couple of drivers (hpsa and lpfc) that got left out for further testing in linux-next. We also have one fix to a prior submission (qla2xxx sparse)" * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (36 commits) qla2xxx: fix sparse warnings introduced by previous target mode t10-dif patch lpfc: Update lpfc version to driver version 10.2.8001.0 lpfc: Fix ExpressLane priority setup lpfc: mark old devices as obsolete lpfc: Fix for initializing RRQ bitmap lpfc: Fix for cleaning up stale ring flag and sp_queue_event entries lpfc: Update lpfc version to driver version 10.2.8000.0 lpfc: Update Copyright on changed files from 8.3.45 patches lpfc: Update Copyright on changed files lpfc: Fixed locking for scsi task management commands lpfc: Convert runtime references to old xlane cfg param to fof cfg param lpfc: Fix FW dump using sysfs lpfc: Fix SLI4 s abort loop to process all FCP rings and under ring_lock lpfc: Fixed kernel panic in lpfc_abort_handler lpfc: Fix locking for postbufq when freeing lpfc: Fix locking for lpfc_hba_down_post lpfc: Fix dynamic transitions of FirstBurst from on to off hpsa: fix handling of hpsa_volume_offline return value hpsa: return -ENOMEM not -1 on kzalloc failure in hpsa_get_device_id hpsa: remove messages about volume status VPD inquiry page not supported ...
2 parents 16d52ef + c7ee3bd commit abf04af

24 files changed

+715
-369
lines changed

drivers/scsi/hpsa.c

Lines changed: 158 additions & 108 deletions
Large diffs are not rendered by default.

drivers/scsi/hpsa.h

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ struct hpsa_scsi_dev_t {
5757

5858
};
5959

60-
struct reply_pool {
60+
struct reply_queue_buffer {
6161
u64 *head;
6262
size_t size;
6363
u8 wraparound;
6464
u32 current_entry;
65+
dma_addr_t busaddr;
6566
};
6667

6768
#pragma pack(1)
@@ -116,11 +117,8 @@ struct ctlr_info {
116117
int nr_cmds; /* Number of commands allowed on this controller */
117118
struct CfgTable __iomem *cfgtable;
118119
int interrupts_enabled;
119-
int major;
120120
int max_commands;
121121
int commands_outstanding;
122-
int max_outstanding; /* Debug */
123-
int usage_count; /* number of opens all all minor devices */
124122
# define PERF_MODE_INT 0
125123
# define DOORBELL_INT 1
126124
# define SIMPLE_MODE_INT 2
@@ -177,11 +175,9 @@ struct ctlr_info {
177175
/*
178176
* Performant mode completion buffers
179177
*/
180-
u64 *reply_pool;
181-
size_t reply_pool_size;
182-
struct reply_pool reply_queue[MAX_REPLY_QUEUES];
178+
size_t reply_queue_size;
179+
struct reply_queue_buffer reply_queue[MAX_REPLY_QUEUES];
183180
u8 nreply_queues;
184-
dma_addr_t reply_pool_dhandle;
185181
u32 *blockFetchTable;
186182
u32 *ioaccel1_blockFetchTable;
187183
u32 *ioaccel2_blockFetchTable;
@@ -196,7 +192,7 @@ struct ctlr_info {
196192
u64 last_heartbeat_timestamp;
197193
u32 heartbeat_sample_interval;
198194
atomic_t firmware_flash_in_progress;
199-
u32 lockup_detected;
195+
u32 *lockup_detected;
200196
struct delayed_work monitor_ctlr_work;
201197
int remove_in_progress;
202198
u32 fifo_recently_full;
@@ -233,11 +229,9 @@ struct ctlr_info {
233229
#define CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE (1 << 31)
234230

235231
#define RESCAN_REQUIRED_EVENT_BITS \
236-
(CTLR_STATE_CHANGE_EVENT | \
237-
CTLR_ENCLOSURE_HOT_PLUG_EVENT | \
232+
(CTLR_ENCLOSURE_HOT_PLUG_EVENT | \
238233
CTLR_STATE_CHANGE_EVENT_PHYSICAL_DRV | \
239234
CTLR_STATE_CHANGE_EVENT_LOGICAL_DRV | \
240-
CTLR_STATE_CHANGE_EVENT_REDUNDANT_CNTRL | \
241235
CTLR_STATE_CHANGE_EVENT_AIO_ENABLED_DISABLED | \
242236
CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE)
243237
spinlock_t offline_device_lock;
@@ -346,22 +340,23 @@ struct offline_device_entry {
346340
static void SA5_submit_command(struct ctlr_info *h,
347341
struct CommandList *c)
348342
{
349-
dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
350-
c->Header.Tag.lower);
351343
writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
352344
(void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
353345
}
354346

347+
static void SA5_submit_command_no_read(struct ctlr_info *h,
348+
struct CommandList *c)
349+
{
350+
writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
351+
}
352+
355353
static void SA5_submit_command_ioaccel2(struct ctlr_info *h,
356354
struct CommandList *c)
357355
{
358-
dev_dbg(&h->pdev->dev, "Sending %x, tag = %x\n", c->busaddr,
359-
c->Header.Tag.lower);
360356
if (c->cmd_type == CMD_IOACCEL2)
361357
writel(c->busaddr, h->vaddr + IOACCEL2_INBOUND_POSTQ_32);
362358
else
363359
writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
364-
(void) readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
365360
}
366361

367362
/*
@@ -399,7 +394,7 @@ static void SA5_performant_intr_mask(struct ctlr_info *h, unsigned long val)
399394

400395
static unsigned long SA5_performant_completed(struct ctlr_info *h, u8 q)
401396
{
402-
struct reply_pool *rq = &h->reply_queue[q];
397+
struct reply_queue_buffer *rq = &h->reply_queue[q];
403398
unsigned long flags, register_value = FIFO_EMPTY;
404399

405400
/* msi auto clears the interrupt pending bit. */
@@ -478,7 +473,6 @@ static bool SA5_intr_pending(struct ctlr_info *h)
478473
{
479474
unsigned long register_value =
480475
readl(h->vaddr + SA5_INTR_STATUS);
481-
dev_dbg(&h->pdev->dev, "intr_pending %lx\n", register_value);
482476
return register_value & SA5_INTR_PENDING;
483477
}
484478

@@ -515,7 +509,7 @@ static bool SA5_ioaccel_mode1_intr_pending(struct ctlr_info *h)
515509
static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
516510
{
517511
u64 register_value;
518-
struct reply_pool *rq = &h->reply_queue[q];
512+
struct reply_queue_buffer *rq = &h->reply_queue[q];
519513
unsigned long flags;
520514

521515
BUG_ON(q >= h->nreply_queues);
@@ -573,6 +567,14 @@ static struct access_method SA5_performant_access = {
573567
SA5_performant_completed,
574568
};
575569

570+
static struct access_method SA5_performant_access_no_read = {
571+
SA5_submit_command_no_read,
572+
SA5_performant_intr_mask,
573+
SA5_fifo_full,
574+
SA5_performant_intr_pending,
575+
SA5_performant_completed,
576+
};
577+
576578
struct board_type {
577579
u32 board_id;
578580
char *product_name;

drivers/scsi/hpsa_cmd.h

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
#define HPSA_VPD_HEADER_SZ 4
152152

153153
/* Logical volume states */
154-
#define HPSA_VPD_LV_STATUS_UNSUPPORTED -1
154+
#define HPSA_VPD_LV_STATUS_UNSUPPORTED 0xff
155155
#define HPSA_LV_OK 0x0
156156
#define HPSA_LV_UNDERGOING_ERASE 0x0F
157157
#define HPSA_LV_UNDERGOING_RPI 0x12
@@ -238,11 +238,21 @@ struct ReportLUNdata {
238238
u8 LUN[HPSA_MAX_LUN][8];
239239
};
240240

241+
struct ext_report_lun_entry {
242+
u8 lunid[8];
243+
u8 wwid[8];
244+
u8 device_type;
245+
u8 device_flags;
246+
u8 lun_count; /* multi-lun device, how many luns */
247+
u8 redundant_paths;
248+
u32 ioaccel_handle; /* ioaccel1 only uses lower 16 bits */
249+
};
250+
241251
struct ReportExtendedLUNdata {
242252
u8 LUNListLength[4];
243253
u8 extended_response_flag;
244254
u8 reserved[3];
245-
u8 LUN[HPSA_MAX_LUN][24];
255+
struct ext_report_lun_entry LUN[HPSA_MAX_LUN];
246256
};
247257

248258
struct SenseSubsystem_info {
@@ -375,6 +385,7 @@ struct ctlr_info; /* defined in hpsa.h */
375385
* or a bus address.
376386
*/
377387

388+
#define COMMANDLIST_ALIGNMENT 128
378389
struct CommandList {
379390
struct CommandListHeader Header;
380391
struct RequestBlock Request;
@@ -389,21 +400,7 @@ struct CommandList {
389400
struct list_head list;
390401
struct completion *waiting;
391402
void *scsi_cmd;
392-
393-
/* on 64 bit architectures, to get this to be 32-byte-aligned
394-
* it so happens we need PAD_64 bytes of padding, on 32 bit systems,
395-
* we need PAD_32 bytes of padding (see below). This does that.
396-
* If it happens that 64 bit and 32 bit systems need different
397-
* padding, PAD_32 and PAD_64 can be set independently, and.
398-
* the code below will do the right thing.
399-
*/
400-
#define IS_32_BIT ((8 - sizeof(long))/4)
401-
#define IS_64_BIT (!IS_32_BIT)
402-
#define PAD_32 (40)
403-
#define PAD_64 (12)
404-
#define COMMANDLIST_PAD (IS_32_BIT * PAD_32 + IS_64_BIT * PAD_64)
405-
u8 pad[COMMANDLIST_PAD];
406-
};
403+
} __aligned(COMMANDLIST_ALIGNMENT);
407404

408405
/* Max S/G elements in I/O accelerator command */
409406
#define IOACCEL1_MAXSGENTRIES 24
@@ -413,6 +410,7 @@ struct CommandList {
413410
* Structure for I/O accelerator (mode 1) commands.
414411
* Note that this structure must be 128-byte aligned in size.
415412
*/
413+
#define IOACCEL1_COMMANDLIST_ALIGNMENT 128
416414
struct io_accel1_cmd {
417415
u16 dev_handle; /* 0x00 - 0x01 */
418416
u8 reserved1; /* 0x02 */
@@ -440,12 +438,7 @@ struct io_accel1_cmd {
440438
struct vals32 host_addr; /* 0x70 - 0x77 */
441439
u8 CISS_LUN[8]; /* 0x78 - 0x7F */
442440
struct SGDescriptor SG[IOACCEL1_MAXSGENTRIES];
443-
#define IOACCEL1_PAD_64 0
444-
#define IOACCEL1_PAD_32 0
445-
#define IOACCEL1_PAD (IS_32_BIT * IOACCEL1_PAD_32 + \
446-
IS_64_BIT * IOACCEL1_PAD_64)
447-
u8 pad[IOACCEL1_PAD];
448-
};
441+
} __aligned(IOACCEL1_COMMANDLIST_ALIGNMENT);
449442

450443
#define IOACCEL1_FUNCTION_SCSIIO 0x00
451444
#define IOACCEL1_SGLOFFSET 32
@@ -510,14 +503,11 @@ struct io_accel2_scsi_response {
510503
u8 sense_data_buff[32]; /* sense/response data buffer */
511504
};
512505

513-
#define IOACCEL2_64_PAD 76
514-
#define IOACCEL2_32_PAD 76
515-
#define IOACCEL2_PAD (IS_32_BIT * IOACCEL2_32_PAD + \
516-
IS_64_BIT * IOACCEL2_64_PAD)
517506
/*
518507
* Structure for I/O accelerator (mode 2 or m2) commands.
519508
* Note that this structure must be 128-byte aligned in size.
520509
*/
510+
#define IOACCEL2_COMMANDLIST_ALIGNMENT 128
521511
struct io_accel2_cmd {
522512
u8 IU_type; /* IU Type */
523513
u8 direction; /* direction, memtype, and encryption */
@@ -544,8 +534,7 @@ struct io_accel2_cmd {
544534
u32 tweak_upper; /* Encryption tweak, upper 4 bytes */
545535
struct ioaccel2_sg_element sg[IOACCEL2_MAXSGENTRIES];
546536
struct io_accel2_scsi_response error_data;
547-
u8 pad[IOACCEL2_PAD];
548-
};
537+
} __aligned(IOACCEL2_COMMANDLIST_ALIGNMENT);
549538

550539
/*
551540
* defines for Mode 2 command struct
@@ -636,7 +625,7 @@ struct TransTable_struct {
636625
u32 RepQCount;
637626
u32 RepQCtrAddrLow32;
638627
u32 RepQCtrAddrHigh32;
639-
#define MAX_REPLY_QUEUES 8
628+
#define MAX_REPLY_QUEUES 64
640629
struct vals32 RepQAddr[MAX_REPLY_QUEUES];
641630
};
642631

drivers/scsi/lpfc/lpfc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+
* Copyright (C) 2004-2014 Emulex. All rights reserved. *
55
* EMULEX and SLI are trademarks of Emulex. *
66
* www.emulex.com *
77
* Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -640,6 +640,7 @@ struct lpfc_hba {
640640
#define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */
641641
#define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */
642642
#define HBA_FCP_IOQ_FLUSH 0x8000 /* FCP I/O queues being flushed */
643+
#define HBA_FW_DUMP_OP 0x10000 /* Skips fn reset before FW dump */
643644
uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/
644645
struct lpfc_dmabuf slim2p;
645646

drivers/scsi/lpfc/lpfc_attr.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2004-2013 Emulex. All rights reserved. *
4+
* Copyright (C) 2004-2014 Emulex. All rights reserved. *
55
* EMULEX and SLI are trademarks of Emulex. *
66
* www.emulex.com *
77
* Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -919,10 +919,15 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
919919
phba->cfg_sriov_nr_virtfn = 0;
920920
}
921921

922+
if (opcode == LPFC_FW_DUMP)
923+
phba->hba_flag |= HBA_FW_DUMP_OP;
924+
922925
status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE);
923926

924-
if (status != 0)
927+
if (status != 0) {
928+
phba->hba_flag &= ~HBA_FW_DUMP_OP;
925929
return status;
930+
}
926931

927932
/* wait for the device to be quiesced before firmware reset */
928933
msleep(100);
@@ -2364,7 +2369,7 @@ lpfc_oas_tgt_store(struct device *dev, struct device_attribute *attr,
23642369
uint8_t wwpn[WWN_SZ];
23652370
int rc;
23662371

2367-
if (!phba->cfg_EnableXLane)
2372+
if (!phba->cfg_fof)
23682373
return -EPERM;
23692374

23702375
/* count may include a LF at end of string */
@@ -2432,7 +2437,7 @@ lpfc_oas_vpt_store(struct device *dev, struct device_attribute *attr,
24322437
uint8_t wwpn[WWN_SZ];
24332438
int rc;
24342439

2435-
if (!phba->cfg_EnableXLane)
2440+
if (!phba->cfg_fof)
24362441
return -EPERM;
24372442

24382443
/* count may include a LF at end of string */
@@ -2499,7 +2504,7 @@ lpfc_oas_lun_state_store(struct device *dev, struct device_attribute *attr,
24992504
struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
25002505
int val = 0;
25012506

2502-
if (!phba->cfg_EnableXLane)
2507+
if (!phba->cfg_fof)
25032508
return -EPERM;
25042509

25052510
if (!isdigit(buf[0]))
@@ -2565,7 +2570,7 @@ lpfc_oas_lun_state_set(struct lpfc_hba *phba, uint8_t vpt_wwpn[],
25652570

25662571
int rc = 0;
25672572

2568-
if (!phba->cfg_EnableXLane)
2573+
if (!phba->cfg_fof)
25692574
return -EPERM;
25702575

25712576
if (oas_state) {
@@ -2670,7 +2675,7 @@ lpfc_oas_lun_show(struct device *dev, struct device_attribute *attr,
26702675
uint64_t oas_lun;
26712676
int len = 0;
26722677

2673-
if (!phba->cfg_EnableXLane)
2678+
if (!phba->cfg_fof)
26742679
return -EPERM;
26752680

26762681
if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0)
@@ -2716,7 +2721,7 @@ lpfc_oas_lun_store(struct device *dev, struct device_attribute *attr,
27162721
uint64_t scsi_lun;
27172722
ssize_t rc;
27182723

2719-
if (!phba->cfg_EnableXLane)
2724+
if (!phba->cfg_fof)
27202725
return -EPERM;
27212726

27222727
if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0)
@@ -4655,7 +4660,7 @@ LPFC_ATTR_R(EnableXLane, 0, 0, 1, "Enable Express Lane Feature.");
46554660
# 0x0 - 0x7f = CS_CTL field in FC header (high 7 bits)
46564661
# Value range is [0x0,0x7f]. Default value is 0
46574662
*/
4658-
LPFC_ATTR_R(XLanePriority, 0, 0x0, 0x7f, "CS_CTL for Express Lane Feature.");
4663+
LPFC_ATTR_RW(XLanePriority, 0, 0x0, 0x7f, "CS_CTL for Express Lane Feature.");
46594664

46604665
/*
46614666
# lpfc_enable_bg: Enable BlockGuard (Emulex's Implementation of T10-DIF)

drivers/scsi/lpfc/lpfc_bsg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2009-2013 Emulex. All rights reserved. *
4+
* Copyright (C) 2009-2014 Emulex. All rights reserved. *
55
* EMULEX and SLI are trademarks of Emulex. *
66
* www.emulex.com *
77
* *

drivers/scsi/lpfc/lpfc_bsg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2010-2012 Emulex. All rights reserved. *
4+
* Copyright (C) 2010-2014 Emulex. All rights reserved. *
55
* EMULEX and SLI are trademarks of Emulex. *
66
* www.emulex.com *
77
* *

0 commit comments

Comments
 (0)