From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 780ABC33CA9 for ; Mon, 13 Jan 2020 18:59:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45A1821569 for ; Mon, 13 Jan 2020 18:59:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="BNqNTWFZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728689AbgAMS7Q (ORCPT ); Mon, 13 Jan 2020 13:59:16 -0500 Received: from mail25.static.mailgun.info ([104.130.122.25]:22597 "EHLO mail25.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbgAMS7P (ORCPT ); Mon, 13 Jan 2020 13:59:15 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1578941955; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=rEVhNoA+SMCklIOXL2qRZ8K89XUanuaNJQR/wOG0Dcw=; b=BNqNTWFZ3tEm1N2sQz2lFqVgStl7gzLUWXLjqAwyxBfPgWZYvMfXvgLu85NVPvN1m9QEQH4l bGiGOnNxwOw9oSd78RAiajAeAYovSAX0HmMjRIjqylHxphohldvbPclIECCUTIv/xkkG7xvq ErNyU94mVl1hj6SdEWgQmBTw0OA= X-Mailgun-Sending-Ip: 104.130.122.25 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e1cbdf9.7f3cda1446c0-smtp-out-n02; Mon, 13 Jan 2020 18:59:05 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BE30AC447A1; Mon, 13 Jan 2020 18:59:04 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: asutoshd) by smtp.codeaurora.org (Postfix) with ESMTPSA id 758BBC433CB; Mon, 13 Jan 2020 18:59:03 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 13 Jan 2020 10:59:03 -0800 From: asutoshd@codeaurora.org To: Stanley Chu Cc: linux-scsi@vger.kernel.org, martin.petersen@oracle.com, avri.altman@wdc.com, alim.akhtar@samsung.com, jejb@linux.ibm.com, beanhuo@micron.com, cang@codeaurora.org, matthias.bgg@gmail.com, bvanassche@acm.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kuohong.wang@mediatek.com, peter.wang@mediatek.com, chun-hung.wu@mediatek.com, andy.teng@mediatek.com Subject: Re: [PATCH v1 2/3] scsi: ufs: add device reset history for vendor implementations In-Reply-To: <1578147968-30938-3-git-send-email-stanley.chu@mediatek.com> References: <1578147968-30938-1-git-send-email-stanley.chu@mediatek.com> <1578147968-30938-3-git-send-email-stanley.chu@mediatek.com> Message-ID: <20ed97a2333ff27d5901c373579f710a@codeaurora.org> X-Sender: asutoshd@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-04 06:26, Stanley Chu wrote: > Device reset history shall be also added for vendor's device > reset variant operation implementation. > > Cc: Alim Akhtar > Cc: Asutosh Das > Cc: Avri Altman > Cc: Bart Van Assche > Cc: Bean Huo > Cc: Can Guo > Cc: Matthias Brugger > Signed-off-by: Stanley Chu > --- > drivers/scsi/ufs/ufshcd.c | 5 +++-- > drivers/scsi/ufs/ufshcd.h | 6 +++++- > 2 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index bae43da00bb6..29e3d50aabfb 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -4346,13 +4346,14 @@ static inline int > ufshcd_disable_device_tx_lcc(struct ufs_hba *hba) > return ufshcd_disable_tx_lcc(hba, true); > } > > -static void ufshcd_update_reg_hist(struct ufs_err_reg_hist *reg_hist, > - u32 reg) > +void ufshcd_update_reg_hist(struct ufs_err_reg_hist *reg_hist, > + u32 reg) > { > reg_hist->reg[reg_hist->pos] = reg; > reg_hist->tstamp[reg_hist->pos] = ktime_get(); > reg_hist->pos = (reg_hist->pos + 1) % UFS_ERR_REG_HIST_LENGTH; > } > +EXPORT_SYMBOL_GPL(ufshcd_update_reg_hist); > > /** > * ufshcd_link_startup - Initialize unipro link startup > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > index e05cafddc87b..de1be6a862b0 100644 > --- a/drivers/scsi/ufs/ufshcd.h > +++ b/drivers/scsi/ufs/ufshcd.h > @@ -805,6 +805,8 @@ int ufshcd_wait_for_register(struct ufs_hba *hba, > u32 reg, u32 mask, > u32 val, unsigned long interval_us, > unsigned long timeout_ms, bool can_sleep); > void ufshcd_parse_dev_ref_clk_freq(struct ufs_hba *hba, struct clk > *refclk); > +void ufshcd_update_reg_hist(struct ufs_err_reg_hist *reg_hist, > + u32 reg); > > static inline void check_upiu_size(void) > { > @@ -1083,8 +1085,10 @@ static inline void > ufshcd_vops_dbg_register_dump(struct ufs_hba *hba) > > static inline void ufshcd_vops_device_reset(struct ufs_hba *hba) > { > - if (hba->vops && hba->vops->device_reset) > + if (hba->vops && hba->vops->device_reset) { > hba->vops->device_reset(hba); > + ufshcd_update_reg_hist(&hba->ufs_stats.dev_reset, 0); > + } > } > > extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; Reviewed-by: Asutosh Das From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6150EC33CA9 for ; Mon, 13 Jan 2020 18:59:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2479521744 for ; Mon, 13 Jan 2020 18:59:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UR1e5DZz"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="HLp9DLKG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2479521744 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gwnEhxsVPOwJQwPkvHWpmDrjRyut+y8XwGxTrrcHq0c=; b=UR1e5DZz8h5h//G5FLImB3NRa YkIEdN859NuF0Cu8ZjfasPwr/SMRBOGujJG0AVX2DtlR3VbjWkwN36pyM1jcVEDUNS8r4Ocxl/EXW zqCMtMvpdJZ3ImxvOZJm/rwS3D5I/ySf9D61imbzB1Fw1vUE5b0UHKB7ODZMgSdWgUGbT0Nmc0CqT 2fPL4WRExUl/xjHogDJ/+dQj08VX17qf/YaL84LAhCrFIbaum5h3xHrgfWOs58N1rIl3Cb1lFRhWy c7mY3uaqFAiqwSYxkQihbdc9dmQ6wJLR33Yack3fFDZDIm5ownDReYgnBHIUj5yEW3yDyXaseELAk lTw5Cv6Cg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ir4vz-0001Pp-9q; Mon, 13 Jan 2020 18:59:31 +0000 Received: from mail26.static.mailgun.info ([104.130.122.26]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ir4vm-0001Ef-Lg for linux-mediatek@lists.infradead.org; Mon, 13 Jan 2020 18:59:20 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1578941959; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=rEVhNoA+SMCklIOXL2qRZ8K89XUanuaNJQR/wOG0Dcw=; b=HLp9DLKGIkgi62qAQLPRYClSKO16AcjWJK4FJN5+4wU7QiU2yKlEwCkc+CGhtiUtMye2zJbF En5+6Ry/Bi5ZslExl7cKxQSgbYYqCdq6gXw7PZ5MgJFRT7zxPtbUpjnIoG78pSYqIHciq5c9 jlLozHKYBrQwfJAz+CIvRBJEIkg= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0ZDIyMyIsICJsaW51eC1tZWRpYXRla0BsaXN0cy5pbmZyYWRlYWQub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e1cbdfa.7f83ae025fb8-smtp-out-n01; Mon, 13 Jan 2020 18:59:06 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id D2515C447A5; Mon, 13 Jan 2020 18:59:04 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: asutoshd) by smtp.codeaurora.org (Postfix) with ESMTPSA id 758BBC433CB; Mon, 13 Jan 2020 18:59:03 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 13 Jan 2020 10:59:03 -0800 From: asutoshd@codeaurora.org To: Stanley Chu Subject: Re: [PATCH v1 2/3] scsi: ufs: add device reset history for vendor implementations In-Reply-To: <1578147968-30938-3-git-send-email-stanley.chu@mediatek.com> References: <1578147968-30938-1-git-send-email-stanley.chu@mediatek.com> <1578147968-30938-3-git-send-email-stanley.chu@mediatek.com> Message-ID: <20ed97a2333ff27d5901c373579f710a@codeaurora.org> X-Sender: asutoshd@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_105919_144977_5570B596 X-CRM114-Status: GOOD ( 12.91 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-scsi@vger.kernel.org, martin.petersen@oracle.com, andy.teng@mediatek.com, jejb@linux.ibm.com, chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com, linux-kernel@vger.kernel.org, avri.altman@wdc.com, cang@codeaurora.org, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, beanhuo@micron.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 2020-01-04 06:26, Stanley Chu wrote: > Device reset history shall be also added for vendor's device > reset variant operation implementation. > > Cc: Alim Akhtar > Cc: Asutosh Das > Cc: Avri Altman > Cc: Bart Van Assche > Cc: Bean Huo > Cc: Can Guo > Cc: Matthias Brugger > Signed-off-by: Stanley Chu > --- > drivers/scsi/ufs/ufshcd.c | 5 +++-- > drivers/scsi/ufs/ufshcd.h | 6 +++++- > 2 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index bae43da00bb6..29e3d50aabfb 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -4346,13 +4346,14 @@ static inline int > ufshcd_disable_device_tx_lcc(struct ufs_hba *hba) > return ufshcd_disable_tx_lcc(hba, true); > } > > -static void ufshcd_update_reg_hist(struct ufs_err_reg_hist *reg_hist, > - u32 reg) > +void ufshcd_update_reg_hist(struct ufs_err_reg_hist *reg_hist, > + u32 reg) > { > reg_hist->reg[reg_hist->pos] = reg; > reg_hist->tstamp[reg_hist->pos] = ktime_get(); > reg_hist->pos = (reg_hist->pos + 1) % UFS_ERR_REG_HIST_LENGTH; > } > +EXPORT_SYMBOL_GPL(ufshcd_update_reg_hist); > > /** > * ufshcd_link_startup - Initialize unipro link startup > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > index e05cafddc87b..de1be6a862b0 100644 > --- a/drivers/scsi/ufs/ufshcd.h > +++ b/drivers/scsi/ufs/ufshcd.h > @@ -805,6 +805,8 @@ int ufshcd_wait_for_register(struct ufs_hba *hba, > u32 reg, u32 mask, > u32 val, unsigned long interval_us, > unsigned long timeout_ms, bool can_sleep); > void ufshcd_parse_dev_ref_clk_freq(struct ufs_hba *hba, struct clk > *refclk); > +void ufshcd_update_reg_hist(struct ufs_err_reg_hist *reg_hist, > + u32 reg); > > static inline void check_upiu_size(void) > { > @@ -1083,8 +1085,10 @@ static inline void > ufshcd_vops_dbg_register_dump(struct ufs_hba *hba) > > static inline void ufshcd_vops_device_reset(struct ufs_hba *hba) > { > - if (hba->vops && hba->vops->device_reset) > + if (hba->vops && hba->vops->device_reset) { > hba->vops->device_reset(hba); > + ufshcd_update_reg_hist(&hba->ufs_stats.dev_reset, 0); > + } > } > > extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; Reviewed-by: Asutosh Das _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4EFAC33CA9 for ; Mon, 13 Jan 2020 18:59:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2B9F21569 for ; Mon, 13 Jan 2020 18:59:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ot7KmMha"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="rdHuiu7l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2B9F21569 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bMRQ9l/uF2wLMK5ZafrMndVj0vkU7yXvvpBlY2MHzgs=; b=Ot7KmMha54DSDNIK6ib5/c6ek 4ceX5UNztCDdGnzfjLAL+RuVbYI/uGGGmqiAFoF14Bl91cEcsPso5IghwTWakvGQ8ZDfeT1LGFP4/ YX55DOlT823NJaMBGepXm2pObcXg0dnjl3aaxm3mUq/4t5m7+f6lKsaqwlWK/fUEA3y+jJNpmE0A4 QtPh/9kI7YyNEop2spS+2kXJ4znJuh5pQdkPH4yV232lpIANzYJ6bKEYMsQWuwh7G2sqEfzPrkldO 1jlfVPaKrCKuy9S6lNLnGma5OnM8hvJvunu6HpkZmTgnQKN2Xy+d004ANOr5n4oac6d/moR6SStf2 QCE8YkVig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ir4vp-0001Fo-BP; Mon, 13 Jan 2020 18:59:21 +0000 Received: from mail25.static.mailgun.info ([104.130.122.25]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ir4vl-0001Ec-Fs for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2020 18:59:19 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1578941958; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=rEVhNoA+SMCklIOXL2qRZ8K89XUanuaNJQR/wOG0Dcw=; b=rdHuiu7lgZkXohhgbFRqPIm/E4F7DjpvpIXG16Cx0Q58yMszUpD/2OYzmF07ZLhh7BNicWAi +yB0CSbhdpTjZpIs/hh2An+WIcJXtMfqbX6+dF4TRlqkThH77H6+sRxsncTpVXoBel5flxnq i+g6HmloB1cItkZPFVM4l88Nz60= X-Mailgun-Sending-Ip: 104.130.122.25 X-Mailgun-Sid: WyJiYzAxZiIsICJsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e1cbdfa.7f83ae025fb8-smtp-out-n01; Mon, 13 Jan 2020 18:59:06 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id D2515C447A5; Mon, 13 Jan 2020 18:59:04 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: asutoshd) by smtp.codeaurora.org (Postfix) with ESMTPSA id 758BBC433CB; Mon, 13 Jan 2020 18:59:03 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 13 Jan 2020 10:59:03 -0800 From: asutoshd@codeaurora.org To: Stanley Chu Subject: Re: [PATCH v1 2/3] scsi: ufs: add device reset history for vendor implementations In-Reply-To: <1578147968-30938-3-git-send-email-stanley.chu@mediatek.com> References: <1578147968-30938-1-git-send-email-stanley.chu@mediatek.com> <1578147968-30938-3-git-send-email-stanley.chu@mediatek.com> Message-ID: <20ed97a2333ff27d5901c373579f710a@codeaurora.org> X-Sender: asutoshd@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_105918_306966_F026514C X-CRM114-Status: GOOD ( 13.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-scsi@vger.kernel.org, martin.petersen@oracle.com, andy.teng@mediatek.com, jejb@linux.ibm.com, chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com, linux-kernel@vger.kernel.org, avri.altman@wdc.com, cang@codeaurora.org, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, beanhuo@micron.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-01-04 06:26, Stanley Chu wrote: > Device reset history shall be also added for vendor's device > reset variant operation implementation. > > Cc: Alim Akhtar > Cc: Asutosh Das > Cc: Avri Altman > Cc: Bart Van Assche > Cc: Bean Huo > Cc: Can Guo > Cc: Matthias Brugger > Signed-off-by: Stanley Chu > --- > drivers/scsi/ufs/ufshcd.c | 5 +++-- > drivers/scsi/ufs/ufshcd.h | 6 +++++- > 2 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index bae43da00bb6..29e3d50aabfb 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -4346,13 +4346,14 @@ static inline int > ufshcd_disable_device_tx_lcc(struct ufs_hba *hba) > return ufshcd_disable_tx_lcc(hba, true); > } > > -static void ufshcd_update_reg_hist(struct ufs_err_reg_hist *reg_hist, > - u32 reg) > +void ufshcd_update_reg_hist(struct ufs_err_reg_hist *reg_hist, > + u32 reg) > { > reg_hist->reg[reg_hist->pos] = reg; > reg_hist->tstamp[reg_hist->pos] = ktime_get(); > reg_hist->pos = (reg_hist->pos + 1) % UFS_ERR_REG_HIST_LENGTH; > } > +EXPORT_SYMBOL_GPL(ufshcd_update_reg_hist); > > /** > * ufshcd_link_startup - Initialize unipro link startup > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > index e05cafddc87b..de1be6a862b0 100644 > --- a/drivers/scsi/ufs/ufshcd.h > +++ b/drivers/scsi/ufs/ufshcd.h > @@ -805,6 +805,8 @@ int ufshcd_wait_for_register(struct ufs_hba *hba, > u32 reg, u32 mask, > u32 val, unsigned long interval_us, > unsigned long timeout_ms, bool can_sleep); > void ufshcd_parse_dev_ref_clk_freq(struct ufs_hba *hba, struct clk > *refclk); > +void ufshcd_update_reg_hist(struct ufs_err_reg_hist *reg_hist, > + u32 reg); > > static inline void check_upiu_size(void) > { > @@ -1083,8 +1085,10 @@ static inline void > ufshcd_vops_dbg_register_dump(struct ufs_hba *hba) > > static inline void ufshcd_vops_device_reset(struct ufs_hba *hba) > { > - if (hba->vops && hba->vops->device_reset) > + if (hba->vops && hba->vops->device_reset) { > hba->vops->device_reset(hba); > + ufshcd_update_reg_hist(&hba->ufs_stats.dev_reset, 0); > + } > } > > extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; Reviewed-by: Asutosh Das _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel