From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164336AbdD0WhC (ORCPT ); Thu, 27 Apr 2017 18:37:02 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:43471 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162393AbdD0Wgx (ORCPT ); Thu, 27 Apr 2017 18:36:53 -0400 From: "Rafael J. Wysocki" To: Lv Zheng Cc: "Rafael J . Wysocki" , Len Brown , Lv Zheng , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Dan Williams Subject: Re: [PATCH v2 1/2] ACPICA: Tables: Fix regression introduced by a too early mechanism enabling Date: Fri, 28 Apr 2017 00:30:38 +0200 Message-ID: <1841048.oWuTkq5WIo@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.11.0-rc6+; KDE/4.14.9; x86_64; ; ) In-Reply-To: <5361b51c7c257b3216475018a3a5cc4f8b6b21c6.1493281247.git.lv.zheng@intel.com> References: <5361b51c7c257b3216475018a3a5cc4f8b6b21c6.1493281247.git.lv.zheng@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, April 27, 2017 04:22:44 PM Lv Zheng wrote: > In the Linux kernel side, acpi_get_table() clones haven't been fully > balanced by acpi_put_table() invocations. In ACPICA side, due to the design > change, there are also unbalanced acpi_get_table_by_index() invocations > requiring special care to be cleaned up. > > So it is not a good timing to report acpi_get_table() counting errors for > this period. The strict balanced validation count check should only be > enabled after confirming that all invocations are safe and compliant to > their designed purposes. > > Thus this patch removes the fatal error along with lthe error report to > fix this issue. Reported by Dan Williams, fixed by Lv Zheng. > > Fixes: 174cc7187e6f ("ACPICA: Tables: Back port acpi_get_table_with_size() and early_acpi_os_unmap_memory() from Linux kernel") > Reported-by: Dan Williams > Signed-off-by: Lv Zheng Please do not add #if 0 anywhere to the kernel code base. If you need to drop some piece of code, just drop it. And in this particular case validation_count should be dropped from the data type definition too. > --- > drivers/acpi/acpica/tbutils.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c > index 5a968a7..8175c70 100644 > --- a/drivers/acpi/acpica/tbutils.c > +++ b/drivers/acpi/acpica/tbutils.c > @@ -418,11 +418,13 @@ acpi_tb_get_table(struct acpi_table_desc *table_desc, > > table_desc->validation_count++; > if (table_desc->validation_count == 0) { > + table_desc->validation_count--; > +#if 0 > ACPI_ERROR((AE_INFO, > "Table %p, Validation count is zero after increment\n", > table_desc)); > - table_desc->validation_count--; > return_ACPI_STATUS(AE_LIMIT); > +#endif > } > > *out_table = table_desc->pointer; > Thanks, Rafael