* [PATCH 0/2] ucsi_ccg: Compat with non-NVIDIA
@ 2025-02-21 5:40 Mario Limonciello
2025-02-21 5:40 ` [PATCH 1/2] ucsi_ccg: Don't show failed to get FW build information error Mario Limonciello
2025-02-21 5:40 ` [PATCH 2/2] ucsi_ccg: Don't show non-functional attributes Mario Limonciello
0 siblings, 2 replies; 7+ messages in thread
From: Mario Limonciello @ 2025-02-21 5:40 UTC (permalink / raw)
To: mario.limonciello, ajayg, gregkh, heikki.krogerus; +Cc: linux-usb
From: Mario Limonciello <mario.limonciello@amd.com>
On some non-NVIDIA machines ucsi_ccg will probe and show errors
because of not having some NVIDIA specific device properties.
Avoid showing this error and adjust the behavior for the sysfs
file related to it.
Mario Limonciello (2):
ucsi_ccg: Don't show failed to get FW build information error
ucsi_ccg: Don't show non-functional attributes
drivers/usb/typec/ucsi/ucsi_ccg.c | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] ucsi_ccg: Don't show failed to get FW build information error
2025-02-21 5:40 [PATCH 0/2] ucsi_ccg: Compat with non-NVIDIA Mario Limonciello
@ 2025-02-21 5:40 ` Mario Limonciello
2025-02-21 6:45 ` Greg KH
2025-02-26 10:00 ` Heikki Krogerus
2025-02-21 5:40 ` [PATCH 2/2] ucsi_ccg: Don't show non-functional attributes Mario Limonciello
1 sibling, 2 replies; 7+ messages in thread
From: Mario Limonciello @ 2025-02-21 5:40 UTC (permalink / raw)
To: mario.limonciello, heikki.krogerus, gregkh, ajayg; +Cc: linux-usb
From: Mario Limonciello <mario.limonciello@amd.com>
The error `failed to get FW build information` is added for what looks
to be for misdetection of the device property firmware-name.
If the property is missing (such as on non-nvidia HW) this error shows up.
Move the error into the scope of the property parser for "firmware-name"
to avoid showing errors on systems without the firmware-name property.
Fixes: 5c9ae5a87573d ("usb: typec: ucsi: ccg: add firmware flashing support")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/usb/typec/ucsi/ucsi_ccg.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index 740171f24ef9f..663aca9421410 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -1432,11 +1432,10 @@ static int ucsi_ccg_probe(struct i2c_client *client)
uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
else if (!strcmp(fw_name, "nvidia,gpu"))
uc->fw_build = CCG_FW_BUILD_NVIDIA;
+ if (!uc->fw_build)
+ dev_err(uc->dev, "failed to get FW build information\n");
}
- if (!uc->fw_build)
- dev_err(uc->dev, "failed to get FW build information\n");
-
/* reset ccg device and initialize ucsi */
status = ucsi_ccg_init(uc);
if (status < 0) {
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] ucsi_ccg: Don't show non-functional attributes
2025-02-21 5:40 [PATCH 0/2] ucsi_ccg: Compat with non-NVIDIA Mario Limonciello
2025-02-21 5:40 ` [PATCH 1/2] ucsi_ccg: Don't show failed to get FW build information error Mario Limonciello
@ 2025-02-21 5:40 ` Mario Limonciello
2025-02-26 10:01 ` Heikki Krogerus
1 sibling, 1 reply; 7+ messages in thread
From: Mario Limonciello @ 2025-02-21 5:40 UTC (permalink / raw)
To: mario.limonciello, heikki.krogerus, gregkh; +Cc: linux-usb
From: Mario Limonciello <mario.limonciello@amd.com>
If no fw_build is recognized for the controller there is no point to
exposing the `do_flash` attribute.
Add an is_visible callback to the attribute group and check for that
fw_build member to hide when not applicable.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/usb/typec/ucsi/ucsi_ccg.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index 663aca9421410..801a66efa9820 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -1390,22 +1390,35 @@ static ssize_t do_flash_store(struct device *dev,
if (!flash)
return n;
- if (uc->fw_build == 0x0) {
- dev_err(dev, "fail to flash FW due to missing FW build info\n");
- return -EINVAL;
- }
-
schedule_work(&uc->work);
return n;
}
+static umode_t ucsi_ccg_attrs_is_visible(struct kobject *kobj, struct attribute *attr, int idx)
+{
+ struct device *dev = kobj_to_dev(kobj);
+ struct ucsi_ccg *uc = i2c_get_clientdata(to_i2c_client(dev));
+
+ if (!uc->fw_build)
+ return 0;
+
+ return attr->mode;
+}
+
static DEVICE_ATTR_WO(do_flash);
static struct attribute *ucsi_ccg_attrs[] = {
&dev_attr_do_flash.attr,
NULL,
};
-ATTRIBUTE_GROUPS(ucsi_ccg);
+static struct attribute_group ucsi_ccg_attr_group = {
+ .attrs = ucsi_ccg_attrs,
+ .is_visible = ucsi_ccg_attrs_is_visible,
+};
+static const struct attribute_group *ucsi_ccg_groups[] = {
+ &ucsi_ccg_attr_group,
+ NULL,
+};
static int ucsi_ccg_probe(struct i2c_client *client)
{
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] ucsi_ccg: Don't show failed to get FW build information error
2025-02-21 5:40 ` [PATCH 1/2] ucsi_ccg: Don't show failed to get FW build information error Mario Limonciello
@ 2025-02-21 6:45 ` Greg KH
2025-02-23 2:41 ` Mario Limonciello
2025-02-26 10:00 ` Heikki Krogerus
1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2025-02-21 6:45 UTC (permalink / raw)
To: Mario Limonciello; +Cc: mario.limonciello, heikki.krogerus, ajayg, linux-usb
On Thu, Feb 20, 2025 at 11:40:03PM -0600, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> The error `failed to get FW build information` is added for what looks
> to be for misdetection of the device property firmware-name.
>
> If the property is missing (such as on non-nvidia HW) this error shows up.
> Move the error into the scope of the property parser for "firmware-name"
> to avoid showing errors on systems without the firmware-name property.
>
> Fixes: 5c9ae5a87573d ("usb: typec: ucsi: ccg: add firmware flashing support")
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> drivers/usb/typec/ucsi/ucsi_ccg.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 740171f24ef9f..663aca9421410 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -1432,11 +1432,10 @@ static int ucsi_ccg_probe(struct i2c_client *client)
> uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
> else if (!strcmp(fw_name, "nvidia,gpu"))
> uc->fw_build = CCG_FW_BUILD_NVIDIA;
> + if (!uc->fw_build)
> + dev_err(uc->dev, "failed to get FW build information\n");
> }
>
> - if (!uc->fw_build)
> - dev_err(uc->dev, "failed to get FW build information\n");
> -
> /* reset ccg device and initialize ucsi */
> status = ucsi_ccg_init(uc);
> if (status < 0) {
> --
> 2.43.0
>
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- You have marked a patch with a "Fixes:" tag for a commit that is in an
older released kernel, yet you do not have a cc: stable line in the
signed-off-by area at all, which means that the patch will not be
applied to any older kernel releases. To properly fix this, please
follow the documented rules in the
Documentation/process/stable-kernel-rules.rst file for how to resolve
this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] ucsi_ccg: Don't show failed to get FW build information error
2025-02-21 6:45 ` Greg KH
@ 2025-02-23 2:41 ` Mario Limonciello
0 siblings, 0 replies; 7+ messages in thread
From: Mario Limonciello @ 2025-02-23 2:41 UTC (permalink / raw)
To: Greg KH; +Cc: mario.limonciello, heikki.krogerus, ajayg, linux-usb
On 2/21/25 00:45, Greg KH wrote:
> On Thu, Feb 20, 2025 at 11:40:03PM -0600, Mario Limonciello wrote:
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> The error `failed to get FW build information` is added for what looks
>> to be for misdetection of the device property firmware-name.
>>
>> If the property is missing (such as on non-nvidia HW) this error shows up.
>> Move the error into the scope of the property parser for "firmware-name"
>> to avoid showing errors on systems without the firmware-name property.
>>
>> Fixes: 5c9ae5a87573d ("usb: typec: ucsi: ccg: add firmware flashing support")
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>> drivers/usb/typec/ucsi/ucsi_ccg.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
>> index 740171f24ef9f..663aca9421410 100644
>> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
>> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
>> @@ -1432,11 +1432,10 @@ static int ucsi_ccg_probe(struct i2c_client *client)
>> uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
>> else if (!strcmp(fw_name, "nvidia,gpu"))
>> uc->fw_build = CCG_FW_BUILD_NVIDIA;
>> + if (!uc->fw_build)
>> + dev_err(uc->dev, "failed to get FW build information\n");
>> }
>>
>> - if (!uc->fw_build)
>> - dev_err(uc->dev, "failed to get FW build information\n");
>> -
>> /* reset ccg device and initialize ucsi */
>> status = ucsi_ccg_init(uc);
>> if (status < 0) {
>> --
>> 2.43.0
>>
>>
>
> Hi,
>
> This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
> a patch that has triggered this response. He used to manually respond
> to these common problems, but in order to save his sanity (he kept
> writing the same thing over and over, yet to different people), I was
> created. Hopefully you will not take offence and will fix the problem
> in your patch and resubmit it so that it can be accepted into the Linux
> kernel tree.
>
> You are receiving this message because of the following common error(s)
> as indicated below:
>
> - You have marked a patch with a "Fixes:" tag for a commit that is in an
> older released kernel, yet you do not have a cc: stable line in the
> signed-off-by area at all, which means that the patch will not be
> applied to any older kernel releases. To properly fix this, please
> follow the documented rules in the
> Documentation/process/stable-kernel-rules.rst file for how to resolve
> this.
>
> If you wish to discuss this problem further, or you have questions about
> how to resolve this issue, please feel free to respond to this email and
> Greg will reply once he has dug out from the pending patches received
> from other developers.
>
> thanks,
>
> greg k-h's patch email bot
I do think that adding stable will make sense. If there is no other
changes requested, b4 can pick it up from the email thread without
re-sending:
Cc: stable@vger.kernel.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] ucsi_ccg: Don't show failed to get FW build information error
2025-02-21 5:40 ` [PATCH 1/2] ucsi_ccg: Don't show failed to get FW build information error Mario Limonciello
2025-02-21 6:45 ` Greg KH
@ 2025-02-26 10:00 ` Heikki Krogerus
1 sibling, 0 replies; 7+ messages in thread
From: Heikki Krogerus @ 2025-02-26 10:00 UTC (permalink / raw)
To: Mario Limonciello; +Cc: mario.limonciello, gregkh, ajayg, linux-usb
On Thu, Feb 20, 2025 at 11:40:03PM -0600, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> The error `failed to get FW build information` is added for what looks
> to be for misdetection of the device property firmware-name.
>
> If the property is missing (such as on non-nvidia HW) this error shows up.
> Move the error into the scope of the property parser for "firmware-name"
> to avoid showing errors on systems without the firmware-name property.
>
> Fixes: 5c9ae5a87573d ("usb: typec: ucsi: ccg: add firmware flashing support")
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/ucsi/ucsi_ccg.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 740171f24ef9f..663aca9421410 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -1432,11 +1432,10 @@ static int ucsi_ccg_probe(struct i2c_client *client)
> uc->fw_build = CCG_FW_BUILD_NVIDIA_TEGRA;
> else if (!strcmp(fw_name, "nvidia,gpu"))
> uc->fw_build = CCG_FW_BUILD_NVIDIA;
> + if (!uc->fw_build)
> + dev_err(uc->dev, "failed to get FW build information\n");
> }
>
> - if (!uc->fw_build)
> - dev_err(uc->dev, "failed to get FW build information\n");
> -
> /* reset ccg device and initialize ucsi */
> status = ucsi_ccg_init(uc);
> if (status < 0) {
> --
> 2.43.0
--
heikki
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ucsi_ccg: Don't show non-functional attributes
2025-02-21 5:40 ` [PATCH 2/2] ucsi_ccg: Don't show non-functional attributes Mario Limonciello
@ 2025-02-26 10:01 ` Heikki Krogerus
0 siblings, 0 replies; 7+ messages in thread
From: Heikki Krogerus @ 2025-02-26 10:01 UTC (permalink / raw)
To: Mario Limonciello; +Cc: mario.limonciello, gregkh, linux-usb
On Thu, Feb 20, 2025 at 11:40:04PM -0600, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> If no fw_build is recognized for the controller there is no point to
> exposing the `do_flash` attribute.
>
> Add an is_visible callback to the attribute group and check for that
> fw_build member to hide when not applicable.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/ucsi/ucsi_ccg.c | 25 +++++++++++++++++++------
> 1 file changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 663aca9421410..801a66efa9820 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -1390,22 +1390,35 @@ static ssize_t do_flash_store(struct device *dev,
> if (!flash)
> return n;
>
> - if (uc->fw_build == 0x0) {
> - dev_err(dev, "fail to flash FW due to missing FW build info\n");
> - return -EINVAL;
> - }
> -
> schedule_work(&uc->work);
> return n;
> }
>
> +static umode_t ucsi_ccg_attrs_is_visible(struct kobject *kobj, struct attribute *attr, int idx)
> +{
> + struct device *dev = kobj_to_dev(kobj);
> + struct ucsi_ccg *uc = i2c_get_clientdata(to_i2c_client(dev));
> +
> + if (!uc->fw_build)
> + return 0;
> +
> + return attr->mode;
> +}
> +
> static DEVICE_ATTR_WO(do_flash);
>
> static struct attribute *ucsi_ccg_attrs[] = {
> &dev_attr_do_flash.attr,
> NULL,
> };
> -ATTRIBUTE_GROUPS(ucsi_ccg);
> +static struct attribute_group ucsi_ccg_attr_group = {
> + .attrs = ucsi_ccg_attrs,
> + .is_visible = ucsi_ccg_attrs_is_visible,
> +};
> +static const struct attribute_group *ucsi_ccg_groups[] = {
> + &ucsi_ccg_attr_group,
> + NULL,
> +};
>
> static int ucsi_ccg_probe(struct i2c_client *client)
> {
> --
> 2.43.0
--
heikki
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-02-26 10:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21 5:40 [PATCH 0/2] ucsi_ccg: Compat with non-NVIDIA Mario Limonciello
2025-02-21 5:40 ` [PATCH 1/2] ucsi_ccg: Don't show failed to get FW build information error Mario Limonciello
2025-02-21 6:45 ` Greg KH
2025-02-23 2:41 ` Mario Limonciello
2025-02-26 10:00 ` Heikki Krogerus
2025-02-21 5:40 ` [PATCH 2/2] ucsi_ccg: Don't show non-functional attributes Mario Limonciello
2025-02-26 10:01 ` Heikki Krogerus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).