All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] mpt3sas: Features to enhance driver debugging.
@ 2020-11-24  3:50 Suganath Prabu S
  2020-11-24  3:50 ` [PATCH 1/8] mpt3sas: Sync time stamp periodically between Driver and FW Suganath Prabu S
                   ` (7 more replies)
  0 siblings, 8 replies; 41+ messages in thread
From: Suganath Prabu S @ 2020-11-24  3:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

1. Periodic Time Sync b/w driver and FW.
Periodic time sync sets the time of the FW to be the same as
the time of the Driver (HOST). With Existing driver, time stamp
synchronization occurs only during Driver load and controller
reset. With Patch1 - Period time sync implementation facilitates
driver to sync time stamp periodically with IO_UNIT_CONTROL
request.

2. Persistent support for diag triggers.
mpt3sas driver support Automatic Firmware Diagnostic Buffer
feature. As part of this feature, drivers provide Trigger
from IOCTL and SysFS interface using which user can set/get/
clear triggers. Driver releases Diagnostic buffer registered
with firmware if any trigger gets hit. The triggers set by
user are not persistent across system reboots. As a result
triggers set by user will be lost after each reboot. This
patch set uses Persistent Trigger Pages so that triggers set
by user will not be lost across system reboots.

Suganath Prabu S (8):
  mpt3sas: Sync time stamp periodically between Driver and FW
  mpt3sas: Add persistent trigger pages support
  mpt3sas: Add master triggers persistent Trigger Page
  mpt3sas: Add Event triggers persistent Trigger Page2
  mpt3sas: Add SCSI sense triggers persistent Trigger Page3
  mpt3sas: Add MPI triggers persistent Trigger Page4
  mpt3sas: Handle trigger page support after reset.
  mpt3sas: Update driver version to 36.100.00.00

 drivers/scsi/mpt3sas/mpt3sas_base.c          | 437 ++++++++++-
 drivers/scsi/mpt3sas/mpt3sas_base.h          |  49 +-
 drivers/scsi/mpt3sas/mpt3sas_config.c        | 760 +++++++++++++++++++
 drivers/scsi/mpt3sas/mpt3sas_trigger_pages.h |  95 +++
 4 files changed, 1334 insertions(+), 7 deletions(-)
 create mode 100644 drivers/scsi/mpt3sas/mpt3sas_trigger_pages.h

-- 
2.18.4


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

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

* [PATCH 1/8] mpt3sas: Sync time stamp periodically between Driver and FW
  2020-11-24  3:50 [PATCH 0/8] mpt3sas: Features to enhance driver debugging Suganath Prabu S
@ 2020-11-24  3:50 ` Suganath Prabu S
  2020-11-24  7:46     ` kernel test robot
  2020-11-24  3:50 ` [PATCH 2/8] mpt3sas: Add persistent trigger pages support Suganath Prabu S
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 41+ messages in thread
From: Suganath Prabu S @ 2020-11-24  3:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Issue Description:
In current Driver/FW, the controller timestamp gets updated
with host time during driver load time or when a controller
reset is issued. i.e. when host issues the IOCInit request
message to the HBA FW. This IOCInit message has a field named
'TimeStamp' using which the host updates the controller
timestamp. Over a period, sometimes we may observe controller
time drifting away from host and it is difficult to co-relate
host logs with controller logs with respect to time.
And every time driver cannot issue the IOCInit request message
just for updating the controller timestamp.

Implementation:
Instead of IOCInit, driver sends IO_UNIT_CONTROL Request to
sync time stamp periodically with controller. Timestamp
synchronization interval is specified in 'TimeSyncInterval'
field of Manufacturing Page11 by controller.
TimeSyncInterval - 8 bits
        bits  0-6: Time stamp Synchronization interval value
        bit     7: Time stamp Synchronization interval unit,
                (if this bit is one then Timestamp Synchronization
                interval value is specified in terms of hours else
                Timestamp Synchronization interval value is
                specified in terms of minutes).

Driver sends this IO_UNIT_CONTROL Request message from
watchdog thread (which gets invoked every one second).
Driver keeps tracks of timer using ioc's timestamp_update_count
field. This field value gets incremented whenever the watchdog
thread gets invoked. And whenever this field value is greater
than or equals to the Time stamp Synchronization interval value
then driver sends the IO_UNIT_CONTROL Request message to
controller to update the time stamp and then it resets the
timestamp_update_count field to zero.

Syncing Driver and FW timestamp periodically makes
correlating the FW logs and OS events easier.

Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 93 ++++++++++++++++++++++++++++-
 drivers/scsi/mpt3sas/mpt3sas_base.h | 14 ++++-
 2 files changed, 104 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 93230cd..18d5c3c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -596,6 +596,71 @@ static int mpt3sas_remove_dead_ioc_func(void *arg)
 	return 0;
 }
 
+/**
+ * _base_sync_drv_fw_timestamp - Sync Drive-Fw TimeStamp.
+ * @ioc: Per Adapter Object
+ *
+ * Return nothing.
+ */
+static void _base_sync_drv_fw_timestamp(struct MPT3SAS_ADAPTER *ioc)
+{
+	Mpi26IoUnitControlRequest_t *mpi_request;
+	Mpi26IoUnitControlReply_t *mpi_reply;
+	u16 smid;
+	ktime_t current_time;
+	u64 TimeStamp = 0;
+	u8 issue_reset = 0;
+
+	mutex_lock(&ioc->scsih_cmds.mutex);
+	if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) {
+		ioc_err(ioc, "scsih_cmd in use %s\n", __func__);
+		goto out;
+	}
+	ioc->scsih_cmds.status = MPT3_CMD_PENDING;
+	smid = mpt3sas_base_get_smid(ioc, ioc->scsih_cb_idx);
+	if (!smid) {
+		ioc_err(ioc, "Failed obtaining a smid %s\n", __func__);
+		ioc->scsih_cmds.status = MPT3_CMD_NOT_USED;
+		goto out;
+	}
+	mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
+	ioc->scsih_cmds.smid = smid;
+	memset(mpi_request, 0, sizeof(Mpi26IoUnitControlRequest_t));
+	mpi_request->Function = MPI2_FUNCTION_IO_UNIT_CONTROL;
+	mpi_request->Operation = MPI26_CTRL_OP_SET_IOC_PARAMETER;
+	mpi_request->IOCParameter = MPI26_SET_IOC_PARAMETER_SYNC_TIMESTAMP;
+	current_time = ktime_get_real();
+	TimeStamp = cpu_to_le64(ktime_to_ms(current_time));
+	mpi_request->Reserved7 = (u32) (TimeStamp & 0xFFFFFFFF);
+	mpi_request->IOCParameterValue = (u32) (TimeStamp >> 32);
+	init_completion(&ioc->scsih_cmds.done);
+	ioc->put_smid_default(ioc, smid);
+	dinitprintk(ioc, ioc_info(ioc,
+	    "Io Unit Control Sync TimeStamp (sending), @time %lld ms\n",
+	    TimeStamp));
+	wait_for_completion_timeout(&ioc->scsih_cmds.done,
+		MPT3SAS_TIMESYNC_TIMEOUT_SECONDS*HZ);
+	if (!(ioc->scsih_cmds.status & MPT3_CMD_COMPLETE)) {
+		mpt3sas_check_cmd_timeout(ioc,
+		    ioc->scsih_cmds.status, mpi_request,
+		    sizeof(Mpi2SasIoUnitControlRequest_t)/4, issue_reset);
+		goto issue_host_reset;
+	}
+	if (ioc->scsih_cmds.status & MPT3_CMD_REPLY_VALID) {
+		mpi_reply = ioc->scsih_cmds.reply;
+		dinitprintk(ioc, ioc_info(ioc,
+		    "Io Unit Control sync timestamp (complete): ioc_status(0x%04x), loginfo(0x%08x)\n",
+		    le16_to_cpu(mpi_reply->IOCStatus),
+		    le32_to_cpu(mpi_reply->IOCLogInfo)));
+	}
+issue_host_reset:
+	if (issue_reset)
+		mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER);
+	ioc->scsih_cmds.status = MPT3_CMD_NOT_USED;
+out:
+	mutex_unlock(&ioc->scsih_cmds.mutex);
+}
+
 /**
  * _base_fault_reset_work - workq handling ioc fault conditions
  * @work: input argument, used to derive ioc
@@ -720,7 +785,11 @@ _base_fault_reset_work(struct work_struct *work)
 			return; /* don't rearm timer */
 	}
 	ioc->ioc_coredump_loop = 0;
-
+	if (ioc->time_sync_interval &&
+	    ++ioc->timestamp_update_count >= ioc->time_sync_interval) {
+		ioc->timestamp_update_count = 0;
+		_base_sync_drv_fw_timestamp(ioc);
+	}
 	spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
  rearm_timer:
 	if (ioc->fault_reset_work_q)
@@ -744,6 +813,7 @@ mpt3sas_base_start_watchdog(struct MPT3SAS_ADAPTER *ioc)
 	if (ioc->fault_reset_work_q)
 		return;
 
+	ioc->timestamp_update_count = 0;
 	/* initialize fault polling */
 
 	INIT_DELAYED_WORK(&ioc->fault_reset_work, _base_fault_reset_work);
@@ -4754,7 +4824,24 @@ _base_static_config_pages(struct MPT3SAS_ADAPTER *ioc)
 		else
 			ioc->nvme_abort_timeout = ioc->manu_pg11.NVMeAbortTO;
 	}
-
+	ioc->time_sync_interval =
+	    ioc->manu_pg11.TimeSyncInterval & MPT3SAS_TIMESYNC_MASK;
+	if (ioc->time_sync_interval) {
+		if (ioc->manu_pg11.TimeSyncInterval & MPT3SAS_TIMESYNC_UNIT_MASK)
+			ioc->time_sync_interval =
+			    ioc->time_sync_interval * SECONDS_PER_HOUR;
+		else
+			ioc->time_sync_interval =
+			    ioc->time_sync_interval * SECONDS_PER_MIN;
+		dinitprintk(ioc, ioc_info(ioc,
+		    "Driver-FW TimeSync interval is %d seconds. ManuPg11 TimeSync Unit is in %s\n",
+		    ioc->time_sync_interval, (ioc->manu_pg11.TimeSyncInterval &
+		    MPT3SAS_TIMESYNC_UNIT_MASK) ? "Hour" : "Minute"));
+	} else {
+		if (ioc->is_gen35_ioc)
+			ioc_warn(ioc,
+			    "TimeSync Interval in Manuf page-11 is not enabled. Periodic Time-Sync will be disabled\n");
+	}
 	mpt3sas_config_get_bios_pg2(ioc, &mpi_reply, &ioc->bios_pg2);
 	mpt3sas_config_get_bios_pg3(ioc, &mpi_reply, &ioc->bios_pg3);
 	mpt3sas_config_get_ioc_pg8(ioc, &mpi_reply, &ioc->ioc_pg8);
@@ -6466,6 +6553,8 @@ _base_send_ioc_init(struct MPT3SAS_ADAPTER *ioc)
 		r = -EIO;
 	}
 
+	/* Reset TimeSync Counter*/
+	ioc->timestamp_update_count = 0;
 	return r;
 }
 
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 7dab579..cc4815c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -93,6 +93,14 @@
 /* CoreDump: Default timeout */
 #define MPT3SAS_DEFAULT_COREDUMP_TIMEOUT_SECONDS	(15) /*15 seconds*/
 #define MPT3SAS_COREDUMP_LOOP_DONE                     (0xFF)
+#define MPT3SAS_TIMESYNC_TIMEOUT_SECONDS		(10) /* 10 seconds */
+#define MPT3SAS_TIMESYNC_UPDATE_INTERVAL		(900) /* 15 minutes */
+#define MPT3SAS_TIMESYNC_UNIT_MASK			(0x80) /* bit 7 */
+#define MPT3SAS_TIMESYNC_MASK				(0x7F) /* 0 - 6 bits */
+#define SECONDS_PER_MIN					(60)
+#define SECONDS_PER_HOUR				(3600)
+#define MPT3SAS_COREDUMP_LOOP_DONE			(0xFF)
+#define MPI26_SET_IOC_PARAMETER_SYNC_TIMESTAMP		(0x81)
 
 /*
  * Set MPT3SAS_SG_DEPTH value based on user input.
@@ -405,7 +413,7 @@ struct Mpi2ManufacturingPage11_t {
 	u16	HostTraceBufferMaxSizeKB;	/* 50h */
 	u16	HostTraceBufferMinSizeKB;	/* 52h */
 	u8	CoreDumpTOSec;			/* 54h */
-	u8	Reserved8;			/* 55h */
+	u8	TimeSyncInterval;		/* 55h */
 	u16	Reserved9;			/* 56h */
 	__le32	Reserved10;			/* 58h */
 };
@@ -1113,6 +1121,8 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc);
  * @cpu_msix_table_sz: table size
  * @total_io_cnt: Gives total IO count, used to load balance the interrupts
  * @ioc_coredump_loop: will have non-zero value when FW is in CoreDump state
+ * @timestamp_update_count: Counter to fire timeSync command
+ * time_sync_interval: Time sync interval read from man page 11
  * @high_iops_outstanding: used to load balance the interrupts
  *				within high iops reply queues
  * @msix_load_balance: Enables load balancing of interrupts across
@@ -1308,6 +1318,8 @@ struct MPT3SAS_ADAPTER {
 	MPT3SAS_FLUSH_RUNNING_CMDS schedule_dead_ioc_flush_running_cmds;
 	u32             non_operational_loop;
 	u8              ioc_coredump_loop;
+	u32		timestamp_update_count;
+	u32		time_sync_interval;
 	atomic64_t      total_io_cnt;
 	atomic64_t	high_iops_outstanding;
 	bool            msix_load_balance;
-- 
2.18.4


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

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

* [PATCH 2/8] mpt3sas: Add persistent trigger pages support
  2020-11-24  3:50 [PATCH 0/8] mpt3sas: Features to enhance driver debugging Suganath Prabu S
  2020-11-24  3:50 ` [PATCH 1/8] mpt3sas: Sync time stamp periodically between Driver and FW Suganath Prabu S
