mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Sometimes supports_usb_power_delivery reports incorrect value.
@ 2017-08-14 18:57 Badhri Jagan Sridharan
  2017-08-15 13:36 ` Heikki Krogerus
  0 siblings, 1 reply; 5+ messages in thread
From: Badhri Jagan Sridharan @ 2017-08-14 18:57 UTC (permalink / raw)
  To: Heikki Krogerus, Guenter Roeck; +Cc: USB, LKML

Hi Heikki,

While testing with different type-c phones available in the market,
With some phones, I noticed that supports_usb_power_delivery
reports "no" eventhough an explicit pd contract has been
established. After spending sometime debugging, I noticed that
the root cause of this is that the partner device(acting as source)
takes too long to send the SRC_CAP message. This makes the
underlying TCPM code to report usb_pd set to 0 while initially
calling typec_register_partner. However,since  there is no
provision in the type-c sysfs interface to update
supports_usb_power_delivery once the contract is established,
supports_usb_power_delivery is left to report "no" even if the partner
source device is at present performing Type-C PD.
Is it OK to add a api to enable updating supports_usb_power_delivery
node in the typec sysfs code after typec_register_partner has been
called ? Or do you have other suggestions ? Please advice.

Thanks & Regards,
Badhri.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Sometimes supports_usb_power_delivery reports incorrect value.
  2017-08-14 18:57 Sometimes supports_usb_power_delivery reports incorrect value Badhri Jagan Sridharan
@ 2017-08-15 13:36 ` Heikki Krogerus
  2017-08-15 14:13   ` Badhri Jagan Sridharan
  0 siblings, 1 reply; 5+ messages in thread
From: Heikki Krogerus @ 2017-08-15 13:36 UTC (permalink / raw)
  To: Badhri Jagan Sridharan; +Cc: Guenter Roeck, USB, LKML

Hi,

On Mon, Aug 14, 2017 at 11:57:15AM -0700, Badhri Jagan Sridharan wrote:
> Hi Heikki,
> 
> While testing with different type-c phones available in the market,
> With some phones, I noticed that supports_usb_power_delivery
> reports "no" eventhough an explicit pd contract has been
> established. After spending sometime debugging, I noticed that
> the root cause of this is that the partner device(acting as source)
> takes too long to send the SRC_CAP message. This makes the
> underlying TCPM code to report usb_pd set to 0 while initially
> calling typec_register_partner. However,since  there is no
> provision in the type-c sysfs interface to update
> supports_usb_power_delivery once the contract is established,
> supports_usb_power_delivery is left to report "no" even if the partner
> source device is at present performing Type-C PD.
> Is it OK to add a api to enable updating supports_usb_power_delivery
> node in the typec sysfs code after typec_register_partner has been
> called ? Or do you have other suggestions ? Please advice.

supports_usb_power_delivery will be updated if typec_set_pwr_opmode()
is called with value TYPEC_PWR_MODE_PD, and it should be called, also
in tcpm.c, always when USB PD contract has been established. I did not
check the latest tcpm.c code, but I assume it does that. If it
doesn't, it needs to be fixed of course.

Are you sure you really have the contract established?


Thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Sometimes supports_usb_power_delivery reports incorrect value.
  2017-08-15 13:36 ` Heikki Krogerus
@ 2017-08-15 14:13   ` Badhri Jagan Sridharan
  2017-08-15 23:26     ` Badhri Jagan Sridharan
  0 siblings, 1 reply; 5+ messages in thread
From: Badhri Jagan Sridharan @ 2017-08-15 14:13 UTC (permalink / raw)
  To: Heikki Krogerus; +Cc: Guenter Roeck, USB, LKML

On Tue, Aug 15, 2017 at 6:36 AM, Heikki Krogerus
<heikki.krogerus@linux.intel.com> wrote:
> Hi,
>
> On Mon, Aug 14, 2017 at 11:57:15AM -0700, Badhri Jagan Sridharan wrote:
>> Hi Heikki,
>>
>> While testing with different type-c phones available in the market,
>> With some phones, I noticed that supports_usb_power_delivery
>> reports "no" eventhough an explicit pd contract has been
>> established. After spending sometime debugging, I noticed that
>> the root cause of this is that the partner device(acting as source)
>> takes too long to send the SRC_CAP message. This makes the
>> underlying TCPM code to report usb_pd set to 0 while initially
>> calling typec_register_partner. However,since  there is no
>> provision in the type-c sysfs interface to update
>> supports_usb_power_delivery once the contract is established,
>> supports_usb_power_delivery is left to report "no" even if the partner
>> source device is at present performing Type-C PD.
>> Is it OK to add a api to enable updating supports_usb_power_delivery
>> node in the typec sysfs code after typec_register_partner has been
>> called ? Or do you have other suggestions ? Please advice.
>
> supports_usb_power_delivery will be updated if typec_set_pwr_opmode()
> is called with value TYPEC_PWR_MODE_PD, and it should be called, also

