linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] scsi: aacraid updates
@ 2019-10-15  6:21 balsundar.p
  2019-10-15  6:21 ` [PATCH 1/7] scsi: aacraid: fix illegal IO beyond last LBA balsundar.p
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: balsundar.p @ 2019-10-15  6:21 UTC (permalink / raw)
  To: linux-scsi, jejb; +Cc: aacraid

From: Balsundar P <balsundar.p@microsemi.com>

These patch are based on scsi misc tree

Balsundar P (7):
  scsi: aacraid: Fix illegal data read or write beyond last LBA
  scsi: aacraid: Fixed failure to check IO response and report IO error
  scsi: aacraid: Fixed basecode assert when IOP reset is sent by driver
  scsi: aacraid: setting different timeout for src and thor
  scsi: aacraid: check adapter health before processing IOCTL
  scsi: aacraid: Issued AIF request command after IOP RESET
  scsi: aacraid: Update driver version to 50983

 drivers/scsi/aacraid/aachba.c   | 11 ++++++-----
 drivers/scsi/aacraid/aacraid.h  | 23 ++++++++++++++++------
 drivers/scsi/aacraid/comminit.c |  5 +++++
 drivers/scsi/aacraid/commsup.c  | 21 +++++++++++++++++++-
 drivers/scsi/aacraid/linit.c    | 35 +++++++++++++++++++++++++++------
 drivers/scsi/aacraid/src.c      | 10 ++++++++++
 6 files changed, 87 insertions(+), 18 deletions(-)

-- 
2.18.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/7] scsi: aacraid: fix illegal IO beyond last LBA
  2019-10-15  6:21 [PATCH 0/7] scsi: aacraid updates balsundar.p
@ 2019-10-15  6:21 ` balsundar.p
  2019-10-15  6:21 ` [PATCH 2/7] scsi: aacraid: fixed IO reporting error balsundar.p
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: balsundar.p @ 2019-10-15  6:21 UTC (permalink / raw)
  To: linux-scsi, jejb; +Cc: aacraid

From: Balsundar P <balsundar.p@microsemi.com>

The driver fails to handle data when read or written beyond device
reported LBA, which triggers kernel panic

Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
---
 drivers/scsi/aacraid/aachba.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 0ed3f806ace5..2388143d59f5 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -2467,13 +2467,13 @@ static int aac_read(struct scsi_cmnd * scsicmd)
 		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
 			SAM_STAT_CHECK_CONDITION;
 		set_sense(&dev->fsa_dev[cid].sense_data,
-			  HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE,
+			  ILLEGAL_REQUEST, SENCODE_LBA_OUT_OF_RANGE,
 			  ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0);
 		memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
 		       min_t(size_t, sizeof(dev->fsa_dev[cid].sense_data),
 			     SCSI_SENSE_BUFFERSIZE));
 		scsicmd->scsi_done(scsicmd);
-		return 1;
+		return 0;
 	}
 
 	dprintk((KERN_DEBUG "aac_read[cpu %d]: lba = %llu, t = %ld.\n",
@@ -2559,13 +2559,13 @@ static int aac_write(struct scsi_cmnd * scsicmd)
 		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
 			SAM_STAT_CHECK_CONDITION;
 		set_sense(&dev->fsa_dev[cid].sense_data,
-			  HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE,
+			  ILLEGAL_REQUEST, SENCODE_LBA_OUT_OF_RANGE,
 			  ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0);
 		memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
 		       min_t(size_t, sizeof(dev->fsa_dev[cid].sense_data),
 			     SCSI_SENSE_BUFFERSIZE));
 		scsicmd->scsi_done(scsicmd);
-		return 1;
+		return 0;
 	}
 
 	dprintk((KERN_DEBUG "aac_write[cpu %d]: lba = %llu, t = %ld.\n",
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/7] scsi: aacraid: fixed IO reporting error
  2019-10-15  6:21 [PATCH 0/7] scsi: aacraid updates balsundar.p
  2019-10-15  6:21 ` [PATCH 1/7] scsi: aacraid: fix illegal IO beyond last LBA balsundar.p
