Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932753AbcLMBTv (ORCPT ); Mon, 12 Dec 2016 20:19:51 -0500 Received: from smtprelay0100.hostedemail.com ([216.40.44.100]:52793 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932560AbcLMBTt (ORCPT ); Mon, 12 Dec 2016 20:19:49 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2828:2892:2898:3138:3139:3140:3141:3142:3352:3622:3868:4250:4321:5007:6119:7904:10004:10400:10848:11026:11232:11473:11658:11914:12043:12048:12296:12438:12740:12760:13069:13311:13357:13439:14659:14721:14775:21080:30054:30070:30075:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: pig50_8fabcf65e611b X-Filterd-Recvd-Size: 2276 Message-ID: <1481591985.29291.15.camel@perches.com> Subject: Re: [PATCH v1 12/12] scsi: ufs: Improve fatal error logs From: Joe Perches To: Subhash Jadavani , vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Dolev Raviv , open list Date: Mon, 12 Dec 2016 17:19:45 -0800 In-Reply-To: <1481590599-17765-1-git-send-email-subhashj@codeaurora.org> References: <1481590599-17765-1-git-send-email-subhashj@codeaurora.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.1-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1329 Lines: 38 On Mon, 2016-12-12 at 16:56 -0800, Subhash Jadavani wrote: > Errors such as UIC error, illegal OCS values, and others may require > more information for debugging. Such information could be hibern8 events, > events sequences, recoverable errors, error history, and more. [] > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c [] > @@ -346,6 +346,37 @@ static inline void ufshcd_cond_add_cmd_trace(struct ufs_hba *hba, [] > +static void ufshcd_print_uic_err_hist(struct ufs_hba *hba, > + struct ufs_uic_err_reg_hist *err_hist, char *err_name) > +{ > + int i; > + > + for (i = 0; i < UIC_ERR_REG_HIST_LENGTH; i++) { > + int p = (i + err_hist->pos - 1) % UIC_ERR_REG_HIST_LENGTH; > + > + if (err_hist->reg[p] == 0) > + continue; > + dev_err(hba->dev, "%s[%d] = 0x%x at %lld us", err_name, i, > + err_hist->reg[p], ktime_to_us(err_hist->tstamp[p])); Please consistently use a terminating \n > + } > +} > + > static void ufshcd_print_host_regs(struct ufs_hba *hba) > { > /* > @@ -362,6 +393,21 @@ static void ufshcd_print_host_regs(struct ufs_hba *hba) > dev_err(hba->dev, > "hba->outstanding_reqs = 0x%x, hba->outstanding_tasks = 0x%x", > (u32)hba->outstanding_reqs, (u32)hba->outstanding_tasks); > + dev_err(hba->dev, > + "last_hibern8_exit_tstamp at %lld us, hibern8_exit_cnt = %d", etc...