linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware/dmi: Include product_sku info to modalias
@ 2020-10-22  6:40 kaichuan.hsieh
  2020-10-22 12:42 ` Jean Delvare
  0 siblings, 1 reply; 9+ messages in thread
From: kaichuan.hsieh @ 2020-10-22  6:40 UTC (permalink / raw)
  To: jdelvare, linux-kernel

From: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>

Some Dell platforms rely on modalias to customize configuration,
the product sku can be more specific for the hardware.

Add product_sku to modalias for better utilization.

Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
---
 drivers/firmware/dmi-id.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index 86d71b0212b1..26eb01da5392 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -77,21 +77,22 @@ static ssize_t get_modalias(char *buffer, size_t buffer_size)
 		const char *prefix;
 		int field;
 	} fields[] = {
-		{ "bvn", DMI_BIOS_VENDOR },
-		{ "bvr", DMI_BIOS_VERSION },
-		{ "bd",  DMI_BIOS_DATE },
-		{ "br",  DMI_BIOS_RELEASE },
-		{ "efr", DMI_EC_FIRMWARE_RELEASE },
-		{ "svn", DMI_SYS_VENDOR },
-		{ "pn",  DMI_PRODUCT_NAME },
-		{ "pvr", DMI_PRODUCT_VERSION },
-		{ "rvn", DMI_BOARD_VENDOR },
-		{ "rn",  DMI_BOARD_NAME },
-		{ "rvr", DMI_BOARD_VERSION },
-		{ "cvn", DMI_CHASSIS_VENDOR },
-		{ "ct",  DMI_CHASSIS_TYPE },
-		{ "cvr", DMI_CHASSIS_VERSION },
-		{ NULL,  DMI_NONE }
+		{ "bvn",  DMI_BIOS_VENDOR },
+		{ "bvr",  DMI_BIOS_VERSION },
+		{ "bd",   DMI_BIOS_DATE },
+		{ "br",   DMI_BIOS_RELEASE },
+		{ "efr",  DMI_EC_FIRMWARE_RELEASE },
+		{ "svn",  DMI_SYS_VENDOR },
+		{ "pn",   DMI_PRODUCT_NAME },
+		{ "pvr",  DMI_PRODUCT_VERSION },
+		{ "psku", DMI_PRODUCT_SKU },
+		{ "rvn",  DMI_BOARD_VENDOR },
+		{ "rn",   DMI_BOARD_NAME },
+		{ "rvr",  DMI_BOARD_VERSION },
+		{ "cvn",  DMI_CHASSIS_VENDOR },
+		{ "ct",   DMI_CHASSIS_TYPE },
+		{ "cvr",  DMI_CHASSIS_VERSION },
+		{ NULL,   DMI_NONE }
 	};
 
 	ssize_t l, left;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] firmware/dmi: Include product_sku info to modalias
  2020-10-22  6:40 [PATCH] firmware/dmi: Include product_sku info to modalias kaichuan.hsieh
@ 2020-10-22 12:42 ` Jean Delvare
  2020-10-22 13:11   ` Kai-Chuan Hsieh
  0 siblings, 1 reply; 9+ messages in thread
From: Jean Delvare @ 2020-10-22 12:42 UTC (permalink / raw)
  To: kaichuan.hsieh; +Cc: linux-kernel

Hi Kai-Chuan,

On Thu, 22 Oct 2020 14:40:47 +0800, kaichuan.hsieh@canonical.com wrote:
> From: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
> 
> Some Dell platforms rely on modalias to customize configuration,
> the product sku can be more specific for the hardware.
> 
> Add product_sku to modalias for better utilization.

Do you have an actual use case for this already, or is it a theoretical
concern?

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] firmware/dmi: Include product_sku info to modalias
  2020-10-22 12:42 ` Jean Delvare
@ 2020-10-22 13:11   ` Kai-Chuan Hsieh
  2020-10-27 16:12     ` Jean Delvare
  0 siblings, 1 reply; 9+ messages in thread
From: Kai-Chuan Hsieh @ 2020-10-22 13:11 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-kernel

Hello Jean,

There are multiple product skus share the same product name, like 
clamshell and 2-in-1 for Latitude series.
Both of them have 3-axis accelerator, but rotation is only disable for 
clamshell model.
Originally, it should be descriminated by chassis_type, but found that 
chassis_type is not trustful.
https://github.com/systemd/systemd/pull/17084#issuecomment-706931881
Therefore, I would like to propose a change to include the product_sku 
for applying customized configuration easier.

Thanks,
KaiChuan

