From: joeyli <jlee@suse.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Alessandro Zummo <a.zummo@towertech.it>,
Matt Fleming <matt@console-pimps.org>,
Matthew Garrett <matthew.garrett@nebula.com>,
Elliott@hp.com, samer.el-haj-mahmoud@hp.com,
Oliver Neukum <oneukum@suse.de>,
werner@suse.com, trenn@suse.de, JBeulich@suse.com,
linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com,
x86@kernel.org,
"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
linux-acpi@vger.kernel.org
Subject: Re: [PATCH 03/14] rtc: block registration of rtc-cmos when CMOS RTC Not Present
Date: Fri, 20 Dec 2013 11:54:10 +0800 [thread overview]
Message-ID: <1387511650.3539.4294.camel@linux-s257.site> (raw)
In-Reply-To: <6fc9a2f9-eae7-4588-a092-f338053ec96a@email.android.com>
Hi hpa,
於 四,2013-12-19 於 06:38 -0800,H. Peter Anvin 提到:
> Where did you find a platform with "no CMOS" set and a PNP RTC? I find the expect behavior in that case to be quite ambiguous and it is not at all clear to me that what you have here is the right thing.
Actually there doesn't have the box both with "No CMOS" and PNP device.
I choice to totally block rtc-cmos driver when "No CMOS RTC" because the
definition in ACPI spec:
CMOS RTC Not Present
If set, indicates that the CMOS RTC is either not implemented, or
does not exist at the legacy addresses. OSPM uses the Control
Method Time and Alarm Namespace device instead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It suggest us using ACPI TAD interface when this flag present. But, I
agreed your point for this is ambiguous due to ACPI spec didn't clear
define the relationship between PNP0B0x.
Maybe we can do more detail check in cmos_init when "No CMOS RTC" set:
+ check if have ACPI TAD device, then block rtc-cmos
+ check if no ACPI TAD device, but have PNP0B0x, then we use PNP0b0x.
>
> "Lee, Chun-Yi" <joeyli.kernel@gmail.com> wrote:
> >We should not acess CMOS address when CMOS RTC Not Present bit set in
> >FADT. The ee5872be patch didn't avoid rtc-cmos driver loaded when
> >system support
> >ACPI PNP PNP0B0* devices.
> >So this patch block the registion of rtc-cmos driver to avoid
> >user space access RTC through CMOS interface.
> >
> >Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
> >---
> > arch/x86/kernel/rtc.c | 20 ++++++++++++++++----
> > drivers/rtc/rtc-cmos.c | 9 +++++++++
> > 2 files changed, 25 insertions(+), 4 deletions(-)
> >
...
> >--- a/drivers/rtc/rtc-cmos.c
> >+++ b/drivers/rtc/rtc-cmos.c
> >@@ -28,6 +28,9 @@
> > * interrupts disabled, holding the global rtc_lock, to exclude those
> > * other drivers and utilities on correctly configured systems.
> > */
> >+
> >+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >+
> > #include <linux/kernel.h>
> > #include <linux/module.h>
> > #include <linux/init.h>
> >@@ -1144,6 +1147,12 @@ static int __init cmos_init(void)
> > {
> > int retval = 0;
> >
> >+ if (acpi_gbl_FADT.header.revision >= 5 &&
> >+ acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) {
> >+ pr_info("ACPI CMOS RTC Not Present detected - not loading\n");
> >+ return 0;
> >+ }
> >+
> > #ifdef CONFIG_PNP
> > retval = pnp_register_driver(&cmos_pnp_driver);
> > if (retval == 0)
>
Thanks a lot!
Joey Lee
next prev parent reply other threads:[~2013-12-20 3:55 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 7:43 [RFC PATCH 00/14] Support timezone of ACPI TAD and EFI TIME Lee, Chun-Yi
2013-12-19 7:44 ` [PATCH 01/14] rtc-efi: fix decrease day twice when computing year days Lee, Chun-Yi
2013-12-19 7:44 ` [PATCH 03/14] rtc: block registration of rtc-cmos when CMOS RTC Not Present Lee, Chun-Yi
2013-12-19 14:38 ` H. Peter Anvin
2013-12-20 3:54 ` joeyli [this message]
2013-12-20 4:20 ` H. Peter Anvin
2013-12-19 14:59 ` [RFC PATCH 00/14] Support timezone of ACPI TAD and EFI TIME H. Peter Anvin
2013-12-19 16:04 ` Alessandro Zummo
2013-12-20 4:05 ` joeyli
2013-12-20 4:22 ` H. Peter Anvin
2013-12-20 5:38 ` joeyli
2013-12-20 21:10 ` H. Peter Anvin
2013-12-20 21:25 ` H. Peter Anvin
2013-12-20 21:45 ` Rafael J. Wysocki
2013-12-20 21:43 ` H. Peter Anvin
2013-12-20 21:50 ` Matt Fleming
2013-12-20 22:18 ` Rafael J. Wysocki
2013-12-21 12:21 ` Matt Fleming
2014-01-12 0:30 ` [RFT][PATCH] ACPI / init: Run acpi_early_init() before efi_enter_virtual_mode() (was: Re: [RFC PATCH 00/14] Support timezone of ACPI TAD and EFI TIME) Rafael J. Wysocki
2014-01-12 9:06 ` Borislav Petkov
2014-01-14 2:04 ` Toshi Kani
2014-01-14 16:25 ` Toshi Kani
2014-01-12 11:05 ` Matt Fleming
2014-01-17 12:20 ` Matt Fleming
2014-01-14 4:09 ` joeyli
2014-01-14 16:50 ` Rafael J. Wysocki
2014-01-14 18:00 ` [RFT][PATCH] ACPI / init: Run acpi_early_init() before efi_enter_virtual_mode() H. Peter Anvin
2014-01-14 20:32 ` Toshi Kani
2014-01-15 7:18 ` joeyli
2013-12-21 2:43 ` [RFC PATCH 00/14] Support timezone of ACPI TAD and EFI TIME joeyli
2013-12-20 10:53 ` Thomas Renninger
2013-12-20 22:15 ` H. Peter Anvin
2013-12-20 15:16 ` Matthew Garrett
2013-12-20 16:57 ` H. Peter Anvin
2013-12-20 16:58 ` Matthew Garrett
2013-12-20 20:29 ` H. Peter Anvin
2013-12-20 20:32 ` Matthew Garrett
2013-12-20 21:14 ` H. Peter Anvin
2013-12-20 21:12 ` H. Peter Anvin
-- strict thread matches above, loose matches on Subject: below --
2013-12-19 7:51 Lee, Chun-Yi
2013-12-19 7:51 ` [PATCH 03/14] rtc: block registration of rtc-cmos when CMOS RTC Not Present Lee, Chun-Yi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387511650.3539.4294.camel@linux-s257.site \
--to=jlee@suse.com \
--cc=Elliott@hp.com \
--cc=JBeulich@suse.com \
--cc=a.zummo@towertech.it \
--cc=hpa@zytor.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@console-pimps.org \
--cc=matthew.garrett@nebula.com \
--cc=oneukum@suse.de \
--cc=rjw@rjwysocki.net \
--cc=rtc-linux@googlegroups.com \
--cc=samer.el-haj-mahmoud@hp.com \
--cc=trenn@suse.de \
--cc=werner@suse.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox