Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp145281lqd; Tue, 23 Apr 2024 18:49:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZZiZB6/eV0lZPBEntOj8XhpZwsEuOZ5nvbDkLi1x9Nic/BJ1N8higdnLsXNRp5TyFF4ox5ZgRYs486GXZTVXVNRXYUdUz7hAiRGRexQ== X-Google-Smtp-Source: AGHT+IFfUveoi8wv6S/5GSgg+LnoPF/eRQINJP/OhvS9alEzLqxR/ZReVpWZdgMwexnkcjPoqWIL X-Received: by 2002:a05:622a:1116:b0:437:bae4:4004 with SMTP id e22-20020a05622a111600b00437bae44004mr1305133qty.9.1713923390075; Tue, 23 Apr 2024 18:49:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713923390; cv=pass; d=google.com; s=arc-20160816; b=rSKp1iMDubh28v9FiYaWIVJ3BNWdcxa2Sp6hjWE4JdY3qhaGC9hWWxMA/eJ2yWBrvn LR0Bzj18sYLXukaIN6ugt4LItLQ1/QbEsIfe1zSCjhtzqFBSZiTrjhNraxQ7dCo6/7aT NUC03LaYyIjyPoFMkjBlOBNvJ2wGr8waZIz4A4rqPkQ+nLn/1gFJZx3Gx1LW5DhTiHYN EV/DRzRKYiZbpxY9lzdchNYqHfXlBW8dQLDKA9lqi6AVuSgjaTp0oRtuOcMrjH/1BmJ8 dqNBWCNF9CCeL0y7xjvPTYJw1i0bBrnwlIc2M+fXn/g5BhhINSV3Obw3b8lHk5ip2MgR ZkfQ== 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=ezOeRF6HXEObMPJXRNe8KMyl6QUSbmrUwM6rPAOdEII=; fh=0KTYfkAPTxYdfTK52H+Zm4240lWZt4TKqOjZxuKebMc=; b=yw7syXBEGlpQEtnGFUVq2UNaqld3k2CyrHSpii+Zl3uqhe6DqF4arlyhAvLq2OoRa+ jQpNY54Jau165g28X8wJbt5VBiZJ9pMGttiPggCx+7ibkEeSgA6/1vIGkPE2f8dWzcn8 6n4r2fqKPYtLGj/tEPJwhvcTW0U+ti8Trhs9ULL2nW5zldlwR2D8oCRiALt75dLCAFtW yXu/QZ1McVH1NicFhhVAGnphDCHvA+ChMoQnw5gs0cD6frtUcN5HN/qnDly9JUgHG+VV ABlc7YEx8UpT4sFCRTBZkDtvsJpMBFcl+Dgnk351k7pvvf5fzJjpJTl67xJoX60/BxdN WTZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CzYauc2c; 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-156106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156106-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z10-20020ac87f8a000000b00439a382fd7bsi6943206qtj.462.2024.04.23.18.49.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 18:49:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CzYauc2c; 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-156106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156106-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 C99B01C22C16 for ; Wed, 24 Apr 2024 01:49:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03AC91CD23; Wed, 24 Apr 2024 01:49:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CzYauc2c" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.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 7F2E814A84 for ; Wed, 24 Apr 2024 01:49:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713923345; cv=none; b=b3sv5pYwARu1Eq1ruA8DWYUGtjFFyiB2FVR9zCId2Wxldkp5svY3LvWfLTZsNeYMAsqSk3IGmYwwRIYwgPqFSMS6GjUB3Brv/rzj7xZRyJVSgzLSSYVHqhmEUtmv2phFwHWFs5LOHt6RqUmxCaFv+3vDwus2n3a1hGUnKtcGH5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713923345; c=relaxed/simple; bh=aOXxLPtNiFPouK8yihnuWDFAFsJNURmfJp1ITib6WMQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=GkwkV2Ov8JrxBJ1XBiv8TH5D0sqMZD/MU7AilFlOVfQA0Nx6Cw22fQ6hDmJ5ypohU8y4JTly3twQq4JV9AGHcr6pQvgyee/bsT2+dzSrbx2Z3uTyILjPzBFYJITYr4yxcxtZn7g2Y6EYU+QzFWatkNb53yOR7QHsfDbblYgvC28= 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=CzYauc2c; arc=none smtp.client-ip=209.85.219.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-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc6dbdcfd39so12658207276.2 for ; Tue, 23 Apr 2024 18:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713923341; x=1714528141; 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=ezOeRF6HXEObMPJXRNe8KMyl6QUSbmrUwM6rPAOdEII=; b=CzYauc2ci30VygHEG7Zvk9z9nUGzcOkrTBOd9QbmVrOlGyP2dwJHjvlmVyO8jr03Nn NmxLtAQmwb59bfT8adjI3Xd7BAQ1EYu17QyI8qjE5CJcmPIjsXjMgK3MkkJ2+bAGa3yK kbY/CLxydnJFWqerjuDWvZcjCXSqy0JQdNMe5XfveRayUbAoZko0nK4sn77xvZ3FH8pB bwHU1OorTf6tNTK0uCtj5Rk2ccB7Le4d3Fq2cD21Dvet/Z6l1sedAExLg7hFfyHWiq/M aJpNUL/+3JNflQdvkzcuV4Thvgh+m2xtKTC66RK3P1QXl0g06O8Jb9beAGrHEZoLznXY PgGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713923341; x=1714528141; 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=ezOeRF6HXEObMPJXRNe8KMyl6QUSbmrUwM6rPAOdEII=; b=TCYTkPlSfVHm8Srk153zqS3Bd0+WBJ4FjzzFhX+VuEquZHoZbmI0VAEbShhfuaK/5/ kG0UTfayKml12AaAXf3RWDNNw0WiuaPyqfqmy+/eJRwc0IPRW1NJ/0gp8JJiLWuJarP5 DZLdLvWXg09iXDQpkNleIZTbkMuqFRoN/SbssGOSBGCw7d/ZFYimZaHsQ6GJBy5Ha8WT fEDKTZ3jhV+mEWgd1I+66axPf3hfny4TyxaE3SsmNx+5G/6AaNM1WdJRJHX2OD0z5eoa 1gtgCcCQ0Aq2r15GywUyKXzwaqNG/ExX2GeANNLEGptA62GvtUkZ/t+NMCb4z0CixqSE o3GA== X-Forwarded-Encrypted: i=1; AJvYcCV+8TqT7WGfJrg2BIxzrJspPgwhfyWcRPJEN+P51+sF6JczL3hn4O0pxHuDuoN5yx2xwlFyIFHcSEUw5jahOCpZeIlz19AL8AF1odqv X-Gm-Message-State: AOJu0YwQEzigJE6Kpo3j1xoqK8DmCMt4hNccQwYIZf3mi1fvuzd+hOuV zBVQ0MS8D/NAQQqdHOqq5klGcSf0lEkpn2skS9hmMB41SJ1ZkNyXc7wpA8NdnvXdCW/gCpJpAIp g/w== X-Received: from jthies.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:23db]) (user=jthies job=sendgmr) by 2002:a05:6902:154b:b0:dc2:398d:a671 with SMTP id r11-20020a056902154b00b00dc2398da671mr358301ybu.10.1713923341480; Tue, 23 Apr 2024 18:49:01 -0700 (PDT) Date: Wed, 24 Apr 2024 01:48:20 +0000 In-Reply-To: <20240424014821.4154159-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: <20240424014821.4154159-1-jthies@google.com> X-Mailer: git-send-email 2.44.0.769.g3c40516874-goog Message-ID: <20240424014821.4154159-4-jthies@google.com> Subject: [PATCH v2 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 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 f3b413f94fd28..f167891e3f79d 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -966,7 +966,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: @@ -1250,7 +1250,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.44.0.769.g3c40516874-goog