Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1492720lqm; Thu, 2 May 2024 17:40:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVrvXR9F+wu3d0n4gxezxS1+SQMRcMNSjSS8L0YVm0lIa1DanEtwW2rhK00UqYSlVkfhViriHhjP4cAfGhq0X7cO3pnAodkIPhAriq2uA== X-Google-Smtp-Source: AGHT+IEUSHxnJ2xmeDnahb/m5repQCCnq+PmZwyZB+BN/5lFDaiqG7QEDAOHzThlSDskLB6ZtG+f X-Received: by 2002:a17:906:af42:b0:a52:6e3a:87ac with SMTP id ly2-20020a170906af4200b00a526e3a87acmr552609ejb.76.1714696842259; Thu, 02 May 2024 17:40:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714696842; cv=pass; d=google.com; s=arc-20160816; b=L6WeToTpAw6EmKunIrtJu1Zr2Asr0c2jG3bxVxUI8CsaCv30HIlLbdOe6WYTIj+AFN IKv9g79KIgpvzbFHfTJP6J8mFw8Hu8w+lHy0PrVca7eCppEdw2cFi6TF8XHFApf4knEz F3LPwTmnGi3gM8odfBwEi9bTdSsuRLjWYxHhSD3tb7haVJVyVg+EuU6kCV9TnAxtcroR biYWML7cUK95pPWnMRml+LoKC3pSZFqyvpFe1rLrfN20QPZJlwoabc1KDs16kyHJwS8/ m2oP7ZTeey040euTGB0AD6pf/9xY73rNGv9l5g8vpLeRmNh5Quw3hw6H3nhtblYb1Bti go5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=FSyCNdHT07TNdA8h5B3w30HbKKc0j314DRlrHa4lbZ8=; fh=OfYXLlDA5QL1EA+vdzO4mIrYEUvX7uIr5ByttvtKo58=; b=JywH38Tlv/SSbVh/eAB2adh3vdL9Xz81YPjnTUUrii96Yn6mutTCtSg1ZH1QSGTh5I HsdYlWHnF52W5HIKCbqWpvYeD6frD0ZbiMXp2Ca/eAmKd6+EmCDGhY+eSmPFMToT9rJP 0PQjlCEvvEBBAizjw7i0fChRi77GQKwZinKT1ZEOZ9uqbts6cQOoV081Jwq0aeVfmQkT ++GiLwup52vRPEPxA8wKWF40j1fFXDA7QSpqi1YQx/c1vU8CXqPoX03pIiChQ8+xQyqK P3oMV9Kqtq4j6lYiPUlkakd606J9spoDWyj8/BmvLGMThuBFpJNpDObv79y+HaN+jc1W dwTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tWU1ogX7; arc=pass (i=1 spf=pass spfdomain=flex--jthies.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-167112-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167112-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w5-20020a170906184500b00a51dbb2aeb3si995315eje.1053.2024.05.02.17.40.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 17:40:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167112-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tWU1ogX7; arc=pass (i=1 spf=pass spfdomain=flex--jthies.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-167112-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167112-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 01E521F22B4F for ; Fri, 3 May 2024 00:40:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E52B518C3D; Fri, 3 May 2024 00:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tWU1ogX7" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A782E17547 for ; Fri, 3 May 2024 00:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714696792; cv=none; b=u/kjWwDaw8y5JctbZVbnmVqXCqmMHXzIWfrR/+s4UIukLkDWAgw/Jl4QOoQNbfeuxt2r4Frl9/DaHvP0k4jPv6u3NUsl30KTmivTo0yzY2aNlzPWCYGOS5zFxjYj+Qp3Q863m1h9wfemAlNcEO4r2zS2hBHN+AlRlic4mh0141E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714696792; c=relaxed/simple; bh=lPHkPZBn4jDkynyngXHEQSInVHBG5XHwELGRCRAANtY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=cHgMgZZfZqrDXCbwpaK1SIQtQWqvjyqFCXh6Br8bj3yRr2Z8RBYir9okafapjos00uq8+M2fMVJku/t2DsPeee8dW9xCctZ5BMFlBV8292e2+SfDAuQpp8j5svzDPSW3aP5XdqRk5/TYm24O67hfCzutLDjc43rmbsmpPdHTfTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tWU1ogX7; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-61be23bb01aso93832087b3.2 for ; Thu, 02 May 2024 17:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714696790; x=1715301590; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FSyCNdHT07TNdA8h5B3w30HbKKc0j314DRlrHa4lbZ8=; b=tWU1ogX7s8djMPuEmSXOsGt6v9cox/ILjl6ekn0FX6yO3RLDGzmiq31L90E3DR9GCO E/nBiMIpkZWEx5P0csOFQCxRr+Ch8R39monu7nSmNBO8L0Wx5MAtlJpcEwucrkhBLXH8 W4oXrGacNA0jV4hlmz2U6DstAbsOUM3kZnTrL27kRhZw9WjKFuFRiEK+nzTTQrfHRMCi 7rgUQSeDmENkLVPasem1dwwn9hYC6oMhS72BqvsOv8ytoVHR+g/puqBFFN0mlraa2BPA SsLgwJdQnP5QMR9057iRu1/mQ9ihBmFfzrjGzvXqa4B6z0kuSAZWYqrmwgRpk4/3Dbgw KPRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714696790; x=1715301590; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FSyCNdHT07TNdA8h5B3w30HbKKc0j314DRlrHa4lbZ8=; b=jwe9eTYEsR4wMhWPMS0B7QDrF+uwmJM6/WdKKpSwSHkn8TDopjywM52MkMgrK4iPfu z/5gO3GONE4w/88wCBi0j7u9hTDRnFe+iw8gk44Mk6lViWfOtAZquVTFN/PDnM9TahSk LwgZys1Km4g9JYqxHxSAHUmWwnpnJR3E7lNlA2mLjaFB5VfVP9QlBmEqVDiLObpE9SIJ OC82Lsr1EcAp1vXjjA5QBpxYFLGtXa3OkrwuFeRhz2LYH6icZYtHqYrW2UhrYaLOpj2n umdwXGZOI7knlSRO+37NVt9HO3hfEutyKiHvu1+0xbTwl5VChZDeZBUZ3+d4fTUCj+s1 fbEg== X-Forwarded-Encrypted: i=1; AJvYcCWolZ93riV81RzWWdhYJfJ6OMVSBB7KjYJCydJnQ/u+qNk3lJrde2tsfYe4PL3W/sZAu4spSpC6XScGeg9jRNWVCVF8ZPJDim+PNXPo X-Gm-Message-State: AOJu0YyFkn1dS2OPQszRaaliBmNx3TLTdu3MkACuisY82Cd+XBnxLuxv WsSCo4FMiKesVzAqbKDr/1RTkU7mFyIW7yvAjDV/vxGkGeRFr3RNET4zyXEX3G2TEDXwtWBXYbj gxg== X-Received: from jthies.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:23db]) (user=jthies job=sendgmr) by 2002:a05:6902:1146:b0:de4:77ab:5fea with SMTP id p6-20020a056902114600b00de477ab5feamr380431ybu.2.1714696789778; Thu, 02 May 2024 17:39:49 -0700 (PDT) Date: Fri, 3 May 2024 00:39:19 +0000 In-Reply-To: <20240503003920.1482447-1-jthies@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240503003920.1482447-1-jthies@google.com> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog Message-ID: <20240503003920.1482447-4-jthies@google.com> Subject: [PATCH v3 3/4] usb: typec: ucsi: Delay alternate mode discovery From: Jameson Thies To: heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org Cc: jthies@google.com, pmalani@chromium.org, bleung@google.com, abhishekpandit@chromium.org, andersson@kernel.org, dmitry.baryshkov@linaro.org, fabrice.gasnier@foss.st.com, gregkh@linuxfoundation.org, hdegoede@redhat.com, neil.armstrong@linaro.org, rajaram.regupathy@intel.com, saranya.gopal@intel.com, linux-kernel@vger.kernel.org, Benson Leung Content-Type: text/plain; charset="UTF-8" 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 Reviewed-by: Benson Leung Signed-off-by: Jameson Thies --- Changes in V3: - None. Changes in V2: - None. drivers/usb/typec/ucsi/ucsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index cb52e7b0a2c5c..bb6e57064513d 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -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); -- 2.45.0.rc1.225.g2a3ae87e7f-goog