All of lore.kernel.org
 help / color / mirror / Atom feed
* Fragmentation
From: Gérard Parat / F6FGZ @ 2003-01-10 21:08 UTC (permalink / raw)
  To: Linux-Hams

Hello,

I am wondering how to tweak mss/mtu/window/packet lenght etc ... to avoid
TCP/IP fragmentation for a 1200 bds link. I am trying to send 256 byte size
AX25 packet, here an example:

vhf: fm F6FGZ-4 to F6KBS-1 ctl I37^ pid=8(segment) len 255 22:05:44 First seg;
remain 1
IP: len 328 44.151.78.19->44.151.91.49 ihl 20 ttl 64 DF prot TCP
TCP: 46755->http Seq x74f3e657 Ack x86439001 ACK PSH Wnd 472 Data 213
0000  GET / HTTP/1.0M.Connection: Keep-AliveM.User-Agent: Mozilla/4.78
0040   [fr] (X11; U; Linux 2.4.18 i686)M.Host: f6bgr.ampr.orgM.Accept:
0080   image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png,
00C0   */*M.Accept-Encoding
vhf: fm F6FGZ-4 to F6KBS-1 ctl I30^ pid=8(segment) len 76 22:05:45 remain 0
0000  : gzipM.Accept-Language: fr, en, zhM.Accept-Charset: iso-8859-1,
0040  *,utf-8M.M.

Data are splitted ...

--
73 Gérard F6FGZ



-
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* RE: Kernel 2.5.55 failed to boot with ACPI support
From: Grover, Andrew @ 2003-01-10 21:10 UTC (permalink / raw)
  To: Ole J. Hagen, Linux Kernel Mailing List

> From: Ole J. Hagen [mailto:olehag_2001@yahoo.no] 
> I just wanted to inform that kernel-2.5.55 failes to boot 
> when ACPI support is 
> compiled in the kernel. 
> 
> I have following configuration; Dell Optiplex GX-240, Pentium 
> 4 (1.5 GHz), ATI 
> RAGE 128.

How exactly does it fail?

-- Andy

^ permalink raw reply

* Interrupt Routing
From: Stephen L Johnson @ 2003-01-10 20:59 UTC (permalink / raw)
  To: ACPI Dev Mailing List

Somewhere along the way, the interrupt routing on my laptopn has gone
back to cramming everything onto the same interrupt. Here is my
/proc/interrupts output:

sjohnson@rodan:~> cat /proc/interrupts 
           CPU0       
  0:     565260          XT-PIC  timer
  1:       6943          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  9:      72990          XT-PIC  acpi, ohci1394, usb-uhci, usb-uhci,
usb-uhci, Ricoh Co Ltd RL5c475, Texas Instruments PCI1410 PC card
Cardbus Controller, Intel 82801CA-ICH3, eth0
 11:        484          XT-PIC  sonypi
 12:      76803          XT-PIC  PS/2 Mouse
 14:      29615          XT-PIC  ide0
NMI:          0 
LOC:     565211 
ERR:          0
MIS:          0

This is on a Sony Vaio R505-ES running 2.4.20 with acpi-20021212.


-- 
Stephen L Johnson <sjohnson-WpdXj7kV/NVg9hUCZPvPmw@public.gmane.org>



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply

* JFFS linker error in kernel 2.4.19
From: Frank R Callaghan @ 2003-01-10 21:27 UTC (permalink / raw)
  To: LinuxMTD

Hi List,

I'm compiling linux 2.4.19 patched with today's CVS MTD patched
with the patching script
(that states 'no Include Filesytems: yes; Zlib-Patch needed: no)

ld -m elf_i386 -T /home/rtlinux/rtai/linux-2.4.19/arch/i386/vmlinux.lds -e 
stext arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o 
init/version.o init/do_mounts.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o mm/mm.o 
fs/fs.o ipc/ipc.o \
         drivers/char/char.o drivers/block/block.o drivers/misc/misc.o 
drivers/net/net.o drivers/media/media.o drivers/ide/idedriver.o 
drivers/mtd/mtdlink.o \
        net/network.o \
        /home/rtlinux/rtai/linux-2.4.19/arch/i386/lib/lib.a 
/home/rtlinux/rtai/linux-2.4.19/lib/lib.a 
/home/rtlinux/rtai/linux-2.4.19/arch/i386/lib/lib.a \
        --end-group \
        -o vmlinux
fs/fs.o: In function `jffs2_compress':
fs/fs.o(.text+0x5fc59): undefined reference to `zlib_compress'
fs/fs.o: In function `jffs2_decompress':
fs/fs.o(.text+0x5fced): undefined reference to `zlib_decompress'
fs/fs.o(.text+0x5fd18): undefined reference to `dynrubin_decompress'
make: *** [vmlinux] Error 1


Any Ideas ?

TIA,
    Frank.

^ permalink raw reply

* Re: FW: Fastest possible UDMA - how?
From: Andre Hedrick @ 2003-01-10 20:48 UTC (permalink / raw)
  To: Manish Lachwani, Manish Lachwani; +Cc: linux-kernel, Michael.Knigge
In-Reply-To: <20030110190403.2127.qmail@web20510.mail.yahoo.com>


I guess if Google can publish their patches to the driver they ship,
Zambeel should consider publishing the known changes they ship with
products.  Zambeel should decide if it is going to contribute or just
take.

Cheers,

Andre Hedrick
LAD Storage Consulting Group

On Fri, 10 Jan 2003, Manish Lachwani wrote:

> Take a look at the drive IDENTIFY data. From the ATA
> spec, it can be seen that word# 88 in the IDENTIFY
> data can help you find out the UDMA mode selected and
> UDMA mode supported. 
> 
> The UDMA mode supported is the maximum supported by
> the drive. 
> 
> Thanks
> Manish
> 
> > Hi all,
> > 
> > is it somehow possible to determine what is the
> > fastest UDMA-Mode my 
> > IDE-Controller supports - independant of the
> > chipset?
> > 
> > Thanks,
> >   Michael
> > 
> > 
> > 
> > -
> > To unsubscribe from this list: send the line
> > "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at 
> > http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


^ permalink raw reply

* Using lilo to boot off any drive ...
From: Manish Lachwani @ 2003-01-10 21:00 UTC (permalink / raw)
  To: linux-kernel

In my current setup, I am having 12 ide drives
connected to a 3ware controller labelled sda to sdl.
Suppose sde is the drive we want the system to boot
off. What I do is modify the lilo.conf on sda, sdb,
sdc etc. to have the "boot" entry point to /dev/sde.

This way when the controller is transferred to lilo on
sda, it will load the kernel from sde. 

consider this. If sda is bad and is not exported to
the OS or is not detected in the BIOS due to a bad
cable etc. In this scenario, the OS mappings would
change. Now, sdb will become sda. The lilo.conf on sdb
(now sda) would have "boot" parameter still point to
sde, which is now sdd. 

When the control is transferred to lilo on sda (sdb
actually), is there a way for me to boot off sdd now
(which was previously sde)? I mean, is there any way
that lilo can load the appropriate kernel image?

One of the ways I was thinking of was to modify the
lilo sources to scan for drive serial# and we boot off
that drive for which the serial# matches. But, does
anyone have a better alternative?

Thanks
Manish

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

^ permalink raw reply

* Re: ipv6 stack seems to forget to send ACKs
From: Paul Jakma @ 2003-01-10 20:59 UTC (permalink / raw)
  To: Fabio Massimo Di Nitto
  Cc: Wichert Akkerman, Andrew McGregor, netdev, linux-kernel
In-Reply-To: <Pine.LNX.4.51.0301091041390.20149@trider-g7.ext.fabbione.net>

On Thu, 9 Jan 2003, Fabio Massimo Di Nitto wrote:

> hmmmm strange because now I have forced the route to ipv6.lkml.org
> via another ISP (bypassing xs26.net) 

xs26.net posted to the 6bone list not so long that ago that they have 
IPv6 routing stability problems. (they're ditching OSPFv3/ospfd and 
implementing an inhouse IPv6 link-state IGP instead apparently).

> Fabio

regards,
-- 
Paul Jakma	Sys Admin	Alphyra
	paulj@alphyra.ie
Warning: /never/ send email to spam@dishone.st or trap@dishone.st


^ permalink raw reply

* [PATCH] HAL2: fix LE stream playback
From: Ladislav Michl @ 2003-01-10 20:43 UTC (permalink / raw)
  To: linux-mips; +Cc: Ralf Baechle, Ulf Karlsson

Hi,

several people complained about it on IRC, so here is a patch against
linux_2_4 branch. Please apply.

Side note: recording still doesn't work. while ago i tried to play with
PBUS configuration and found following (refer to hpc3.ps):
1) writing 0x08248844 (ie. 16bit DMA stream) into pbus_dmacfgs produces
   noise at output.
2) writing 0x082c8844 (ie. 16bit with EVEN_HIGH bit set) make playback
   two times faster.
3) writing 0x08248844 (ie. 8 bit stream) works as expected. That is
   strange, because I still believe that HAL2 is 16bit device. I'd guess
   that there are two bugs in driver which neutralizes each other.
In all cases DMA stream wasn't started for recording.


--- XXX/drivers/sound/hal2.c	Mon Aug  5 19:40:50 2002
+++ linux/drivers/sound/hal2.c	Fri Jan 10 21:06:27 2003
@@ -1,6 +1,6 @@
 /*
  *  Driver for HAL2 sound processors
- *  Copyright (c) 2001, 2002 Ladislav Michl <ladis@psi.cz>
+ *  Copyright (c) 2001-2003 Ladislav Michl <ladis@linux-mips.org>
  *  
  *  Based on Ulf Carlsson's code.
  *
@@ -394,7 +394,8 @@
 	fifobeg = 0;				/* playback is first */
 	fifoend = (sample_size * 4) >> 3;	/* doublewords */
 	pbus->ctrl = HPC3_PDMACTRL_RT | HPC3_PDMACTRL_LD |
-		     (highwater << 8) | (fifobeg << 16) | (fifoend << 24);
+		     (highwater << 8) | (fifobeg << 16) | (fifoend << 24) |
+		     (hal2->dac.format & AFMT_S16_LE ? HPC3_PDMACTRL_SEL : 0);
 	/* We disable everything before we do anything at all */
 	pbus->pbus->pbdma_ctrl = HPC3_PDMACTRL_LD;
 	hal2_i_clearbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECTX);
@@ -420,7 +421,8 @@
 	fifobeg = (4 * 4) >> 3;				/* record is second */
 	fifoend = (4 * 4 + sample_size * 4) >> 3;	/* doublewords */
 	pbus->ctrl = HPC3_PDMACTRL_RT | HPC3_PDMACTRL_RCV | HPC3_PDMACTRL_LD | 
-		     (highwater << 8) | (fifobeg << 16) | (fifoend << 24);
+		     (highwater << 8) | (fifobeg << 16) | (fifoend << 24) |
+		     (hal2->adc.format & AFMT_S16_LE ? HPC3_PDMACTRL_SEL : 0);
 	pbus->pbus->pbdma_ctrl = HPC3_PDMACTRL_LD;
 	hal2_i_clearbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECR);
 	hal2_i_clearbit16(hal2, H2I_DMA_DRV, (1 << pbus->pbusnr));

^ permalink raw reply

* Re: 2.4.20, .text.lock.swap cpu usage? (ibm x440)
From: Chris Wood @ 2003-01-10 20:42 UTC (permalink / raw)
  To: Andrew Morton; +Cc: William Lee Irwin III, linux-kernel
In-Reply-To: <3E1DD913.2571469F@digeo.com>

Andrew Morton wrote:
> Chris Wood wrote:
> 
>>..
>>The server ran fine for 3 days, so it took a bit to get this info.
> 
> 
> Is appreciated, thanks.
>  
> 
>>Is there a list of which patches I can apply if I don't want to apply
>>the entire 2.4.20aa1?  I'm nervous about breaking other things, but may
>>give it a try anyway.
> 
> 
> http://www.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.20aa1/05_vm_16_active_free_zone_bhs-1
> http://www.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.20aa1/10_inode-highmem-2
> 
> The former is the most important and, alas, has dependencies on
> earlier patches.
> 
> hm, OK.  I've pulled all Andrea's VM changes and the inode-highmem fix
> into a standalone diff.  I'll beat on that a bit tonight before unleashing
> it.
> 

I tried to apply 2.4.20aa1 to my /usr/src/linux and then compile it, but 
it failed to compile.  I do have the IBM x440 (NUMA) patches applied to 
this tree, I don't know if that caused any problems but I didn't see any 
when I applied the patch.  I'll attach a snip at the end of this email 
just in case it may point to something (there was more than this).

> 
>>Thanks for the help!
>>
>>Here is a /proc/meminfo when it is running fine:
> 
> 
> These numbers are a little odd.  You seem to have only lost 200M of
> lowmem to buffer_heads.  Bill, what's your take on this?
> 
> Maybe we're looking at the wrong thing.  Are any of your applications
> using mlock(), mlockall(), etc?

I'm not sure, other than our services our main programs are in Cobol 
(iCobol and AcuCobol).  I could ask the vendors if that would help.


------- sorry if this is an ugly paste -------

/usr/src/linux-2.4.20/include/asm/pgalloc.h: In function `get_pgd_slow':
/usr/src/linux-2.4.20/include/asm/pgalloc.h:49: `PAGE_OFFSET_RAW' 
undeclared (fi
rst use in this function)
/usr/src/linux-2.4.20/include/asm/pgalloc.h:54: warning: implicit 
declaration of
  function `set_64bit'
/usr/src/linux-2.4.20/include/asm/pgalloc.h: In function `free_pgd_slow':
/usr/src/linux-2.4.20/include/asm/pgalloc.h:110: `PAGE_OFFSET_RAW' 
undeclared (f
irst use in this function)
In file included from /usr/src/linux-2.4.20/include/linux/blkdev.h:11,
                  from /usr/src/linux-2.4.20/include/linux/blk.h:4,
                  from init/main.c:25:
/usr/src/linux-2.4.20/include/asm/io.h: In function `virt_to_phys':
/usr/src/linux-2.4.20/include/asm/io.h:78: `PAGE_OFFSET_RAW' undeclared 
(first u
se in this function)
/usr/src/linux-2.4.20/include/asm/io.h:79: warning: control reaches end 
of non-v
oid function
/usr/src/linux-2.4.20/include/asm/io.h: In function `phys_to_virt':
/usr/src/linux-2.4.20/include/asm/io.h:96: `PAGE_OFFSET_RAW' undeclared 
(first u
se in this function)
/usr/src/linux-2.4.20/include/asm/io.h:97: warning: control reaches end 
of non-v
oid function
/usr/src/linux-2.4.20/include/asm/io.h: In function `isa_check_signature':
/usr/src/linux-2.4.20/include/asm/io.h:280: `PAGE_OFFSET_RAW' undeclared 
(first
use in this function)
init/main.c: In function `start_kernel':
init/main.c:381: `PAGE_OFFSET_RAW' undeclared (first use in this function)
make: *** [init/main.o] Error 1
In file included from eni.c:9:
/usr/src/linux-2.4.20/include/linux/mm.h: In function `pmd_alloc':
/usr/src/linux-2.4.20/include/linux/mm.h:521: `PAGE_OFFSET_RAW' 
undeclared (firs
t use in this function)
/usr/src/linux-2.4.20/include/linux/mm.h:521: (Each undeclared 
identifier is rep
orted only once
/usr/src/linux-2.4.20/include/linux/mm.h:521: for each function it 
appears in.)
/usr/src/linux-2.4.20/include/linux/mm.h:522: warning: control reaches 
end of no
n-void function
In file included from /usr/src/linux-2.4.20/include/linux/highmem.h:5,
                  from /usr/src/linux-2.4.20/include/linux/vmalloc.h:8,
                  from /usr/src/linux-2.4.20/include/asm/io.h:47,
                  from /usr/src/linux-2.4.20/include/asm/pci.h:35,
                  from /usr/src/linux-2.4.20/include/linux/pci.h:622,
                  from eni.c:10:
/usr/src/linux-2.4.20/include/asm/pgalloc.h: In function `get_pgd_slow':
/usr/src/linux-2.4.20/include/asm/pgalloc.h:49: `PAGE_OFFSET_RAW' 
undeclared (fi
rst use in this function)
/usr/src/linux-2.4.20/include/asm/pgalloc.h:54: warning: implicit 
declaration of
  function `set_64bit'
/usr/src/linux-2.4.20/include/asm/pgalloc.h: In function `free_pgd_slow':
/usr/src/linux-2.4.20/include/asm/pgalloc.h:110: `PAGE_OFFSET_RAW' 
undeclared (f
irst use in this function)
In file included from /usr/src/linux-2.4.20/include/asm/pci.h:35,
                  from /usr/src/linux-2.4.20/include/linux/pci.h:622,
                  from eni.c:10:
/usr/src/linux-2.4.20/include/asm/io.h: In function `virt_to_phys':
/usr/src/linux-2.4.20/include/asm/io.h:78: `PAGE_OFFSET_RAW' undeclared 
(first u
se in this function)
/usr/src/linux-2.4.20/include/asm/io.h:79: warning: control reaches end 
of non-v
oid function
/usr/src/linux-2.4.20/include/asm/io.h: In function `phys_to_virt':
/usr/src/linux-2.4.20/include/asm/io.h:96: `PAGE_OFFSET_RAW' undeclared 
(first u
se in this function)
/usr/src/linux-2.4.20/include/asm/io.h:97: warning: control reaches end 
of non-v
oid function
/usr/src/linux-2.4.20/include/asm/io.h: In function `isa_check_signature':
/usr/src/linux-2.4.20/include/asm/io.h:280: `PAGE_OFFSET_RAW' undeclared 
(first
use in this function)
make[2]: *** [eni.o] Error 1
make[1]: *** [_modsubdir_atm] Error 2
make: *** [_mod_drivers] Error 2




^ permalink raw reply

* Re: Where is lilo.conf in the kernel source tree?
From: Der Herr Hofrat @ 2003-01-10 20:33 UTC (permalink / raw)
  To: Khai Trinh; +Cc: linuxppc-embedded
In-Reply-To: <20030110191126.74442.qmail@web11508.mail.yahoo.com>


>
> I would like to reserve a piece of High RAM memory for
> DMA. The Linux 2.4 Drivers book show to appand
> MEM=reserve_size to the lilo.conf file.
>
> Would someone please let me know where this file is in
> the kernel tree? I couldn't seem to locate it.

its in /etc/ by default not in the kernel tree.

hofrat

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply

* DiskOnChip GRUB menu fall-back fix
From: Ilguiz Latypov @ 2003-01-10 20:57 UTC (permalink / raw)
  To: Linux MTD mailing list

I submitted a modification to the David Woodhouse's GRUB patch,
patches/grub-2003-01-08-doc.patch in the MTD CVS tree.  It is the same as
the previous one posted by Mark Meade plus the fix for a fall-back menu 
option.  When the default drive (DiskOnChip) doesn't contain the menu.lst 
file, the menu will be looked for among the first hard disk and the floppy 
disk.  The bug was that selecting an item of the fall-back menu barked 
about non-existent disk.

I hope I didn't break anything by fixing this bug.

-- 
Ilguiz Latypov
Montreal, Quebec
Canada

+1 (514) 526-6911 (home)
+1 (514) 281-9191 x 117 (work)

