Skip to contentSkip to conversation

ACPI: disable the gpe that doesn't have a GPE handler correctly

PATCH In review Zhang Rui 2 participants 3 messages Nov 19, 2007 – Nov 20, 2007 ACPI

lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

PATCH 1/1 ACPI: disable the gpe that doesn't have a GPE handler correctly

From: Zhang Rui <[email protected]>

The current code only disable the GPE by judging the GPE type, which is one of WAKE, RUNTIME and WAKE_RUN. In bug 6217, GPE 17 is enabled by the AML code ... And it will be triggerred when an extra CRT is connected. As GPE 17 is not ec gpe, and there is no _Lxx/_Exx method exists in the _GPE scope, the type flag of GPE 17 is cleared at the boot time and it's none of the three GPE types. In this case, the GPE is not disabled correctly.

http://bugzilla.kernel.org/show_bug.cgi?id=6217

---
 drivers/acpi/events/evgpe.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/acpi/events/evgpe.c +2 -3
Index: linux-2.6/drivers/acpi/events/evgpe.c
===================================================================
@@ -277,11 +277,10 @@ acpi_status acpi_ev_disable_gpe(struct a
 		/* Disable the requested runtime GPE */
 
 		ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED);
-		status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
-		break;
 
 	default:
-		return_ACPI_STATUS(AE_BAD_PARAMETER);
+		acpi_hw_write_gpe_enable_reg(gpe_event_info);
+		break;
 	}
 
 	return_ACPI_STATUS(AE_OK);
author
#1 lore raw
Quoted 11 lines · Zhang Rui

From: Zhang Rui <[email protected]>

The current code only disable the GPE by judging the GPE type, which is one of WAKE, RUNTIME and WAKE_RUN. In bug 6217, GPE 17 is enabled by the AML code ... And it will be triggerred when an extra CRT is connected. As GPE 17 is not ec gpe, and there is no _Lxx/_Exx method exists in the _GPE scope, the type flag of GPE 17 is cleared at the boot time and it's none of the three GPE types. In this case, the GPE is not disabled correctly.

Quoted 2 lines

http://bugzilla.kernel.org/show_bug.cgi?id=6217

Hi, Alexey,
Any comments on this patch? :)

Thanks,
Rui

Quoted 27 lines
---
 drivers/acpi/events/evgpe.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/acpi/events/evgpe.c
===================================================================

drivers/acpi/events/evgpe.c +2 -4
@@ -277,11 +277,10 @@ acpi_status acpi_ev_disable_gpe(struct a
 		/* Disable the requested runtime GPE */
 
 		ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED);
-		status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
-		break;
 
 	default:
-		return_ACPI_STATUS(AE_BAD_PARAMETER);
+		acpi_hw_write_gpe_enable_reg(gpe_event_info);
+		break;
 	}
 
 	return_ACPI_STATUS(AE_OK);
-

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

#2 lore raw
Quoted 13 lines · Zhang Rui
Quoted 11 lines · Zhang Rui

From: Zhang Rui <[email protected]>

The current code only disable the GPE by judging the GPE type, which is one of WAKE, RUNTIME and WAKE_RUN. In bug 6217, GPE 17 is enabled by the AML code ... And it will be triggerred when an extra CRT is connected. As GPE 17 is not ec gpe, and there is no _Lxx/_Exx method exists in the _GPE scope, the type flag of GPE 17 is cleared at the boot time and it's none of the three GPE types. In this case, the GPE is not disabled correctly.

Quoted 7 lines
Quoted 3 lines

http://bugzilla.kernel.org/show_bug.cgi?id=6217

Hi, Alexey,
Any comments on this patch? :)

See below. Idea itself seem to be right.

Quoted 15 lines

Thanks,
Rui

Quoted 12 lines
---
 drivers/acpi/events/evgpe.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/acpi/events/evgpe.c
===================================================================

drivers/acpi/events/evgpe.c +0 -0
@@ -277,11 +277,10 @@ acpi_status acpi_ev_disable_gpe(struct a
 		/* Disable the requested runtime GPE */
 
Quoted 4 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct a · line 280

Quoted 4 lines
drivers/acpi/events/evgpe.c +0 -2
 		ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED);
-		status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
-		break;
 

put /* lint -fallthrough */ here, same as above.

Quoted 6 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct a · line 285

Quoted 6 lines
drivers/acpi/events/evgpe.c +2 -1
 	default:
-		return_ACPI_STATUS(AE_BAD_PARAMETER);
+		acpi_hw_write_gpe_enable_reg(gpe_event_info);
+		break;
 

don't need this break...

Quoted 4 lines
Quoted 4 lines
drivers/acpi/events/evgpe.c +0 -0
 	}
 

return_ACPI_STATUS(AE_OK);

Regards,
Alex.