@ 2020-11-24  3:50 ` Suganath Prabu S
  2020-11-24  6:34     ` kernel test robot
                     ` (2 more replies)
  2020-11-24  3:50 ` [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page Suganath Prabu S
                   ` (5 subsequent siblings)
  7 siblings, 3 replies; 41+ messages in thread
From: Suganath Prabu S @ 2020-11-24  3:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Problem statement:
User sets the tigger value inorder to collect the IOC's
Host tace buffer automicatically upon detecting the trigger
condition. But the tigger values that the user has set are not
persistent across the system reboot or reload of driver. User
has to set them eveytime upon rebooting, realoding the driver
or when HBA is moved to another system.

Solution:
Inorder to make the user trigger settings persistant, these trigger
values needs to be saved in IOC's pages and IOC provides below pages
to save them,

* Driver Persistent Trigger Page 0 :
    This page is used to know list of trigger types that are enabled
* Driver Persistent Trigger Page 1 :
    This page stores the list of Mater triggers that are enabled
* Driver Persistent Trigger Page 2 :
    This page stores the list of MPI Event Triggers that are enabled
* Driver Persistent Trigger Page 3 :
    This page stores the list of SCSI Sense Triggers that are enabled
* Driver Persistent Trigger Page 4 :
    This page stores the list of IOCStatus-LogInfo Triggers that are
    enabled.

* Whenever user configure the trigger values then driver writes the
  configured trigger values in the corresponding trigger pages.
* During next driver load time, driver reads the trigger values
  from these pages and configures the trigger values accordingly.
* During firmware upload operation,
  * if the newer firmware supports these driver trigger pages
    then driver write backs the configured diag trigger values
    on driver trigger pages of IOC.
  * if the newer firmware doesn't supports these driver trigger
    pages then driver clear the supporting trigger flag so that
    whenever user modifies the trigger values then driver
    won't do any config write operations to driver trigger pages.

Current patch change set:
* During driver load, driver will first read Persistent Trigger Page0.
  - If this page's read operation fails then it means that IOC
    firmware doesn't support these Persistent Trigger Pages, i.e.
    current feature of saving/restoring the tigger values is not
    enabled in the IOC. So, driver can't read/store user trigger values
    from/to Persistent triggers pages.
  - If this Page's read opearation is successful then it means that
    IOC firmware supports storing the trigger values on persistent
    trigger pages. So, driver sets the supports_trigger_pages ioc
    variable to one. On reading this page, driver will get to know
    which are all the trigger types that are enabled before the
    driver load.

* And added below helper functions to read & modify
  Persistent Trigger Page0.
  - mpt3sas_config_get_driver_trigger_pg0 : reads the page,
  - mpt3sas_config_set_driver_trigger_pg0 : writes the page,
  - mpt3sas_config_update_driver_trigger_pg0 :
    When user adds any new trigger values then driver enable
    the corresponding trigger type bit in 'TriggerFlags' field of
    Persistent Trigger Page0 (if it was not enabled before)
    before adding these trigger values to corresponding
    Persistent Trigger type pages.

Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c          |  70 ++++++++++
 drivers/scsi/mpt3sas/mpt3sas_base.h          |   5 +
 drivers/scsi/mpt3sas/mpt3sas_config.c        | 134 +++++++++++++++++++
 drivers/scsi/mpt3sas/mpt3sas_trigger_pages.h |  95 +++++++++++++
 4 files changed, 304 insertions(+)
 create mode 100644 drivers/scsi/mpt3sas/mpt3sas_trigger_pages.h

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 18d5c3c..919070b 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -975,6 +975,20 @@ _base_sas_ioc_info(struct MPT3SAS_ADAPTER *ioc, MPI2DefaultReply_t *mpi_reply,
 
 	if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
 		return;
+	/*
+	 * Older Firmware version doesn't support driver trigger pages.
+	 * So, skip displaying 'config invalid type' type
+	 * of error message.
+	 */
+	if (request_hdr->Function == MPI2_FUNCTION_CONFIG) {
+		Mpi2ConfigRequest_t *rqst = (Mpi2ConfigRequest_t *)request_hdr;
+
+		if ((rqst->ExtPageType ==
+		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER) &&
+		    !(ioc->logging_level & MPT_DEBUG_CONFIG)) {
+			return;
+		}
+	}
 
 	switch (ioc_status) {
 
@@ -4783,6 +4797,58 @@ _base_update_ioc_page1_inlinewith_perf_mode(struct MPT3SAS_ADAPTER *ioc)
 	}
 }
 
+/**
+ * _base_check_for_trigger_pages_support - checks whether HBA FW supports
+ *					driver trigger pages or not
+ * @ioc : per adapter object
+ *
+ * Returns trigger flags mask if HBA FW supports driver trigger pages,
+ * otherwise returns EFAULT.
+ */
+static int
+_base_check_for_trigger_pages_support(struct MPT3SAS_ADAPTER *ioc)
+{
+	Mpi26DriverTriggerPage0_t trigger_pg0;
+	int r = 0;
+	Mpi2ConfigReply_t mpi_reply;
+	u16 ioc_status;
+
+	r = mpt3sas_config_get_driver_trigger_pg0(ioc, &mpi_reply,
+	    &trigger_pg0);
+	if (r)
+		return -EFAULT;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
+		return -EFAULT;
+
+	return le16_to_cpu(trigger_pg0.TriggerFlags);
+}
+
+/**
+ * _base_get_diag_triggers - Retrieve diag trigger values from
+ *				persistent pages.
+ * @ioc : per adapter object
+ *
+ * Return nothing.
+ */
+static void
+_base_get_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
+{
+	u16 trigger_flags;
+
+	/*
+	 * Default setting of master trigger.
+	 */
+	ioc->diag_trigger_master.MasterData =
+	    (MASTER_TRIGGER_FW_FAULT + MASTER_TRIGGER_ADAPTER_RESET);
+	trigger_flags = _base_check_for_trigger_pages_support(ioc);
+	if (trigger_flags < 0)
+		return;
+	ioc->supports_trigger_pages = 1;
+}
+
 /**
  * _base_static_config_pages - static start of day config pages
  * @ioc: per adapter object
@@ -4869,6 +4935,10 @@ _base_static_config_pages(struct MPT3SAS_ADAPTER *ioc)
 		ioc->temp_sensors_count = ioc->iounit_pg8.NumSensors;
 	if (ioc->is_aero_ioc)
 		_base_update_ioc_page1_inlinewith_perf_mode(ioc);
+	if (ioc->is_gen35_ioc) {
+		if (ioc->is_driver_loading)
+			_base_get_diag_triggers(ioc);
+	}
 }
 
 /**
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index cc4815c..83b6308 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -71,6 +71,7 @@
 
 #include "mpt3sas_debug.h"
 #include "mpt3sas_trigger_diag.h"
+#include "mpt3sas_trigger_pages.h"
 
 /* driver versioning info */
 #define MPT3SAS_DRIVER_NAME		"mpt3sas"
@@ -1541,6 +1542,7 @@ struct MPT3SAS_ADAPTER {
 	struct SL_WH_EVENT_TRIGGERS_T diag_trigger_event;
 	struct SL_WH_SCSI_TRIGGERS_T diag_trigger_scsi;
 	struct SL_WH_MPI_TRIGGERS_T diag_trigger_mpi;
+	u8		supports_trigger_pages;
 	void		*device_remove_in_progress;
 	u16		device_remove_in_progress_sz;
 	u8		is_gen35_ioc;
@@ -1817,6 +1819,9 @@ int mpt3sas_config_get_volume_handle(struct MPT3SAS_ADAPTER *ioc, u16 pd_handle,
 	u16 *volume_handle);
 int mpt3sas_config_get_volume_wwid(struct MPT3SAS_ADAPTER *ioc,
 	u16 volume_handle, u64 *wwid);
+int
+mpt3sas_config_get_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page);
 
 /* ctl shared API */
 extern struct device_attribute *mpt3sas_host_attrs[];
diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 4a0ddc7..9f7d4cd 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -1742,6 +1742,140 @@ mpt3sas_config_get_phys_disk_pg0(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigReply_t
 	return r;
 }
 
+/**
+ * mpt3sas_config_get_driver_trigger_pg0 - obtain driver trigger page 0
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_get_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 0;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE0_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_set_driver_trigger_pg0 - write driver trigger page 0
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+_config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 0;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE0_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
+	_config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_update_driver_trigger_pg0 - update driver trigger page 0
+ * @ioc: per adapter object
+ * @trigger_flags: trigger type bit map
+ * @set: set ot clear trigger values
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
+	u16 trigger_flag, bool set)
+{
+	Mpi26DriverTriggerPage0_t tg_pg0;
+	Mpi2ConfigReply_t mpi_reply;
+	int rc;
+	u16 flags, ioc_status;
+
+	rc = mpt3sas_config_get_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
+	if (rc)
+		return rc;
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg0, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		return -EFAULT;
+	}
+
+	if (set)
+		flags = le16_to_cpu(tg_pg0.TriggerFlags) | trigger_flag;
+	else
+		flags = le16_to_cpu(tg_pg0.TriggerFlags) & ~trigger_flag;
+
+	tg_pg0.TriggerFlags = cpu_to_le16(flags);
+
+	rc = _config_set_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
+	if (rc)
+		return rc;
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to update trigger pg0, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		return -EFAULT;
+	}
+
+	return 0;
+}
+
 /**
  * mpt3sas_config_get_volume_handle - returns volume handle for give hidden
  * raid components
diff --git a/drivers/scsi/mpt3sas/mpt3sas_trigger_pages.h b/drivers/scsi/mpt3sas/mpt3sas_trigger_pages.h
new file mode 100644
index 0000000..24e30f3
--- /dev/null
+++ b/drivers/scsi/mpt3sas/mpt3sas_trigger_pages.h
@@ -0,0 +1,95 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+/*
+ * This is the Fusion MPT base driver providing common API layer interface
+ * to store diag trigger values into persistent driver triggers pages
+ * for MPT (Message Passing Technology) based controllers.
+ *
+ * Copyright (C) 2020  Broadcom Inc.
+ *
+ * Authors: Broadcom Inc.
+ * Sreekanth Reddy  <sreekanth.reddy@broadcom.com>
+ *
+ * Send feedback to : MPT-FusionLinux.pdl@broadcom.com)
+ */
+
+#include "mpi/mpi2_cnfg.h"
+
+#ifndef MPI2_TRIGGER_PAGES_H
+#define MPI2_TRIGGER_PAGES_H
+
+#define MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER    (0xE0)
+#define MPI26_DRIVER_TRIGGER_PAGE0_PAGEVERSION               (0x01)
+typedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_0 {
+	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/* 0x00  */
+	U16	TriggerFlags;		/* 0x08  */
+	U16	Reserved0xA;		/* 0x0A */
+	U32	Reserved0xC[61];	/* 0x0C */
+} _MPI26_CONFIG_PAGE_DRIVER_TIGGER_0, Mpi26DriverTriggerPage0_t;
+
+/* Trigger Flags */
+#define  MPI26_DRIVER_TRIGGER0_FLAG_MASTER_TRIGGER_VALID       (0x0001)
+#define  MPI26_DRIVER_TRIGGER0_FLAG_MPI_EVENT_TRIGGER_VALID    (0x0002)
+#define  MPI26_DRIVER_TRIGGER0_FLAG_SCSI_SENSE_TRIGGER_VALID   (0x0004)
+#define  MPI26_DRIVER_TRIGGER0_FLAG_LOGINFO_TRIGGER_VALID      (0x0008)
+
+#define MPI26_DRIVER_TRIGGER_PAGE1_PAGEVERSION               (0x01)
+typedef struct _MPI26_DRIVER_MASTER_TIGGER_ENTRY {
+	U32	MasterTriggerFlags;
+} MPI26_DRIVER_MASTER_TIGGER_ENTRY;
+
+#define MPI26_MAX_MASTER_TRIGGERS                                   (1)
+typedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_1 {
+	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/* 0x00 */
+	U16	NumMasterTrigger;	/* 0x08 */
+	U16	Reserved0xA;		/* 0x0A */
+	MPI26_DRIVER_MASTER_TIGGER_ENTRY MasterTriggers[MPI26_MAX_MASTER_TRIGGERS];	/* 0x0C */
+} MPI26_CONFIG_PAGE_DRIVER_TIGGER_1, Mpi26DriverTriggerPage1_t;
+
+#define MPI26_DRIVER_TRIGGER_PAGE2_PAGEVERSION               (0x01)
+typedef struct _MPI26_DRIVER_MPI_EVENT_TIGGER_ENTRY {
+	U16	MPIEventCode;		/* 0x00 */
+	U16	MPIEventCodeSpecific;	/* 0x02 */
+} MPI26_DRIVER_MPI_EVENT_TIGGER_ENTRY;
+
+#define MPI26_MAX_MPI_EVENT_TRIGGERS                            (20)
+typedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_2 {
+	MPI2_CONFIG_EXTENDED_PAGE_HEADER        Header;	/* 0x00  */
+	U16	NumMPIEventTrigger;     /* 0x08  */
+	U16	Reserved0xA;		/* 0x0A */
+	MPI26_DRIVER_MPI_EVENT_TIGGER_ENTRY MPIEventTriggers[MPI26_MAX_MPI_EVENT_TRIGGERS]; /* 0x0C */
+} MPI26_CONFIG_PAGE_DRIVER_TIGGER_2, Mpi26DriverTriggerPage2_t;
+
+#define MPI26_DRIVER_TRIGGER_PAGE3_PAGEVERSION               (0x01)
+typedef struct _MPI26_DRIVER_SCSI_SENSE_TIGGER_ENTRY {
+	U8     ASCQ;		/* 0x00 */
+	U8     ASC;		/* 0x01 */
+	U8     SenseKey;	/* 0x02 */
+	U8     Reserved;	/* 0x03 */
+} MPI26_DRIVER_SCSI_SENSE_TIGGER_ENTRY;
+
+#define MPI26_MAX_SCSI_SENSE_TRIGGERS                            (20)
+typedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_3 {
+	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/* 0x00  */
+	U16	NumSCSISenseTrigger;			/* 0x08  */
+	U16	Reserved0xA;				/* 0x0A */
+	MPI26_DRIVER_SCSI_SENSE_TIGGER_ENTRY SCSISenseTriggers[MPI26_MAX_SCSI_SENSE_TRIGGERS];	/* 0x0C */
+} MPI26_CONFIG_PAGE_DRIVER_TIGGER_3, Mpi26DriverTriggerPage3_t;
+
+#define MPI26_DRIVER_TRIGGER_PAGE4_PAGEVERSION               (0x01)
+typedef struct _MPI26_DRIVER_IOCSTATUS_LOGINFO_TIGGER_ENTRY {
+	U16        IOCStatus;      /* 0x00 */
+	U16        Reserved;       /* 0x02 */
+	U32        LogInfo;        /* 0x04 */
+} MPI26_DRIVER_IOCSTATUS_LOGINFO_TIGGER_ENTRY;
+
+#define MPI26_MAX_LOGINFO_TRIGGERS                            (20)
+typedef struct _MPI26_CONFIG_PAGE_DRIVER_TIGGER_4 {
+	MPI2_CONFIG_EXTENDED_PAGE_HEADER	Header;	/* 0x00  */
+	U16	NumIOCStatusLogInfoTrigger;		/* 0x08  */
+	U16	Reserved0xA;				/* 0x0A */
+	MPI26_DRIVER_IOCSTATUS_LOGINFO_TIGGER_ENTRY IOCStatusLoginfoTriggers[MPI26_MAX_LOGINFO_TRIGGERS];	/* 0x0C */
+} MPI26_CONFIG_PAGE_DRIVER_TIGGER_4, Mpi26DriverTriggerPage4_t;
+
+#endif
+
-- 
2.18.4


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

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

* [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page
  2020-11-24  3:50 [PATCH 0/8] mpt3sas: Features to enhance driver debugging Suganath Prabu S
  2020-11-24  3:50 ` [PATCH 1/8] mpt3sas: Sync time stamp periodically between Driver and FW Suganath Prabu S
  2020-11-24  3:50 ` [PATCH 2/8] mpt3sas: Add persistent trigger pages support Suganath Prabu S
@ 2020-11-24  3:50 ` Suganath Prabu S
  2020-11-24  7:48     ` kernel test robot
                     ` (2 more replies)
  2020-11-24  3:50 ` [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2 Suganath Prabu S
                   ` (4 subsequent siblings)
  7 siblings, 3 replies; 41+ messages in thread
From: Suganath Prabu S @ 2020-11-24  3:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Description:
Trigger Page 1 is used store information about master triggers.
Below are the master triggers conditions.

Bit[3]  Trigger condition for Device Removal event
Bit[2]  Trigger condition for TM command issued by driver
Bit[1]  Trigger condition for Adapter reset issued by driver
Bit[0]  Trigger condition for IOC Fault state

During driver load:
 If Master trigger type bit is enabled in the Persistent Trigger Page0
 then read the Persistent Trigger Page1 and update the ioc instances
 diag_trigger_master.MasterData with Persistent Trigger Page1's
 MasterTriggerFlags. This will restores the Master trigger type's
 triggers which are enabled before.

When user modifies the Master trigger type triggers:
 When user sets/clears the Master trigger type triggers then driver
 fisrt checks whether IOC firmware supports trigger pages support
 or not. if firmware supports these pages then driver enables the
 Master trigger type bit in Persistent Trigger Page0 (if it was not
 enabled before) and updates the user provided trigger values in
 Persistent Trigger Page1.

Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c   |  46 ++++++++
 drivers/scsi/mpt3sas/mpt3sas_base.h   |   3 +
 drivers/scsi/mpt3sas/mpt3sas_config.c | 151 ++++++++++++++++++++++++++
 3 files changed, 200 insertions(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 919070b..2c13078 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4797,6 +4797,42 @@ _base_update_ioc_page1_inlinewith_perf_mode(struct MPT3SAS_ADAPTER *ioc)
 	}
 }
 
+/**
+ * _base_get_master_diag_triggers - get master diag trigger values from
+ *				persistent pages
+ * @ioc : per adapter object
+ *
+ * Return nothing.
+ */
+static void
+_base_get_master_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
+{
+	Mpi26DriverTriggerPage1_t trigger_pg1;
+	Mpi2ConfigReply_t mpi_reply;
+	int r;
+	u16 ioc_status;
+
+	r = mpt3sas_config_get_driver_trigger_pg1(ioc, &mpi_reply,
+	    &trigger_pg1);
+	if (r)
+		return;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dinitprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg1, ioc_status(0x%04x)\n",
+		   __func__, ioc_status));
+		return;
+	}
+
+	if (le16_to_cpu(trigger_pg1.NumMasterTrigger))
+		ioc->diag_trigger_master.MasterData |=
+		    le32_to_cpu(
+		    trigger_pg1.MasterTriggers[0].MasterTriggerFlags);
+}
+
 /**
  * _base_check_for_trigger_pages_support - checks whether HBA FW supports
  *					driver trigger pages or not
@@ -4843,10 +4879,20 @@ _base_get_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
 	 */
 	ioc->diag_trigger_master.MasterData =
 	    (MASTER_TRIGGER_FW_FAULT + MASTER_TRIGGER_ADAPTER_RESET);