^ permalink raw reply

* Re: [parisc-linux] unaligned accesses
From: Thibaut VARENE @ 2003-01-10 22:25 UTC (permalink / raw)
  To: parisc-linux
In-Reply-To: <20030110231313.1215dc79.varenet@esiee.fr>

On Fri, 10 Jan 2003 23:13:13 +0100
"Thibaut VARENE" <varenet@esiee.fr> wrote:

I hate to reply to myself but I said crap in my previous mail.
All apologies:
> FWIW, the default option (used by most people) is data=journal, and is not affected by that bug. We've been using 2.4.20 with ext3 for weeks pretty safely here.
it was: "the default option is data=ordered" of course, which is safe.

HTH,


Thibaut VARENE
The PA/Linux ESIEE Team
http://pateam.esiee.fr/

^ permalink raw reply

* Linux kernel 2.5.56 released
From: Linux Kernel Distribution System @ 2003-01-10 20:23 UTC (permalink / raw)
  To: linux-kernel-announce

Linux kernel version 2.5.56 has been released.  It is available from:

Patch:		ftp://ftp.kernel.org/pub/linux/kernel/v2.5/patch-2.5.56.gz
Full source:	ftp://ftp.kernel.org/pub/linux/kernel/v2.5/linux-2.5.56.tar.gz

Sizes in bytes			Compressed	Uncompressed
------------------------------------------------------------
Patch                               213460           1274023
Full source                       39301979         176281600

-----------------------------------------------------------------------------
 This is an automatically generated message.  To unsubscribe from this list,
 please send a message to majordomo@vger.kernel.org containing
 the line:

   unsubscribe linux-kernel-announce <your_email_address>

 ... where <your_email_address> is the email address you are receiving
     this message at.
-----------------------------------------------------------------------------

The following files were changed in this release:

 Documentation/usb/scanner-hp-sane.txt          |   79 --
 b/Documentation/crypto/api-intro.txt           |    7 
 b/Documentation/filesystems/proc.txt           |   12 
 b/Documentation/networking/NAPI_HOWTO.txt      |   17 
 b/Documentation/serial/driver                  |   41 +
 b/Documentation/usb/scanner.txt                |  329 ++++-------
 b/Makefile                                     |    2 
 b/arch/i386/kernel/entry.S                     |   69 +-
 b/arch/i386/kernel/mpparse.c                   |    2 
 b/arch/i386/kernel/vm86.c                      |    6 
 b/arch/ppc/Kconfig                             |    2 
 b/arch/ppc/configs/redwood6_defconfig          |  547 ++++++++++++++++++
 b/arch/ppc/configs/sycamore_defconfig          |  528 ++++++++++++++++++
 b/arch/ppc/kernel/traps.c                      |   95 +--
 b/arch/ppc/platforms/4xx/Kconfig               |   17 
 b/arch/ppc/platforms/4xx/Makefile              |    1 
 b/arch/ppc/platforms/4xx/sycamore.c            |  293 ++++++++++
 b/arch/ppc/platforms/4xx/sycamore.h            |   71 ++
 b/arch/sparc/kernel/unaligned.c                |    3 
 b/arch/sparc/mm/extable.c                      |   70 --
 b/arch/sparc/mm/fault.c                        |    5 
 b/arch/sparc64/defconfig                       |   74 +-
 b/arch/sparc64/kernel/sys_sparc32.c            |    6 
 b/crypto/Kconfig                               |   25 
 b/crypto/Makefile                              |    1 
 b/crypto/aes.c                                 |  468 +++++++++++++++
 b/crypto/tcrypt.c                              |  110 +++
 b/crypto/tcrypt.h                              |   93 +++
 b/drivers/acpi/acpi_bus.h                      |   21 
 b/drivers/acpi/acpi_drivers.h                  |    4 
 b/drivers/acpi/battery.c                       |   24 
 b/drivers/acpi/bus.c                           |    6 
 b/drivers/acpi/button.c                        |   73 ++
 b/drivers/acpi/dispatcher/dsfield.c            |   76 +-
 b/drivers/acpi/dispatcher/dsinit.c             |   34 -
 b/drivers/acpi/dispatcher/dsmethod.c           |   60 +-
 b/drivers/acpi/dispatcher/dsmthdat.c           |   94 +--
 b/drivers/acpi/dispatcher/dsobject.c           |   86 +-
 b/drivers/acpi/dispatcher/dsopcode.c           |  134 ++--
 b/drivers/acpi/dispatcher/dsutils.c            |   64 +-
 b/drivers/acpi/dispatcher/dswexec.c            |   34 -
 b/drivers/acpi/dispatcher/dswload.c            |   60 +-
 b/drivers/acpi/dispatcher/dswscope.c           |   22 
 b/drivers/acpi/dispatcher/dswstate.c           |  140 ++--
 b/drivers/acpi/ec.c                            |   24 
 b/drivers/acpi/events/evevent.c                |   20 
 b/drivers/acpi/events/evgpe.c                  |   84 +-
 b/drivers/acpi/events/evmisc.c                 |   56 -
 b/drivers/acpi/events/evregion.c               |   86 +-
 b/drivers/acpi/events/evrgnini.c               |   92 +--
 b/drivers/acpi/events/evsci.c                  |   14 
 b/drivers/acpi/events/evxface.c                |   76 +-
 b/drivers/acpi/events/evxfevnt.c               |   40 -
 b/drivers/acpi/events/evxfregn.c               |   42 -
 b/drivers/acpi/executer/exconfig.c             |   72 +-
 b/drivers/acpi/executer/exconvrt.c             |   86 +-
 b/drivers/acpi/executer/excreate.c             |  100 +--
 b/drivers/acpi/executer/exdump.c               |   64 +-
 b/drivers/acpi/executer/exfield.c              |   38 -
 b/drivers/acpi/executer/exfldio.c              |  116 +--
 b/drivers/acpi/executer/exmisc.c               |   62 +-
 b/drivers/acpi/executer/exmutex.c              |   34 -
 b/drivers/acpi/executer/exnames.c              |   44 -
 b/drivers/acpi/executer/exoparg1.c             |   56 -
 b/drivers/acpi/executer/exoparg2.c             |   46 -
 b/drivers/acpi/executer/exoparg3.c             |   26 
 b/drivers/acpi/executer/exoparg6.c             |   20 
 b/drivers/acpi/executer/exprep.c               |   42 -
 b/drivers/acpi/executer/exregion.c             |  108 +--
 b/drivers/acpi/executer/exresnte.c             |   20 
 b/drivers/acpi/executer/exresolv.c             |   46 -
 b/drivers/acpi/executer/exresop.c              |   34 -
 b/drivers/acpi/executer/exstore.c              |   44 -
 b/drivers/acpi/executer/exstoren.c             |   24 
 b/drivers/acpi/executer/exstorob.c             |   18 
 b/drivers/acpi/executer/exsystem.c             |   44 -
 b/drivers/acpi/executer/exutils.c              |   46 -
 b/drivers/acpi/hardware/hwacpi.c               |   14 
 b/drivers/acpi/hardware/hwgpe.c                |   72 +-
 b/drivers/acpi/hardware/hwregs.c               |  106 +--
 b/drivers/acpi/hardware/hwsleep.c              |   32 -
 b/drivers/acpi/hardware/hwtimer.c              |   22 
 b/drivers/acpi/include/acconfig.h              |    4 
 b/drivers/acpi/include/acdebug.h               |  222 +++----
 b/drivers/acpi/include/acdispat.h              |  370 ++++++------
 b/drivers/acpi/include/acevents.h              |  102 +--
 b/drivers/acpi/include/acexcep.h               |    2 
 b/drivers/acpi/include/acglobal.h              |  212 +++----
 b/drivers/acpi/include/achware.h               |   62 +-
 b/drivers/acpi/include/acinterp.h              |  546 +++++++++---------
 b/drivers/acpi/include/aclocal.h               |  669 ++++++++++------------
 b/drivers/acpi/include/acmacros.h              |   16 
 b/drivers/acpi/include/acnamesp.h              |  324 +++++------
 b/drivers/acpi/include/acobject.h              |  415 ++++++--------
 b/drivers/acpi/include/acoutput.h              |    2 
 b/drivers/acpi/include/acparser.h              |  216 +++----
 b/drivers/acpi/include/acpi.h                  |    2 
 b/drivers/acpi/include/acpiosxf.h              |  168 +++--
 b/drivers/acpi/include/acpixf.h                |  258 ++++----
 b/drivers/acpi/include/acresrc.h               |  304 +++++-----
 b/drivers/acpi/include/acstruct.h              |  190 +++---
 b/drivers/acpi/include/actables.h              |  110 +--
 b/drivers/acpi/include/actbl.h                 |  150 ++---
 b/drivers/acpi/include/actbl1.h                |  134 ++--
 b/drivers/acpi/include/actbl2.h                |  195 +++---
 b/drivers/acpi/include/actbl71.h               |  140 ++--
 b/drivers/acpi/include/actypes.h               |  732 +++++++++++--------------
 b/drivers/acpi/include/acutils.h               |  532 +++++++++---------
 b/drivers/acpi/include/amlcode.h               |    2 
 b/drivers/acpi/include/amlresrc.h              |  381 ++++++-------
 b/drivers/acpi/include/platform/acenv.h        |    2 
 b/drivers/acpi/include/platform/acgcc.h        |    2 
 b/drivers/acpi/include/platform/aclinux.h      |    2 
 b/drivers/acpi/namespace/nsaccess.c            |   48 -
 b/drivers/acpi/namespace/nsalloc.c             |   74 +-
 b/drivers/acpi/namespace/nsdump.c              |   70 +-
 b/drivers/acpi/namespace/nsdumpdv.c            |   20 
 b/drivers/acpi/namespace/nseval.c              |   64 +-
 b/drivers/acpi/namespace/nsinit.c              |   48 -
 b/drivers/acpi/namespace/nsload.c              |   36 -
 b/drivers/acpi/namespace/nsnames.c             |   34 -
 b/drivers/acpi/namespace/nsobject.c            |   62 +-
 b/drivers/acpi/namespace/nsparse.c             |   18 
 b/drivers/acpi/namespace/nssearch.c            |   44 -
 b/drivers/acpi/namespace/nsutils.c             |  142 ++--
 b/drivers/acpi/namespace/nswalk.c              |   38 -
 b/drivers/acpi/namespace/nsxfeval.c            |  112 +--
 b/drivers/acpi/namespace/nsxfname.c            |   40 -
 b/drivers/acpi/namespace/nsxfobj.c             |   34 -
 b/drivers/acpi/osl.c                           |  171 +----
 b/drivers/acpi/parser/psargs.c                 |   76 +-
 b/drivers/acpi/parser/psopcode.c               |   12 
 b/drivers/acpi/parser/psparse.c                |   62 +-
 b/drivers/acpi/parser/psscope.c                |   38 -
 b/drivers/acpi/parser/pstree.c                 |   38 -
 b/drivers/acpi/parser/psutils.c                |   44 -
 b/drivers/acpi/parser/pswalk.c                 |   28 
 b/drivers/acpi/parser/psxface.c                |   18 
 b/drivers/acpi/pci_bind.c                      |   10 
 b/drivers/acpi/pci_irq.c                       |   22 
 b/drivers/acpi/pci_link.c                      |   28 
 b/drivers/acpi/pci_root.c                      |   28 
 b/drivers/acpi/power.c                         |    4 
 b/drivers/acpi/processor.c                     |   85 --
 b/drivers/acpi/resources/rsaddr.c              |  116 +--
 b/drivers/acpi/resources/rscalc.c              |  100 +--
 b/drivers/acpi/resources/rscreate.c            |   60 +-
 b/drivers/acpi/resources/rsdump.c              |   84 +-
 b/drivers/acpi/resources/rsio.c                |   96 +--
 b/drivers/acpi/resources/rsirq.c               |   78 +-
 b/drivers/acpi/resources/rslist.c              |   44 -
 b/drivers/acpi/resources/rsmemory.c            |   92 +--
 b/drivers/acpi/resources/rsmisc.c              |  104 +--
 b/drivers/acpi/resources/rsutils.c             |   36 -
 b/drivers/acpi/resources/rsxface.c             |   26 
 b/drivers/acpi/scan.c                          |   16 
 b/drivers/acpi/system.c                        |    4 
 b/drivers/acpi/tables/tbconvrt.c               |   56 -
 b/drivers/acpi/tables/tbget.c                  |   68 +-
 b/drivers/acpi/tables/tbgetall.c               |   30 -
 b/drivers/acpi/tables/tbinstal.c               |   56 -
 b/drivers/acpi/tables/tbrsdt.c                 |   34 -
 b/drivers/acpi/tables/tbutils.c                |   38 -
 b/drivers/acpi/tables/tbxface.c                |   48 -
 b/drivers/acpi/tables/tbxfroot.c               |   72 +-
 b/drivers/acpi/thermal.c                       |    4 
 b/drivers/acpi/toshiba_acpi.c                  |   12 
 b/drivers/acpi/utilities/utalloc.c             |  156 ++---
 b/drivers/acpi/utilities/utcopy.c              |  168 ++---
 b/drivers/acpi/utilities/utdebug.c             |   86 +-
 b/drivers/acpi/utilities/utdelete.c            |   42 -
 b/drivers/acpi/utilities/uteval.c              |   58 -
 b/drivers/acpi/utilities/utglobal.c            |  100 +--
 b/drivers/acpi/utilities/utinit.c              |    8 
 b/drivers/acpi/utilities/utmath.c              |   58 -
 b/drivers/acpi/utilities/utmisc.c              |  210 +++----
 b/drivers/acpi/utilities/utobject.c            |   84 +-
 b/drivers/acpi/utilities/utxface.c             |   30 -
 b/drivers/acpi/utils.c                         |   28 
 b/drivers/char/agp/amd-k7-agp.c                |    4 
 b/drivers/char/agp/sworks-agp.c                |    4 
 b/drivers/char/watchdog/Kconfig                |   20 
 b/drivers/char/watchdog/Makefile               |    5 
 b/drivers/char/watchdog/acquirewdt.c           |   96 +--
 b/drivers/char/watchdog/advantechwdt.c         |   80 +-
 b/drivers/char/watchdog/alim7101_wdt.c         |  345 +++++++++++
 b/drivers/char/watchdog/eurotechwdt.c          |  538 +++++++++---------
 b/drivers/char/watchdog/i810-tco.c             |    4 
 b/drivers/char/watchdog/ib700wdt.c             |   74 +-
 b/drivers/char/watchdog/indydog.c              |  182 ++++++
 b/drivers/char/watchdog/machzwd.c              |   17 
 b/drivers/char/watchdog/mixcomwd.c             |   27 
 b/drivers/char/watchdog/pcwd.c                 |  111 ++-
 b/drivers/char/watchdog/sbc60xxwdt.c           |    6 
 b/drivers/char/watchdog/sc1200wdt.c            |  479 ++++++++++++++++
 b/drivers/char/watchdog/sc520_wdt.c            |  394 +++++++++++++
 b/drivers/char/watchdog/shwdt.c                |   18 
 b/drivers/char/watchdog/softdog.c              |   21 
 b/drivers/char/watchdog/w83877f_wdt.c          |    6 
 b/drivers/char/watchdog/wafer5823wdt.c         |  262 ++++++++
 b/drivers/char/watchdog/wdt.c                  |   31 -
 b/drivers/char/watchdog/wdt977.c               |   18 
 b/drivers/char/watchdog/wdt_pci.c              |   18 
 b/drivers/hotplug/acpiphp_glue.c               |   46 -
 b/drivers/input/mouse/psmouse.c                |    2 
 b/drivers/scsi/aic7xxx/aic7xxx_osm.h           |    1 
 b/drivers/serial/21285.c                       |   55 +
 b/drivers/serial/8250.c                        |   60 +-
 b/drivers/serial/amba.c                        |   43 -
 b/drivers/serial/anakin.c                      |   33 -
 b/drivers/serial/clps711x.c                    |   45 -
 b/drivers/serial/core.c                        |  156 ++---
 b/drivers/serial/mux.c                         |   13 
 b/drivers/serial/nb85e_uart.c                  |   14 
 b/drivers/serial/sa1100.c                      |   69 +-
 b/drivers/serial/sunsab.c                      |   27 
 b/drivers/serial/sunsu.c                       |   36 -
 b/drivers/serial/sunzilog.c                    |  149 ++---
 b/drivers/serial/uart00.c                      |   46 +
 b/drivers/usb/class/usblp.c                    |    3 
 b/drivers/usb/core/hcd-pci.c                   |   16 
 b/drivers/usb/core/hcd.c                       |   34 -
 b/drivers/usb/core/hub.c                       |   70 +-
 b/drivers/usb/core/usb-debug.c                 |    2 
 b/drivers/usb/core/usb.c                       |   38 -
 b/drivers/usb/host/ehci-dbg.c                  |   32 -
 b/drivers/usb/host/ehci-hcd.c                  |   11 
 b/drivers/usb/host/ehci-q.c                    |   19 
 b/drivers/usb/host/ehci.h                      |    2 
 b/drivers/usb/host/ohci-dbg.c                  |   35 -
 b/drivers/usb/host/ohci-hcd.c                  |   10 
 b/drivers/usb/host/ohci-hub.c                  |    2 
 b/drivers/usb/host/ohci-mem.c                  |    2 
 b/drivers/usb/host/ohci-q.c                    |    4 
 b/drivers/usb/image/Kconfig                    |    4 
 b/drivers/usb/image/mdc800.c                   |    4 
 b/drivers/usb/image/scanner.c                  |  171 ++---
 b/drivers/usb/image/scanner.h                  |   24 
 b/drivers/usb/input/pid.c                      |   45 -
 b/drivers/usb/misc/Makefile                    |    6 
 b/drivers/usb/misc/atmsar.c                    |  177 ++----
 b/drivers/usb/misc/atmsar.h                    |   27 
 b/drivers/usb/misc/auerswald.c                 |    7 
 b/drivers/usb/misc/brlvger.c                   |   21 
 b/drivers/usb/misc/rio500.c                    |    5 
 b/drivers/usb/misc/speedtouch.c                |   80 +-
 b/drivers/usb/misc/usbtest.c                   |  306 ++++++++++
 b/drivers/usb/net/kaweth.c                     |    8 
 b/drivers/usb/net/pegasus.c                    |    5 
 b/drivers/usb/net/pegasus.h                    |    4 
 b/drivers/usb/net/rtl8150.c                    |    5 
 b/drivers/usb/net/usbnet.c                     |   22 
 b/drivers/usb/serial/bus.c                     |    9 
 b/drivers/usb/serial/empeg.c                   |   12 
 b/drivers/usb/serial/ezusb.c                   |    4 
 b/drivers/usb/serial/generic.c                 |    6 
 b/drivers/usb/serial/io_edgeport.c             |   38 -
 b/drivers/usb/serial/io_ti.c                   |   58 -
 b/drivers/usb/serial/ir-usb.c                  |   16 
 b/drivers/usb/serial/keyspan.c                 |    6 
 b/drivers/usb/serial/pl2303.c                  |   18 
 b/drivers/usb/serial/usb-serial.c              |   38 -
 b/drivers/usb/serial/usb-serial.h              |    2 
 b/drivers/usb/serial/visor.c                   |   48 -
 b/drivers/usb/serial/whiteheat.c               |    4 
 b/drivers/usb/storage/freecom.c                |    4 
 b/drivers/usb/storage/transport.c              |  307 ----------
 b/drivers/usb/storage/transport.h              |    1 
 b/drivers/usb/storage/unusual_devs.h           |   22 
 b/fs/exec.c                                    |   16 
 b/include/asm-alpha/mmu_context.h              |    2 
 b/include/asm-arm/mmu_context.h                |    2 
 b/include/asm-cris/mmu_context.h               |    2 
 b/include/asm-i386/mmu_context.h               |    3 
 b/include/asm-ia64/mmu_context.h               |    2 
 b/include/asm-m68k/mmu_context.h               |    2 
 b/include/asm-m68knommu/mmu_context.h          |    2 
 b/include/asm-mips/mmu_context.h               |    2 
 b/include/asm-mips64/mmu_context.h             |    2 
 b/include/asm-parisc/mmu_context.h             |    2 
 b/include/asm-ppc/mmu_context.h                |    2 
 b/include/asm-ppc64/mmu_context.h              |    2 
 b/include/asm-s390/mmu_context.h               |    2 
 b/include/asm-s390x/mmu_context.h              |    2 
 b/include/asm-sh/mmu_context.h                 |    2 
 b/include/asm-sparc/mmu_context.h              |    2 
 b/include/asm-sparc/uaccess.h                  |    2 
 b/include/asm-sparc64/mmu_context.h            |    2 
 b/include/asm-um/mmu_context.h                 |    2 
 b/include/asm-v850/mmu_context.h               |    1 
 b/include/asm-x86_64/mmu_context.h             |    2 
 b/include/linux/acpi.h                         |   28 
 b/include/linux/device.h                       |   12 
 b/include/linux/netfilter_ipv4/ip_nat_helper.h |    7 
 b/include/linux/pfkeyv2.h                      |   26 
 b/include/linux/sched.h                        |    2 
 b/include/linux/serial_core.h                  |   26 
 b/include/linux/watchdog.h                     |    1 
 b/include/net/tcp.h                            |    3 
 b/include/net/xfrm.h                           |   41 +
 b/kernel/exit.c                                |    2 
 b/kernel/fork.c                                |    8 
 b/kernel/kallsyms.c                            |    2 
 b/kernel/sched.c                               |    2 
 b/net/core/skbuff.c                            |    4 
 b/net/ipv4/Makefile                            |    2 
 b/net/ipv4/ah.c                                |  118 ++--
 b/net/ipv4/fib_hash.c                          |    6 
 b/net/ipv4/ip_fragment.c                       |    2 
 b/net/ipv4/ip_output.c                         |    4 
 b/net/ipv4/netfilter/ip_conntrack_core.c       |   29 
 b/net/ipv4/netfilter/ip_conntrack_ftp.c        |    6 
 b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c  |    3 
 b/net/ipv4/netfilter/ip_nat_helper.c           |  175 ++++-
 b/net/ipv4/netfilter/ip_nat_standalone.c       |    1 
 b/net/ipv4/netfilter/ipt_ECN.c                 |    4 
 b/net/ipv4/netfilter/ipt_REJECT.c              |   16 
 b/net/ipv4/netfilter/ipt_ULOG.c                |    6 
 b/net/ipv4/netfilter/ipt_multiport.c           |    2 
 b/net/ipv4/route.c                             |    4 
 b/net/ipv4/tcp_input.c                         |   12 
 b/net/ipv4/tcp_ipv4.c                          |    4 
 b/net/ipv4/xfrm_algo.c                         |  350 +++++++++++
 b/net/ipv4/xfrm_policy.c                       |    2 
 b/net/ipv6/af_inet6.c                          |    2 
 b/net/key/af_key.c                             |  272 +++------
 b/net/netsyms.c                                |   10 
 b/net/unix/af_unix.c                           |    2 
 b/net/unix/garbage.c                           |    8 
 329 files changed, 13584 insertions(+), 9218 deletions(-)


