Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752145AbdHHKrA (ORCPT ); Tue, 8 Aug 2017 06:47:00 -0400 Received: from mail-qt0-f178.google.com ([209.85.216.178]:34917 "EHLO mail-qt0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921AbdHHKq7 (ORCPT ); Tue, 8 Aug 2017 06:46:59 -0400 MIME-Version: 1.0 In-Reply-To: <20170802031742.60363-1-liwei213@huawei.com> References: <20170802031742.60363-1-liwei213@huawei.com> From: Ulf Hansson Date: Tue, 8 Aug 2017 12:46:57 +0200 Message-ID: Subject: Re: [PATCH v8 1/2] mmc: dw_mmc: move controller reset before driver init To: Li Wei Cc: Adrian Hunter , Jaehoon Chung , Shawn Lin , Wolfram Sang , Heiner Kallweit , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Guodong Xu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1756 Lines: 54 On 2 August 2017 at 05:17, Li Wei wrote: > This commit modifies dw_mci_probe(), it moves reset assertion before > drv_data->init(host) > > Some driver needs to access controller registers in its .init() ops. So, > in order to make such access safe, we should do controller reset before > .init() being called. > > Signed-off-by: Wei Li > Signed-off-by: Guodong Xu > Signed-off-by: Chen Jun This looks good to me. However, I need an ack from Jaehoon to pick this up. Kind regards Uffe > --- > drivers/mmc/host/dw_mmc.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c > index a9dfb26972f2..f2fa928e1a12 100644 > --- a/drivers/mmc/host/dw_mmc.c > +++ b/drivers/mmc/host/dw_mmc.c > @@ -3067,6 +3067,12 @@ int dw_mci_probe(struct dw_mci *host) > goto err_clk_ciu; > } > > + if (!IS_ERR(host->pdata->rstc)) { > + reset_control_assert(host->pdata->rstc); > + usleep_range(10, 50); > + reset_control_deassert(host->pdata->rstc); > + } > + > if (drv_data && drv_data->init) { > ret = drv_data->init(host); > if (ret) { > @@ -3076,12 +3082,6 @@ int dw_mci_probe(struct dw_mci *host) > } > } > > - if (!IS_ERR(host->pdata->rstc)) { > - reset_control_assert(host->pdata->rstc); > - usleep_range(10, 50); > - reset_control_deassert(host->pdata->rstc); > - } > - > setup_timer(&host->cmd11_timer, > dw_mci_cmd11_timer, (unsigned long)host); > > -- > 2.11.0 >