All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Brace <don.brace@microchip.com>
To: <Kevin.Barnett@microchip.com>, <scott.teel@microchip.com>,
	<Justin.Lindley@microchip.com>, <scott.benesh@microchip.com>,
	<gerry.morong@microchip.com>, <mahesh.rajashekhara@microchip.com>,
	<mike.mcgowen@microchip.com>, <murthy.bhat@microchip.com>,
	<hch@infradead.org>, <jejb@linux.vnet.ibm.com>,
	<joseph.szczypek@hpe.com>, <POSWALD@suse.com>
Cc: <linux-scsi@vger.kernel.org>
Subject: [PATCH 10/18] smartpqi: update volume size after expansion
Date: Tue, 1 Feb 2022 15:48:38 -0600	[thread overview]
Message-ID: <164375211833.440833.17023155389220583731.stgit@brunhilda.pdev.net> (raw)
In-Reply-To: <164375113574.440833.13174600317115819605.stgit@brunhilda.pdev.net>

From: Mahesh Rajashekhara <mahesh.rajashekhara@microchip.com>

Rescan devices after volume expansion.

After modifying logical volume size, lsblk command still shows up
previous size of logical volume.

When driver gets any event from f/w, driver schedules rescan worker
with delay of 10 seconds.

If array expansion is so quick and gets complete in a second,
driver could not catch logical volume expansion due to worker delay.

