From patchwork Sat Apr 2 10:00:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattia Dongili X-Patchwork-Id: 683631 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p32A1Jaa011707 for ; Sat, 2 Apr 2011 10:01:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755486Ab1DBKAw (ORCPT ); Sat, 2 Apr 2011 06:00:52 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:49944 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755483Ab1DBKAv (ORCPT ); Sat, 2 Apr 2011 06:00:51 -0400 Received: by iwn34 with SMTP id 34so4200147iwn.19 for ; Sat, 02 Apr 2011 03:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:x-message-flag:x-operating-system:x-editor:x-disclaimer :user-agent; bh=91yW4Yp4IJFGbPI1PogX3yrkclrXNHFQuQvEyXb4xSE=; b=ZvHh2+hSQAKxD4SjybxvvugOTr/4epoPjzIRDyljK6Bpl2C/UcT0nPHq5wCEzsKhqm mQ3xZjr7sp5JJV4wwbOnTk4zvO9ojk8nIioKIw7Jijs3lJe6n1/7qOv1rRE9phAdCuFU Y6MDdnHwBghmr1If7Jya3gO/z0SukMEmyLzRM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-message-flag :x-operating-system:x-editor:x-disclaimer:user-agent; b=C2i7wDgoK8n+veDWbAEZ4b+CVfPxCFjcNoBVWBpfRELKdzGW+u3sBWtRg2bsqSuUr+ dn05H0u5+PPffsMCJbSyEP1/r+YclO4OtYxzo/iPTIwd3aq/a/t328FqT3tc2+jcjQtJ pG6dKem1diVEICLP3ajRsIoQcA2KDZtYKS5/Y= Received: by 10.42.172.131 with SMTP id n3mr3210549icz.136.1301738450912; Sat, 02 Apr 2011 03:00:50 -0700 (PDT) Received: from caligola.kamineko.org (cm8.kappa1.maxonline.com.sg [58.182.1.8]) by mx.google.com with ESMTPS id g16sm2103764ibb.3.2011.04.02.03.00.47 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Apr 2011 03:00:50 -0700 (PDT) Received: by caligola.kamineko.org (Postfix, from userid 1000) id B5BCD15EA4; Sat, 2 Apr 2011 19:00:44 +0900 (JST) Date: Sat, 2 Apr 2011 19:00:44 +0900 From: Mattia Dongili To: Andrea Gelmini Cc: Matthew Garrett , anssi.hannula@iki.fi, linux-acpi@vger.kernel.org, axel.lin@gmail.com, trenn@suse.de, len.brown@intel.com, error27@gmail.com, linux-kernel@vger.kernel.org Subject: Re: Regression 2.6.39-rc1 for sony-laptop Message-ID: <20110402100043.GA5890@kamineko.org> References: <20110401172241.GA26851@srcf.ucam.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Message-Flag: Cranky? Try Free Software instead! X-Operating-System: Linux 2.6.39-rc1+ x86_64 X-Editor: Vim http://www.vim.org/ X-Disclaimer: Buh! User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 02 Apr 2011 10:01:22 +0000 (UTC) On Sat, Apr 02, 2011 at 11:44:57AM +0200, Andrea Gelmini wrote: > 2011/4/1 Matthew Garrett : > > touch any Sony code. I'll take a look at the Sony patches, thanks for > > the report! > > Hi Matthew, > and thanks a lot for your quick answer. > Maybe I messed up with bisect trying to find the origin of two regression. > One was this. The other one is this one. > > Hibernation (to disk, of course) doesn't work no more. > Screen blanks and nothing happens. No HD activity, and so on. I also > waited some minutes. > > Well, bisect blame this commit: > > commit 2a4f0c81adcd1f812a63bc9106be2fd26f437730 > Author: Mattia Dongili > Date: Sat Feb 19 11:52:30 2011 +0900 > > sony-laptop: cache handles and report them via sysfs > > Avoid calling into acpi each time we need to lookup a method handle > and report the available handles to ease collection of information when > debugging issues. Also move initialization of the platform driver > earlier to allow adding files from other setup functions. > > Signed-off-by: Mattia Dongili > Signed-off-by: Matthew Garrett > > drivers/platform/x86/sony-laptop.c | 97 ++++++++++++++++++++++++++++++------ > 1 files changed, 81 insertions(+), 16 deletions(-) > > Do you have any suggestion to better track down this issue? > It's not possibile to simply revert it. As already reported the following patch should fix the issue: commit 88d25cbfda526567dabf056a868d8ff5f22a962e Author: Mattia Dongili Date: Fri Apr 1 10:01:41 2011 +0900 sony-laptop: fix early NULL pointer dereference The SNC acpi driver could get early notifications before it fully initializes and that could lead to dereferencing the sony_nc_handles structure pointer that is still NULL at that stage. Make sure we return early from the handle lookup function in these cases. Signed-off-by: Mattia Dongili diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index b2ce172..7082c55 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -810,6 +810,11 @@ static int sony_nc_handles_cleanup(struct platform_device *pd) static int sony_find_snc_handle(int handle) { int i; + + /* not initialized yet, return early */ + if (!handles) + return -1; + for (i = 0; i < 0x10; i++) { if (handles->cap[i] == handle) { dprintk("found handle 0x%.4x (offset: 0x%.2x)\n",