@ 2019-10-15  6:21 ` balsundar.p
  2019-10-15  6:22 ` [PATCH 3/7] scsi: aacraid: fixed firmware assert issue balsundar.p
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: balsundar.p @ 2019-10-15  6:21 UTC (permalink / raw)
  To: linux-scsi, jejb; +Cc: aacraid

From: Balsundar P <balsundar.p@microsemi.com>

The problem is the driver detects FastResponse bit set and saves it to
Fib's flags for not to check IO response status, but it never clear it
for next IO. Hence the next IO will pick up FastResponse bit and not
to check the IO response status and fail to report any type IO error
to kernel

Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
---
 drivers/scsi/aacraid/commsup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 2142a649e865..3f268f669cc3 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -232,6 +232,7 @@ struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd)
 	fibptr->type = FSAFS_NTC_FIB_CONTEXT;
 	fibptr->callback_data = NULL;
 	fibptr->callback = NULL;
+	fibptr->flags = 0;
 
 	return fibptr;
 }
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/7] scsi: aacraid: fixed firmware assert issue
  2019-10-15  6:21 [PATCH 0/7] scsi: aacraid updates balsundar.p
  2019-10-15  6:21 ` [PATCH 1/7] scsi: aacraid: fix illegal IO beyond last LBA balsundar.p
  2019-10-15  6:21 ` [PATCH 2/7] scsi: aacraid: fixed IO reporting error balsundar.p
@ 2019-10-15  6:22 ` balsundar.p
  2019-10-15  6:22 ` [PATCH 4/7] scsi: aacraid: setting different timeout for src and thor balsundar.p
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: balsundar.p @ 2019-10-15  6:22 UTC (permalink / raw)
  To: linux-scsi, jejb; +Cc: aacraid

From: Balsundar P <balsundar.p@microsemi.com>

Before issuing IOP reset, INTX mode is selected. This is triggering
MSGU lockup and ended in basecode assert. Use DROP_IO command when
IOP reset is sent in preparation for interrupt mode switch

Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
---
 drivers/scsi/aacraid/aacraid.h  |  1 +
 drivers/scsi/aacraid/comminit.c |  5 +++++
 drivers/scsi/aacraid/src.c      | 10 ++++++++++
 3 files changed, 16 insertions(+)

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 3fa03230f6ba..3fdd4583cbb5 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1673,6 +1673,7 @@ struct aac_dev
 	u8			adapter_shutdown;
 	u32			handle_pci_error;
 	bool			init_reset;
+	u8			soft_reset_support;
 };
 
 #define aac_adapter_interrupt(dev) \
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index d4fcfa1e54e0..f75878d773cf 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -571,6 +571,11 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
 		else
 			dev->sa_firmware = 0;
 
+		if (status[4] & le32_to_cpu(AAC_EXTOPT_SOFT_RESET))
+			dev->soft_reset_support = 1;
+		else
+			dev->soft_reset_support = 0;
+
 		if ((dev->comm_interface == AAC_COMM_MESSAGE) &&
 		    (status[2] > dev->base_size)) {
 			aac_adapter_ioremap(dev, 0);
diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
index 3b66e06726c8..787ec9baebb0 100644
--- a/drivers/scsi/aacraid/src.c
+++ b/drivers/scsi/aacraid/src.c
@@ -733,10 +733,20 @@ static bool aac_is_ctrl_up_and_running(struct aac_dev *dev)
 	return ctrl_up;
 }
 
+static void aac_src_drop_io(struct aac_dev *dev)
+{
+	if (!dev->soft_reset_support)
+		return;
+
+	aac_adapter_sync_cmd(dev, DROP_IO,
+			0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL);
+}
+
 static void aac_notify_fw_of_iop_reset(struct aac_dev *dev)
 {
 	aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS, 0, 0, 0, 0, 0, 0, NULL,
 						NULL, NULL, NULL, NULL);
+	aac_src_drop_io(dev);
 }
 
 static void aac_send_iop_reset(struct aac_dev *dev)
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/7] scsi: aacraid: setting different timeout for src and thor
  2019-10-15  6:21 [PATCH 0/7] scsi: aacraid updates balsundar.p
                   ` (2 preceding siblings ...)
  2019-10-15  6:22 ` [PATCH 3/7] scsi: aacraid: fixed firmware assert issue balsundar.p
