Re: oops with asus_acpi on P30/P35

Christian Aichinger
2005-09-21T14:39:27Z

[-- Attachment #1: Type: text/plain, Size: 2842 bytes --]

On Wed, Sep 21, 2005 at 01:47:10PM +0200, Hanno Böck wrote:
> Am Wednesday, 21. September 2005 11:08 schrieb Christian Aichinger:
> > Since the relevant part hasn't changed between P30 -> P35's DSDT, I
> > assume that there has been some change in the Linux ACPI code, that
> > causes integer returns now instead of no returns. This means we
> > could get rid of the P30 code in the (!buffer.pointer) path. I don't
> > have a P30 around to test this though :-/
>
> I have a P30 around to test and I'd gladly help, but your patch doesn't apply
> to the current 2.6.14-rc1 and -git5 kernel.
> Also note that afaik asus_acpi-cvs and kernel aren't in sync at the moment.

I think the conflict should be only a trivial whitespace thing
(according to git-whatchanged). The patch should apply fine to
2.6.14-rc2 (that had it's release mail on LKML on 2005-09-19, but
still isn't on kernel.org) or any recent git checkout.

I've attached a patch that should apply to -rc1. What would be
interesting is if dmesg shows "Samsung P35 detected", or "Samsung
P30 detected". If it indeed shows the former (i.e. the code path my
patch adds), we could probably really get rid of the old cruft.

Cheers,
Christian Aichinger

---
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1006,6 +1006,24 @@ static int __init asus_hotk_get_info(voi
}

model = (union acpi_object *)buffer.pointer;
+
+ /* INIT on Samsung's P35 returns an integer, possible return
+ * values are tested below */
+ if (model->type == ACPI_TYPE_INTEGER) {
+ if (model->integer.value == -1 ||
+ model->integer.value == 0x58 ||
+ model->integer.value == 0x38) {
+ hotk->model = P30;
+ printk(KERN_NOTICE
+ " Samsung P35 detected, supported\n");
+ goto out_known;
+ } else {
+ printk(KERN_WARNING
+ " unknown integer returned by INIT\n");
+ goto out_unknown;
+ }
+ }
+
if (model->type == ACPI_TYPE_STRING) {
printk(KERN_NOTICE " %s model detected, ",
model->string.pointer);
@@ -1057,9 +1075,7 @@ static int __init asus_hotk_get_info(voi
hotk->model = L5x;

if (hotk->model == END_MODEL) {
- printk("unsupported, trying default values, supply the "
- "developers with your DSDT\n");
- hotk->model = M2E;
+ goto out_unknown;
} else {
printk("supported\n");
}
@@ -1088,6 +1104,15 @@ static int __init asus_hotk_get_info(voi
acpi_os_free(model);

return AE_OK;
+
+out_unknown:
+ printk(KERN_WARNING " unsupported, trying default values, "
+ "supply the developers with your DSDT\n");
+ hotk->model = M2E;
+out_known:
+ hotk->methods = &model_conf[hotk->model];
+ acpi_os_free(model);
+ return AE_OK;
}

static int __init asus_hotk_check(void)

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]