^ permalink raw reply

* Linux v2.5.56
From: Linus Torvalds @ 2003-01-10 20:26 UTC (permalink / raw)
  To: Kernel Mailing List


Trying to make releases slightly more often and slightly smaller.

ACPI, USB, networking (mainly netfilter) updates. Some syscall path
updates and a thread bug in mm_release() that would miss updating the TID
and cause a few extra traps at exec time.

And a watchdog forward port from 2.4.x by DaveJ.

			Linus

----
Summary of changes from v2.5.55 to v2.5.56
============================================

<blueflux@koffein.net>:
  o [IPV4 ROUTE]: Fix some sysctl documentation

<gandalf@wlug.westbo.se>:
  o [NETFILTER]: Fix a locking bug in ip_conntrack_proto_tcp

<kadlec@blackhole.kfki.hu>:
  o [NETFILTER]: Fix excess logging of reused FTP expectations

<marcus@ingate.com>:
  o [NETFILTER]: ipt_multiport invert fix

<mulix@mulix.org>:
  o fix "assignment from incompatible pointer type"

<neilt@slimy.greenend.org.uk>:
  o USB Serial patch for old pl2303 devices

<netfilter@interlinx.bc.ca>:
  o [NETFILTER]: UDP nat helper support

<pablo@menichini.com.ar>:
  o 2.5.54 dev_*(&<dev>,...): drivers/usb/input/pid.c

Alan Cox <alan@lxorguk.ukuu.org.uk>:
  o more unusual USB storage devices

Anders Gustafsson <andersg@0x63.nu>:
  o [IPV6]: cleanup_ipv6_mibs cannot be __exit, since it is called on
    the ipv6_init error path

Andrew Morton <akpm@digeo.com>:
  o [NET]: Uninline skb_headerinit
  o [AF_UNIX]: Uninline unix_get_socket/maybe_unmark_and_push, mark
    {pop,empty}_stack static
  o [UNIX]: Uninline unix_peer_get
  o [IPSEC]: Uninline _decode_session
  o [IPV4 ROUTE]: Uninline rt_hash_code and rt_may_expire
  o [IPV4 OUTPUT]: Uninline ip_finish_output and skb_fill_page_desc
  o [IPV4 FRAG]: Uninline ipq_kill
  o [IPV4 FIBHASH]: extern inline --> static inline
  o [IPV4 TCP]: Dont export or inline __tcp_put_port, but do inline
    tcp_put_port
  o [IPV4 TCP]: Uninline tcp_rtt_estimator and tcp_urg.  extern inline
    --> static inline

Andy Grover <agrover@groveronline.com>:
  o ACPI: Use printk instead of pr_debug (Randy Dunlap)
  o ACPI: Remove typedefs in favor of using "struct" and "union"
    explicitly
  o ACPI: Expose lid state to userspace (Zdenek OGAR Skalak)
  o ACPI: Make button functions static (Pavel Machek)
  o ACPI: Express state of lid in words, not a number
  o cpufreq-ACPI: no longer use CPUFREQ_ALL_CPUS (Dominik Brodowski)
  o ACPI: Eliminate spawning of thread from timer callback. Use
    schedule_work for all cases. Thanks to Ingo Oeser, Andrew Morton,
    and Pavel Machek for their wisdom.
  o ACPI: Update version string to 20030109

Dave Jones <davej@codemonkey.org.uk>:
  o [WATCHDOG] wdt_pci nowayout fixes from 2.4
  o [WATCHDOG] eurotech indentation fixes
  o [WATCHDOG] eurotech nowayout fixes from 2.4
  o [WATCHDOG] wdt nowayout changes from 2.4
  o [WATCHDOG] wdt977 nowayout fixes from 2.4
  o c99 initialisers
  o [WATCHDOG] Add several new watchdog drivers from 2.4
  o [WATCHDOG] pcwd driver update from 2.4
  o [WATCHDOG] acquirewdt nowayout fixes from 2.4 (plus some
    CodingStyle reformatting)
  o [WATCHDOG] Acquirewdt C99 struct initialisers
  o [WATCHDOG] Advantech fixes from 2.4
  o [WATCHDOG] simplify advwdt_open, and add C99 struct initialisers
  o [WATCHDOG] Fix up incorrect C99 struct conversion
  o [WATCHDOG] acquirewdt compile fixes
  o [WATCHDOG] advantech compile fixes
  o [WATCHDOG] ALIM7101 fixes from 2.4 + C99 structs
  o [WATCHDOG] More alim7101 cleanups
  o [WATCHDOG] i810-tco fix from 2.4
  o [WATCHDOG] ib700wdt fixes from 2.4
  o [WATCHDOG] ib700wdt c99 structs
  o [WATCHDOG] indydog nowayout fixes from 2.4
  o [WATCHDOG] machzwd nowayout fixes from 2.4
  o [WATCHDOG] mixcomwd nowayout fixes from 2.4
  o [WATCHDOG] pcwd nowayout fixes from 2.4
  o [WATCHDOG] sbc60xxwdt nowayout fixes from 2.4
  o [WATCHDOG] SC1200WDT nowayout fixes from 2.4
  o [WATCHDOG] SC520 nowayout fixes from 2.4
  o [WATCHDOG] C99 struct initialisers for shwdt
  o [WATCHDOG] softdog nowayout fixes from 2.4
  o [WATCHDOG] w83877f nowayout fixes from 2.4
  o [WATCHDOG] nowayout fixes for wafer5823

David Brownell <david-b@pacbell.net>:
  o ehci, remove potential hangs
  o zaurus B500 (sl-5600?) & usbnet
  o 2.5.54 -- ohci-dbg.c: 358: In function `show_list': `data1'
  o usbtest, covers control queueing and fault cleanup

David S. Miller <davem@nuts.ninka.net>:
  o [SUNZILOG]: Adapt sun4u get_zs for Peters new scanning scheme
  o [CRYPTO]: Fix typo in aes.o rule
  o [NET]: Kill __tcp_put_port module export
  o [TCP]: Fix tcp_put_port declaration
  o [IPSEC]: Dont check algorithm availability unless CONFIG_CRYPTO
  o [IPSEC]: Kill warning in xfrm_algo.c
  o [CRYPTO]: Use appropriate defaults if AH/ESP is enabled
  o [SUNZILOG]: Fix uart_get_baud_rate args
  o [AIC7XXX]: Include asm/io.h, necessary to get at inb/outb/etc
  o [SPARC64]: Update defconfig

Duncan Sands <baldrick@wanadoo.fr>:
  o USB: atmsar is not a module
  o USB: speedtouch missing __init and __exit
  o USB: speedtouch: add GPL notices

Duncan Sands <duncan.sands@math.u-psud.fr>:
  o USB: speedtouch: remove version string duplication

Erich Focht <efocht@ess.nec.de>:
  o small migration thread fix

Filip Sneppe <filip.sneppe@cronos.be>:
  o [NETFILTER]: ip_conntrack_ftp.c, fixes a typo in a DEBUG statement

Gabriel Paubert <paubert@iram.es>:
  o 'iret' segment fixup

Greg Kroah-Hartman <greg@kroah.com>:
  o USB: revert davem's compile time fix, now that it's fixed properly
  o USB brlvger: Forward port 2.4 fix for misuse of types
  o USB: removed MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT from driver
    that do not need it
  o USB printer driver: forward port 2.4 fix for misuse of types
  o USB mdc800: forward port 2.4 fix for misuse of types
  o DEV: change dev_printk() to take a pointer to dev instead of the
    structure itself
  o USB: drivers/usb/core/ fixups due to dev_printk change
  o USB: drivers/usb/host/ fixups due to dev_printk change
  o USB: drivers/usb/serial/ fixups due to dev_printk change
  o USB serial: pass the usb_device_id to the probe() function
  o USB serial: fixup for probe function paramaters changing
  o USB: fix ehci build for older versions of gcc

Harald Welte <laforge@gnumonks.org>:
  o [NETFILTER]: This patch fixes the ULOG target when logging packets
    without any ethernet header (mac address).

Henning Meier-Geinitz <henning@meier-geinitz.de>:
  o scanner.c: fix race in ioctl_scanner()
  o USB scanner driver: updated documentation
  o USB scanner driver: updated Kconfig
  o scanner.c, scanner.h: Added vendor/product ids
  o scanner.c: print user-supplied ids only on start-up
  o scanner.c, scanner.h: Remove PV8630 ioctls
  o [PATCH 2.5.54] scanner.c: endpoint detection cleanup
  o scanner.c, scanner.h: Use symbolic name for interface class

James Morris <jmorris@intercode.com.au>:
  o [IPSEC]: Clean up key manager algorithm handling
  o [CRYPTO]: Add AES algorithm
  o [SUNSAB]: Comment out powering down of chip for now
  o [CRYPTO]: More credits for AES

Linus Torvalds <torvalds@home.transmeta.com>:
  o Fix exec_mmap() to release the MM while we still have it active, to
    properly de-activate it and make the child_tid logic work
    correctly.
  o Fix kallsyms symbol lookup code. Let's do this trivial
    one-character version before looking at more complicated changes.
  o Make psmouse driver _much_ more lenient about packet data timeouts

Luca Barbieri <ldb@ldb.ods.org>:
  o Use %ebp rather than %ebx for thread_info pointer
  o Remove all register pops before sysexit

Matthew Dharm <mdharm-usb@one-eyed-alien.net>:
  o USB storage: remove usb_stor_tranfer_length()

Oliver Neukum <oliver@neukum.name>:
  o USB: kaweth freeing skbs

Patrick McHardy <kaber@trash.net>:
  o [NETFILTER]: Fix ipt_REJECT udp checksums
  o [NETFILTER]: Fix incremental TCP checksum in ECN module

Paul Mackerras <paulus@samba.org>:
  o PPC32: Add support for the IBM PPC 405GPR-based "Sycamore" board
  o PPC32: Handle machine checks on 4xx processors better

Petko Manolov <petkan@users.sourceforge.net>:
  o USB pegasus: small patch for 2.5
  o again rtl8150

Rob Radez <rob@osinvestor.com>:
  o [SPARC32]: Copy over sparc64 exception table changes

Robert Olsson <robert.olsson@data.slu.se>:
  o [NAPI]: Discuss some more issues in driver HOWTO

Russell King <rmk@flint.arm.linux.org.uk>:
  o [SERIAL] Add prototypes and rename UPF_FLAGS
  o [SERIAL] Remove unused info->event
  o [SERIAL] Convert change_speed() to settermios()
  o [SERIAL] Change settermios to set_termios
  o [SERIAL] Bug fix: remove infinite loop in sa1100 serial driver
  o [SERIAL] Restrict the baud rates returnable from
    uart_get_baud_rate()
  o [SERIAL] Fix build errors caused in previous cset

Stephen Rothwell <sfr@canb.auug.org.au>:
  o [COMPAT]: Sparc64 use get/put compat_timespec

Tom Rini <trini@kernel.crashing.org>:
  o PPC32: Default to 768MB of lowmem



^ permalink raw reply

* 2.5: Link errors are shown in the wrong files
From: Adrian Bunk @ 2003-01-10 20:26 UTC (permalink / raw)
  To: kai.germaschewski, Sam Ravnborg; +Cc: linux-kernel

I'm doing regular compile tests with 2.4 and 2.5 kernels to catch and 
either fix or report compile errors.

Since several revisions 2.5 has the _very_ annoying behavior of showing 
link errors in the wrong files. This makes finding the cause of the 
problems harder.

As an example look at the following link error in 2.4.21-pre3-ac2:

<--  snip  -->

...
ld -m elf_i386 -T 
/home/bunk/linux/kernel-2.4/linux-2.4.20-ac/arch/i386/vmlinux.
lds -e stext arch/i386/kernel/head.o arch/i386/kernel/init_task.o 
init/main.o init/version.o init/do_mounts.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o 
mm/mm.o fs/fs.o ipc/ipc.o \
         drivers/acpi/acpi.o drivers/parport/driver.o 
drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o 
drivers/char/agp/agp.o drivers/char/drm/drm.o drivers/net/fc/fc.o 
drivers/net/appletalk/appletalk.o drivers/net/tokenring/tr.o drivers/net/wan/wan.o 
drivers/net/arcnet/arcnetdrv.o drivers/atm/atm.o drivers/ide/idedriver.o drivers/scsi/scsidrv.o 
drivers/message/fusion/fusion.o drivers/ieee1394/ieee1394drv.o drivers/cdrom/driver.o 
drivers/sound/sounddrivers.o drivers/pci/driver.o drivers/mtd/mtdlink.o 
drivers/pcmcia/pcmcia.o
 drivers/net/pcmcia/pcmcia_net.o drivers/net/wireless/wireless_net.o 
drivers/char/pcmcia/pcmcia_char.o drivers/pnp/pnp.o drivers/video/video.o 
drivers/block/paride/paride.a drivers/net/hamradio/hamradio.o drivers/usb/usbdrv.o 
drivers/media/media.o drivers/input/inputdrv.o drivers/message/i2o/i2o.o 
drivers/net/irda/irda.o drivers/i2c/i2c.o drivers/telephony/telephony.o drivers/md/mddev.o 
drivers/bluetooth/bluetooth.o drivers/hotplug/vmlinux-obj.o 
drivers/isdn/vmlinux-obj.o arch/i386/math-emu/math.o \
        net/network.o \
        /home/bunk/linux/kernel-2.4/linux-2.4.20-ac/arch/i386/lib/lib.a 
/home/bunk/linux/kernel-2.4/linux-2.4.20-ac/lib/lib.a 
/home/bunk/linux/kernel-2.4/linux-2.4.20-ac/arch/i386/lib/lib.a \
        --end-group \
        -o vmlinux
drivers/char/char.o(.text.init+0xa0bc): In function `siolx_init':
: undefined reference to `local symbols in discarded section .text.exit'
drivers/atm/atm.o(.text.init+0x21): In function `idt77252_exit':
/home/bunk/linux/kernel-2.4/linux-2.4.20-ac/drivers/atm/idt77252.c: 
undefined reference to `ia_detect'
make: *** [vmlinux] Error 1

<--  snip  -->


With these error messages it's easy to identify the problems.

Compare this to the following output in 2.5.55:


<--  snip  -->

...
        ld -m elf_i386 -e stext -T arch/i386/vmlinux.lds.s 
