lkml.org 
[lkml]   [2021]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 2/7] usb: typec: ucsi: Don't stop alt mode registration on busy condition
    Date
    If the PPM tells it's busy, we can now simply try again.

    Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    ---
    drivers/usb/typec/ucsi/ucsi.c | 5 ++++-
    1 file changed, 4 insertions(+), 1 deletion(-)

    diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
    index 366c8a468bc18..a8e0e31dcddf5 100644
    --- a/drivers/usb/typec/ucsi/ucsi.c
    +++ b/drivers/usb/typec/ucsi/ucsi.c
    @@ -437,8 +437,11 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
    command |= UCSI_GET_ALTMODE_CONNECTOR_NUMBER(con->num);
    command |= UCSI_GET_ALTMODE_OFFSET(i);
    len = ucsi_send_command(con->ucsi, command, alt, sizeof(alt));
    - if (len <= 0)
    + if (len <= 0) {
    + if (len == -EBUSY)
    + continue;
    return len;
    + }

    /*
    * This code is requesting one alt mode at a time, but some PPMs
    --
    2.30.2
    \
     
     \ /
      Last update: 2021-06-07 15:16    [W:5.376 / U:0.640 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site