diff mbox

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

Message ID 1409814819-30594-1-git-send-email-jlee@suse.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Lee, Chun-Yi Sept. 4, 2014, 7:13 a.m. UTC
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.

Cc: Lan Tianyu <tianyu.lan@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
 drivers/acpi/acpi_cmos_rtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rafael J. Wysocki Sept. 4, 2014, 7:46 p.m. UTC | #1
On Thursday, September 04, 2014 03:13:39 PM Lee, Chun-Yi wrote:
> 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?

> Cc: Lan Tianyu <tianyu.lan@intel.com>
> Cc: Len Brown <lenb@kernel.org>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
> ---
>  drivers/acpi/acpi_cmos_rtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/acpi_cmos_rtc.c b/drivers/acpi/acpi_cmos_rtc.c
> index 2da8660..81dc750 100644
> --- a/drivers/acpi/acpi_cmos_rtc.c
> +++ b/drivers/acpi/acpi_cmos_rtc.c
> @@ -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;
>
joeyli Sept. 5, 2014, 2:06 a.m. UTC | #2
Hi, 

On Thu, Sep 04, 2014 at 09:46:30PM +0200, Rafael J. Wysocki wrote:
> On Thursday, September 04, 2014 03:13:39 PM Lee, Chun-Yi wrote:
> > 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.

> > Cc: Lan Tianyu <tianyu.lan@intel.com>
> > Cc: Len Brown <lenb@kernel.org>
> > Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
> > ---
> >  drivers/acpi/acpi_cmos_rtc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/acpi/acpi_cmos_rtc.c b/drivers/acpi/acpi_cmos_rtc.c
> > index 2da8660..81dc750 100644
> > --- a/drivers/acpi/acpi_cmos_rtc.c
> > +++ b/drivers/acpi/acpi_cmos_rtc.c
> > @@ -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;
> > 
> 
> -- 
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.

Regards
Joey Lee
--
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
diff mbox

Patch

diff --git a/drivers/acpi/acpi_cmos_rtc.c b/drivers/acpi/acpi_cmos_rtc.c
index 2da8660..81dc750 100644
--- a/drivers/acpi/acpi_cmos_rtc.c
+++ b/drivers/acpi/acpi_cmos_rtc.c
@@ -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;