+
 	trigger_flags = _base_check_for_trigger_pages_support(ioc);
 	if (trigger_flags < 0)
 		return;
+
 	ioc->supports_trigger_pages = 1;
+
+	/*
+	 * Retrieve master diag trigger values from driver trigger pg1
+	 * if master trigger bit enabled in TriggerFlags.
+	 */
+	if ((u16)trigger_flags &
+	    MPI26_DRIVER_TRIGGER0_FLAG_MASTER_TRIGGER_VALID)
+		_base_get_master_diag_triggers(ioc);
 }
 
 /**
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 83b6308..9f5983c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -1822,6 +1822,9 @@ int mpt3sas_config_get_volume_wwid(struct MPT3SAS_ADAPTER *ioc,
 int
 mpt3sas_config_get_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page);
+int
+mpt3sas_config_get_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page);
 
 /* ctl shared API */
 extern struct device_attribute *mpt3sas_host_attrs[];
diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 9f7d4cd..86d1643 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -1876,6 +1876,157 @@ mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
 	return 0;
 }
 
+/**
+ * mpt3sas_config_get_driver_trigger_pg1 - obtain driver trigger page 1
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_get_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 1;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE1_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_set_driver_trigger_pg1 - write driver trigger page 1
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+_config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 1;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE1_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
+	_config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_update_driver_trigger_pg1 - update driver trigger page 1
+ * @ioc: per adapter object
+ * @trigger_flags: trigger type bit map
+ * @set: set ot clear trigger values
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
+	struct SL_WH_MASTER_TRIGGER_T *master_tg, bool set)
+{
+	Mpi26DriverTriggerPage1_t tg_pg1;
+	Mpi2ConfigReply_t mpi_reply;
+	int rc;
+	u16 ioc_status;
+
+	rc = mpt3sas_config_update_driver_trigger_pg0(ioc,
+	    MPI26_DRIVER_TRIGGER0_FLAG_MASTER_TRIGGER_VALID, set);
+	if (rc)
+		return rc;
+
+	rc = mpt3sas_config_get_driver_trigger_pg1(ioc, &mpi_reply, &tg_pg1);
+	if (rc)
+		goto out;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg1, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		rc = -EFAULT;
+		goto out;
+	}
+
+	if (set) {
+		tg_pg1.NumMasterTrigger = cpu_to_le16(1);
+		tg_pg1.MasterTriggers[0].MasterTriggerFlags = cpu_to_le32(
+		    master_tg->MasterData);
+	} else {
+		tg_pg1.NumMasterTrigger = 0;
+		tg_pg1.MasterTriggers[0].MasterTriggerFlags = 0;
+	}
+
+	rc = _config_set_driver_trigger_pg1(ioc, &mpi_reply, &tg_pg1);
+	if (rc)
+		goto out;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg1, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		rc = -EFAULT;
+		goto out;
+	}
+
+	return 0;
+
+out:
+	mpt3sas_config_update_driver_trigger_pg0(ioc,
+	    MPI26_DRIVER_TRIGGER0_FLAG_MASTER_TRIGGER_VALID, !set);
+
+	return rc;
+}
+
 /**
  * mpt3sas_config_get_volume_handle - returns volume handle for give hidden
  * raid components
-- 
2.18.4


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

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

* [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2
  2020-11-24  3:50 [PATCH 0/8] mpt3sas: Features to enhance driver debugging Suganath Prabu S
                   ` (2 preceding siblings ...)
  2020-11-24  3:50 ` [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page Suganath Prabu S
@ 2020-11-24  3:50 ` Suganath Prabu S
  2020-11-24  8:40     ` kernel test robot
                     ` (2 more replies)
  2020-11-24  3:50 ` [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3 Suganath Prabu S
                   ` (3 subsequent siblings)
  7 siblings, 3 replies; 41+ messages in thread
From: Suganath Prabu S @ 2020-11-24  3:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Description:
Trigger page2 is used to store information about event triggers.

Persistent Trigger page2 format:

 31     24 23        16 15      8 7         0   Byte
-----------------------------------------------
|PageType  |PageNumber  |Reserved |PageVersion| 0x00
-----------------------------------------------
|Reserved  |ExtPageType |   ExtPageLength     | 0x04
-----------------------------------------------
|     Reserved          | NumMPIEventTriggers | 0x08
-----------------------------------------------
|                 MPIEventTriggerEntries      | 0x0C
|                                             | 0xFC
-----------------------------------------------

NumMPIEventTriggers:
Number of MPI Event Trigger Entries currently stored in this page.
If this is set to zero, there are no valid MPI-Event-Trigger
entries available in this page.

MPIEventTriggerEntry:
- MPIEventCode [15:00]
  MPI Event code specified in MPI-Spec
- MPIEventCodeSpecific [16:31]
  For Event Code “MPI2_EVENT_LOG_ENTRY_ADDED (0x0021)”,
  this field specifies the Log-Entry-Qualifier.
  For all other Event Codes, this field is reserved and not used

Maximum of 20-event trigger entries can be stored in this page.

During driver load:
 If MPIEvent trigger type bit is enabled in the Persistent Trigger Page0
 then read the Persistent Trigger Page2 and update the ioc instances
 diag_trigger_event.EventTriggerEntry with Persistent Trigger Page2's
 MPIEventTriggerEntries. This will restores the MPIEvent trigger type's
 triggers which are enabled before.

When user modifies the MPIEvent trigger type triggers:
 When user sets/clears the MPIEvent trigger type triggers then driver
 fisrt checks whether IOC firmware supports trigger pages support
 or not. if firmware supports these pages then driver enables the
 MPIEvent trigger type bit in Persistent Trigger Page0 (if it was not
 enabled before) and updates the user provided trigger values in
 Persistent Trigger Page2.

Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c   |  60 ++++++++++
 drivers/scsi/mpt3sas/mpt3sas_base.h   |   4 +
 drivers/scsi/mpt3sas/mpt3sas_config.c | 160 ++++++++++++++++++++++++++
 3 files changed, 224 insertions(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 2c13078..19e522a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4797,6 +4797,57 @@ _base_update_ioc_page1_inlinewith_perf_mode(struct MPT3SAS_ADAPTER *ioc)
 	}
 }
 
+/**
+ * _base_get_event_diag_triggers - get event diag trigger values from
+ *				persistent pages
+ * @ioc : per adapter object
+ *
+ * Return nothing.
+ */
+static void
+_base_get_event_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
+{
+	Mpi26DriverTriggerPage2_t trigger_pg2;
+	struct SL_WH_EVENT_TRIGGER_T *event_tg;
+	MPI26_DRIVER_MPI_EVENT_TIGGER_ENTRY *mpi_event_tg;
+	Mpi2ConfigReply_t mpi_reply;
+	int r = 0, i = 0;
+	u16 count = 0;
+	u16 ioc_status;
+
+	r = mpt3sas_config_get_driver_trigger_pg2(ioc, &mpi_reply,
+	    &trigger_pg2);
+	if (r)
+		return;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dinitprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg2, ioc_status(0x%04x)\n",
+		   __func__, ioc_status));
+		return;
+	}
+
+	if (le16_to_cpu(trigger_pg2.NumMPIEventTrigger)) {
+		count = le16_to_cpu(trigger_pg2.NumMPIEventTrigger);
+		count = min_t(u16, NUM_VALID_ENTRIES, count);
+		ioc->diag_trigger_event.ValidEntries = count;
+
+		event_tg = &ioc->diag_trigger_event.EventTriggerEntry[0];
+		mpi_event_tg = &trigger_pg2.MPIEventTriggers[0];
+		for (i = 0; i < count; i++) {
+			event_tg->EventValue = le16_to_cpu(
+			    mpi_event_tg->MPIEventCode);
+			event_tg->LogEntryQualifier = le16_to_cpu(
+			    mpi_event_tg->MPIEventCodeSpecific);
+			event_tg++;
+			mpi_event_tg++;
+		}
+	}
+}
+
 /**
  * _base_get_master_diag_triggers - get master diag trigger values from
  *				persistent pages
@@ -4893,6 +4944,15 @@ _base_get_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
 	if ((u16)trigger_flags &
 	    MPI26_DRIVER_TRIGGER0_FLAG_MASTER_TRIGGER_VALID)
 		_base_get_master_diag_triggers(ioc);
+
+	/*
+	 * Retrieve event diag trigger values from driver trigger pg2
+	 * if event trigger bit enabled in TriggerFlags.
+	 */
+	if ((u16)trigger_flags &
+	    MPI26_DRIVER_TRIGGER0_FLAG_MPI_EVENT_TRIGGER_VALID)
+		_base_get_event_diag_triggers(ioc);
+
 }
 
 /**
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 9f5983c..febd5ec 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -1825,6 +1825,10 @@ mpt3sas_config_get_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
 int
 mpt3sas_config_get_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page);
+int
+mpt3sas_config_get_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage2_t *config_page);
+
 
 /* ctl shared API */
 extern struct device_attribute *mpt3sas_host_attrs[];
diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 86d1643..b4c2b73 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -2027,6 +2027,166 @@ out:
 	return rc;
 }
 
+/**
+ * mpt3sas_config_get_driver_trigger_pg2 - obtain driver trigger page 2
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_get_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage2_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 2;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE2_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_set_driver_trigger_pg2 - write driver trigger page 2
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+_config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage2_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 2;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE2_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
+	_config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_update_driver_trigger_pg2 - update driver trigger page 2
+ * @ioc: per adapter object
+ * @trigger_flags: trigger type bit map
+ * @set: set ot clear trigger values
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_update_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
+	struct SL_WH_EVENT_TRIGGERS_T *event_tg, bool set)
+{
+	Mpi26DriverTriggerPage2_t tg_pg2;
+	Mpi2ConfigReply_t mpi_reply;
+	int rc, i, count;
+	u16 ioc_status;
+
+	rc = mpt3sas_config_update_driver_trigger_pg0(ioc,
+	    MPI26_DRIVER_TRIGGER0_FLAG_MPI_EVENT_TRIGGER_VALID, set);
+	if (rc)
+		return rc;
+
+	rc = mpt3sas_config_get_driver_trigger_pg2(ioc, &mpi_reply, &tg_pg2);
+	if (rc)
+		goto out;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg2, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		rc = -EFAULT;
+		goto out;
+	}
+
+	if (set) {
+		count = event_tg->ValidEntries;
+		tg_pg2.NumMPIEventTrigger = cpu_to_le16(count);
+		for (i = 0; i < count; i++) {
+			tg_pg2.MPIEventTriggers[i].MPIEventCode =
+			    cpu_to_le16(
+			    event_tg->EventTriggerEntry[i].EventValue);
+			tg_pg2.MPIEventTriggers[i].MPIEventCodeSpecific =
+			    cpu_to_le16(
+			    event_tg->EventTriggerEntry[i].LogEntryQualifier);
+		}
+	} else {
+		tg_pg2.NumMPIEventTrigger = 0;
+		memset(&tg_pg2.MPIEventTriggers[0], 0,
+		    NUM_VALID_ENTRIES * sizeof(
+		    MPI26_DRIVER_MPI_EVENT_TIGGER_ENTRY));
+	}
+
+	rc = _config_set_driver_trigger_pg2(ioc, &mpi_reply, &tg_pg2);
+	if (rc)
+		goto out;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg2, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		rc = -EFAULT;
+		goto out;
+	}
+
+	return 0;
+
+out:
+	mpt3sas_config_update_driver_trigger_pg0(ioc,
+	    MPI26_DRIVER_TRIGGER0_FLAG_MPI_EVENT_TRIGGER_VALID, !set);
+
+	return rc;
+}
+
 /**
  * mpt3sas_config_get_volume_handle - returns volume handle for give hidden
  * raid components
-- 
2.18.4


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

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

* [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3
  2020-11-24  3:50 [PATCH 0/8] mpt3sas: Features to enhance driver debugging Suganath Prabu S
                   ` (3 preceding siblings ...)
  2020-11-24  3:50 ` [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2 Suganath Prabu S
@ 2020-11-24  3:50 ` Suganath Prabu S
  2020-11-24  9:52     ` kernel test robot
                     ` (2 more replies)
  2020-11-24  3:50 ` [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4 Suganath Prabu S
                   ` (2 subsequent siblings)
  7 siblings, 3 replies; 41+ messages in thread
From: Suganath Prabu S @ 2020-11-24  3:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Description:
This trigger page3 is used store information about SCSI Sense
triggers.

Persistent Trigger Page-3
------------------------------------------------------------------
| 31         24 23            16 15              8 7         	0|    Byte
------------------------------------------------------------------
| PageType	| PageNumber	 | Reserved	  | PageVersion  |    0x00
------------------------------------------------------------------
| Reserved	| ExtPageType    |          ExtPageLen     	 |    0x04
------------------------------------------------------------------
| Reserved	| NumScsiSense   |         TriggerEntries	 |    0x08
------------------------------------------------------------------
|               ScsiSenseTriggerEntry[0]			 |    0x0C
------------------------------------------------------------------
|                    …	      …                                  |
------------------------------------------------------------------
|               ScsiSenseTriggerEntry[19]			 |    0x58
------------------------------------------------------------------

NumScsiSenseTriggerEntries:
This field indicates number of SCSI Sense trigger entries stored in
this page. Currently driver is supporting a maximum of 20-SCSI Sense
trigger entries.

ScsiSenseTriggerEntry:
-----------------------------------------------
| 31   	  24 23       16 15  	  8 7       0 |
-----------------------------------------------
| Reserved   | SenseKey	 |    ASC   |   ASCQ  |
-----------------------------------------------

ASCQ	 => Additional Sense Code Qualifier
ASC	 => Additional Sense Code
SenseKey => Sense Key values

During driver load:
 If SCSI Sense trigger type bit is enabled in the Persistent
 Trigger Page0 then read the Persistent Trigger Page3 and update the
 ioc instances diag_trigger_scsi.SCSITriggerEntry with Persistent
 Trigger Page3's SCSISenseTriggerEntries. This will restores the
 SCSI sense trigger type's triggers which are enabled before.

When user modifies the SCSI sense trigger type triggers:
 When user sets/clears the SCSI sense trigger type triggers then
 driver first checks whether IOC firmware supports trigger pages
 support or not. if firmware supports these pages then driver enables
 the SCSI sense trigger type bit in Persistent Trigger Page0 (if it
 was not enabled before) and updates the user provided trigger values
 in Persistent Trigger Page3.

Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c   |  59 ++++++++++
 drivers/scsi/mpt3sas/mpt3sas_base.h   |   4 +-
 drivers/scsi/mpt3sas/mpt3sas_config.c | 157 ++++++++++++++++++++++++++
 3 files changed, 219 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 19e522a..75c0c64 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4848,6 +4848,57 @@ _base_get_event_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
 	}
 }
 
+/**
+ * _base_get_scsi_diag_triggers - get scsi diag trigger values from
+ *				persistent pages
+ * @ioc : per adapter object
+ *
+ * Return nothing.
+ */
+static void
+_base_get_scsi_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
+{
+	Mpi26DriverTriggerPage3_t trigger_pg3;
+	struct SL_WH_SCSI_TRIGGER_T *scsi_tg;
+	MPI26_DRIVER_SCSI_SENSE_TIGGER_ENTRY *mpi_scsi_tg;
+	Mpi2ConfigReply_t mpi_reply;
+	int r = 0, i = 0;
+	u16 count = 0;
+	u16 ioc_status;
+
+	r = mpt3sas_config_get_driver_trigger_pg3(ioc, &mpi_reply,
+	    &trigger_pg3);
+	if (r)
+		return;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dinitprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg3, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		return;
+	}
+
+	if (le16_to_cpu(trigger_pg3.NumSCSISenseTrigger)) {
+		count = le16_to_cpu(trigger_pg3.NumSCSISenseTrigger);
+		count = min_t(u16, NUM_VALID_ENTRIES, count);
+		ioc->diag_trigger_scsi.ValidEntries = count;
+
+		scsi_tg = &ioc->diag_trigger_scsi.SCSITriggerEntry[0];
+		mpi_scsi_tg = &trigger_pg3.SCSISenseTriggers[0];
+		for (i = 0; i < count; i++) {
+			scsi_tg->ASCQ = mpi_scsi_tg->ASCQ;
+			scsi_tg->ASC = mpi_scsi_tg->ASC;
+			scsi_tg->SenseKey = mpi_scsi_tg->SenseKey;
+
+			scsi_tg++;
+			mpi_scsi_tg++;
+		}
+	}
+}
+
 /**
  * _base_get_master_diag_triggers - get master diag trigger values from
  *				persistent pages
@@ -4953,6 +5004,14 @@ _base_get_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
 	    MPI26_DRIVER_TRIGGER0_FLAG_MPI_EVENT_TRIGGER_VALID)
 		_base_get_event_diag_triggers(ioc);
 
+	/*
+	 * Retrieve scsi diag trigger values from driver trigger pg3
+	 * if scsi trigger bit enabled in TriggerFlags.
+	 */
+	if ((u16)trigger_flags &
+	    MPI26_DRIVER_TRIGGER0_FLAG_SCSI_SENSE_TRIGGER_VALID)
+		_base_get_scsi_diag_triggers(ioc);
+
 }
 
 /**
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index febd5ec..6c3bc50 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -1828,7 +1828,9 @@ mpt3sas_config_get_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
 int
 mpt3sas_config_get_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage2_t *config_page);
-
+int
+mpt3sas_config_get_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage3_t *config_page);
 
 /* ctl shared API */
 extern struct device_attribute *mpt3sas_host_attrs[];
diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index b4c2b73..98b6a59 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -2187,6 +2187,163 @@ out:
 	return rc;
 }
 
+/**
+ * mpt3sas_config_get_driver_trigger_pg3 - obtain driver trigger page 3
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_get_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage3_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 3;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE3_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_set_driver_trigger_pg3 - write driver trigger page 3
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+_config_set_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage3_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 3;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE3_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
+	_config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_update_driver_trigger_pg3 - update driver trigger page 3
+ * @ioc: per adapter object
+ * @trigger_flags: trigger type bit map
+ * @set: set ot clear trigger values
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_update_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
+	struct SL_WH_SCSI_TRIGGERS_T *scsi_tg, bool set)
+{
+	Mpi26DriverTriggerPage3_t tg_pg3;
+	Mpi2ConfigReply_t mpi_reply;
+	int rc, i, count;
+	u16 ioc_status;
+
+	rc = mpt3sas_config_update_driver_trigger_pg0(ioc,
+	    MPI26_DRIVER_TRIGGER0_FLAG_SCSI_SENSE_TRIGGER_VALID, set);
+	if (rc)
+		return rc;
+
+	rc = mpt3sas_config_get_driver_trigger_pg3(ioc, &mpi_reply, &tg_pg3);
+	if (rc)
+		goto out;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg3, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		return -EFAULT;
+	}
+
+	if (set) {
+		count = scsi_tg->ValidEntries;
+		tg_pg3.NumSCSISenseTrigger = cpu_to_le16(count);
+		for (i = 0; i < count; i++) {
+			tg_pg3.SCSISenseTriggers[i].ASCQ =
+			    scsi_tg->SCSITriggerEntry[i].ASCQ;
+			tg_pg3.SCSISenseTriggers[i].ASC =
+			    scsi_tg->SCSITriggerEntry[i].ASC;
+			tg_pg3.SCSISenseTriggers[i].SenseKey =
+			    scsi_tg->SCSITriggerEntry[i].SenseKey;
+		}
+	} else {
+		tg_pg3.NumSCSISenseTrigger = 0;
+		memset(&tg_pg3.SCSISenseTriggers[0], 0,
+		    NUM_VALID_ENTRIES * sizeof(
+		    MPI26_DRIVER_SCSI_SENSE_TIGGER_ENTRY));
+	}
+
+	rc = _config_set_driver_trigger_pg3(ioc, &mpi_reply, &tg_pg3);
+	if (rc)
+		goto out;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg3, ioc_status(0x%04x)\n",
+		     __func__, ioc_status));
+		return -EFAULT;
+	}
+
+	return 0;
+out:
+	mpt3sas_config_update_driver_trigger_pg0(ioc,
+	    MPI26_DRIVER_TRIGGER0_FLAG_SCSI_SENSE_TRIGGER_VALID, !set);
+
+	return rc;
+}
+
 /**
  * mpt3sas_config_get_volume_handle - returns volume handle for give hidden
  * raid components
-- 
2.18.4


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

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

* [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4
  2020-11-24  3:50 [PATCH 0/8] mpt3sas: Features to enhance driver debugging Suganath Prabu S
                   ` (4 preceding siblings ...)
  2020-11-24  3:50 ` [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3 Suganath Prabu S
@ 2020-11-24  3:50 ` Suganath Prabu S
  2020-11-24 11:03     ` kernel test robot
                     ` (2 more replies)
  2020-11-24  3:50 ` [PATCH 7/8] mpt3sas: Handle trigger page support after reset Suganath Prabu S
  2020-11-24  3:50 ` [PATCH 8/8] mpt3sas: Update driver version to 36.100.00.00 Suganath Prabu S
  7 siblings, 3 replies; 41+ messages in thread
From: Suganath Prabu S @ 2020-11-24  3:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Description:
This trigger page is used store information about
MPI (IOC Status & LogInfo) triggers.

Driver Persistent Trigger Page-4 format:
-------------------------------------------------------
| 31       24 23           16 15         8 7          0|  Byte
-------------------------------------------------------
| PageType   | PageNumber    | Reserved	 | PageVersion |  0x00
--------------------------------------------------------
| Reserved   | ExtPageType   |      ExtPageLength      |  0x04
--------------------------------------------------------
|          Reserved	     | NumMpiTriggerEntries    |  0x08
--------------------------------------------------------
|	      MPITriggerEntry[0]		       |  0x0C
--------------------------------------------------------
|		…                                      |
--------------------------------------------------------
|	     MPITriggerEntry[19]	   	       |  0xA4
--------------------------------------------------------

NumMpiTriggerEntries:
This field indicates number of MPI (IOC Status & LogInfo)
trigger entries stored in this page. Currently driver is supporting
a maximum of 20-MPI trigger entries.

MPITriggerEntry:
-----------------------------------------------------
| 31                    16 15                     0 |
-----------------------------------------------------
|        Reserved         |      IOCStatus	    |
-----------------------------------------------------
|                   IOCLogInfo	                    |
-----------------------------------------------------

IOCStatus  => Status value from the IOC
IOCLogInfo => Specific value that supplements the IOCStatus.

During driver load:
 If MPI trigger type bit is enabled in the Persistent
 Trigger Page0 then read the Persistent Trigger Page4 and update the
 ioc instances diag_trigger_mpi.MPITriggerEntry with Persistent
 Trigger Page4's MPITriggerEntries. This will restores the
 MPI trigger type's triggers which are enabled before.

When user modifies the MPI trigger type triggers:
 When user sets/clears the MPI trigger type triggers then driver
 fisrt checks whether IOC firmware supports trigger pages support
 or not. if firmware supports these pages then driver enables the
 MPI trigger type bit in Persistent Trigger Page0 (if it was not
 enabled before) and updates the user provided trigger values in
 Persistent Trigger Page4.

Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c   |  61 +++++++++-
 drivers/scsi/mpt3sas/mpt3sas_base.h   |   3 +
 drivers/scsi/mpt3sas/mpt3sas_config.c | 158 ++++++++++++++++++++++++++
 3 files changed, 221 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 75c0c64..ee86124 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4899,6 +4899,59 @@ _base_get_scsi_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
 	}
 }
 
+/**
+ * _base_get_mpi_diag_triggers - get mpi diag trigger values from
+ *				persistent pages
+ * @ioc : per adapter object
+ *
+ * Return nothing.
+ */
+static void
+_base_get_mpi_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
+{
+	Mpi26DriverTriggerPage4_t trigger_pg4;
+	struct SL_WH_MPI_TRIGGER_T *status_tg;
+	MPI26_DRIVER_IOCSTATUS_LOGINFO_TIGGER_ENTRY *mpi_status_tg;
+	Mpi2ConfigReply_t mpi_reply;
+	int r = 0, i = 0;
+	u16 count = 0;
+	u16 ioc_status;
+
+	r = mpt3sas_config_get_driver_trigger_pg4(ioc, &mpi_reply,
+	    &trigger_pg4);
+	if (r)
+		return;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dinitprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg4, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		return;
+	}
+
+	if (le16_to_cpu(trigger_pg4.NumIOCStatusLogInfoTrigger)) {
+		count = le16_to_cpu(trigger_pg4.NumIOCStatusLogInfoTrigger);
+		count = min_t(u16, NUM_VALID_ENTRIES, count);
+		ioc->diag_trigger_mpi.ValidEntries = count;
+
+		status_tg = &ioc->diag_trigger_mpi.MPITriggerEntry[0];
+		mpi_status_tg = &trigger_pg4.IOCStatusLoginfoTriggers[0];
+
+		for (i = 0; i < count; i++) {
+			status_tg->IOCStatus = le16_to_cpu(
+			    mpi_status_tg->IOCStatus);
+			status_tg->IocLogInfo = le32_to_cpu(
+			    mpi_status_tg->LogInfo);
+
+			status_tg++;
+			mpi_status_tg++;
+		}
+	}
+}
+
 /**
  * _base_get_master_diag_triggers - get master diag trigger values from
  *				persistent pages
@@ -5011,7 +5064,13 @@ _base_get_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
 	if ((u16)trigger_flags &
 	    MPI26_DRIVER_TRIGGER0_FLAG_SCSI_SENSE_TRIGGER_VALID)
 		_base_get_scsi_diag_triggers(ioc);
-
+	/*
+	 * Retrieve mpi error diag trigger values from driver trigger pg4
+	 * if loginfo trigger bit enabled in TriggerFlags.
+	 */
+	if ((u16)trigger_flags &
+	    MPI26_DRIVER_TRIGGER0_FLAG_LOGINFO_TRIGGER_VALID)
+		_base_get_mpi_diag_triggers(ioc);
 }
 
 /**
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 6c3bc50..6745d79 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -1831,6 +1831,9 @@ mpt3sas_config_get_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
 int
 mpt3sas_config_get_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage3_t *config_page);
+int
+mpt3sas_config_get_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage4_t *config_page);
 
 /* ctl shared API */
 extern struct device_attribute *mpt3sas_host_attrs[];
diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 98b6a59..c3aaaab 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -2344,6 +2344,164 @@ out:
 	return rc;
 }
 
+/**
+ * mpt3sas_config_get_driver_trigger_pg4 - obtain driver trigger page 4
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_get_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage4_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 4;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE4_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_set_driver_trigger_pg4 - write driver trigger page 4
+ * @ioc: per adapter object
+ * @mpi_reply: reply mf payload returned from firmware
+ * @config_page: contents of the config page
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+_config_set_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
+	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage4_t *config_page)
+{
+	Mpi2ConfigRequest_t mpi_request;
+	int r;
+
+	memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
+	mpi_request.Function = MPI2_FUNCTION_CONFIG;
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
+	mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+	mpi_request.ExtPageType =
+	    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
+	mpi_request.Header.PageNumber = 4;
+	mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE4_PAGEVERSION;
+	ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
+	if (r)
+		goto out;
+
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
+	_config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+	mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
+	r = _config_request(ioc, &mpi_request, mpi_reply,
+	    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
+	    sizeof(*config_page));
+ out:
+	return r;
+}
+
+/**
+ * mpt3sas_config_update_driver_trigger_pg4 - update driver trigger page 4
+ * @ioc: per adapter object
+ * @trigger_flags: trigger type bit map
+ * @set: set ot clear trigger values
+ * Context: sleep.
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+int
+mpt3sas_config_update_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
+	struct SL_WH_MPI_TRIGGERS_T *mpi_tg, bool set)
+{
+	Mpi26DriverTriggerPage4_t tg_pg4;
+	Mpi2ConfigReply_t mpi_reply;
+	int rc, i, count;
+	u16 ioc_status;
+
+	rc = mpt3sas_config_update_driver_trigger_pg0(ioc,
+	    MPI26_DRIVER_TRIGGER0_FLAG_LOGINFO_TRIGGER_VALID, set);
+	if (rc)
+		return rc;
+
+	rc = mpt3sas_config_get_driver_trigger_pg4(ioc, &mpi_reply, &tg_pg4);
+	if (rc)
+		goto out;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg4, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		rc = -EFAULT;
+		goto out;
+	}
+
+	if (set) {
+		count = mpi_tg->ValidEntries;
+		tg_pg4.NumIOCStatusLogInfoTrigger = cpu_to_le16(count);
+		for (i = 0; i < count; i++) {
+			tg_pg4.IOCStatusLoginfoTriggers[i].IOCStatus =
+			    cpu_to_le16(mpi_tg->MPITriggerEntry[i].IOCStatus);
+			tg_pg4.IOCStatusLoginfoTriggers[i].LogInfo =
+			    cpu_to_le32(mpi_tg->MPITriggerEntry[i].IocLogInfo);
+		}
+	} else {
+		tg_pg4.NumIOCStatusLogInfoTrigger = 0;
+		memset(&tg_pg4.IOCStatusLoginfoTriggers[0], 0,
+		    NUM_VALID_ENTRIES * sizeof(
+		    MPI26_DRIVER_IOCSTATUS_LOGINFO_TIGGER_ENTRY));
+	}
+
+	rc = _config_set_driver_trigger_pg4(ioc, &mpi_reply, &tg_pg4);
+	if (rc)
+		goto out;
+
+	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
+	    MPI2_IOCSTATUS_MASK;
+	if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+		dcprintk(ioc,
+		    ioc_err(ioc,
+		    "%s: Failed to get trigger pg4, ioc_status(0x%04x)\n",
+		    __func__, ioc_status));
+		rc = -EFAULT;
+		goto out;
+	}
+
+	return 0;
+
+out:
+	mpt3sas_config_update_driver_trigger_pg0(ioc,
+	    MPI26_DRIVER_TRIGGER0_FLAG_LOGINFO_TRIGGER_VALID, !set);
+
+	return rc;
+}
+
 /**
  * mpt3sas_config_get_volume_handle - returns volume handle for give hidden
  * raid components
-- 
2.18.4


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

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

* [PATCH 7/8] mpt3sas: Handle trigger page support after reset.
  2020-11-24  3:50 [PATCH 0/8] mpt3sas: Features to enhance driver debugging Suganath Prabu S
                   ` (5 preceding siblings ...)
  2020-11-24  3:50 ` [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4 Suganath Prabu S
@ 2020-11-24  3:50 ` Suganath Prabu S
  2020-11-24  3:50 ` [PATCH 8/8] mpt3sas: Update driver version to 36.100.00.00 Suganath Prabu S
  7 siblings, 0 replies; 41+ messages in thread
From: Suganath Prabu S @ 2020-11-24  3:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Description:
Handle trigger page support after reset.
Prior to IOC reset, if firmware is not supporting trigger pages
and after reset if driver sees the firmware started supporting
trigger pages. (In case of a reset after firmware
upgrade) then the driver should handle this by writing the
already available trigger data from the driver’s internal data
structure to the corresponding trigger pages NVRAM region and
also update Trigger flags in Trigger Page-0 NVRAM region
accordingly.

Implementation:
Add ioc->supports_trigger_pages, this feature supported flag is
used to determine whether the pages needs update or not. And also
this feature supporting flag needs to be updated for every reset as
it is possible that FW won’t support trigger pages before reset
and start supporting after reset or vice versa.
(In case of FW upgrade or downgrade)

Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 50 ++++++++++++++++++++++++++++-
 drivers/scsi/mpt3sas/mpt3sas_base.h | 12 +++++++
 2 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index ee86124..655f277 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -5073,6 +5073,35 @@ _base_get_diag_triggers(struct MPT3SAS_ADAPTER *ioc)
 		_base_get_mpi_diag_triggers(ioc);
 }
 
+/**
+ * _base_update_diag_trigger_pages - Update the driver trigger pages after
+ *			online FW update, incase updated FW supports driver
+ *			trigger pages.
+ * @ioc : per adapter object
+ *
+ * Return nothing.
+ */
+static void
+_base_update_diag_trigger_pages(struct MPT3SAS_ADAPTER *ioc)
+{
+
+	if (ioc->diag_trigger_master.MasterData)
+		mpt3sas_config_update_driver_trigger_pg1(ioc,
+		    &ioc->diag_trigger_master, 1);
+
+	if (ioc->diag_trigger_event.ValidEntries)
+		mpt3sas_config_update_driver_trigger_pg2(ioc,
+		    &ioc->diag_trigger_event, 1);
+
+	if (ioc->diag_trigger_scsi.ValidEntries)
+		mpt3sas_config_update_driver_trigger_pg3(ioc,
+		    &ioc->diag_trigger_scsi, 1);
+
+	if (ioc->diag_trigger_mpi.ValidEntries)
+		mpt3sas_config_update_driver_trigger_pg4(ioc,
+		    &ioc->diag_trigger_mpi, 1);
+}
+
 /**
  * _base_static_config_pages - static start of day config pages
  * @ioc: per adapter object
@@ -5082,7 +5111,7 @@ _base_static_config_pages(struct MPT3SAS_ADAPTER *ioc)
 {
 	Mpi2ConfigReply_t mpi_reply;
 	u32 iounit_pg1_flags;
-
+	int tg_flags = 0;
 	ioc->nvme_abort_timeout = 30;
 	mpt3sas_config_get_manufacturing_pg0(ioc, &mpi_reply, &ioc->manu_pg0);
 	if (ioc->ir_firmware)
@@ -5162,6 +5191,25 @@ _base_static_config_pages(struct MPT3SAS_ADAPTER *ioc)
 	if (ioc->is_gen35_ioc) {
 		if (ioc->is_driver_loading)
 			_base_get_diag_triggers(ioc);
+		else {
+			/*
+			 * In case of online HBA FW update operation,
+			 * check whether updated FW supports the driver trigger
+			 * pages or not.
+			 * - If previous FW has not supported driver trigger
+			 *   pages and newer FW supports them then update these
+			 *   pages with current diag trigger values.
+			 * - If previous FW has supported driver trigger pages
+			 *   and new FW doesn't support them then disable
+			 *   support_trigger_pages flag.
+			 */
+			tg_flags = _base_check_for_trigger_pages_support(ioc);
+			if (!ioc->supports_trigger_pages && tg_flags != -EFAULT)
+				_base_update_diag_trigger_pages(ioc);
+			else if (ioc->supports_trigger_pages &&
+			    tg_flags == -EFAULT)
+				ioc->supports_trigger_pages = 0;
+		}
 	}
 }
 
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 6745d79..352e6cd 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -1834,6 +1834,18 @@ mpt3sas_config_get_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
 int
 mpt3sas_config_get_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage4_t *config_page);
