public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Samuel Holland <samuel@sholland.org>
To: Peter Geis <pgwipeout@gmail.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Vinod Koul <vkoul@kernel.org>
Cc: linux-phy@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: rockchip-inno-usb2: Sync initial otg state
Date: Wed, 22 Jun 2022 00:16:16 -0500	[thread overview]
Message-ID: <f252c182-e306-174e-dd32-51c9a406d3f7@sholland.org> (raw)
In-Reply-To: <20220622003140.30365-1-pgwipeout@gmail.com>

On 6/21/22 7:31 PM, Peter Geis wrote:
> The initial otg state for the phy defaults to device mode. The actual
> state isn't detected until an ID IRQ fires. Fix this by syncing the ID
> state during initialization.
> 
> Fixes: 51a9b2c03dd3 ("phy: rockchip-inno-usb2: Handle ID IRQ")
> Signed-off-by: Peter Geis <pgwipeout@gmail.com>

One comment below. Either way it fixes a bug, so:

Reviewed-by: Samuel Holland <samuel@sholland.org>

> ---
>  drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 6711659f727c..6e44069617df 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -1162,6 +1162,12 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
>  					EXTCON_USB_HOST, &rport->event_nb);
>  		if (ret)
>  			dev_err(rphy->dev, "register USB HOST notifier failed\n");
> +
> +		if (!of_property_read_bool(rphy->dev->of_node, "extcon")) {

Currently the IRQ handler does not care who created the extcon. We should at
least be consistent between here and there.

Regards,
Samuel

> +			/* do initial sync of usb state */
> +			ret = property_enabled(rphy->grf, &rport->port_cfg->utmi_id);
> +			extcon_set_state_sync(rphy->edev, EXTCON_USB_HOST, !ret);
> +		}
>  	}
>  
>  out:
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-06-22  5:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22  0:31 [PATCH] phy: rockchip-inno-usb2: Sync initial otg state Peter Geis
2022-06-22  5:16 ` Samuel Holland [this message]
2022-06-22  8:31   ` Peter Geis
2022-07-05  7:27 ` Vinod Koul
2022-07-26  8:54 ` Markus Reichl
     [not found] ` <88f2de00-32e3-ed74-082f-c0972a81f0f8@fivetechno.de>
2022-08-04  9:49   ` [BUG BISECT] " Peter Geis
2022-08-16  9:20     ` Michael Riesch
2022-08-16 15:27       ` Peter Geis
2022-08-17  8:25         ` Michael Riesch
2022-08-20 10:23           ` Peter Geis
2022-08-22  7:01             ` Michael Riesch
2022-08-22  9:28             ` Markus Reichl

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=f252c182-e306-174e-dd32-51c9a406d3f7@sholland.org \
    --to=samuel@sholland.org \
    --cc=heiko@sntech.de \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=pgwipeout@gmail.com \
    --cc=vkoul@kernel.org \
    /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