From: Mark Pearson <mpearson-lenovo@squebb.ca>
To: mpearson-lenovo@squebb.ca
Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] usb: typec: ucsi: treat get_pdos not supported condition as info instead of error
Date: Tue, 4 Jun 2024 15:40:44 -0400 [thread overview]
Message-ID: <20240604194056.16625-1-mpearson-lenovo@squebb.ca> (raw)
In-Reply-To: <mpearson-lenovo@squebb.ca>
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 <mpearson-lenovo@squebb.ca>
---
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");
+ else
+ dev_err(ucsi->dev, "UCSI_GET_PDOS failed (%d)\n", ret);
+ }
return ret;
}
--
2.45.1
next reply other threads:[~2024-06-04 19:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 19:40 Mark Pearson [this message]
2024-06-04 23:45 ` [PATCH] usb: typec: ucsi: treat get_pdos not supported condition as info instead of error Dmitry Baryshkov
2024-06-05 17:09 ` Mark Pearson
2024-06-05 23:26 ` Dmitry Baryshkov
2024-06-06 2:12 ` Mark Pearson
2024-06-06 15:47 ` Diogo Ivo
2024-06-05 10:10 ` Diogo Ivo
2024-06-05 15:29 ` Diogo Ivo
2024-06-05 16:24 ` Mark Pearson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240604194056.16625-1-mpearson-lenovo@squebb.ca \
--to=mpearson-lenovo@squebb.ca \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox