linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Marco Aurelio da Costa <costa@gamic.com>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Len Brown <lenb@kernel.org>
Subject: Re: [RFC][PATCH v2] ACPI: Ignore invalid _PSS entries, but use valid ones
Date: Fri, 4 May 2012 12:11:54 -0400	[thread overview]
Message-ID: <20120504161154.GA16255@phenom.dumpdata.com> (raw)
In-Reply-To: <CAEe-dwjVsqn-XyXfhRacEF5gh_5GCX_MeNafPkSGFu_eeA3Pfw@mail.gmail.com>

On Fri, May 04, 2012 at 05:25:13PM +0200, Marco Aurelio da Costa wrote:
> From: Marco Aurelio da Costa <costa@gamic.com>
> [v2: Fixes suggested by Konrad]
> Signed-off-by: Marco Aurelio da Costa <costa@gamic.com>

Heh. You didn't compile test this version did you?
> 
> The EliteBook 8560W has non-initialized entries in its _PSS ACPI
> table. Instead of bailing out when the first non-initialized entry is
> found, ignore it and use only  the valid entries. Only bail out if there
> is no valid entry at all.
> 
> ---
> --- linux-3.3.3/drivers/acpi/processor_perflib.c.orig	2012-04-24
> 22:18:23.288041268 +0200
> +++ linux-3.3.3/drivers/acpi/processor_perflib.c	2012-05-04
> 17:22:57.400034613 +0200
> @@ -311,6 +311,7 @@ static int acpi_processor_get_performanc
>  	struct acpi_buffer state = { 0, NULL };
>  	union acpi_object *pss = NULL;
>  	int i;
> +	int last_invalid = -1;
> 
> 
>  	status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
> @@ -372,14 +373,32 @@ static int acpi_processor_get_performanc
>  		    ((u32)(px->core_frequency * 1000) !=
>  		     (px->core_frequency * 1000))) {
>  			printk(KERN_ERR FW_BUG PREFIX
> -			       "Invalid BIOS _PSS frequency: 0x%llx MHz\n",
> -			       px->core_frequency);
> -			result = -EFAULT;
> -			kfree(pr->performance->states);
> -			goto end;
> +			       "Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n",
> +			       pr->id, px->core_frequency);
> +			if (last_invalidi == -1)

Hrmm. invalidi?

> +				last_invalid = i;
> +		} else {
> +			if (last_invalid != -1) {
> +				/*
> +				 * Copy this valid entry over last_invalid entry
> +				 */
> +				memcpy(&(pr->performance->states[last_invalid]),
> +				       px, sizeof(struct acpi_processor_px));
> +				++last_invalid;
> +			}
>  		}
>  	}
> 
> +	if (last_invalid == 0) {
> +		printk(KERN_ERR FW_BUG PREFIX
> +		       "No valid BIOS _PSS frequency found for processor %d\n", pr->id);
> +		result = -EFAULT;
> +		kfree(pr->performance->states);

Just as a precaution - also do this pls:

pr->performance->states = NULL?

> +	}
> +
> +	if (last_invalid > 0)
> +		pr->performance->state_count = last_invalid;
> +
>        end:
>  	kfree(buffer.pointer);
> 
> -- 
> Marco Costa
> Customer Support
> --
> GAMIC mbH
> Roermonder Strasse, 151
> 52072 Aachen
> Germany
> --
> 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

  reply	other threads:[~2012-05-04 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 13:46 [RFC][PATCH] ACPI: Ignore invalid _PSS entries, but use valid ones Marco Aurelio da Costa
2012-05-04 13:52 ` Konrad Rzeszutek Wilk
2012-05-04 14:13   ` Marco Aurelio da Costa
2012-05-04 14:39     ` Konrad Rzeszutek Wilk
     [not found]     ` <CAEe-dwg5pG2aDHopeHA2yiACUjS3cba5Vm1GyOaM4y=gpvpmMQ@mail.gmail.com>
2012-05-04 15:25       ` [RFC][PATCH v2] " Marco Aurelio da Costa
2012-05-04 16:11         ` Konrad Rzeszutek Wilk [this message]
2012-05-04 16:21           ` Marco Aurelio da Costa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120504161154.GA16255@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=costa@gamic.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).