+int
+mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
+	struct SL_WH_MASTER_TRIGGER_T *master_tg, bool set);
+int
+mpt3sas_config_update_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
+	struct SL_WH_EVENT_TRIGGERS_T *event_tg, bool set);
+int
+mpt3sas_config_update_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
+	struct SL_WH_SCSI_TRIGGERS_T *scsi_tg, bool set);
+int
+mpt3sas_config_update_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
+	struct SL_WH_MPI_TRIGGERS_T *mpi_tg, bool set);
 
 /* ctl shared API */
 extern struct device_attribute *mpt3sas_host_attrs[];
-- 
2.18.4


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

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

* [PATCH 8/8] mpt3sas: Update driver version to 36.100.00.00
  2020-11-24  3:50 [PATCH 0/8] mpt3sas: Features to enhance driver debugging Suganath Prabu S
                   ` (6 preceding siblings ...)
  2020-11-24  3:50 ` [PATCH 7/8] mpt3sas: Handle trigger page support after reset Suganath Prabu S
@ 2020-11-24  3:50 ` Suganath Prabu S
  7 siblings, 0 replies; 41+ messages in thread
From: Suganath Prabu S @ 2020-11-24  3:50 UTC (permalink / raw)
  To: linux-scsi, martin.petersen
  Cc: Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Update driver version to 36.100.00.00

Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 352e6cd..2def7a3 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -77,9 +77,9 @@
 #define MPT3SAS_DRIVER_NAME		"mpt3sas"
 #define MPT3SAS_AUTHOR "Avago Technologies <MPT-FusionLinux.pdl@avagotech.com>"
 #define MPT3SAS_DESCRIPTION	"LSI MPT Fusion SAS 3.0 Device Driver"
-#define MPT3SAS_DRIVER_VERSION		"35.101.00.00"
-#define MPT3SAS_MAJOR_VERSION		35
-#define MPT3SAS_MINOR_VERSION		101
+#define MPT3SAS_DRIVER_VERSION		"36.100.00.00"
+#define MPT3SAS_MAJOR_VERSION		36
+#define MPT3SAS_MINOR_VERSION		100
 #define MPT3SAS_BUILD_VERSION		0
 #define MPT3SAS_RELEASE_VERSION	00
 
-- 
2.18.4


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

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

* Re: [PATCH 2/8] mpt3sas: Add persistent trigger pages support
  2020-11-24  3:50 ` [PATCH 2/8] mpt3sas: Add persistent trigger pages support Suganath Prabu S
@ 2020-11-24  6:34     ` kernel test robot
  2020-11-24  8:41     ` kernel test robot
  2020-11-24  8:41     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  6:34 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/6ef897d0859c5415dc82c174e1f2a83b286e9ae2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 6ef897d0859c5415dc82c174e1f2a83b286e9ae2
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg0 +1793 drivers/scsi/mpt3sas/mpt3sas_config.c

  1782	
  1783	/**
  1784	 * mpt3sas_config_set_driver_trigger_pg0 - write driver trigger page 0
  1785	 * @ioc: per adapter object
  1786	 * @mpi_reply: reply mf payload returned from firmware
  1787	 * @config_page: contents of the config page
  1788	 * Context: sleep.
  1789	 *
  1790	 * Returns 0 for success, non-zero for failure.
  1791	 */
  1792	int
> 1793	_config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  1794		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page)
  1795	{
  1796		Mpi2ConfigRequest_t mpi_request;
  1797		int r;
  1798	
  1799		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  1800		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  1801		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  1802		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  1803		mpi_request.ExtPageType =
  1804		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  1805		mpi_request.Header.PageNumber = 0;
  1806		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE0_PAGEVERSION;
  1807		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  1808		r = _config_request(ioc, &mpi_request, mpi_reply,
  1809		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  1810		if (r)
  1811			goto out;
  1812	
  1813		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  1814		_config_request(ioc, &mpi_request, mpi_reply,
  1815		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1816		    sizeof(*config_page));
  1817		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  1818		r = _config_request(ioc, &mpi_request, mpi_reply,
  1819		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1820		    sizeof(*config_page));
  1821	 out:
  1822		return r;
  1823	}
  1824	
  1825	/**
  1826	 * mpt3sas_config_update_driver_trigger_pg0 - update driver trigger page 0
  1827	 * @ioc: per adapter object
  1828	 * @trigger_flags: trigger type bit map
  1829	 * @set: set ot clear trigger values
  1830	 * Context: sleep.
  1831	 *
  1832	 * Returns 0 for success, non-zero for failure.
  1833	 */
  1834	int
> 1835	mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  1836		u16 trigger_flag, bool set)
  1837	{
  1838		Mpi26DriverTriggerPage0_t tg_pg0;
  1839		Mpi2ConfigReply_t mpi_reply;
  1840		int rc;
  1841		u16 flags, ioc_status;
  1842	
  1843		rc = mpt3sas_config_get_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
  1844		if (rc)
  1845			return rc;
  1846		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
  1847		    MPI2_IOCSTATUS_MASK;
  1848		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
  1849			dcprintk(ioc,
  1850			    ioc_err(ioc,
  1851			    "%s: Failed to get trigger pg0, ioc_status(0x%04x)\n",
  1852			    __func__, ioc_status));
  1853			return -EFAULT;
  1854		}
  1855	
  1856		if (set)
  1857			flags = le16_to_cpu(tg_pg0.TriggerFlags) | trigger_flag;
  1858		else
  1859			flags = le16_to_cpu(tg_pg0.TriggerFlags) & ~trigger_flag;
  1860	
  1861		tg_pg0.TriggerFlags = cpu_to_le16(flags);
  1862	
  1863		rc = _config_set_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
  1864		if (rc)
  1865			return rc;
  1866		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
  1867		    MPI2_IOCSTATUS_MASK;
  1868		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
  1869			dcprintk(ioc,
  1870			    ioc_err(ioc,
  1871			    "%s: Failed to update trigger pg0, ioc_status(0x%04x)\n",
  1872			    __func__, ioc_status));
  1873			return -EFAULT;
  1874		}
  1875	
  1876		return 0;
  1877	}
  1878	

---
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: 45542 bytes --]

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

* Re: [PATCH 2/8] mpt3sas: Add persistent trigger pages support
@ 2020-11-24  6:34     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  6:34 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/6ef897d0859c5415dc82c174e1f2a83b286e9ae2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 6ef897d0859c5415dc82c174e1f2a83b286e9ae2
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg0 +1793 drivers/scsi/mpt3sas/mpt3sas_config.c

  1782	
  1783	/**
  1784	 * mpt3sas_config_set_driver_trigger_pg0 - write driver trigger page 0
  1785	 * @ioc: per adapter object
  1786	 * @mpi_reply: reply mf payload returned from firmware
  1787	 * @config_page: contents of the config page
  1788	 * Context: sleep.
  1789	 *
  1790	 * Returns 0 for success, non-zero for failure.
  1791	 */
  1792	int
> 1793	_config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  1794		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page)
  1795	{
  1796		Mpi2ConfigRequest_t mpi_request;
  1797		int r;
  1798	
  1799		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  1800		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  1801		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  1802		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  1803		mpi_request.ExtPageType =
  1804		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  1805		mpi_request.Header.PageNumber = 0;
  1806		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE0_PAGEVERSION;
  1807		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  1808		r = _config_request(ioc, &mpi_request, mpi_reply,
  1809		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  1810		if (r)
  1811			goto out;
  1812	
  1813		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  1814		_config_request(ioc, &mpi_request, mpi_reply,
  1815		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1816		    sizeof(*config_page));
  1817		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  1818		r = _config_request(ioc, &mpi_request, mpi_reply,
  1819		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1820		    sizeof(*config_page));
  1821	 out:
  1822		return r;
  1823	}
  1824	
  1825	/**
  1826	 * mpt3sas_config_update_driver_trigger_pg0 - update driver trigger page 0
  1827	 * @ioc: per adapter object
  1828	 * @trigger_flags: trigger type bit map
  1829	 * @set: set ot clear trigger values
  1830	 * Context: sleep.
  1831	 *
  1832	 * Returns 0 for success, non-zero for failure.
  1833	 */
  1834	int
> 1835	mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  1836		u16 trigger_flag, bool set)
  1837	{
  1838		Mpi26DriverTriggerPage0_t tg_pg0;
  1839		Mpi2ConfigReply_t mpi_reply;
  1840		int rc;
  1841		u16 flags, ioc_status;
  1842	
  1843		rc = mpt3sas_config_get_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
  1844		if (rc)
  1845			return rc;
  1846		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
  1847		    MPI2_IOCSTATUS_MASK;
  1848		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
  1849			dcprintk(ioc,
  1850			    ioc_err(ioc,
  1851			    "%s: Failed to get trigger pg0, ioc_status(0x%04x)\n",
  1852			    __func__, ioc_status));
  1853			return -EFAULT;
  1854		}
  1855	
  1856		if (set)
  1857			flags = le16_to_cpu(tg_pg0.TriggerFlags) | trigger_flag;
  1858		else
  1859			flags = le16_to_cpu(tg_pg0.TriggerFlags) & ~trigger_flag;
  1860	
  1861		tg_pg0.TriggerFlags = cpu_to_le16(flags);
  1862	
  1863		rc = _config_set_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
  1864		if (rc)
  1865			return rc;
  1866		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
  1867		    MPI2_IOCSTATUS_MASK;
  1868		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
  1869			dcprintk(ioc,
  1870			    ioc_err(ioc,
  1871			    "%s: Failed to update trigger pg0, ioc_status(0x%04x)\n",
  1872			    __func__, ioc_status));
  1873			return -EFAULT;
  1874		}
  1875	
  1876		return 0;
  1877	}
  1878	

---
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: 45542 bytes --]

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

