From patchwork Sat Feb 4 00:58:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: subhashj@codeaurora.org X-Patchwork-Id: 9555415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C8E24602B7 for ; Sat, 4 Feb 2017 00:58:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B454827C0C for ; Sat, 4 Feb 2017 00:58:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7F9A28478; Sat, 4 Feb 2017 00:58:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54FAC27C0C for ; Sat, 4 Feb 2017 00:58:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753495AbdBDA6c (ORCPT ); Fri, 3 Feb 2017 19:58:32 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:44876 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753138AbdBDA6a (ORCPT ); Fri, 3 Feb 2017 19:58:30 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D7A66609C9; Sat, 4 Feb 2017 00:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1486169909; bh=3uNHuhhZoS9rp3LlvRd+LPO+xVUzJYoJajmbnGM6znc=; h=From:To:Cc:Subject:Date:From; b=a6MKmkXs3J+nSL7omfECgZmT+ti6eJmVAOeGyvuB/o6HPo0R9EMTQykWFawSASpDZ +P/6ZKCsq0pC5wWLfdijPUivigaWmMySHR1FYjd+hJhhwOVjD7488gre1gXz9FSucr V5axFyYQuWi80nvC64MNuWj9BYfs6bzr2QS+p4pI= Received: from pacamara-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: subhashj@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 41B8960953; Sat, 4 Feb 2017 00:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1486169909; bh=3uNHuhhZoS9rp3LlvRd+LPO+xVUzJYoJajmbnGM6znc=; h=From:To:Cc:Subject:Date:From; b=a6MKmkXs3J+nSL7omfECgZmT+ti6eJmVAOeGyvuB/o6HPo0R9EMTQykWFawSASpDZ +P/6ZKCsq0pC5wWLfdijPUivigaWmMySHR1FYjd+hJhhwOVjD7488gre1gXz9FSucr V5axFyYQuWi80nvC64MNuWj9BYfs6bzr2QS+p4pI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 41B8960953 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=subhashj@codeaurora.org From: Subhash Jadavani To: vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Venkat Gopalakrishnan , Subhash Jadavani , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 8/8] scsi: ufs: dump hw regs on link failures Date: Fri, 3 Feb 2017 16:58:24 -0800 Message-Id: <1486169904-22972-1-git-send-email-subhashj@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Venkat Gopalakrishnan Dump host state, power info and host/vendor specific registers on link failures. This provides useful info to debug the failures. Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Subhash Jadavani --- drivers/scsi/ufs/ufshcd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index a99a673..8b721f4 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3554,6 +3554,12 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd) ret = (status != PWR_OK) ? status : -1; } out: + if (ret) { + ufshcd_print_host_state(hba); + ufshcd_print_pwr_info(hba); + ufshcd_print_host_regs(hba); + } + spin_lock_irqsave(hba->host->host_lock, flags); hba->active_uic_cmd = NULL; hba->uic_async_done = NULL; @@ -4146,8 +4152,12 @@ static int ufshcd_link_startup(struct ufs_hba *hba) ret = ufshcd_make_hba_operational(hba); out: - if (ret) + if (ret) { dev_err(hba->dev, "link startup failed %d\n", ret); + ufshcd_print_host_state(hba); + ufshcd_print_pwr_info(hba); + ufshcd_print_host_regs(hba); + } return ret; }