arch/i386/kernel/head.o arch/i386/kernel/init_task.o  init/built-in.o 
--start-group  usr/built-in.o  arch/i386/kernel/built-in.o  
arch/i386/mm/built-in.o  arch/i386/mach-default/built-in.o  
kernel/built-in.o  mm/built-in.o  fs/built-in.o  ipc/built-in.o  
security/built-in.o  crypto/built-in.o  lib/lib.a  arch/i386/lib/lib.a  
drivers/built-in.o  sound/built-in.o  arch/i386/math-emu/built-in.o  
arch/i386/pci/built-in.o  arch/i386/oprofile/built-in.o  net/built-in.o 
--end-group  -o .tmp_vmlinux1
drivers/built-in.o(.text+0x17daa9): In function `lanai_module_init':
/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: undefined 
reference to `__udivdi3'
drivers/built-in.o(.text+0x17e6ab):/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: 
undefined reference to `__udivdi3'
drivers/built-in.o(.text+0x17f73a):/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: 
undefined reference to `__udivdi3'
drivers/built-in.o(.text+0x1810bf):/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: 
undefined reference to `__udivdi3'
drivers/built-in.o(.text+0x183125):/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: 
undefined reference to `__udivdi3'
drivers/built-in.o(.text+0x1ac9e5):/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: 
undefined reference to `awc_work'
drivers/built-in.o(.text+0x23747a):/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: 
undefined reference to `__bad_udelay'
drivers/built-in.o(.init.text+0x44c7): In function 
`nicstar_module_exit':
/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/nicstar.c:408: 
undefined reference to `mxser_init'
drivers/built-in.o(.init.text+0x518fc): In function `lanai_module_init':
/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: undefined 
reference to `_ebss'
drivers/built-in.o(.init.text+0x51901):/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: 
undefined reference to `_ebss'
drivers/built-in.o(.init.text+0x5191b):/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: 
undefined reference to `_ebss'
drivers/built-in.o(.data+0x73154):/home/bunk/linux/kernel-2.5/linux-2.5.55/drivers/atm/lanai.c: 
undefined reference to `local symbols in discarded section .exit.text'
make: *** [.tmp_vmlinux1] Error 1

<--  snip   -->


The references to drivers/atm/lanai.c are complete nonsense, e.g. the 
cause for the awc_work problem is in drivers/net/aironet4500* .

I'm using the gcc 2.95 and binutils 2.13.90.0.16 from Debian unstable.


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply

* Re: [ACPI] ACPI patches updated (20030109)
From: Jurgen Kramer @ 2003-01-10 20:16 UTC (permalink / raw)
  To: Grover, Andrew; +Cc: acpi-devel-pyega4qmqnRoyOMFzWx49A, kernel list
In-Reply-To: <F760B14C9561B941B89469F59BA3A84725A119-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>

Hi,

Are you planning a diff for 2.4.20? I'd really like to
test the lid status update on my laptop.

Cheers,

Jurgen

^ permalink raw reply

* Re: Linux 2.4.21-pre3-ac3
From: Dominik Brodowski @ 2003-01-10 20:22 UTC (permalink / raw)
  To: Alan Cox, linux-kernel; +Cc: cpufreq
In-Reply-To: <30994.1042229722@www4.gmx.net>

On Fri, Jan 10, 2003 at 09:15:22PM +0100, Alan Cox wrote:
> Handle with care, this should work nicely but does have more minor IDE
> changes paticularly relevant to laptop IDE suspend/resume.
> 
> Linux 2.4.21pre3-ac3
> o	Natsemi Geode/Cyrix MediaGX cpufreq support	(Dominik Brodowski)
Actually, this has been Hiroshi Miura's and Zwane Mwaikambo's work.

	Dominik

^ permalink raw reply

* Re: PATCH: [2.4.21-pre3] Fix for SMP race condition in IDE code
From: Andre Hedrick @ 2003-01-10 20:22 UTC (permalink / raw)
  To: Ross Biro; +Cc: Alan Cox, Marcelo Tosatti, Linux Kernel Mailing List
In-Reply-To: <3E1F0CF5.4000304@google.com>


Ross,

Sheesh, I know who is a candiated for me to dump the maintainership on in
the future!  This will take a little time to reveiw; however, I know of no
one who runs systems in this scale.

Also "t" is the last drive.

If you need more drives, use the upper half of the current majors
/dev/hdu 3,128
/dev/hdv 3,192

Repeat ... that will make it to 20 channels.

Cheers,


On Fri, 10 Jan 2003, Ross Biro wrote:

> 
> There is a race condition in all versions of the IDE code that I've 
> looked at including 2.4.18 and 2.4.21-pre3. Basically on an SMP system 
> if mutiple IDE channels are on the same interrupt and 1 channel sends 
> has an interrupt pending on 1 processor while the other processor is 
> calling ide_set_handler, then the interrupt can be mistaken for command 
> completion on both channels, and a command can be completed before it is 
> even issued.
> 
> This problem can be triggered with the following code
> 
> cd /proc/ide
> (while true; do for i in hd[a-z]; do for j in 1 2 3 ; do cat 
> $i/smart_values >/dev/null; done; done; done) &
> (while true; do for i in hd[a-z]; do dd if=/dev/$i of=/dev/null bs=4096k 
> skip=0 & done; wait; done) &
> 
> And can be seen by properly instrumenting drive_cmd_intr to check for 
> errors.
> 
> On a dual proc machine with 4 channels on a single interrupt and 2.4.18 
> I expec to see an error about once every twenty minutes with the above 
> code.  I believe it should occur much less often on 2.4.20 and above.  
> 
> Drives react to this problem in different ways.  Often they simply lock 
> up and refuse to talk to the host until they have been properly reset. 
>  Some drives require a power cycle before they will work properly again.
> 
> This problem required the use of over 200 machines, approximately 2000 
> drives, a bus analyzer, and a lot of cooperation from a couple of drive 
> manufacturers to go from "something goes wrong once in a while" to 
> something we could easily reproduce.
> 
> This patch has only been minimally tested and then only with 1 brand of 
> ide hard drive.
> 
> ----- snip ------
> 
> diff -durbB linux-2.4.20/drivers/ide/ide-cd.c 
> linux-2.4.20-p1/drivers/ide/ide-cd.c
> --- linux-2.4.20/drivers/ide/ide-cd.c    Thu Jan  9 11:14:01 2003
> +++ linux-2.4.20-p1/drivers/ide/ide-cd.c    Wed Jan  8 16:25:04 2003
> @@ -863,11 +864,15 @@
>          HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
>  
>      if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) {
> +                unsigned long flags;
>          if (HWGROUP(drive)->handler != NULL)
>              BUG();
> -        ide_set_handler (drive, handler, WAIT_CMD, cdrom_timer_expiry);
> +                spin_lock_irqsave(&io_request_lock, flags);
>          /* packet command */
>          HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG);
> +        ide_set_handler_nolock (drive, handler, WAIT_CMD, 
> cdrom_timer_expiry);
> +                ide_delay_400ns();
> +                spin_unlock_irqrestore(&io_request_lock, flags);
>          return ide_started;
>      } else {
>          /* packet command */
> diff -durbB linux-2.4.20/drivers/ide/ide-disk.c 
> linux-2.4.20-p1/drivers/ide/ide-disk.c
> --- linux-2.4.20/drivers/ide/ide-disk.c    Thu Jan  9 11:14:01 2003
> +++ linux-2.4.20-p1/drivers/ide/ide-disk.c    Wed Jan  8 16:25:17 2003
> @@ -467,12 +467,15 @@
>  #endif /* CONFIG_BLK_DEV_IDEDMA */
>          if (HWGROUP(drive)->handler != NULL)
>              BUG();
> -        ide_set_handler(drive, &read_intr, WAIT_CMD, NULL);
>  
>          command = ((drive->mult_count) ?
>                 ((lba48) ? WIN_MULTREAD_EXT : WIN_MULTREAD) :
>                 ((lba48) ? WIN_READ_EXT : WIN_READ));
> +                spin_lock_irqsave(&io_request_lock, flags);
>          hwif->OUTB(command, IDE_COMMAND_REG);
> +        ide_set_handler_nolock(drive, &read_intr, WAIT_CMD, NULL);
> +                ide_delay_400ns();
> +                spin_unlock_irqrestore(&io_request_lock, flags);
>          return ide_started;
>      } else if (rq_data_dir(rq) == WRITE) {
>          ide_startstop_t startstop;
> diff -durbB linux-2.4.20/drivers/ide/ide-dma.c 
> linux-2.4.20-p1/drivers/ide/ide-dma.c
> --- linux-2.4.20/drivers/ide/ide-dma.c    Thu Jan  9 11:14:01 2003
> +++ linux-2.4.20-p1/drivers/ide/ide-dma.c    Thu Jan  9 15:32:09 2003
> @@ -655,6 +655,7 @@
>      unsigned int count    = 0;
>      u8 dma_stat = 0, lba48    = (drive->addressing == 1) ? 1 : 0;
>      task_ioreg_t command    = WIN_NOP;
> +        unsigned long flags;
>  
>      if (!(count = ide_build_dmatable(drive, rq, PCI_DMA_FROMDEVICE)))
>          /* try PIO instead of DMA */
> @@ -673,7 +674,6 @@
>      /* paranoia check */
>      if (HWGROUP(drive)->handler != NULL)
>          BUG();
> -    ide_set_handler(drive, &ide_dma_intr, 2*WAIT_CMD, dma_timer_expiry);
>  
>      /*
>       * FIX ME to use only ACB ide_task_t args Struct
> @@ -691,7 +691,11 @@
>      }
>  #endif
>      /* issue cmd to drive */
> +        spin_lock_irqsave(&io_request_lock, flags);
>      hwif->OUTB(command, IDE_COMMAND_REG);
> +    ide_set_handler_nolock(drive, &ide_dma_intr, 2*WAIT_CMD, 
> dma_timer_expiry);
> +        ide_delay_400ns();
> +        spin_unlock_irqrestore(&io_request_lock, flags);
>  
>      return HWIF(drive)->ide_dma_count(drive);
>  }
> @@ -707,6 +711,7 @@
>      unsigned int count    = 0;
>      u8 dma_stat = 0, lba48    = (drive->addressing == 1) ? 1 : 0;
>      task_ioreg_t command    = WIN_NOP;
> +        unsigned long flags;
>  
>      if (!(count = ide_build_dmatable(drive, rq, PCI_DMA_TODEVICE)))
>          /* try PIO instead of DMA */
> @@ -725,7 +730,6 @@
>      /* paranoia check */
>      if (HWGROUP(drive)->handler != NULL)
>          BUG();
> -    ide_set_handler(drive, &ide_dma_intr, 2*WAIT_CMD, dma_timer_expiry);
>      /*
>       * FIX ME to use only ACB ide_task_t args Struct
>       */
> @@ -742,7 +746,13 @@
>      }
>  #endif
>      /* issue cmd to drive */
> +        spin_lock_irqsave(&io_request_lock, flags);
>      hwif->OUTB(command, IDE_COMMAND_REG);
> +    ide_set_handler_nolock(drive, &ide_dma_intr,
> +                               2*WAIT_CMD, dma_timer_expiry);
> +        ide_delay_400ns();
> +        spin_unlock_irqrestore(&io_request_lock, flags);
> +       
>      return HWIF(drive)->ide_dma_count(drive);
>  }
>  
> diff -durbB linux-2.4.20/drivers/ide/ide-floppy.c 
> linux-2.4.20-p1/drivers/ide/ide-floppy.c
> --- linux-2.4.20/drivers/ide/ide-floppy.c    Thu Jan  9 11:14:01 2003
> +++ linux-2.4.20-p1/drivers/ide/ide-floppy.c    Wed Jan  8 16:15:17 2003
> @@ -1123,14 +1123,17 @@
>      }
>     
>      if (test_bit(IDEFLOPPY_DRQ_INTERRUPT, &floppy->flags)) {
> +                unsigned long flags;
>          if (HWGROUP(drive)->handler != NULL)
>              BUG();
> +        /* Issue the packet command */
> +                spin_lock_irqsave(&io_request_lock, flags);
> +        HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG);
>          ide_set_handler(drive,
>                  pkt_xfer_routine,
>                  IDEFLOPPY_WAIT_CMD,
>                  NULL);
> -        /* Issue the packet command */
> -        HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG);
> +                spin_unlock_irqrestore(&io_request_lock, flags);
>          return ide_started;
>      } else {
>          /* Issue the packet command */
> diff -durbB linux-2.4.20/drivers/ide/ide-io.c 
> linux-2.4.20-p1/drivers/ide/ide-io.c
> --- linux-2.4.20/drivers/ide/ide-io.c    Thu Jan  9 11:14:01 2003
> +++ linux-2.4.20-p1/drivers/ide/ide-io.c    Wed Jan  8 16:25:37 2003
> @@ -363,14 +363,21 @@
>  void ide_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, ide_handler_t *handler)
>  {
>      ide_hwif_t *hwif = HWIF(drive);
> +        unsigned long flags;
> +
>      if (HWGROUP(drive)->handler != NULL)
>          BUG();
> -    ide_set_handler(drive, handler, WAIT_CMD, NULL);
>      if (IDE_CONTROL_REG)
>          hwif->OUTB(drive->ctl,IDE_CONTROL_REG);    /* clear nIEN */
>      SELECT_MASK(drive,0);
>      hwif->OUTB(nsect,IDE_NSECTOR_REG);
> +
> +        spin_lock_irqsave(&io_request_lock, flags);
>      hwif->OUTB(cmd,IDE_COMMAND_REG);
> +    ide_set_handler_nolock(drive, handler, WAIT_CMD, NULL);
> +        ide_delay_400ns();
> +        spin_unlock_irqrestore(&io_request_lock, flags);
> +
>  }
>  
>  EXPORT_SYMBOL(ide_cmd);
> diff -durbB linux-2.4.20/drivers/ide/ide-iops.c 
> linux-2.4.20-p1/drivers/ide/ide-iops.c
> --- linux-2.4.20/drivers/ide/ide-iops.c    Thu Jan  9 11:14:01 2003
> +++ linux-2.4.20-p1/drivers/ide/ide-iops.c    Wed Jan  8 15:54:18 2003
> @@ -908,13 +908,14 @@
>   * timer is started to prevent us from waiting forever in case
>   * something goes wrong (see the ide_timer_expiry() handler later on).
>   */
> -void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
> +
> +/* This version doesn't get the spinlock, so you must call it with a 
> spinlock
> +   on io_request_lock. */
> +void ide_set_handler_nolock (ide_drive_t *drive, ide_handler_t *handler,
>                unsigned int timeout, ide_expiry_t *expiry)
>  {
> -    unsigned long flags;
>      ide_hwgroup_t *hwgroup = HWGROUP(drive);
>  
> -    spin_lock_irqsave(&io_request_lock, flags);
>      if (hwgroup->handler != NULL) {
>          printk("%s: ide_set_handler: handler not null; "
>              "old=%p, new=%p\n",
> @@ -924,6 +925,15 @@
>      hwgroup->expiry        = expiry;
>      hwgroup->timer.expires    = jiffies + timeout;
>      add_timer(&hwgroup->timer);
> +}
> +
> +/* This version grabs and releases the io_request_lock, so must be called
> +   with out the spinlock grabbed. */
> +void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
> +              unsigned int timeout, ide_expiry_t *expiry) {
> +    unsigned long flags;
> +    spin_lock_irqsave(&io_request_lock, flags);
> +        ide_set_handler_nolock(drive, handler, timeout, expiry);
>      spin_unlock_irqrestore(&io_request_lock, flags);
>  }
>  
> diff -durbB linux-2.4.20/drivers/ide/ide-tape.c 
> linux-2.4.20-p1/drivers/ide/ide-tape.c
> --- linux-2.4.20/drivers/ide/ide-tape.c    Thu Jan  9 11:14:01 2003
> +++ linux-2.4.20-p1/drivers/ide/ide-tape.c    Wed Jan  8 16:20:09 2003
> @@ -2457,13 +2457,17 @@
>          set_bit(PC_DMA_IN_PROGRESS, &pc->flags);
>  #endif /* CONFIG_BLK_DEV_IDEDMA */
>      if (test_bit(IDETAPE_DRQ_INTERRUPT, &tape->flags)) {
> +                unsigned long flags;
>          if (HWGROUP(drive)->handler != NULL)
>              BUG();
> -        ide_set_handler(drive,
> +
> +                spin_lock_irqsave(&io_request_lock, flags);
> +        HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG);
> +        ide_set_handler_nolock(drive,
>                  &idetape_transfer_pc,
>                  IDETAPE_WAIT_CMD,
>                  NULL);
> -        HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG);
> +                spin_unlock_irqrestore(&io_request_lock, flags);
>          return ide_started;
>      } else {
>          HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG);
> diff -durbB linux-2.4.20/drivers/ide/ide-taskfile.c 
> linux-2.4.20-p1/drivers/ide/ide-taskfile.c
> --- linux-2.4.20/drivers/ide/ide-taskfile.c    Thu Jan  9 11:14:01 2003
> +++ linux-2.4.20-p1/drivers/ide/ide-taskfile.c    Wed Jan  8 16:25:43 2003
> @@ -173,6 +173,7 @@
>      task_struct_t *taskfile    = (task_struct_t *) task->tfRegister;
>      hob_struct_t *hobfile    = (hob_struct_t *) task->hobRegister;
>      u8 HIHI            = (drive->addressing == 1) ? 0xE0 : 0xEF;
> +        unsigned long flags;
>  
>  #ifdef CONFIG_IDE_TASK_IOCTL_DEBUG
>      void debug_taskfile(drive, task);
> @@ -201,8 +202,14 @@
>  
>      hwif->OUTB((taskfile->device_head & HIHI) | drive->select.all, 
> IDE_SELECT_REG);
>      if (task->handler != NULL) {
> -        ide_set_handler(drive, task->handler, WAIT_WORSTCASE, NULL);
> +                spin_lock_irqsave(&io_request_lock, flags);
>          hwif->OUTB(taskfile->command, IDE_COMMAND_REG);
> +                /* We need to give the drive time to set the busy
> +                   flag, or we may mistake an interrupt from another drive
> +                   for the command completion on this drive. */
> +        ide_set_handler_nolock(drive, task->handler, WAIT_WORSTCASE, NULL);
> +                ide_delay_400ns();
> +                spin_unlock_irqrestore(&io_request_lock, flags);
>          if (task->prehandler != NULL)
>              return task->prehandler(drive, task->rq);
>          return ide_started;
> @@ -1832,6 +1839,7 @@
>      ide_hwif_t *hwif    = HWIF(drive);
>      task_struct_t *taskfile    = (task_struct_t *) task->tfRegister;
>      hob_struct_t *hobfile    = (hob_struct_t *) task->hobRegister;
> +        unsigned long flags;
>  #if DEBUG_TASKFILE
>      u8 status;
>  #endif
> @@ -1929,9 +1937,13 @@
>               if (task->handler == NULL)
>                  return ide_stopped;
>  
> -            ide_set_handler(drive, task->handler, WAIT_WORSTCASE, NULL);
> +                       
>              /* Issue the command */
> +                        spin_lock_irqsave(&io_request_lock, flags);
>              hwif->OUTB(taskfile->command, IDE_COMMAND_REG);
> +            ide_set_handler_nolock(drive, task->handler,
> +                                               WAIT_WORSTCASE, NULL);
> +                        spin_unlock_irqrestore(&io_request_lock, flags);
>              if (task->prehandler != NULL)
>                  return task->prehandler(drive, HWGROUP(drive)->rq);
>      }
> diff -durbB linux-2.4.20/include/asm-i386/ide.h 
> linux-2.4.20-p1/include/asm-i386/ide.h
> --- linux-2.4.20/include/asm-i386/ide.h    Thu Jan  9 11:17:05 2003
> +++ linux-2.4.20-p1/include/asm-i386/ide.h    Fri Jan 10 09:54:07 2003
> @@ -14,6 +14,7 @@
>  #ifdef __KERNEL__
>  
>  #include <linux/config.h>
> +#include <linux/delay.h>
>  
>  #ifndef MAX_HWIFS
>  # ifdef CONFIG_BLK_DEV_IDEPCI
> @@ -22,6 +23,16 @@
>  #define MAX_HWIFS    6
>  # endif
>  #endif
> +
> +
> +
> +/* The ATA spec requires 400ns delays all over the place. */
> +/* Do the same fixed point trick the udelay does to get our delay. */
> +#define IDE_DELAY_400NS
> +static __inline__ void ide_delay_400ns(void)
> +{
> +        __const_udelay (400 * 4);
> +}
>  
>  static __inline__ int ide_default_irq(ide_ioreg_t base)
>  {
> diff -durbB linux-2.4.20/include/linux/ide.h 
> linux-2.4.20-p1/include/linux/ide.h
> --- linux-2.4.20/include/linux/ide.h    Thu Jan  9 11:17:05 2003
> +++ linux-2.4.20-p1/include/linux/ide.h    Thu Jan  9 15:37:22 2003
> @@ -18,6 +18,7 @@
>  #include <linux/bitops.h>
>  #include <linux/highmem.h>
>  #include <linux/pci.h>
> +#include <linux/delay.h>
>  #include <asm/byteorder.h>
>  #include <asm/system.h>
>  #include <asm/hdreg.h>
> @@ -354,6 +355,11 @@
>  
>  #include <asm/ide.h>
>  
> +#ifndef IDE_DELAY_400NS
> +#define IDE_DELAY_400NS
> +static inline void ide_delay_400ns(void) { udelay(1); }
> +#endif
> +
>  /* Currently only m68k, apus and m8xx need it */
>  #ifdef IDE_ARCH_ACK_INTR
>  extern int ide_irq_lock;
> @@ -1282,6 +1288,7 @@
>   * and also to start the safety timer.
>   */
>  extern void ide_set_handler(ide_drive_t *, ide_handler_t *, unsigned 
> int, ide_expiry_t *);
> +extern void ide_set_handler_nolock(ide_drive_t *, ide_handler_t *, 
> unsigned int, ide_expiry_t *);
>  
>  /*
>   * Error reporting, in human readable form (luxurious, but a memory hog).
> 
> 

Andre Hedrick
LAD Storage Consulting Group


^ permalink raw reply

* RE: Power button doesn't give events (Asus TUSL2-C)
From: Jurgen Kramer @ 2003-01-10 20:13 UTC (permalink / raw)
  To: Grover, Andrew; +Cc: acpi-devel
In-Reply-To: <F760B14C9561B941B89469F59BA3A847137F5B-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>

On Fri, 2003-01-10 at 19:32, Grover, Andrew wrote:

> Does the output from /proc/interrupts list ACPI anywhere?

Output from cat /proc/interrupts:

           CPU0
  0:      43542    IO-APIC-edge  timer
  1:       1202    IO-APIC-edge  keyboard
  2:          0          XT-PIC  cascade
  8:          1    IO-APIC-edge  rtc
  9:       2186   IO-APIC-level  acpi
 14:      11092    IO-APIC-edge  ide0
 15:          2    IO-APIC-edge  ide1
 16:      31845   IO-APIC-level  nvidia
 18:       5752   IO-APIC-level  EMU10K1
 19:       5836   IO-APIC-level  usb-uhci
 20:   33097143   IO-APIC-level  eth0
 21:          1   IO-APIC-level  ohci1394
 23:          7   IO-APIC-level  usb-uhci, eth1
NMI:          0
LOC:      43492
ERR:          0
MIS:          0

> Does the interrupt count increase by 1 every time you press a power
> button?

The interrupt count from irq 9 doesn't change when a press the power
button. It doesn't seem the change ever. On my other working systems
(which are non APIC btw) the interrupt count for the ACPI irq changes
regularly.

> What does your dmesg say about discovered buttons?

[root@paragon root]# dmesg |grep Button
ACPI: Power Button (FF) [PWRF]

Hope this helps.

Cheers,

Jurgen





-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply

* Re: [parisc-linux] unaligned accesses
From: Thibaut VARENE @ 2003-01-10 22:13 UTC (permalink / raw)
  To: parisc-linux
In-Reply-To: <3E1AA8D500000AF7@ocpmta8.freegates.net>

On Fri, 10 Jan 2003 19:47:52 +0100
jsoe0708@tiscali.be wrote:

> 
> >-- Original Message --
> >Date: Fri, 10 Jan 2003 17:08:13 +0000
> >From: Matthew Wilcox <willy@debian.org>
> >To: jsoe0708@tiscali.be
> >Cc: Randolph Chung <randolph@tausq.org>,
> >	parisc-linux@lists.parisc-linux.org
> >Subject: Re: [parisc-linux] unaligned accesses
> >
> >
> >On Fri, Jan 10, 2003 at 11:51:41AM +0100, jsoe0708@tiscali.be wrote:
> >> PS:  with ext3 (which I use) problem I hesitate to install 2.4.20 and
> waiting
> >> for 2.4.21 and evms, jfs, xfs support for this system)
> >
> >um, you use the data=ordered mount option (or whatever it was)?
it was data=journal
see http://developers.slashdot.org/developers/02/12/02/0128206.shtml?tid=106

FWIW, the default option (used by most people) is data=journal, and is not affected by that bug. We've been using 2.4.20 with ext3 for weeks pretty safely here.


Thibaut VARENE
The PA/Linux ESIEE Team
http://pateam.esiee.fr/

^ permalink raw reply

* [2.5.55][PATCH] SB16 convertation to new PnP layer - Didn't work :(
From: Shawn Starr @ 2003-01-10 20:16 UTC (permalink / raw)
  To: Linux Kernel Mailing List

>From dmesg:

pnp: Calling quirk for 02:01.00
pnp: SB audio device quirk - increasing port range
pnp: Calling quirk for 02:01.02
pnp: AWE32 quirk - adding two ports
isapnp: No Plug & Play card found   <-- this is WRONG

Advanced Linux Sound Architecture Driver Version 0.9.0rc6 (Tue Dec 17 19:01:13 
2002 UTC).
pnp: the card driver 'opl3sa2' has been registered
pnp: the card driver 'sbawe' has been registered
pnp: pnp: match found with the PnP card '01:01' and the driver 'sbawe'
sbawe: isapnp configure failure (no device or busy)
ALSA device list:
  No soundcards found.

ALSA cannot find this model of the SBAWE32

Information from /sys:

/sys/bus/pnp_card/devices/01:01:

Name: Creative SB32 PnP
 
02:01.00/:

Name: Audio

Possible: (Priority preferred)

Dependent: 01 - Priority preferred
   port 0x220-0x220, align 0x0, size 0x10, 16-bit address decoding
   port 0x330-0x330, align 0x0, size 0x2, 16-bit address decoding
   port 0x388-0x3f8, align 0x0, size 0x4, 16-bit address decoding
   irq 5 High-Edge
   dma 1 8-bit byte-count compatible
   dma 5 16-bit word-count compatible

id: CTL0031

Resources: DISABLED

* NOTE: On this motherboard there is also a PnP ISA USRobotics modem which has 
a com port. When COM2 is enabled, this conflicts with the SBAWE32 IDE (which 
is known).

02:01.02/:

Name: WaveTable

Possible: (Priority preferred)

Dependent: 01 - Priority preferred
   port 0x620-0x620, align 0x0, size 0x4, 16-bit address decoding
   port 0xa20-0xa20, align 0x0, size 0x4, 16-bit address decoding
   port 0xe20-0xe20, align 0x0, size 0x4, 16-bit address decoding

id: CTL0021

Resources: DISABLED

There are other components on this card such as the EIDE control but this 
broken right now ;-) they have been omitted from this email


-- 
Shawn Starr
UNIX Systems Administrator, Operations
Datawire Communication Networks Inc.
10 Carlson Court, Suite 300
Toronto, ON, M9W 6L2
T: 416-213-2001 ext 179  F: 416-213-2008
shawn.starr@datawire.net
"The power to Transact" - http://www.datawire.net


^ permalink raw reply

* Re: netfilter digest, Vol 1 #514 - 7 msgs (was Re: portforwarding-HOWTO)
From: Joel Newkirk @ 2003-01-10 20:07 UTC (permalink / raw)
  To: oarojo, netfilter
In-Reply-To: <14780.192.168.0.1.1042018341.squirrel@mail.intermediacorp.com>

On Wednesday 08 January 2003 04:32 am, oarojo@intermediacorp.com wrote:
> Yes I'm using telnet from other network...

Please snip unrelated material out of a digest message when replying - 
the other six messages had nothing to do with this...  A single-line 
response with over 450 quoted lines is a big waste, especially since you 
didn't sign the response making it appear that there might be more you 
had added further on in the quoted part.

Also, you don't answer the first question I posed, or the one another 
helpful participant offered.  

You said you have a mail server behind your firewall and are trying to 
DNAT connections to it from the internet.  You listed two DNAT rules 
(which appeared correct) and two FORWARD rules to let the traffic reach 
the mail server.  (which also appeared correct)

Since you don't offer much detail apart from this about the setup, we 
asked if you have a rule allowing the return traffic back through the 
FORWARD chain, and whether you have forwarding enabled with:
echo "1" > /proc/sys/net/ipv4/ip_forward
At least that's what I believe the other reply meant.  He actually asked 
"Did you turn on Masquerading?", but MASQUERADE in iptables syntax is a 
form of SNAT, while Masquerade in general is simply NAT used to hide 
multiple machines, neither of which has any direct bearing on DNAT to a 
mailserver, so I'm making a guess as to what the question really 
intended.  

Finally, you said you try telnetting to the IP, port 25, and get no 
response.  Is there a service running on the mailserver that is properly 
configured to respond to a telnet connection to port 25 from the 
internet?  If this is the only DNAT you are attempting so far, you might 
be better served trying it to port 80 with apache running on 
192.168.0.5, until you confirm that your DNAT and FORWARD rules and 
everything else are working as expected, THEN change over to port 25/110 
with mail server (sendmail?) running and that way any failure at that 
last step is then very likely a problem with mail configuration, rather 
than firewall DNAT and forwarding.

j

> > Do you have a FORWARD rule to allow return traffic back out?  You
> > don't=20 mention one, so I have to ask.  Something like this would
> > work, if no=20 other more general rule allows it:
> >
> > iptables -A FORWARD -p tcp -o eth0 -s 192.168.0.5 -m multiport  \
> > --sport 25,110 -j ACCEPT
> >
> > Are you trying to telnet from outside the network?  If you are
> > trying to=20 do it from the firewall box or from anywhere on the
> > 192.168 network it=20 will fail unless you have other rules to help
> > 'guide' the traffic back=20 through the firewall.  (of course the
> > rules you list are presumably for=20 traffice from outside...)  See
> > Oskar's tutorial's DNAT info at:
> > http://iptables-tutorial.frozentux.net/chunkyhtml/targets.html#DNATT
> >ARGET where he explains the problem and the solution, if you need to
> > allow=20 access from the local network or firewall.




^ permalink raw reply

* [parisc-linux] Generic RTC driver in 2.4.x
From: Geert Uytterhoeven @ 2003-01-10 20:05 UTC (permalink / raw)
  To: Alan Cox, parisc-linux, Linux/PPC Development
  Cc: Linux Kernel Development, Linux/m68k
In-Reply-To: <Pine.GSO.4.21.0301051535430.10519-100000@vervain.sonytel.be>

Unfortunately I didn't receive any feedback from the pa-risc and ppc people
after my previous posting last Sunday.

Alan, I'm explicitly sending it to you for inclusion in your ac tree.
I intend to send it to Marcelo after the weekend.

Changes since last Sunday:
  - fix spelling of `automatically' (from Geoffrey Lee <glee@gnupilgrims.org>)
  - misc_register() and create_proc_read_entry() can fail
    (from mikal@stillhq.com in 2.5.x)
  - create_proc_read_entry() depends on CONFIG_PROC_FS
    (from mikal@stillhq.com in 2.5.x)