* Re: [PATCH 1/8] mpt3sas: Sync time stamp periodically between Driver and FW
  2020-11-24  3:50 ` [PATCH 1/8] mpt3sas: Sync time stamp periodically between Driver and FW Suganath Prabu S
@ 2020-11-24  7:46     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  7:46 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/25de902f6dde291c7e0266b943d68ff8ed4d683b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 25de902f6dde291c7e0266b943d68ff8ed4d683b
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/scsi/mpt3sas/mpt3sas_base.c:633:19: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] TimeStamp @@     got restricted __le64 [usertype] @@
>> drivers/scsi/mpt3sas/mpt3sas_base.c:633:19: sparse:     expected unsigned long long [usertype] TimeStamp
   drivers/scsi/mpt3sas/mpt3sas_base.c:633:19: sparse:     got restricted __le64 [usertype]
>> drivers/scsi/mpt3sas/mpt3sas_base.c:634:32: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] Reserved7 @@     got unsigned int [usertype] @@
>> drivers/scsi/mpt3sas/mpt3sas_base.c:634:32: sparse:     expected restricted __le32 [usertype] Reserved7
   drivers/scsi/mpt3sas/mpt3sas_base.c:634:32: sparse:     got unsigned int [usertype]
>> drivers/scsi/mpt3sas/mpt3sas_base.c:635:40: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] IOCParameterValue @@     got unsigned int [usertype] @@
>> drivers/scsi/mpt3sas/mpt3sas_base.c:635:40: sparse:     expected restricted __le32 [usertype] IOCParameterValue
   drivers/scsi/mpt3sas/mpt3sas_base.c:635:40: sparse:     got unsigned int [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:1704:64: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long [usertype] * @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:1704:64: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/scsi/mpt3sas/mpt3sas_base.c:1704:64: sparse:     got unsigned long long [usertype] *
   drivers/scsi/mpt3sas/mpt3sas_base.c:1758:52: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long [usertype] * @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:1758:52: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/scsi/mpt3sas/mpt3sas_base.c:1758:52: sparse:     got unsigned long long [usertype] *
   drivers/scsi/mpt3sas/mpt3sas_base.c:4105:16: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:4105:16: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:4105:16: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:4127:16: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:4127:16: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:4127:16: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:4150:16: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:4150:16: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:4150:16: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:4171:16: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:4171:16: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:4171:16: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:6035:24: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:6035:24: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:6035:24: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:6054:20: sparse: sparse: cast to restricted __le16
   drivers/scsi/mpt3sas/mpt3sas_base.c:6062:20: sparse: sparse: cast to restricted __le16
   drivers/scsi/mpt3sas/mpt3sas_base.c:6075:36: sparse: sparse: cast to restricted __le16
   drivers/scsi/mpt3sas/mpt3sas_base.c:7213:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long [usertype] * @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:7213:55: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/scsi/mpt3sas/mpt3sas_base.c:7213:55: sparse:     got unsigned long long [usertype] *

vim +633 drivers/scsi/mpt3sas/mpt3sas_base.c

   598	
   599	/**
   600	 * _base_sync_drv_fw_timestamp - Sync Drive-Fw TimeStamp.
   601	 * @ioc: Per Adapter Object
   602	 *
   603	 * Return nothing.
   604	 */
   605	static void _base_sync_drv_fw_timestamp(struct MPT3SAS_ADAPTER *ioc)
   606	{
   607		Mpi26IoUnitControlRequest_t *mpi_request;
   608		Mpi26IoUnitControlReply_t *mpi_reply;
   609		u16 smid;
   610		ktime_t current_time;
   611		u64 TimeStamp = 0;
   612		u8 issue_reset = 0;
   613	
   614		mutex_lock(&ioc->scsih_cmds.mutex);
   615		if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) {
   616			ioc_err(ioc, "scsih_cmd in use %s\n", __func__);
   617			goto out;
   618		}
   619		ioc->scsih_cmds.status = MPT3_CMD_PENDING;
   620		smid = mpt3sas_base_get_smid(ioc, ioc->scsih_cb_idx);
   621		if (!smid) {
   622			ioc_err(ioc, "Failed obtaining a smid %s\n", __func__);
   623			ioc->scsih_cmds.status = MPT3_CMD_NOT_USED;
   624			goto out;
   625		}
   626		mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
   627		ioc->scsih_cmds.smid = smid;
   628		memset(mpi_request, 0, sizeof(Mpi26IoUnitControlRequest_t));
   629		mpi_request->Function = MPI2_FUNCTION_IO_UNIT_CONTROL;
   630		mpi_request->Operation = MPI26_CTRL_OP_SET_IOC_PARAMETER;
   631		mpi_request->IOCParameter = MPI26_SET_IOC_PARAMETER_SYNC_TIMESTAMP;
   632		current_time = ktime_get_real();
 > 633		TimeStamp = cpu_to_le64(ktime_to_ms(current_time));
 > 634		mpi_request->Reserved7 = (u32) (TimeStamp & 0xFFFFFFFF);
 > 635		mpi_request->IOCParameterValue = (u32) (TimeStamp >> 32);
   636		init_completion(&ioc->scsih_cmds.done);
   637		ioc->put_smid_default(ioc, smid);
   638		dinitprintk(ioc, ioc_info(ioc,
   639		    "Io Unit Control Sync TimeStamp (sending), @time %lld ms\n",
   640		    TimeStamp));
   641		wait_for_completion_timeout(&ioc->scsih_cmds.done,
   642			MPT3SAS_TIMESYNC_TIMEOUT_SECONDS*HZ);
   643		if (!(ioc->scsih_cmds.status & MPT3_CMD_COMPLETE)) {
   644			mpt3sas_check_cmd_timeout(ioc,
   645			    ioc->scsih_cmds.status, mpi_request,
   646			    sizeof(Mpi2SasIoUnitControlRequest_t)/4, issue_reset);
   647			goto issue_host_reset;
   648		}
   649		if (ioc->scsih_cmds.status & MPT3_CMD_REPLY_VALID) {
   650			mpi_reply = ioc->scsih_cmds.reply;
   651			dinitprintk(ioc, ioc_info(ioc,
   652			    "Io Unit Control sync timestamp (complete): ioc_status(0x%04x), loginfo(0x%08x)\n",
   653			    le16_to_cpu(mpi_reply->IOCStatus),
   654			    le32_to_cpu(mpi_reply->IOCLogInfo)));
   655		}
   656	issue_host_reset:
   657		if (issue_reset)
   658			mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER);
   659		ioc->scsih_cmds.status = MPT3_CMD_NOT_USED;
   660	out:
   661		mutex_unlock(&ioc->scsih_cmds.mutex);
   662	}
   663	

---
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: 36094 bytes --]

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

* Re: [PATCH 1/8] mpt3sas: Sync time stamp periodically between Driver and FW
@ 2020-11-24  7:46     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  7:46 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/25de902f6dde291c7e0266b943d68ff8ed4d683b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 25de902f6dde291c7e0266b943d68ff8ed4d683b
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/scsi/mpt3sas/mpt3sas_base.c:633:19: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] TimeStamp @@     got restricted __le64 [usertype] @@
>> drivers/scsi/mpt3sas/mpt3sas_base.c:633:19: sparse:     expected unsigned long long [usertype] TimeStamp
   drivers/scsi/mpt3sas/mpt3sas_base.c:633:19: sparse:     got restricted __le64 [usertype]
>> drivers/scsi/mpt3sas/mpt3sas_base.c:634:32: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] Reserved7 @@     got unsigned int [usertype] @@
>> drivers/scsi/mpt3sas/mpt3sas_base.c:634:32: sparse:     expected restricted __le32 [usertype] Reserved7
   drivers/scsi/mpt3sas/mpt3sas_base.c:634:32: sparse:     got unsigned int [usertype]
>> drivers/scsi/mpt3sas/mpt3sas_base.c:635:40: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] IOCParameterValue @@     got unsigned int [usertype] @@
>> drivers/scsi/mpt3sas/mpt3sas_base.c:635:40: sparse:     expected restricted __le32 [usertype] IOCParameterValue
   drivers/scsi/mpt3sas/mpt3sas_base.c:635:40: sparse:     got unsigned int [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:1704:64: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long [usertype] * @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:1704:64: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/scsi/mpt3sas/mpt3sas_base.c:1704:64: sparse:     got unsigned long long [usertype] *
   drivers/scsi/mpt3sas/mpt3sas_base.c:1758:52: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long [usertype] * @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:1758:52: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/scsi/mpt3sas/mpt3sas_base.c:1758:52: sparse:     got unsigned long long [usertype] *
   drivers/scsi/mpt3sas/mpt3sas_base.c:4105:16: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:4105:16: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:4105:16: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:4127:16: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:4127:16: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:4127:16: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:4150:16: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:4150:16: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:4150:16: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:4171:16: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:4171:16: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:4171:16: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:6035:24: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int val @@     got restricted __le32 [usertype] @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:6035:24: sparse:     expected unsigned int val
   drivers/scsi/mpt3sas/mpt3sas_base.c:6035:24: sparse:     got restricted __le32 [usertype]
   drivers/scsi/mpt3sas/mpt3sas_base.c:6054:20: sparse: sparse: cast to restricted __le16
   drivers/scsi/mpt3sas/mpt3sas_base.c:6062:20: sparse: sparse: cast to restricted __le16
   drivers/scsi/mpt3sas/mpt3sas_base.c:6075:36: sparse: sparse: cast to restricted __le16
   drivers/scsi/mpt3sas/mpt3sas_base.c:7213:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long [usertype] * @@
   drivers/scsi/mpt3sas/mpt3sas_base.c:7213:55: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/scsi/mpt3sas/mpt3sas_base.c:7213:55: sparse:     got unsigned long long [usertype] *

vim +633 drivers/scsi/mpt3sas/mpt3sas_base.c

   598	
   599	/**
   600	 * _base_sync_drv_fw_timestamp - Sync Drive-Fw TimeStamp.
   601	 * @ioc: Per Adapter Object
   602	 *
   603	 * Return nothing.
   604	 */
   605	static void _base_sync_drv_fw_timestamp(struct MPT3SAS_ADAPTER *ioc)
   606	{
   607		Mpi26IoUnitControlRequest_t *mpi_request;
   608		Mpi26IoUnitControlReply_t *mpi_reply;
   609		u16 smid;
   610		ktime_t current_time;
   611		u64 TimeStamp = 0;
   612		u8 issue_reset = 0;
   613	
   614		mutex_lock(&ioc->scsih_cmds.mutex);
   615		if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) {
   616			ioc_err(ioc, "scsih_cmd in use %s\n", __func__);
   617			goto out;
   618		}
   619		ioc->scsih_cmds.status = MPT3_CMD_PENDING;
   620		smid = mpt3sas_base_get_smid(ioc, ioc->scsih_cb_idx);
   621		if (!smid) {
   622			ioc_err(ioc, "Failed obtaining a smid %s\n", __func__);
   623			ioc->scsih_cmds.status = MPT3_CMD_NOT_USED;
   624			goto out;
   625		}
   626		mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
   627		ioc->scsih_cmds.smid = smid;
   628		memset(mpi_request, 0, sizeof(Mpi26IoUnitControlRequest_t));
   629		mpi_request->Function = MPI2_FUNCTION_IO_UNIT_CONTROL;
   630		mpi_request->Operation = MPI26_CTRL_OP_SET_IOC_PARAMETER;
   631		mpi_request->IOCParameter = MPI26_SET_IOC_PARAMETER_SYNC_TIMESTAMP;
   632		current_time = ktime_get_real();
 > 633		TimeStamp = cpu_to_le64(ktime_to_ms(current_time));
 > 634		mpi_request->Reserved7 = (u32) (TimeStamp & 0xFFFFFFFF);
 > 635		mpi_request->IOCParameterValue = (u32) (TimeStamp >> 32);
   636		init_completion(&ioc->scsih_cmds.done);
   637		ioc->put_smid_default(ioc, smid);
   638		dinitprintk(ioc, ioc_info(ioc,
   639		    "Io Unit Control Sync TimeStamp (sending), @time %lld ms\n",
   640		    TimeStamp));
   641		wait_for_completion_timeout(&ioc->scsih_cmds.done,
   642			MPT3SAS_TIMESYNC_TIMEOUT_SECONDS*HZ);
   643		if (!(ioc->scsih_cmds.status & MPT3_CMD_COMPLETE)) {
   644			mpt3sas_check_cmd_timeout(ioc,
   645			    ioc->scsih_cmds.status, mpi_request,
   646			    sizeof(Mpi2SasIoUnitControlRequest_t)/4, issue_reset);
   647			goto issue_host_reset;
   648		}
   649		if (ioc->scsih_cmds.status & MPT3_CMD_REPLY_VALID) {
   650			mpi_reply = ioc->scsih_cmds.reply;
   651			dinitprintk(ioc, ioc_info(ioc,
   652			    "Io Unit Control sync timestamp (complete): ioc_status(0x%04x), loginfo(0x%08x)\n",
   653			    le16_to_cpu(mpi_reply->IOCStatus),
   654			    le32_to_cpu(mpi_reply->IOCLogInfo)));
   655		}
   656	issue_host_reset:
   657		if (issue_reset)
   658			mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER);
   659		ioc->scsih_cmds.status = MPT3_CMD_NOT_USED;
   660	out:
   661		mutex_unlock(&ioc->scsih_cmds.mutex);
   662	}
   663	

---
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: 36094 bytes --]

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

* Re: [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page
  2020-11-24  3:50 ` [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page Suganath Prabu S
@ 2020-11-24  7:48     ` kernel test robot
  2020-11-24  9:25     ` kernel test robot
  2020-11-24  9:25     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  7:48 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/9d619bffb390470be629fa99370eb823d64d796e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 9d619bffb390470be629fa99370eb823d64d796e
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: warning: no previous prototype for '_config_set_driver_trigger_pg1' [-Wmissing-prototypes]
    1927 | _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg1' [-Wmissing-prototypes]
    1969 | mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg1 +1927 drivers/scsi/mpt3sas/mpt3sas_config.c

  1782	
  1783	/**
  1784	 * mpt3sas_config_set_driver_trigger_pg0 - write driver trigger page 0
  1785	 * @ioc: per adapter object
  1786	 * @mpi_reply: reply mf payload returned from firmware
  1787	 * @config_page: contents of the config page
  1788	 * Context: sleep.
  1789	 *
  1790	 * Returns 0 for success, non-zero for failure.
  1791	 */
  1792	int
> 1793	_config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  1794		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page)
  1795	{
  1796		Mpi2ConfigRequest_t mpi_request;
  1797		int r;
  1798	
  1799		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  1800		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  1801		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  1802		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  1803		mpi_request.ExtPageType =
  1804		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  1805		mpi_request.Header.PageNumber = 0;
  1806		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE0_PAGEVERSION;
  1807		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  1808		r = _config_request(ioc, &mpi_request, mpi_reply,
  1809		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  1810		if (r)
  1811			goto out;
  1812	
  1813		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  1814		_config_request(ioc, &mpi_request, mpi_reply,
  1815		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1816		    sizeof(*config_page));
  1817		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  1818		r = _config_request(ioc, &mpi_request, mpi_reply,
  1819		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1820		    sizeof(*config_page));
  1821	 out:
  1822		return r;
  1823	}
  1824	
  1825	/**
  1826	 * mpt3sas_config_update_driver_trigger_pg0 - update driver trigger page 0
  1827	 * @ioc: per adapter object
  1828	 * @trigger_flags: trigger type bit map
  1829	 * @set: set ot clear trigger values
  1830	 * Context: sleep.
  1831	 *
  1832	 * Returns 0 for success, non-zero for failure.
  1833	 */
  1834	int
  1835	mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  1836		u16 trigger_flag, bool set)
  1837	{
  1838		Mpi26DriverTriggerPage0_t tg_pg0;
  1839		Mpi2ConfigReply_t mpi_reply;
  1840		int rc;
  1841		u16 flags, ioc_status;
  1842	
  1843		rc = mpt3sas_config_get_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
  1844		if (rc)
  1845			return rc;
  1846		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
  1847		    MPI2_IOCSTATUS_MASK;
  1848		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
  1849			dcprintk(ioc,
  1850			    ioc_err(ioc,
  1851			    "%s: Failed to get trigger pg0, ioc_status(0x%04x)\n",
  1852			    __func__, ioc_status));
  1853			return -EFAULT;
  1854		}
  1855	
  1856		if (set)
  1857			flags = le16_to_cpu(tg_pg0.TriggerFlags) | trigger_flag;
  1858		else
  1859			flags = le16_to_cpu(tg_pg0.TriggerFlags) & ~trigger_flag;
  1860	
  1861		tg_pg0.TriggerFlags = cpu_to_le16(flags);
  1862	
  1863		rc = _config_set_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
  1864		if (rc)
  1865			return rc;
  1866		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
  1867		    MPI2_IOCSTATUS_MASK;
  1868		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
  1869			dcprintk(ioc,
  1870			    ioc_err(ioc,
  1871			    "%s: Failed to update trigger pg0, ioc_status(0x%04x)\n",
  1872			    __func__, ioc_status));
  1873			return -EFAULT;
  1874		}
  1875	
  1876		return 0;
  1877	}
  1878	
  1879	/**
  1880	 * mpt3sas_config_get_driver_trigger_pg1 - obtain driver trigger page 1
  1881	 * @ioc: per adapter object
  1882	 * @mpi_reply: reply mf payload returned from firmware
  1883	 * @config_page: contents of the config page
  1884	 * Context: sleep.
  1885	 *
  1886	 * Returns 0 for success, non-zero for failure.
  1887	 */
  1888	int
  1889	mpt3sas_config_get_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
  1890		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page)
  1891	{
  1892		Mpi2ConfigRequest_t mpi_request;
  1893		int r;
  1894	
  1895		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  1896		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  1897		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  1898		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  1899		mpi_request.ExtPageType =
  1900		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  1901		mpi_request.Header.PageNumber = 1;
  1902		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE1_PAGEVERSION;
  1903		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  1904		r = _config_request(ioc, &mpi_request, mpi_reply,
  1905		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  1906		if (r)
  1907			goto out;
  1908	
  1909		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
  1910		r = _config_request(ioc, &mpi_request, mpi_reply,
  1911		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1912		    sizeof(*config_page));
  1913	 out:
  1914		return r;
  1915	}
  1916	
  1917	/**
  1918	 * mpt3sas_config_set_driver_trigger_pg1 - write driver trigger page 1
  1919	 * @ioc: per adapter object
  1920	 * @mpi_reply: reply mf payload returned from firmware
  1921	 * @config_page: contents of the config page
  1922	 * Context: sleep.
  1923	 *
  1924	 * Returns 0 for success, non-zero for failure.
  1925	 */
  1926	int
> 1927	_config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
  1928		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page)
  1929	{
  1930		Mpi2ConfigRequest_t mpi_request;
  1931		int r;
  1932	
  1933		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  1934		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  1935		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  1936		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  1937		mpi_request.ExtPageType =
  1938		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  1939		mpi_request.Header.PageNumber = 1;
  1940		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE1_PAGEVERSION;
  1941		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  1942		r = _config_request(ioc, &mpi_request, mpi_reply,
  1943		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  1944		if (r)
  1945			goto out;
  1946	
  1947		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  1948		_config_request(ioc, &mpi_request, mpi_reply,
  1949		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1950		    sizeof(*config_page));
  1951		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  1952		r = _config_request(ioc, &mpi_request, mpi_reply,
  1953		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1954		    sizeof(*config_page));
  1955	 out:
  1956		return r;
  1957	}
  1958	

---
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: 45542 bytes --]

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

