From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <87sh2n9led.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: Re: [PATCH v3 3/3] usb: renesas_usbhs: Add multiple clocks management In-Reply-To: <1536213014-1325-4-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536213014-1325-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> <1536213014-1325-4-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Date: Thu, 6 Sep 2018 06:49:47 +0000 To: Yoshihiro Shimoda Cc: balbi@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org List-ID: Hi Shimoda-san > R-Car Gen3 needs to enable clocks of both host and peripheral. > Since [eo]hci-platform disables the reset(s) when the drivers are > removed, renesas_usbhs driver doesn't work correctly. To fix this > issue, this patch adds multiple clocks management on this > renesas_usbhs driver. > > Signed-off-by: Yoshihiro Shimoda > --- (snip) > + /* enable clks if exist */ > + if (priv->num_clks && > + clk_bulk_prepare_enable(priv->num_clks, priv->clks)) > + return; (snip) > + /* disable clks if exist */ > + if (priv->num_clks) > + clk_bulk_disable_unprepare(priv->num_clks, priv->clks); I think clk_bulk_xxx() will do nothing if priv->num_clks was 0. priv->num_clks check is not neede, I think. Best regards --- Kuninori Morimoto From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relmlor4.renesas.com ([210.160.252.174]:26605 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725851AbeIFLXu (ORCPT ); Thu, 6 Sep 2018 07:23:50 -0400 Message-ID: <87sh2n9led.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Yoshihiro Shimoda Cc: , , , , , , Subject: Re: [PATCH v3 3/3] usb: renesas_usbhs: Add multiple clocks management In-Reply-To: <1536213014-1325-4-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536213014-1325-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> <1536213014-1325-4-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Date: Thu, 6 Sep 2018 06:49:47 +0000 Sender: linux-renesas-soc-owner@vger.kernel.org List-ID: Hi Shimoda-san > R-Car Gen3 needs to enable clocks of both host and peripheral. > Since [eo]hci-platform disables the reset(s) when the drivers are > removed, renesas_usbhs driver doesn't work correctly. To fix this > issue, this patch adds multiple clocks management on this > renesas_usbhs driver. > > Signed-off-by: Yoshihiro Shimoda > --- (snip) > + /* enable clks if exist */ > + if (priv->num_clks && > + clk_bulk_prepare_enable(priv->num_clks, priv->clks)) > + return; (snip) > + /* disable clks if exist */ > + if (priv->num_clks) > + clk_bulk_disable_unprepare(priv->num_clks, priv->clks); I think clk_bulk_xxx() will do nothing if priv->num_clks was 0. priv->num_clks check is not neede, I think. Best regards --- Kuninori Morimoto From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: [v3,3/3] usb: renesas_usbhs: Add multiple clocks management From: Kuninori Morimoto Message-Id: <87sh2n9led.wl-kuninori.morimoto.gx@renesas.com> Date: Thu, 6 Sep 2018 06:49:47 +0000 To: Yoshihiro Shimoda Cc: balbi@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org List-ID: SGkgU2hpbW9kYS1zYW4KCj4gUi1DYXIgR2VuMyBuZWVkcyB0byBlbmFibGUgY2xvY2tzIG9mIGJv dGggaG9zdCBhbmQgcGVyaXBoZXJhbC4KPiBTaW5jZSBbZW9daGNp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