[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVwdb1J8j4JaeHhCmkSF4ozWN+EVh7f01MSaGOkSb9W0w@mail.gmail.com>
Date: Fri, 7 Jun 2019 15:23:07 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
Cc: Kishon Vijay Abraham I <kishon@...com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCH v2] phy: renesas: rcar-gen3-usb2: fix imbalance powered flag
Hi Shimoda-san,
Thanks for the update!
On Fri, Jun 7, 2019 at 12:07 PM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@...esas.com> wrote:
> The powered flag should be set for any other phys anyway. Also
> the flag should be locked by the channel. Otherwise, after we have
> revised the device tree for the usb phy, the following warning
> happened during a second system suspend. And if the driver doesn't
> lock the flag, enabling the regulator is possible to be imbalance
I think it reads better as:
..., an imbalance is possible when enabling the regulator ...
> during system resume. So, this patch fixes the issues.
> --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
> +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
> @@ -106,6 +107,7 @@ struct rcar_gen3_chan {
> struct rcar_gen3_phy rphys[NUM_OF_PHYS];
> struct regulator *vbus;
> struct work_struct work;
> + struct mutex lock;
It is always a good idea to document what is protected by the mutex:
struct mutex lock; /* protects rphys[...].powered */
Checkpatch does have a check for this, but unfortunately it is enabled for
drivers/net/, net/, and drivers/staging/ only:
CHECK: struct mutex definition without comment
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
and the imbalance is gone:
Tested-by: Geert Uytterhoeven <geert+renesas@...der.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists