From patchwork Mon Mar 16 03:42:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lin Ming X-Patchwork-Id: 12281 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 n2G3jxWU028578 for ; Mon, 16 Mar 2009 03:51:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751197AbZCPDvW (ORCPT ); Sun, 15 Mar 2009 23:51:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751280AbZCPDvW (ORCPT ); Sun, 15 Mar 2009 23:51:22 -0400 Received: from mga09.intel.com ([134.134.136.24]:37433 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbZCPDvV (ORCPT ); Sun, 15 Mar 2009 23:51:21 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 15 Mar 2009 20:43:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,370,1233561600"; d="scan'208";a="498013421" Received: from minggr.sh.intel.com (HELO [10.239.13.35]) ([10.239.13.35]) by orsmga001.jf.intel.com with ESMTP; 15 Mar 2009 20:50:54 -0700 Subject: Re: 2.6.29 acpi regression: acpi_ex_extract_from_field -- div by zero From: Lin Ming To: jirislaby@gmail.com Cc: robert.moore@intel.com, lenb@kernel.org, linux-acpi@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel , torvalds@linux-foundation.org In-Reply-To: References: <49BCDCAA.8040309@gmail.com> Date: Mon, 16 Mar 2009 11:42:23 +0800 Message-Id: <1237174943.4193.37.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, > > sometimes, when booting up/resuming from disk, I get an oops[1]. > > obj_desc->common_field.access_bit_width is zero, but even after the > loop. Division before the loop is apparently OK. Would please try below debug patch to see which region filed is accessed? --- Lin Ming > > This is the case: > /* Mask off any extra bits in the last datum */ > > buffer_tail_bits = obj_desc->common_field.bit_length % > obj_desc->common_field.access_bit_width; > > .L39: > xorl %edx, %edx # > movzbl 37(%rbx), %esi # > .common_field.access_bit_width, > .common_field.access_bit_width > movl 24(%rbx), %eax # .common_field.bit_length, > .common_field.bit_length > --------------- here: > divl %esi # .common_field.access_bit_width > movl %edx, %ecx #, tmp121 > testl %edx, %edx # tmp121 > je .L41 #, > > [1] http://www.fi.muni.cz/~xslaby/sklad/panics/acpi_oops.png > -- -- 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/exfldio.c b/drivers/acpi/acpica/exfldio.c index ef58ac4..10ac0c8 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c @@ -683,6 +683,7 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, u32 datum_count; u32 field_datum_count; u32 i; + struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL }; ACPI_FUNCTION_TRACE(ex_extract_from_field); @@ -765,6 +766,20 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, raw_datum >> obj_desc->common_field.start_field_bit_offset; } + if (obj_desc->common_field.bit_length == 0 || + obj_desc->common_field.access_bit_width == 0) { + status = acpi_get_name(obj_desc->common_field.node, + ACPI_FULL_PATHNAME, &name_buffer); + if (ACPI_FAILURE(status)) { + printk(KERN_DEBUG "ACPI Debug: %s\n", + acpi_format_exception(status)); + } else { + printk(KERN_DEBUG "ACPI Debug: field node path: %s\n", + (char *) name_buffer.pointer); + kfree(name_buffer.pointer); + } + } + /* Mask off any extra bits in the last datum */ buffer_tail_bits = obj_desc->common_field.bit_length %