On 10/22/20 8:42 PM, Jean Delvare wrote:
> Hi Kai-Chuan,
> 
> On Thu, 22 Oct 2020 14:40:47 +0800, kaichuan.hsieh@canonical.com wrote:
>> From: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
>>
>> Some Dell platforms rely on modalias to customize configuration,
>> the product sku can be more specific for the hardware.
>>
>> Add product_sku to modalias for better utilization.
> 
> Do you have an actual use case for this already, or is it a theoretical
> concern?
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] firmware/dmi: Include product_sku info to modalias
  2020-10-22 13:11   ` Kai-Chuan Hsieh
@ 2020-10-27 16:12     ` Jean Delvare
  0 siblings, 0 replies; 9+ messages in thread
From: Jean Delvare @ 2020-10-27 16:12 UTC (permalink / raw)
  To: Kai-Chuan Hsieh; +Cc: linux-kernel

Hi Kai-Chuan,

On Thu, 22 Oct 2020 21:11:32 +0800, Kai-Chuan Hsieh wrote:
> There are multiple product skus share the same product name, like 
> clamshell and 2-in-1 for Latitude series.
> Both of them have 3-axis accelerator, but rotation is only disable for 
> clamshell model.
> Originally, it should be descriminated by chassis_type, but found that 
> chassis_type is not trustful.
> https://github.com/systemd/systemd/pull/17084#issuecomment-706931881
> Therefore, I would like to propose a change to include the product_sku 
> for applying customized configuration easier.

OK. On the principle I'm fine with the change. As far as the
implementation details go, I'd rather stick to 3 letters maximum as we
did for other fields, to keep the overall string as short as possible.
This also has the nice effect that you wouldn't need to realign
everything, which would make the patch more readable too.

So please go with either "sku" (my preference) or "psk".

Thanks,
-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] firmware/dmi: Include product_sku info to modalias
  2020-10-28  9:04 ` Jean Delvare
@ 2020-10-28  9:15   ` Kai-Chuan Hsieh
  0 siblings, 0 replies; 9+ messages in thread
From: Kai-Chuan Hsieh @ 2020-10-28  9:15 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-kernel

Hello Jean,

Thanks for your reminder, I'll read the document for future submission.
Sorry for not following the rule this time.

Thanks,
KaiChuan

On 10/28/20 5:04 PM, Jean Delvare wrote:
> Hi Kai-Chuan,
> 
> On Wed, 28 Oct 2020 11:50:15 +0800, Kai-Chuan Hsieh wrote:
>> Some Dell platforms rely on modalias to customize configuration,
>> the product sku can be more specific for the hardware.
>>
>> Add product_sku to modalias for better utilization.
>>
>> Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
>> ---
>>   drivers/firmware/dmi-id.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
>> index 86d71b0212b1..4d5421d14a41 100644
>> --- a/drivers/firmware/dmi-id.c
>> +++ b/drivers/firmware/dmi-id.c
>> @@ -85,6 +85,7 @@ static ssize_t get_modalias(char *buffer, size_t buffer_size)
>>   		{ "svn", DMI_SYS_VENDOR },
>>   		{ "pn",  DMI_PRODUCT_NAME },
>>   		{ "pvr", DMI_PRODUCT_VERSION },
>> +		{ "sku", DMI_PRODUCT_SKU },
>>   		{ "rvn", DMI_BOARD_VENDOR },
>>   		{ "rn",  DMI_BOARD_NAME },
>>   		{ "rvr", DMI_BOARD_VERSION },
> 
> Applied, thanks.
> 
> For your future submissions, I invite you to read
> Documentation/process/submitting-patches.rst
> 
> Specifically, when submitting a new version of a patch, please:
> * Replace [PATCH] with [PATCH v2] in the subject.
> * Do not reply to the previous version of the patch, instead start a
>    new thread.
> * Ideally, include a list of changes from previous version, between the
>    "---" marker and the diffstat.
> 
> Thanks,
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] firmware/dmi: Include product_sku info to modalias
  2020-10-28  3:50 Kai-Chuan Hsieh
@ 2020-10-28  9:04 ` Jean Delvare
  2020-10-28  9:15   ` Kai-Chuan Hsieh
  0 siblings, 1 reply; 9+ messages in thread
From: Jean Delvare @ 2020-10-28  9:04 UTC (permalink / raw)
  To: Kai-Chuan Hsieh; +Cc: linux-kernel

Hi Kai-Chuan,

On Wed, 28 Oct 2020 11:50:15 +0800, Kai-Chuan Hsieh wrote:
> Some Dell platforms rely on modalias to customize configuration,
> the product sku can be more specific for the hardware.
> 
> Add product_sku to modalias for better utilization.
> 
> Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
> ---
>  drivers/firmware/dmi-id.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
> index 86d71b0212b1..4d5421d14a41 100644
> --- a/drivers/firmware/dmi-id.c
> +++ b/drivers/firmware/dmi-id.c
> @@ -85,6 +85,7 @@ static ssize_t get_modalias(char *buffer, size_t buffer_size)
>  		{ "svn", DMI_SYS_VENDOR },
>  		{ "pn",  DMI_PRODUCT_NAME },
>  		{ "pvr", DMI_PRODUCT_VERSION },
> +		{ "sku", DMI_PRODUCT_SKU },
>  		{ "rvn", DMI_BOARD_VENDOR },
>  		{ "rn",  DMI_BOARD_NAME },
>  		{ "rvr", DMI_BOARD_VERSION },

