]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: typec: ucsi: Delay alternate mode discovery
authorJameson Thies <jthies@google.com>
Fri, 10 May 2024 20:12:43 +0000 (20:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Jun 2024 13:44:27 +0000 (15:44 +0200)
Delay the ucsi_check_altmodes task to be inline with surrounding partner
tasks. This allows partner, cable and identity discovery to complete
before alternate mode registration. With that order, alternate mode
discovery can be used to indicate the ucsi driver has completed
discovery.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Jameson Thies <jthies@google.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240510201244.2968152-4-jthies@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c

index cb52e7b0a2c5cd6702ee8c4e182652984721e5e0..bb6e57064513dab7514ede34ad23170497ff93ee 100644 (file)
@@ -963,7 +963,7 @@ static void ucsi_pwr_opmode_change(struct ucsi_connector *con)
                con->rdo = con->status.request_data_obj;
                typec_set_pwr_opmode(con->port, TYPEC_PWR_MODE_PD);
                ucsi_partner_task(con, ucsi_get_src_pdos, 30, 0);
-               ucsi_partner_task(con, ucsi_check_altmodes, 30, 0);
+               ucsi_partner_task(con, ucsi_check_altmodes, 30, HZ);
                ucsi_partner_task(con, ucsi_register_partner_pdos, 1, HZ);
                break;
        case UCSI_CONSTAT_PWR_OPMODE_TYPEC1_5:
@@ -1247,7 +1247,7 @@ static void ucsi_handle_connector_change(struct work_struct *work)
        }
 
        if (con->status.change & UCSI_CONSTAT_CAM_CHANGE)
-               ucsi_partner_task(con, ucsi_check_altmodes, 1, 0);
+               ucsi_partner_task(con, ucsi_check_altmodes, 1, HZ);
 
 out_unlock:
        mutex_unlock(&con->lock);