The following patch adds the generic RTC driver to 2.4.20 (applies fine to
2.4.21-pre3). This driver provides a /dev/rtc-compatible interface to the real
time clock on machines without a PC-style RTC chip. It is used as the primary
RTC driver on m68k, pa-risc, and ppc. This driver is already present in 2.5.x.

Pa-risc and ppc people (any other users?), please send me your enhancements (or
just ack if none are necessary), so I can send genrtc to Marcelo.

Thanks!

 Documentation/Configure.help  |   28 ++
 arch/m68k/config.in           |    5 
 arch/m68k/kernel/m68k_ksyms.c |    5 
 arch/m68k/kernel/setup.c      |    3 
 arch/m68k/q40/config.c        |   41 +++
 drivers/char/Makefile         |    1 
 drivers/char/genrtc.c         |  533 ++++++++++++++++++++++++++++++++++++++++++
 include/asm-m68k/machdep.h    |    4 
 include/asm-m68k/rtc.h        |   44 +++
 include/linux/rtc.h           |   28 ++
 10 files changed, 687 insertions(+), 5 deletions(-)

--- linux-2.4.20/Documentation/Configure.help	Tue Oct 29 18:40:45 2002
+++ linux-genrtc-2.4.20/Documentation/Configure.help	Fri Jan 10 20:54:52 2003
@@ -18959,6 +18959,34 @@
   The module is called rtc.o. If you want to compile it as a module,
   say M here and read <file:Documentation/modules.txt>.
 
+Generic Real Time Clock Support
+CONFIG_GEN_RTC
+  If you say Y here and create a character special file /dev/rtc with
+  major number 10 and minor number 135 using mknod ("man mknod"), you
+  will get access to the real time clock (or hardware clock) built
+  into your computer.
+
+  In 2.4 and later kernels this is the only way to set and get rtc
+  time on m68k systems so it is highly recommended.
+
+  It reports status information via the file /proc/driver/rtc and its 
+  behaviour is set by various ioctls on /dev/rtc. If you enable the
+  "extended RTC operation" below it will also provide an emulation
+  for RTC_UIE which is required by some programs and may improve
+  precision in some cases.
+
+  This driver is also available as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want).
+  The module is called genrtc.o. If you want to compile it as a module,
+  say M here and read <file:Documentation/modules.txt>. To load the
+  module automatically add 'alias char-major-10-135 genrtc' to your
+  /etc/modules.conf
+
+Extended RTC operation
+CONFIG_GEN_RTC_X
+  Provides an emulation for RTC_UIE which is required by some programs 
+  and may improve precision of the generic RTC support in some cases.
+
 Tadpole ANA H8 Support
 CONFIG_H8
   The Hitachi H8/337 is a microcontroller used to deal with the power
--- linux-2.4.20/arch/m68k/config.in	Fri Sep 13 10:14:59 2002
+++ linux-genrtc-2.4.20/arch/m68k/config.in	Fri Jan 10 20:54:25 2003
@@ -517,8 +517,11 @@
    if [ "$CONFIG_SUN3" = "y" ]; then
       define_bool CONFIG_GEN_RTC y
    else
-      bool 'Generic /dev/rtc emulation' CONFIG_GEN_RTC
+      tristate 'Generic /dev/rtc emulation' CONFIG_GEN_RTC      
    fi
+fi
+if [ "$CONFIG_GEN_RTC" != "n" ]; then
+   bool '   Extended RTC operation' CONFIG_GEN_RTC_X
 fi
 bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
 if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
--- linux-2.4.20/arch/m68k/kernel/m68k_ksyms.c	Thu Jan  4 22:00:55 2001
+++ linux-genrtc-2.4.20/arch/m68k/kernel/m68k_ksyms.c	Fri Jan 10 20:54:25 2003
@@ -18,6 +18,7 @@
 #include <asm/checksum.h>
 #include <asm/hardirq.h>
 #include <asm/softirq.h>
+#include <asm/rtc.h>
 
 asmlinkage long long __ashldi3 (long long, int);
 asmlinkage long long __ashrdi3 (long long, int);
@@ -49,6 +50,10 @@
 EXPORT_SYMBOL(kernel_set_cachemode);
 #endif /* !CONFIG_SUN3 */
 EXPORT_SYMBOL(m68k_debug_device);
+EXPORT_SYMBOL(mach_hwclk);
+EXPORT_SYMBOL(mach_get_ss);
+EXPORT_SYMBOL(mach_get_rtc_pll);
+EXPORT_SYMBOL(mach_set_rtc_pll);
 EXPORT_SYMBOL(dump_fpu);
 EXPORT_SYMBOL(dump_thread);
 EXPORT_SYMBOL(strnlen);
--- linux-2.4.20/arch/m68k/kernel/setup.c	Fri Sep 13 10:15:01 2002
+++ linux-genrtc-2.4.20/arch/m68k/kernel/setup.c	Fri Jan 10 20:54:25 2003
@@ -90,6 +90,9 @@
 void (*mach_gettod) (int*, int*, int*, int*, int*, int*);
 int (*mach_hwclk) (int, struct rtc_time*) = NULL;
 int (*mach_set_clock_mmss) (unsigned long) = NULL;
+unsigned int (*mach_get_ss)(void) = NULL;
+int (*mach_get_rtc_pll)(struct rtc_pll_info *) = NULL;
+int (*mach_set_rtc_pll)(struct rtc_pll_info *) = NULL;
 void (*mach_reset)( void );
 void (*mach_halt)( void ) = NULL;
 void (*mach_power_off)( void ) = NULL;
--- linux-2.4.20/arch/m68k/q40/config.c	Fri Sep 13 10:15:02 2002
+++ linux-genrtc-2.4.20/arch/m68k/q40/config.c	Fri Jan 10 20:54:25 2003
@@ -58,7 +58,10 @@
 extern void q40_gettod (int *year, int *mon, int *day, int *hour,
                            int *min, int *sec);
 extern int q40_hwclk (int, struct rtc_time *);
+extern unsigned int q40_get_ss (void);
 extern int q40_set_clock_mmss (unsigned long);
+static int q40_get_rtc_pll(struct rtc_pll_info *pll);
+static int q40_set_rtc_pll(struct rtc_pll_info *pll);
 extern void q40_reset (void);
 void q40_halt(void);
 extern void q40_waitbut(void);
@@ -196,6 +199,9 @@
     mach_gettimeoffset   = q40_gettimeoffset; 
     mach_gettod  	 = q40_gettod;
     mach_hwclk           = q40_hwclk; 
+    mach_get_ss          = q40_get_ss; 
+    mach_get_rtc_pll     = q40_get_rtc_pll; 
+    mach_set_rtc_pll     = q40_set_rtc_pll; 
     mach_set_clock_mmss	 = q40_set_clock_mmss;
 
     mach_reset		 = q40_reset;
@@ -331,6 +337,11 @@
 	return 0;
 }
 
+unsigned int q40_get_ss()
+{
+	return bcd2bin(Q40_RTC_SECS);
+}
+
 /*
  * Set the minutes and seconds from seconds value 'nowtime'.  Fail if
  * clock is out by > 30 minutes.  Logic lifted from atari code.
@@ -362,3 +373,33 @@
 	return retval;
 }
 
+
+/* get and set PLL calibration of RTC clock */
+#define Q40_RTC_PLL_MASK ((1<<5)-1)
+#define Q40_RTC_PLL_SIGN (1<<5)
+
+static int q40_get_rtc_pll(struct rtc_pll_info *pll)
+{
+      int tmp=Q40_RTC_CTRL;
+      pll->pll_value = tmp & Q40_RTC_PLL_MASK;
+      if (tmp & Q40_RTC_PLL_SIGN) 
+	  pll->pll_value = -pll->pll_value;
+      pll->pll_max=31;
+      pll->pll_min=-31;
+      pll->pll_posmult=512;
+      pll->pll_negmult=256;
+      pll->pll_clock=125829120;
+      return 0;
+  }
+
+static int q40_set_rtc_pll(struct rtc_pll_info *pll)
+{
+  if (!pll->pll_ctrl){
+      /* the docs are a bit unclear so I am doublesetting RTC_WRITE here ... */
+      int tmp=(pll->pll_value & 31) | (pll->pll_value<0 ? 32 : 0) | Q40_RTC_WRITE;
+      Q40_RTC_CTRL |= Q40_RTC_WRITE;
+      Q40_RTC_CTRL = tmp;
+      Q40_RTC_CTRL &= ~(Q40_RTC_WRITE);
+      return 0;
+  } else return -EINVAL;
+}
--- linux-2.4.20/drivers/char/Makefile	Wed Nov 27 11:02:06 2002
+++ linux-genrtc-2.4.20/drivers/char/Makefile	Fri Jan 10 20:54:25 2003
@@ -222,6 +222,7 @@
 obj-$(CONFIG_PC110_PAD) += pc110pad.o
 obj-$(CONFIG_MK712_MOUSE) += mk712.o
 obj-$(CONFIG_RTC) += rtc.o