* Re: [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page
@ 2020-11-24  7:48     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  7:48 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/9d619bffb390470be629fa99370eb823d64d796e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 9d619bffb390470be629fa99370eb823d64d796e
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: warning: no previous prototype for '_config_set_driver_trigger_pg1' [-Wmissing-prototypes]
    1927 | _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg1' [-Wmissing-prototypes]
    1969 | mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg1 +1927 drivers/scsi/mpt3sas/mpt3sas_config.c

  1782	
  1783	/**
  1784	 * mpt3sas_config_set_driver_trigger_pg0 - write driver trigger page 0
  1785	 * @ioc: per adapter object
  1786	 * @mpi_reply: reply mf payload returned from firmware
  1787	 * @config_page: contents of the config page
  1788	 * Context: sleep.
  1789	 *
  1790	 * Returns 0 for success, non-zero for failure.
  1791	 */
  1792	int
> 1793	_config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  1794		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page)
  1795	{
  1796		Mpi2ConfigRequest_t mpi_request;
  1797		int r;
  1798	
  1799		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  1800		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  1801		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  1802		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  1803		mpi_request.ExtPageType =
  1804		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  1805		mpi_request.Header.PageNumber = 0;
  1806		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE0_PAGEVERSION;
  1807		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  1808		r = _config_request(ioc, &mpi_request, mpi_reply,
  1809		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  1810		if (r)
  1811			goto out;
  1812	
  1813		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  1814		_config_request(ioc, &mpi_request, mpi_reply,
  1815		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1816		    sizeof(*config_page));
  1817		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  1818		r = _config_request(ioc, &mpi_request, mpi_reply,
  1819		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1820		    sizeof(*config_page));
  1821	 out:
  1822		return r;
  1823	}
  1824	
  1825	/**
  1826	 * mpt3sas_config_update_driver_trigger_pg0 - update driver trigger page 0
  1827	 * @ioc: per adapter object
  1828	 * @trigger_flags: trigger type bit map
  1829	 * @set: set ot clear trigger values
  1830	 * Context: sleep.
  1831	 *
  1832	 * Returns 0 for success, non-zero for failure.
  1833	 */
  1834	int
  1835	mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  1836		u16 trigger_flag, bool set)
  1837	{
  1838		Mpi26DriverTriggerPage0_t tg_pg0;
  1839		Mpi2ConfigReply_t mpi_reply;
  1840		int rc;
  1841		u16 flags, ioc_status;
  1842	
  1843		rc = mpt3sas_config_get_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
  1844		if (rc)
  1845			return rc;
  1846		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
  1847		    MPI2_IOCSTATUS_MASK;
  1848		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
  1849			dcprintk(ioc,
  1850			    ioc_err(ioc,
  1851			    "%s: Failed to get trigger pg0, ioc_status(0x%04x)\n",
  1852			    __func__, ioc_status));
  1853			return -EFAULT;
  1854		}
  1855	
  1856		if (set)
  1857			flags = le16_to_cpu(tg_pg0.TriggerFlags) | trigger_flag;
  1858		else
  1859			flags = le16_to_cpu(tg_pg0.TriggerFlags) & ~trigger_flag;
  1860	
  1861		tg_pg0.TriggerFlags = cpu_to_le16(flags);
  1862	
  1863		rc = _config_set_driver_trigger_pg0(ioc, &mpi_reply, &tg_pg0);
  1864		if (rc)
  1865			return rc;
  1866		ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
  1867		    MPI2_IOCSTATUS_MASK;
  1868		if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
  1869			dcprintk(ioc,
  1870			    ioc_err(ioc,
  1871			    "%s: Failed to update trigger pg0, ioc_status(0x%04x)\n",
  1872			    __func__, ioc_status));
  1873			return -EFAULT;
  1874		}
  1875	
  1876		return 0;
  1877	}
  1878	
  1879	/**
  1880	 * mpt3sas_config_get_driver_trigger_pg1 - obtain driver trigger page 1
  1881	 * @ioc: per adapter object
  1882	 * @mpi_reply: reply mf payload returned from firmware
  1883	 * @config_page: contents of the config page
  1884	 * Context: sleep.
  1885	 *
  1886	 * Returns 0 for success, non-zero for failure.
  1887	 */
  1888	int
  1889	mpt3sas_config_get_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
  1890		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page)
  1891	{
  1892		Mpi2ConfigRequest_t mpi_request;
  1893		int r;
  1894	
  1895		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  1896		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  1897		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  1898		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  1899		mpi_request.ExtPageType =
  1900		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  1901		mpi_request.Header.PageNumber = 1;
  1902		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE1_PAGEVERSION;
  1903		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  1904		r = _config_request(ioc, &mpi_request, mpi_reply,
  1905		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  1906		if (r)
  1907			goto out;
  1908	
  1909		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
  1910		r = _config_request(ioc, &mpi_request, mpi_reply,
  1911		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1912		    sizeof(*config_page));
  1913	 out:
  1914		return r;
  1915	}
  1916	
  1917	/**
  1918	 * mpt3sas_config_set_driver_trigger_pg1 - write driver trigger page 1
  1919	 * @ioc: per adapter object
  1920	 * @mpi_reply: reply mf payload returned from firmware
  1921	 * @config_page: contents of the config page
  1922	 * Context: sleep.
  1923	 *
  1924	 * Returns 0 for success, non-zero for failure.
  1925	 */
  1926	int
> 1927	_config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
  1928		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page)
  1929	{
  1930		Mpi2ConfigRequest_t mpi_request;
  1931		int r;
  1932	
  1933		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  1934		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  1935		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  1936		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  1937		mpi_request.ExtPageType =
  1938		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  1939		mpi_request.Header.PageNumber = 1;
  1940		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE1_PAGEVERSION;
  1941		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  1942		r = _config_request(ioc, &mpi_request, mpi_reply,
  1943		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  1944		if (r)
  1945			goto out;
  1946	
  1947		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  1948		_config_request(ioc, &mpi_request, mpi_reply,
  1949		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1950		    sizeof(*config_page));
  1951		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  1952		r = _config_request(ioc, &mpi_request, mpi_reply,
  1953		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  1954		    sizeof(*config_page));
  1955	 out:
  1956		return r;
  1957	}
  1958	

---
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: 45542 bytes --]

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