Since driver does not detect volume expansion, driver would not call
rescan device to update new size to the OS.

Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Mahesh Rajashekhara <mahesh.rajashekhara@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
---
 drivers/scsi/smartpqi/smartpqi.h      |    1 +
 drivers/scsi/smartpqi/smartpqi_init.c |   20 ++++++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index 81ec5fbf570a..4f6e48854c66 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -1322,6 +1322,7 @@ struct pqi_ctrl_info {
 	bool		controller_online;
 	bool		block_requests;
 	bool		scan_blocked;
+	u8		logical_volume_rescan_needed : 1;
 	u8		inbound_spanning_supported : 1;
 	u8		outbound_spanning_supported : 1;
 	u8		pqi_mode_enabled : 1;
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index ab12507da436..de53180fab9c 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2015,8 +2015,8 @@ static void pqi_dev_info(struct pqi_ctrl_info *ctrl_info,
 
 /* Assumes the SCSI device list lock is held. */
 
-static void pqi_scsi_update_device(struct pqi_scsi_dev *existing_device,
-	struct pqi_scsi_dev *new_device)
+static void pqi_scsi_update_device(struct pqi_ctrl_info *ctrl_info,
+	struct pqi_scsi_dev *existing_device, struct pqi_scsi_dev *new_device)
 {
 	existing_device->device_type = new_device->device_type;
 	existing_device->bus = new_device->bus;
@@ -2026,9 +2026,8 @@ static void pqi_scsi_update_device(struct pqi_scsi_dev *existing_device,
 		existing_device->target_lun_valid = true;
 	}
 
-	if ((existing_device->volume_status == CISS_LV_QUEUED_FOR_EXPANSION ||
-		existing_device->volume_status == CISS_LV_UNDERGOING_EXPANSION) &&
-		new_device->volume_status == CISS_LV_OK)
+	if (pqi_is_logical_device(existing_device) &&
+		ctrl_info->logical_volume_rescan_needed)
 		existing_device->rescan = true;
 
 	/* By definition, the scsi3addr and wwid fields are already the same. */
@@ -2146,7 +2145,7 @@ static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info,
 			 */
 			device->new_device = false;
 			matching_device->device_gone = false;
-			pqi_scsi_update_device(matching_device, device);
+			pqi_scsi_update_device(ctrl_info, matching_device, device);
 			break;
 		case DEVICE_NOT_FOUND:
 			/*
@@ -2218,8 +2217,8 @@ static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info,
 	}
 
 	/*
-	 * Notify the SCSI ML if the queue depth of any existing device has
-	 * changed.
+	 * Notify the SML of any existing device changes such as;
+	 * queue depth, device size.
 	 */
 	list_for_each_entry(device, &ctrl_info->scsi_device_list, scsi_device_list_entry) {
 		if (device->sdev && device->queue_depth != device->advertised_queue_depth) {
@@ -2248,6 +2247,9 @@ static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info,
 			}
 		}
 	}
+
+	ctrl_info->logical_volume_rescan_needed = false;
+
 }
 
 static inline bool pqi_is_supported_device(struct pqi_scsi_dev *device)
@@ -3703,6 +3705,8 @@ static void pqi_event_worker(struct work_struct *work)
 			} else {
 				ack_event = true;
 				rescan_needed = true;
+				if (event->event_type == PQI_EVENT_TYPE_LOGICAL_DEVICE)
+					ctrl_info->logical_volume_rescan_needed = true;
 			}
 			if (ack_event)
 				pqi_acknowledge_event(ctrl_info, event);



  parent reply	other threads:[~2022-02-01 21:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 21:47 [PATCH 00/18] smartpqi updates Don Brace
2022-02-01 21:47 ` [PATCH 01/18] smartpqi: fix rmmod stack trace Don Brace
2022-02-01 21:47 ` [PATCH 02/18] smartpqi: add PCI IDs Don Brace
2022-02-01 21:48 ` [PATCH 03/18] smartpqi: enable SATA NCQ priority in sysfs Don Brace
2022-02-01 21:48 ` [PATCH 04/18] smartpqi: eliminate drive spin down on warm boot Don Brace
2022-02-01 21:48 ` [PATCH 05/18] smartpqi: propagate path failures to SML quickly Don Brace
2022-02-01 21:48 ` [PATCH 06/18] smartpqi: fix a name typo and cleanup code Don Brace
2022-02-01 21:48 ` [PATCH 07/18] smartpqi: fix a typo in func pqi_aio_submit_io Don Brace
2022-02-01 21:48 ` [PATCH 08/18] smartpqi: resolve delay issue with PQI_HZ value Don Brace
2022-02-01 21:48 ` [PATCH 09/18] smartpqi: avoid drive spin-down during suspend Don Brace
2022-02-01 21:48 ` Don Brace [this message]
2022-02-01 21:48 ` [PATCH 11/18] smartpqi: fix kdump issue when ctrl is locked up Don Brace
2022-02-01 21:48 ` [PATCH 12/18] smartpqi: speed up RAID 10 sequential reads Don Brace
2022-02-01 21:48 ` [PATCH 13/18] smartpqi: expose SAS address for SATA drives Don Brace
2022-02-01 21:48 ` [PATCH 14/18] smartpqi: fix NUMA node not updated during init Don Brace
2022-02-01 21:49 ` [PATCH 15/18] smartpqi: fix BUILD_BUG_ON() statements Don Brace
2022-02-01 21:49 ` [PATCH 16/18] smartpqi: fix hibernate and suspend Don Brace
2022-02-01 21:49 ` [PATCH 17/18] smartpqi: fix lsscsi-t SAS addresses Don Brace
2022-02-01 21:49 ` [PATCH 18/18] smartpqi: update version to 2.1.14-035 Don Brace
2022-02-08  4:40 ` [PATCH 00/18] smartpqi updates Martin K. Petersen
2022-02-11 23:25 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=164375211833.440833.17023155389220583731.stgit@brunhilda.pdev.net \
    --to=don.brace@microchip.com \
    --cc=Justin.Lindley@microchip.com \
    --cc=Kevin.Barnett@microchip.com \
    --cc=POSWALD@suse.com \
    --cc=gerry.morong@microchip.com \
    --cc=hch@infradead.org \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=joseph.szczypek@hpe.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mahesh.rajashekhara@microchip.com \
    --cc=mike.mcgowen@microchip.com \
    --cc=murthy.bhat@microchip.com \
    --cc=scott.benesh@microchip.com \
    --cc=scott.teel@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.