All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] megaraid_sas: Update driver version to 07.717.02.00-rc1
@ 2021-05-21 10:25 Chandrakanth Patil
  2021-05-21 10:25 ` [PATCH v2 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware Chandrakanth Patil
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Chandrakanth Patil @ 2021-05-21 10:25 UTC (permalink / raw)
  To: linux-scsi; +Cc: kashyap.desai, sumit.saxena, Chandrakanth Patil

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

This patchset contains few critical fixes and enhancements.

v2:
     - Fixed sparse warnings reported by kbuild test robot in patch3.

Chandrakanth Patil (5):
  megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through
    firmware
  megaraid_sas: Fix the resource leak in case of probe failure
  megaraid_sas: Early detection of VD deletion through RaidMap update
  megaraid_sas: Handle missing interrupts while re-enabling IRQs
  megaraid_sas: Update driver version to 07.717.02.00-rc1

 drivers/scsi/megaraid/megaraid_sas.h        | 16 +++-
 drivers/scsi/megaraid/megaraid_sas_base.c   | 96 +++++++++++++++++++--
 drivers/scsi/megaraid/megaraid_sas_fp.c     |  6 +-
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 18 +++-
 4 files changed, 122 insertions(+), 14 deletions(-)

-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

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

* [PATCH v2 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware
  2021-05-21 10:25 [PATCH v2 0/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
@ 2021-05-21 10:25 ` Chandrakanth Patil
  2021-05-21 10:25 ` [PATCH v2 2/5] megaraid_sas: Fix the resource leak in case of probe failure Chandrakanth Patil
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Chandrakanth Patil @ 2021-05-21 10:25 UTC (permalink / raw)
  To: linux-scsi; +Cc: kashyap.desai, sumit.saxena, Chandrakanth Patil, stable

[-- Attachment #1: Type: text/plain, Size: 1948 bytes --]

Driver issues all non-ReadWrite IOs for TYPE_ENCLOSURE devices through
the fast path with invalid dev handle and fast path inturn directs all
the IOs to the firmware. As firmware stopped handling those IOs from
SAS3.5 generation of controllers (Ventura and its onward generations)
lead to IOs failure.

The driver will issue all the non-ReadWrite IOs for TYPE_ENCLOSURE devices
directly to firmware from SAS3.5 generation of controllers.

Cc: <stable@vger.kernel.org> # v5.11+
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 2221175ae051..cd94a0c81f83 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3203,6 +3203,8 @@ megasas_build_io_fusion(struct megasas_instance *instance,
 {
 	int sge_count;
 	u8  cmd_type;
+	u16 pd_index = 0;
+	u8 drive_type = 0;
 	struct MPI2_RAID_SCSI_IO_REQUEST *io_request = cmd->io_request;
 	struct MR_PRIV_DEVICE *mr_device_priv_data;
 	mr_device_priv_data = scp->device->hostdata;
@@ -3237,8 +3239,12 @@ megasas_build_io_fusion(struct megasas_instance *instance,
 		megasas_build_syspd_fusion(instance, scp, cmd, true);
 		break;
 	case NON_READ_WRITE_SYSPDIO:
-		if (instance->secure_jbod_support ||
-		    mr_device_priv_data->is_tm_capable)
+		pd_index = MEGASAS_PD_INDEX(scp);
+		drive_type = instance->pd_list[pd_index].driveType;
+		if ((instance->secure_jbod_support ||
+		     mr_device_priv_data->is_tm_capable) ||
+		     (instance->adapter_type >= VENTURA_SERIES &&
+		     drive_type == TYPE_ENCLOSURE))
 			megasas_build_syspd_fusion(instance, scp, cmd, false);
 		else
 			megasas_build_syspd_fusion(instance, scp, cmd, true);
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

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

* [PATCH v2 2/5] megaraid_sas: Fix the resource leak in case of probe failure
  2021-05-21 10:25 [PATCH v2 0/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
  2021-05-21 10:25 ` [PATCH v2 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware Chandrakanth Patil
@ 2021-05-21 10:25 ` Chandrakanth Patil
  2021-05-21 10:25 ` [PATCH v2 3/5] megaraid_sas: Early detection of VD deletion through RaidMap update Chandrakanth Patil
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Chandrakanth Patil @ 2021-05-21 10:25 UTC (permalink / raw)
  To: linux-scsi; +Cc: kashyap.desai, sumit.saxena, Chandrakanth Patil

[-- Attachment #1: Type: text/plain, Size: 2243 bytes --]

Driver doesn't cleanup all the allocated resources properly when
scsi_add_host(),megasas_start_aen() function fails during the PCI
device probe.
This patch will cleanup all those resources.

Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c   | 13 +++++++++++++
 drivers/scsi/megaraid/megaraid_sas_fusion.c |  1 +
 2 files changed, 14 insertions(+)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 8ed347eebf07..35b2137e0d1a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -7545,11 +7545,16 @@ static int megasas_probe_one(struct pci_dev *pdev,
 	return 0;
 
 fail_start_aen:
+	instance->unload = 1;
+	scsi_remove_host(instance->host);
 fail_io_attach:
 	megasas_mgmt_info.count--;
 	megasas_mgmt_info.max_index--;
 	megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
 
+	if (instance->requestorId && !instance->skip_heartbeat_timer_del)
+		del_timer_sync(&instance->sriov_heartbeat_timer);
+
 	instance->instancet->disable_intr(instance);
 	megasas_destroy_irqs(instance);
 
@@ -7557,8 +7562,16 @@ static int megasas_probe_one(struct pci_dev *pdev,
 		megasas_release_fusion(instance);
 	else
 		megasas_release_mfi(instance);
+
 	if (instance->msix_vectors)
 		pci_free_irq_vectors(instance->pdev);
+	instance->msix_vectors = 0;
+
+	if (instance->fw_crash_state != UNAVAILABLE)
+		megasas_free_host_crash_buffer(instance);
+
+	if (instance->adapter_type != MFI_SERIES)
+		megasas_fusion_stop_watchdog(instance);
 fail_init_mfi:
 	scsi_host_put(host);
 fail_alloc_instance:
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index cd94a0c81f83..f79c19010c92 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -5272,6 +5272,7 @@ megasas_alloc_fusion_context(struct megasas_instance *instance)
 		if (!fusion->log_to_span) {
 			dev_err(&instance->pdev->dev, "Failed from %s %d\n",
 				__func__, __LINE__);
+			kfree(instance->ctrl_context);
 			return -ENOMEM;
 		}
 	}
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

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

* [PATCH v2 3/5] megaraid_sas: Early detection of VD deletion through RaidMap update
  2021-05-21 10:25 [PATCH v2 0/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
  2021-05-21 10:25 ` [PATCH v2 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware Chandrakanth Patil
  2021-05-21 10:25 ` [PATCH v2 2/5] megaraid_sas: Fix the resource leak in case of probe failure Chandrakanth Patil
@ 2021-05-21 10:25 ` Chandrakanth Patil
  2021-05-21 10:25 ` [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs Chandrakanth Patil
  2021-05-21 10:25 ` [PATCH v2 5/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
  4 siblings, 0 replies; 8+ messages in thread
From: Chandrakanth Patil @ 2021-05-21 10:25 UTC (permalink / raw)
  To: linux-scsi; +Cc: kashyap.desai, sumit.saxena, Chandrakanth Patil

[-- Attachment #1: Type: text/plain, Size: 8627 bytes --]

Consider in a case, when a VD is deleted and the targetID of
that VD is assigned to a newly created VD. If the sequence of
deletion/addition of VD happens very quickly, there is a possibility
that second event(VD add) occurs even before the driver processes the
first event(VD delete).
As event processing is done in deferred context the device list
remains same(but targetID is re-used) so driver will not learn the
VD deletion/additon and IOs meant for older VD will be directed to
new VD which may lead to data corruption.

In new design, driver will detect the deleted VD as soon as possible
based on the RaidMap update and blocks further IOs to that device.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas.h      | 12 ++++
 drivers/scsi/megaraid/megaraid_sas_base.c | 83 ++++++++++++++++++++---
 drivers/scsi/megaraid/megaraid_sas_fp.c   |  6 +-
 3 files changed, 92 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index b5a765b73c76..a43b67299b08 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -2262,6 +2262,15 @@ enum MR_PERF_MODE {
 		 (mode) == MR_LATENCY_PERF_MODE ? "Latency" : \
 		 "Unknown")
 
+enum MEGASAS_LD_TARGET_ID_STATUS {
+	LD_TARGET_ID_INITIAL,
+	LD_TARGET_ID_ACTIVE,
+	LD_TARGET_ID_DELETED,
+};
+
+#define MEGASAS_TARGET_ID(sdev)						\
+	(((sdev->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) + sdev->id)
+
 struct megasas_instance {
 
 	unsigned int *reply_map;
@@ -2326,6 +2335,9 @@ struct megasas_instance {
 	struct megasas_pd_list          pd_list[MEGASAS_MAX_PD];
 	struct megasas_pd_list          local_pd_list[MEGASAS_MAX_PD];
 	u8 ld_ids[MEGASAS_MAX_LD_IDS];
+	u8 ld_tgtid_status[MEGASAS_MAX_LD_IDS];
+	u8 ld_ids_prev[MEGASAS_MAX_LD_IDS];
+	u8 ld_ids_from_raidmap[MEGASAS_MAX_LD_IDS];
 	s8 init_id;
 
 	u16 max_num_sge;
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 35b2137e0d1a..9cb167069ec8 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -141,6 +141,8 @@ static int megasas_register_aen(struct megasas_instance *instance,
 				u32 seq_num, u32 class_locale_word);
 static void megasas_get_pd_info(struct megasas_instance *instance,
 				struct scsi_device *sdev);
+static void
+megasas_set_ld_removed_by_fw(struct megasas_instance *instance);
 
 /*
  * PCI ID table for all supported controllers
@@ -436,6 +438,12 @@ megasas_decode_evt(struct megasas_instance *instance)
 			(class_locale.members.locale),
 			format_class(class_locale.members.class),
 			evt_detail->description);
+
+	if (megasas_dbg_lvl & LD_PD_DEBUG)
+		dev_info(&instance->pdev->dev,
+			 "evt_detail.args.ld.target_id/index %d/%d\n",
+			 evt_detail->args.ld.target_id, evt_detail->args.ld.ld_index);
+
 }
 
 /*
@@ -1779,6 +1787,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
 {
 	struct megasas_instance *instance;
 	struct MR_PRIV_DEVICE *mr_device_priv_data;
+	u32 ld_tgt_id;
 
 	instance = (struct megasas_instance *)
 	    scmd->device->host->hostdata;
@@ -1805,17 +1814,21 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
 		}
 	}
 
-	if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) {
+	mr_device_priv_data = scmd->device->hostdata;
+	if (!mr_device_priv_data ||
+	    (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)) {
 		scmd->result = DID_NO_CONNECT << 16;
 		scmd->scsi_done(scmd);
 		return 0;
 	}
 
-	mr_device_priv_data = scmd->device->hostdata;
-	if (!mr_device_priv_data) {
-		scmd->result = DID_NO_CONNECT << 16;
-		scmd->scsi_done(scmd);
-		return 0;
+	if (MEGASAS_IS_LOGICAL(scmd->device)) {
+		ld_tgt_id = MEGASAS_TARGET_ID(scmd->device);
+		if (instance->ld_tgtid_status[ld_tgt_id] == LD_TARGET_ID_DELETED) {
+			scmd->result = DID_NO_CONNECT << 16;
+			scmd->scsi_done(scmd);
+			return 0;
+		}
 	}
 
 	if (atomic_read(&instance->adprecovery) != MEGASAS_HBA_OPERATIONAL)
@@ -2095,7 +2108,7 @@ static int megasas_slave_configure(struct scsi_device *sdev)
 
 static int megasas_slave_alloc(struct scsi_device *sdev)
 {
-	u16 pd_index = 0;
+	u16 pd_index = 0, ld_tgt_id;
 	struct megasas_instance *instance ;
 	struct MR_PRIV_DEVICE *mr_device_priv_data;
 
@@ -2120,6 +2133,14 @@ static int megasas_slave_alloc(struct scsi_device *sdev)
 					GFP_KERNEL);
 	if (!mr_device_priv_data)
 		return -ENOMEM;
+
+	if (MEGASAS_IS_LOGICAL(sdev)) {
+		ld_tgt_id = MEGASAS_TARGET_ID(sdev);
+		instance->ld_tgtid_status[ld_tgt_id] = LD_TARGET_ID_ACTIVE;
+		if (megasas_dbg_lvl & LD_PD_DEBUG)
+			sdev_printk(KERN_INFO, sdev, "LD target ID %d created.\n", ld_tgt_id);
+	}
+
 	sdev->hostdata = mr_device_priv_data;
 
 	atomic_set(&mr_device_priv_data->r1_ldio_hint,
@@ -2129,6 +2150,19 @@ static int megasas_slave_alloc(struct scsi_device *sdev)
 
 static void megasas_slave_destroy(struct scsi_device *sdev)
 {
+	u16 ld_tgt_id;
+	struct megasas_instance *instance;
+
+	instance = megasas_lookup_instance(sdev->host->host_no);
+
+	if (MEGASAS_IS_LOGICAL(sdev)) {
+		ld_tgt_id = MEGASAS_TARGET_ID(sdev);
+		instance->ld_tgtid_status[ld_tgt_id] = LD_TARGET_ID_DELETED;
+		if (megasas_dbg_lvl & LD_PD_DEBUG)
+			sdev_printk(KERN_INFO, sdev,
+				    "LD target ID %d removed from OS stack\n", ld_tgt_id);
+	}
+
 	kfree(sdev->hostdata);
 	sdev->hostdata = NULL;
 }
@@ -3525,6 +3559,22 @@ megasas_complete_abort(struct megasas_instance *instance,
 	}
 }
 
+static void
+megasas_set_ld_removed_by_fw(struct megasas_instance *instance)
+{
+	uint i;
+
+	for (i = 0; (i < MEGASAS_MAX_LD_IDS); i++) {
+		if (instance->ld_ids_prev[i] != 0xff &&
+		    instance->ld_ids_from_raidmap[i] == 0xff) {
+			if (megasas_dbg_lvl & LD_PD_DEBUG)
+				dev_info(&instance->pdev->dev,
+					 "LD target ID %d removed from RAID map\n", i);
+			instance->ld_tgtid_status[i] = LD_TARGET_ID_DELETED;
+		}
+	}
+}
+
 /**
  * megasas_complete_cmd -	Completes a command
  * @instance:			Adapter soft state
@@ -3687,9 +3737,13 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
 				fusion->fast_path_io = 0;
 			}
 
+			if (instance->adapter_type >= INVADER_SERIES)
+				megasas_set_ld_removed_by_fw(instance);
+
 			megasas_sync_map_info(instance);
 			spin_unlock_irqrestore(instance->host->host_lock,
 					       flags);
+
 			break;
 		}
 		if (opcode == MR_DCMD_CTRL_EVENT_GET_INFO ||
@@ -8831,8 +8885,10 @@ megasas_aen_polling(struct work_struct *work)
 	union megasas_evt_class_locale class_locale;
 	int event_type = 0;
 	u32 seq_num;
+	u16 ld_target_id;
 	int error;
 	u8  dcmd_ret = DCMD_SUCCESS;
+	struct scsi_device *sdev1;
 
 	if (!instance) {
 		printk(KERN_ERR "invalid instance!\n");
@@ -8855,12 +8911,23 @@ megasas_aen_polling(struct work_struct *work)
 			break;
 
 		case MR_EVT_LD_OFFLINE:
-		case MR_EVT_CFG_CLEARED:
 		case MR_EVT_LD_DELETED:
+			ld_target_id = instance->evt_detail->args.ld.target_id;
+			sdev1 = scsi_device_lookup(instance->host,
+						   MEGASAS_MAX_PD_CHANNELS +
+						   (ld_target_id / MEGASAS_MAX_DEV_PER_CHANNEL),
+						   (ld_target_id - MEGASAS_MAX_DEV_PER_CHANNEL),
+						   0);
+			if (sdev1)
+				megasas_remove_scsi_device(sdev1);
+
+			event_type = SCAN_VD_CHANNEL;
+			break;
 		case MR_EVT_LD_CREATED:
 			event_type = SCAN_VD_CHANNEL;
 			break;
 
+		case MR_EVT_CFG_CLEARED:
 		case MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED:
 		case MR_EVT_FOREIGN_CFG_IMPORTED:
 		case MR_EVT_LD_STATE_CHANGE:
diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c
index b6c08d620033..83f69c33b01a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fp.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
@@ -349,6 +349,10 @@ u8 MR_ValidateMapInfo(struct megasas_instance *instance, u64 map_id)
 
 	num_lds = le16_to_cpu(drv_map->raidMap.ldCount);
 
+	memcpy(instance->ld_ids_prev,
+	       instance->ld_ids_from_raidmap,
+	       sizeof(instance->ld_ids_from_raidmap));
+	memset(instance->ld_ids_from_raidmap, 0xff, MEGASAS_MAX_LD_IDS);
 	/*Convert Raid capability values to CPU arch */
 	for (i = 0; (num_lds > 0) && (i < MAX_LOGICAL_DRIVES_EXT); i++) {
 		ld = MR_TargetIdToLdGet(i, drv_map);
@@ -359,7 +363,7 @@ u8 MR_ValidateMapInfo(struct megasas_instance *instance, u64 map_id)
 
 		raid = MR_LdRaidGet(ld, drv_map);
 		le32_to_cpus((u32 *)&raid->capability);
-
+		instance->ld_ids_from_raidmap[i] = i;
 		num_lds--;
 	}
 
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

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

* [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs
  2021-05-21 10:25 [PATCH v2 0/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
                   ` (2 preceding siblings ...)
  2021-05-21 10:25 ` [PATCH v2 3/5] megaraid_sas: Early detection of VD deletion through RaidMap update Chandrakanth Patil
@ 2021-05-21 10:25 ` Chandrakanth Patil
  2021-05-22 16:01     ` kernel test robot
  2021-05-21 10:25 ` [PATCH v2 5/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
  4 siblings, 1 reply; 8+ messages in thread
From: Chandrakanth Patil @ 2021-05-21 10:25 UTC (permalink / raw)
  To: linux-scsi; +Cc: kashyap.desai, sumit.saxena, Chandrakanth Patil, Tomas Henzl

[-- Attachment #1: Type: text/plain, Size: 2314 bytes --]

While reenabling the IRQ after irq poll there may be a small window for
the firmware to post the replies with interrupts raised. In that case,
driver will not see the interrupts which lead to IOs timeout.

This issue hits only when there is a high IOs completion on a single reply
queue, which forces the driver to switch between the interrupt and IRQ
context.

To fix this, driver will process the reply queue one more time after
enabling the IRQ.

Link: https://lore.kernel.org/linux-scsi/20201102072746.27410-1-sreekanth.reddy@broadcom.com/
Cc: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index f79c19010c92..8b8d68e75318 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3745,6 +3745,7 @@ static void megasas_sync_irqs(unsigned long instance_addr)
 		if (irq_ctx->irq_poll_scheduled) {
 			irq_ctx->irq_poll_scheduled = false;
 			enable_irq(irq_ctx->os_irq);
+			complete_cmd_fusion(instance, irq_ctx->MSIxIndex, irq_ctx);
 		}
 	}
 }
@@ -3776,6 +3777,7 @@ int megasas_irqpoll(struct irq_poll *irqpoll, int budget)
 		irq_poll_complete(irqpoll);
 		irq_ctx->irq_poll_scheduled = false;
 		enable_irq(irq_ctx->os_irq);
+		complete_cmd_fusion(instance, irq_ctx->MSIxIndex, irq_ctx);
 	}
 
 	return num_entries;
@@ -3792,6 +3794,7 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr)
 {
 	struct megasas_instance *instance =
 		(struct megasas_instance *)instance_addr;
+	struct megasas_irq_context *irq_ctx = NULL;
 	u32 count, MSIxIndex;
 
 	count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
@@ -3800,8 +3803,10 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr)
 	if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)
 		return;
 
-	for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++)
+	for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) {
+		irq_ctx = &instance->irq_context[MSIxIndex];
 		complete_cmd_fusion(instance, MSIxIndex, NULL);
+	}
 }
 
 /**
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

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

* [PATCH v2 5/5] megaraid_sas: Update driver version to 07.717.02.00-rc1
  2021-05-21 10:25 [PATCH v2 0/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
                   ` (3 preceding siblings ...)
  2021-05-21 10:25 ` [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs Chandrakanth Patil
@ 2021-05-21 10:25 ` Chandrakanth Patil
  4 siblings, 0 replies; 8+ messages in thread
From: Chandrakanth Patil @ 2021-05-21 10:25 UTC (permalink / raw)
  To: linux-scsi; +Cc: kashyap.desai, sumit.saxena, Chandrakanth Patil

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index a43b67299b08..7af2c23652b0 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -21,8 +21,8 @@
 /*
  * MegaRAID SAS Driver meta data
  */