@ 2019-10-15  6:22 ` balsundar.p
  2019-10-15  6:22 ` [PATCH 5/7] scsi: aacraid: check adapter health balsundar.p
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: balsundar.p @ 2019-10-15  6:22 UTC (permalink / raw)
  To: linux-scsi, jejb; +Cc: aacraid

From: Balsundar P <balsundar.p@microsemi.com>

Set 180 secs timeout for thor and 60 secs for src controllers

Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
---
 drivers/scsi/aacraid/aachba.c  |  3 ++-
 drivers/scsi/aacraid/aacraid.h |  2 ++
 drivers/scsi/aacraid/linit.c   | 10 +++++++---
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 2388143d59f5..e36608ce937a 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -1477,6 +1477,7 @@ static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd
 	struct aac_srb * srbcmd;
 	u32 flag;
 	u32 timeout;
+	struct aac_dev *dev = fib->dev;
 
 	aac_fib_init(fib);
 	switch(cmd->sc_data_direction){
@@ -1503,7 +1504,7 @@ static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd
 	srbcmd->flags    = cpu_to_le32(flag);
 	timeout = cmd->request->timeout/HZ;
 	if (timeout == 0)
-		timeout = 1;
+		timeout = (dev->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT);
 	srbcmd->timeout  = cpu_to_le32(timeout);  // timeout in seconds
 	srbcmd->retry_limit = 0; /* Obsolete parameter */
 	srbcmd->cdb_size = cpu_to_le32(cmd->cmd_len);
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 3fdd4583cbb5..f76a33cb0259 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -108,6 +108,8 @@ enum {
 #define AAC_BUS_TARGET_LOOP		(AAC_MAX_BUSES * AAC_MAX_TARGETS)
 #define AAC_MAX_NATIVE_SIZE		2048
 #define FW_ERROR_BUFFER_SIZE		512
+#define AAC_SA_TIMEOUT			180
+#define AAC_ARC_TIMEOUT			60
 
 #define get_bus_number(x)	(x/AAC_MAX_TARGETS)
 #define get_target_number(x)	(x%AAC_MAX_TARGETS)
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 644f7f5c61a2..acc0250a4b62 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -392,6 +392,7 @@ static int aac_slave_configure(struct scsi_device *sdev)
 	int chn, tid;
 	unsigned int depth = 0;
 	unsigned int set_timeout = 0;
+	int timeout = 0;
 	bool set_qd_dev_type = false;
 	u8 devtype = 0;
 
@@ -484,10 +485,13 @@ static int aac_slave_configure(struct scsi_device *sdev)
 
 	/*
 	 * Firmware has an individual device recovery time typically
-	 * of 35 seconds, give us a margin.
+	 * of 35 seconds, give us a margin. Thor devices can take longer in
+	 * error recovery, hence different value
 	 */
-	if (set_timeout && sdev->request_queue->rq_timeout < (45 * HZ))
-		blk_queue_rq_timeout(sdev->request_queue, 45*HZ);
+	if (set_timeout) {
+		timeout = aac->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT;
+		blk_queue_rq_timeout(sdev->request_queue, timeout*HZ);
+	}
 
 	if (depth > 256)
 		depth = 256;
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/7] scsi: aacraid: check adapter health
  2019-10-15  6:21 [PATCH 0/7] scsi: aacraid updates balsundar.p
                   ` (3 preceding siblings ...)
  2019-10-15  6:22 ` [PATCH 4/7] scsi: aacraid: setting different timeout for src and thor balsundar.p
@ 2019-10-15  6:22 ` balsundar.p
  2019-10-15  6:22 ` [PATCH 6/7] scsi: aacraid: send AIF request post IOP RESET balsundar.p
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: balsundar.p @ 2019-10-15  6:22 UTC (permalink / raw)
  To: linux-scsi, jejb; +Cc: aacraid

From: Balsundar P <balsundar.p@microsemi.com>

Currently driver waits for the command IOCTL from the firmware
and if the firmware enters nonresponsive state, the driver doesn't
respond till the firmware is responsive again

Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
---
 drivers/scsi/aacraid/linit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index acc0250a4b62..2055307f4f3d 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -613,9 +613,13 @@ static struct device_attribute *aac_dev_attrs[] = {
 static int aac_ioctl(struct scsi_device *sdev, unsigned int cmd,
 		     void __user *arg)
 {
+	int retval;
 	struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
 	if (!capable(CAP_SYS_RAWIO))
 		return -EPERM;
+	retval = aac_adapter_check_health(dev);
+	if (retval)
+		return -EBUSY;
 	return aac_do_ioctl(dev, cmd, arg);
 }
 
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/7] scsi: aacraid: send AIF request post IOP RESET
  2019-10-15  6:21 [PATCH 0/7] scsi: aacraid updates balsundar.p
                   ` (4 preceding siblings ...)
  2019-10-15  6:22 ` [PATCH 5/7] scsi: aacraid: check adapter health balsundar.p
@ 2019-10-15  6:22 ` balsundar.p
  2019-10-15 18:58   ` kbuild test robot
  2019-10-15 18:58   ` [RFC PATCH] scsi: aacraid: aac_schedule_bus_scan() can be static kbuild test robot
  2019-10-15  6:22 ` [PATCH 7/7] scsi: aacraid: bump version balsundar.p
  2019-10-18 23:35 ` [PATCH 0/7] scsi: aacraid updates Martin K. Petersen
  7 siblings, 2 replies; 12+ messages in thread
From: balsundar.p @ 2019-10-15  6:22 UTC (permalink / raw)
  To: linux-scsi, jejb; +Cc: aacraid

From: Balsundar P <balsundar.p@microsemi.com>

After IOP reset completion AIF request command is not issued to the
controller. Driver schedules a worker thread to issue a AIF request
command after IOP reset completion.

Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
---
 drivers/scsi/aacraid/aacraid.h | 18 +++++++++++++-----
 drivers/scsi/aacraid/commsup.c | 20 +++++++++++++++++++-
 drivers/scsi/aacraid/linit.c   | 21 ++++++++++++++++++---
 3 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index f76a33cb0259..17a4e8b8bd00 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1330,7 +1330,7 @@ struct fib {
 #define AAC_DEVTYPE_ARC_RAW		2
 #define AAC_DEVTYPE_NATIVE_RAW		3
 
-#define AAC_SAFW_RESCAN_DELAY		(10 * HZ)
+#define AAC_RESCAN_DELAY		(10 * HZ)
 
 struct aac_hba_map_info {
 	__le32	rmw_nexus;		/* nexus for native HBA devices */
@@ -1603,6 +1603,7 @@ struct aac_dev
 	struct fsa_dev_info	*fsa_dev;
 	struct task_struct	*thread;
 	struct delayed_work	safw_rescan_work;
+	struct delayed_work	src_reinit_aif_worker;
 	int			cardtype;
 	/*
 	 *This lock will protect the two 32-bit
@@ -2647,7 +2648,12 @@ int aac_scan_host(struct aac_dev *dev);
 
 static inline void aac_schedule_safw_scan_worker(struct aac_dev *dev)
 {
-	schedule_delayed_work(&dev->safw_rescan_work, AAC_SAFW_RESCAN_DELAY);
+	schedule_delayed_work(&dev->safw_rescan_work, AAC_RESCAN_DELAY);
+}
+
+static inline void aac_schedule_src_reinit_aif_worker(struct aac_dev *dev)
+{
+	schedule_delayed_work(&dev->src_reinit_aif_worker, AAC_RESCAN_DELAY);
 }
 
 static inline void aac_safw_rescan_worker(struct work_struct *work)
@@ -2661,10 +2667,10 @@ static inline void aac_safw_rescan_worker(struct work_struct *work)
 	aac_scan_host(dev);
 }
 
-static inline void aac_cancel_safw_rescan_worker(struct aac_dev *dev)
+static inline void aac_cancel_rescan_worker(struct aac_dev *dev)
 {
-	if (dev->sa_firmware)
-		cancel_delayed_work_sync(&dev->safw_rescan_work);
+	cancel_delayed_work_sync(&dev->safw_rescan_work);
+	cancel_delayed_work_sync(&dev->src_reinit_aif_worker);
 }
 
 /* SCp.phase values */
@@ -2674,6 +2680,7 @@ static inline void aac_cancel_safw_rescan_worker(struct aac_dev *dev)
 #define AAC_OWNER_FIRMWARE	0x106
 
 void aac_safw_rescan_worker(struct work_struct *work);
+void aac_src_reinit_aif_worker(struct work_struct *work);
 int aac_acquire_irq(struct aac_dev *dev);
 void aac_free_irq(struct aac_dev *dev);
 int aac_setup_safw_adapter(struct aac_dev *dev);
@@ -2731,6 +2738,7 @@ int aac_probe_container(struct aac_dev *dev, int cid);
 int _aac_rx_init(struct aac_dev *dev);
 int aac_rx_select_comm(struct aac_dev *dev, int comm);
 int aac_rx_deliver_producer(struct fib * fib);
+void aac_reinit_aif(struct aac_dev *aac, unsigned int index);
 
 static inline int aac_is_src(struct aac_dev *dev)
 {
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 3f268f669cc3..1c3beea2b3c5 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1464,6 +1464,14 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
 	}
 }
 
+void aac_schedule_bus_scan(struct aac_dev *aac)
+{
+	if (aac->sa_firmware)
+		aac_schedule_safw_scan_worker(aac);
+	else
+		aac_schedule_src_reinit_aif_worker(aac);
+}
+
 static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
 {
 	int index, quirks;
@@ -1639,7 +1647,7 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
 	 */
 	if (!retval && !is_kdump_kernel()) {
 		dev_info(&aac->pdev->dev, "Scheduling bus rescan\n");
-		aac_schedule_safw_scan_worker(aac);
+		aac_schedule_bus_scan(aac);
 	}
 
 	if (jafo) {
@@ -1960,6 +1968,16 @@ int aac_scan_host(struct aac_dev *dev)
 	return rcode;
 }
 
+void aac_src_reinit_aif_worker(struct work_struct *work)
+{
+	struct aac_dev *dev = container_of(to_delayed_work(work),
+				struct aac_dev, src_reinit_aif_worker);
+
+	wait_event(dev->scsi_host_ptr->host_wait,
+			!scsi_host_in_recovery(dev->scsi_host_ptr));
+	aac_reinit_aif(dev, dev->cardtype);
+}
+
 /**
  *	aac_handle_sa_aif	Handle a message from the firmware
  *	@dev: Which adapter this fib is from
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 2055307f4f3d..128ab1af5b7f 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1594,6 +1594,19 @@ static void aac_init_char(void)
 	}
 }
 
+void aac_reinit_aif(struct aac_dev *aac, unsigned int index)
+{
+	/*
+	 * Firmware may send a AIF messages very early and the Driver may had
+	 * ignored as it is not fully ready to process the messages. so send
+	 * AIF to firmware so that if there is any unprocessed events then it
+	 * can be processed now.
+	 */
+	if (aac_drivers[index].quirks & AAC_QUIRK_SRC)
+		aac_intr_normal(aac, 0, 2, 0, NULL);
+
+}
+
 static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	unsigned index = id->driver_data;
@@ -1691,6 +1704,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	mutex_init(&aac->scan_mutex);
 
 	INIT_DELAYED_WORK(&aac->safw_rescan_work, aac_safw_rescan_worker);
+	INIT_DELAYED_WORK(&aac->src_reinit_aif_worker,
+				aac_src_reinit_aif_worker);
 	/*
 	 *	Map in the registers from the adapter.
 	 */
@@ -1881,7 +1896,7 @@ static int aac_suspend(struct pci_dev *pdev, pm_message_t state)
 	struct aac_dev *aac = (struct aac_dev *)shost->hostdata;
 
 	scsi_block_requests(shost);
-	aac_cancel_safw_rescan_worker(aac);
+	aac_cancel_rescan_worker(aac);
 	aac_send_shutdown(aac);
 
 	aac_release_resources(aac);
@@ -1940,7 +1955,7 @@ static void aac_remove_one(struct pci_dev *pdev)
 	struct Scsi_Host *shost = pci_get_drvdata(pdev);
 	struct aac_dev *aac = (struct aac_dev *)shost->hostdata;
 
-	aac_cancel_safw_rescan_worker(aac);
+	aac_cancel_rescan_worker(aac);
 	scsi_remove_host(shost);
 
 	__aac_shutdown(aac);
@@ -1998,7 +2013,7 @@ static pci_ers_result_t aac_pci_error_detected(struct pci_dev *pdev,
 		aac->handle_pci_error = 1;
 
 		scsi_block_requests(aac->scsi_host_ptr);
-		aac_cancel_safw_rescan_worker(aac);
+		aac_cancel_rescan_worker(aac);
 		aac_flush_ios(aac);
 		aac_release_resources(aac);
 
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/7] scsi: aacraid: bump version
  2019-10-15  6:21 [PATCH 0/7] scsi: aacraid updates balsundar.p
                   ` (5 preceding siblings ...)
  2019-10-15  6:22 ` [PATCH 6/7] scsi: aacraid: send AIF request post IOP RESET balsundar.p
@ 2019-10-15  6:22 ` balsundar.p
  2019-10-18 23:35 ` [PATCH 0/7] scsi: aacraid updates Martin K. Petersen
  7 siblings, 0 replies; 12+ messages in thread
From: balsundar.p @ 2019-10-15  6:22 UTC (permalink / raw)
  To: linux-scsi, jejb; +Cc: aacraid

From: Balsundar P <balsundar.p@microsemi.com>

bump version to 50877

Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
---
 drivers/scsi/aacraid/aacraid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 17a4e8b8bd00..e3e4ecbea726 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -85,7 +85,7 @@ enum {
 #define	PMC_GLOBAL_INT_BIT0		0x00000001
 
 #ifndef AAC_DRIVER_BUILD
-# define AAC_DRIVER_BUILD 50877
+# define AAC_DRIVER_BUILD 50983
 # define AAC_DRIVER_BRANCH "-custom"
 #endif
 #define MAXIMUM_NUM_CONTAINERS	32
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 6/7] scsi: aacraid: send AIF request post IOP RESET
  2019-10-15  6:22 ` [PATCH 6/7] scsi: aacraid: send AIF request post IOP RESET balsundar.p
@ 2019-10-15 18:58   ` kbuild test robot
  2019-10-15 18:58   ` [RFC PATCH] scsi: aacraid: aac_schedule_bus_scan() can be static kbuild test robot
  1 sibling, 0 replies; 12+ messages in thread
From: kbuild test robot @ 2019-10-15 18:58 UTC (permalink / raw)
  To: balsundar.p; +Cc: kbuild-all, linux-scsi, jejb, aacraid

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[cannot apply to v5.4-rc3 next-20191014]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/balsundar-p-microsemi-com/scsi-aacraid-updates/20191015-142326
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/scsi/aacraid/commsup.c:1467:6: sparse: sparse: symbol 'aac_schedule_bus_scan' was not declared. Should it be static?
   drivers/scsi/aacraid/commsup.c:2385:5: sparse: sparse: symbol 'aac_send_safw_hostttime' was not declared. Should it be static?
   drivers/scsi/aacraid/commsup.c:2414:5: sparse: sparse: symbol 'aac_send_hosttime' was not declared. Should it be static?
   drivers/scsi/aacraid/commsup.c:599:17: sparse: sparse: context imbalance in 'aac_fib_send' - different lock contexts for basic block
   drivers/scsi/aacraid/commsup.c:754:17: sparse: sparse: context imbalance in 'aac_hba_send' - different lock contexts for basic block
   drivers/scsi/aacraid/commsup.c:1502:32: sparse: sparse: context imbalance in '_aac_reset_adapter' - unexpected unlock

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [RFC PATCH] scsi: aacraid: aac_schedule_bus_scan() can be static
  2019-10-15  6:22 ` [PATCH 6/7] scsi: aacraid: send AIF request post IOP RESET balsundar.p
  2019-10-15 18:58   ` kbuild test robot
@ 2019-10-15 18:58   ` kbuild test robot
  2019-10-18  7:26     ` Balsundar.P
  1 sibling, 1 reply; 12+ messages in thread
From: kbuild test robot @ 2019-10-15 18:58 UTC (permalink / raw)
  To: balsundar.p; +Cc: kbuild-all, linux-scsi, jejb, aacraid


Fixes: ffcdda7d81b4 ("scsi: aacraid: send AIF request post IOP RESET")
Signed-off-by: kbuild test robot <lkp@intel.com>
---
 commsup.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 1c3beea2b3c57..5a8a999606ea3 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1464,7 +1464,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
 	}
 }
 
