From patchwork Wed Jun 24 07:17:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 32097 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 n5O7Gtqv009383 for ; Wed, 24 Jun 2009 07:16:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751444AbZFXHQv (ORCPT ); Wed, 24 Jun 2009 03:16:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751737AbZFXHQv (ORCPT ); Wed, 24 Jun 2009 03:16:51 -0400 Received: from mga09.intel.com ([134.134.136.24]:12518 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbZFXHQu (ORCPT ); Wed, 24 Jun 2009 03:16:50 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 24 Jun 2009 00:05:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,281,1243839600"; d="scan'208";a="527333463" Received: from rzhang-dt.sh.intel.com (HELO [10.239.36.94]) ([10.239.36.94]) by orsmga001.jf.intel.com with ESMTP; 24 Jun 2009 00:16:41 -0700 Subject: Re: [PATCH] ACPI video: ignore buggy _BQC From: Zhang Rui To: Len Brown Cc: linux-acpi , "showard314@gmail.com" In-Reply-To: References: <1245820142.15520.112.camel@rzhang-dt> Date: Wed, 24 Jun 2009 15:17:36 +0800 Message-Id: <1245827856.15520.117.camel@rzhang-dt> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Wed, 2009-06-24 at 14:09 +0800, Len Brown wrote: > scripts/checkpatch.pl > total: 9 errors, 0 warnings, 24 lines checked > sorry, refreshed patch attached. From: Scott Howard _BQC doesn't return a value listed in _BCL method. http://bugzilla.kernel.org/show_bug.cgi?id=13511 ingore the buggy _BQC method in this case Signed-off-by: Scott Howard Acked-by: Zhang Rui --- drivers/acpi/video.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 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 Index: linux-2.6/drivers/acpi/video.c =================================================================== --- linux-2.6.orig/drivers/acpi/video.c +++ linux-2.6/drivers/acpi/video.c @@ -594,6 +594,7 @@ acpi_video_device_lcd_get_level_current( unsigned long long *level) { acpi_status status = AE_OK; + int i; if (device->cap._BQC || device->cap._BCQ) { char *buf = device->cap._BQC ? "_BQC" : "_BCQ"; @@ -609,8 +610,15 @@ acpi_video_device_lcd_get_level_current( } *level += bqc_offset_aml_bug_workaround; - device->brightness->curr = *level; - return 0; + for (i = 2; i < device->brightness->count; i++) + if (device->brightness->levels[i] == *level) { + device->brightness->curr = *level; + return 0; + } + /* BQC returned an invalid level. Stop using it. */ + ACPI_WARNING((AE_INFO, "%s returned an invalid level", + buf)); + device->cap._BQC = device->cap._BCQ = 0; } else { /* Fixme: * should we return an error or ignore this failure?