mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Yauhen Kharuzhy <jekhor@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH v2] extcon-intel-cht-wc: Don't reset USB data connection at probe
Date: Fri, 20 Sep 2019 16:42:04 +0900	[thread overview]
Message-ID: <8435e5df-711b-1669-0980-2ae49c6c412d@samsung.com> (raw)
In-Reply-To: <CAHp75VeRBW4W0vEr+KZzdJWMf5ANQP_LEAXXK8SPC8BC+97Yyg@mail.gmail.com>

Hi Andy,

On 19. 9. 18. 오후 4:17, Andy Shevchenko wrote:
> On Wed, Sep 18, 2019 at 2:04 AM Yauhen Kharuzhy <jekhor@gmail.com> wrote:
>>
>> On Tue, Sep 17, 2019 at 02:13:22PM +0300, Andy Shevchenko wrote:
>>> On Tue, Sep 17, 2019 at 12:15:36AM +0300, Yauhen Kharuzhy wrote:
>>>> Intel Cherry Trail Whiskey Cove extcon driver connect USB data lines to
>>>> PMIC at driver probing for further charger detection. This causes reset of
>>>> USB data sessions and removing all devices from bus. If system was
>>>> booted from Live CD or USB dongle, this makes system unusable.
>>>>
>>>> Check if USB ID pin is floating and re-route data lines in this case
>>>> only, don't touch otherwise.
>>>
>>>> +   ret = regmap_read(ext->regmap, CHT_WC_PWRSRC_STS, &pwrsrc_sts);
>>>> +   if (ret) {
>>>> +           dev_err(ext->dev, "Error reading pwrsrc status: %d\n", ret);
>>>> +           goto disable_sw_control;
>>>> +   }
>>>> +
>>>> +   id = cht_wc_extcon_get_id(ext, pwrsrc_sts);
>>>
>>> We have second implementation of this. Would it make sense to split to some
>>> helper?
>>
>> Do you mean the combination of regmap_read(...CHT_WC_PWRSRC_STS,
>> &pwrsrc_sts) with cht_wc_extcon_get_id()?
> 
> Yes.
> 
>> In the cht_wc_extcon_pwrsrc_event() function the pwrsrc_sts is checked
>> for other bits also, so separation of PWRSRC_STS read and id calculation
>> to one routine will cause non-clear function calls like as
>> get_powersrc_and_check_id(..., &powersrc_sts, &id) which is not looks
>> better than current code duplication.
> 
> I see. Thanks for answer.
> 
>> Or we need to spend some time for
>> refactoring and testing of cht_wc_extcon_pwrsrc_event() code.
> 
> Perhaps, In any case I'm not objecting of the current approach.
> 

If you think it is OK, could you reply with your tag?
and I'll fix the multi-line comment by myself.


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

  reply	other threads:[~2019-09-20  7:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16 21:15 Yauhen Kharuzhy
2019-09-16 21:15 ` [PATCH v2] " Yauhen Kharuzhy
2019-09-17  6:22   ` Hans de Goede
2019-09-17 11:13   ` Andy Shevchenko
2019-09-17 13:25     ` Yauhen Kharuzhy
2019-09-18  7:17       ` Andy Shevchenko
2019-09-20  7:42         ` Chanwoo Choi [this message]
2019-09-20  8:25   ` Andy Shevchenko
2019-09-20  8:43   ` Chanwoo Choi

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=8435e5df-711b-1669-0980-2ae49c6c412d@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=jekhor@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.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

all inboxes | Powered by JetHome®