Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1953235AbdDZFP0 (ORCPT ); Wed, 26 Apr 2017 01:15:26 -0400 Received: from mga07.intel.com ([134.134.136.100]:48405 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1035412AbdDZFPN (ORCPT ); Wed, 26 Apr 2017 01:15:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,253,1488873600"; d="scan'208";a="961153063" From: "Zheng, Lv" To: "Williams, Dan J" CC: "Wysocki, Rafael J" , "Rafael J . Wysocki" , "Brown, Len" , Lv Zheng , "linux-kernel@vger.kernel.org" , Linux ACPI Subject: RE: [RFC PATCH] ACPICA: Tables: Fix regression introduced by a too early mechanism enabling Thread-Topic: [RFC PATCH] ACPICA: Tables: Fix regression introduced by a too early mechanism enabling Thread-Index: AQHSvi9si71Mg4Xha0Cbczw4fAyMnKHWkbKAgACHxbA= Date: Wed, 26 Apr 2017 05:15:07 +0000 Message-ID: <1AE640813FDE7649BE1B193DEA596E886CE98BCA@SHSMSX101.ccr.corp.intel.com> References: <1493171393-1825-1-git-send-email-lv.zheng@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjRiZGQwMWEtZmE0ZC00YmJhLWFmYjAtMmQyNWU2YWE0YjAxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkkzVDc2SitDZTdoZDhMelVhcnRLWjdSZjQ4OTJ3QmZEbzdJZUtqVmJrWDA9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v3Q5HGuR024072 Content-Length: 2796 Lines: 68 Hi, > From: Dan Williams [mailto:dan.j.williams@intel.com] > Subject: Re: [RFC PATCH] ACPICA: Tables: Fix regression introduced by a too early mechanism enabling > > On Tue, Apr 25, 2017 at 6:49 PM, Lv Zheng wrote: > > In the Linux kernel side, acpi_get_table() hasn't been fully balanced by > > acpi_put_table() invocations. So it is not a good timing to report errors. > > The strict balanced validation count check should only be enabled after > > confirming that all kernel side invocations are safe. > > We've been living with this bug for 7 years, let's just go fix all > acpi_get_table() invocations to make sure they have a corresponding > acpi_put_table(). We knew that, you should have already seen a series internally or externally from me achieving this. It's done several years ago. But it takes long time to make the ACPICA part upstreamed. Now my plan is: 1. introduce the APIs but allow old usage models in order not to change old ACPICA behavior and its users. 2. fix all users 3. disallow old usage models. It's just my mistake to leak the final stage approach to the ACPICA upstream from my local repo. Now we can try to jump to the final step, but as far as I know, not only Linux, ACPICA itself also contains several broken cases. Bottom line of Linux kernel is we shouldn't break any running system. So IMO, we will need this commit during this special period. I didn't say the final step is wrong or is not required. We can do both in parallel. So could you please help to confirm if it's working. And I would like to suggest linux to take this first step fix along with other final step fixes during this period. Thanks and best regards Lv > > > > > Thus this patch removes the fatal error but leaves the error report to > > indicate the leak so that developers can notice the required engineering > > change. Reported by Dan Williams, fixed by Lv Zheng. > > > > Reported-by: Dan Williams > > Signed-off-by: Lv Zheng > > --- > > drivers/acpi/acpica/tbutils.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c > > index 5a968a7..9e7d95cf 100644 > > --- a/drivers/acpi/acpica/tbutils.c > > +++ b/drivers/acpi/acpica/tbutils.c > > @@ -422,7 +422,6 @@ acpi_tb_get_table(struct acpi_table_desc *table_desc, > > "Table %p, Validation count is zero after increment\n", > > table_desc)); > > table_desc->validation_count--; > > - return_ACPI_STATUS(AE_LIMIT); > > If you want to leave the error report turn it into a WARN_ON_ONCE() so > it doesn't keep triggering, but I'd rather we just focus on the > missing acpi_put_table() calls.