diff mbox

[Utopic,SRU] ipr: don't log error messages when applications issues illegal requests

Message ID 1416441878-9491-1-git-send-email-tim.gardner@canonical.com
State New
Headers show

Commit Message

Tim Gardner Nov. 20, 2014, 12:04 a.m. UTC
From: "wenxiong@linux.vnet.ibm.com" <wenxiong@linux.vnet.ibm.com>

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

Failing Device information are logged when IOA firmware detected these
illegal request such as IOA firmware doesn't support inquiry with page
code 2. The patch fixes the issue.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Tested-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
(cherry picked from commit 3185ea63907cb281cfdc5aa29aa2d855826ad16a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/scsi/ipr.c | 10 ++++++++++
 drivers/scsi/ipr.h |  1 +
 2 files changed, 11 insertions(+)

Comments

Stefan Bader Nov. 20, 2014, 7:59 a.m. UTC | #1

Andy Whitcroft Nov. 20, 2014, 10:45 a.m. UTC | #2
On Wed, Nov 19, 2014 at 06:04:38PM -0600, tim.gardner@canonical.com wrote:
> From: "wenxiong@linux.vnet.ibm.com" <wenxiong@linux.vnet.ibm.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1392152
> 
> Failing Device information are logged when IOA firmware detected these
> illegal request such as IOA firmware doesn't support inquiry with page
> code 2. The patch fixes the issue.
> 
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> Tested-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> (cherry picked from commit 3185ea63907cb281cfdc5aa29aa2d855826ad16a)
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  drivers/scsi/ipr.c | 10 ++++++++++
>  drivers/scsi/ipr.h |  1 +
>  2 files changed, 11 insertions(+)
> 
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 924b0ba..2a9578c 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -2440,6 +2440,7 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
>  {
>  	u32 ioasc;
>  	int error_index;
> +	struct ipr_hostrcb_type_21_error *error;
>  
>  	if (hostrcb->hcam.notify_type != IPR_HOST_RCB_NOTIF_TYPE_ERROR_LOG_ENTRY)
>  		return;
> @@ -2464,6 +2465,15 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
>  	if (!ipr_error_table[error_index].log_hcam)
>  		return;
>  
> +	if (ioasc == IPR_IOASC_HW_CMD_FAILED &&
> +	    hostrcb->hcam.overlay_id == IPR_HOST_RCB_OVERLAY_ID_21) {
> +		error = &hostrcb->hcam.u.error64.u.type_21_error;
> +
> +		if (((be32_to_cpu(error->sense_data[0]) & 0x0000ff00) >> 8) == ILLEGAL_REQUEST &&
> +			ioa_cfg->log_level <= IPR_DEFAULT_LOG_LEVEL)
> +				return;
> +	}
> +
>  	ipr_hcam_err(hostrcb, "%s\n", ipr_error_table[error_index].error);
>  
>  	/* Set indication we have logged an error */
> diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
> index 31ed126..8f8960d0 100644
> --- a/drivers/scsi/ipr.h
> +++ b/drivers/scsi/ipr.h
> @@ -130,6 +130,7 @@
>  #define IPR_IOASC_HW_DEV_BUS_STATUS			0x04448500
>  #define	IPR_IOASC_IOASC_MASK			0xFFFFFF00
>  #define	IPR_IOASC_SCSI_STATUS_MASK		0x000000FF
> +#define IPR_IOASC_HW_CMD_FAILEd			0x046E0000
>  #define IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT	0x05240000
>  #define IPR_IOASC_IR_RESOURCE_HANDLE		0x05250000
>  #define IPR_IOASC_IR_NO_CMDS_TO_2ND_IOA		0x05258100


Looks simple enough, upstream cherry-pick:

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw
Andy Whitcroft Nov. 20, 2014, 10:52 a.m. UTC | #3
Applied to Utopic.

-apw
diff mbox

Patch

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 924b0ba..2a9578c 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -2440,6 +2440,7 @@  static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
 {
 	u32 ioasc;
 	int error_index;
+	struct ipr_hostrcb_type_21_error *error;
 
 	if (hostrcb->hcam.notify_type != IPR_HOST_RCB_NOTIF_TYPE_ERROR_LOG_ENTRY)
 		return;
@@ -2464,6 +2465,15 @@  static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
 	if (!ipr_error_table[error_index].log_hcam)
 		return;
 
+	if (ioasc == IPR_IOASC_HW_CMD_FAILED &&
+	    hostrcb->hcam.overlay_id == IPR_HOST_RCB_OVERLAY_ID_21) {
+		error = &hostrcb->hcam.u.error64.u.type_21_error;
+
+		if (((be32_to_cpu(error->sense_data[0]) & 0x0000ff00) >> 8) == ILLEGAL_REQUEST &&
+			ioa_cfg->log_level <= IPR_DEFAULT_LOG_LEVEL)
+				return;
+	}
+
 	ipr_hcam_err(hostrcb, "%s\n", ipr_error_table[error_index].error);
 
 	/* Set indication we have logged an error */
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 31ed126..8f8960d0 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -130,6 +130,7 @@ 
 #define IPR_IOASC_HW_DEV_BUS_STATUS			0x04448500
 #define	IPR_IOASC_IOASC_MASK			0xFFFFFF00
 #define	IPR_IOASC_SCSI_STATUS_MASK		0x000000FF
+#define IPR_IOASC_HW_CMD_FAILEd			0x046E0000
 #define IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT	0x05240000
 #define IPR_IOASC_IR_RESOURCE_HANDLE		0x05250000
 #define IPR_IOASC_IR_NO_CMDS_TO_2ND_IOA		0x05258100