-#define MEGASAS_VERSION				"07.714.04.00-rc1"
-#define MEGASAS_RELDATE				"Apr 14, 2020"
+#define MEGASAS_VERSION				"07.717.02.00-rc1"
+#define MEGASAS_RELDATE				"May 19, 2021"
 
 #define MEGASAS_MSIX_NAME_LEN			32
 
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

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

* Re: [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs
  2021-05-21 10:25 ` [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs Chandrakanth Patil
@ 2021-05-22 16:01     ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-05-22 16:01 UTC (permalink / raw)
  To: Chandrakanth Patil, linux-scsi
  Cc: kbuild-all, kashyap.desai, sumit.saxena, Chandrakanth Patil, Tomas Henzl

[-- Attachment #1: Type: text/plain, Size: 2757 bytes --]

Hi Chandrakanth,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next v5.13-rc2 next-20210521]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Chandrakanth-Patil/megaraid_sas-Update-driver-version-to-07-717-02-00-rc1/20210522-203404
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: i386-randconfig-a001-20210522 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/14f4c308962448ba3ff062098bed88de6acda8ab
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Chandrakanth-Patil/megaraid_sas-Update-driver-version-to-07-717-02-00-rc1/20210522-203404
        git checkout 14f4c308962448ba3ff062098bed88de6acda8ab
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

   drivers/scsi/megaraid/megaraid_sas_fusion.c: In function 'megasas_complete_cmd_dpc_fusion':
>> drivers/scsi/megaraid/megaraid_sas_fusion.c:3797:30: warning: variable 'irq_ctx' set but not used [-Wunused-but-set-variable]
    3797 |  struct megasas_irq_context *irq_ctx = NULL;
         |                              ^~~~~~~


vim +/irq_ctx +3797 drivers/scsi/megaraid/megaraid_sas_fusion.c

  3785	
  3786	/**
  3787	 * megasas_complete_cmd_dpc_fusion -	Completes command
  3788	 * @instance_addr:			Adapter soft state address
  3789	 *
  3790	 * Tasklet to complete cmds
  3791	 */
  3792	static void
  3793	megasas_complete_cmd_dpc_fusion(unsigned long instance_addr)
  3794	{
  3795		struct megasas_instance *instance =
  3796			(struct megasas_instance *)instance_addr;
> 3797		struct megasas_irq_context *irq_ctx = NULL;
  3798		u32 count, MSIxIndex;
  3799	
  3800		count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
  3801	
  3802		/* If we have already declared adapter dead, donot complete cmds */
  3803		if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)
  3804			return;
  3805	
  3806		for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) {
  3807			irq_ctx = &instance->irq_context[MSIxIndex];
  3808			complete_cmd_fusion(instance, MSIxIndex, NULL);
  3809		}
  3810	}
  3811	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40551 bytes --]

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

* Re: [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs
@ 2021-05-22 16:01     ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-05-22 16:01 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2825 bytes --]

Hi Chandrakanth,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next v5.13-rc2 next-20210521]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Chandrakanth-Patil/megaraid_sas-Update-driver-version-to-07-717-02-00-rc1/20210522-203404
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: i386-randconfig-a001-20210522 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/14f4c308962448ba3ff062098bed88de6acda8ab
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Chandrakanth-Patil/megaraid_sas-Update-driver-version-to-07-717-02-00-rc1/20210522-203404
        git checkout 14f4c308962448ba3ff062098bed88de6acda8ab
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

   drivers/scsi/megaraid/megaraid_sas_fusion.c: In function 'megasas_complete_cmd_dpc_fusion':
>> drivers/scsi/megaraid/megaraid_sas_fusion.c:3797:30: warning: variable 'irq_ctx' set but not used [-Wunused-but-set-variable]
    3797 |  struct megasas_irq_context *irq_ctx = NULL;
         |                              ^~~~~~~


vim +/irq_ctx +3797 drivers/scsi/megaraid/megaraid_sas_fusion.c

  3785	
  3786	/**
  3787	 * megasas_complete_cmd_dpc_fusion -	Completes command
  3788	 * @instance_addr:			Adapter soft state address
  3789	 *
  3790	 * Tasklet to complete cmds
  3791	 */
  3792	static void
  3793	megasas_complete_cmd_dpc_fusion(unsigned long instance_addr)
  3794	{
  3795		struct megasas_instance *instance =
  3796			(struct megasas_instance *)instance_addr;
> 3797		struct megasas_irq_context *irq_ctx = NULL;
  3798		u32 count, MSIxIndex;
  3799	
  3800		count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
  3801	
  3802		/* If we have already declared adapter dead, donot complete cmds */
  3803		if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)
  3804			return;
  3805	
  3806		for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) {
  3807			irq_ctx = &instance->irq_context[MSIxIndex];
  3808			complete_cmd_fusion(instance, MSIxIndex, NULL);
  3809		}
  3810	}
  3811	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 40551 bytes --]

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

end of thread, other threads:[~2021-05-22 16:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 10:25 [PATCH v2 0/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
2021-05-21 10:25 ` [PATCH v2 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware Chandrakanth Patil
2021-05-21 10:25 ` [PATCH v2 2/5] megaraid_sas: Fix the resource leak in case of probe failure Chandrakanth Patil
2021-05-21 10:25 ` [PATCH v2 3/5] megaraid_sas: Early detection of VD deletion through RaidMap update Chandrakanth Patil
2021-05-21 10:25 ` [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs Chandrakanth Patil
2021-05-22 16:01   ` kernel test robot
2021-05-22 16:01     ` kernel test robot
2021-05-21 10:25 ` [PATCH v2 5/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.