[PATCH] Reserve only needed regions for PC timers on i386 and x86_64
Linux Kernel Mailing List <[email protected]> Wed, 23 Feb 2005 07:23:33 +0000
| Newsgroups | gmane.linux.kernel.commits.2-4 |
|---|---|
| Message-ID | <[email protected]> |
ChangeSet 1.1549, 2005/02/23 04:23:33-03:00, [email protected] [PATCH] Reserve only needed regions for PC timers on i386 and x86_64 Date: Mon, 21 Feb 2005 14:06:18 +0100 From: Charles-Edouard Ruault <[email protected]> To: [email protected], [email protected] Cc: Alan Cox <[email protected]>, Linux Kernel Mailing List <[email protected]> Subject: [PATCH] Reserve only needed regions for PC timers on i386 and x86_64 >>- Why is the generic timer using this address ? isn't it reserving a too >>wide portion of IO ports ? Should it be modified for this board ? > >It just reserved the entire chip space since way back when. > >>- If there's a good reason for the timer to request this address, is >>there a clean way to share it with the timer ? > >Submit a small patch to Linus/Andrew to make the generic code only >reserve the ports it should. It's just a historical oversight Linus, Andrew, As suggested by Alan, here's a small patch against kernel 2.4.29 to split the IO addresses reserved for the PC timer into two regions instead of a large one. It mimics what has been done in kernel 2.6. Instead of reserving 0x40 through 0x5f it reserves only what the two timers need, i.e 0x40-0x43 and 0x50-0x53. It patches both i386 and x86_64 architecture. Please CC me in replies since i did not subscribe to the list. i386/kernel/setup.c | 3 ++- x86_64/kernel/setup.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c 2005-02-24 15:01:59 -08:00 +++ b/arch/i386/kernel/setup.c 2005-02-24 15:01:59 -08:00 @@ -354,7 +354,8 @@ struct resource standard_io_resources[] = { { "dma1", 0x00, 0x1f, IORESOURCE_BUSY }, { "pic1", 0x20, 0x3f, IORESOURCE_BUSY }, - { "timer", 0x40, 0x5f, IORESOURCE_BUSY }, + { "timer0", 0x40, 0x43, IORESOURCE_BUSY }, + { "timer1", 0x50, 0x53, IORESOURCE_BUSY }, { "keyboard", 0x60, 0x6f, IORESOURCE_BUSY }, { "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY }, { "pic2", 0xa0, 0xbf, IORESOURCE_BUSY }, diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c --- a/arch/x86_64/kernel/setup.c 2005-02-24 15:01:59 -08:00 +++ b/arch/x86_64/kernel/setup.c 2005-02-24 15:01:59 -08:00 @@ -93,7 +93,8 @@ struct resource standard_io_resources[] = { { "dma1", 0x00, 0x1f, IORESOURCE_BUSY }, { "pic1", 0x20, 0x3f, IORESOURCE_BUSY }, - { "timer", 0x40, 0x5f, IORESOURCE_BUSY }, + { "timer0", 0x40, 0x43, IORESOURCE_BUSY }, + { "timer1", 0x50, 0x53, IORESOURCE_BUSY }, { "keyboard", 0x60, 0x6f, IORESOURCE_BUSY }, { "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY }, { "pic2", 0xa0, 0xbf, IORESOURCE_BUSY },