Applied, thanks.

For your future submissions, I invite you to read
Documentation/process/submitting-patches.rst

Specifically, when submitting a new version of a patch, please:
* Replace [PATCH] with [PATCH v2] in the subject.
* Do not reply to the previous version of the patch, instead start a
  new thread.
* Ideally, include a list of changes from previous version, between the
  "---" marker and the diffstat.

Thanks,
-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] firmware/dmi: Include product_sku info to modalias
       [not found] <20201022064936.10854-1-kaichuan.hsieh@canonical.com>
@ 2020-10-28  4:38 ` Kai-Chuan Hsieh
  0 siblings, 0 replies; 9+ messages in thread
From: Kai-Chuan Hsieh @ 2020-10-28  4:38 UTC (permalink / raw)
  To: jdelvare, linux-kernel

Some Dell platforms rely on modalias to customize configuration,
the product sku can be more specific for the hardware.

Add product_sku to modalias for better utilization.

Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
---
 drivers/firmware/dmi-id.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index 86d71b0212b1..4d5421d14a41 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -85,6 +85,7 @@ static ssize_t get_modalias(char *buffer, size_t buffer_size)
 		{ "svn", DMI_SYS_VENDOR },
 		{ "pn",  DMI_PRODUCT_NAME },
 		{ "pvr", DMI_PRODUCT_VERSION },
+		{ "sku", DMI_PRODUCT_SKU },
 		{ "rvn", DMI_BOARD_VENDOR },
 		{ "rn",  DMI_BOARD_NAME },
 		{ "rvr", DMI_BOARD_VERSION },
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] firmware/dmi: Include product_sku info to modalias
       [not found] <[PATCH] firmware/dmi: Include product_sku info to modalias>
@ 2020-10-28  4:13 ` Kai-Chuan Hsieh
  0 siblings, 0 replies; 9+ messages in thread
From: Kai-Chuan Hsieh @ 2020-10-28  4:13 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-kernel

Some Dell platforms rely on modalias to customize configuration,
the product sku can be more specific for the hardware.

Add product_sku to modalias for better utilization.

Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
---
 drivers/firmware/dmi-id.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index 86d71b0212b1..4d5421d14a41 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -85,6 +85,7 @@ static ssize_t get_modalias(char *buffer, size_t buffer_size)
 		{ "svn", DMI_SYS_VENDOR },
 		{ "pn",  DMI_PRODUCT_NAME },
 		{ "pvr", DMI_PRODUCT_VERSION },
+		{ "sku", DMI_PRODUCT_SKU },
 		{ "rvn", DMI_BOARD_VENDOR },
 		{ "rn",  DMI_BOARD_NAME },
 		{ "rvr", DMI_BOARD_VERSION },
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] firmware/dmi: Include product_sku info to modalias
@ 2020-10-28  3:50 Kai-Chuan Hsieh
  2020-10-28  9:04 ` Jean Delvare
  0 siblings, 1 reply; 9+ messages in thread
From: Kai-Chuan Hsieh @ 2020-10-28  3:50 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-kernel

Some Dell platforms rely on modalias to customize configuration,
the product sku can be more specific for the hardware.

Add product_sku to modalias for better utilization.

Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
---
 drivers/firmware/dmi-id.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index 86d71b0212b1..4d5421d14a41 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -85,6 +85,7 @@ static ssize_t get_modalias(char *buffer, size_t buffer_size)
 		{ "svn", DMI_SYS_VENDOR },
 		{ "pn",  DMI_PRODUCT_NAME },
 		{ "pvr", DMI_PRODUCT_VERSION },
+		{ "sku", DMI_PRODUCT_SKU },
 		{ "rvn", DMI_BOARD_VENDOR },
 		{ "rn",  DMI_BOARD_NAME },
 		{ "rvr", DMI_BOARD_VERSION },
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-10-29  1:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22  6:40 [PATCH] firmware/dmi: Include product_sku info to modalias kaichuan.hsieh
2020-10-22 12:42 ` Jean Delvare
2020-10-22 13:11   ` Kai-Chuan Hsieh
2020-10-27 16:12     ` Jean Delvare
2020-10-28  3:50 Kai-Chuan Hsieh
2020-10-28  9:04 ` Jean Delvare
2020-10-28  9:15   ` Kai-Chuan Hsieh
     [not found] <[PATCH] firmware/dmi: Include product_sku info to modalias>
2020-10-28  4:13 ` Kai-Chuan Hsieh
     [not found] <20201022064936.10854-1-kaichuan.hsieh@canonical.com>
2020-10-28  4:38 ` Kai-Chuan Hsieh

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).