+obj-$(CONFIG_GEN_RTC) += genrtc.o
 obj-$(CONFIG_EFI_RTC) += efirtc.o
 ifeq ($(CONFIG_PPC),)
   obj-$(CONFIG_NVRAM) += nvram.o
--- linux-2.4.20/drivers/char/genrtc.c	Thu Jan  1 01:00:00 1970
+++ linux-genrtc-2.4.20/drivers/char/genrtc.c	Fri Jan 10 20:54:52 2003
@@ -0,0 +1,533 @@
+/*
+ *	Real Time Clock interface for q40 and other m68k machines
+ *      emulate some RTC irq capabilities in software
+ *
+ *      Copyright (C) 1999 Richard Zidlicky
+ *
+ *	based on Paul Gortmaker's rtc.c device and
+ *           Sam Creasey Generic rtc driver
+ *
+ *	This driver allows use of the real time clock (built into
+ *	nearly all computers) from user space. It exports the /dev/rtc
+ *	interface supporting various ioctl() and also the /proc/dev/rtc
+ *	pseudo-file for status information.
+ *
+ *	The ioctls can be used to set the interrupt behaviour where
+ *  supported.
+ *
+ *	The /dev/rtc interface will block on reads until an interrupt
+ *	has been received. If a RTC interrupt has already happened,
+ *	it will output an unsigned long and then block. The output value
+ *	contains the interrupt status in the low byte and the number of
+ *	interrupts since the last read in the remaining high bytes. The
+ *	/dev/rtc interface can also be used with the select(2) call.
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ *
+
+ *      1.01 fix for 2.3.X                    rz@linux-m68k.org
+ *      1.02 merged with code from genrtc.c   rz@linux-m68k.org
+ *      1.03 make it more portable            zippel@linux-m68k.org
+ *      1.04 removed useless timer code       rz@linux-m68k.org
+ *      1.05 portable RTC_UIE emulation       rz@linux-m68k.org
+ *      1.06 set_rtc_time can return an error trini@kernel.crashing.org
+ */
+
+#define RTC_VERSION	"1.06"
+
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/errno.h>
+#include <linux/miscdevice.h>
+#include <linux/fcntl.h>
+
+#include <linux/rtc.h>
+#include <linux/init.h>
+#include <linux/poll.h>
+#include <linux/proc_fs.h>
+
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/rtc.h>
+
+/*
+ *	We sponge a minor off of the misc major. No need slurping
+ *	up another valuable major dev number for this. If you add
+ *	an ioctl, make sure you don't conflict with SPARC's RTC
+ *	ioctls.
+ */
+
+static DECLARE_WAIT_QUEUE_HEAD(gen_rtc_wait);
+
+static int gen_rtc_ioctl(struct inode *inode, struct file *file,
+		     unsigned int cmd, unsigned long arg);
+
+/*
+ *	Bits in gen_rtc_status.
+ */
+
+#define RTC_IS_OPEN		0x01	/* means /dev/rtc is in use	*/
+
+unsigned char gen_rtc_status;		/* bitmapped status byte.	*/
+unsigned long gen_rtc_irq_data;		/* our output to the world	*/
+
+/* months start at 0 now */
+unsigned char days_in_mo[] =
+{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+static int irq_active;
+
+#ifdef CONFIG_GEN_RTC_X
+struct tq_struct genrtc_task;
+static struct timer_list timer_task;
+
+static unsigned int oldsecs;
+static int lostint;
+static int tt_exp;
+
+void gen_rtc_timer(unsigned long data);
+
+static volatile int stask_active;              /* schedule_task */
+static volatile int ttask_active;              /* timer_task */
+static int stop_rtc_timers;                    /* don't requeue tasks */
+static spinlock_t gen_rtc_lock = SPIN_LOCK_UNLOCKED;
+
+/*
+ * Routine to poll RTC seconds field for change as often as posible,
+ * after first RTC_UIE use timer to reduce polling
+ */
+void genrtc_troutine(void *data)
+{
+	unsigned int tmp = get_rtc_ss();
+	
+	if (stop_rtc_timers) {
+		stask_active = 0;
+		return;
+	}
+
+	if (oldsecs != tmp){
+		oldsecs = tmp;
+
+		timer_task.function = gen_rtc_timer;
+		timer_task.expires = jiffies + HZ - (HZ/10);
+		tt_exp=timer_task.expires;
+		ttask_active=1;
+		stask_active=0;
+		add_timer(&timer_task);
+
+		gen_rtc_interrupt(0);
+	} else if (schedule_task(&genrtc_task) == 0)
+		stask_active = 0;
+}
+
+void gen_rtc_timer(unsigned long data)
+{
+	lostint = get_rtc_ss() - oldsecs ;
+	if (lostint<0) 
+		lostint = 60 - lostint;
+	if (time_after(jiffies, tt_exp))
+		printk(KERN_INFO "genrtc: timer task delayed by %ld jiffies\n",
+		       jiffies-tt_exp);
+	ttask_active=0;
+	stask_active=1;
+	if ((schedule_task(&genrtc_task) == 0))
+		stask_active = 0;
+}
+
+/* 
+ * call gen_rtc_interrupt function to signal an RTC_UIE,
+ * arg is unused.
+ * Could be invoked either from a real interrupt handler or
+ * from some routine that periodically (eg 100HZ) monitors
+ * whether RTC_SECS changed
+ */
+void gen_rtc_interrupt(unsigned long arg)
+{
+	/*  We store the status in the low byte and the number of
+	 *	interrupts received since the last read in the remainder
+	 *	of rtc_irq_data.  */
+
+	gen_rtc_irq_data += 0x100;
+	gen_rtc_irq_data &= ~0xff;
+	gen_rtc_irq_data |= RTC_UIE;
+
+	if (lostint){
+		printk("genrtc: system delaying clock ticks?\n");
+		/* increment count so that userspace knows something is wrong */
+		gen_rtc_irq_data += ((lostint-1)<<8);
+		lostint = 0;
+	}
+
+	wake_up_interruptible(&gen_rtc_wait);
+}
+
+/*
+ *	Now all the various file operations that we export.
+ */
+static ssize_t gen_rtc_read(struct file *file, char *buf,
+			size_t count, loff_t *ppos)
+{
+	DECLARE_WAITQUEUE(wait, current);
+	unsigned long data;
+	ssize_t retval;
+
+	if (count != sizeof (unsigned int) && count != sizeof (unsigned long))
+		return -EINVAL;
+
+	if (file->f_flags & O_NONBLOCK && !gen_rtc_irq_data)
+		return -EAGAIN;
+
+	add_wait_queue(&gen_rtc_wait, &wait);
+	retval = -ERESTARTSYS;
+
+	while (1) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		data = xchg(&gen_rtc_irq_data, 0);
+		if (data)
+			break;
+		if (signal_pending(current))
+			goto out;
+		schedule();
+	}
+
+	/* first test allows optimizer to nuke this case for 32-bit machines */
+	if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) {
+		unsigned int uidata = data;
+		retval = put_user(uidata, (unsigned long *)buf);
+	}
+	else {
+		retval = put_user(data, (unsigned long *)buf);
+	}
+	if (!retval)
+		retval = sizeof(unsigned long);
+ out:
+	current->state = TASK_RUNNING;
+	remove_wait_queue(&gen_rtc_wait, &wait);
+
+	return retval;
+}
+
+static unsigned int gen_rtc_poll(struct file *file,
+				 struct poll_table_struct *wait)
+{
+	poll_wait(file, &gen_rtc_wait, wait);
+	if (gen_rtc_irq_data != 0)
+		return POLLIN | POLLRDNORM;
+	return 0;
+}
+
+#endif
+
+/*
+ * Used to disable/enable interrupts, only RTC_UIE supported
+ * We also clear out any old irq data after an ioctl() that
+ * meddles with the interrupt enable/disable bits.
+ */
+
+static inline void gen_clear_rtc_irq_bit(unsigned char bit)
+{
+#ifdef CONFIG_GEN_RTC_X
+	stop_rtc_timers = 1;
+	if (ttask_active){
+		del_timer_sync(&timer_task);
+		ttask_active = 0;
+	}
+	while (stask_active)
+		schedule();
+
+	spin_lock(&gen_rtc_lock);
+	irq_active = 0;
+	spin_unlock(&gen_rtc_lock);
+#endif
+}
+
+static inline int gen_set_rtc_irq_bit(unsigned char bit)
+{
+#ifdef CONFIG_GEN_RTC_X
+	spin_lock(&gen_rtc_lock);
+	if ( !irq_active ) {
+		irq_active = 1;
+		stop_rtc_timers = 0;
+		lostint = 0;
+		genrtc_task.routine = genrtc_troutine;
+		oldsecs = get_rtc_ss();
+		init_timer(&timer_task);
+
+		stask_active = 1;
+		if (schedule_task(&genrtc_task) == 0){
+			stask_active = 0;
+		}
+	}
+	spin_unlock(&gen_rtc_lock);
+	gen_rtc_irq_data = 0;
+	return 0;
+#else
+	return -EINVAL;
+#endif
+}
+
+static int gen_rtc_ioctl(struct inode *inode, struct file *file,
+			 unsigned int cmd, unsigned long arg)
+{
+	struct rtc_time wtime;
+	struct rtc_pll_info pll;
+
+	switch (cmd) {
+
+	case RTC_PLL_GET:
+	    if (get_rtc_pll(&pll))
+	 	    return -EINVAL;
+	    else
+		    return copy_to_user((void *)arg, &pll, sizeof pll) ? -EFAULT : 0;
+
+	case RTC_PLL_SET:
+		if (!capable(CAP_SYS_TIME))
+			return -EACCES;
+		if (copy_from_user(&pll, (struct rtc_pll_info*)arg,
+				   sizeof(pll)))
+			return -EFAULT;
+	    return set_rtc_pll(&pll);
+
+	case RTC_UIE_OFF:	/* disable ints from RTC updates.	*/
+		gen_clear_rtc_irq_bit(RTC_UIE);
+		return 0;
+
+	case RTC_UIE_ON:	/* enable ints for RTC updates.	*/
+	        return gen_set_rtc_irq_bit(RTC_UIE);
+
+	case RTC_RD_TIME:	/* Read the time/date from RTC	*/
+		/* this doesn't get week-day, who cares */
+		memset(&wtime, 0, sizeof(wtime));
+		get_rtc_time(&wtime);
+
+		return copy_to_user((void *)arg, &wtime, sizeof(wtime)) ? -EFAULT : 0;
+
+	case RTC_SET_TIME:	/* Set the RTC */
+	    {
+		int year;
+		unsigned char leap_yr;
+
+		if (!capable(CAP_SYS_TIME))
+			return -EACCES;
+
+		if (copy_from_user(&wtime, (struct rtc_time *)arg,
+				   sizeof(wtime)))
+			return -EFAULT;
+
+		year = wtime.tm_year + 1900;
+		leap_yr = ((!(year % 4) && (year % 100)) ||
+			   !(year % 400));
+
+		if ((wtime.tm_mon < 0 || wtime.tm_mon > 11) || (wtime.tm_mday < 1))
+			return -EINVAL;
+
+		if (wtime.tm_mday < 0 || wtime.tm_mday >
+		    (days_in_mo[wtime.tm_mon] + ((wtime.tm_mon == 1) && leap_yr)))
+			return -EINVAL;
+
+		if (wtime.tm_hour < 0 || wtime.tm_hour >= 24 ||
+		    wtime.tm_min < 0 || wtime.tm_min >= 60 ||
+		    wtime.tm_sec < 0 || wtime.tm_sec >= 60)
+			return -EINVAL;
+
+		return set_rtc_time(&wtime);
+	    }
+	}
+
+	return -EINVAL;
+}
+
+/*
+ *	We enforce only one user at a time here with the open/close.
+ *	Also clear the previous interrupt data on an open, and clean
+ *	up things on a close.
+ */
+
+static int gen_rtc_open(struct inode *inode, struct file *file)
+{
+	if (gen_rtc_status & RTC_IS_OPEN)
+		return -EBUSY;
+
+	MOD_INC_USE_COUNT;
+
+	gen_rtc_status |= RTC_IS_OPEN;
+	gen_rtc_irq_data = 0;
+	irq_active = 0;
+
+	return 0;
+}
+
+static int gen_rtc_release(struct inode *inode, struct file *file)
+{
+	/*
+	 * Turn off all interrupts once the device is no longer
+	 * in use and clear the data.
+	 */
+
+	gen_clear_rtc_irq_bit(RTC_PIE|RTC_AIE|RTC_UIE);
+
+	gen_rtc_status &= ~RTC_IS_OPEN;
+	MOD_DEC_USE_COUNT;
+
+	return 0;
+}
+
+static int gen_rtc_read_proc(char *page, char **start, off_t off,
+			     int count, int *eof, void *data);
+
+
+/*
+ *	The various file operations we support.
+ */
+
+static struct file_operations gen_rtc_fops = {
+	owner:		THIS_MODULE,
+#ifdef CONFIG_GEN_RTC_X
+	read:		gen_rtc_read,
+	poll:		gen_rtc_poll,
+#endif
+	ioctl:		gen_rtc_ioctl,
+	open:		gen_rtc_open,
+	release:	gen_rtc_release
+};
+
+static struct miscdevice rtc_gen_dev =
+{
+	RTC_MINOR,
+	"rtc",
+	&gen_rtc_fops
+};
+
+int __init rtc_generic_init(void)
+{
+	int retval;
+
+	printk(KERN_INFO "Generic RTC Driver v%s\n", RTC_VERSION);
+
+	retval = misc_register(&rtc_gen_dev);
+	if(retval < 0)
+		return retval;
+
+#ifdef CONFIG_PROC_FS
+	if((create_proc_read_entry ("driver/rtc", 0, 0, gen_rtc_read_proc, NULL)) == NULL){
+		misc_deregister(&rtc_gen_dev);
+		return -ENOMEM;
+	}
+#endif
+
+	return 0;
+}
+
+static void __exit rtc_generic_exit(void)
+{
+	remove_proc_entry ("driver/rtc", NULL);
+	misc_deregister(&rtc_gen_dev);
+}
+
+module_init(rtc_generic_init);
+module_exit(rtc_generic_exit);
+EXPORT_NO_SYMBOLS;
+
+
+/*
+ *	Info exported via "/proc/rtc".
+ */
+
+int gen_rtc_proc_output(char *buf)
+{
+	char *p;
+	struct rtc_time tm;
+	unsigned tmp;
+	struct rtc_pll_info pll;
+
+	p = buf;
+
+	get_rtc_time(&tm);
+
+	p += sprintf(p,
+		     "rtc_time\t: %02d:%02d:%02d\n"
+		     "rtc_date\t: %04d-%02d-%02d\n"
+		     "rtc_epoch\t: %04u\n",
+		     tm.tm_hour, tm.tm_min, tm.tm_sec,
+		     tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, 1900);
+
+	tm.tm_hour=0;tm.tm_min=0;tm.tm_sec=0;
+
+	p += sprintf(p, "alarm\t\t: ");
+	if (tm.tm_hour <= 24)
+		p += sprintf(p, "%02d:", tm.tm_hour);
+	else
+		p += sprintf(p, "**:");
+
+	if (tm.tm_min <= 59)
+		p += sprintf(p, "%02d:", tm.tm_min);
+	else
+		p += sprintf(p, "**:");
+
+	if (tm.tm_sec <= 59)
+		p += sprintf(p, "%02d\n", tm.tm_sec);
+	else
+		p += sprintf(p, "**\n");
+
+	tmp= RTC_24H ;
+	p += sprintf(p,
+		     "DST_enable\t: %s\n"
+		     "BCD\t\t: %s\n"
+		     "24hr\t\t: %s\n"
+		     "square_wave\t: %s\n"
+		     "alarm_IRQ\t: %s\n"
+		     "update_IRQ\t: %s\n"
+		     "periodic_IRQ\t: %s\n"
+		     "periodic_freq\t: %ld\n"
+		     "batt_status\t: %s\n",
+		     (tmp & RTC_DST_EN) ? "yes" : "no",
+		     (tmp & RTC_DM_BINARY) ? "no" : "yes",
+		     (tmp & RTC_24H) ? "yes" : "no",
+		     (tmp & RTC_SQWE) ? "yes" : "no",
+		     (tmp & RTC_AIE) ? "yes" : "no",
+		     irq_active ? "yes" : "no",
+		     (tmp & RTC_PIE) ? "yes" : "no",
+		     0L /* freq */,
+		     "okay" );
+	if (!get_rtc_pll(&pll))
+	    p += sprintf(p,
+			 "PLL adjustment\t: %d\n"
+			 "PLL max +ve adjustment\t: %d\n"
+			 "PLL max -ve adjustment\t: %d\n"
+			 "PLL +ve adjustment factor\t: %d\n"
+			 "PLL -ve adjustment factor\t: %d\n"
+			 "PLL frequency\t: %ld\n",
+			 pll.pll_value,
+			 pll.pll_max,
+			 pll.pll_min,
+			 pll.pll_posmult,
+			 pll.pll_negmult,
+			 pll.pll_clock);
+	return  p - buf;
+}
+
+static int gen_rtc_read_proc(char *page, char **start, off_t off,
+			     int count, int *eof, void *data)
+{
+	int len = gen_rtc_proc_output (page);
+        if (len <= off+count) *eof = 1;
+	*start = page + off;
+	len -= off;
+        if (len>count) len = count;
+        if (len<0) len = 0;
+	return len;
+}
+
+
+MODULE_AUTHOR("Richard Zidlicky");
+MODULE_LICENSE("GPL");
+
+/*
+ * Local variables:
+ * compile-command: "m68k-linux-gcc -D__KERNEL__ -I../../include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -ffixed-a2 -c -o genrtc.o genrtc.c"
+ * End:
+ */
+
--- linux-2.4.20/include/asm-m68k/machdep.h	Wed May 29 10:14:12 2002
+++ linux-genrtc-2.4.20/include/asm-m68k/machdep.h	Fri Jan 10 20:54:25 2003
@@ -5,6 +5,7 @@
 struct kbd_repeat;
 struct mktime;
 struct rtc_time;
+struct rtc_pll_info;
 struct gendisk;
 struct buffer_head;
 
@@ -29,6 +30,9 @@
 extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour,
 			   int *min, int *sec);
 extern int (*mach_hwclk)(int, struct rtc_time*);
+extern unsigned int (*mach_get_ss)(void);
+extern int (*mach_get_rtc_pll)(struct rtc_pll_info *);
+extern int (*mach_set_rtc_pll)(struct rtc_pll_info *);
 extern int (*mach_set_clock_mmss)(unsigned long);
 extern void (*mach_reset)( void );
 extern void (*mach_halt)( void );