Oops my bad !! I somehow did not notice the presence of your following
commit:

usb: typec: update partner power delivery support with opmode

which has not been picked-up in our codebase yet.

> in tcpm.c, always when USB PD contract has been established. I did not
> check the latest tcpm.c code, but I assume it does that. If it

TCPM does do this.

> doesn't, it needs to be fixed of course.
>
> Are you sure you really have the contract established?

Yes I did verify using the pd-analyzer. I will your change and see how it goes.
Thanks !

>
>
> Thanks,
>
> --
> heikki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Sometimes supports_usb_power_delivery reports incorrect value.
  2017-08-15 14:13   ` Badhri Jagan Sridharan
@ 2017-08-15 23:26     ` Badhri Jagan Sridharan
  2017-08-16 12:31       ` Heikki Krogerus
  0 siblings, 1 reply; 5+ messages in thread
From: Badhri Jagan Sridharan @ 2017-08-15 23:26 UTC (permalink / raw)
  To: Heikki Krogerus; +Cc: Guenter Roeck, USB, LKML

Submitted couple of patches for the missing pieces in TCPM.
Those patches along with "usb: typec: update partner power delivery
support with opmode"
seems to address the issue of reporting the right value for
supports_usb_power_delivery.

Thanks,
Badhri

On Tue, Aug 15, 2017 at 7:13 AM, Badhri Jagan Sridharan
<badhri@google.com> wrote:
> On Tue, Aug 15, 2017 at 6:36 AM, Heikki Krogerus
> <heikki.krogerus@linux.intel.com> wrote:
>> Hi,
>>
>> On Mon, Aug 14, 2017 at 11:57:15AM -0700, Badhri Jagan Sridharan wrote:
>>> Hi Heikki,
>>>
>>> While testing with different type-c phones available in the market,
>>> With some phones, I noticed that supports_usb_power_delivery
>>> reports "no" eventhough an explicit pd contract has been
>>> established. After spending sometime debugging, I noticed that
>>> the root cause of this is that the partner device(acting as source)
>>> takes too long to send the SRC_CAP message. This makes the
>>> underlying TCPM code to report usb_pd set to 0 while initially
>>> calling typec_register_partner. However,since  there is no
>>> provision in the type-c sysfs interface to update
>>> supports_usb_power_delivery once the contract is established,
>>> supports_usb_power_delivery is left to report "no" even if the partner
>>> source device is at present performing Type-C PD.
>>> Is it OK to add a api to enable updating supports_usb_power_delivery
>>> node in the typec sysfs code after typec_register_partner has been
>>> called ? Or do you have other suggestions ? Please advice.
>>
>> supports_usb_power_delivery will be updated if typec_set_pwr_opmode()
>> is called with value TYPEC_PWR_MODE_PD, and it should be called, also
>
> Oops my bad !! I somehow did not notice the presence of your following
> commit:
>
> usb: typec: update partner power delivery support with opmode
>
> which has not been picked-up in our codebase yet.
>
>> in tcpm.c, always when USB PD contract has been established. I did not
>> check the latest tcpm.c code, but I assume it does that. If it
>
> TCPM does do this.
>
>> doesn't, it needs to be fixed of course.
>>
>> Are you sure you really have the contract established?
>
> Yes I did verify using the pd-analyzer. I will your change and see how it goes.
> Thanks !
>
>>
>>
>> Thanks,
>>
>> --
>> heikki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Sometimes supports_usb_power_delivery reports incorrect value.
  2017-08-15 23:26     ` Badhri Jagan Sridharan
@ 2017-08-16 12:31       ` Heikki Krogerus
  0 siblings, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2017-08-16 12:31 UTC (permalink / raw)
  To: Badhri Jagan Sridharan; +Cc: Guenter Roeck, USB, LKML

On Tue, Aug 15, 2017 at 04:26:07PM -0700, Badhri Jagan Sridharan wrote:
> Submitted couple of patches for the missing pieces in TCPM.
> Those patches along with "usb: typec: update partner power delivery
> support with opmode"
> seems to address the issue of reporting the right value for
> supports_usb_power_delivery.

Cool! Thanks Badhri!

-- 
heikki

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-16 12:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14 18:57 Sometimes supports_usb_power_delivery reports incorrect value Badhri Jagan Sridharan
2017-08-15 13:36 ` Heikki Krogerus
2017-08-15 14:13   ` Badhri Jagan Sridharan
2017-08-15 23:26     ` Badhri Jagan Sridharan
2017-08-16 12:31       ` Heikki Krogerus

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®