HPET: handle multiple ACPI EXTENDED_IRQ resources
PATCH 1/1 HPET: handle multiple ACPI EXTENDED_IRQ resources
When the _CRS for a single HPET contains multiple EXTENDED_IRQ resources, we overwrote hdp->hd_nirqs every time we found one.
So the driver worked when all the IRQs were described in a single EXTENDED_IRQ resource, but failed when multiple resources were used. (Strictly speaking, I think the latter is actually more correct, but both styles have been used.)
Someday we should remove all the ACPI stuff from hpet.c and use PNP driver registration instead. But currently PNP_MAX_IRQ is 2, and HPETs often have more IRQs. Hint, hint, Adam :-)
drivers/char/hpet.c +8 -12
@@ -953,22 +953,18 @@ } }else if (res->type ==ACPI_RESOURCE_TYPE_EXTENDED_IRQ ) {struct acpi_resource_extended_irq *irqp; -int i; +int i, irq; irqp = &res->data.extended_irq; -if (irqp->interrupt_count >0 ) { - hdp->hd_nirqs = irqp->interrupt_count; +for (i =0 ; i < irqp->interrupt_count; i++) { + irq =acpi_register_gsi (irqp->interrupts[i], + irqp->triggering, irqp->polarity); +if (irq <0 ) +return AE_ERROR ; -for (i =0 ; i < hdp->hd_nirqs; i++) { -int rc = -acpi_register_gsi (irqp->interrupts[i], - irqp->triggering, - irqp->polarity); -if (rc <0 ) -return AE_ERROR ; - hdp->hd_irq[i] = rc; - } + hdp->hd_irq[hdp->hd_nirqs] = irq; + hdp->hd_nirqs++; } }
Bjorn Helgaas wrote: [Tue Feb 07 2006, 06:50:27PM EST]
Quoted 39 lines
When the
_CRSfor a single HPET contains multipleEXTENDED_IRQresources, we overwrotehdp->hd_nirqsevery time we found one.So the driver worked when all the IRQs were described in a single
EXTENDED_IRQresource, but failed when multiple resources were used. (Strictly speaking, I think the latter is actually more correct, but both styles have been used.)Someday we should remove all the ACPI stuff from
hpet.cand use PNP driver registration instead. But currentlyPNP_MAX_IRQis 2, and HPETs often have more IRQs. Hint, hint, Adam :-)Signed-off-by Bjorn Helgaas <[email protected]>Index:
work-mm4/drivers/char/hpet.c
===================================================================drivers/char/hpet.c +6
-7@@ -953,22 +953,18 @@ } }else if (res->type ==ACPI_RESOURCE_TYPE_EXTENDED_IRQ ) {struct acpi_resource_extended_irq *irqp; -int i; +int i, irq; irqp = &res->data.extended_irq; -if (irqp->interrupt_count >0 ) { - hdp->hd_nirqs = irqp->interrupt_count; +for (i =0 ; i < irqp->interrupt_count; i++) { + irq =acpi_register_gsi (irqp->interrupts[i], + irqp->triggering, irqp->polarity); +if (irq <0 ) +return AE_ERROR ; -for (i =0 ; i < hdp->hd_nirqs; i++) { -int rc = - acpi_register_gsi(irqp->interrupts[i], - irqp->triggering,
drivers/char/hpet.c line 970
Quoted 10 lines
drivers/char/hpet.c +2
-5- irqp->polarity); -if (rc <0 ) -return AE_ERROR ; - hdp->hd_irq[i] = rc; - } + hdp->hd_irq[hdp->hd_nirqs] = irq; + hdp->hd_nirqs++; } }
Andrew, I know it's late in the 2.6.16 cycle, but it would be really nice if this patch made it. Without it, HPETs on new HP boxes don't work, so we're going to have to get it in the distros some way or another.
Quoted 54 lines · Bob Picco
Bjorn Helgaas wrote: [Tue Feb 07 2006, 06:50:27PM EST]
Quoted 39 lines
When the
_CRSfor a single HPET contains multipleEXTENDED_IRQresources, we overwrotehdp->hd_nirqsevery time we found one.So the driver worked when all the IRQs were described in a single
EXTENDED_IRQresource, but failed when multiple resources were used. (Strictly speaking, I think the latter is actually more correct, but both styles have been used.)Someday we should remove all the ACPI stuff from
hpet.cand use PNP driver registration instead. But currentlyPNP_MAX_IRQis 2, and HPETs often have more IRQs. Hint, hint, Adam :-)Signed-off-by Bjorn Helgaas <[email protected]>Index:
work-mm4/drivers/char/hpet.c
===================================================================drivers/char/hpet.c +6
-7@@ -953,22 +953,18 @@ } }else if (res->type ==ACPI_RESOURCE_TYPE_EXTENDED_IRQ ) {struct acpi_resource_extended_irq *irqp; -int i; +int i, irq; irqp = &res->data.extended_irq; -if (irqp->interrupt_count >0 ) { - hdp->hd_nirqs = irqp->interrupt_count; +for (i =0 ; i < irqp->interrupt_count; i++) { + irq =acpi_register_gsi (irqp->interrupts[i], + irqp->triggering, irqp->polarity); +if (irq <0 ) +return AE_ERROR ; -for (i =0 ; i < hdp->hd_nirqs; i++) { -int rc = - acpi_register_gsi(irqp->interrupts[i], - irqp->triggering,drivers/char/hpet.c line 970
Quoted 10 lines
drivers/char/hpet.c +2
-5- irqp->polarity); -if (rc <0 ) -return AE_ERROR ; - hdp->hd_irq[i] = rc; - } + hdp->hd_irq[hdp->hd_nirqs] = irq; + hdp->hd_nirqs++; } }Acked-by Bob Picco <[email protected]>
Quoted 5 lines · Bjorn Helgaas
Andrew, I know it's late in the 2.6.16 cycle, but it would be really nice if this patch made it. Without it, HPETs on new HP boxes don't work, so we're going to have to get it in the distros some way or another.
OK..
What about hpet-fix-acpi-memory-range-length-handling.patch?
From: Bjorn Helgaas <[email protected]>
ACPI address space descriptors contain _MIN, _MAX, and _LEN. _MIN and _MAX are the bounds within which the region can be moved (this is clarified in Table 6-38 of the ACPI 3.0 spec). We should use _LEN to determine the size of the region, not _MAX - _MIN + 1.
---
drivers/char/hpet.c | 5 +---- 1 files changed, 1 insertion(+), 4 deletions(-)
drivers/char/hpet.c renamed from drivers/char/hpet.c~hpet-fix-acpi-memory-range-length-handling +1 -4
@@ -925,11 +925,8 @@ static acpi_status hpet_resources(struct status =acpi_resource_to_address64 (res, &addr);if (ACPI_SUCCESS (status)) { -unsigned long size; - - size = addr.maximum - addr.minimum +1 ; hdp->hd_phys_address = addr.minimum; - hdp->hd_address =ioremap (addr.minimum, size); + hdp->hd_address =ioremap (addr.minimum, addr.address_length);if (hpet_is_known (hdp)) { printk(KERN_DEBUG "%s: 0x%lx is busy\n",
_
(It's hard for me to judge when people don't describe what the impact of the problem is, so thanks for the poke).
Quoted 10 lines · Andrew Morton
Quoted 5 lines · Bjorn Helgaas
Andrew, I know it's late in the 2.6.16 cycle, but it would be really nice if this patch made it. Without it, HPETs on new HP boxes don't work, so we're going to have to get it in the distros some way or another.
OK..
What about hpet-fix-acpi-memory-range-length-handling.patch?
The range length patch has no functional impact on any machine I know about; it's just a cleanup/align-with-spec thing. Definitely post-2.6.16 material.
Quoted 41 lines
From: Bjorn Helgaas <[email protected]>
ACPI address space descriptors contain
_MIN,_MAX, and_LEN._MINand_MAXare the bounds within which the region can be moved (this is clarified in Table 6-38 of the ACPI 3.0 spec). We should use_LENto determine the size of the region, not_MAX-_MIN+ 1.Signed-off-by Bjorn Helgaas <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
drivers/char/hpet.c | 5 +---- 1 files changed, 1 insertion(+), 4 deletions(-)diff -puN
drivers/char/hpet.c~hpet-fix-acpi-memory-range-length-handlingdrivers/char/hpet.cdrivers/char/hpet.c renamed from drivers/char/hpet.c~hpet-fix-acpi-memory-range-length-handling +1
-4@@ -925,11 +925,8 @@ static acpi_status hpet_resources(struct status =acpi_resource_to_address64 (res, &addr);if (ACPI_SUCCESS (status)) { -unsigned long size; - - size = addr.maximum - addr.minimum +1 ; hdp->hd_phys_address = addr.minimum; - hdp->hd_address =ioremap (addr.minimum, size); + hdp->hd_address =ioremap (addr.minimum, addr.address_length);if (hpet_is_known (hdp)) { printk(KERN_DEBUG "%s: 0x%lx is busy\n",_
(It's hard for me to judge when people don't describe what the impact of the problem is, so thanks for the poke).
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html