* Re: [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2
  2020-11-24  3:50 ` [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2 Suganath Prabu S
@ 2020-11-24  8:40     ` kernel test robot
  2020-11-24 10:24     ` kernel test robot
  2020-11-24 10:24     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  8:40 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/0bded6ff43e4b0168fd607fed5169a35fa7edb4c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 0bded6ff43e4b0168fd607fed5169a35fa7edb4c
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: warning: no previous prototype for '_config_set_driver_trigger_pg1' [-Wmissing-prototypes]
    1927 | _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg1' [-Wmissing-prototypes]
    1969 | mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: warning: no previous prototype for '_config_set_driver_trigger_pg2' [-Wmissing-prototypes]
    2078 | _config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg2' [-Wmissing-prototypes]
    2120 | mpt3sas_config_update_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg2 +2078 drivers/scsi/mpt3sas/mpt3sas_config.c

  2067	
  2068	/**
  2069	 * mpt3sas_config_set_driver_trigger_pg2 - write driver trigger page 2
  2070	 * @ioc: per adapter object
  2071	 * @mpi_reply: reply mf payload returned from firmware
  2072	 * @config_page: contents of the config page
  2073	 * Context: sleep.
  2074	 *
  2075	 * Returns 0 for success, non-zero for failure.
  2076	 */
  2077	int
> 2078	_config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
  2079		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage2_t *config_page)
  2080	{
  2081		Mpi2ConfigRequest_t mpi_request;
  2082		int r;
  2083	
  2084		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  2085		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  2086		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  2087		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  2088		mpi_request.ExtPageType =
  2089		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  2090		mpi_request.Header.PageNumber = 2;
  2091		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE2_PAGEVERSION;
  2092		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  2093		r = _config_request(ioc, &mpi_request, mpi_reply,
  2094		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  2095		if (r)
  2096			goto out;
  2097	
  2098		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  2099		_config_request(ioc, &mpi_request, mpi_reply,
  2100		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2101		    sizeof(*config_page));
  2102		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  2103		r = _config_request(ioc, &mpi_request, mpi_reply,
  2104		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2105		    sizeof(*config_page));
  2106	 out:
  2107		return r;
  2108	}
  2109	

---
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: 45542 bytes --]

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

* Re: [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2
@ 2020-11-24  8:40     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  8:40 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/0bded6ff43e4b0168fd607fed5169a35fa7edb4c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 0bded6ff43e4b0168fd607fed5169a35fa7edb4c
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: warning: no previous prototype for '_config_set_driver_trigger_pg1' [-Wmissing-prototypes]
    1927 | _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg1' [-Wmissing-prototypes]
    1969 | mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: warning: no previous prototype for '_config_set_driver_trigger_pg2' [-Wmissing-prototypes]
    2078 | _config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg2' [-Wmissing-prototypes]
    2120 | mpt3sas_config_update_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg2 +2078 drivers/scsi/mpt3sas/mpt3sas_config.c

  2067	
  2068	/**
  2069	 * mpt3sas_config_set_driver_trigger_pg2 - write driver trigger page 2
  2070	 * @ioc: per adapter object
  2071	 * @mpi_reply: reply mf payload returned from firmware
  2072	 * @config_page: contents of the config page
  2073	 * Context: sleep.
  2074	 *
  2075	 * Returns 0 for success, non-zero for failure.
  2076	 */
  2077	int
> 2078	_config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
  2079		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage2_t *config_page)
  2080	{
  2081		Mpi2ConfigRequest_t mpi_request;
  2082		int r;
  2083	
  2084		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  2085		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  2086		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  2087		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  2088		mpi_request.ExtPageType =
  2089		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  2090		mpi_request.Header.PageNumber = 2;
  2091		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE2_PAGEVERSION;
  2092		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  2093		r = _config_request(ioc, &mpi_request, mpi_reply,
  2094		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  2095		if (r)
  2096			goto out;
  2097	
  2098		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  2099		_config_request(ioc, &mpi_request, mpi_reply,
  2100		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2101		    sizeof(*config_page));
  2102		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  2103		r = _config_request(ioc, &mpi_request, mpi_reply,
  2104		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2105		    sizeof(*config_page));
  2106	 out:
  2107		return r;
  2108	}
  2109	

---
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: 45542 bytes --]

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

* Re: [PATCH 2/8] mpt3sas: Add persistent trigger pages support
  2020-11-24  3:50 ` [PATCH 2/8] mpt3sas: Add persistent trigger pages support Suganath Prabu S
@ 2020-11-24  8:41     ` kernel test robot
  2020-11-24  8:41     ` kernel test robot
  2020-11-24  8:41     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  8:41 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/6ef897d0859c5415dc82c174e1f2a83b286e9ae2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 6ef897d0859c5415dc82c174e1f2a83b286e9ae2
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* Re: [PATCH 2/8] mpt3sas: Add persistent trigger pages support
@ 2020-11-24  8:41     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  8:41 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/6ef897d0859c5415dc82c174e1f2a83b286e9ae2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 6ef897d0859c5415dc82c174e1f2a83b286e9ae2
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg0 can be static
  2020-11-24  3:50 ` [PATCH 2/8] mpt3sas: Add persistent trigger pages support Suganath Prabu S
@ 2020-11-24  8:41     ` kernel test robot
  2020-11-24  8:41     ` kernel test robot
  2020-11-24  8:41     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  8:41 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 9f7d4cddf52396..032c55b6e444bf 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -1789,7 +1789,7 @@ mpt3sas_config_get_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page)
 {
@@ -1831,7 +1831,7 @@ _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
 	u16 trigger_flag, bool set)
 {

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg0 can be static
@ 2020-11-24  8:41     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  8:41 UTC (permalink / raw)
  To: kbuild-all

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


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 9f7d4cddf52396..032c55b6e444bf 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -1789,7 +1789,7 @@ mpt3sas_config_get_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage0_t *config_page)
 {
@@ -1831,7 +1831,7 @@ _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
 	u16 trigger_flag, bool set)
 {

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

* Re: [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page
  2020-11-24  3:50 ` [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page Suganath Prabu S
@ 2020-11-24  9:25     ` kernel test robot
  2020-11-24  9:25     ` kernel test robot
  2020-11-24  9:25     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  9:25 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/9d619bffb390470be629fa99370eb823d64d796e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 9d619bffb390470be629fa99370eb823d64d796e
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
   drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: sparse: sparse: symbol '_config_set_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg1' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* Re: [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page
@ 2020-11-24  9:25     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  9:25 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/9d619bffb390470be629fa99370eb823d64d796e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 9d619bffb390470be629fa99370eb823d64d796e
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
   drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: sparse: sparse: symbol '_config_set_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg1' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg1 can be static
  2020-11-24  3:50 ` [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page Suganath Prabu S
@ 2020-11-24  9:25     ` kernel test robot
  2020-11-24  9:25     ` kernel test robot
  2020-11-24  9:25     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  9:25 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 86d1643a74cd6b..15bbd6f9ae1019 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -1923,7 +1923,7 @@ mpt3sas_config_get_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page)
 {

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg1 can be static
@ 2020-11-24  9:25     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  9:25 UTC (permalink / raw)
  To: kbuild-all

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


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 86d1643a74cd6b..15bbd6f9ae1019 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -1923,7 +1923,7 @@ mpt3sas_config_get_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage1_t *config_page)
 {

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

* Re: [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3
  2020-11-24  3:50 ` [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3 Suganath Prabu S
@ 2020-11-24  9:52     ` kernel test robot
  2020-11-24 11:09     ` kernel test robot
  2020-11-24 11:09     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  9:52 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/7c7da8252f6c7d2b9c9915fed563703a57bb92e4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 7c7da8252f6c7d2b9c9915fed563703a57bb92e4
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: warning: no previous prototype for '_config_set_driver_trigger_pg1' [-Wmissing-prototypes]
    1927 | _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg1' [-Wmissing-prototypes]
    1969 | mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: warning: no previous prototype for '_config_set_driver_trigger_pg2' [-Wmissing-prototypes]
    2078 | _config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg2' [-Wmissing-prototypes]
    2120 | mpt3sas_config_update_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2238:1: warning: no previous prototype for '_config_set_driver_trigger_pg3' [-Wmissing-prototypes]
    2238 | _config_set_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2280:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg3' [-Wmissing-prototypes]
    2280 | mpt3sas_config_update_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg3 +2238 drivers/scsi/mpt3sas/mpt3sas_config.c

  2227	
  2228	/**
  2229	 * mpt3sas_config_set_driver_trigger_pg3 - write driver trigger page 3
  2230	 * @ioc: per adapter object
  2231	 * @mpi_reply: reply mf payload returned from firmware
  2232	 * @config_page: contents of the config page
  2233	 * Context: sleep.
  2234	 *
  2235	 * Returns 0 for success, non-zero for failure.
  2236	 */
  2237	int
> 2238	_config_set_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
  2239		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage3_t *config_page)
  2240	{
  2241		Mpi2ConfigRequest_t mpi_request;
  2242		int r;
  2243	
  2244		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  2245		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  2246		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  2247		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  2248		mpi_request.ExtPageType =
  2249		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  2250		mpi_request.Header.PageNumber = 3;
  2251		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE3_PAGEVERSION;
  2252		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  2253		r = _config_request(ioc, &mpi_request, mpi_reply,
  2254		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  2255		if (r)
  2256			goto out;
  2257	
  2258		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  2259		_config_request(ioc, &mpi_request, mpi_reply,
  2260		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2261		    sizeof(*config_page));
  2262		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  2263		r = _config_request(ioc, &mpi_request, mpi_reply,
  2264		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2265		    sizeof(*config_page));
  2266	 out:
  2267		return r;
  2268	}
  2269	

---
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: 45542 bytes --]

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

* Re: [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3
@ 2020-11-24  9:52     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24  9:52 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/7c7da8252f6c7d2b9c9915fed563703a57bb92e4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 7c7da8252f6c7d2b9c9915fed563703a57bb92e4
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: warning: no previous prototype for '_config_set_driver_trigger_pg1' [-Wmissing-prototypes]
    1927 | _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg1' [-Wmissing-prototypes]
    1969 | mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: warning: no previous prototype for '_config_set_driver_trigger_pg2' [-Wmissing-prototypes]
    2078 | _config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg2' [-Wmissing-prototypes]
    2120 | mpt3sas_config_update_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2238:1: warning: no previous prototype for '_config_set_driver_trigger_pg3' [-Wmissing-prototypes]
    2238 | _config_set_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2280:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg3' [-Wmissing-prototypes]
    2280 | mpt3sas_config_update_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg3 +2238 drivers/scsi/mpt3sas/mpt3sas_config.c

  2227	
  2228	/**
  2229	 * mpt3sas_config_set_driver_trigger_pg3 - write driver trigger page 3
  2230	 * @ioc: per adapter object
  2231	 * @mpi_reply: reply mf payload returned from firmware
  2232	 * @config_page: contents of the config page
  2233	 * Context: sleep.
  2234	 *
  2235	 * Returns 0 for success, non-zero for failure.
  2236	 */
  2237	int
> 2238	_config_set_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
  2239		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage3_t *config_page)
  2240	{
  2241		Mpi2ConfigRequest_t mpi_request;
  2242		int r;
  2243	
  2244		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  2245		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  2246		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  2247		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  2248		mpi_request.ExtPageType =
  2249		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  2250		mpi_request.Header.PageNumber = 3;
  2251		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE3_PAGEVERSION;
  2252		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  2253		r = _config_request(ioc, &mpi_request, mpi_reply,
  2254		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  2255		if (r)
  2256			goto out;
  2257	
  2258		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  2259		_config_request(ioc, &mpi_request, mpi_reply,
  2260		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2261		    sizeof(*config_page));
  2262		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  2263		r = _config_request(ioc, &mpi_request, mpi_reply,
  2264		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2265		    sizeof(*config_page));
  2266	 out:
  2267		return r;
  2268	}
  2269	

---
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: 45542 bytes --]

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

* Re: [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2
  2020-11-24  3:50 ` [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2 Suganath Prabu S
@ 2020-11-24 10:24     ` kernel test robot
  2020-11-24 10:24     ` kernel test robot
  2020-11-24 10:24     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 10:24 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/0bded6ff43e4b0168fd607fed5169a35fa7edb4c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 0bded6ff43e4b0168fd607fed5169a35fa7edb4c
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
   drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: sparse: sparse: symbol '_config_set_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg1' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: sparse: sparse: symbol '_config_set_driver_trigger_pg2' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg2' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* Re: [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2
@ 2020-11-24 10:24     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 10:24 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/0bded6ff43e4b0168fd607fed5169a35fa7edb4c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 0bded6ff43e4b0168fd607fed5169a35fa7edb4c
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
   drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: sparse: sparse: symbol '_config_set_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg1' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: sparse: sparse: symbol '_config_set_driver_trigger_pg2' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg2' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg2 can be static
  2020-11-24  3:50 ` [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2 Suganath Prabu S
@ 2020-11-24 10:24     ` kernel test robot
  2020-11-24 10:24     ` kernel test robot
  2020-11-24 10:24     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 10:24 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index b4c2b7389e87a2..7e99062e324313 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -2074,7 +2074,7 @@ mpt3sas_config_get_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage2_t *config_page)
 {

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg2 can be static
@ 2020-11-24 10:24     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 10:24 UTC (permalink / raw)
  To: kbuild-all

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


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index b4c2b7389e87a2..7e99062e324313 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -2074,7 +2074,7 @@ mpt3sas_config_get_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage2_t *config_page)
 {

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

* Re: [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4
  2020-11-24  3:50 ` [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4 Suganath Prabu S
@ 2020-11-24 11:03     ` kernel test robot
  2020-11-24 12:05     ` kernel test robot
  2020-11-24 12:05     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 11:03 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/d13faa942966ed911558ffa9c1fb021847f72632
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout d13faa942966ed911558ffa9c1fb021847f72632
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: warning: no previous prototype for '_config_set_driver_trigger_pg1' [-Wmissing-prototypes]
    1927 | _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg1' [-Wmissing-prototypes]
    1969 | mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: warning: no previous prototype for '_config_set_driver_trigger_pg2' [-Wmissing-prototypes]
    2078 | _config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg2' [-Wmissing-prototypes]
    2120 | mpt3sas_config_update_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2238:1: warning: no previous prototype for '_config_set_driver_trigger_pg3' [-Wmissing-prototypes]
    2238 | _config_set_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2280:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg3' [-Wmissing-prototypes]
    2280 | mpt3sas_config_update_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2395:1: warning: no previous prototype for '_config_set_driver_trigger_pg4' [-Wmissing-prototypes]
    2395 | _config_set_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2437:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg4' [-Wmissing-prototypes]
    2437 | mpt3sas_config_update_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg4 +2395 drivers/scsi/mpt3sas/mpt3sas_config.c

  2384	
  2385	/**
  2386	 * mpt3sas_config_set_driver_trigger_pg4 - write driver trigger page 4
  2387	 * @ioc: per adapter object
  2388	 * @mpi_reply: reply mf payload returned from firmware
  2389	 * @config_page: contents of the config page
  2390	 * Context: sleep.
  2391	 *
  2392	 * Returns 0 for success, non-zero for failure.
  2393	 */
  2394	int
> 2395	_config_set_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
  2396		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage4_t *config_page)
  2397	{
  2398		Mpi2ConfigRequest_t mpi_request;
  2399		int r;
  2400	
  2401		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  2402		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  2403		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  2404		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  2405		mpi_request.ExtPageType =
  2406		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  2407		mpi_request.Header.PageNumber = 4;
  2408		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE4_PAGEVERSION;
  2409		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  2410		r = _config_request(ioc, &mpi_request, mpi_reply,
  2411		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  2412		if (r)
  2413			goto out;
  2414	
  2415		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  2416		_config_request(ioc, &mpi_request, mpi_reply,
  2417		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2418		    sizeof(*config_page));
  2419		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  2420		r = _config_request(ioc, &mpi_request, mpi_reply,
  2421		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2422		    sizeof(*config_page));
  2423	 out:
  2424		return r;
  2425	}
  2426	

---
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: 45542 bytes --]

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

* Re: [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4
@ 2020-11-24 11:03     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 11:03 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/d13faa942966ed911558ffa9c1fb021847f72632
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout d13faa942966ed911558ffa9c1fb021847f72632
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/mpt3sas/mpt3sas_config.c:1793:1: warning: no previous prototype for '_config_set_driver_trigger_pg0' [-Wmissing-prototypes]
    1793 | _config_set_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg0' [-Wmissing-prototypes]
    1835 | mpt3sas_config_update_driver_trigger_pg0(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: warning: no previous prototype for '_config_set_driver_trigger_pg1' [-Wmissing-prototypes]
    1927 | _config_set_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg1' [-Wmissing-prototypes]
    1969 | mpt3sas_config_update_driver_trigger_pg1(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: warning: no previous prototype for '_config_set_driver_trigger_pg2' [-Wmissing-prototypes]
    2078 | _config_set_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg2' [-Wmissing-prototypes]
    2120 | mpt3sas_config_update_driver_trigger_pg2(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2238:1: warning: no previous prototype for '_config_set_driver_trigger_pg3' [-Wmissing-prototypes]
    2238 | _config_set_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2280:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg3' [-Wmissing-prototypes]
    2280 | mpt3sas_config_update_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2395:1: warning: no previous prototype for '_config_set_driver_trigger_pg4' [-Wmissing-prototypes]
    2395 | _config_set_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpt3sas/mpt3sas_config.c:2437:1: warning: no previous prototype for 'mpt3sas_config_update_driver_trigger_pg4' [-Wmissing-prototypes]
    2437 | mpt3sas_config_update_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/_config_set_driver_trigger_pg4 +2395 drivers/scsi/mpt3sas/mpt3sas_config.c

  2384	
  2385	/**
  2386	 * mpt3sas_config_set_driver_trigger_pg4 - write driver trigger page 4
  2387	 * @ioc: per adapter object
  2388	 * @mpi_reply: reply mf payload returned from firmware
  2389	 * @config_page: contents of the config page
  2390	 * Context: sleep.
  2391	 *
  2392	 * Returns 0 for success, non-zero for failure.
  2393	 */
  2394	int
> 2395	_config_set_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
  2396		Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage4_t *config_page)
  2397	{
  2398		Mpi2ConfigRequest_t mpi_request;
  2399		int r;
  2400	
  2401		memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
  2402		mpi_request.Function = MPI2_FUNCTION_CONFIG;
  2403		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
  2404		mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
  2405		mpi_request.ExtPageType =
  2406		    MPI2_CONFIG_EXTPAGETYPE_DRIVER_PERSISTENT_TRIGGER;
  2407		mpi_request.Header.PageNumber = 4;
  2408		mpi_request.Header.PageVersion = MPI26_DRIVER_TRIGGER_PAGE4_PAGEVERSION;
  2409		ioc->build_zero_len_sge_mpi(ioc, &mpi_request.PageBufferSGE);
  2410		r = _config_request(ioc, &mpi_request, mpi_reply,
  2411		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, NULL, 0);
  2412		if (r)
  2413			goto out;
  2414	
  2415		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_CURRENT;
  2416		_config_request(ioc, &mpi_request, mpi_reply,
  2417		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2418		    sizeof(*config_page));
  2419		mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
  2420		r = _config_request(ioc, &mpi_request, mpi_reply,
  2421		    MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
  2422		    sizeof(*config_page));
  2423	 out:
  2424		return r;
  2425	}
  2426	

---
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: 45542 bytes --]

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

* Re: [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3
  2020-11-24  3:50 ` [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3 Suganath Prabu S
@ 2020-11-24 11:09     ` kernel test robot
  2020-11-24 11:09     ` kernel test robot
  2020-11-24 11:09     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 11:09 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/7c7da8252f6c7d2b9c9915fed563703a57bb92e4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 7c7da8252f6c7d2b9c9915fed563703a57bb92e4
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
   drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: sparse: sparse: symbol '_config_set_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: sparse: sparse: symbol '_config_set_driver_trigger_pg2' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg2' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2238:1: sparse: sparse: symbol '_config_set_driver_trigger_pg3' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2280:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg3' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* Re: [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3
@ 2020-11-24 11:09     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 11:09 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/7c7da8252f6c7d2b9c9915fed563703a57bb92e4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout 7c7da8252f6c7d2b9c9915fed563703a57bb92e4
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
   drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: sparse: sparse: symbol '_config_set_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: sparse: sparse: symbol '_config_set_driver_trigger_pg2' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg2' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2238:1: sparse: sparse: symbol '_config_set_driver_trigger_pg3' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2280:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg3' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg3 can be static
  2020-11-24  3:50 ` [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3 Suganath Prabu S
@ 2020-11-24 11:09     ` kernel test robot
  2020-11-24 11:09     ` kernel test robot
  2020-11-24 11:09     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 11:09 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 98b6a59e5560b7..15bc22f7afc40c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -2234,7 +2234,7 @@ mpt3sas_config_get_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage3_t *config_page)
 {

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg3 can be static
@ 2020-11-24 11:09     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 11:09 UTC (permalink / raw)
  To: kbuild-all

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


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index 98b6a59e5560b7..15bc22f7afc40c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -2234,7 +2234,7 @@ mpt3sas_config_get_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg3(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage3_t *config_page)
 {

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

* Re: [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4
  2020-11-24  3:50 ` [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4 Suganath Prabu S
@ 2020-11-24 12:05     ` kernel test robot
  2020-11-24 12:05     ` kernel test robot
  2020-11-24 12:05     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 12:05 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/d13faa942966ed911558ffa9c1fb021847f72632
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout d13faa942966ed911558ffa9c1fb021847f72632
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
   drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: sparse: sparse: symbol '_config_set_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: sparse: sparse: symbol '_config_set_driver_trigger_pg2' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg2' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2238:1: sparse: sparse: symbol '_config_set_driver_trigger_pg3' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2280:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg3' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2395:1: sparse: sparse: symbol '_config_set_driver_trigger_pg4' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2437:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg4' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* Re: [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4
@ 2020-11-24 12:05     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 12:05 UTC (permalink / raw)
  To: kbuild-all

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

Hi Suganath,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.10-rc5 next-20201123]
[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/Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-s001-20201124 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/d13faa942966ed911558ffa9c1fb021847f72632
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Suganath-Prabu-S/mpt3sas-Features-to-enhance-driver-debugging/20201124-115842
        git checkout d13faa942966ed911558ffa9c1fb021847f72632
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
   drivers/scsi/mpt3sas/mpt3sas_config.c:1793:1: sparse: sparse: symbol '_config_set_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1835:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg0' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1927:1: sparse: sparse: symbol '_config_set_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:1969:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg1' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2078:1: sparse: sparse: symbol '_config_set_driver_trigger_pg2' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2120:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg2' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2238:1: sparse: sparse: symbol '_config_set_driver_trigger_pg3' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2280:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg3' was not declared. Should it be static?
>> drivers/scsi/mpt3sas/mpt3sas_config.c:2395:1: sparse: sparse: symbol '_config_set_driver_trigger_pg4' was not declared. Should it be static?
   drivers/scsi/mpt3sas/mpt3sas_config.c:2437:1: sparse: sparse: symbol 'mpt3sas_config_update_driver_trigger_pg4' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
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: 36094 bytes --]

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg4 can be static
  2020-11-24  3:50 ` [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4 Suganath Prabu S
@ 2020-11-24 12:05     ` kernel test robot
  2020-11-24 12:05     ` kernel test robot
  2020-11-24 12:05     ` kernel test robot
  2 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 12:05 UTC (permalink / raw)
  To: Suganath Prabu S, linux-scsi, martin.petersen
  Cc: kbuild-all, Sathya.Prakash, sreekanth.reddy, Suganath Prabu S


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index c3aaaab15b311c..8726f448d81c4d 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -2391,7 +2391,7 @@ mpt3sas_config_get_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage4_t *config_page)
 {

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

* [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg4 can be static
@ 2020-11-24 12:05     ` kernel test robot
  0 siblings, 0 replies; 41+ messages in thread
From: kernel test robot @ 2020-11-24 12:05 UTC (permalink / raw)
  To: kbuild-all

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


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 mpt3sas_config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
index c3aaaab15b311c..8726f448d81c4d 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -2391,7 +2391,7 @@ mpt3sas_config_get_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
  *
  * Returns 0 for success, non-zero for failure.
  */
-int
+static int
 _config_set_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc,
 	Mpi2ConfigReply_t *mpi_reply, Mpi26DriverTriggerPage4_t *config_page)
 {

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

end of thread, other threads:[~2020-11-24 12:07 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24  3:50 [PATCH 0/8] mpt3sas: Features to enhance driver debugging Suganath Prabu S
2020-11-24  3:50 ` [PATCH 1/8] mpt3sas: Sync time stamp periodically between Driver and FW Suganath Prabu S
2020-11-24  7:46   ` kernel test robot
2020-11-24  7:46     ` kernel test robot
2020-11-24  3:50 ` [PATCH 2/8] mpt3sas: Add persistent trigger pages support Suganath Prabu S
2020-11-24  6:34   ` kernel test robot
2020-11-24  6:34     ` kernel test robot
2020-11-24  8:41   ` kernel test robot
2020-11-24  8:41     ` kernel test robot
2020-11-24  8:41   ` [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg0 can be static kernel test robot
2020-11-24  8:41     ` kernel test robot
2020-11-24  3:50 ` [PATCH 3/8] mpt3sas: Add master triggers persistent Trigger Page Suganath Prabu S
2020-11-24  7:48   ` kernel test robot
2020-11-24  7:48     ` kernel test robot
2020-11-24  9:25   ` kernel test robot
2020-11-24  9:25     ` kernel test robot
2020-11-24  9:25   ` [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg1 can be static kernel test robot
2020-11-24  9:25     ` kernel test robot
2020-11-24  3:50 ` [PATCH 4/8] mpt3sas: Add Event triggers persistent Trigger Page2 Suganath Prabu S
2020-11-24  8:40   ` kernel test robot
2020-11-24  8:40     ` kernel test robot
2020-11-24 10:24   ` kernel test robot
2020-11-24 10:24     ` kernel test robot
2020-11-24 10:24   ` [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg2 can be static kernel test robot
2020-11-24 10:24     ` kernel test robot
2020-11-24  3:50 ` [PATCH 5/8] mpt3sas: Add SCSI sense triggers persistent Trigger Page3 Suganath Prabu S
2020-11-24  9:52   ` kernel test robot
2020-11-24  9:52     ` kernel test robot
2020-11-24 11:09   ` kernel test robot
2020-11-24 11:09     ` kernel test robot
2020-11-24 11:09   ` [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg3 can be static kernel test robot
2020-11-24 11:09     ` kernel test robot
2020-11-24  3:50 ` [PATCH 6/8] mpt3sas: Add MPI triggers persistent Trigger Page4 Suganath Prabu S
2020-11-24 11:03   ` kernel test robot
2020-11-24 11:03     ` kernel test robot
2020-11-24 12:05   ` kernel test robot
2020-11-24 12:05     ` kernel test robot
2020-11-24 12:05   ` [RFC PATCH] mpt3sas: _config_set_driver_trigger_pg4 can be static kernel test robot
2020-11-24 12:05     ` kernel test robot
2020-11-24  3:50 ` [PATCH 7/8] mpt3sas: Handle trigger page support after reset Suganath Prabu S
2020-11-24  3:50 ` [PATCH 8/8] mpt3sas: Update driver version to 36.100.00.00 Suganath Prabu S

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.