linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erwan Velu <erwanaliasr1@gmail.com>
To: elliott@hpe.com
Cc: Erwan Velu <e.velu@criteo.com>,
	Don Brace <don.brace@microsemi.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	esc.storagedev@microsemi.com (open list:MICROSEMI SMART ARRAY
	SMARTPQI DRIVER (smartpqi)),
	linux-scsi@vger.kernel.org (open list:MICROSEMI SMART ARRAY
	SMARTPQI DRIVER (smartpqi)),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2] scsi: smartpqi_init: Reporting 'logical unit failure'
Date: Fri,  1 Mar 2019 15:58:32 +0100	[thread overview]
Message-ID: <20190301145832.12735-1-e.velu@criteo.com> (raw)
In-Reply-To: <20190227163133.26283-1-e.velu@criteo.com>

When the HARDWARE_ERROR/0x3e/0x1 case is triggered, the logical volume is offlined.
When reading the kernel log, the reason why the device got offlined isn't reported to the user.
This situation makes difficult for admins to estimate the root cause of the issue they analize.

Reading this part of the code makes clear this is because driver received a HARDWARE_ERROR/0x3e/0x1 which is a 'logical unit failure'.
This patch is just about reporting the reason behind the offlining to ease the analyse.

Signed-off-by: Erwan Velu <e.velu@criteo.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index f564af8949e8..dfc4a6813440 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2764,6 +2764,12 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request)
 				sshdr.sense_key == HARDWARE_ERROR &&
 				sshdr.asc == 0x3e &&
 				sshdr.ascq == 0x1) {
+			struct pqi_ctrl_info *ctrl_info = shost_to_hba(scmd->device->host);
+			struct pqi_scsi_dev *device = scmd->device->hostdata;
+
+			dev_err_ratelimited(&ctrl_info->pci_dev->dev, "received 'logical unit failure' from controller for scsi %d:%d:%d:%d\n",
+							ctrl_info->scsi_host->host_no, device->bus,
+							device->target, device->lun);
 			pqi_take_device_offline(scmd->device, "RAID");
 			host_byte = DID_NO_CONNECT;
 		}
-- 
2.20.1


  parent reply	other threads:[~2019-03-01 14:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 16:31 [PATCH] scsi: smartpqi_init: Reporting 'logical unit failure' Erwan Velu
2019-02-28 13:09 ` Erwan Velu
2019-02-28 20:03 ` Elliott, Robert (Persistent Memory)
2019-03-01 14:59   ` Erwan Velu
2019-03-01 14:58 ` Erwan Velu [this message]
2019-03-01 15:26   ` [PATCH v2] " James Bottomley
2019-03-01 15:43     ` Erwan Velu
2019-03-01 15:56       ` James Bottomley
2019-03-01 16:00         ` Erwan Velu
2019-03-01 16:08         ` [PATCH v3] " Erwan Velu
2019-03-05 22:30           ` Don.Brace
2019-03-06 17:34           ` Martin K. Petersen
2019-03-11 16:36             ` Erwan Velu
2019-03-11 16:43             ` Erwan Velu

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20190301145832.12735-1-e.velu@criteo.com \
    --to=erwanaliasr1@gmail.com \
    --cc=don.brace@microsemi.com \
    --cc=e.velu@criteo.com \
    --cc=elliott@hpe.com \
    --cc=esc.storagedev@microsemi.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).