-void aac_schedule_bus_scan(struct aac_dev *aac)
+static void aac_schedule_bus_scan(struct aac_dev *aac)
 {
 	if (aac->sa_firmware)
 		aac_schedule_safw_scan_worker(aac);

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* RE: [RFC PATCH] scsi: aacraid: aac_schedule_bus_scan() can be static
  2019-10-15 18:58   ` [RFC PATCH] scsi: aacraid: aac_schedule_bus_scan() can be static kbuild test robot
@ 2019-10-18  7:26     ` Balsundar.P
  0 siblings, 0 replies; 12+ messages in thread
From: Balsundar.P @ 2019-10-18  7:26 UTC (permalink / raw)
  To: lkp, balsundar.p; +Cc: kbuild-all, linux-scsi, jejb, aacraid

Acked-by: Balsundar P < Balsundar.P@microchip.com>

-----Original Message-----
From: kbuild test robot <lkp@intel.com> 
Sent: Wednesday, October 16, 2019 00:28
To: balsundar.p@microsemi.com
Cc: kbuild-all@lists.01.org; linux-scsi@vger.kernel.org; jejb@linux.vnet.ibm.com; aacraid@microsemi.com
Subject: [RFC PATCH] scsi: aacraid: aac_schedule_bus_scan() can be static

External E-Mail


Fixes: ffcdda7d81b4 ("scsi: aacraid: send AIF request post IOP RESET")
Signed-off-by: kbuild test robot <lkp@intel.com>
---
 commsup.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 1c3beea2b3c57..5a8a999606ea3 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1464,7 +1464,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
 	}
 }
 
