diff options
author | Takahisa Tanaka <mc74hc00@gmail.com> | 2013-01-13 21:01:57 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2013-03-01 06:19:26 -0500 |
commit | 10ab329b5db7e592a3a60b4594e4e5f40b60c45c (patch) | |
tree | 52e8c155fe20f181df604c3ac5cefa2a306c0bbb /drivers/watchdog | |
parent | 6737176569d1d6356c644694d60ea2b265cb3870 (diff) |
watchdog: sp5100_tco: Fix wrong indirect I/O access for getting value of reserved bits
In case of SB800 or later chipset and re-programming MMIO address(*),
sp5100_tco module may read incorrect value of reserved bit, because the module
reads a value from an incorrect I/O address. However, this bug doesn't cause
a problem, because when re-programming MMIO address, by chance the module
writes zero (this is BIOS's default value) to the low three bits of register.
* In most cases, PC with SB8x0 or later chipset doesn't need to re-programming
MMIO address, because such PC can enable AcpiMmio and can use 0xfed80b00 for
watchdog register base address.
This patch fixes this bug.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43176
Signed-off-by: Takahisa Tanaka <mc74hc00@gmail.com>
Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Cc: stable <stable@vger.kernel.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/sp5100_tco.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index 2b0e000d4377..5dfe86ebdc8b 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c | |||
@@ -500,14 +500,15 @@ static unsigned char sp5100_tco_setupdevice(void) | |||
500 | /* Restore to the low three bits, if chipset is SB8x0(or later) */ | 500 | /* Restore to the low three bits, if chipset is SB8x0(or later) */ |
501 | if (sp5100_tco_pci->revision >= 0x40) { | 501 | if (sp5100_tco_pci->revision >= 0x40) { |
502 | u8 reserved_bit; | 502 | u8 reserved_bit; |
503 | reserved_bit = inb(base_addr) & 0x7; | 503 | outb(base_addr+0, index_reg); |
504 | reserved_bit = inb(data_reg) & 0x7; | ||
504 | val |= (u32)reserved_bit; | 505 | val |= (u32)reserved_bit; |
505 | } | 506 | } |
506 | 507 | ||
507 | /* Re-programming the watchdog timer base address */ | 508 | /* Re-programming the watchdog timer base address */ |
508 | outb(base_addr+0, index_reg); | 509 | outb(base_addr+0, index_reg); |
509 | /* Low three bits of BASE are reserved */ | 510 | /* Low three bits of BASE are reserved */ |
510 | outb((val >> 0) & 0xf8, data_reg); | 511 | outb((val >> 0) & 0xff, data_reg); |
511 | outb(base_addr+1, index_reg); | 512 | outb(base_addr+1, index_reg); |
512 | outb((val >> 8) & 0xff, data_reg); | 513 | outb((val >> 8) & 0xff, data_reg); |
513 | outb(base_addr+2, index_reg); | 514 | outb(base_addr+2, index_reg); |