--- linux-2.4.20/include/asm-m68k/rtc.h	Wed May 29 10:14:13 2002
+++ linux-genrtc-2.4.20/include/asm-m68k/rtc.h	Fri Jan 10 20:54:25 2003
@@ -13,9 +13,8 @@
 
 #ifdef __KERNEL__
 
-#include <linux/config.h>
 #include <linux/rtc.h>
-#include <linux/delay.h>
+#include <asm/errno.h>
 #include <asm/machdep.h>
 
 #define RTC_PIE 0x40		/* periodic interrupt enable */
@@ -30,7 +29,48 @@
 #define RTC_24H 0x02		/* 24 hour mode - else hours bit 7 means pm */
 #define RTC_DST_EN 0x01	        /* auto switch DST - works f. USA only */
 
+static inline void get_rtc_time(struct rtc_time *time)
+{
+	/*
+	 * Only the values that we read from the RTC are set. We leave
+	 * tm_wday, tm_yday and tm_isdst untouched. Even though the
+	 * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated
+	 * by the RTC when initially set to a non-zero value.
+	 */
+	mach_hwclk(0, time);
+}
 
+static inline int set_rtc_time(struct rtc_time *time)
+{
+	return mach_hwclk(1, time);
+}
+
+static inline unsigned int get_rtc_ss(void)
+{
+	if (mach_get_ss)
+		return mach_get_ss();
+	else{
+		struct rtc_time h;
+		
+		get_rtc_time(&h);
+		return h.tm_sec;
+	}
+}
+
+static inline int get_rtc_pll(struct rtc_pll_info *pll)
+{
+	if (mach_get_rtc_pll)
+		return mach_get_rtc_pll(pll);
+	else
+		return -EINVAL;
+}
+static inline int set_rtc_pll(struct rtc_pll_info *pll)
+{
+	if (mach_set_rtc_pll)
+		return mach_set_rtc_pll(pll);
+	else
+		return -EINVAL;
+}
 #endif /* __KERNEL__ */
 
 #endif /* _ASM__RTC_H */
--- linux-2.4.20/include/linux/rtc.h	Mon Feb 19 09:47:19 2001
+++ linux-genrtc-2.4.20/include/linux/rtc.h	Fri Jan 10 20:54:25 2003
@@ -39,10 +39,32 @@
 	struct rtc_time time;	/* time the alarm is set to */
 };
 
+/*
+ * Data structure to control PLL correction some better RTC feature
+ * pll_value is used to get or set current value of correction,
+ * the rest of the struct is used to query HW capabilities.
+ * This is modeled after the RTC used in Q40/Q60 computers but
+ * should be sufficiently flexible for other devices
+ *
+ * +ve pll_value means clock will run faster by
+ *   pll_value*pll_posmult/pll_clock
+ * -ve pll_value means clock will run slower by
+ *   pll_value*pll_negmult/pll_clock
+ */ 
+
+struct rtc_pll_info {
+	int pll_ctrl;       /* placeholder for fancier control */
+	int pll_value;      /* get/set correction value */
+	int pll_max;        /* max +ve (faster) adjustment value */
+	int pll_min;        /* max -ve (slower) adjustment value */
+	int pll_posmult;    /* factor for +ve corection */
+	int pll_negmult;    /* factor for -ve corection */
+	long pll_clock;     /* base PLL frequency */
+};
 
 /*
- * ioctl calls that are permitted to the /dev/rtc interface, if 
- * CONFIG_RTC/CONFIG_EFI_RTC was enabled.
+ * ioctl calls that are permitted to the /dev/rtc interface, if
+ * any of the RTC drivers are enabled.
  */
 
 #define RTC_AIE_ON	_IO('p', 0x01)	/* Alarm int. enable on		*/
@@ -66,4 +88,6 @@
 #define RTC_WKALM_SET	_IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/
 #define RTC_WKALM_RD	_IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/
 
+#define RTC_PLL_GET	_IOR('p', 0x11, struct rtc_pll_info)  /* Get PLL correction */
+#define RTC_PLL_SET	_IOW('p', 0x12, struct rtc_pll_info)  /* Set PLL correction */
 #endif /* _LINUX_RTC_H_ */

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply

* [parisc-linux] Generic RTC driver in 2.4.x
From: Geert Uytterhoeven @ 2003-01-10 20:05 UTC (permalink / raw)
  To: Alan Cox, parisc-linux, Linux/PPC Development
  Cc: Linux Kernel Development, Linux/m68k
In-Reply-To: <Pine.GSO.4.21.0301051535430.10519-100000@vervain.sonytel.be>

Unfortunately I didn't receive any feedback from the pa-risc and ppc people
after my previous posting last Sunday.

Alan, I'm explicitly sending it to you for inclusion in your ac tree.
I intend to send it to Marcelo after the weekend.

