Skip to contentSkip to conversation

ACPI: Fix CMOS RTC Operation Region handler accesses to wrong address of value

PATCH Rafael J. Wysocki 2 participants 2 messages Sep 4, 2014 – Sep 5, 2014 1 message not in the archive ACPI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 6 lines · Chun-Yi

The value64 parameter is an u64 point that used to transfer the value for write to CMOS, or used to return the value that's read from CMOS.

The value64 is an u64 point, so don't need get address again. It causes acpi_cmos_rtc_space_handler always return 0 to reader and didn't write expected value to CMOS.

Do we need this fix to go to -stable?

Quoted 22 lines
Cc Lan Tianyu <[email protected]>
Cc Len Brown <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
---
 drivers/acpi/acpi_cmos_rtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_cmos_rtc.c +1 -1
index 2da8660..81dc750 100644
@@ -33,7 +33,7 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address,
 		      void *handler_context, void *region_context)
 {
 	int i;
-	u8 *value = (u8 *)&value64;
+	u8 *value = (u8 *)value64;
 
 	if (address > 0xff || !value64)
 		return AE_BAD_PARAMETER;
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#2 lore raw

Hi,

Quoted 10 lines · Rafael J. Wysocki
Quoted 6 lines · Chun-Yi

The value64 parameter is an u64 point that used to transfer the value for write to CMOS, or used to return the value that's read from CMOS.

The value64 is an u64 point, so don't need get address again. It causes acpi_cmos_rtc_space_handler always return 0 to reader and didn't write expected value to CMOS.

Do we need this fix to go to -stable?

Yes, this handler was added since v3.11 kernel. So, need go to -stable.

Quoted 19 lines
Quoted 19 lines
Cc Lan Tianyu <[email protected]>
Cc Len Brown <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
---
 drivers/acpi/acpi_cmos_rtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_cmos_rtc.c +1 -1
index 2da8660..81dc750 100644
@@ -33,7 +33,7 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address,
 		      void *handler_context, void *region_context)
 {
 	int i;
-	u8 *value = (u8 *)&value64;
+	u8 *value = (u8 *)value64;
 
Quoted 7 lines
Quoted 3 lines
drivers/acpi/acpi_cmos_rtc.c +0 -0
 	if (address > 0xff || !value64)
 		return AE_BAD_PARAMETER;
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

Regards
Joey Lee