提交 04aaa7ba 编写于 作者: D David P. Reed 提交者: Ingo Molnar

x86: fix cmos read and write to not use inb_p and outb_p

fix code to access CMOS rtc registers so that it does not use inb_p and
outb_p routines, which are deprecated.  Extensive research on all known
CMOS RTC chipset timing shows that there is no need for a delay in
accessing the registers of these chips even on old machines. These chipa
are never on an expansion bus, but have always been "motherboard"
resources, either in the processor chipset or explicitly on the
motherboard, and they are not part of the ISA/LPC or PCI buses, so
delays should not be based on bus timing. The reason to fix it:

 1) port 80 writes often hang some laptops that use ENE EC chipsets,
    esp. those designed and manufactured by Quanta for HP;

 2) RTC accesses are timing sensitive, and extra microseconds may matter;

 3) the new "io_delay" function is calibrated by expansion bus timing needs,
    thus is not appropriate for access to CMOS rtc registers.
Signed-off-by: NDavid P. Reed <dpreed@reed.com>
Acked-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 03ae5768
...@@ -146,8 +146,8 @@ unsigned char rtc_cmos_read(unsigned char addr) ...@@ -146,8 +146,8 @@ unsigned char rtc_cmos_read(unsigned char addr)
unsigned char val; unsigned char val;
lock_cmos_prefix(addr); lock_cmos_prefix(addr);
outb_p(addr, RTC_PORT(0)); outb(addr, RTC_PORT(0));
val = inb_p(RTC_PORT(1)); val = inb(RTC_PORT(1));
lock_cmos_suffix(addr); lock_cmos_suffix(addr);
return val; return val;
} }
...@@ -156,8 +156,8 @@ EXPORT_SYMBOL(rtc_cmos_read); ...@@ -156,8 +156,8 @@ EXPORT_SYMBOL(rtc_cmos_read);
void rtc_cmos_write(unsigned char val, unsigned char addr) void rtc_cmos_write(unsigned char val, unsigned char addr)
{ {
lock_cmos_prefix(addr); lock_cmos_prefix(addr);
outb_p(addr, RTC_PORT(0)); outb(addr, RTC_PORT(0));
outb_p(val, RTC_PORT(1)); outb(val, RTC_PORT(1));
lock_cmos_suffix(addr); lock_cmos_suffix(addr);
} }
EXPORT_SYMBOL(rtc_cmos_write); EXPORT_SYMBOL(rtc_cmos_write);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册