[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99B4C6BADD9E3241B25E52B02BA737C54116242D@DGGEMA505-MBS.china.huawei.com>
Date: Thu, 18 May 2017 07:24:53 +0000
From: songxiaowei <songxiaowei@...ilicon.com>
To: Arnd Bergmann <arnd@...db.de>
CC: Bjorn Helgaas <bhelgaas@...gle.com>, Kishon <kishon@...com>,
Jingoo Han <jingoohan1@...il.com>,
Tomasz Nowicki <tn@...ihalf.com>,
Keith Busch <keith.busch@...el.com>,
"niklas.cassel@...s.com" <niklas.cassel@...s.com>,
Duc Dang <dhdang@....com>,
"liudongdong (C)" <liudongdong3@...wei.com>,
"Chenfeng (puck)" <puck.chen@...ilicon.com>,
Guodong Xu <guodong.xu@...aro.org>,
Wangbinghui <wangbinghui@...ilicon.com>,
Suzhuangluan <suzhuangluan@...ilicon.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-pci <linux-pci@...r.kernel.org>
Subject: 答复: [PATCH 1/2] PCI: dwc: kirin: add PCIe Driver for HiSilicon Kirin SoC
-----邮件原件-----
发件人: arndbergmann@...il.com [mailto:arndbergmann@...il.com] 代表 Arnd Bergmann
发送时间: 2017年5月18日 4:29
收件人: songxiaowei
抄送: Bjorn Helgaas; Kishon; Jingoo Han; Tomasz Nowicki; Keith Busch; niklas.cassel@...s.com; Duc Dang; liudongdong (C); Chenfeng (puck); Guodong Xu; Wangbinghui; Suzhuangluan; Linux Kernel Mailing List; linux-pci
主题: Re: [PATCH 1/2] PCI: dwc: kirin: add PCIe Driver for HiSilicon Kirin SoC
On Fri, May 12, 2017 at 3:51 AM, Song Xiaowei <songxiaowei@...ilicon.com> wrote:
> From: songxiaowei <songxiaowei@...ilicon.com>
Looks good overall, just a few details:
Please fix your ~/.gitconfig to contain the same real name ("Song Xiaowei"
instead of "songxiaowei") that you use for sending the emails.
> +
> +static int kirin_pcie_phy_init(struct kirin_pcie *kirin_pcie) {
...
> + reg_val = kirin_apb_phy_readl(kirin_pcie, 0x400);
> + while (reg_val & pipe_clk_stable) {
> + udelay(100);
> + if (time == 0) {
> + dev_err(kirin_pcie->pci->dev, "PIPE clk is not stable\n");
> + return -EINVAL;
> + }
> + time--;
> + reg_val = kirin_apb_phy_readl(kirin_pcie, 0x400);
> + }
If this is not called with interrupts disabled, please use a sleeping function (e.g. msleep(1)) as the delay and compare against ktime_before() to see how much total time has expired when waiting for a timeout, instead of using a counter.
Since the time of pipe clk stable is from 450us to 520us, I think function usleep_range is better.
The patches is going to be updated.
-Xiaowei.
> diff --git a/drivers/pci/dwc/pcie-kirin.h
> b/drivers/pci/dwc/pcie-kirin.h new file mode 100644 index
> 000000000000..ad9a3b427298
> --- /dev/null
> +++ b/drivers/pci/dwc/pcie-kirin.h
> @@ -0,0 +1,79 @@
> +/*
> + * PCIe host controller driver for Kirin 960 SoCs
> + *
> + * Copyright (C) 2015 Huawei Electronics Co., Ltd.
> + * http://www.huawei.com
> + *
> + * Author: Xiaowei Song <songxiaowei@...wei.com>
The header is only used in one .c file, so just remove it and add the contents to that file.
Arnd
Powered by blists - more mailing lists