Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp98593lqt; Wed, 5 Jun 2024 19:14:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDCrrI6RT9dSHBFhnZJ51yKo7NvJcTbt54NuS7yirATiuhuvl7B4J7+LmstLwCjzBQcZWRqOnHaBslkX6KGEDChA2lpxIkOuUpyknkGQ== X-Google-Smtp-Source: AGHT+IGeLnCyy03Xoy+4Eb6C+L87kK69VFt+O8PML07//23Kpqqw17vEzW6AgAhmZRrC1jJHDcaC X-Received: by 2002:a05:6871:b06:b0:24c:b3c0:6cb7 with SMTP id 586e51a60fabf-2512209483fmr4666595fac.54.1717640063193; Wed, 05 Jun 2024 19:14:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717640063; cv=pass; d=google.com; s=arc-20160816; b=F/LRNlV7L4t4Yut1ryHB2ZU+cmXKDEeyaGpjLb/r543JZQ3FVu0JCS0PCAbZKuS7Ze 0Gwuk++d1nolKCrCcB49R7FhziiR8bOXT3SHBsgKtN6TSse/gQxu926qTN6DHkGSXOrO fptRDfuAPv53LQ2mb6oY/IeTcf18sGIss2H/MVdepm6XDRLEV6sTdK5SZsLRKjmF+AGt peYkK+oXLrMwJrtj3SqrXPnaHQUnnQI7z+f9SI+Zldsk2SJJcdrarsB08dzH26/i6jKO HR8A976GEsyZOUo0zMJ7kT7FIMeVYr0Oa8jE0X0MAoRD2XvlK5v2b68+Glrykbh6lEky wrFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=f/U9i0grtXyPEh0f0xQwuZ2cYpbRTaMYvy44FQqW0H0=; fh=YNGuIgnWJGPSev2lFb5khKS79z/Fbiz+hSKKq6Q/8Tg=; b=AuxvON9X4RJzPnprl2pRmeMQsN3vBNjGYJKoVA5ccTqXUKycybtbgaKCgnADhL7iIz 8/1q30cd/UZ40woyqO4m7DlEhn42LrsDvwNKpql2bXh2HLXNPLWbPos6A5ibW7W4gu1a W9AELuAf/hbHVk52LLNo6SCyKP213hyQ3X7AckNclmePDAXl1/BYqFAUzuk15x6FeMqM WU7xaaD+6N6prchJDpa8MmPeQq0alTeV/Z3Dud62qPIdARxqPw+mDcFQaUWc3Zxt2tuR 3qT8aDnXxJy4u3P/2BlpNI4XIU69XyW2Zg7lN0OnOM8eTVctcy2aTNHywnbZcx3WNWGQ Jrsw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm2 header.b=sQDMVEOH; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Z1WSPuwL; arc=pass (i=1 spf=pass spfdomain=squebb.ca dkim=pass dkdomain=squebb.ca dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-203525-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203525-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd3b3fc5si48167b3a.128.2024.06.05.19.14.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 19:14:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203525-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm2 header.b=sQDMVEOH; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Z1WSPuwL; arc=pass (i=1 spf=pass spfdomain=squebb.ca dkim=pass dkdomain=squebb.ca dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-203525-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203525-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E6C1DB241AA for ; Thu, 6 Jun 2024 02:13:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 226CB18039; Thu, 6 Jun 2024 02:13:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b="sQDMVEOH"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Z1WSPuwL" Received: from wfhigh7-smtp.messagingengine.com (wfhigh7-smtp.messagingengine.com [64.147.123.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E04D17580; Thu, 6 Jun 2024 02:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717639995; cv=none; b=PTrDJSuvDth0GpUzRGm63m2hxxtgEkUVQEzTeLQB55lveUZFhkOwGqpSI6hoYwKwKS3Ps+Svl79hNzPhqU9dIMm8bI4gMTyPmDfMlRWdJ+HjcP55LlU5sLiZ9JuML6FxGuwM8ns8h7RzXInZ6MhT0/A0KDOlaqrbw3qvj95veNs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717639995; c=relaxed/simple; bh=yJWrJbCqPqapXYAwKXwN1zRvyQPhRPbhbiN+kmQtLK8=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=ofPXwGCsfgsJ8zvjR/tl8qA2joHe0ioDN/9frypzzayTT0xQjddBKS+6tHuGG2K8j+yBt29dfpoCJ0DudIdtcrNuD63EvVy5ZItObx2kkVL0LJsahTcV5vcGOPB36uLt/K0Ucj/HwDIA7hayTE/jjN0Ko4MRTXl03ctgEjK2fzM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=squebb.ca; spf=pass smtp.mailfrom=squebb.ca; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b=sQDMVEOH; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Z1WSPuwL; arc=none smtp.client-ip=64.147.123.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=squebb.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=squebb.ca Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfhigh.west.internal (Postfix) with ESMTP id 39898180015E; Wed, 5 Jun 2024 22:13:12 -0400 (EDT) Received: from imap52 ([10.202.2.102]) by compute3.internal (MEProxy); Wed, 05 Jun 2024 22:13:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1717639991; x=1717726391; bh=f/U9i0grtX yPEh0f0xQwuZ2cYpbRTaMYvy44FQqW0H0=; b=sQDMVEOH0IXXRS9X5J8vQcyJUN ZxKcwS+lfJQO4froeZwXxeH/EI6EtuJS9nG4plNpKLjDb+Te2+F/a3sR9J0Mx1Zf IUADurirUQ8UqmTUZkXJMAxsznFuzBQKiTug5finxKfj5kUy6C6+eYdWjmyCuKFA WPZMK8QWNUe8y2TBNgP8yVL7r9e6qIglIrLD6uuXZbQ/P1XbpzZPxv0MyBUtOu5F dQ2VsCdZ6irhZhEouRE7qSq2q9z98cMlbEIYqdmm05Ss1xzGhV8YS+Untx0VsitQ g8xp03NJYwKBbK6sS96PjG67UwqmJ5LFjaHyK2xbD0GnJ6uXbdtFEimZJKnQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1717639991; x=1717726391; bh=f/U9i0grtXyPEh0f0xQwuZ2cYpbR TaMYvy44FQqW0H0=; b=Z1WSPuwL3pJTZzhP1DjSJXPzYZqmi1RBSF2XW/+EbNSo O8wbcQ4lFQxR91v5xzOKFsdNdZWXU4XwZIGNGEtn9bOftETFTIujQ4dxHsZBPt1d LLM/xz0YL/4NgcNSypFAUmV/MseY8RmYKk6oSpGoRtf1cRaBofDugM6f+g3vvHKQ FaI1QohEQuy01+uV5av40MxAovnC67LX9gBjYJoiivj/F8przYhX1PR1Lvxazr27 VL4rZPbLCXTMIGSqQLWQ72v67fQ2SgE5gOlhRDgpqsq9ZTW5l5rSZjvnz5rjHEsO iPrDHC2Nn+rZWgG7M6E9f+SZPBdr+Z/eCHlJSuzf1A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeljedgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedfofgr rhhkucfrvggrrhhsohhnfdcuoehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssg drtggrqeenucggtffrrghtthgvrhhnpeeiueefjeeiveetuddvkeetfeeltdevffevudeh ffefjedufedvieejgedugeekhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehmphgvrghrshhonhdqlhgvnhhovhhosehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 845FBC60097; Wed, 5 Jun 2024 22:13:11 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-497-g97f96844c-fm-20240526.001-g97f96844 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <69b41002-69d7-4327-a8cd-b8bdc371ad2c@app.fastmail.com> In-Reply-To: References: <20240604194056.16625-1-mpearson-lenovo@squebb.ca> <2midmmssv2i3plvtc2hajar6alfvggpnbvgpmldspelxsnjvcl@qiblhwat6n3p> Date: Wed, 05 Jun 2024 22:12:45 -0400 From: "Mark Pearson" To: "Dmitry Baryshkov" Cc: "Heikki Krogerus" , "Greg KH" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "Diogo Ivo" Subject: Re: [PATCH] usb: typec: ucsi: treat get_pdos not supported condition as info instead of error Content-Type: text/plain On Wed, Jun 5, 2024, at 7:26 PM, Dmitry Baryshkov wrote: > On Wed, 5 Jun 2024 at 20:09, Mark Pearson wrote: >> >> Thanks Dmitry (& Diogo from the other thread) >> >> On Tue, Jun 4, 2024, at 7:45 PM, Dmitry Baryshkov wrote: >> > On Tue, Jun 04, 2024 at 03:40:44PM -0400, Mark Pearson wrote: >> >> On systems where the UCSI PDOs are not supported, the UCSI driver is >> >> giving an error message. This can cause users to believe there is a HW >> >> issue with their system when in fact it is working as designed. >> >> >> >> Downgrade message to dev_info for EOPNOTSUPP condition. >> >> >> >> Tested on Lenovo L14 G5 AMD and confirmed with Lenovo FW team that PDOs >> >> are not supported on this platform. >> >> >> >> Signed-off-by: Mark Pearson >> >> --- >> >> drivers/usb/typec/ucsi/ucsi.c | 8 ++++++-- >> >> 1 file changed, 6 insertions(+), 2 deletions(-) >> >> >> >> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c >> >> index cb52e7b0a2c5..090be87d5485 100644 >> >> --- a/drivers/usb/typec/ucsi/ucsi.c >> >> +++ b/drivers/usb/typec/ucsi/ucsi.c >> >> @@ -632,8 +632,12 @@ static int ucsi_read_pdos(struct ucsi_connector *con, >> >> command |= is_source(role) ? UCSI_GET_PDOS_SRC_PDOS : 0; >> >> ret = ucsi_send_command(ucsi, command, pdos + offset, >> >> num_pdos * sizeof(u32)); >> >> - if (ret < 0 && ret != -ETIMEDOUT) >> >> - dev_err(ucsi->dev, "UCSI_GET_PDOS failed (%d)\n", ret); >> >> + if (ret < 0 && ret != -ETIMEDOUT) { >> >> + if (ret == -EOPNOTSUPP) >> >> + dev_info(ucsi->dev, "UCSI_GET_PDOS not supported on this hardware\n"); >> > >> > Maybe it would be enough to guard GET_PDOS commands with the >> > UCSI_CAP_PDO_DETAILS check? Is it cleared on affected platforms? >> > >> >> I checked on the system I have and the features are 0x84, so the CAP_PDO_DETAILS aren't set. >> I can do a formal patch if the approach is better, I ended up doing: >> >> @@ -645,9 +645,13 @@ static int ucsi_read_pdos(struct ucsi_connector *con, >> static int ucsi_get_pdos(struct ucsi_connector *con, enum typec_role role, >> int is_partner, u32 *pdos) >> { >> + struct ucsi *ucsi = con->ucsi; >> u8 num_pdos; >> int ret; >> >> + if (!(ucsi->cap.features & UCSI_CAP_PDO_DETAILS)) >> + return 0; >> + >> /* UCSI max payload means only getting at most 4 PDOs at a time */ >> ret = ucsi_read_pdos(con, role, is_partner, pdos, 0, UCSI_MAX_PDOS); >> >> And this did indeed squelch the 'error' message. >> >> Couple of notes: >> - I don't know this area very well, so don't know if there are risks of any regressions in other circumstances. I think it's pretty safe, but if any experts have an opinion that would be appreciated. >> - It means that there isn't a log message saying that PDO capabilities are not available. Are there going to be power related tooling that won't work and it would be useful to have that message available? > > From my POV this patch looks good. Also if there are no PDOs, then the > UCSI driver will register an empty usb_power_delivery object with > neither source nor sink capabilities being present. So userspace can > identify the case of PDOs retrieval being unsupported. If you really > want to have a possible trace in the logs, it might be a good idea to > add dev_dbg under this if statement. > Thanks Dmitry. I don't have any concerns about not having a log message myself. I'll wait a couple more days in case there is other feedback and, if all good, get a new patch submitted with this change instead. Mark