Received: by 10.223.185.111 with SMTP id b44csp646592wrg; Fri, 9 Mar 2018 10:57:28 -0800 (PST) X-Google-Smtp-Source: AG47ELsFig4KHo8SiA7pK3OqNOEarOMGbZyS/uQpKFI3sl0CKuRt/JDMQ7S3kFGb9P6S9bjnt/s5 X-Received: by 10.99.121.5 with SMTP id u5mr25091491pgc.444.1520621848192; Fri, 09 Mar 2018 10:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520621848; cv=none; d=google.com; s=arc-20160816; b=BXlZvNiGdimhqhdLgQeovRlqeIkSNo7SiI/jOec+kkH4NZdq96OYXM3fm4Em6c5Azr drA5Ws6wvsMaQId83BnvGFApwf7JqezI2eokZ0IOSSTkVrXcmNezgVpFXsMEQXR45Y5V CKx0iW49sF/R+hk3NtQOIWKf8YvUtUPIAeUIpRGhCqy505ltfffRdvFsuOrRUFbOdqI9 dpvXI9ihaXRO620jMkvVq/iiVb9IqBeylCWRQ5nWakKPXjYswObaqPpKiBhzBCglZoY7 80xbOjFun93YUaQzN1+qarARH1nFq7bHzi75R9mKx+0v5SIxRsS7SpCqzL6UgAmFXXhz xNeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=UoasImhXz43m4sxlfv7s4UTzYZ6BaJrkHs8YOiS2m6k=; b=fbpQIKMflWJvIoKwdpzysxv2ZhIiw+941GWNIZhOYwwosmbPs52Hr+QZyWb1HYG2xO VdcpUiRRhTQUtIkWZ88VtqjMgHryNK9Ejnmzb+FVkQzkgTYblD03bLs0hADbsHTJH87v 0ejH2yQ7MJte+6aoAUU4iXLDElS0FRi7tf7VbVEhqXyYC3OIC1Y7cT0uJTveviRZ0KfR TaVBjfNqBatK/Odg1FKOyKsJX9+SrvxGbYzt4sRQJVjMi92slYBAy5vy5U3o335eLD1T tJ1cwe8UsQQ+Chyb9VhtGtpFyetewwxVqvYMzAnejgkNcQBMF1YJn+ef/WcpwVsryffY X9Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a61-v6si1269941plc.669.2018.03.09.10.57.13; Fri, 09 Mar 2018 10:57:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932541AbeCIS4L (ORCPT + 99 others); Fri, 9 Mar 2018 13:56:11 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:50325 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932165AbeCIS4K (ORCPT ); Fri, 9 Mar 2018 13:56:10 -0500 Received: from mail-qk0-f197.google.com ([209.85.220.197]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1euNBZ-00021T-F5 for linux-kernel@vger.kernel.org; Fri, 09 Mar 2018 18:56:09 +0000 Received: by mail-qk0-f197.google.com with SMTP id c76so2925900qke.19 for ; Fri, 09 Mar 2018 10:56:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UoasImhXz43m4sxlfv7s4UTzYZ6BaJrkHs8YOiS2m6k=; b=nM5hS0aDXtA97uFM3hKwz11aWphMHy6zIouydHS+K8EeFgmDTzR/FB3K86mh/2OUiX EyyvD6Xo1orDKOp2XLOYZvv0bHDeTIr7LHKiEJJYP5zbstWwBCEtH0cgnPemep4X8viY cIyV5ApTu18/GR2zSfHlt3mI5D6oS/kew4iwgI8c7OjA5qEf9HPyctkQDGb23Tfx3D8p ghLQVqkA0tXul0YvzQgKcARZL8+RHdHKt3XkUj7W7yhwELEl3DSNVudL3Nw3NGw0GBxV /2ILfq1CvV0d9UIkFd+gw/oQYy1nZVxE4AZAdK6OjDL5Oinl60Q0+eIwLG2JuJuEBYfz wO+w== X-Gm-Message-State: AElRT7EPXgemT8THQJgfc0atbojDLtMUBW0S0eMH3MB5gvUuqMoRpGmz e5mzszeSjBcqi8UV961V3scfYD53RJXIZ0DxY49bhbEDa/LkpI5J+1DzlvxawYRyyPtwyJDKag1 cQEKhTV3yXZXxdHH2ZQv9ECbdUauzgE16uRFQZ+ubz7x25AioLteviTZH7Q== X-Received: by 10.237.47.67 with SMTP id l61mr13972020qtd.120.1520621768381; Fri, 09 Mar 2018 10:56:08 -0800 (PST) X-Received: by 10.237.47.67 with SMTP id l61mr13972000qtd.120.1520621768142; Fri, 09 Mar 2018 10:56:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.157.129 with HTTP; Fri, 9 Mar 2018 10:56:07 -0800 (PST) In-Reply-To: <20180309143315.354ad0be@endymion> References: <1519800494-32107-1-git-send-email-alex.hung@canonical.com> <20180309143315.354ad0be@endymion> From: Alex Hung Date: Fri, 9 Mar 2018 10:56:07 -0800 Message-ID: Subject: Re: [PATCH][V2] firmware: dmi_scan: add DMI_OEM_STRING support to dmi_matches To: Jean Delvare Cc: LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 9, 2018 at 5:33 AM, Jean Delvare wrote: > Hi Alex, > > On Tue, 27 Feb 2018 22:48:14 -0800, Alex Hung wrote: >> OEM strings are defined by each OEM and they contain customized and >> useful OEM information. Supporting it provides more flexible uses of >> the dmi_matches function. >> >> Signed-off-by: Alex Hung >> --- >> drivers/firmware/dmi_scan.c | 11 +++++++++-- >> include/linux/mod_devicetable.h | 1 + >> 2 files changed, 10 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c >> index e763e14..c712e66 100644 >> --- a/drivers/firmware/dmi_scan.c >> +++ b/drivers/firmware/dmi_scan.c >> @@ -775,7 +775,15 @@ static bool dmi_matches(const struct dmi_system_id *dmi) >> int s = dmi->matches[i].slot; >> if (s == DMI_NONE) >> break; >> - if (dmi_ident[s]) { >> + if (s == DMI_OEM_STRING) { >> + /* DMI_OEM_STRING must be exact match */ >> + const struct dmi_device *valid; >> + >> + valid = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, >> + dmi->matches[i].substr, NULL); >> + if (valid) >> + continue; >> + } else if (dmi_ident[s]) { >> if (dmi->matches[i].exact_match) { >> if (!strcmp(dmi_ident[s], >> dmi->matches[i].substr)) >> @@ -786,7 +794,6 @@ static bool dmi_matches(const struct dmi_system_id *dmi) >> continue; >> } >> } >> - >> /* No match */ >> return false; >> } > > Please avoid gratuitous blank line changes. > >> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h >> index 48fb2b4..7d361be 100644 >> --- a/include/linux/mod_devicetable.h >> +++ b/include/linux/mod_devicetable.h >> @@ -502,6 +502,7 @@ enum dmi_field { >> DMI_CHASSIS_SERIAL, >> DMI_CHASSIS_ASSET_TAG, >> DMI_STRING_MAX, >> + DMI_OEM_STRING, /* special case - will not be in dmi_ident */ >> }; >> >> struct dmi_strmatch { > > Other than this, I'm happy with this version, so with the blank line > restored: > > Reviewed-by: Jean Delvare Thank you very much. > > However it doesn't make sense to commit this change unless there will > be at least one user of it. What is the status of the piece of code > which was supposed to use this new feature? The original use of DMI on _OSI is no needed anymore - the OEM _OSI string will always enabled; however, this patch is still needed because DMI_OEM_STRING are more suitable for many DMI quirks, especially for Dell systems, and many, if not all, DMI quirks for Dell systems with DMI_PRODUCT_NAME can be (and should be) replaced by DMI_OEM_STRING because 1) OEM string contains system id, 2) multiple product names can be used for the same system id and 3) the number DMI quirks can be reduced. For example, the DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020M") in commit 1f59ab2783aed04f131 can be replaced by DMI_MATCH_EXACT(DMI_OEM_STRING, "1[0669]") I will start sending DMI quirks with DMI_OEM_STRING myself and perhaps sending a clean up patch to replace DMI_PRODUCT_NAME by DMI_OEM_STRING for the Dell systems I have access to. With this patch in place first, I am able to convince others to use DMI_OEM_STRING because there will fewer risks to spend time in vain. Cheers, Alex Hung > > -- > Jean Delvare > SUSE L3 Support