linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Guenter Roeck <groeck@google.com>,
	Douglas Anderson <dianders@chromium.org>
Cc: Guenter Roeck <groeck@chromium.org>, Chris <zyw@rock-chips.com>,
	wulf <wulf@rock-chips.com>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] phy: rockchip-typec: Check for errors from tcphy_phy_init()
Date: Tue, 3 Oct 2017 15:11:04 +0530	[thread overview]
Message-ID: <07d21b93-e58b-c5e3-8b9e-7150c023c452@ti.com> (raw)
In-Reply-To: <CABXOdTdukST-8tRh6Z2mRTFYwseiknEzB7FL+uiz_PxYrYYjgw@mail.gmail.com>



On Saturday 30 September 2017 04:08 PM, Guenter Roeck wrote:
> On Fri, Sep 29, 2017 at 4:58 PM, Douglas Anderson <dianders@chromium.org> wrote:
>> The function tcphy_phy_init() could return an error but the callers
>> weren't checking the return value.  They should.  In at least one case
>> while testing I saw the message "wait pma ready timeout" which
>> indicates that tcphy_phy_init() really could return an error and we
>> should account for it.
>>
>> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> 
> Reviewed-by: Guenter Roeck <groeck@chromium.org>

merged, thanks!

-Kishon
> 
>> ---
>>
>>  drivers/phy/rockchip/phy-rockchip-typec.c | 13 +++++++++----
>>  1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
>> index 4d2c57f21d76..38831eebc934 100644
>> --- a/drivers/phy/rockchip/phy-rockchip-typec.c
>> +++ b/drivers/phy/rockchip/phy-rockchip-typec.c
>> @@ -685,8 +685,11 @@ static int rockchip_usb3_phy_power_on(struct phy *phy)
>>         if (tcphy->mode == new_mode)
>>                 goto unlock_ret;
>>
>> -       if (tcphy->mode == MODE_DISCONNECT)
>> -               tcphy_phy_init(tcphy, new_mode);
>> +       if (tcphy->mode == MODE_DISCONNECT) {
>> +               ret = tcphy_phy_init(tcphy, new_mode);
>> +               if (ret)
>> +                       goto unlock_ret;
>> +       }
>>
>>         /* wait TCPHY for pipe ready */
>>         for (timeout = 0; timeout < 100; timeout++) {
>> @@ -760,10 +763,12 @@ static int rockchip_dp_phy_power_on(struct phy *phy)
>>          */
>>         if (new_mode == MODE_DFP_DP && tcphy->mode != MODE_DISCONNECT) {
>>                 tcphy_phy_deinit(tcphy);
>> -               tcphy_phy_init(tcphy, new_mode);
>> +               ret = tcphy_phy_init(tcphy, new_mode);
>>         } else if (tcphy->mode == MODE_DISCONNECT) {
>> -               tcphy_phy_init(tcphy, new_mode);
>> +               ret = tcphy_phy_init(tcphy, new_mode);
>>         }
>> +       if (ret)
>> +               goto unlock_ret;
>>
>>         ret = readx_poll_timeout(readl, tcphy->base + DP_MODE_CTL,
>>                                  val, val & DP_MODE_A2, 1000,
>> --
>> 2.14.2.822.g60be5d43e6-goog
>>

      reply	other threads:[~2017-10-03  9:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 23:58 [PATCH] phy: rockchip-typec: Check for errors from tcphy_phy_init() Douglas Anderson
2017-09-30 10:38 ` Guenter Roeck
2017-10-03  9:41   ` Kishon Vijay Abraham I [this message]

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=07d21b93-e58b-c5e3-8b9e-7150c023c452@ti.com \
    --to=kishon@ti.com \
    --cc=dianders@chromium.org \
    --cc=groeck@chromium.org \
    --cc=groeck@google.com \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=wulf@rock-chips.com \
    --cc=zyw@rock-chips.com \
    /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).