Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp734597lqo; Fri, 10 May 2024 13:13:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9x6Qe80cMEtwNsBwgJzF76rnWXk7HizLv6AmSnecsMlE/3v6hid6AEMkPsJPannOPFxsb6LJrUtY1nl32SiKXw06J5gwDImli1KaifQ== X-Google-Smtp-Source: AGHT+IG4sabjo1t3Pwf7ORaBRf12Lg7wwjjmVkzmTqr43tsGoNGAk+tyvpgJa5BVcY5v8FCtjDZs X-Received: by 2002:a81:ac43:0:b0:615:4700:94cb with SMTP id 00721157ae682-622aff7eb32mr43211257b3.1.1715372034556; Fri, 10 May 2024 13:13:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715372034; cv=pass; d=google.com; s=arc-20160816; b=u5jU74rhUpW5f6MLFvMWpS4JBpAKKYwdgoBjJnCSASk0fqkriQvL7HhuudTDRCLcJg qrjV3+2W87/yPzyAmrtArdVmbkGh7cwjbitvvhxHhL6xRCCBPWRnXDK0ReGvf9Ytl31I LWuWaaMBs/Q/cLrARYAzULY7bo6B7H63nfxxVOIoKrh5Zn5YRhY/NbdStnkdWT/s/TQV tfQeGlcAiw6auYME5cKwO1kpE0g8jUICZwcMzz7O4m/G7rMOC/SDD3R1o8B5ZuS/k61S eqrNQRwjdJmj7AoQZL7Y6+opWNZWFMmlQqLTrElqfHIcKlCCUX1JC0dfKnp+/6rgkNTd pf7Q== 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=p6Gt9uHKHh1HnRu1uhOwPYNBg9fkaiXawsgjwu/g2rQ=; fh=NcE2v69ZKLYAagBTme8ei/1ReN5PQ481dsiN0zD8GU8=; b=Ha8xE629xxAYZmWz8hjKmyWiOHfMeJU5tjTPJxoFKBHrOoya/uWLHx1Eth/5UMJEH5 NseI9+m7lh09szSeW/9ILMYo+SHPbHlro8MVAbTo4ys3YOZlzXyqkcZ80yk4AeQlZIbd 9nAsyZk2qmftvSVEg/41A/rULgVJwN+cOh9u7gX1b40j4Qphydy/G17cKbK8GxVrsNE5 LfyF94Btjd0A6SKZw9qASoFafO752xHRkfjxG/Qeo9HS2CxnqFtVMgpCK17njOsLySJV U3xBLkEBGCUgkvkdGBuhe/V6zTQ9fe3j2OzYo63ZCM13EylOrDdafm4o1I24a3JgGyqk UlZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iGgKgUUR; 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-176161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df54a2085si45358341cf.151.2024.05.10.13.13.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 13:13:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iGgKgUUR; 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-176161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176161-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 02CD91C224FC for ; Fri, 10 May 2024 20:13:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F185502A2; Fri, 10 May 2024 20:13:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iGgKgUUR" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 243E547F73 for ; Fri, 10 May 2024 20:13:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715372003; cv=none; b=N5zumE4+ruP0zjiLToRpck8h+zWewmNk6fFRrEXJf5GnOntSPPk9X/5RUYrMQ2X2Jl4/+kVCZv/ggrk3jcWSjau0p0mLFJnQxpPPemeo10EKIMldpeoUH/EygfzYmLfC/vMYn7RZUNBuMGnYa7MX/ex4MEUaOP0GVvu44QRVPU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715372003; c=relaxed/simple; bh=s/KsF7KsNmNqfW9jySfUKYHz0qrPmcvkypMn9trKTyw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=rrWLomnWJSjXvgpl8g8FfTQ54eNBeSCukqdyY7GE7sTNZ/g+TTomt+y5OWby+EpvXHym3Zp6pYs4gbPSABsIu4Ye3QjZ0tWtJTeIACttlLsR0ZGYBESWuGaxSeMI2tdFFuFcl/hjso+J/n26nNjjgY0Q739dVRJs0Fc0wyeF/WM= 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=iGgKgUUR; arc=none smtp.client-ip=209.85.128.202 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-f202.google.com with SMTP id 00721157ae682-61be8f9ca09so40529737b3.2 for ; Fri, 10 May 2024 13:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715372000; x=1715976800; 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=p6Gt9uHKHh1HnRu1uhOwPYNBg9fkaiXawsgjwu/g2rQ=; b=iGgKgUURDJra7q/q+qsrqQRPaFVth5wyhzcl+LVZII9B8Y0q133RrzP6/aLUpxBuBj s2bALKoKL79yWaGugkGHOqpQiGTMEH5KHa/Hfev1sghOfX81dLh0MCeVOQjPACXWQu8r +e+knN6xBvkdo2faKyx/dnYLaZnDWmJoG+xtIG4+8/uUImlzeCtNKs+mX5+xrfXFSq/f +XNyOD9JNoNxSAOIwlbT6dvZ5FzH7gfW8Tw15VH48ECim6PYwVsqZ9oTbWuuOsOSwQ3f 6PsV6znHABNyTYOYpSbotzDiy2Y547kJ+SDLlfasrYQbZeN63BcpYgAkpGpngR1WrV0Q Aqww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715372000; x=1715976800; 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=p6Gt9uHKHh1HnRu1uhOwPYNBg9fkaiXawsgjwu/g2rQ=; b=l3ks+5hKSyhSQzlAmLSBXO8WFHFAsAFbkDM1/RN31sq/BcFZTMZ8xRCuPZ1Kq0cQnk Z5WHIuhBklEmaSMvnAKC3ofLS+sBKORJZYDpqcWuIkIeADtdSi/nB8ZGBXMzCdpHC0LA U+a319JEBr6YB4R0bhmnSw7wj4phdf/gP7b558ldZ+v2XPDxFOQJaK42CdA5tjA3vSFD md45JUpG5oaf+Dhyb9fE43X7/2ie9reaOa8owUQiqab1nWs8cETPwXbLoCKesIMD1byA Y+5JZGf7apuYEjCoHiw8csGagyJgR8GxepAQH2Zrf0r4NUriV0BsPssUHr4m30LTftvp HiYQ== X-Forwarded-Encrypted: i=1; AJvYcCUzPH/CEVRDBHAtZHlwa9ptNUDArkCyk/S6ZhgmIjOWAQXesQ5nUuDLyUygqnxuU8M3bK5GVVtCNUu1mLVnCOBCx+gcoiu6zWbUJEqF X-Gm-Message-State: AOJu0YxYxeqfYAFq64HPzQuK7rBD7KNJZCh9Iki5dtbQO0YJMdOMv+wX D6EPcgEotLc5OsQWKyR1y4mUVFtyLkytHCqpBq5a199KAcYjx5exo++Gt2Rs1o0kddUCk0j2pst snA== X-Received: from jthies.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:23db]) (user=jthies job=sendgmr) by 2002:a05:6902:18c1:b0:dc2:550b:a4f4 with SMTP id 3f1490d57ef6-dee4f33cb20mr954759276.1.1715372000164; Fri, 10 May 2024 13:13:20 -0700 (PDT) Date: Fri, 10 May 2024 20:12:43 +0000 In-Reply-To: <20240510201244.2968152-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: <20240510201244.2968152-1-jthies@google.com> X-Mailer: git-send-email 2.45.0.118.g7fe29c98d7-goog Message-ID: <20240510201244.2968152-4-jthies@google.com> Subject: [PATCH v5 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 V5: - None. Changes in V4: - None. 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.118.g7fe29c98d7-goog