lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b369e6d44b01e0ccc653e333bc2def556b17bbb3.camel@intel.com>
Date:   Tue, 08 Nov 2022 10:30:33 +0800
From:   Zhang Rui <rui.zhang@...el.com>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        linux-rtc@...r.kernel.org
Cc:     Linux ACPI <linux-acpi@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Alessandro Zummo <a.zummo@...ertech.it>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v1 1/5] rtc: rtc-cmos: Call cmos_wake_setup() from
 cmos_do_probe()

On Mon, 2022-11-07 at 20:59 +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> Notice that cmos_wake_setup() is the only user of acpi_rtc_info and
> it
> can operate on the cmos_rtc variable directly, so it need not set the
> platform_data pointer before cmos_do_probe() is called.  Instead, it
> can be called by cmos_do_probe() in the case when the platform_data
> pointer is not set to implement the default behavior (which is to use
> the FADT information as long as ACPI support is enabled).
> 

...

>  
> @@ -827,19 +829,27 @@ cmos_do_probe(struct device *dev, struct
>  		if (info->address_space)
>  			address_space = info->address_space;
>  
> -		if (info->rtc_day_alarm && info->rtc_day_alarm < 128)
> -			cmos_rtc.day_alrm = info->rtc_day_alarm;
> -		if (info->rtc_mon_alarm && info->rtc_mon_alarm < 128)
> -			cmos_rtc.mon_alrm = info->rtc_mon_alarm;
> -		if (info->rtc_century && info->rtc_century < 128)
> -			cmos_rtc.century = info->rtc_century;
> +		cmos_rtc.day_alrm = info->rtc_day_alarm;
> +		cmos_rtc.mon_alrm = info->rtc_mon_alarm;
> +		cmos_rtc.century = info->rtc_century;
>  
>  		if (info->wake_on && info->wake_off) {
>  			cmos_rtc.wake_on = info->wake_on;
>  			cmos_rtc.wake_off = info->wake_off;
>  		}
> +	} else {
> +		cmos_wake_setup(dev);
>  	}
>  
> 

Previously, before commit a474aaedac99 ("rtc-cmos: move wake setup from
ACPI glue into RTC driver"), dev->platform_data is set in
drivers/acpi/glue.c, and the above commit moves it to cmos_wake_setup()
in this file.

Now, with this patch, my understanding is that dev->platform_data is
never set, thus we can remove the 'info' variable and the
	if (info)
check above.

thanks,
rui

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