Changes since last Sunday:
  - fix spelling of `automatically' (from Geoffrey Lee <glee@gnupilgrims.org>)
  - misc_register() and create_proc_read_entry() can fail
    (from mikal@stillhq.com in 2.5.x)
  - create_proc_read_entry() depends on CONFIG_PROC_FS
    (from mikal@stillhq.com in 2.5.x)


The following patch adds the generic RTC driver to 2.4.20 (applies fine to
2.4.21-pre3). This driver provides a /dev/rtc-compatible interface to the real
time clock on machines without a PC-style RTC chip. It is used as the primary
RTC driver on m68k, pa-risc, and ppc. This driver is already present in 2.5.x.

Pa-risc and ppc people (any other users?), please send me your enhancements (or
just ack if none are necessary), so I can send genrtc to Marcelo.

Thanks!

 Documentation/Configure.help  |   28 ++
 arch/m68k/config.in           |    5 
 arch/m68k/kernel/m68k_ksyms.c |    5 
 arch/m68k/kernel/setup.c      |    3 
 arch/m68k/q40/config.c        |   41 +++
 drivers/char/Makefile         |    1 
 drivers/char/genrtc.c         |  533 ++++++++++++++++++++++++++++++++++++++++++
 include/asm-m68k/machdep.h    |    4 
 include/asm-m68k/rtc.h        |   44 +++
 include/linux/rtc.h           |   28 ++
 10 files changed, 687 insertions(+), 5 deletions(-)

--- linux-2.4.20/Documentation/Configure.help	Tue Oct 29 18:40:45 2002
+++ linux-genrtc-2.4.20/Documentation/Configure.help	Fri Jan 10 20:54:52 2003
@@ -18959,6 +18959,34 @@
   The module is called rtc.o. If you want to compile it as a module,
   say M here and read <file:Documentation/modules.txt>.
 
+Generic Real Time Clock Support
+CONFIG_GEN_RTC
+  If you say Y here and create a character special file /dev/rtc with
+  major number 10 and minor number 135 using mknod ("man mknod"), you
+  will get access to the real time clock (or hardware clock) built
+  into your computer.
+
+  In 2.4 and later kernels this is the only way to set and get rtc
+  time on m68k systems so it is highly recommended.
+
+  It reports status information via the file /proc/driver/rtc and its 
+  behaviour is set by various ioctls on /dev/rtc. If you enable the
+  "extended RTC operation" below it will also provide an emulation
+  for RTC_UIE which is required by some programs and may improve
+  precision in some cases.
+
+  This driver is also available as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want).
+  The module is called genrtc.o. If you want to compile it as a module,
+  say M here and read <file:Documentation/modules.txt>. To load the
+  module automatically add 'alias char-major-10-135 genrtc' to your
+  /etc/modules.conf
+
+Extended RTC operation
+CONFIG_GEN_RTC_X
+  Provides an emulation for RTC_UIE which is required by some programs 
+  and may improve precision of the generic RTC support in some cases.
+
 Tadpole ANA H8 Support
 CONFIG_H8
   The Hitachi H8/337 is a microcontroller used to deal with the power
--- linux-2.4.20/arch/m68k/config.in	Fri Sep 13 10:14:59 2002
+++ linux-genrtc-2.4.20/arch/m68k/config.in	Fri Jan 10 20:54:25 2003
@@ -517,8 +517,11 @@
    if [ "$CONFIG_SUN3" = "y" ]; then
       define_bool CONFIG_GEN_RTC y
    else
-      bool 'Generic /dev/rtc emulation' CONFIG_GEN_RTC
+      tristate 'Generic /dev/rtc emulation' CONFIG_GEN_RTC      
    fi
+fi
+if [ "$CONFIG_GEN_RTC" != "n" ]; then
+   bool '   Extended RTC operation' CONFIG_GEN_RTC_X
 fi
 bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
 if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
--- linux-2.4.20/arch/m68k/kernel/m68k_ksyms.c	Thu Jan  4 22:00:55 2001
+++ linux-genrtc-2.4.20/arch/m68k/kernel/m68k_ksyms.c	Fri Jan 10 20:54:25 2003
@@ -18,6 +18,7 @@
 #include <asm/checksum.h>
 #include <asm/hardirq.h>
 #include <asm/softirq.h>
+#include <asm/rtc.h>
 
 asmlinkage long long __ashldi3 (long long, int);
 asmlinkage long long __ashrdi3 (long long, int);
@@ -49,6 +50,10 @@
 EXPORT_SYMBOL(kernel_set_cachemode);
 #endif /* !CONFIG_SUN3 */
 EXPORT_SYMBOL(m68k_debug_device);
+EXPORT_SYMBOL(mach_hwclk);
+EXPORT_SYMBOL(mach_get_ss);
+EXPORT_SYMBOL(mach_get_rtc_pll);
+EXPORT_SYMBOL(mach_set_rtc_pll);
 EXPORT_SYMBOL(dump_fpu);
 EXPORT_SYMBOL(dump_thread);
 EXPORT_SYMBOL(strnlen);
--- linux-2.4.20/arch/m68k/kernel/setup.c	Fri Sep 13 10:15:01 2002
+++ linux-genrtc-2.4.20/arch/m68k/kernel/setup.c	Fri Jan 10 20:54:25 2003
@@ -90,6 +90,9 @@
 void (*mach_gettod) (int*, int*, int*, int*, int*, int*);
 int (*mach_hwclk) (int, struct rtc_time*) = NULL;
 int (*mach_set_clock_mmss) (unsigned long) = NULL;
+unsigned int (*mach_get_ss)(void) = NULL;
+int (*mach_get_rtc_pll)(struct rtc_pll_info *) = NULL;
+int (*mach_set_rtc_pll)(struct rtc_pll_info *) = NULL;
 void (*mach_reset)( void );
 void (*mach_halt)( void ) = NULL;
 void (*mach_power_off)( void ) = NULL;
--- linux-2.4.20/arch/m68k/q40/config.c	Fri Sep 13 10:15:02 2002
+++ linux-genrtc-2.4.20/arch/m68k/q40/config.c	Fri Jan 10 20:54:25 2003
@@ -58,7 +58,10 @@
 extern void q40_gettod (int *year, int *mon, int *day, int *hour,
                            int *min, int *sec);
 extern int q40_hwclk (int, struct rtc_time *);
+extern unsigned int q40_get_ss (void);
 extern int q40_set_clock_mmss (unsigned long);
+static int q40_get_rtc_pll(struct rtc_pll_info *pll);
+static int q40_set_rtc_pll(struct rtc_pll_info *pll);
 extern void q40_reset (void);
 void q40_halt(void);
 extern void q40_waitbut(void);
@@ -196,6 +199,9 @@
     mach_gettimeoffset   = q40_gettimeoffset; 
     mach_gettod  	 = q40_gettod;
     mach_hwclk           = q40_hwclk; 
+    mach_get_ss          = q40_get_ss; 
+    mach_get_rtc_pll     = q40_get_rtc_pll; 
+    mach_set_rtc_pll     = q40_set_rtc_pll; 
     mach_set_clock_mmss	 = q40_set_clock_mmss;
 
     mach_reset		 = q40_reset;
@@ -331,6 +337,11 @@
 	return 0;
 }
 
+unsigned int q40_get_ss()
+{
+	return bcd2bin(Q40_RTC_SECS);
+}
+
 /*
  * Set the minutes and seconds from seconds value 'nowtime'.  Fail if
  * clock is out by > 30 minutes.  Logic lifted from atari code.
@@ -362,3 +373,33 @@
 	return retval;
 }
 
+
+/* get and set PLL calibration of RTC clock */
+#define Q40_RTC_PLL_MASK ((1<<5)-1)
+#define Q40_RTC_PLL_SIGN (1<<5)
+
+static int q40_get_rtc_pll(struct rtc_pll_info *pll)
+{
+      int tmp=Q40_RTC_CTRL;
+      pll->pll_value = tmp & Q40_RTC_PLL_MASK;
+      if (tmp & Q40_RTC_PLL_SIGN) 
+	  pll->pll_value = -pll->pll_value;
+      pll->pll_max=31;
+      pll->pll_min=-31;
+      pll->pll_posmult=512;
+      pll->pll_negmult=256;
+      pll->pll_clock=125829120;
+      return 0;
+  }
+
+static int q40_set_rtc_pll(struct rtc_pll_info *pll)
+{
+  if (!pll->pll_ctrl){
+      /* the docs are a bit unclear so I am doublesetting RTC_WRITE here ... */
+      int tmp=(pll->pll_value & 31) | (pll->pll_value<0 ? 32 : 0) | Q40_RTC_WRITE;
+      Q40_RTC_CTRL |= Q40_RTC_WRITE;
+      Q40_RTC_CTRL = tmp;
+      Q40_RTC_CTRL &= ~(Q40_RTC_WRITE);
+      return 0;
+  } else return -EINVAL;
+}
--- linux-2.4.20/drivers/char/Makefile	Wed Nov 27 11:02:06 2002
+++ linux-genrtc-2.4.20/drivers/char/Makefile	Fri Jan 10 20:54:25 2003
@@ -222,6 +222,7 @@
 obj-$(CONFIG_PC110_PAD) += pc110pad.o
 obj-$(CONFIG_MK712_MOUSE) += mk712.o
 obj-$(CONFIG_RTC) += rtc.o
+obj-$(CONFIG_GEN_RTC) += genrtc.o
 obj-$(CONFIG_EFI_RTC) += efirtc.o
 ifeq ($(CONFIG_PPC),)
   obj-$(CONFIG_NVRAM) += nvram.o
--- linux-2.4.20/drivers/char/genrtc.c	Thu Jan  1 01:00:00 1970
+++ linux-genrtc-2.4.20/drivers/char/genrtc.c	Fri Jan 10 20:54:52 2003
@@ -0,0 +1,533 @@
+/*
+ *	Real Time Clock interface for q40 and other m68k machines
+ *      emulate some RTC irq capabilities in software
+ *
+ *      Copyright (C) 1999 Richard Zidlicky
+ *
+ *	based on Paul Gortmaker's rtc.c device and
+ *           Sam Creasey Generic rtc driver
+ *
+ *	This driver allows use of the real time clock (built into
+ *	nearly all computers) from user space. It exports the /dev/rtc
+ *	interface supporting various ioctl() and also the /proc/dev/rtc
+ *	pseudo-file for status information.
+ *
+ *	The ioctls can be used to set the interrupt behaviour where
+ *  supported.
+ *
+ *	The /dev/rtc interface will block on reads until an interrupt
+ *	has been received. If a RTC interrupt has already happened,
+ *	it will output an unsigned long and then block. The output value
+ *	contains the interrupt status in the low byte and the number of
+ *	interrupts since the last read in the remaining high bytes. The
+ *	/dev/rtc interface can also be used with the select(2) call.
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ *
+
+ *      1.01 fix for 2.3.X                    rz@linux-m68k.org
+ *      1.02 merged with code from genrtc.c   rz@linux-m68k.org
+ *      1.03 make it more portable            zippel@linux-m68k.org
+ *      1.04 removed useless timer code       rz@linux-m68k.org
+ *      1.05 portable RTC_UIE emulation       rz@linux-m68k.org
+ *      1.06 set_rtc_time can return an error trini@kernel.crashing.org
+ */
+
+#define RTC_VERSION	"1.06"
+
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/errno.h>
+#include <linux/miscdevice.h>
+#include <linux/fcntl.h>
+
+#include <linux/rtc.h>
+#include <linux/init.h>
+#include <linux/poll.h>
+#include <linux/proc_fs.h>
+
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/rtc.h>
+
+/*
+ *	We sponge a minor off of the misc major. No need slurping
+ *	up another valuable major dev number for this. If you add
+ *	an ioctl, make sure you don't conflict with SPARC's RTC
+ *	ioctls.
+ */
+
+static DECLARE_WAIT_QUEUE_HEAD(gen_rtc_wait);
+
+static int gen_rtc_ioctl(struct inode *inode, struct file *file,
+		     unsigned int cmd, unsigned long arg);
+
+/*
+ *	Bits in gen_rtc_status.
+ */
+
+#define RTC_IS_OPEN		0x01	/* means /dev/rtc is in use	*/
+
+unsigned char gen_rtc_status;		/* bitmapped status byte.	*/
+unsigned long gen_rtc_irq_data;		/* our output to the world	*/
+
+/* months start at 0 now */
+unsigned char days_in_mo[] =
+{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+static int irq_active;
+
+#ifdef CONFIG_GEN_RTC_X
+struct tq_struct genrtc_task;
+static struct timer_list timer_task;
+
+static unsigned int oldsecs;
+static int lostint;
+static int tt_exp;
+
+void gen_rtc_timer(unsigned long data);
+
+static volatile int stask_active;              /* schedule_task */
+static volatile int ttask_active;              /* timer_task */
+static int stop_rtc_timers;                    /* don't requeue tasks */
+static spinlock_t gen_rtc_lock = SPIN_LOCK_UNLOCKED;
+
+/*
+ * Routine to poll RTC seconds field for change as often as posible,
+ * after first RTC_UIE use timer to reduce polling
+ */
+void genrtc_troutine(void *data)
+{
+	unsigned int tmp = get_rtc_ss();
+	
+	if (stop_rtc_timers) {
+		stask_active = 0;
+		return;
+	}
+
+	if (oldsecs != tmp){
+		oldsecs = tmp;
+
+		timer_task.function = gen_rtc_timer;
+		timer_task.expires = jiffies + HZ - (HZ/10);
+		tt_exp=timer_task.expires;
+		ttask_active=1;
+		stask_active=0;
+		add_timer(&timer_task);
+
+		gen_rtc_interrupt(0);
+	} else if (schedule_task(&genrtc_task) == 0)
+		stask_active = 0;
+}
+
+void gen_rtc_timer(unsigned long data)
+{
+	lostint = get_rtc_ss() - oldsecs ;
+	if (lostint<0) 
+		lostint = 60 - lostint;
+	if (time_after(jiffies, tt_exp))
+		printk(KERN_INFO "genrtc: timer task delayed by %ld jiffies\n",
+		       jiffies-tt_exp);
+	ttask_active=0;
+	stask_active=1;
+	if ((schedule_task(&genrtc_task) == 0))
+		stask_active = 0;
+}
+
+/* 
+ * call gen_rtc_interrupt function to signal an RTC_UIE,
+ * arg is unused.
+ * Could be invoked either from a real interrupt handler or
+ * from some routine that periodically (eg 100HZ) monitors
+ * whether RTC_SECS changed
+ */
+void gen_rtc_interrupt(unsigned long arg)
+{
+	/*  We store the status in the low byte and the number of
+	 *	interrupts received since the last read in the remainder
+	 *	of rtc_irq_data.  */
+
+	gen_rtc_irq_data += 0x100;
+	gen_rtc_irq_data &= ~0xff;
+	gen_rtc_irq_data |= RTC_UIE;
+
+	if (lostint){
+		printk("genrtc: system delaying clock ticks?\n");
+		/* increment count so that userspace knows something is wrong */
+		gen_rtc_irq_data += ((lostint-1)<<8);
+		lostint = 0;
+	}
+
+	wake_up_interruptible(&gen_rtc_wait);
+}
+
+/*
+ *	Now all the various file operations that we export.
+ */
+static ssize_t gen_rtc_read(struct file *file, char *buf,
+			size_t count, loff_t *ppos)
+{
+	DECLARE_WAITQUEUE(wait, current);
+	unsigned long data;
+	ssize_t retval;
+
+	if (count != sizeof (unsigned int) && count != sizeof (unsigned long))
+		return -EINVAL;
+
+	if (file->f_flags & O_NONBLOCK && !gen_rtc_irq_data)
+		return -EAGAIN;
+
+	add_wait_queue(&gen_rtc_wait, &wait);
+	retval = -ERESTARTSYS;
+
+	while (1) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		data = xchg(&gen_rtc_irq_data, 0);
+		if (data)
+			break;
+		if (signal_pending(current))
+			goto out;
+		schedule();
+	}
+
+	/* first test allows optimizer to nuke this case for 32-bit machines */
+	if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) {
+		unsigned int uidata = data;
+		retval = put_user(uidata, (unsigned long *)buf);
+	}
+	else {
+		retval = put_user(data, (unsigned long *)buf);
+	}
+	if (!retval)
+		retval = sizeof(unsigned long);
+ out:
+	current->state = TASK_RUNNING;
+	remove_wait_queue(&gen_rtc_wait, &wait);
+
+	return retval;
+}
+
+static unsigned int gen_rtc_poll(struct file *file,
+				 struct poll_table_struct *wait)
+{
+	poll_wait(file, &gen_rtc_wait, wait);
+	if (gen_rtc_irq_data != 0)
+		return POLLIN | POLLRDNORM;
+	return 0;
+}
+
+#endif
+
+/*
+ * Used to disable/enable interrupts, only RTC_UIE supported
+ * We also clear out any old irq data after an ioctl() that
+ * meddles with the interrupt enable/disable bits.
+ */
+
+static inline void gen_clear_rtc_irq_bit(unsigned char bit)
+{
+#ifdef CONFIG_GEN_RTC_X
+	stop_rtc_timers = 1;
+	if (ttask_active){
+		del_timer_sync(&timer_task);
+		ttask_active = 0;
+	}
+	while (stask_active)
+		schedule();
+
+	spin_lock(&gen_rtc_lock);
+	irq_active = 0;
+	spin_unlock(&gen_rtc_lock);
+#endif
+}
+
+static inline int gen_set_rtc_irq_bit(unsigned char bit)
+{
+#ifdef CONFIG_GEN_RTC_X
+	spin_lock(&gen_rtc_lock);
+	if ( !irq_active ) {
+		irq_active = 1;
+		stop_rtc_timers = 0;
+		lostint = 0;
+		genrtc_task.routine = genrtc_troutine;
+		oldsecs = get_rtc_ss();
+		init_timer(&timer_task);
+
+		stask_active = 1;
+		if (schedule_task(&genrtc_task) == 0){
+			stask_active = 0;
+		}
+	}
+	spin_unlock(&gen_rtc_lock);
+	gen_rtc_irq_data = 0;
+	return 0;
+#else
+	return -EINVAL;
+#endif
+}
+
+static int gen_rtc_ioctl(struct inode *inode, struct file *file,
+			 unsigned int cmd, unsigned long arg)
+{
+	struct rtc_time wtime;
+	struct rtc_pll_info pll;
+
+	switch (cmd) {
+
+	case RTC_PLL_GET:
+	    if (get_rtc_pll(&pll))
+	 	    return -EINVAL;
+	    else
+		    return copy_to_user((void *)arg, &pll, sizeof pll) ? -EFAULT : 0;
+
+	case RTC_PLL_SET:
+		if (!capable(CAP_SYS_TIME))
+			return -EACCES;
+		if (copy_from_user(&pll, (struct rtc_pll_info*)arg,
+				   sizeof(pll)))
+			return -EFAULT;
+	    return set_rtc_pll(&pll);
+
+	case RTC_UIE_OFF:	/* disable ints from RTC updates.	*/
+		gen_clear_rtc_irq_bit(RTC_UIE);
+		return 0;
+
+	case RTC_UIE_ON:	/* enable ints for RTC updates.	*/
+	        return gen_set_rtc_irq_bit(RTC_UIE);
+
+	case RTC_RD_TIME:	/* Read the time/date from RTC	*/
+		/* this doesn't get week-day, who cares */
+		memset(&wtime, 0, sizeof(wtime));
+		get_rtc_time(&wtime);
+
+		return copy_to_user((void *)arg, &wtime, sizeof(wtime)) ? -EFAULT : 0;
+
+	case RTC_SET_TIME:	/* Set the RTC */
+	    {
+		int year;
+		unsigned char leap_yr;
+
+		if (!capable(CAP_SYS_TIME))
+			return -EACCES;
+
+		if (copy_from_user(&wtime, (struct rtc_time *)arg,
+				   sizeof(wtime)))
+			return -EFAULT;
+
+		year = wtime.tm_year + 1900;
+		leap_yr = ((!(year % 4) && (year % 100)) ||
+			   !(year % 400));
+
+		if ((wtime.tm_mon < 0 || wtime.tm_mon > 11) || (wtime.tm_mday < 1))
+			return -EINVAL;
+
+		if (wtime.tm_mday < 0 || wtime.tm_mday >
+		    (days_in_mo[wtime.tm_mon] + ((wtime.tm_mon == 1) && leap_yr)))
+			return -EINVAL;
+
+		if (wtime.tm_hour < 0 || wtime.tm_hour >= 24 ||
+		    wtime.tm_min < 0 || wtime.tm_min >= 60 ||
+		    wtime.tm_sec < 0 || wtime.tm_sec >= 60)
+			return -EINVAL;
+
+		return set_rtc_time(&wtime);
+	    }
+	}
+
+	return -EINVAL;
+}
+
+/*
+ *	We enforce only one user at a time here with the open/close.
+ *	Also clear the previous interrupt data on an open, and clean
+ *	up things on a close.
+ */
+
+static int gen_rtc_open(struct inode *inode, struct file *file)
+{
+	if (gen_rtc_status & RTC_IS_OPEN)
+		return -EBUSY;
+
+	MOD_INC_USE_COUNT;
+
+	gen_rtc_status |= RTC_IS_OPEN;
+	gen_rtc_irq_data = 0;
+	irq_active = 0;
+
+	return 0;
+}
+
+static int gen_rtc_release(struct inode *inode, struct file *file)
+{
+	/*
+	 * Turn off all interrupts once the device is no longer
+	 * in use and clear the data.
+	 */
+
+	gen_clear_rtc_irq_bit(RTC_PIE|RTC_AIE|RTC_UIE);
+
+	gen_rtc_status &= ~RTC_IS_OPEN;
+	MOD_DEC_USE_COUNT;
+
+	return 0;
+}
+
+static int gen_rtc_read_proc(char *page, char **start, off_t off,
+			     int count, int *eof, void *data);
+
+
+/*
+ *	The various file operations we support.
+ */
+
+static struct file_operations gen_rtc_fops = {
+	owner:		THIS_MODULE,
+#ifdef CONFIG_GEN_RTC_X
+	read:		gen_rtc_read,
+	poll:		gen_rtc_poll,
+#endif
+	ioctl:		gen_rtc_ioctl,
+	open:		gen_rtc_open,
+	release:	gen_rtc_release
+};
+
+static struct miscdevice rtc_gen_dev =
+{
+	RTC_MINOR,
+	"rtc",
+	&gen_rtc_fops
+};
+
+int __init rtc_generic_init(void)
+{
+	int retval;
+
+	printk(KERN_INFO "Generic RTC Driver v%s\n", RTC_VERSION);
+
+	retval = misc_register(&rtc_gen_dev);
+	if(retval < 0)
+		return retval;
+
+#ifdef CONFIG_PROC_FS
+	if((create_proc_read_entry ("driver/rtc", 0, 0, gen_rtc_read_proc, NULL)) == NULL){
+		misc_deregister(&rtc_gen_dev);
+		return -ENOMEM;
+	}
+#endif
+
+	return 0;
+}
+
+static void __exit rtc_generic_exit(void)
+{
+	remove_proc_entry ("driver/rtc", NULL);
+	misc_deregister(&rtc_gen_dev);
+}
+
+module_init(rtc_generic_init);
+module_exit(rtc_generic_exit);
+EXPORT_NO_SYMBOLS;
+
+
+/*
+ *	Info exported via "/proc/rtc".
+ */
+
+int gen_rtc_proc_output(char *buf)
+{
+	char *p;
+	struct rtc_time tm;
+	unsigned tmp;
+	struct rtc_pll_info pll;
+
+	p = buf;
+
+	get_rtc_time(&tm);
+
+	p += sprintf(p,
+		     "rtc_time\t: %02d:%02d:%02d\n"
+		     "rtc_date\t: %04d-%02d-%02d\n"
+		     "rtc_epoch\t: %04u\n",
+		     tm.tm_hour, tm.tm_min, tm.tm_sec,
+		     tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, 1900);
+
+	tm.tm_hour=0;tm.tm_min=0;tm.tm_sec=0;
+
+	p += sprintf(p, "alarm\t\t: ");
+	if (tm.tm_hour <= 24)
+		p += sprintf(p, "%02d:", tm.tm_hour);
+	else
+		p += sprintf(p, "**:");
+
+	if (tm.tm_min <= 59)
+		p += sprintf(p, "%02d:", tm.tm_min);
+	else
+		p += sprintf(p, "**:");
+
+	if (tm.tm_sec <= 59)
+		p += sprintf(p, "%02d\n", tm.tm_sec);
+	else
+		p += sprintf(p, "**\n");
+
+	tmp= RTC_24H ;
+	p += sprintf(p,
+		     "DST_enable\t: %s\n"
+		     "BCD\t\t: %s\n"
+		     "24hr\t\t: %s\n"
+		     "square_wave\t: %s\n"
+		     "alarm_IRQ\t: %s\n"
+		     "update_IRQ\t: %s\n"
+		     "periodic_IRQ\t: %s\n"
+		     "periodic_freq\t: %ld\n"
+		     "batt_status\t: %s\n",
+		     (tmp & RTC_DST_EN) ? "yes" : "no",
+		     (tmp & RTC_DM_BINARY) ? "no" : "yes",
+		     (tmp & RTC_24H) ? "yes" : "no",
+		     (tmp & RTC_SQWE) ? "yes" : "no",
+		     (tmp & RTC_AIE) ? "yes" : "no",
+		     irq_active ? "yes" : "no",
+		     (tmp & RTC_PIE) ? "yes" : "no",
+		     0L /* freq */,
+		     "okay" );
+	if (!get_rtc_pll(&pll))
+	    p += sprintf(p,
+			 "PLL adjustment\t: %d\n"
+			 "PLL max +ve adjustment\t: %d\n"
+			 "PLL max -ve adjustment\t: %d\n"
+			 "PLL +ve adjustment factor\t: %d\n"
+			 "PLL -ve adjustment factor\t: %d\n"
+			 "PLL frequency\t: %ld\n",
+			 pll.pll_value,
+			 pll.pll_max,
+			 pll.pll_min,
+			 pll.pll_posmult,
+			 pll.pll_negmult,
+			 pll.pll_clock);
+	return  p - buf;
+}
+
+static int gen_rtc_read_proc(char *page, char **start, off_t off,
+			     int count, int *eof, void *data)
+{
+	int len = gen_rtc_proc_output (page);
+        if (len <= off+count) *eof = 1;
+	*start = page + off;
+	len -= off;
+        if (len>count) len = count;
+        if (len<0) len = 0;
+	return len;
+}
+
+
+MODULE_AUTHOR("Richard Zidlicky");
+MODULE_LICENSE("GPL");
+
+/*
+ * Local variables:
+ * compile-command: "m68k-linux-gcc -D__KERNEL__ -I../../include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -ffixed-a2 -c -o genrtc.o genrtc.c"
+ * End:
+ */
+
--- linux-2.4.20/include/asm-m68k/machdep.h	Wed May 29 10:14:12 2002
+++ linux-genrtc-2.4.20/include/asm-m68k/machdep.h	Fri Jan 10 20:54:25 2003
@@ -5,6 +5,7 @@
 struct kbd_repeat;
 struct mktime;
 struct rtc_time;
+struct rtc_pll_info;
 struct gendisk;
 struct buffer_head;
 
@@ -29,6 +30,9 @@
 extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour,
 			   int *min, int *sec);
 extern int (*mach_hwclk)(int, struct rtc_time*);
+extern unsigned int (*mach_get_ss)(void);
+extern int (*mach_get_rtc_pll)(struct rtc_pll_info *);
+extern int (*mach_set_rtc_pll)(struct rtc_pll_info *);
 extern int (*mach_set_clock_mmss)(unsigned long);
 extern void (*mach_reset)( void );
 extern void (*mach_halt)( void );
--- linux-2.4.20/include/asm-m68k/rtc.h	Wed May 29 10:14:13 2002
+++ linux-genrtc-2.4.20/include/asm-m68k/rtc.h	Fri Jan 10 20:54:25 2003
@@ -13,9 +13,8 @@
 
 #ifdef __KERNEL__
 
-#include <linux/config.h>
 #include <linux/rtc.h>
-#include <linux/delay.h>
+#include <asm/errno.h>
 #include <asm/machdep.h>
 
 #define RTC_PIE 0x40		/* periodic interrupt enable */
@@ -30,7 +29,48 @@
 #define RTC_24H 0x02		/* 24 hour mode - else hours bit 7 means pm */
 #define RTC_DST_EN 0x01	        /* auto switch DST - works f. USA only */
 
+static inline void get_rtc_time(struct rtc_time *time)
+{
+	/*
+	 * Only the values that we read from the RTC are set. We leave
+	 * tm_wday, tm_yday and tm_isdst untouched. Even though the
+	 * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated
+	 * by the RTC when initially set to a non-zero value.
+	 */
+	mach_hwclk(0, time);
+}
 
+static inline int set_rtc_time(struct rtc_time *time)
+{
+	return mach_hwclk(1, time);
+}
+
+static inline unsigned int get_rtc_ss(void)
+{
+	if (mach_get_ss)
+		return mach_get_ss();
+	else{
+		struct rtc_time h;
+		
+		get_rtc_time(&h);
+		return h.tm_sec;
+	}
+}
+
+static inline int get_rtc_pll(struct rtc_pll_info *pll)
+{
+	if (mach_get_rtc_pll)
+		return mach_get_rtc_pll(pll);
+	else
+		return -EINVAL;
+}
+static inline int set_rtc_pll(struct rtc_pll_info *pll)
+{
+	if (mach_set_rtc_pll)
+		return mach_set_rtc_pll(pll);
+	else
+		return -EINVAL;
+}
 #endif /* __KERNEL__ */
 
 #endif /* _ASM__RTC_H */
--- linux-2.4.20/include/linux/rtc.h	Mon Feb 19 09:47:19 2001
+++ linux-genrtc-2.4.20/include/linux/rtc.h	Fri Jan 10 20:54:25 2003
@@ -39,10 +39,32 @@
 	struct rtc_time time;	/* time the alarm is set to */
 };
 
+/*
+ * Data structure to control PLL correction some better RTC feature
+ * pll_value is used to get or set current value of correction,
+ * the rest of the struct is used to query HW capabilities.
+ * This is modeled after the RTC used in Q40/Q60 computers but
+ * should be sufficiently flexible for other devices
+ *
+ * +ve pll_value means clock will run faster by
+ *   pll_value*pll_posmult/pll_clock
+ * -ve pll_value means clock will run slower by
+ *   pll_value*pll_negmult/pll_clock
+ */ 
+
+struct rtc_pll_info {
+	int pll_ctrl;       /* placeholder for fancier control */
+	int pll_value;      /* get/set correction value */
+	int pll_max;        /* max +ve (faster) adjustment value */
+	int pll_min;        /* max -ve (slower) adjustment value */
+	int pll_posmult;    /* factor for +ve corection */
+	int pll_negmult;    /* factor for -ve corection */
+	long pll_clock;     /* base PLL frequency */
+};
 
 /*
- * ioctl calls that are permitted to the /dev/rtc interface, if 
- * CONFIG_RTC/CONFIG_EFI_RTC was enabled.
+ * ioctl calls that are permitted to the /dev/rtc interface, if
+ * any of the RTC drivers are enabled.
  */
 
 #define RTC_AIE_ON	_IO('p', 0x01)	/* Alarm int. enable on		*/
@@ -66,4 +88,6 @@
 #define RTC_WKALM_SET	_IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/
 #define RTC_WKALM_RD	_IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/
 
+#define RTC_PLL_GET	_IOR('p', 0x11, struct rtc_pll_info)  /* Get PLL correction */
+#define RTC_PLL_SET	_IOW('p', 0x12, struct rtc_pll_info)  /* Set PLL correction */
 #endif /* _LINUX_RTC_H_ */

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH] SCSI Core patches
From: James Bottomley @ 2003-01-10 20:05 UTC (permalink / raw)
  To: Luben Tuikov; +Cc: linux-scsi
In-Reply-To: <3E1F1DAC.6060207@splentec.com>

luben@splentec.com said:
> I think that the slab cache can acknowledge a GFP_DMA flag even after
> creation of the slab, but not 100% sure on this. I.e. in
> scsi_get_command() a check of host->unchecked_isa_dma can be performed
> and the kmem_flags OR-ed with GFP_DMA.

Unfortunately, not.  That's why the kmem caches that are used by kmalloc have 
two separate caches for each buddy size (one for zone normal and one for zone 
dma)---you see this in cat /proc/slabinfo.

The essential problem is that the zone flags must be known at the time slab 
gets fed from __get_free_pages().

> I've no problem changing the slab alloc. just let's decide if we want
> a slab per host (kind of inefficient) or 2 slabs (DMA, and non-DMA) or
> OR-ing the mask upon scsi_get_command(). 

The latter, I think.  We want the *ability* to have one slab per host, but 
we'd then assign each host either to the zone DMA or zone normal allocator.  
Then, when the wierd device that has a strange dma_mask comes along, it may 
use its own slab if necessary.

> Actually, I had this in the 2.5.52 version of this patch but decided
> that the LLDD code will run as normal kernel code and that the actual
> PCI HOST will never have to access the struct scsi_cmnd directly over
> the PCI bus; but will only need to access the sg list. For this reason
> I decided to leave it out. I.e. struct scsi_cmnd will alway be
> accessed in normal operation of the kernel, and thus no need for
> GFP_DMA. (I'd so much rather it be that way, so much... :-) 

I'd be happy about this too.  Just assure me that no legacy ISA drivers do dma 
from the Scsi_Cmnd structure and we can forget about the separate allocators 
and revoke the current promise that Scsi_Cmnd will be in memory dma'able by 
the driver.

James



^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.