Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1566362ybl; Sun, 19 Jan 2020 06:09:03 -0800 (PST) X-Google-Smtp-Source: APXvYqz+iGXWxGdQXIAVpRWmLLtcuXU9t/tRUD2Uzef5NE5IE6SJtfr1eT2t0f6sJbGHm9MTfK0U X-Received: by 2002:a05:6830:18ce:: with SMTP id v14mr12576450ote.36.1579442943629; Sun, 19 Jan 2020 06:09:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579442943; cv=none; d=google.com; s=arc-20160816; b=TiwXSUUEa7RHNIKIpmkGAK82ub663N/CBdPaTYcB+FEa6ZwUkFYSuH2nhzmggFCL7r 8AwfUOYUlHL7XiU9/nSv6S0D5hmoUnHihxCZjzCJbFls8r/5tCI0Hrwjj2WBPuaXUAfv 8WPUj+2I4C8xnwfHxqv2TQ2ZIRLuHKgd0w++cVaYLq65gR6waG7IylmfHRgvTfTHys1D jV9l6odacghu+Upq+OE6NVBaqR55y1vmWFz2ohxK+HI6kbUuWQos4PayQezZHdupu6AP jlL8a0GKpcp/jAHcMFNRot+L9Tll2GbPbUTtI98lAiFOaodQjztrM90HySPekRB6rUq/ 49Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zQ9s6aXRXnoAgbGD22gB4cMgUN7RxJiXOnF2aQocl4w=; b=yvgk9iz+WYmj7XvrCMrtrAx/KeDkqR39bvNnDefaj2Xe/iToswNirntCqblJ4XLU16 eyhDS+F/oi1Hcstoc1oc6JViQvxwtYTlY/+e0B+zAxX7z34bXXiRivTr1t8FMXTGtXLR PQuf3i0PmM0G+8Qi9PqFn7x2oM1fPqS0YU9CnY9ZUTe7sBZprPBl/flFfbo7IeJyLBl8 HgHJ7TRMvw1SL/dVur98ObFjfAztvTgCZrzuVv/eU+MyZhHecHeS0+6yXLdfJslJ9x5V 6jB6C6Unh95KlnVKS34WhCD91oUkasI7Mogduv5I1U5wpvf4KoJDeFRkJ/2Qm8p03i5D OQEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D4HYewrw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si10533525otk.91.2020.01.19.06.08.51; Sun, 19 Jan 2020 06:09:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D4HYewrw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbgASOFv (ORCPT + 99 others); Sun, 19 Jan 2020 09:05:51 -0500 Received: from mail-vk1-f194.google.com ([209.85.221.194]:40474 "EHLO mail-vk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbgASOFu (ORCPT ); Sun, 19 Jan 2020 09:05:50 -0500 Received: by mail-vk1-f194.google.com with SMTP id c129so7874428vkh.7; Sun, 19 Jan 2020 06:05:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zQ9s6aXRXnoAgbGD22gB4cMgUN7RxJiXOnF2aQocl4w=; b=D4HYewrwAwcrLYakl62CNJiFBQ21pi4ZSSvdtblf5pnIkzSU7vQ+QY6eS6wSb8soGu tWXzPn5F/se0Rt6m2pey0k3xdLx/CPVJvnLKhitOq7+owIV1+R5iZeE5z4pSsJNCkf8w 9cApU/2Bw8FkyDzMqpEWX1fm7IyJ5SQEn57J5Qk85uadJEJsl5oX8erdX/F+tAUnEiLI ooIHwdS/TjwcABk0pNszo9xzH0Tfl3ocK7J89gLrm95DRPpMbOH2bo5WXnN2Ez8myrue G2GYZx1QKuIkjbZyo+WNcvLRqhBtqXcAVgmIJZ18tFRm1rwxDn2FtSvje/bPn2pnzNAZ L/JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zQ9s6aXRXnoAgbGD22gB4cMgUN7RxJiXOnF2aQocl4w=; b=dpeMcGSimXEUIxpd9g7u21AwwwOEdegYzuJYXRYeHwtf/eUguYuzFhU0lliujKpceM 7ZPsmhrSw4dXtTxWjXwVVF8pVGfQRWw/2JrzO+21MRN+//KNKgyt/InRFQTE3fKcjw3u Mtjs/221ZD8gTYgH23wCLWXSzCjMeQ9O1IR5C06YUQtyGrT0Htn7JFDwfOy8b3BpQbHA 2qJ51/QeKilwhcmZl5t/0tNR7OCxt13vtdavnOTkBT2dxb13uOTlxiRYrQ0J7uIv0PMw 2oxglKmUOrHvx4373AzxnbCKKKE42HJ8+bnhw9wGtV43Cu7sz4jOu1wNV57zPVTXTEe3 V2sg== X-Gm-Message-State: APjAAAUb9RyanqRz2zUW6XEWW0yfkAvx7mAEnUz4rrQXJnesvF8CJE05 LwTcD5keTT0Gkfg8I+ibYYaCvbuBkuncWvcDwHI= X-Received: by 2002:a1f:8f44:: with SMTP id r65mr7356012vkd.8.1579442749175; Sun, 19 Jan 2020 06:05:49 -0800 (PST) MIME-Version: 1.0 References: <20200117035108.19699-1-stanley.chu@mediatek.com> <20200117035108.19699-2-stanley.chu@mediatek.com> In-Reply-To: <20200117035108.19699-2-stanley.chu@mediatek.com> From: Alim Akhtar Date: Sun, 19 Jan 2020 19:35:12 +0530 Message-ID: Subject: Re: [PATCH v1 1/3] scsi: ufs-mediatek: add dbg_register_dump implementation To: Stanley Chu Cc: linux-scsi@vger.kernel.org, "Martin K. Petersen" , Avri Altman , Alim Akhtar , "James E.J. Bottomley" , "Bean Huo (beanhuo)" , asutoshd@codeaurora.org, Can Guo , Matthias Brugger , Bart Van Assche , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, open list , Kuohong Wang , peter.wang@mediatek.com, chun-hung.wu@mediatek.com, andy.teng@mediatek.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stanley On Fri, Jan 17, 2020 at 9:44 AM Stanley Chu wrote: > > Add dbg_register_dump variant vendor implementation in MediaTek > UFS driver. > > Signed-off-by: Stanley Chu > --- Reviewed-by: Alim Akhtar > drivers/scsi/ufs/ufs-mediatek.c | 16 ++++++++++++++++ > drivers/scsi/ufs/ufs-mediatek.h | 5 +++++ > 2 files changed, 21 insertions(+) > > diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c > index 8d999c0e60fe..d5194d0c4ef5 100644 > --- a/drivers/scsi/ufs/ufs-mediatek.c > +++ b/drivers/scsi/ufs/ufs-mediatek.c > @@ -406,6 +406,21 @@ static int ufs_mtk_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) > return 0; > } > > +static void ufs_mtk_dbg_register_dump(struct ufs_hba *hba) > +{ > + ufshcd_dump_regs(hba, REG_UFS_REFCLK_CTRL, 0x4, "Ref-Clk Ctrl "); > + > + ufshcd_dump_regs(hba, REG_UFS_EXTREG, 0x4, "Ext Reg "); > + > + ufshcd_dump_regs(hba, REG_UFS_MPHYCTRL, > + REG_UFS_REJECT_MON - REG_UFS_MPHYCTRL + 4, > + "MPHY Ctrl "); > + > + /* Direct debugging information to REG_MTK_PROBE */ > + ufshcd_writel(hba, 0x20, REG_UFS_DEBUG_SEL); > + ufshcd_dump_regs(hba, REG_UFS_PROBE, 0x4, "Debug Probe "); > +} > + > static int ufs_mtk_apply_dev_quirks(struct ufs_hba *hba, > struct ufs_dev_desc *card) > { > @@ -430,6 +445,7 @@ static struct ufs_hba_variant_ops ufs_hba_mtk_vops = { > .apply_dev_quirks = ufs_mtk_apply_dev_quirks, > .suspend = ufs_mtk_suspend, > .resume = ufs_mtk_resume, > + .dbg_register_dump = ufs_mtk_dbg_register_dump, > .device_reset = ufs_mtk_device_reset, > }; > > diff --git a/drivers/scsi/ufs/ufs-mediatek.h b/drivers/scsi/ufs/ufs-mediatek.h > index 31b7fead19eb..fccdd979d6fb 100644 > --- a/drivers/scsi/ufs/ufs-mediatek.h > +++ b/drivers/scsi/ufs/ufs-mediatek.h > @@ -13,6 +13,11 @@ > * Vendor specific UFSHCI Registers > */ > #define REG_UFS_REFCLK_CTRL 0x144 > +#define REG_UFS_EXTREG 0x2100 > +#define REG_UFS_MPHYCTRL 0x2200 > +#define REG_UFS_REJECT_MON 0x22AC > +#define REG_UFS_DEBUG_SEL 0x22C0 > +#define REG_UFS_PROBE 0x22C8 > > /* > * Ref-clk control > -- > 2.18.0 -- Regards, Alim