[PATCH 2/3 Xenial SRU] cxlflash: Add device dependent flags

Tim Gardner tim.gardner at canonical.com
Thu Jun 23 12:18:44 UTC 2016


From: Uma Krishnan <ukrishn at linux.vnet.ibm.com>

BugLink: http://bugs.launchpad.net/bugs/1592114

Device dependent flags are needed to support functions that are specific
to a particular device.

One such case is - some CXL Flash cards need to be notified of device
shutdown. For other CXL devices, this feature does not prove to be
useful yet. Such distinct features need to be identified in the driver
to bypass or invoke specific functionality.

In this patch, a member 'flags' has been added to device dependent
values. These flags will be used and expanded in the future to support
various device specific functions.

Signed-off-by: Uma Krishnan <ukrishn at linux.vnet.ibm.com>
Acked-by: Manoj N. Kumar <manoj at linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs at linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
(cherry picked from linux-next commit 4fecd2767dccfe9aafabc337e08acb7e585171ad)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
 drivers/scsi/cxlflash/main.c | 6 ++++--
 drivers/scsi/cxlflash/main.h | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 087bc92..1348839 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -2280,8 +2280,10 @@ static struct scsi_host_template driver_template = {
 /*
  * Device dependent values
  */
-static struct dev_dependent_vals dev_corsa_vals = { CXLFLASH_MAX_SECTORS };
-static struct dev_dependent_vals dev_flash_gt_vals = { CXLFLASH_MAX_SECTORS };
+static struct dev_dependent_vals dev_corsa_vals = { CXLFLASH_MAX_SECTORS,
+					0ULL };
+static struct dev_dependent_vals dev_flash_gt_vals = { CXLFLASH_MAX_SECTORS,
+					0ULL };
 
 /*
  * PCI device binding table
diff --git a/drivers/scsi/cxlflash/main.h b/drivers/scsi/cxlflash/main.h
index 0faed42..d8238d0 100644
--- a/drivers/scsi/cxlflash/main.h
+++ b/drivers/scsi/cxlflash/main.h
@@ -89,6 +89,7 @@ enum undo_level {
 
 struct dev_dependent_vals {
 	u64 max_sectors;
+	u64 flags;
 };
 
 struct asyc_intr_info {
-- 
1.9.1





More information about the kernel-team mailing list