From patchwork Wed Aug 26 01:01:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lin Ming X-Patchwork-Id: 43822 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7Q178W7017572 for ; Wed, 26 Aug 2009 01:07:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751050AbZHZBGn (ORCPT ); Tue, 25 Aug 2009 21:06:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754913AbZHZBGn (ORCPT ); Tue, 25 Aug 2009 21:06:43 -0400 Received: from mga01.intel.com ([192.55.52.88]:10147 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751020AbZHZBGm (ORCPT ); Tue, 25 Aug 2009 21:06:42 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 25 Aug 2009 18:03:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,275,1249282800"; d="scan'208";a="487391047" Received: from minggr.sh.intel.com (HELO [10.239.13.35]) ([10.239.13.35]) by fmsmga002.fm.intel.com with ESMTP; 25 Aug 2009 17:58:27 -0700 Subject: [PATCH] ACPICA: Windows compatibility fix: same buffer/string store From: Lin Ming To: Len Brown Cc: "Zhang, Rui" , "Rezwanul_Kabir@Dell.com" , linux-acpi In-Reply-To: References: <1249956889.7853.2.camel@rzhang-dt> <1250045983.7853.68.camel@rzhang-dt> <037F493892196B458CD3E193E8EBAD4F01EAB64667@pdsmsx502.ccr.corp.intel.com> Date: Wed, 26 Aug 2009 09:01:34 +0800 Message-Id: <1251248494.17754.14.camel@minggr.sh.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.24.1 (2.24.1-2.fc10) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Hi, Len This is the important fix for the WMI based HotKey issue reported by Dell. Could you merge it to 2.6.31-rc8? Thanks, Lin Ming --- Subject: [PATCH] ACPICA: Windows compatibility fix: same buffer/string store Fixes a compatibility issue when the same buffer or string is stored to itself. This has been seen in the field. Previously, ACPICA would zero out the buffer/string. Now, the operation is treated as a noop. ACPICA BZ 803. http://bugzilla.acpica.org/show_bug.cgi?id=803 Signed-off-by: Lin Ming Signed-off-by: Bob Moore --- drivers/acpi/acpica/exstorob.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/acpica/exstorob.c b/drivers/acpi/acpica/exstorob.c index 67340cc..257706e 100644 --- a/drivers/acpi/acpica/exstorob.c +++ b/drivers/acpi/acpica/exstorob.c @@ -70,6 +70,12 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc, ACPI_FUNCTION_TRACE_PTR(ex_store_buffer_to_buffer, source_desc); + /* If Source and Target are the same, just return */ + + if (source_desc == target_desc) { + return_ACPI_STATUS(AE_OK); + } + /* We know that source_desc is a buffer by now */ buffer = ACPI_CAST_PTR(u8, source_desc->buffer.pointer); @@ -161,6 +167,12 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc, ACPI_FUNCTION_TRACE_PTR(ex_store_string_to_string, source_desc); + /* If Source and Target are the same, just return */ + + if (source_desc == target_desc) { + return_ACPI_STATUS(AE_OK); + } + /* We know that source_desc is a string by now */ buffer = ACPI_CAST_PTR(u8, source_desc->string.pointer);