-void aac_schedule_bus_scan(struct aac_dev *aac)
+static void aac_schedule_bus_scan(struct aac_dev *aac)
 {
 	if (aac->sa_firmware)
 		aac_schedule_safw_scan_worker(aac);


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/7] scsi: aacraid updates
  2019-10-15  6:21 [PATCH 0/7] scsi: aacraid updates balsundar.p
                   ` (6 preceding siblings ...)
  2019-10-15  6:22 ` [PATCH 7/7] scsi: aacraid: bump version balsundar.p
@ 2019-10-18 23:35 ` Martin K. Petersen
  7 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2019-10-18 23:35 UTC (permalink / raw)
  To: balsundar.p; +Cc: linux-scsi, jejb, aacraid


Balsundar,

> Balsundar P (7):
>   scsi: aacraid: Fix illegal data read or write beyond last LBA
>   scsi: aacraid: Fixed failure to check IO response and report IO error
>   scsi: aacraid: Fixed basecode assert when IOP reset is sent by driver
>   scsi: aacraid: setting different timeout for src and thor
>   scsi: aacraid: check adapter health before processing IOCTL
>   scsi: aacraid: Issued AIF request command after IOP RESET
>   scsi: aacraid: Update driver version to 50983

Applied to 5.5/scsi-queue.

Zeroday had some additional warnings that were not introduced by this
series. Please review and address those. Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-10-18 23:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15  6:21 [PATCH 0/7] scsi: aacraid updates balsundar.p
2019-10-15  6:21 ` [PATCH 1/7] scsi: aacraid: fix illegal IO beyond last LBA balsundar.p
2019-10-15  6:21 ` [PATCH 2/7] scsi: aacraid: fixed IO reporting error balsundar.p
2019-10-15  6:22 ` [PATCH 3/7] scsi: aacraid: fixed firmware assert issue balsundar.p
2019-10-15  6:22 ` [PATCH 4/7] scsi: aacraid: setting different timeout for src and thor balsundar.p
2019-10-15  6:22 ` [PATCH 5/7] scsi: aacraid: check adapter health balsundar.p
2019-10-15  6:22 ` [PATCH 6/7] scsi: aacraid: send AIF request post IOP RESET balsundar.p
2019-10-15 18:58   ` kbuild test robot
2019-10-15 18:58   ` [RFC PATCH] scsi: aacraid: aac_schedule_bus_scan() can be static kbuild test robot
2019-10-18  7:26     ` Balsundar.P
2019-10-15  6:22 ` [PATCH 7/7] scsi: aacraid: bump version balsundar.p
2019-10-18 23:35 ` [PATCH 0/7] scsi: aacraid updates Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).