Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp25724lqp; Sun, 9 Jun 2024 14:43:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULXbTG+7cKOccxv+SN8iRzM/rcuW7wdyPFb6Cy9Znm1reDfUjlEgnQY4KQWnYshedogXbsUjEldcArAFWVAgT6v2NEzwSan8j8UpzAtQ== X-Google-Smtp-Source: AGHT+IGiEboB8zjC1otnShxgYz/uxWdVcp+iv6wMA14SFUVmi+f4ROqOmpPwLaRo7RWcNuwcskKh X-Received: by 2002:ac2:498d:0:b0:52b:c2b9:d988 with SMTP id 2adb3069b0e04-52bc2b9da42mr4695463e87.40.1717969438710; Sun, 09 Jun 2024 14:43:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717969438; cv=pass; d=google.com; s=arc-20160816; b=f/YTZ0eaVCWJunwZLJ0rJ08a92xDE6cvDKIJDwPWG2jhKV1dnDvupUi/tp1n+ZsfyG NU76VrO6zR+UsIieKH7yLmEofrRaVWGiLV9MgnoH+LknMDjB/d7U0HSpqYaxMAIgiQiF 2ZMI+3s98PqFRap6MyJ2WLl0gUNWKexD6qsRbjN+qTvyZnjurTSwyvTXdlj9TZhgRMVB PkgArfYFOVxEwVYUaWL90t+PfXL8Ga6JRMME/HNfCjtMSGJVGRpfTOozx0pBm3+1KCXl ykWvlyAtE4v10i+YGF6cvEggX+0O5DvcycVo/6YPDkrUm2OhHHtKnjQegfUkL+d9qATR uiQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:feedback-id:dkim-signature:dkim-signature; bh=fGXoDc5UQ7R92D0+Vz5I/WElToagZBOZ6lR8JyKacWE=; fh=Dik5GMP4At5etDutDLpW+Zmd/2QXCADVeDMiQobtTjQ=; b=KErQkpnzssNeZG937mMhKJBzaNdlWlUCmYJ5oZPklfRAvf6xJxsGYaoc2AN0ul3GMK 9fmJFLd6qsDvqSjY8Oq0nmJfhioT7XpezHs0de5vel9wnhLwq2i9b+T42wmJzPk83lLm dHfi7nX8j9YfdbYLlxUjsS8z9Y1+3XnAGOhWsP3hz6OZG0edQBbMNHahc+3We8YxtLpQ NfLApT8fXzUrozgxHf+xXEEwYwqJEdL2MlHOIqMrvFLzCPyFUptci0Q8LzazXJwlb+72 Y5AQxphShfCgIsnW32PpARNHjDmOTbEU6DJXilU8noZ35+m/0eulzCfSepCKipkDmfK8 EGCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@squebb.ca header.s=fm2 header.b=XImHj7o6; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="OFv/hOoE"; 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-207521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207521-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f185bf51csi87638466b.306.2024.06.09.14.43.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 14:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207521-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=@squebb.ca header.s=fm2 header.b=XImHj7o6; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="OFv/hOoE"; 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-207521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207521-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 67E311F21103 for ; Sun, 9 Jun 2024 21:43:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96A2D52F6A; Sun, 9 Jun 2024 21:43:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=squebb.ca header.i=@squebb.ca header.b="XImHj7o6"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OFv/hOoE" Received: from fout8-smtp.messagingengine.com (fout8-smtp.messagingengine.com [103.168.172.151]) (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 0521C48CE0; Sun, 9 Jun 2024 21:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717969428; cv=none; b=ZQfmafBYp+kwy7sPWs1BII89Y+D2nQ8tYQHUxEZMZgMEWYy5dLNSE1rf8vid440D1M0SwrwpSEt5/gLb+CReVj2FbXTFeEf76/osT/3vety68JrAxDrLYZdOywGOX6oJbzLL+N8k4JU/69l5rBACe9easXv8YbJ92YwRI3ZyfXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717969428; c=relaxed/simple; bh=HJgurrWiX7eXP4/IiNcGUcXHq8B7HVmDJ3Xbz7REcyE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hYbhZCZfx9BEoEokDJ4C83jjUmUFEeocNZ93R1w0f/J0i8F5T9k+EyEr7V3UDUl733pkc5Qdj7Guujjt7no6/91IETw/ey1zz8Zd5C/hu8KzTw/i7ZPPms/W24AOQw8IJVLBtSonijEbzxXK4dLr/wrsqeKNqPzs9llZl1HbEJc= 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=XImHj7o6; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OFv/hOoE; arc=none smtp.client-ip=103.168.172.151 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 compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 0147913800C2; Sun, 9 Jun 2024 17:43:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 09 Jun 2024 17:43:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-transfer-encoding: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=1717969424; x= 1718055824; bh=fGXoDc5UQ7R92D0+Vz5I/WElToagZBOZ6lR8JyKacWE=; b=X ImHj7o6OhXSA1D8wybapa2gE4lY/FttnqFiGnltyOvsho9nXXG2uooFMwOsnPqBy MB1/JwtctjTauXMWydtA8BTVxG634bd15zNGytG4kJ0bvSMv5MqI7pPLnEfqzeKr e8+y5knhXbfbnhp7n9erHcGeGWkzcbZ54uhKoBGVZr3VY+1JwRDcnd8b95+5JG8d K7vo3+/sb/9m9xOhOXdhC837Fhszt3vDFxnQTlBPWrgCUh3LnX9jnXprGp4XPRXQ YolsM51/bt+FVOleAt/f6Mm7Eu2LTWlExPoUfF9v8q5UIcVTX4LhTjxkAdAINokZ qHmWHpw1NWf/aDLFKgypw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1717969424; x= 1718055824; bh=fGXoDc5UQ7R92D0+Vz5I/WElToagZBOZ6lR8JyKacWE=; b=O Fv/hOoEMJbyIFtVcjPMCbMXCMCm4SCIlQu/bMnDJQ/2j6VjtU5iPvAUdid5ltmdR hSK06azb6ogDhYZCnQ1VHGgjzg76NIgILM61oFJz/Yi/kwfAEYFE1aUllWBYgVaw IrE+kT5lFzAwh2LqMCfaFd3VbIw29hR5uAwExlZu8uPsvNajRqzQIt9JOTX7+cQV athT1KOKThpigCZQnQcZfN/lxF2Va1uZZk/vIZbpDLpajuUPyvQikUKrdOWgm8su CPTm5ZOPKBuahJNTBfwCaTsgIEIrroGIaOuT5lL+cljVBO6rjHfYXYX6InZKNals hlpfYJWcW2sCWEnnip7Kw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtkedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoteeftdduqddtudculdduhedmnecujfgurhephf fvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrrhhkucfrvggrrhhs ohhnuceomhhpvggrrhhsohhnqdhlvghnohhvohesshhquhgvsggsrdgtrgeqnecuggftrf grthhtvghrnhepfedtvdejfeelffevhffgjeejheduteetieeguefgkefhhfegjeduueet hefgvdffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhhpvggrrhhsohhnqdhlvghnohhvohesshhquhgvsggsrdgtrg X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 9 Jun 2024 17:43:44 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: diogo.ivo@siemens.com, dmitry.baryshkov@linaro.org, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: typec: ucsi: don't retrieve PDOs if not supported Date: Sun, 9 Jun 2024 17:43:18 -0400 Message-ID: <20240609214328.6580-1-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.45.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Check if PDO_DETAILS are supported as a feature before attempting to access PDO. If not supported return that zero PDOs are available. Tested on Lenovo L14 G5 AMD and confirmed with Lenovo FW team that PDOs are not supported on this platform. Suggested-by: Diogo Ivo Suggested-by: Dmitry Baryshkov Signed-off-by: Mark Pearson --- Note this patch replaces my previous submission 'treat get_pdos not supported condition as info instead of error', based on feedback from review. drivers/usb/typec/ucsi/ucsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index cb52e7b0a2c5..cadea8d328ed 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -641,9 +641,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); if (ret < 0) -- 2.45.1