From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Subject: Re: [PATCH] ACPICA: Detect duplicate SSDT tables Date: Fri, 3 Mar 2017 14:52:42 +0100 Message-ID: <1d07f8ff-9672-7141-90c4-3d67c6e23f0f@redhat.com> References: <20170227093432.3308-1-hdegoede@redhat.com> <1AE640813FDE7649BE1B193DEA596E886CE430EF@SHSMSX101.ccr.corp.intel.com> <1AE640813FDE7649BE1B193DEA596E886CE43ED5@SHSMSX101.ccr.corp.intel.com> <1AE640813FDE7649BE1B193DEA596E886CE446CB@SHSMSX101.ccr.corp.intel.com> <1AE640813FDE7649BE1B193DEA596E886CE44EC5@SHSMSX101.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57173 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751945AbdCCOaI (ORCPT ); Fri, 3 Mar 2017 09:30:08 -0500 In-Reply-To: <1AE640813FDE7649BE1B193DEA596E886CE44EC5@SHSMSX101.ccr.corp.intel.com> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: "Zheng, Lv" , "Rafael J . Wysocki" , Len Brown , "Moore, Robert" Cc: "linux-acpi@vger.kernel.org" , "devel@acpica.org" Hi, On 03-03-17 03:50, Zheng, Lv wrote: > Hi, > >> From: Hans de Goede [mailto:hdegoede@redhat.com] >> Subject: Re: [PATCH] ACPICA: Detect duplicate SSDT tables >> >> Hi, >> >> On 02-03-17 02:59, Zheng, Lv wrote: >>> Hi, >>> >>>> From: Hans de Goede [mailto:hdegoede@redhat.com] >>>> Subject: Re: [PATCH] ACPICA: Detect duplicate SSDT tables >>>> >>>> Hi, >>>> >>>> On 01-03-17 04:21, Zheng, Lv wrote: >>>>> Hi, >>>>> >>>>>> From: Hans de Goede [mailto:hdegoede@redhat.com] >>>>>> Subject: Re: [PATCH] ACPICA: Detect duplicate SSDT tables >>>>>> >>>>>> Hi, >>>>>> >>>>>> On 28-02-17 06:19, Zheng, Lv wrote: >>>>>>> Hi, >>>>>>> >>>>>>>> From: Hans de Goede [mailto:hdegoede@redhat.com] >>>>>>>> Subject: [PATCH] ACPICA: Detect duplicate SSDT tables >>>>>>>> >>>>>>>> Some machines have the exact (byte for byte) same SSDT tables multiple >>>>>>>> times in the root_table_list. >> >> >> >>>>>>>> Detect this and silently skip the duplicates >>>>>>>> rather then printing a scary looking set of errors. >> >> >> >>>>>>>> Signed-off-by: Hans de Goede >>>>>>>> --- >>>>>>>> drivers/acpi/acpica/tbxfload.c | 41 ++++++++++++++++++++++++++++++++++++++++- >>>>>>>> 1 file changed, 40 insertions(+), 1 deletion(-) >>>>>>>> >>>>>>>> diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c >>>>>>>> index 82019c0..1971cd7 100644 >>>>>>>> --- a/drivers/acpi/acpica/tbxfload.c >>>>>>>> +++ b/drivers/acpi/acpica/tbxfload.c >>>>>>>> @@ -125,6 +125,44 @@ ACPI_EXPORT_SYMBOL_INIT(acpi_load_tables) >>>>>>>> >>>>>>>> /******************************************************************************* >>>>>>>> * >>>>>>>> + * FUNCTION: acpi_tb_find_duplicate_ssdt >>>>>>>> + * >>>>>>>> + * PARAMETERS: table - validated acpi_table_desc of table to check >>>>>>>> + * index - index of table to find a duplicate of >>>>>>>> + * >>>>>>>> + * RETURN: TRUE if a duplicate is found, FALSE if not >>>>>>>> + * >>>>>>>> + * DESCRIPTION: Private helper function for acpi_tb_load_namespace to >>>>>>>> + * avoid trying to load duplicate ssdt tables >>>>>>>> + * >>>>>>>> + ******************************************************************************/ >>>>>>>> +static u8 acpi_tb_find_duplicate_ssdt(struct acpi_table_desc *table, u32 index) >>> >>> If you really want to add this. >>> My suggestion is: >>> Invoke this function in acpi_tb_verify_temp_table(). >>> This is the function we use to verify if a table is OK. >>> Otherwise it won't be installed to the global table list. >>> >>> And the name should contain "aml_table" or "aml" rather than "ssdt" according to your check below. >> >> Ok, when I've some time I will do a new version moving the functionality >> to acpi_tb_verify_temp_table(). I will post a v2 with this change when >> it is ready. I will also just compare the headers then as suggested in >> other replies in this thread. > > If you wish, I can offer help here. > It actually won't take me much time to generate such a change. Great, if you can send me a new patch to test I'm more then willing to make time to test it. Thanks & Regards, Hans