linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Amjad Ouled-Ameur <aouledameur@baylibre.com>
Cc: Kevin Hilman <khilman@baylibre.com>,
	Felipe Balbi <balbi@kernel.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-amlogic@lists.infradead.org,
	Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [PATCH 3/3] phy: amlogic: meson8b-usb2: fix shared reset control use
Date: Sat, 14 Nov 2020 20:11:59 +0100	[thread overview]
Message-ID: <CAFBinCA6_Cei5QdiVRTX14S5QFoyDgAOhFUXtnx5uiAxuTRs9A@mail.gmail.com> (raw)
In-Reply-To: <20201113000508.14702-4-aouledameur@baylibre.com>

Hi Amjad,

On Fri, Nov 13, 2020 at 1:07 AM Amjad Ouled-Ameur
<aouledameur@baylibre.com> wrote:
[...]
>         ret = clk_prepare_enable(priv->clk_usb);
>         if (ret) {
>                 dev_err(&phy->dev, "Failed to enable USB DDR clock\n");
> +               reset_control_rearm(priv->reset);
this should come after reset_control_rearm so we're cleaning up in
reverse order of initializing things
(in this case it probably makes no difference since
reset_control_rearm is not touching any registers, but I'd still have
it in the correct order to not confuse future developers)

>                 clk_disable_unprepare(priv->clk_usb_general);
>                 return ret;
>         }
> @@ -197,6 +199,7 @@ static int phy_meson8b_usb2_power_on(struct phy *phy)
>                         regmap_read(priv->regmap, REG_ADP_BC, &reg);
>                         if (reg & REG_ADP_BC_ACA_PIN_FLOAT) {
>                                 dev_warn(&phy->dev, "USB ID detect failed!\n");
> +                               reset_control_rearm(priv->reset);
same here, reset_control_rearm should be after clk_disable_unprepare

>                                 clk_disable_unprepare(priv->clk_usb);
>                                 clk_disable_unprepare(priv->clk_usb_general);
>                                 return -EINVAL;
> @@ -216,6 +219,7 @@ static int phy_meson8b_usb2_power_off(struct phy *phy)
>                                    REG_DBG_UART_SET_IDDQ,
>                                    REG_DBG_UART_SET_IDDQ);
>
> +       reset_control_rearm(priv->reset);
same here, reset_control_rearm should be after clk_disable_unprepare

>         clk_disable_unprepare(priv->clk_usb);
>         clk_disable_unprepare(priv->clk_usb_general);


Best regards,
Martin

  reply	other threads:[~2020-11-14 19:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13  0:05 [PATCH 0/3] usb: meson: fix shared reset control use Amjad Ouled-Ameur
2020-11-13  0:05 ` [PATCH 1/3] phy: amlogic: phy-meson-gxl-usb2: fix shared reset controller use Amjad Ouled-Ameur
2020-11-14 19:13   ` Martin Blumenstingl
2020-11-17  9:16     ` Amjad Ouled-Ameur
2020-11-13  0:05 ` [PATCH 2/3] usb: dwc3: meson-g12a: fix shared reset control use Amjad Ouled-Ameur
2020-11-13  0:05 ` [PATCH 3/3] phy: amlogic: meson8b-usb2: " Amjad Ouled-Ameur
2020-11-14 19:11   ` Martin Blumenstingl [this message]
2020-11-17  9:13     ` Amjad Ouled-Ameur
2020-11-23  9:29 ` [PATCH 0/3] usb: meson: " Amjad Ouled-Ameur
2020-12-01  0:05   ` Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFBinCA6_Cei5QdiVRTX14S5QFoyDgAOhFUXtnx5uiAxuTRs9A@mail.gmail.com \
    --to=martin.blumenstingl@googlemail.com \
    --cc=aouledameur@baylibre.com \
    --cc=balbi@kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).