All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Kernel for Pentium 4 hyperthreading?
From: Dave Jones @ 2002-12-15 13:44 UTC (permalink / raw)
  To: Scott Robert Ladd; +Cc: linux-kernel
In-Reply-To: <FKEAJLBKJCGBDJJIPJLJMEGPDLAA.scott@coyotegulch.com>

On Sat, Dec 14, 2002 at 08:11:45PM -0500, Scott Robert Ladd wrote:

 > I've just received a new computer based on a 2.8 GHz Pentium 4 with
 > hyper-threading enabled. Yes, HT is enabled in the BIOS; yes, /proc/cpuinfo
 > shows the 'ht' flag; yes, I've compiled 2.4.20 (stock) with SMP and ACPI
 > enabled.
 > No, it doesn't work. cat /proc/cpuinfo reports a single CPU.

Note that just because /proc/cpuinfo shows 'ht' does not mean you can
use it in hyperthreaded mode. To do that, you also have to have >1
sibling in the physical package. Non-Xeon type P4's don't have the
extra sibling, so don't function as a hyperthreaded CPU.

 > Can 2.4.20 handle a Pentium 4 (not Xeon, mind you) with HT? What could I be
 > missing in my kernel build?

It's more a case of whats missing in your CPU package 8-)
 
		Dave

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs

^ permalink raw reply

* Problems with OnStream USB30 Tape drive on the USB ports on a FIC VA-503+ - VIA MVP3 Chipset
From: Linux Kernel Developer @ 2002-12-15 13:32 UTC (permalink / raw)
  To: Linux Kernel Mailing List
In-Reply-To: <3DFC7C17.906E3211@cinet.co.jp>

Hi all,

    I am trying to use an On-Stream USB30 Tape drive on a Linux system which
I have running on a FIC VA-503+ motherboard that uses the VIA MVP3 chipset.
I am using the standard Linux kernel 2.4.20.  And loaded the drivers
usb-uhci, usb-storage, and osst to access the tape drive.  The tape drive
has its latest firmware version.  Please not that I also tried the alternate
USB driver uhci, which dies even quicker, consistently.  The problem is that
a very short while after I start a backup to the tape (variable length of
time) the backup procedure crashes.  The following error message appears to
be called every time the procedure crashes.

"
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
hub.c: new USB device 00:07.2-2, assigned address 10
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 10
"

    The entire dmesg has been pasted below, each of the resets appears to
cause the tape drive to be lost and then reinstalled causing a write error
to the process writing to the tape.  The problem seams like it might also be
time dependant.  Before the last tries I made today I was following the
README.osst which strongly suggested using 23k blocks when writing to the
tape so all my tar commands had the -b64 option.  Mysteriously I tried tar
without the -b64 option and the backup proceeded for a significantly longer
amount of time before succumbing to the problem.  I noticed a similar
pattern of behavior in the use of dd commands (dd bs=a_block_size
if=really_big_file of=/dev/osst0).  Smaller block sizes seam to keep the
tape drive working for a longer period of time before dying.  I also tried
telling tar to compress data before writing to the tape with the -z option
which also caused the tape drive to last longer.

    Note: Tape drive seamed to work on another system where I tried it on
with a later VIA chipset, the SMP VIA P3 chipset.  I did a huge backup which
did also die, though at this time I'm not sure if its the same problem.  The
dmesg error messages where different and I may have backed up more data that
the space available on the tape.  The tape drive did last a really long time
though.

    I am willing to help debug the problem.  Can anyone help me?  Thank you.

-------------------------------------------------------------------


Linux version 2.4.20 (root@Miyu) (gcc version 2.95.3 20010315 (release)) #4
Wed Dec 11 17:29:58 EST 2002
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 0000000007ff0000 (usable)
 BIOS-e820: 0000000007ff0000 - 0000000007ff0800 (ACPI NVS)
 BIOS-e820: 0000000007ff0800 - 0000000008000000 (ACPI data)
 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
127MB LOWMEM available.
On node 0 totalpages: 32752
zone(0): 4096 pages.
zone(1): 28656 pages.
zone(2): 0 pages.
Kernel command line: auto BOOT_IMAGE=Linux ro root=301
Initializing CPU#0
Detected 451.034 MHz processor.
Console: colour VGA+ 80x25
Calibrating delay loop... 897.84 BogoMIPS
Memory: 127612k/131008k available (934k kernel code, 3008k reserved, 379k
data, 64k init, 0k highmem)
Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
Inode cache hash table entries: 8192 (order: 4, 65536 bytes)
Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 32768 (order: 5, 131072 bytes)
CPU: L1 I Cache: 32K (32 bytes/line), D cache 32K (32 bytes/line)
CPU:     After generic, caps: 008021bf 808029bf 00000000 00000002
CPU:             Common caps: 008021bf 808029bf 00000000 00000002
CPU: AMD-K6(tm) 3D processor stepping 0c
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
mtrr: v1.40 (20010327) Richard Gooch (rgooch@atnf.csiro.au)
mtrr: detected mtrr type: AMD K6
PCI: PCI BIOS revision 2.10 entry at 0xfb360, last bus=2
PCI: Using configuration type 1
PCI: Probing PCI hardware
PCI: 00:07.3: class 604 doesn't match header type 00. Ignoring class.
PCI: Using IRQ router VIA [1106/0586] at 00:07.0
Activating ISA DMA hang workarounds.
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
VFS: Diskquotas version dquot_6.4.0 initialized
Journalled Block Device driver loaded
ACPI: Core Subsystem version [20011018]
ACPI: Subsystem enabled
pty: 512 Unix98 ptys configured
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller on PCI bus 00 dev 39
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: VIA vt82c586b (rev 41) IDE UDMA33 controller on pci00:07.1
    ide0: BM-DMA at 0xb400-0xb407, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0xb408-0xb40f, BIOS settings: hdc:DMA, hdd:DMA
hda: WDC WD102BA, ATA DISK drive
hdc: CREATIVEDVD8400E, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
blk: queue c0283aa4, I/O limit 4095Mb (mask 0xffffffff)
hda: 20028960 sectors (10255 MB) w/1961KiB Cache, CHS=1246/255/63, UDMA(33)
Partition check:
 hda:<7>ldm_validate_partition_table(): Found an MS-DOS partition table, not
a dynamic disk.
 hda1 hda2
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 8192 bind 8192)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 64k freed
Adding Swap: 530104k swap-space (priority -1)
EXT3 FS 2.4-0.9.19, 19 August 2002 on ide0(3,1), internal journal
Real Time Clock Driver v1.10e
PCI: Assigned IRQ 5 for device 00:08.0
3c59x: Donald Becker and others. www.scyld.com/network/vortex.html
00:08.0: 3Com PCI 3c905B Cyclone 100baseTx at 0xb800. Vers LK1.1.16
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-uhci.c: $Revision: 1.275 $ time 17:41:15 Dec 11 2002
usb-uhci.c: High bandwidth mode enabled
PCI: Assigned IRQ 11 for device 00:07.2
usb-uhci.c: USB UHCI at I/O 0xb000, IRQ 11
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
hub.c: new USB device 00:07.2-2, assigned address 2
usb.c: USB device 2 (vend/prod 0x7ab/0xfc01) is not claimed by any active
driver.
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: OnStream  Model: USB30             Rev: 1.09
  Type:   Sequential-Access                  ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
USB Mass Storage support registered.
osst :I: Tape driver with OnStream support version 0.9.10
osst :I: $Id: osst.c,v 1.65 2001/11/11 20:38:56 riede Exp $
osst :I: Attached OnStream USB30 tape at scsi0, channel 0, id 0, lun 0 as
osst0
usb-uhci.c: interrupt, status 30, frame# 1939
usb-uhci.c: Host controller halted, trying to restart.
usb-uhci.c: interrupt, status 2, frame# 1927
freecom reset called
hub.c: already running port 2 disabled by hub (EMI?), re-enabling...
usb.c: USB disconnect on device 00:07.2-2 address 2
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
osst0:I: This warning may be caused by your scsi controller,
osst0:I: it has been reported with some Buslogic cards.
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
hub.c: new USB device 00:07.2-2, assigned address 3
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3
usb-uhci.c: interrupt, status 2, frame# 1403
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
freecom reset called
freecom reset called
freecom reset called
freecom reset called
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
hub.c: already running port 2 disabled by hub (EMI?), re-enabling...
usb.c: USB disconnect on device 00:07.2-2 address 3
freecom reset called
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
hub.c: new USB device 00:07.2-2, assigned address 4
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4
usb-uhci.c: interrupt, status 2, frame# 508
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
hub.c: already running port 2 disabled by hub (EMI?), re-enabling...
usb.c: USB disconnect on device 00:07.2-2 address 4
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
hub.c: new USB device 00:07.2-2, assigned address 5
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 5
usb-uhci.c: interrupt, status 2, frame# 945
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
freecom reset called
freecom reset called
hub.c: already running port 2 disabled by hub (EMI?), re-enabling...
usb.c: USB disconnect on device 00:07.2-2 address 5
freecom reset called
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
hub.c: new USB device 00:07.2-2, assigned address 6
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 6
usb-uhci.c: interrupt, status 2, frame# 146
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
hub.c: already running port 2 disabled by hub (EMI?), re-enabling...
usb.c: USB disconnect on device 00:07.2-2 address 6
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
hub.c: new USB device 00:07.2-2, assigned address 7
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 7
usb-uhci.c: interrupt, status 2, frame# 520
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
freecom reset called
hub.c: already running port 2 disabled by hub (EMI?), re-enabling...
usb.c: USB disconnect on device 00:07.2-2 address 7
freecom reset called
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
hub.c: new USB device 00:07.2-2, assigned address 8
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 8
usb-uhci.c: interrupt, status 2, frame# 1808
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
hub.c: already running port 2 disabled by hub (EMI?), re-enabling...
usb.c: USB disconnect on device 00:07.2-2 address 8
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
hub.c: new USB device 00:07.2-2, assigned address 9
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 9
usb-uhci.c: interrupt, status 2, frame# 1821
hub.c: already running port 2 disabled by hub (EMI?), re-enabling...
usb.c: USB disconnect on device 00:07.2-2 address 9
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7).
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current
osst:ce:00: sns = 70  2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
hub.c: new USB device 00:07.2-2, assigned address 10
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 10

^ permalink raw reply

* Re: empty directories under /proc
From: Thomas Estaben @ 2002-12-15 13:23 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <200212151315.48470.joerg.haensel-S0/GAf8tV78@public.gmane.org>

It seems u have the same prob than me.
I have a thinkpad t30..
The problem come from a bad bios from IBM. Since there is no prob with acpi 
under windows, they will not release a good one.
Sad, very sad...
We have to wait, and to hope that someone find a workaround for this prob..


Tom

On Sunday 15 December 2002 13:15, Jörg Hänsel wrote:
> Hello,
> I have a IBM R32 notebook and compiled a (clean) 2.4.20 kernel patched with
> the acpi patch from 12122002.
> When I load the modules ac.o  battery.o  button.o  fan.o  processor.o
> thermal.o nothing is complaining. But when I look into /proc there is no
> subdirectory acpi, but subdirs from the ospm modules are directly under
> /proc
>
> 1     1359  1647  224  ac adapter   fb           locks       stat
> 1285  1361  1655  225  battery      filesystems  meminfo     swaps
> 1286  1362  1663  226  bus          fs           misc        sys
> 1292  1364  172   227  button       ide          modules     sysvipc
> 1317  1372  175   228  cmdline      interrupts   mounts      thermal zone
> 1333  1374  193   229  cpuinfo      iomem        mtrr        tty
> 1336  1378  2     3    devices      ioports      net         uptime
> 1339  1379  200   4    dma          irq          partitions  version
> 1341  1382  205   5    dri          kcore        pci
> 1346  1393  210   6    driver       kmsg         processor
> 1352  160   213   9    execdomains  ksyms        self
> 1358  163   219   99   fan          loadavg      slabinfo
>
> When I boot the kernel there is a message:
> ACPI: Found ECDT
> ACPI: Could not use ECDT
>
> Can this be a reason for the problems.
> Is there a Kernel config dependency I have overseen, an option that must be
> enabled for ACPI ?
>
> please help,
> Joerg
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility
> Learn to use your power at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
>
> Acpi-devel mailing list
> Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/acpi-devel



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/

^ permalink raw reply

* [LARTC] OSPF on the lartc howto
From: Pedro Larroy @ 2002-12-15 13:18 UTC (permalink / raw)
  To: lartc

Hi 

As you can see, we are doing an effort to document setting up dynamic
routing with zebra on the lartc howto. Although some issues are still
unknown for me, for example making default routes replicate through OSPF.
Any hints on this or other issues will be very wellcome.

The next thing will be writting about BGP for intra AS routing.

Regards.
-- 
O   _____________________________________________________________   O
|  /-| Pedro Larroy Tovar. PiotR | http://omega.resa.es/piotr  |-\  |
| /--|            No MS-Office attachments please.             |--\ |
o-|--|              e-mail: piotr@omega.resa.es                |--|-o 
   \-|   finger piotr@omega.resa.es for public key and info    |-/  
    -------------------------------------------------------------
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply

* Contributors
From: Mark Westerman @ 2002-12-15 13:20 UTC (permalink / raw)
  To: selinux

I would like to congratulate and say thanks to the people listed on the
NSA  Contributors web page.

Mark Westerman

Thanks for your hard work.

Ryan Bergauer 
Russell Coker 
Carsten Grohmann 
Paul Krumviede 
Brian May 
James Morris 
Yuichi Nakamura 
Shaun Savage 
Rogelio Serrano Jr
Justin Smith 
Frank Mayer (Tresys Technology)
Reino Wallin 
David A. Wheeler 
Brian Fegler  
Steve Tate 
Tom Vogt 
Reino Wallin 


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply

* [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (21/21)
From: Osamu Tomita @ 2002-12-15 13:20 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox
In-Reply-To: <3DFC50E9.656B96D0@cinet.co.jp>

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (21/21)
This patch contains SMP support for PC98 (remained).

 arch/i386/kernel/mpparse.c |   45 ++++++++++++++++++++++++++++++++++++---------
 arch/i386/kernel/smpboot.c |   14 ++++++++++++++
 include/asm-i386/smpboot.h |    9 +++++++++
 3 files changed, 59 insertions(+), 9 deletions(-)

Regards,
Osamu Tomita

[-- Attachment #2: smp.patch --]
[-- Type: text/plain, Size: 4563 bytes --]

diff -urN linux/arch/i386/kernel/mpparse.c linux98/arch/i386/kernel/mpparse.c
--- linux/arch/i386/kernel/mpparse.c	2002-12-10 09:17:48.000000000 +0900
+++ linux98/arch/i386/kernel/mpparse.c	2002-12-10 10:54:09.000000000 +0900
@@ -676,11 +676,14 @@
 		printk(KERN_DEBUG "Default MP configuration #%d\n", mpf->mpf_feature1);
 		construct_default_ISA_mptable(mpf->mpf_feature1);
 	} else if (mpf->mpf_physptr) {
+		extern int pc98;
+
 		/*
 		 * Read the physical hardware table.  Anything here will
 		 * override the defaults.
 		 */
-		if (!smp_read_mpc((void *)mpf->mpf_physptr)) {
+		if (!smp_read_mpc(pc98 ? phys_to_virt(mpf->mpf_physptr)
+					: (void *)mpf->mpf_physptr)) {
 			smp_found_config = 0;
 			printk(KERN_ERR "BIOS bug, MP table errors detected!...\n");
 			printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");
@@ -734,8 +737,30 @@
 			Dprintk("found SMP MP-table at %08lx\n",
 						virt_to_phys(mpf));
 			reserve_bootmem(virt_to_phys(mpf), PAGE_SIZE);
+#ifndef CONFIG_PC9800
 			if (mpf->mpf_physptr)
 				reserve_bootmem(mpf->mpf_physptr, PAGE_SIZE);
+#else
+			/*
+			 * PC-9800's MPC table places on the very last of
+			 * physical memory; so that simply reserving PAGE_SIZE
+			 * from mpg->mpf_physptr yields BUG() in
+			 * reserve_bootmem.
+			 */
+			if (mpf->mpf_physptr) {
+				/*
+				 * We cannot access to MPC table to compute
+				 * table size yet, as only few megabytes from
+				 * the bottom is mapped now.
+				 */
+				unsigned long size = PAGE_SIZE;
+				unsigned long end = max_low_pfn * PAGE_SIZE;
+				if (mpf->mpf_physptr + size > end)
+					size = end - mpf->mpf_physptr;
+				reserve_bootmem(mpf->mpf_physptr, size);
+			}
+#endif
+
 			mpf_found = mpf;
 			return 1;
 		}
@@ -747,8 +772,6 @@
 
 void __init find_smp_config (void)
 {
-	unsigned int address;
-
 	/*
 	 * FIXME: Linux assumes you have 640K of base ram..
 	 * this continues the error...
@@ -778,12 +801,16 @@
 	 * MP1.4 SPEC states to only scan first 1K of 4K EBDA.
 	 */
 
-	address = *(unsigned short *)phys_to_virt(0x40E);
-	address <<= 4;
-	smp_scan_config(address, 0x400);
-	/* This has been safe for ages */
-	if (smp_found_config)
-		Dprintk(KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact linux-smp@vger.kernel.org if you experience SMP problems!\n");
+#ifndef CONFIG_PC9800	/* PC-9800 has no EBDA area? */
+	{
+		unsigned int address = *(unsigned short *)phys_to_virt(0x40E);
+		address <<= 4;
+		smp_scan_config(address, 0x400);
+		/* This has been safe for ages */
+		if (smp_found_config)
+			Dprintk(KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact linux-smp@vger.kernel.org if you experience SMP problems!\n");
+	}
+#endif
 }
 
 
diff -urN linux/arch/i386/kernel/smpboot.c linux98/arch/i386/kernel/smpboot.c
--- linux/arch/i386/kernel/smpboot.c	2002-12-10 09:17:49.000000000 +0900
+++ linux98/arch/i386/kernel/smpboot.c	2002-12-10 10:43:32.000000000 +0900
@@ -856,13 +856,27 @@
 		nmi_low = *((volatile unsigned short *) TRAMPOLINE_LOW);
 	} 
 
+#ifndef CONFIG_PC9800
 	CMOS_WRITE(0xa, 0xf);
+#else
+	/* reset code is stored in 8255 on PC-9800. */
+	outb(0x0e, 0x37);	/* SHUT0 = 0 */
+#endif
 	local_flush_tlb();
 	Dprintk("1.\n");
 	*((volatile unsigned short *) TRAMPOLINE_HIGH) = start_eip >> 4;
 	Dprintk("2.\n");
 	*((volatile unsigned short *) TRAMPOLINE_LOW) = start_eip & 0xf;
 	Dprintk("3.\n");
+#ifdef CONFIG_PC9800
+	/*
+	 * On PC-9800, continuation on warm reset is done by loading
+	 * %ss:%sp from 0x0000:0404 and executing 'lret', so:
+	 */
+	/* 0x3f0 is on unused interrupt vector and should be safe... */
+	*((volatile unsigned long *) phys_to_virt(0x404)) = 0x000003f0;
+	Dprintk("4.\n");
+#endif
 
 	/*
 	 * Be paranoid about clearing APIC errors.
diff -urN linux/include/asm-i386/smpboot.h linux98/include/asm-i386/smpboot.h
--- linux/include/asm-i386/smpboot.h	Sat Oct 12 13:22:19 2002
+++ linux98/include/asm-i386/smpboot.h	Sat Oct 12 19:33:46 2002
@@ -13,8 +13,17 @@
  #define TRAMPOLINE_LOW phys_to_virt(0x8)
  #define TRAMPOLINE_HIGH phys_to_virt(0xa)
 #else /* !CONFIG_CLUSTERED_APIC */
+ #ifndef CONFIG_PC9800
  #define TRAMPOLINE_LOW phys_to_virt(0x467)
  #define TRAMPOLINE_HIGH phys_to_virt(0x469)
+ #else  /* CONFIG_PC9800 */
+  /*
+   * On PC-9800, continuation on warm reset is done by loading
+   * %ss:%sp from 0x0000:0404 and executing 'lret', so:
+   */
+  #define TRAMPOLINE_LOW phys_to_virt(0x4fa)
+  #define TRAMPOLINE_HIGH phys_to_virt(0x4fc)
+ #endif /* !CONFIG_PC9800 */
 #endif /* CONFIG_CLUSTERED_APIC */
 
 #ifdef CONFIG_CLUSTERED_APIC

^ permalink raw reply

* Re: IDE-CD and VT8235 issue!!!
From: AnonimoVeneziano @ 2002-12-15 13:21 UTC (permalink / raw)
  To: linux-kernel
In-Reply-To: <3DFBC4F3.2070603@tin.it>

Here the "kern.log" file in the loading of the ide support, so you can 
examine better the problem, Thank you very much, Bye

PS= The load of ide-cd is at the end, because I've load it after the 
system start.

Dec 11 00:05:36 valinor kernel: klogd 1.4.1#11, log source = /proc/kmsg 
started.
Dec 11 00:05:36 valinor kernel: Inspecting /boot/System.map-2.4.20
Dec 11 00:05:36 valinor kernel: Loaded 14676 symbols from 
/boot/System.map-2.4.20.
Dec 11 00:05:36 valinor kernel: Symbols match kernel version 2.4.20.
Dec 11 00:05:36 valinor kernel: Loaded 72 symbols from 4 modules.
Dec 11 00:05:36 valinor kernel: Linux version 2.4.20 (root@valinor) (gcc 
version 2.95.4 20011002 (Debian prerelease)) #1 Tue Dec 10 23:56:37 CET 2002
Dec 11 00:05:36 valinor kernel: BIOS-provided physical RAM map:
Dec 11 00:05:36 valinor kernel:  BIOS-e820: 0000000000000000 - 
000000000009fc00 (usable)
Dec 11 00:05:36 valinor kernel:  BIOS-e820: 000000000009fc00 - 
00000000000a0000 (reserved)
Dec 11 00:05:36 valinor kernel:  BIOS-e820: 00000000000f0000 - 
0000000000100000 (reserved)
Dec 11 00:05:36 valinor kernel:  BIOS-e820: 0000000000100000 - 
000000001fff0000 (usable)
Dec 11 00:05:36 valinor kernel:  BIOS-e820: 000000001fff0000 - 
000000001fff8000 (ACPI data)
Dec 11 00:05:36 valinor kernel:  BIOS-e820: 000000001fff8000 - 
0000000020000000 (ACPI NVS)
Dec 11 00:05:36 valinor kernel:  BIOS-e820: 00000000fec00000 - 
00000000fec01000 (reserved)
Dec 11 00:05:36 valinor kernel:  BIOS-e820: 00000000fee00000 - 
00000000fee01000 (reserved)
Dec 11 00:05:36 valinor kernel:  BIOS-e820: 00000000fff80000 - 
0000000100000000 (reserved)
Dec 11 00:05:36 valinor kernel: 511MB LOWMEM available.
Dec 11 00:05:36 valinor kernel: On node 0 totalpages: 131056
Dec 11 00:05:36 valinor kernel: zone(0): 4096 pages.
Dec 11 00:05:36 valinor kernel: zone(1): 126960 pages.
Dec 11 00:05:36 valinor kernel: zone(2): 0 pages.
Dec 11 00:05:36 valinor kernel: Kernel command line: auto 
BOOT_IMAGE=Linux ro root=305 video=vesa:ywrap,mtrr
Dec 11 00:05:36 valinor kernel: Initializing CPU#0
Dec 11 00:05:36 valinor kernel: Detected 2255.176 MHz processor.
Dec 11 00:05:36 valinor kernel: Console: colour dummy device 80x25
Dec 11 00:05:36 valinor kernel: Calibrating delay loop... 4495.76 BogoMIPS
Dec 11 00:05:36 valinor kernel: Memory: 516504k/524224k available (990k 
kernel code, 7332k reserved, 377k data, 80k init, 0k highmem)
Dec 11 00:05:36 valinor kernel: Dentry cache hash table entries: 65536 
(order: 7, 524288 bytes)
Dec 11 00:05:36 valinor kernel: Inode cache hash table entries: 32768 
(order: 6, 262144 bytes)
Dec 11 00:05:36 valinor kernel: Mount-cache hash table entries: 8192 
(order: 4, 65536 bytes)
Dec 11 00:05:36 valinor kernel: Buffer-cache hash table entries: 32768 
(order: 5, 131072 bytes)
Dec 11 00:05:36 valinor kernel: Page-cache hash table entries: 131072 
(order: 7, 524288 bytes)
Dec 11 00:05:36 valinor kernel: CPU: L1 I Cache: 64K (64 bytes/line), D 
cache 64K (64 bytes/line)
Dec 11 00:05:36 valinor kernel: CPU: L2 Cache: 256K (64 bytes/line)
Dec 11 00:05:36 valinor kernel: Intel machine check architecture supported.
Dec 11 00:05:36 valinor kernel: Intel machine check reporting enabled on 
CPU#0.
Dec 11 00:05:36 valinor kernel: CPU:     After generic, caps: 0383fbff 
c1c3fbff 00000000 00000000
Dec 11 00:05:36 valinor kernel: CPU:             Common caps: 0383fbff 
c1c3fbff 00000000 00000000
Dec 11 00:05:36 valinor kernel: CPU: AMD Athlon(tm) XP 2400+ stepping 01
Dec 11 00:05:36 valinor kernel: Enabling fast FPU save and restore... done.
Dec 11 00:05:36 valinor kernel: Enabling unmasked SIMD FPU exception 
support... done.
Dec 11 00:05:36 valinor kernel: Checking 'hlt' instruction... OK.
Dec 11 00:05:36 valinor kernel: POSIX conformance testing by UNIFIX
Dec 11 00:05:36 valinor kernel: mtrr: v1.40 (20010327) Richard Gooch 
(rgooch@atnf.csiro.au)
Dec 11 00:05:36 valinor kernel: mtrr: detected mtrr type: Intel
Dec 11 00:05:36 valinor kernel: PCI: PCI BIOS revision 2.10 entry at 
0xfdaf1, last bus=1
Dec 11 00:05:36 valinor kernel: PCI: Using configuration type 1
Dec 11 00:05:36 valinor kernel: PCI: Probing PCI hardware
Dec 11 00:05:36 valinor kernel: PCI: Using IRQ router default 
[1106/3177] at 00:11.0
Dec 11 00:05:36 valinor kernel: PCI: Hardcoded IRQ 14 for device 00:11.1
Dec 11 00:05:36 valinor kernel: Linux NET4.0 for Linux 2.4
Dec 11 00:05:36 valinor kernel: Based upon Swansea University Computer 
Society NET3.039
Dec 11 00:05:36 valinor kernel: Initializing RT netlink socket
Dec 11 00:05:36 valinor kernel: Starting kswapd
Dec 11 00:05:36 valinor kernel: devfs: v1.12c (20020818) Richard Gooch 
(rgooch@atnf.csiro.au)
Dec 11 00:05:36 valinor kernel: devfs: boot_options: 0x1
Dec 11 00:05:36 valinor kernel: vesafb: framebuffer at 0xd8000000, 
mapped to 0xe0800000, size 65536k
Dec 11 00:05:36 valinor kernel: vesafb: mode is 1024x768x32, 
linelength=4096, pages=1
Dec 11 00:05:36 valinor kernel: vesafb: protected mode interface info at 
c000:b7d0
Dec 11 00:05:36 valinor kernel: vesafb: pmi: set display start = 
c00cb815, set palette = c00cb89a
Dec 11 00:05:36 valinor kernel: vesafb: pmi: ports = 3b4 3b5 3ba 3c0 3c1 
3c4 3c5 3c6 3c7 3c8 3c9 3cc 3ce 3cf 3d0 3d1 3d2 3d3 3d4 3d5 3da
Dec 11 00:05:36 valinor kernel: vesafb: scrolling: ywrap using protected 
mode interface, yres_virtual=16384
Dec 11 00:05:36 valinor kernel: vesafb: directcolor: size=8:8:8:8, 
shift=24:16:8:0
Dec 11 00:05:36 valinor kernel: Console: switching to colour frame 
buffer device 128x48
Dec 11 00:05:36 valinor kernel: fb0: VESA VGA frame buffer device
Dec 11 00:05:36 valinor kernel: pty: 256 Unix98 ptys configured
Dec 11 00:05:36 valinor kernel: Real Time Clock Driver v1.10e
Dec 11 00:05:36 valinor kernel: Uniform Multi-Platform E-IDE driver 
Revision: 6.31
Dec 11 00:05:36 valinor kernel: ide: Assuming 33MHz system bus speed for 
PIO modes; override with idebus=xx
Dec 11 00:05:36 valinor kernel: VP_IDE: IDE controller on PCI bus 00 dev 89
Dec 11 00:05:36 valinor kernel: PCI: Hardcoded IRQ 14 for device 00:11.1
Dec 11 00:05:36 valinor kernel: VP_IDE: chipset revision 6
Dec 11 00:05:36 valinor kernel: VP_IDE: not 100%% native mode: will 
probe irqs later
Dec 11 00:05:36 valinor kernel: ide: Assuming 33MHz system bus speed for 
PIO modes; override with idebus=xx
Dec 11 00:05:36 valinor kernel: VP_IDE: VIA vt8235 (rev 00) IDE UDMA133 
controller on pci00:11.1
Dec 11 00:05:36 valinor kernel:     ide0: BM-DMA at 0xfc00-0xfc07, BIOS 
settings: hda:DMA, hdb:DMA
Dec 11 00:05:36 valinor kernel:     ide1: BM-DMA at 0xfc08-0xfc0f, BIOS 
settings: hdc:DMA, hdd:DMA
Dec 11 00:05:36 valinor kernel: hda: QUANTUM FIREBALLP AS30.0, ATA DISK 
drive
Dec 11 00:05:36 valinor kernel: hdb: MAXTOR 6L060J3, ATA DISK drive
Dec 11 00:05:36 valinor kernel: hdc: _NEC DV-5800A, ATAPI CD/DVD-ROM drive
Dec 11 00:05:36 valinor kernel: hdd: PCRW804, ATAPI CD/DVD-ROM drive
Dec 11 00:05:36 valinor kernel: ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Dec 11 00:05:36 valinor kernel: ide1 at 0x170-0x177,0x376 on irq 15
Dec 11 00:05:36 valinor kernel: blk: queue c0293364, I/O limit 4095Mb 
(mask 0xffffffff)
Dec 11 00:05:36 valinor kernel: hda: 58633344 sectors (30020 MB) 
w/1902KiB Cache, CHS=3649/255/63, UDMA(100)
Dec 11 00:05:36 valinor kernel: blk: queue c02934b0, I/O limit 4095Mb 
(mask 0xffffffff)
Dec 11 00:05:36 valinor kernel: hdb: 117266688 sectors (60041 MB) 
w/1819KiB Cache, CHS=7299/255/63, UDMA(133)
Dec 11 00:05:36 valinor kernel: Partition check:
Dec 11 00:05:36 valinor kernel:  /dev/ide/host0/bus0/target0/lun0: p1 p2 
p3 < p5 p6 p7 p8 >
Dec 11 00:05:36 valinor kernel:  /dev/ide/host0/bus0/target1/lun0: p1 p2 
< p5 > p3
Dec 11 00:05:36 valinor kernel: NET4: Linux TCP/IP 1.0 for NET4.0
Dec 11 00:05:36 valinor kernel: IP Protocols: ICMP, UDP, TCP, IGMP
Dec 11 00:05:36 valinor kernel: IP: routing cache hash table of 4096 
buckets, 32Kbytes
Dec 11 00:05:36 valinor kernel: TCP: Hash tables configured (established 
32768 bind 32768)
Dec 11 00:05:36 valinor kernel: reiserfs: checking transaction log 
(device 03:05) ...
Dec 11 00:05:36 valinor kernel: Using r5 hash to sort names
Dec 11 00:05:36 valinor kernel: ReiserFS version 3.6.25
Dec 11 00:05:36 valinor kernel: VFS: Mounted root (reiserfs filesystem) 
readonly.
Dec 11 00:05:36 valinor kernel: Mounted devfs on /dev
Dec 11 00:05:36 valinor kernel: Freeing unused kernel memory: 80k freed
Dec 11 00:05:36 valinor kernel: NET4: Unix domain sockets 1.0/SMP for 
Linux NET4.0.
Dec 11 00:05:36 valinor kernel: Adding Swap: 506036k swap-space 
(priority -1)
Dec 11 00:05:36 valinor kernel: Adding Swap: 506036k swap-space 
(priority -2)
Dec 11 00:05:36 valinor kernel: Serial driver version 5.05c (2001-07-08) 
with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
Dec 11 00:05:36 valinor kernel: ttyS00 at 0x03f8 (irq = 4) is a 16550A
Dec 11 00:05:36 valinor kernel: ttyS01 at 0x02f8 (irq = 3) is a 16550A
Dec 11 00:05:36 valinor kernel: reiserfs: checking transaction log 
(device 03:01) ...
Dec 11 00:05:36 valinor kernel: Using r5 hash to sort names
Dec 11 00:05:36 valinor kernel: ReiserFS version 3.6.25
Dec 11 00:05:36 valinor kernel: reiserfs: checking transaction log 
(device 03:06) ...
Dec 11 00:05:36 valinor kernel: Using r5 hash to sort names
Dec 11 00:05:36 valinor kernel: ReiserFS version 3.6.25
Dec 11 00:05:36 valinor kernel: reiserfs: checking transaction log 
(device 03:07) ...
Dec 11 00:05:36 valinor kernel: Using r5 hash to sort names
Dec 11 00:05:36 valinor kernel: ReiserFS version 3.6.25
Dec 11 00:05:36 valinor kernel: reiserfs: checking transaction log 
(device 03:08) ...
Dec 11 00:05:36 valinor kernel: Using r5 hash to sort names
Dec 11 00:05:36 valinor kernel: ReiserFS version 3.6.25
Dec 11 00:05:36 valinor kernel: Journalled Block Device driver loaded
Dec 11 00:05:36 valinor kernel: kjournald starting.  Commit interval 5 
seconds
Dec 11 00:05:36 valinor kernel: EXT3 FS 2.4-0.9.19, 19 August 2002 on 
ide0(3,67), internal journal
Dec 11 00:05:36 valinor kernel: EXT3-fs: mounted filesystem with ordered 
data mode.
Dec 11 00:05:36 valinor kernel: kjournald starting.  Commit interval 5 
seconds
Dec 11 00:05:36 valinor kernel: EXT3 FS 2.4-0.9.19, 19 August 2002 on 
ide0(3,69), internal journal
Dec 11 00:05:36 valinor kernel: EXT3-fs: mounted filesystem with ordered 
data mode.
Dec 11 00:05:51 valinor kernel: SCSI subsystem driver Revision: 1.00
Dec 11 00:05:56 valinor kernel: hdc: status timeout: status=0xd0 { Busy }
Dec 11 00:05:56 valinor kernel: hdc: DMA disabled
Dec 11 00:05:56 valinor kernel: hdc: drive not ready for command
Dec 11 00:06:26 valinor kernel: hdc: ATAPI reset timed-out, status=0x80
Dec 11 00:06:31 valinor kernel: ide1: reset: success
Dec 11 00:06:31 valinor kernel: hdc: status timeout: status=0x80 { Busy }
Dec 11 00:06:31 valinor kernel: hdc: drive not ready for command
Dec 11 00:06:43 valinor kernel: Kernel logging (proc) stopped.
Dec 11 00:06:43 valinor kernel: Kernel log daemon terminating.


^ permalink raw reply

* [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (20/21)
From: Osamu Tomita @ 2002-12-15 13:15 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox
In-Reply-To: <3DFC50E9.656B96D0@cinet.co.jp>

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (20/21)
This patch support on-board modem of PC98.

diffstat:
 drivers/serial/8250_pnp.c |    5 +++++
 1 files changed, 5 insertions(+)

Regards,
Osamu Tomita

[-- Attachment #2: serial-pnp.patch --]
[-- Type: text/plain, Size: 715 bytes --]

diff -urN linux/drivers/serial/8250_pnp.c linux98/drivers/serial/8250_pnp.c
--- linux/drivers/serial/8250_pnp.c	2002-12-11 13:10:07.000000000 +0900
+++ linux98/drivers/serial/8250_pnp.c	2002-12-11 13:16:51.000000000 +0900
@@ -188,6 +188,8 @@
 	{	"MVX00A1",		0	},
 	/* PC Rider K56 Phone System PnP */
 	{	"MVX00F2",		0	},
+	/* NEC 98NOTE SPEAKER PHONE FAX MODEM(33600bps) */
+	{	"nEC8241",		0	},
 	/* Pace 56 Voice Internal Plug & Play Modem */
 	{	"PMC2430",		0	},
 	/* Generic */
@@ -373,6 +375,9 @@
 			    ((port->min == 0x2f8) ||
 			     (port->min == 0x3f8) ||
 			     (port->min == 0x2e8) ||
+#ifdef CONFIG_PC9800
+			     (port->min == 0x8b0) ||
+#endif
 			     (port->min == 0x3e8)))
 				return 0;
 	}

^ permalink raw reply

* [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (19/21)
From: Osamu Tomita @ 2002-12-15 13:11 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox
In-Reply-To: <3DFC50E9.656B96D0@cinet.co.jp>

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (19/21)
This patch is for SCSI driver.
I separate scsicam98.c from scsicam.c and do some cleanup.

diffstat:
 drivers/scsi/Kconfig        |    7 +
 drivers/scsi/Makefile       |   10 +
 drivers/scsi/pc980155.c     |  263 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/scsi/pc980155.h     |   47 +++++++
 drivers/scsi/pc980155regs.h |   89 ++++++++++++++
 drivers/scsi/scsi_scan.c    |    1 
 drivers/scsi/scsi_syms.c    |    4 
 drivers/scsi/scsicam98.c    |  192 ++++++++++++++++++++++++++++++++
 drivers/scsi/sd.c           |   24 +++-
 drivers/scsi/wd33c93.c      |   57 ++++++---
 drivers/scsi/wd33c93.h      |    5 
 11 files changed, 677 insertions(+), 22 deletions(-)

Regards,
Osamu Tomita

[-- Attachment #2: scsi.patch --]
[-- Type: text/plain, Size: 26406 bytes --]

diff -urN linux/drivers/scsi/Kconfig linux98/drivers/scsi/Kconfig
--- linux/drivers/scsi/Kconfig	Mon Nov 11 15:46:15 2002
+++ linux98/drivers/scsi/Kconfig	Mon Nov 11 16:53:06 2002
@@ -1729,6 +1729,13 @@
 	  see the picture at
 	  <http://amiga.multigraph.com/photos/oktagon.html>.
 
+config SCSI_PC980155
+	tristate "NEC PC-9801-55 SCSI support"
+	depends on PC9800 && SCSI
+	help
+	  If you have the NEC PC-9801-55 SCSI interface card or compatibles
+	  for NEC PC-9801/PC-9821, say Y.
+
 #      bool 'Cyberstorm Mk III SCSI support (EXPERIMENTAL)' CONFIG_CYBERSTORMIII_SCSI
 #      bool 'GVP Turbo 040/060 SCSI support (EXPERIMENTAL)' CONFIG_GVP_TURBO_SCSI
 endmenu
diff -urN linux/drivers/scsi/Makefile linux98/drivers/scsi/Makefile
--- linux/drivers/scsi/Makefile	2002-11-28 07:36:17.000000000 +0900
+++ linux98/drivers/scsi/Makefile	2002-12-14 15:08:42.000000000 +0900
@@ -31,6 +31,7 @@
 obj-$(CONFIG_A3000_SCSI)	+= a3000.o	wd33c93.o
 obj-$(CONFIG_A2091_SCSI)	+= a2091.o	wd33c93.o
 obj-$(CONFIG_GVP11_SCSI)	+= gvp11.o	wd33c93.o
+obj-$(CONFIG_SCSI_PC980155)	+= pc980155.o	wd33c93.o
 obj-$(CONFIG_MVME147_SCSI)	+= mvme147.o	wd33c93.o
 obj-$(CONFIG_SGIWD93_SCSI)	+= sgiwd93.o	wd33c93.o
 obj-$(CONFIG_CYBERSTORM_SCSI)	+= NCR53C9x.o	cyberstorm.o
@@ -122,9 +123,16 @@
 obj-$(CONFIG_BLK_DEV_SR)	+= sr_mod.o
 obj-$(CONFIG_CHR_DEV_SG)	+= sg.o
 
-scsi_mod-objs	:= scsi.o hosts.o scsi_ioctl.o constants.o scsicam.o \
+scsi_mod-objs	:= scsi.o hosts.o scsi_ioctl.o constants.o \
 		   scsi_error.o scsi_lib.o scsi_scan.o scsi_syms.o
 
+ifneq ($(CONFIG_PC9800),y)
+scsi_mod-objs	+= scsicam.o
+else
+export-objs	+= wd33c93.o
+scsi_mod-objs	+= scsicam98.o
+endif
+
 ifdef CONFIG_PROC_FS
 scsi_mod-objs	+= scsi_proc.o
 endif
diff -urN linux/drivers/scsi/pc980155.c linux98/drivers/scsi/pc980155.c
--- linux/drivers/scsi/pc980155.c	1970-01-01 09:00:00.000000000 +0900
+++ linux98/drivers/scsi/pc980155.c	2002-12-15 12:09:04.000000000 +0900
@@ -0,0 +1,263 @@
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/blk.h>
+#include <linux/sched.h>
+#include <linux/version.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/interrupt.h>
+
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/irq.h>
+#include <asm/dma.h>
+#include <linux/module.h>
+
+#include "scsi.h"
+#include "hosts.h"
+#include "wd33c93.h"
+#include "pc980155.h"
+#include "pc980155regs.h"
+
+#define DEBUG
+
+#include<linux/stat.h>
+
+static inline void __print_debug_info(unsigned int);
+static inline void __print_debug_info(unsigned int a){}
+#define print_debug_info() __print_debug_info(base_io);
+
+#define NR_BASE_IOS 4
+static int nr_base_ios = NR_BASE_IOS;
+static unsigned int base_ios[NR_BASE_IOS] = {0xcc0, 0xcd0, 0xce0, 0xcf0};
+static unsigned int  SASR;
+static unsigned int  SCMD;
+static wd33c93_regs regs = {&SASR, &SCMD};
+
+static struct Scsi_Host *pc980155_host = NULL;
+
+static void pc980155_intr_handle(int irq, void *dev_id, struct pt_regs *regp);
+
+inline void pc980155_dma_enable(unsigned int base_io){
+  outb(0x01, REG_CWRITE);
+  WAIT();
+}
+inline void pc980155_dma_disable(unsigned int base_io){
+  outb(0x02, REG_CWRITE);
+  WAIT();
+}
+
+
+static void pc980155_intr_handle(int irq, void *dev_id, struct pt_regs *regp)
+{
+  wd33c93_intr(pc980155_host);
+}
+
+static int dma_setup(Scsi_Cmnd *sc, int dir_in){
+  /*
+   * sc->SCp.this_residual : transfer count
+   * sc->SCp.ptr : distination address (virtual address)
+   * dir_in : data direction (DATA_OUT_DIR:0 or DATA_IN_DIR:1)
+   *
+   * if success return 0
+   */
+
+   /*
+    * DMA WRITE MODE
+    * bit 7,6 01b single mode (this mode only)
+    * bit 5   inc/dec (default:0 = inc)
+    * bit 4   auto initialize (normaly:0 = off)
+    * bit 3,2 01b memory -> io
+    *         10b io -> memory
+    *         00b verify
+    * bit 1,0 channel
+    */
+  disable_dma(sc->host->dma_channel);
+  set_dma_mode(sc->host->dma_channel, 0x40 | (dir_in ? 0x04 : 0x08));
+  clear_dma_ff(sc->host->dma_channel);
+  set_dma_addr(sc->host->dma_channel, virt_to_phys(sc->SCp.ptr));
+  set_dma_count(sc->host->dma_channel, sc->SCp.this_residual);
+#if 0
+#ifdef DEBUG
+  printk("D%d(%x)D", sc->SCp.this_residual);
+#endif
+#endif
+  enable_dma(sc->host->dma_channel);
+
+  pc980155_dma_enable(sc->host->io_port);
+
+  return 0;
+}
+
+static void dma_stop(struct Scsi_Host *instance, Scsi_Cmnd *sc, int status){
+  /*
+   * instance: Hostadapter's instance
+   * sc: scsi command
+   * status: True if success
+   */
+
+  pc980155_dma_disable(sc->host->io_port);
+
+  disable_dma(sc->host->dma_channel);
+}  
+
+/* return non-zero on detection */
+static inline int pc980155_test_port(wd33c93_regs regs)
+{
+	/* Quick and dirty test for presence of the card. */
+	if (READ_AUX_STAT() == 0xff)
+		return 0;
+	return 1;
+}
+
+static inline int
+pc980155_getconfig(unsigned int base_io, wd33c93_regs regs,
+		    unsigned char* irq, unsigned char* dma,
+		    unsigned char* scsi_id)
+{
+	static unsigned char irqs[] = { 3, 5, 6, 9, 12, 13 };
+	unsigned char result;
+  
+	printk(KERN_DEBUG "PC-9801-55: base_io=%x SASR=%x SCMD=%x\n",
+		base_io, *regs.SASR, *regs.SCMD);
+	result = read_wd33c93(regs, WD_RESETINT);
+	printk(KERN_DEBUG "PC-9801-55: getting config (%x)\n", result);
+	*scsi_id = result & 0x07;
+	*irq = (result >> 3) & 0x07;
+	if (*irq > 5) {
+		printk(KERN_ERR "PC-9801-55 (base %#x): impossible IRQ (%d)"
+			" - other device here?\n", base_io, *irq);
+		return 0;
+	}
+
+	*irq = irqs[*irq];
+	result = inb(REG_STATRD);
+	WAIT();
+	*dma = result & 0x03;
+	if (*dma == 1) {
+		printk(KERN_ERR
+			"PC-9801-55 (base %#x): impossible DMA channl (%d)"
+			" - other device here?\n", base_io, *dma);
+		return 0;
+	}
+#ifdef DEBUG
+	printk("PC-9801-55: end of getconfig\n");
+#endif
+	return 1;
+}
+
+/* return non-zero on detection */
+int scsi_pc980155_detect(Scsi_Host_Template* tpnt)
+{
+	unsigned int base_io;
+	unsigned char irq, dma, scsi_id;
+	int i;
+#ifdef DEBUG
+	unsigned char debug;
+#endif
+  
+	for (i = 0; i < nr_base_ios; i++) {
+		base_io = base_ios[i];
+		SASR = REG_ADDRST;
+		SCMD = REG_CONTRL;
+
+    /*    printk("PC-9801-55: SASR(%x = %x)\n", SASR, REG_ADDRST); */
+		if (check_region(base_io, 6))
+			continue;
+		if (! pc980155_test_port(regs))
+			continue;
+
+		if (!pc980155_getconfig(base_io, regs, &irq, &dma, &scsi_id))
+			continue;
+#ifdef DEBUG
+		printk("PC-9801-55: config: base io = %x, irq = %d, dma channel = %d, scsi id = %d\n",
+			base_io, irq, dma, scsi_id);
+#endif
+		if (request_irq(irq, pc980155_intr_handle, 0, "PC-9801-55",
+				 NULL)) {
+			printk(KERN_ERR
+				"PC-9801-55: unable to allocate IRQ %d\n",
+				irq);
+			continue;
+		}
+		if (request_dma(dma, "PC-9801-55")) {
+			printk(KERN_ERR "PC-9801-55: "
+				"unable to allocate DMA channel %d\n", dma);
+			free_irq(irq, NULL);
+			continue;
+		}
+
+		request_region(base_io, 6, "PC-9801-55");
+		pc980155_host = scsi_register(tpnt, sizeof(struct WD33C93_hostdata));
+		pc980155_host->this_id = scsi_id;
+		pc980155_host->io_port = base_io;
+		pc980155_host->n_io_port = 6;
+		pc980155_host->irq = irq;
+		pc980155_host->dma_channel = dma;
+
+#ifdef DEBUG
+		printk("PC-9801-55: scsi host found at %x irq = %d, use dma channel %d.\n", base_io, irq, dma);
+		debug = read_aux_stat(regs);
+		printk("PC-9801-55: aux: %x ", debug);
+		debug = read_wd33c93(regs, 0x17);
+		printk("status: %x\n", debug);
+#endif
+
+		pc980155_int_enable(regs);
+  
+		wd33c93_init(pc980155_host, regs, dma_setup, dma_stop,
+			      WD33C93_FS_12_15);
+    
+		return 1;
+	}
+
+	printk("PC-9801-55: not found\n");
+	return 0;
+}
+
+int pc980155_proc_info(char *buf, char **start, off_t off, int len,
+			int hostno, int in)
+{
+	/* NOT SUPPORTED YET! */
+
+	if (in) {
+		return -EPERM;
+	}
+	*start = buf;
+	return sprintf(buf, "Sorry, not supported yet.\n");
+}
+
+int pc980155_setup(char *str)
+{
+next:
+  if (!strncmp(str, "io:", 3)){
+    base_ios[0] = simple_strtoul(str+3,NULL,0);
+    nr_base_ios = 1;
+    while (*str > ' ' && *str != ',')
+      str++;
+    if (*str == ','){
+      str++;
+      goto next;
+    }
+  }
+  return 0;
+}
+
+int scsi_pc980155_release(struct Scsi_Host *pc980155_host)
+{
+#ifdef MODULE
+        pc980155_int_disable(regs);
+        release_region(pc980155_host->io_port, pc980155_host->n_io_port);
+        free_irq(pc980155_host->irq, NULL);
+        free_dma(pc980155_host->dma_channel);
+        wd33c93_release();
+#endif
+    return 1;
+}
+
+__setup("pc980155=", pc980155_setup);
+
+Scsi_Host_Template driver_template = SCSI_PC980155;
+
+#include "scsi_module.c"
diff -urN linux/drivers/scsi/pc980155.h linux98/drivers/scsi/pc980155.h
--- linux/drivers/scsi/pc980155.h	1970-01-01 09:00:00.000000000 +0900
+++ linux98/drivers/scsi/pc980155.h	2002-12-15 12:05:05.000000000 +0900
@@ -0,0 +1,47 @@
+/*
+ *  PC-9801-55 SCSI host adapter driver
+ *
+ *  Copyright (C) 1997-2000  Kyoto University Microcomputer Club
+ *			     (Linux/98 project)
+ */
+
+#ifndef _SCSI_PC9801_55_H
+#define _SCSI_PC9801_55_H
+
+#include <linux/types.h>
+#include <linux/kdev_t.h>
+#include <scsi/scsicam.h>
+
+int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+int wd33c93_abort(Scsi_Cmnd *);
+int wd33c93_reset(Scsi_Cmnd *, unsigned int);
+int scsi_pc980155_detect(Scsi_Host_Template *);
+int scsi_pc980155_release(struct Scsi_Host *);
+int pc980155_proc_info(char *, char **, off_t, int, int, int);
+
+#ifndef CMD_PER_LUN
+#define CMD_PER_LUN 2
+#endif
+
+#ifndef CAN_QUEUE
+#define CAN_QUEUE 16
+#endif
+
+#define SCSI_PC980155 {	.proc_name =		"PC-9801-55",		\
+  			.name =			"SCSI PC-9801-55",	\
+			.proc_info =		pc980155_proc_info,	\
+			.detect =		scsi_pc980155_detect,	\
+			.release =		scsi_pc980155_release,	\
+			/* command: use queue command */		\
+			.queuecommand =		wd33c93_queuecommand,	\
+			.abort =		wd33c93_abort,		\
+			.reset =		wd33c93_reset,		\
+			.bios_param =		scsicam_bios_param,	\
+			.can_queue =		CAN_QUEUE,		\
+			.this_id =		7,			\
+			.sg_tablesize =		SG_ALL,			 \
+			.cmd_per_lun =		CMD_PER_LUN, /* dont use link command */ \
+			.unchecked_isa_dma =	1, /* use dma **XXXX***/ \
+			.use_clustering =	ENABLE_CLUSTERING }
+
+#endif /* _SCSI_PC9801_55_H */
diff -urN linux/drivers/scsi/pc980155regs.h linux98/drivers/scsi/pc980155regs.h
--- linux/drivers/scsi/pc980155regs.h	Thu Jan  1 09:00:00 1970
+++ linux98/drivers/scsi/pc980155regs.h	Mon Dec  3 18:44:10 2001
@@ -0,0 +1,89 @@
+#ifndef __PC980155REGS_H
+#define __PC980155REGS_H
+
+#include "wd33c93.h"
+
+#define REG_ADDRST (base_io+0)
+#define REG_CONTRL (base_io+2)
+#define REG_CWRITE (base_io+4)
+#define REG_STATRD (base_io+4)
+
+#define WD_MEMORYBANK 0x30
+#define WD_RESETINT   0x33
+
+#if 0
+#define WAIT() outb(0x00,0x5f)
+#else
+#define WAIT() do{}while(0)
+#endif
+
+static inline uchar read_wd33c93(const wd33c93_regs regs, uchar reg_num)
+{
+  uchar data;
+  outb(reg_num, *regs.SASR);
+  WAIT();
+  data = inb(*regs.SCMD);
+  WAIT();
+  return data;
+}
+
+static inline uchar read_aux_stat(const wd33c93_regs regs)
+{
+  uchar result;
+  result = inb(*regs.SASR);
+  WAIT();
+  /*  printk("PC-9801-55: regp->SASR(%x) = %x\n", regp->SASR, result); */
+  return result;
+}
+#define READ_AUX_STAT() read_aux_stat(regs)
+
+static inline void write_wd33c93(const wd33c93_regs regs, uchar reg_num,
+				 uchar value)
+{
+  outb(reg_num, *regs.SASR);
+  WAIT();
+  outb(value, *regs.SCMD);
+  WAIT();
+}
+
+
+#define write_wd33c93_cmd(regs,cmd) write_wd33c93(regs,WD_COMMAND,cmd)
+
+static inline void write_wd33c93_count(const wd33c93_regs regs,
+					unsigned long value)
+{
+   outb(WD_TRANSFER_COUNT_MSB, *regs.SASR);
+   WAIT();
+   outb((value >> 16) & 0xff, *regs.SCMD);
+   WAIT();
+   outb((value >> 8)  & 0xff, *regs.SCMD);
+   WAIT();
+   outb( value        & 0xff, *regs.SCMD);
+   WAIT();
+}
+
+
+static inline unsigned long read_wd33c93_count(const wd33c93_regs regs)
+{
+unsigned long value;
+
+   outb(WD_TRANSFER_COUNT_MSB, *regs.SASR);
+   value = inb(*regs.SCMD) << 16;
+   value |= inb(*regs.SCMD) << 8;
+   value |= inb(*regs.SCMD);
+   return value;
+}
+
+static inline void write_wd33c93_cdb(const wd33c93_regs regs, unsigned int len,
+					unsigned char cmnd[])
+{
+  int i;
+  outb(WD_CDB_1, *regs.SASR);
+  for (i=0; i<len; i++)
+    outb(cmnd[i], *regs.SCMD);
+}
+
+#define pc980155_int_enable(regs)  write_wd33c93(regs, WD_MEMORYBANK, read_wd33c93(regs, WD_MEMORYBANK) | 0x04)
+#define pc980155_int_disable(regs) write_wd33c93(regs, WD_MEMORYBANK, read_wd33c93(regs, WD_MEMORYBANK) & ~0x04)
+
+#endif
diff -urN linux/drivers/scsi/scsi_scan.c linux98/drivers/scsi/scsi_scan.c
--- linux/drivers/scsi/scsi_scan.c	Mon Nov 18 13:29:52 2002
+++ linux98/drivers/scsi/scsi_scan.c	Tue Nov 19 11:04:14 2002
@@ -129,6 +129,7 @@
 	{"MITSUMI", "CD-R CR-2201CS", "6119", BLIST_NOLUN},	/* locks up */
 	{"RELISYS", "Scorpio", NULL, BLIST_NOLUN},	/* responds to all lun */
 	{"MICROTEK", "ScanMaker II", "5.61", BLIST_NOLUN},	/* responds to all lun */
+	{"NEC", "D3856", "0009", BLIST_NOLUN},
 
 	/*
 	 * Other types of devices that have special flags.
diff -urN linux/drivers/scsi/scsi_syms.c linux98/drivers/scsi/scsi_syms.c
--- linux/drivers/scsi/scsi_syms.c	2002-11-28 07:36:00.000000000 +0900
+++ linux98/drivers/scsi/scsi_syms.c	2002-12-14 14:27:53.000000000 +0900
@@ -95,6 +95,10 @@
 EXPORT_SYMBOL(scsi_host_put);
 EXPORT_SYMBOL(scsi_device_types);
 
+/* For PC-9800 architecture support */
+extern struct scsi_device *sd_find_params_by_bdev(struct block_device *, char **, sector_t *);
+EXPORT_SYMBOL(sd_find_params_by_bdev);
+
 /*
  * Externalize timers so that HBAs can safely start/restart commands.
  */
diff -urN linux/drivers/scsi/scsicam98.c linux98/drivers/scsi/scsicam98.c
--- linux/drivers/scsi/scsicam98.c	1970-01-01 09:00:00.000000000 +0900
+++ linux98/drivers/scsi/scsicam98.c	2002-12-14 14:55:28.000000000 +0900
@@ -0,0 +1,192 @@
+/*
+ *
+ *  scsicam98.c
+ *   SCSI CAM support functions for NEC PC-9801 , use for HDIO_GETGEO, etc.
+ *
+ *  Copyright (c) 1999-2002 Osamu Tomita <tomita@cinet.co.jp>
+ *    Based on scsicam.c written by Drew Eckhardt
+ *
+ */
+
+#include <linux/module.h>
+
+#include <linux/fs.h>
+#include <linux/genhd.h>
+#include <linux/kernel.h>
+#include <linux/blk.h>
+#include <linux/buffer_head.h>
+#include <asm/unaligned.h>
+#include "scsi.h"
+#include "hosts.h"
+#include <scsi/scsicam.h>
+#include <asm/pc9800.h>
+
+
+unsigned char *scsi_bios_ptable(struct block_device *dev)
+{
+	unsigned char *res = kmalloc(66, GFP_KERNEL);
+	if (res) {
+		struct block_device *bdev = dev->bd_contains;
+		struct buffer_head *bh = __bread(bdev, 0, block_size(bdev));
+		if (bh) {
+			memcpy(res, bh->b_data + 0x1be, 66);
+			brelse(bh);
+		} else {
+			kfree(res);
+			res = NULL;
+		}
+	}
+	return res;
+}
+
+/*
+ * Function : static int scsi_partsize(unsigned char *buf, unsigned long 
+ *     capacity,unsigned int *cyls, unsigned int *hds, unsigned int *secs);
+ *
+ * Purpose : to determine the BIOS mapping used to create the partition
+ *      table, storing the results in *cyls, *hds, and *secs 
+ *
+ * Returns : -1 on failure, 0 on success.
+ *
+ */
+
+int scsi_partsize(unsigned char *buf, unsigned long capacity,
+	       unsigned int *cyls, unsigned int *hds, unsigned int *secs)
+{
+	struct partition *p = (struct partition *)buf, *largest = NULL;
+	int i, largest_cyl;
+	int cyl, ext_cyl, end_head, end_cyl, end_sector;
+	unsigned int logical_end, physical_end, ext_physical_end;
+
+
+	if (*(unsigned short *) (buf + 64) == 0xAA55) {
+		for (largest_cyl = -1, i = 0; i < 4; ++i, ++p) {
+			if (!p->sys_ind)
+				continue;
+#ifdef DEBUG
+			printk("scsicam98 : partition %d has system \n", i);
+#endif
+			cyl = p->cyl + ((p->sector & 0xc0) << 2);
+			if (cyl > largest_cyl) {
+				largest_cyl = cyl;
+				largest = p;
+			}
+		}
+	}
+	if (largest) {
+		end_cyl = largest->end_cyl + ((largest->end_sector & 0xc0) << 2);
+		end_head = largest->end_head;
+		end_sector = largest->end_sector & 0x3f;
+
+		if (end_head + 1 == 0 || end_sector == 0)
+			return -1;
+
+#ifdef DEBUG
+		printk("scsicam98 : end at h = %d, c = %d, s = %d\n",
+		       end_head, end_cyl, end_sector);
+#endif
+
+		physical_end = end_cyl * (end_head + 1) * end_sector +
+		    end_head * end_sector + end_sector;
+
+		/* This is the actual _sector_ number at the end */
+		logical_end = get_unaligned(&largest->start_sect)
+		    + get_unaligned(&largest->nr_sects);
+
+		/* This is for >1023 cylinders */
+		ext_cyl = (logical_end - (end_head * end_sector + end_sector))
+		    / (end_head + 1) / end_sector;
+		ext_physical_end = ext_cyl * (end_head + 1) * end_sector +
+		    end_head * end_sector + end_sector;
+
+#ifdef DEBUG
+		printk("scsicam98 : logical_end=%d physical_end=%d ext_physical_end=%d ext_cyl=%d\n"
+		  ,logical_end, physical_end, ext_physical_end, ext_cyl);
+#endif
+
+		if ((logical_end == physical_end) ||
+		  (end_cyl == 1023 && ext_physical_end == logical_end)) {
+			*secs = end_sector;
+			*hds = end_head + 1;
+			*cyls = capacity / ((end_head + 1) * end_sector);
+			return 0;
+		}
+#ifdef DEBUG
+		printk("scsicam98 : logical (%u) != physical (%u)\n",
+		       logical_end, physical_end);
+#endif
+	}
+	return -1;
+}
+
+/* XXX - For now, we assume the first (i.e. having the least host_no)
+   real (i.e. non-emulated) host adapter shall be BIOS-controlled one.
+   We *SHOULD* invent another way.  */
+
+static inline struct Scsi_Host *first_real_host(void)
+{
+	struct Scsi_Host *h = NULL;
+
+	while ((h = scsi_host_get_next(h)))
+		if (!h->hostt->emulated)
+			break;
+
+	return h;
+}
+
+extern struct scsi_device *sd_find_params_by_bdev(struct block_device *, char **, sector_t *);
+
+/*
+ * Function : int scsicam_bios_param (struct block_device *bdev, ector_t capacity, int *ip)
+ *
+ * Purpose : to determine the BIOS mapping used for a drive in a 
+ *      SCSI-CAM system, storing the results in ip as required
+ *      by the HDIO_GETGEO ioctl().
+ *
+ * Returns : -1 on failure, 0 on success.
+ *
+ */
+
+int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip)
+{
+	char *name;
+	struct scsi_device *device = sd_find_params_by_bdev(bdev, &name, NULL);
+
+	if (device && first_real_host() == device->host && device->id < 7
+	    && __PC9800SCA_TEST_BIT(PC9800SCA_DISK_EQUIPS, device->id))
+	{
+		const u8 *p = (&__PC9800SCA(u8, PC9800SCA_SCSI_PARAMS)
+			       + device->id * 4);
+
+		ip[0] = p[1];	/* # of heads */
+		ip[1] = p[0];	/* # of sectors/track */
+		ip[2] = *(u16 *)&p[2] & 0x0FFF;	/* # of cylinders */
+		if (p[3] & (1 << 6)) { /* #-of-cylinders is 16-bit */
+			ip[2] |= (ip[0] & 0xF0) << 8;
+			ip[0] &= 0x0F;
+		}
+		printk(KERN_INFO "%s: "
+			"BIOS parameters CHS:%d/%d/%d, %u bytes %s sector\n",
+			name, ip[2], ip[0], ip[1], 256 << ((p[3] >> 4) & 3),
+			p[3] & 0x80 ? "hard" : "soft");
+		return 0;
+	}
+
+	/* Assume PC-9801-92 compatible parameters for HAs without BIOS.  */
+	ip[0] = 8;
+	ip[1] = 32;
+	ip[2] = capacity / (8 * 32);
+	if (ip[2] > 65535) {	/* if capacity >= 8GB */
+		/* Recent on-board adapters seem to use this parameter.  */
+		ip[1] = 128;
+		ip[2] = capacity / (8 * 128);
+		if (ip[2] > 65535) { /* if capacity >= 32GB  */
+			/* Clip the number of cylinders.  Currently this
+			   is the limit that we deal with.  */
+			ip[2] = 65535;
+		}
+	}
+	printk(KERN_INFO "%s: BIOS parameters CHS:%d/%d/%d (assumed)\n",
+		name, ip[2], ip[0], ip[1]);
+	return 0;
+}
diff -urN linux/drivers/scsi/sd.c linux98/drivers/scsi/sd.c
--- linux/drivers/scsi/sd.c	Mon Nov 18 13:29:51 2002
+++ linux98/drivers/scsi/sd.c	Tue Nov 19 11:04:14 2002
@@ -195,6 +195,7 @@
 		case HDIO_GETGEO:   /* Return BIOS disk parameters */
 		{
 			struct hd_geometry *loc = (struct hd_geometry *)arg;
+			extern int pc98;
 
 			if (!loc)
 				return -EINVAL;
@@ -210,7 +211,7 @@
 			/* override with calculated, extended default, 
 			   or driver values */
 	
-			if (host->hostt->bios_param) {
+			if (!pc98 && host->hostt->bios_param) {
 				host->hostt->bios_param(sdp, bdev,
 							capacity, diskinfo);
 			} else
@@ -1297,6 +1298,27 @@
 	kfree(sdkp);
 }
 
+struct scsi_device *sd_find_params_by_bdev(struct block_device *bdev, char **disk_name, sector_t *capacity)
+{
+	struct scsi_disk *sdkp;
+	int major = major(to_kdev_t(bdev->bd_dev));
+
+	spin_lock(&sd_devlist_lock);
+	list_for_each_entry(sdkp, &sd_devlist, list) {
+		if (sdkp->disk->major == major) {
+			if (capacity)
+				*capacity = sdkp->capacity;
+			if (disk_name)
+				*disk_name = sdkp->disk->disk_name;
+			spin_unlock(&sd_devlist_lock);
+			return sdkp->device;
+		}
+	}
+
+	spin_unlock(&sd_devlist_lock);
+	return NULL;
+}
+
 /**
  *	init_sd - entry point for this driver (both when built in or when
  *	a module).
diff -urN linux/drivers/scsi/wd33c93.c linux98/drivers/scsi/wd33c93.c
--- linux/drivers/scsi/wd33c93.c	Mon Nov 18 13:29:50 2002
+++ linux98/drivers/scsi/wd33c93.c	Tue Nov 19 11:04:14 2002
@@ -84,6 +84,7 @@
 #include <linux/init.h>
 #include <asm/irq.h>
 #include <linux/blk.h>
+#include <linux/spinlock.h>
 
 #include "scsi.h"
 #include "hosts.h"
@@ -173,7 +174,11 @@
 MODULE_PARM(setup_strings, "s");
 #endif
 
+static spinlock_t wd_lock = SPIN_LOCK_UNLOCKED;
 
+#if defined(CONFIG_SCSI_PC980155) || defined(CONFIG_SCSI_PC980155_MODULE)
+#include "pc980155regs.h"
+#else /* !CONFIG_SCSI_PC980155 */
 
 static inline uchar read_wd33c93(const wd33c93_regs regs, uchar reg_num)
 {
@@ -203,6 +208,7 @@
    *regs.SCMD = cmd;
    mb();
 }
+#endif /* CONFIG_SCSI_PC980155 */
 
 
 static inline uchar read_1_byte(const wd33c93_regs regs)
@@ -220,6 +226,7 @@
    return x;
 }
 
+#if !defined(CONFIG_SCSI_PC980155) && !defined(CONFIG_SCSI_PC980155_MODULE)
 
 static void write_wd33c93_count(const wd33c93_regs regs, unsigned long value)
 {
@@ -244,6 +251,7 @@
    mb();
    return value;
 }
+#endif /* !CONFIG_SCSI_PC980155 */
 
 
 /* The 33c93 needs to be told which direction a command transfers its
@@ -385,8 +393,7 @@
     * sense data is not lost before REQUEST_SENSE executes.
     */
 
-   save_flags(flags);
-   cli();
+   spin_lock_irqsave(&wd_lock, flags);
 
    if (!(hostdata->input_Q) || (cmd->cmnd[0] == REQUEST_SENSE)) {
       cmd->host_scribble = (uchar *)hostdata->input_Q;
@@ -407,7 +414,7 @@
 
 DB(DB_QUEUE_COMMAND,printk(")Q-%ld ",cmd->pid))
 
-   restore_flags(flags);
+   spin_unlock_irqrestore(&wd_lock, flags);
    return 0;
 }
 
@@ -428,7 +435,6 @@
 struct WD33C93_hostdata *hostdata = (struct WD33C93_hostdata *)instance->hostdata;
 const wd33c93_regs regs = hostdata->regs;
 Scsi_Cmnd *cmd, *prev;
-int i;
 
 DB(DB_EXECUTE,printk("EX("))
 
@@ -591,9 +597,16 @@
     * (take advantage of auto-incrementing)
     */
 
-      *regs.SASR = WD_CDB_1;
-      for (i=0; i<cmd->cmd_len; i++)
-         *regs.SCMD = cmd->cmnd[i];
+#if defined(CONFIG_SCSI_PC980155) || defined(CONFIG_SCSI_PC980155_MODULE)
+      write_wd33c93_cdb(regs, cmd->cmd_len, cmd->cmnd);
+#else /* !CONFIG_SCSI_PC980155 */
+      {
+         int i;
+         *regs.SASR = WD_CDB_1;
+         for (i = 0; i < cmd->cmd_len; i++)
+            *regs.SCMD = cmd->cmnd[i];
+      }
+#endif /* CONFIG_SCSI_PC980155 */
 
    /* The wd33c93 only knows about Group 0, 1, and 5 commands when
     * it's doing a 'select-and-transfer'. To be safe, we write the
@@ -765,7 +778,7 @@
    if (!(asr & ASR_INT) || (asr & ASR_BSY))
       return;
 
-   save_flags(flags);
+   local_save_flags(flags);
 
 #ifdef PROC_STATISTICS
    hostdata->int_cnt++;
@@ -831,7 +844,7 @@
      * is here...
      */
 
-    restore_flags(flags);
+    local_irq_restore(flags);
 
 /* We are not connected to a target - check to see if there
  * are commands waiting to be executed.
@@ -1085,7 +1098,7 @@
                write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK);
                hostdata->state = S_CONNECTED;
             }
-         restore_flags(flags);
+         local_irq_restore(flags);
          break;
 
 
@@ -1117,7 +1130,7 @@
 /* We are no longer  connected to a target - check to see if
  * there are commands waiting to be executed.
  */
-       restore_flags(flags);
+            local_irq_restore(flags);
             wd33c93_execute(instance);
             }
          else {
@@ -1200,7 +1213,7 @@
  * there are commands waiting to be executed.
  */
     /* look above for comments on scsi_done() */
-    restore_flags(flags);
+         local_irq_restore(flags);
          wd33c93_execute(instance);
          break;
 
@@ -1228,7 +1241,7 @@
                else
                   cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8);
                cmd->scsi_done(cmd);
-          restore_flags(flags);
+               local_irq_restore(flags);
                break;
             case S_PRE_TMP_DISC:
             case S_RUNNING_LEVEL2:
@@ -1693,7 +1706,7 @@
    return 1;
 }
 
-__setup("wd33c93", wd33c93_setup);
+__setup("wd33c93=", wd33c93_setup);
 
 
 /* check_setup_args() returns index if key found, 0 if not
@@ -1831,10 +1844,9 @@
 
 
    { unsigned long flags;
-     save_flags(flags);
-     cli();
+     spin_lock_irqsave(&wd_lock, flags);
      reset_wd33c93(instance);
-     restore_flags(flags);
+     spin_unlock_irqrestore(&wd_lock, flags);
    }
 
    printk("wd33c93-%d: chip=%s/%d no_sync=0x%x no_dma=%d",instance->host_no,
@@ -1928,8 +1940,7 @@
       return len;
       }
 
-   save_flags(flags);
-   cli();
+   spin_lock_irqsave(&wd_lock, flags);
    bp = buf;
    *bp = '\0';
    if (hd->proc & PR_VERSION) {
@@ -2004,7 +2015,7 @@
          }
       }
    strcat(bp,"\n");
-   restore_flags(flags);
+   spin_unlock_irqrestore(&wd_lock, flags);
    *start = buf;
    if (stop) {
       stop = 0;
@@ -2032,4 +2043,10 @@
 {
 }
 
+EXPORT_SYMBOL(wd33c93_reset);
+EXPORT_SYMBOL(wd33c93_init);
+EXPORT_SYMBOL(wd33c93_release);
+EXPORT_SYMBOL(wd33c93_abort);
+EXPORT_SYMBOL(wd33c93_queuecommand);
+EXPORT_SYMBOL(wd33c93_intr);
 MODULE_LICENSE("GPL");
diff -urN linux/drivers/scsi/wd33c93.h linux98/drivers/scsi/wd33c93.h
--- linux/drivers/scsi/wd33c93.h	Sat Oct 12 13:21:35 2002
+++ linux98/drivers/scsi/wd33c93.h	Sat Oct 12 14:18:53 2002
@@ -186,8 +186,13 @@
 
    /* This is what the 3393 chip looks like to us */
 typedef struct {
+#if defined(CONFIG_SCSI_PC980155) || defined(CONFIG_SCSI_PC980155_MODULE)
+   volatile unsigned int   *SASR;
+   volatile unsigned int   *SCMD;
+#else
    volatile unsigned char  *SASR;
    volatile unsigned char  *SCMD;
+#endif
 } wd33c93_regs;
 
 

^ permalink raw reply

* problems creating a driver
From: David Sanán Baena @ 2002-12-15 13:05 UTC (permalink / raw)
  To: linux-kernel

Hello and before of all thank you for read this.

First I use kernel 2.4.9
I have made a driver to change data betwen kernel and user space.
but when compiling I got the following message:

[david@localhost samplepackage]# make
c++ -w -Wall -fno-exceptions -fno-rtti -fvtable-thunks -DHAVE_CONFIG_H -I. -
I. -I. -I/usr/local/include -I/usr/local/share/click/src -I/usr/src/linux/in
clude -MD -DCLICK_LINUXMODULE -DCLICK_PACKAGE -O2 -c totcl.cc -o totcl.ko
totcl.cc:60: sorry, not implemented: non-trivial labeled initializers
totcl.cc:60: cannot convert `ssize_t (*) (file *, char *, unsigned int,
loff_t *)' to `module *' in initialization
totcl.cc:60: sorry, not implemented: non-trivial labeled initializers
totcl.cc:60: cannot convert `int (*) (inode *, file *)' to `loff_t (*)
(file *, long long int, int)' in initialization
totcl.cc:60: sorry, not implemented: non-trivial labeled initializers
totcl.cc:60: cannot convert `int (*) (inode *, file *)' to `ssize_t (*)
(file *, char *, unsigned int, loff_t *)' in initialization
make: *** [totcl.ko] Error 1

my file_operations var is:
struct file_operations totcl_fops=
{
 read:totcl_read,
 open:totcl_open,
 release:totcl_release,
};

(I have seen this in many documents, even in linux files...)

when I removed the labels the "sorry, not implementd:non-trivial labeled
initializers" is not shown
And finally looking in "/usr/src/linux/include/linxu/fs.h"
I saw that with the first field is: module * own
so I have changed my file_operations var to:

static struct file_operations totcl_fops=
{            NULL,
              NULL, /*seek*/
 totcl_read,
              NULL,  /*write*/
              NULL, /* readdir*/
              NULL, /* select */
              NULL, /* ioctl */
              NULL, /*mmap*/
 totcl_open,
              NULL, /*fflush*/
 totcl_release
};
And now it compiles well... I have not test the result, but first I would
want to know why doesn't work the first declaration (when It must be work,
or not?).
Could I have any problems later because that?
Thanks In advance
David




^ permalink raw reply

* [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (18/21)
From: Osamu Tomita @ 2002-12-15 13:04 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox
In-Reply-To: <3DFC50E9.656B96D0@cinet.co.jp>

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (18/21)
This is support for C-Bus (legacy bus like ISA) PNP.

 drivers/pnp/isapnp/core.c |    5 +++++
 1 files changed, 5 insertions(+)

Regards,
Osamu Tomita

[-- Attachment #2: pnp.patch --]
[-- Type: text/plain, Size: 494 bytes --]

diff -urN linux/drivers/pnp/isapnp/core.c linux98/drivers/pnp/isapnp/core.c
--- linux/drivers/pnp/isapnp/core.c	Tue Nov  5 07:30:31 2002
+++ linux98/drivers/pnp/isapnp/core.c	Sun Nov 10 23:25:36 2002
@@ -76,8 +76,13 @@
 MODULE_PARM_DESC(isapnp_verbose, "ISA Plug & Play verbose mode");
 MODULE_LICENSE("GPL");
 
+#ifndef CONFIG_PC9800
 #define _PIDXR		0x279
 #define _PNPWRP		0xa79
+#else
+#define _PIDXR		0x259
+#define _PNPWRP		0xa59
+#endif
 
 /* short tags */
 #define _STAG_PNPVERNO		0x01

^ permalink raw reply

* Re: Networking/Becker et al [was Re: pci-skeleton duplex check]
From: Henning P. Schmiedehausen @ 2002-12-15 13:06 UTC (permalink / raw)
  To: linux-kernel
In-Reply-To: <20021215123159.GJ27658@fs.tum.de>

Adrian Bunk <bunk@fs.tum.de> writes:

>> Yes. And he does a great job. But the second he started to put
>> something in that he maintains in his subsystem, another obnoxious
>> developer with too much spare time popped up and started whining about
>> "don't put this crap in, Marcello". Of course, without offering any
>> alternative.

>I remember the mail you were referring to but I don't have any knowledge 
>regarding whether this specific patch is good or bad.

>It's often better to reject bad code and to have nothing in the kernel 
>instead of having bad code in the kernel. There are several examples 
>where bad code entered into the kernel and it would have been better if 
>it was rejected.

>You might discuss whether the code in question is "crap" or good code 
>but please discuss it on a technical level without personal offences.

Hi,

the problem is, that Donald diverted in his drivers from the "official
stance" by introducing a pci-layer which he uses in all his
drivers. To him, at that time, it was technically superior to the
(then existing) PCI code and after he created this layer, he no longer
cared about the ongoing Linux PCI development because he wanted to
keep his drivers stable and laid the emphasis not on "keeping up with
every PCI change in a minor kernel revision" but to keep his drivers
stable.

You can't simply take Donalds' drivers and drop them into the
kernel. You need at least the pci-scan.c file and even then you might
either not get it to work or have to make code changes. BTDTGTT.

But you do have to start somewhere. If Jeff drops the drivers into the
source in a way that they compile and work even if they don't adhere
to every linux kernel programming standard (which seem to be chiseled
in jelly anway...)  and after that start converting with Donalds' help
to the actual PCI core code, that's IMHO the right way to go.

But if one gets shot down for even trying to start this, you might
(after a while) drive developers away from the kernel source (just as
it did happen with Donald).

I considered the ChangeSet which included pci-scan.c as a start and a
peace offer to Donald. Too bad, that not all core developers seem to
be as understanding and ready to make an admission as Jeff.

 	Regards
 		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

^ permalink raw reply

* Interoperability Testing
From: Meir Zaid @ 2002-12-15 12:56 UTC (permalink / raw)
  To: nfs

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

We are looking for certification testing of our product in an interoperability
lab or some such facility.  This is mainly to test compatibility with various
hardware vendors, but also performance benchmarking.

Actona Technologies is in the market space of storage centralization &
application acceleration over the WAN.
We implement the NFS & CIFS  file server protocols.

Do you know of any conferences or interoperability labs that do this?

Thanks,

Meir Zaid
QA Manager
Actona Technologies
www.actona.com

[-- Attachment #2: Type: text/html, Size: 2844 bytes --]

^ permalink raw reply

* [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (17/21)
From: Osamu Tomita @ 2002-12-15 13:01 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox
In-Reply-To: <3DFC50E9.656B96D0@cinet.co.jp>

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (17/21)
This is patch for IRQ number differences in pcmcia driver.

diffstat:
 drivers/pcmcia/i82365.c |    4 ++++
 1 files changed, 4 insertions(+)

Regards,
Osamu Tomita

[-- Attachment #2: pcmcia.patch --]
[-- Type: text/plain, Size: 517 bytes --]

diff -Nru linux-2.5.50-ac1/drivers/pcmcia/i82365.c linux98-2.5.50-ac1/drivers/pcmcia/i82365.c
--- linux-2.5.50-ac1/drivers/pcmcia/i82365.c	2002-11-28 07:36:18.000000000 +0900
+++ linux98-2.5.50-ac1/drivers/pcmcia/i82365.c	2002-12-12 16:40:13.000000000 +0900
@@ -187,7 +187,11 @@
 };
 
 /* Default ISA interrupt mask */
+#ifndef CONFIG_PC9800
 #define I365_MASK	0xdeb8	/* irq 15,14,12,11,10,9,7,5,4,3 */
+#else
+#define I365_MASK	0xd668	/* irq 15,14,12,10,9,6,5,3 */
+#endif
 
 #ifdef CONFIG_ISA
 static int grab_irq;

^ permalink raw reply

* [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (16/21)
From: Osamu Tomita @ 2002-12-15 12:56 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox
In-Reply-To: <3DFC50E9.656B96D0@cinet.co.jp>

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (16/21)
This is patch for IRQ number differences in pci drivers.

diffstat:
 arch/i386/pci/irq.c    |   27 +++++++++++++++++++++++++++
 drivers/pcmcia/yenta.c |    6 ++++++
 include/asm-i386/pci.h |    4 ++++
 3 files changed, 37 insertions(+)

Regards,
Osamu Tomita

[-- Attachment #2: pci.patch --]
[-- Type: text/plain, Size: 2889 bytes --]

diff -urN linux/arch/i386/pci/irq.c linux98/arch/i386/pci/irq.c
--- linux/arch/i386/pci/irq.c	Sat Oct 12 13:22:46 2002
+++ linux98/arch/i386/pci/irq.c	Sat Oct 12 14:18:52 2002
@@ -5,6 +5,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/pci_ids.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -25,6 +26,7 @@
 
 static struct irq_routing_table *pirq_table;
 
+#ifndef CONFIG_PC9800
 /*
  * Never use: 0, 1, 2 (timer, keyboard, and cascade)
  * Avoid using: 13, 14 and 15 (FP error and IDE).
@@ -36,6 +38,20 @@
 	1000000, 1000000, 1000000, 1000, 1000, 0, 1000, 1000,
 	0, 0, 0, 0, 1000, 100000, 100000, 100000
 };
+#else
+/*
+ * Never use: 0, 1, 2, 7 (timer, keyboard, CRT VSYNC and cascade)
+ * Avoid using: 8, 9 and 15 (FP error and IDE).
+ * Penalize: 4, 5, 11, 12, 13, 14 (known ISA uses: serial, floppy, sound, mouse
+ *                                 and parallel)
+ */
+unsigned int pcibios_irq_mask = 0xff78;
+
+static int pirq_penalty[16] = {
+	1000000, 1000000, 1000000, 0, 1000, 1000, 0, 1000000,
+	100000, 100000, 0, 1000, 1000, 1000, 1000, 100000
+};
+#endif
 
 struct irq_router {
 	char *name;
@@ -612,6 +628,17 @@
 		r->set(pirq_router_dev, dev, pirq, 11);
 	}
 
+#ifdef CONFIG_PC9800
+	if ((dev->class >> 8) == PCI_CLASS_BRIDGE_CARDBUS) {
+		if (pci_find_device(PCI_VENDOR_ID_INTEL,
+				PCI_DEVICE_ID_INTEL_82439TX, NULL) != NULL) {
+			if (mask & 0x0040) {
+				mask &= 0x0040;	/* assign IRQ 6 only */
+				printk("pci-irq: Use IRQ6 for CardBus controller\n");
+			}
+		}
+	}
+#endif
 	/*
 	 * Find the best IRQ to assign: use the one
 	 * reported by the device if possible.
diff -urN linux/drivers/pcmcia/yenta.c linux98/drivers/pcmcia/yenta.c
--- linux/drivers/pcmcia/yenta.c	Mon Nov 18 13:29:48 2002
+++ linux98/drivers/pcmcia/yenta.c	Tue Nov 19 11:02:09 2002
@@ -8,6 +8,7 @@
  * 	Dynamically adjust the size of the bridge resource
  * 	
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/sched.h>
@@ -510,6 +511,7 @@
 	add_timer(&socket->poll_timer);
 }
 
+#ifndef CONFIG_PC9800
 /*
  * Only probe "regular" interrupts, don't
  * touch dangerous spots like the mouse irq,
@@ -520,6 +522,10 @@
  * Default to 11, 10, 9, 7, 6, 5, 4, 3.
  */
 static u32 isa_interrupts = 0x0ef8;
+#else
+/* Default to 12, 10, 6, 5, 3. */
+static u32 isa_interrupts = 0x1468;
+#endif
 
 static unsigned int yenta_probe_irq(pci_socket_t *socket, u32 isa_irq_mask)
 {
diff -urN linux/include/asm-i386/pci.h linux98/include/asm-i386/pci.h
--- linux/include/asm-i386/pci.h	Sun Jun  9 14:29:24 2002
+++ linux98/include/asm-i386/pci.h	Mon Jun 10 20:49:15 2002
@@ -17,7 +17,11 @@
 #endif
 
 extern unsigned long pci_mem_start;
+#ifndef CONFIG_PC9800
 #define PCIBIOS_MIN_IO		0x1000
+#else
+#define PCIBIOS_MIN_IO		0x4000
+#endif
 #define PCIBIOS_MIN_MEM		(pci_mem_start)
 
 void pcibios_config_init(void);

^ permalink raw reply

* <no subject>
From: Heinrich Stillger @ 2002-12-15 12:50 UTC (permalink / raw)
  To: linux-smp

Inspecting /boot/System.map
Loaded 19336 symbols from /boot/System.map.
Symbols match kernel version 2.4.20.
Loaded 15 symbols from 1 module.
klogd 1.4.1, log source = ksyslog started.
pported.
<6>Intel machine check reporting enabled on CPU#0.
<7>CPU:     After generic, caps: 0383fbff c1cbfbff 00000000 00000000
<7>CPU:             Common caps: 0383fbff c1cbfbff 00000000 00000000
<4>CPU: AMD Athlon(tm) XP 1800+ stepping 02
<6>Enabling fast FPU save and restore... done.
<6>Enabling unmasked SIMD FPU exception support... done.
<6>Checking 'hlt' instruction... OK.
<4>POSIX conformance testing by UNIFIX
<4>enabled ExtINT on CPU#0
<4>ESR value before enabling vector: 00000080
<4>ESR value after enabling vector: 00000000
<4>ENABLING IO-APIC IRQs
<7>init IO_APIC IRQs
<7> IO-APIC (apicid-pin) 2-0, 2-16, 2-17, 2-18, 2-19, 2-20, 2-21, 2-22, 2-23 not connected.
<6>..TIMER: vector=0x31 pin1=2 pin2=0
<7>number of MP IRQ sources: 16.
<7>number of IO-APIC #2 registers: 24.
<6>testing the IO APIC.......................
<4>
<7>IO APIC #2......
<7>.... register #00: 02000000
<7>.......    : physical APIC id: 02
<7>.... register #01: 00178002
<7>.......     : max redirection entries: 0017
<7>.......     : PRQ implemented: 1
<7>.......     : IO APIC version: 0002
<4> WARNING: unexpected IO-APIC, please mail
<4>          to linux-smp@vger.kernel.org
<7>.... IRQ redirection table:
<7> NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect:   
<7> 00 000 00  1    0    0   0   0    0    0    00
<7> 01 001 01  0    0    0   0   0    1    1    39
<7> 02 001 01  0    0    0   0   0    1    1    31
<7> 03 001 01  0    0    0   0   0    1    1    41
<7> 04 001 01  0    0    0   0   0    1    1    49
<7> 05 001 01  0    0    0   0   0    1    1    51
<7> 06 001 01  0    0    0   0   0    1    1    59
<7> 07 001 01  0    0    0   0   0    1    1    61
<7> 08 001 01  0    0    0   0   0    1    1    69
<7> 09 001 01  1    1    0   1   0    1    1    71
<7> 0a 001 01  0    0    0   0   0    1    1    79
<7> 0b 001 01  0    0    0   0   0    1    1    81
<7> 0c 001 01  0    0    0   0   0    1    1    89
<7> 0d 001 01  0    0    0   0   0    1    1    91
<7> 0e 001 01  0    0    0   0   0    1    1    99
<7> 0f 001 01  0    0    0   0   0    1    1    A1
<7> 10 000 00  1    0    0   0   0    0    0    00
<7> 11 000 00  1    0    0   0   0    0    0    00
<7> 12 000 00  1    0    0   0   0    0    0    00
<7> 13 000 00  1    0    0   0   0    0    0    00
<7> 14 000 00  1    0    0   0   0    0    0    00
<7> 15 000 00  1    0    0   0   0    0    0    00
<7> 16 000 00  1    0    0   0   0    0    0    00
<7> 17 000 00  1    0    0   0   0    0    0    00
<7>IRQ to pin mappings:
<7>IRQ0 -> 0:2
<7>IRQ1 -> 0:1
<7>IRQ3 -> 0:3
<7>IRQ4 -> 0:4
<7>IRQ5 -> 0:5
<7>IRQ6 -> 0:6
<7>IRQ7 -> 0:7
<7>IRQ8 -> 0:8
<7>IRQ9 -> 0:9
<7>IRQ10 -> 0:10
<7>IRQ11 -> 0:11
<7>IRQ12 -> 0:12
<7>IRQ13 -> 0:13
<7>IRQ14 -> 0:14
<7>IRQ15 -> 0:15
<6>.................................... done.
<4>Using local APIC timer interrupts.
<4>calibrating APIC timer ...
<4>..... CPU clock speed is 1539.9111 MHz.
<4>..... host bus clock speed is 267.8105 MHz.
<4>cpu: 0, clocks: 2678105, slice: 1339052
<4>CPU0<T0:2678096,T1:1339040,D:4,S:1339052,C:2678105>
<4>mtrr: v1.40 (20010327) Richard Gooch (rgooch@atnf.csiro.au)
<4>mtrr: detected mtrr type: Intel
<6>ACPI: Subsystem revision 20021205
<6>PCI: PCI BIOS revision 2.10 entry at 0xfdb01, last bus=1
<6>PCI: Using configuration type 1
<4>..................................................................................................................................    ACPI-0263: *** Info: GPE Block0 defined as GPE0 to GPE15
<4>..............................................................................................................................<6>ACPI: Interpreter enabled
<6>ACPI: Using IOAPIC for interrupt routing
<6>ACPI: System [ACPI] (supports S0 S1 S4 S5)
<6>ACPI: PCI Root Bridge [PCI0] (00:00)
<4>PCI: Probing PCI hardware (bus 00)
<7>ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
<6>ACPI: Power Resource [URP1] (off)
<6>ACPI: Power Resource [URP2] (off)
<6>ACPI: Power Resource [FDDP] (off)
<6>ACPI: Power Resource [LPTP] (off)
<4>ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
<4>ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 10 *11 12 14 15)
<4>ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 *10 11 12 14 15)
<4>ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 *5 6 7 10 11 12 14 15)
<6>PCI: Probing PCI hardware
<7>IOAPIC[0]: Set PCI routing entry (2-16 -> 0xa9 -> IRQ 16)
<7>00:00:01[A] -> 2-16 -> IRQ 16
<7>IOAPIC[0]: Set PCI routing entry (2-17 -> 0xb1 -> IRQ 17)
<7>00:00:01[B] -> 2-17 -> IRQ 17
<7>IOAPIC[0]: Set PCI routing entry (2-22 -> 0xb9 -> IRQ 22)
<7>00:00:11[C] -> 2-22 -> IRQ 22
<7>IOAPIC[0]: Set PCI routing entry (2-21 -> 0xc1 -> IRQ 21)
<7>00:00:11[D] -> 2-21 -> IRQ 21
<7>Pin 2-17 already programmed
<7>IOAPIC[0]: Set PCI routing entry (2-18 -> 0xc9 -> IRQ 18)
<7>00:00:09[B] -> 2-18 -> IRQ 18
<7>IOAPIC[0]: Set PCI routing entry (2-19 -> 0xd1 -> IRQ 19)
<7>00:00:09[C] -> 2-19 -> IRQ 19
<7>Pin 2-16 already programmed
<7>Pin 2-18 already programmed
<7>Pin 2-19 already programmed
<7>Pin 2-16 already programmed
<7>Pin 2-17 already programmed
<7>Pin 2-19 already programmed
<7>Pin 2-16 already programmed
<7>Pin 2-17 already programmed
<7>Pin 2-18 already programmed
<7>Pin 2-16 already programmed
<7>Pin 2-17 already programmed
<7>Pin 2-18 already programmed
<7>Pin 2-19 already programmed
<7>Pin 2-17 already programmed
<7>Pin 2-18 already programmed
<7>Pin 2-19 already programmed
<7>Pin 2-16 already programmed
<7>Pin 2-17 already programmed
<7>Pin 2-18 already programmed
<7>Pin 2-16 already programmed
<7>Pin 2-17 already programmed
<7>Pin 2-18 already programmed
<7>Pin 2-19 already programmed
<7>Pin 2-16 already programmed
<7>Pin 2-17 already programmed
<7>Pin 2-18 already programmed
<7>Pin 2-19 already programmed
<4>PCI: No IRQ known for interrupt pin A of device 00:11.1 - using IRQ 255
<6>PCI: Using ACPI for IRQ routing
<6>PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'
<6>Linux NET4.0 for Linux 2.4
<6>Based upon Swansea University Computer Society NET3.039
<4>Initializing RT netlink socket
<4>Starting kswapd
<6>Journalled Block Device driver loaded
<6>Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
<4>pty: 256 Unix98 ptys configured
<6>Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ DETECT_IRQ SERIAL_PCI enabled
<6>ttyS00 at 0x03f8 (irq = 4) is a 16550A
<6>ttyS01 at 0x02f8 (irq = 3) is a 16550A
<6>Uniform Multi-Platform E-IDE driver Revision: 6.31
<4>ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
<4>PDC20268: IDE controller on PCI bus 00 dev 58
<4>PDC20268: chipset revision 2
<4>PDC20268: not 100%% native mode: will probe irqs later
<4>PDC20268: ROM enabled at 0xdffe0000
<4>PDC20268: (U)DMA Burst Bit ENABLED Primary MASTER Mode Secondary MASTER Mode.
<4>    ide2: BM-DMA at 0xd800-0xd807, BIOS settings: hde:pio, hdf:pio
<4>    ide3: BM-DMA at 0xd808-0xd80f, BIOS settings: hdg:pio, hdh:pio
<4>VP_IDE: IDE controller on PCI bus 00 dev 89
<4>PCI: No IRQ known for interrupt pin A of device 00:11.1 - using IRQ 255
<4>VP_IDE: chipset revision 6
<4>VP_IDE: not 100%% native mode: will probe irqs later
<6>VP_IDE: VIA vt8233a (rev 00) IDE UDMA133 controller on pci00:11.1
<4>    ide0: BM-DMA at 0xfc00-0xfc07, BIOS settings: hda:DMA, hdb:pio
<4>    ide1: BM-DMA at 0xfc08-0xfc0f, BIOS settings: hdc:DMA, hdd:pio
<4>hda: IC35L040AVVA07-0, ATA DISK drive
<4>hdc: TOSHIBA DVD-ROM SD-M1612, ATAPI CD/DVD-ROM drive
<4>hdd: CR-48X9TE, ATAPI CD/DVD-ROM drive
<4>hde: IC35L040AVVA07-0, ATA DISK drive
<4>ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
<4>ide1 at 0x170-0x177,0x376 on irq 15
<4>ide2 at 0xe800-0xe807,0xe402 on irq 19
<4>blk: queue c038ab24, I/O limit 4095Mb (mask 0xffffffff)
<6>hda: 80418240 sectors (41174 MB) w/1863KiB Cache, CHS=5005/255/63, UDMA(100)
<4>blk: queue c038b1ec, I/O limit 4095Mb (mask 0xffffffff)
<6>hde: 80418240 sectors (41174 MB) w/1863KiB Cache, CHS=79780/16/63, UDMA(100)
<6>Partition check:
<6> hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 >
<6> hde: [PTBL] [5005/255/63] hde1 hde2 hde3 hde4 < hde5 hde6 hde7 hde8 hde9 hde10 hde11 >
<6>Floppy drive(s): fd0 is 1.44M
<6>FDC 0 is a post-1991 82077
<6>8139too Fast Ethernet driver 0.9.26
<6>eth0: RealTek RTL8139 Fast Ethernet at 0xe0807c00, 00:20:ed:20:c3:10, IRQ 18
<7>eth0:  Identified 8139 chip type 'RTL-8139B'
<6>Linux agpgart interface v0.99 (c) Jeff Hartmann
<6>agpgart: Maximum main memory to use for agp memory: 439M
<6>agpgart: Detected Via Apollo Pro KT266 chipset
<6>agpgart: AGP aperture is 128M @ 0xe0000000
<6>[drm] AGP 0.99 on VIA Apollo KT133 @ 0xe0000000 128MB
<6>[drm] Initialized radeon 1.1.1 20010405 on minor 0
<6>[drm] AGP 0.99 on VIA Apollo KT133 @ 0xe0000000 128MB
<6>[drm] Initialized mga 3.0.2 20010321 on minor 1
<6>SCSI subsystem driver Revision: 1.00
<3>kmod: failed to exec /sbin/modprobe -s -k scsi_hostadapter, errno = 2
<6>es1371: version v0.30 time 17:52:00 Dec 14 2002
<6>es1371: found chip, vendor id 0x1274 device id 0x5880 revision 0x04
<6>es1371: found es1371 rev 4 at io 0xd000 irq 17
<6>es1371: features: joystick 0x0
<6>ac97_codec: AC97 Audio codec, id: f?v8(SigmaTel STAC9708)
<6>usb.c: registered new driver hub
<6>uhci.c: USB Universal Host Controller Interface driver v1.1
<6>uhci.c: USB UHCI at I/O 0xcc00, IRQ 21
<6>usb.c: new USB bus registered, assigned bus number 1
<6>hub.c: USB hub found
<6>hub.c: 2 ports detected
<6>uhci.c: USB UHCI at I/O 0xc800, IRQ 21
<6>usb.c: new USB bus registered, assigned bus number 2
<6>hub.c: USB hub found
<6>hub.c: 2 ports detected
<6>Initializing USB Mass Storage driver...
<6>usb.c: registered new driver usb-storage
<6>USB Mass Storage support registered.
<6>mice: PS/2 mouse device common for all mice
<6>md: raid0 personality registered as nr 2
<6>md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
<6>md: Autodetecting RAID arrays.
<6>md: autorun ...
<6>md: ... autorun DONE.
<6>pci_hotplug: PCI Hot Plug PCI Core version: 0.5
<6>NET4: Linux TCP/IP 1.0 for NET4.0
<6>IP Protocols: ICMP, UDP, TCP, IGMP
<6>IP: routing cache hash table of 4096 buckets, 32Kbytes
<6>TCP: Hash tables configured (established 32768 bind 32768)
<6>NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
<4>VFS: Mounted root (ext2 filesystem) readonly.
<6>Freeing unused kernel memory: 116k freed
<6>hub.c: new USB device 00:11.2-2, assigned address 2
<6> [events: 000000fe]
<4>usb.c: USB device 2 (vend/prod 0x471/0x311) is not claimed by any active driver.
<6> [events: 000000fe]
<6>md: autorun ...
<6>md: considering hde9 ...
<6>md:  adding hde9 ...
<6>md:  adding hda5 ...
<6>md: created md0
<6>md: bind<hda5,1>
<6>md: bind<hde9,2>
<6>md: running: <hde9><hda5>
<6>md: hde9's event counter: 000000fe
<6>md: hda5's event counter: 000000fe
<6>md0: max total readahead window set to 2048k
<6>md0: 2 data-disks, max readahead per data-disk: 1024k
<4>raid0: looking at hda5
<4>raid0:   comparing hda5(1027840) with hda5(1027840)
<4>raid0:   END
<4>raid0:   ==> UNIQUE
<4>raid0: 1 zones
<4>raid0: looking at hde9
<4>raid0:   comparing hde9(1027840) with hda5(1027840)
<4>raid0:   EQUAL
<4>raid0: FINAL 1 zones
<4>raid0: zone 0
<4>raid0: checking hda5 ... contained as device 0
<4>  (1027840) is smallest!.
<4>raid0: checking hde9 ... contained as device 1
<4>raid0: zone->nb_dev: 2, size: 2055680
<4>raid0: current zone offset: 1027840
<4>raid0: done.
<4>raid0 : md_size is 2055680 blocks.
<4>raid0 : conf->smallest->size is 2055680 blocks.
<4>raid0 : nb_zone is 1.
<4>raid0 : Allocating 8 bytes for hash.
<6>md: updating md0 RAID superblock on device
<6>md: hde9 [events: 000000ff]<6>(write) hde9's sb offset: 1028032
<6>md: hda5 [events: 000000ff]<6>(write) hda5's sb offset: 1028032
<6>md: ... autorun DONE.
<6> [events: 00000102]
<6> [events: 00000102]
<6>md: autorun ...
<6>md: considering hde7 ...
<6>md:  adding hde7 ...
<6>md:  adding hda3 ...
<6>md: created md1
<6>md: bind<hda3,1>
<6>md: bind<hde7,2>
<6>md: running: <hde7><hda3>
<6>md: hde7's event counter: 00000102
<6>md: hda3's event counter: 00000102
<6>md1: max total readahead window set to 2048k
<6>md1: 2 data-disks, max readahead per data-disk: 1024k
<4>raid0: looking at hda3
<4>raid0:   comparing hda3(313088) with hda3(313088)
<4>raid0:   END
<4>raid0:   ==> UNIQUE
<4>raid0: 1 zones
<4>raid0: looking at hde7
<4>raid0:   comparing hde7(313088) with hda3(313088)
<4>raid0:   EQUAL
<4>raid0: FINAL 1 zones
<4>raid0: zone 0
<4>raid0: checking hda3 ... contained as device 0
<4>  (313088) is smallest!.
<4>raid0: checking hde7 ... contained as device 1
<4>raid0: zone->nb_dev: 2, size: 626176
<4>raid0: current zone offset: 313088
<4>raid0: done.
<4>raid0 : md_size is 626176 blocks.
<4>raid0 : conf->smallest->size is 626176 blocks.
<4>raid0 : nb_zone is 1.
<4>raid0 : Allocating 8 bytes for hash.
<6>md: updating md1 RAID superblock on device
<6>md: hde7 [events: 00000103]<6>(write) hde7's sb offset: 313152
<6>md: hda3 [events: 00000103]<6>(write) hda3's sb offset: 313152
<6>md: ... autorun DONE.
<6> [events: 000000fe]
<6> [events: 000000fe]
<6>md: autorun ...
<6>md: considering hde11 ...
<6>md:  adding hde11 ...
<6>md:  adding hda7 ...
<6>md: created md3
<6>md: bind<hda7,1>
<6>md: bind<hde11,2>
<6>md: running: <hde11><hda7>
<6>md: hde11's event counter: 000000fe
<6>md: hda7's event counter: 000000fe
<6>md3: max total readahead window set to 2048k
<6>md3: 2 data-disks, max readahead per data-disk: 1024k
<4>raid0: looking at hda7
<4>raid0:   comparing hda7(20466688) with hda7(20466688)
<4>raid0:   END
<4>raid0:   ==> UNIQUE
<4>raid0: 1 zones
<4>raid0: looking at hde11
<4>raid0:   comparing hde11(20434432) with hda7(20466688)
<4>raid0:   NOT EQUAL
<4>raid0:   comparing hde11(20434432) with hde11(20434432)
<4>raid0:   END
<4>raid0:   ==> UNIQUE
<4>raid0: 2 zones
<4>raid0: FINAL 2 zones
<4>raid0: zone 0
<4>raid0: checking hda7 ... contained as device 0
<4>  (20466688) is smallest!.
<4>raid0: checking hde11 ... contained as device 1
<4>  (20434432) is smallest!.
<4>raid0: zone->nb_dev: 2, size: 40868864
<4>raid0: current zone offset: 20434432
<4>raid0: zone 1
<4>raid0: checking hda7 ... contained as device 0
<4>  (20466688) is smallest!.
<4>raid0: checking hde11 ... nope.
<4>raid0: zone->nb_dev: 1, size: 32256
<4>raid0: current zone offset: 20466688
<4>raid0: done.
<4>raid0 : md_size is 40901120 blocks.
<4>raid0 : conf->smallest->size is 32256 blocks.
<4>raid0 : nb_zone is 1269.
<4>raid0 : Allocating 10152 bytes for hash.
<6>md: updating md3 RAID superblock on device
<6>md: hde11 [events: 000000ff]<6>(write) hde11's sb offset: 20434560
<6>md: hda7 [events: 000000ff]<6>(write) hda7's sb offset: 20466688
<6>md: ... autorun DONE.
<6>Adding Swap: 265064k swap-space (priority 1)
<6>Adding Swap: 265032k swap-space (priority 1)
<6>kjournald starting.  Commit interval 5 seconds
<6>EXT3 FS 2.4-0.9.19, 19 August 2002 on ide0(3,6), internal journal
<6>EXT3-fs: mounted filesystem with ordered data mode.
<6>kjournald starting.  Commit interval 5 seconds
<6>EXT3 FS 2.4-0.9.19, 19 August 2002 on md(9,1), internal journal
<6>EXT3-fs: mounted filesystem with ordered data mode.
<6>kjournald starting.  Commit interval 5 seconds
<6>EXT3 FS 2.4-0.9.19, 19 August 2002 on md(9,0), internal journal
<6>EXT3-fs: mounted filesystem with ordered data mode.
<6>kjournald starting.  Commit interval 5 seconds
<6>EXT3 FS 2.4-0.9.19, 19 August 2002 on ide2(33,6), internal journal
<6>EXT3-fs: mounted filesystem with ordered data mode.
<6>kjournald starting.  Commit interval 5 seconds
<6>EXT3 FS 2.4-0.9.19, 19 August 2002 on ide2(33,1), internal journal
<6>EXT3-fs: mounted filesystem with ordered data mode.
<6>kjournald starting.  Commit interval 5 seconds
<6>EXT3 FS 2.4-0.9.19, 19 August 2002 on ide2(33,10), internal journal
<6>EXT3-fs: mounted filesystem with ordered data mode.
<6>kjournald starting.  Commit interval 5 seconds
<6>EXT3 FS 2.4-0.9.19, 19 August 2002 on ide2(33,8), internal journal
<6>EXT3-fs: mounted filesystem with ordered data mode.
<6>kjournald starting.  Commit interval 5 seconds
<6>EXT3 FS 2.4-0.9.19, 19 August 2002 on md(9,3), internal journal
<6>EXT3-fs: mounted filesystem with ordered data mode.
<6>scsi0 : SCSI host adapter emulation for IDE ATAPI devices
<4>  Vendor: TOSHIBA   Model: DVD-ROM SD-M1612  Rev: 1002
<4>  Type:   CD-ROM                             ANSI SCSI revision: 02
<4>  Vendor: MITSUMI   Model: CR-48X9TE         Rev: 1.0B
<4>  Type:   CD-ROM                             ANSI SCSI revision: 02
Kernel logging (ksyslog) stopped.
Kernel log daemon terminating.

______________________________________________________________________________
Jetzt PREMIERE START bestellen und das Geschenk liegt noch punktlich 
unter dem Weihnachtsbaum ! <http://premiere.web.de/?mc=99997>


^ permalink raw reply

* [PATCH 2.5] cpufreq: change setpolicy to event
From: Dominik Brodowski @ 2002-12-15 12:49 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, cpufreq, alan, davej

[-- Attachment #1: Type: text/plain, Size: 19015 bytes --]

[NOTE: This patch depends on the patch "cpufreq: clean up CPU information" 
sent on Friday, but is independend of the patch "cpufreq: move x86 
configuration to "Power Management" which was also submitted on Friday]

This patch changes the arguments, the name and the nature of the
"main" callback function for cpufreq drivers. It is now called
"event", and gets the following arguments:

struct cpufreq_policy policy - same as before. Because of this, all
       existing cpufreq drivers continue to work, but can be changed
       one-by-one to use the new values described below.

unsigned int event - specifies the "event" which caused this function
	 call. Currently, the following events are defined:
	 _INIT, _EXIT and _CHANGE_POLICY. For interval-based dynamic
	 frequency switching, _INTERVAL may be used later; for other
	 purpouses ("burst mode" on Geode, per-task switching etc.)
	 other events may be added.

unsigned int target_freq - On processors that only allow for frequency 
	 ranges (like the Transmeta Crusoe processor) the target_freq 
	 is ignored. The policy->min and policy->max values are used
	 to set the frequency range -- just like before.

	 Most processors, though, only allow to be set to a specific
	 frequency. So far, the different "policy models"
	 (powersave/performance) were implemented in each cpufreq
	 processor driver. This will be abstracted in future: the
	 cpufreq driver will set the processor to the frequency
	 closest to target_freq within the "policy borders"
	 [policy->min, policy->max].

unsigned int relation - if the processor can't set the CPU speed
	 exactly to the value target_freq, this value decides what 
	 frequency to use instead:

	 CPUFREQ_REL_L means the _lowest_ frequency within the policy 
	 limit is used, but it shall be not lower than target_freq.
	 If the processor can't be set to a speed between target_freq
	 and policy->max, the highest speed below target_freq is used.

	 CPUFREQ_REL_H means the highest frequency within the policy
	 limit is used, but it shall be not higher than target_freq.
	 If the processor can't be set to a speed between target_freq
	 and policy->min, the lowest speed above target_freq is used.

	 --------------------------------------------------------> CPU freq.
	      |				|		     |
         policy->min		   target_freq 		 policy->max
CPUFREQ_REL_H |----------------------->>|*
  				       *|<<------------------|
						CPUFREQ_REL_L


The target_freq and the relation are calculated by CPUfreq governors. 
("governor - A feedback device on a machine or engine that is used to
 provide automatic control, as of speed,  pressure, or temperature"
 [http://dictionary.reference.com/search?q=governor] [Thanks, David!])

This patch adds two such governors:
"powersave" selects the lowest speed within the policy limits
statically, and
"performance" selects the highest speed within the policy limits statically.
More governors will be added in future, e.g. governors which implement
different "dynamic frequency scaling" models (bounded-delay
limited-past, real-time DVS, etc.).


	Dominik


diff -ruN linux-Kconfig/arch/arm/mach-integrator/cpu.c linux/arch/arm/mach-integrator/cpu.c
--- linux-Kconfig/arch/arm/mach-integrator/cpu.c	2002-12-13 16:48:20.000000000 +0100
+++ linux/arch/arm/mach-integrator/cpu.c	2002-12-15 12:50:34.000000000 +0100
@@ -118,7 +118,10 @@
 	__raw_writel(0, CM_LOCK);
 }
 
-static int integrator_set_policy(struct cpufreq_policy *policy)
+static int integrator_event(struct cpufreq_policy *policy,
+			    unsigned int event,
+			    unsigned int target_freq,
+			    unsigned int relation)
 {
 	unsigned long cpus_allowed;
 	int cpu;
@@ -155,7 +158,7 @@
 
 static struct cpufreq_driver integrator_driver = {
 	.verify		= integrator_verify_speed,
-	.setpolicy	= integrator_set_policy,
+	.event    	= integrator_event,
 	.policy		= &integrator_policy,
 };
 #endif
diff -ruN linux-Kconfig/arch/arm/mach-sa1100/cpu-sa1100.c linux/arch/arm/mach-sa1100/cpu-sa1100.c
--- linux-Kconfig/arch/arm/mach-sa1100/cpu-sa1100.c	2002-12-13 16:48:20.000000000 +0100
+++ linux/arch/arm/mach-sa1100/cpu-sa1100.c	2002-12-15 12:51:57.000000000 +0100
@@ -176,7 +176,10 @@
 	}
 }
 
-static int sa1100_setspeed(struct cpufreq_policy *policy)
+static int sa1100_event (struct cpufreq_policy *policy,
+			 unsigned int event,
+			 unsigned int target_freq,
+			 unsigned int relation)
 {
 	unsigned int cur = sa11x0_getspeed();
 	struct cpufreq_freqs freqs;
@@ -210,7 +213,7 @@
 
 static struct cpufreq_driver sa1100_driver = {
 	.verify		= sa11x0_verify_speed,
-	.setpolicy	= sa1100_setspeed,
+	.event		= sa1100_event,
 	.policy		= &sa1100_policy,
 };
 
diff -ruN linux-Kconfig/arch/arm/mach-sa1100/cpu-sa1110.c linux/arch/arm/mach-sa1100/cpu-sa1110.c
--- linux-Kconfig/arch/arm/mach-sa1100/cpu-sa1110.c	2002-12-13 16:48:20.000000000 +0100
+++ linux/arch/arm/mach-sa1100/cpu-sa1110.c	2002-12-15 12:52:54.000000000 +0100
@@ -212,7 +212,10 @@
  * above, we can match for an exact frequency.  If we don't find
  * an exact match, we will to set the lowest frequency to be safe.
  */
-static int sa1110_setspeed(struct cpufreq_policy *policy)
+static int sa1110_event(struct cpufreq_policy *policy,
+			unsigned int event,
+			unsigned int target_freq,
+			unsigned int relation)
 {
 	struct sdram_params *sdram = &sdram_params;
 	struct cpufreq_freqs freqs;
@@ -304,9 +307,9 @@
 };
 
 static struct cpufreq_driver sa1110_driver = {
-	.verify		 = sa11x0_verify_speed,
-	.setpolicy	 = sa1110_setspeed,
-	.policy		 = &sa1110_policy,
+	.verify	 = sa11x0_verify_speed,
+	.event	 = sa1110_event,
+	.policy	 = &sa1110_policy,
 };
 
 static int __init sa1110_clk_init(void)
diff -ruN linux-Kconfig/arch/i386/kernel/cpu/cpufreq/elanfreq.c linux/arch/i386/kernel/cpu/cpufreq/elanfreq.c
--- linux-Kconfig/arch/i386/kernel/cpu/cpufreq/elanfreq.c	2002-12-13 16:48:16.000000000 +0100
+++ linux/arch/i386/kernel/cpu/cpufreq/elanfreq.c	2002-12-15 12:44:05.000000000 +0100
@@ -201,7 +201,10 @@
 	return 0;
 }
 
-static int elanfreq_setpolicy (struct cpufreq_policy *policy)
+static int elanfreq_event (struct cpufreq_policy *policy,
+			   unsigned int event,
+			   unsigned int target_freq,
+			   unsigned int relation)
 {
 	unsigned int    number_states = 0;
 	unsigned int    i, j=4;
@@ -300,7 +303,7 @@
 #endif
 
 	driver->verify        = &elanfreq_verify;
-	driver->setpolicy     = &elanfreq_setpolicy;
+	driver->event         = &elanfreq_event;
 
 	driver->policy[0].cpu    = 0;
 	driver->policy[0].min    = 1000;
diff -ruN linux-Kconfig/arch/i386/kernel/cpu/cpufreq/longhaul.c linux/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- linux-Kconfig/arch/i386/kernel/cpu/cpufreq/longhaul.c	2002-12-13 16:48:16.000000000 +0100
+++ linux/arch/i386/kernel/cpu/cpufreq/longhaul.c	2002-12-15 12:46:35.000000000 +0100
@@ -586,7 +586,10 @@
 }
 
 
-static int longhaul_setpolicy (struct cpufreq_policy *policy)
+static int longhaul_event (struct cpufreq_policy *policy,
+			   unsigned int event,
+			   unsigned int target_freq,
+			   unsigned int relation)
 {
 	unsigned int    number_states = 0;
 	unsigned int    i;
@@ -782,8 +785,8 @@
 	driver->cpu_cur_freq[0] = currentspeed;
 #endif
 
-	driver->verify    = &longhaul_verify;
-	driver->setpolicy = &longhaul_setpolicy;
+	driver->verify = &longhaul_verify;
+	driver->event  = &longhaul_event;
 
 	driver->policy[0].cpu = 0;
 	driver->policy[0].min = (unsigned int) lowest_speed;
diff -ruN linux-Kconfig/arch/i386/kernel/cpu/cpufreq/longrun.c linux/arch/i386/kernel/cpu/cpufreq/longrun.c
--- linux-Kconfig/arch/i386/kernel/cpu/cpufreq/longrun.c	2002-12-13 16:48:16.000000000 +0100
+++ linux/arch/i386/kernel/cpu/cpufreq/longrun.c	2002-12-15 12:46:48.000000000 +0100
@@ -67,7 +67,10 @@
  * Sets a new CPUFreq policy on LongRun-capable processors. This function
  * has to be called with cpufreq_driver locked.
  */
-static int longrun_set_policy(struct cpufreq_policy *policy)
+static int longrun_event(struct cpufreq_policy *policy,
+			 unsigned int event,
+			 unsigned int target_freq,
+			 unsigned int relation)
 {
 	u32 msr_lo, msr_hi;
 	u32 pctg_lo, pctg_hi;
@@ -258,8 +261,8 @@
 	driver->cpu_cur_freq[0] = longrun_high_freq; /* dummy value */
 #endif
 
-	driver->verify         = &longrun_verify_policy;
-	driver->setpolicy      = &longrun_set_policy;
+	driver->verify = &longrun_verify_policy;
+	driver->event  = &longrun_event;
 
 	longrun_driver = driver;
 
diff -ruN linux-Kconfig/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c linux/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
--- linux-Kconfig/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c	2002-12-13 16:48:16.000000000 +0100
+++ linux/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c	2002-12-15 12:45:24.000000000 +0100
@@ -136,7 +136,10 @@
 }
 
 
-static int cpufreq_p4_setpolicy(struct cpufreq_policy *policy)
+static int cpufreq_p4_event(struct cpufreq_policy *policy,
+			    unsigned int event,
+			    unsigned int target_freq,
+			    unsigned int relation)
 {
 	unsigned int    i;
 	unsigned int    newstate = 0;
@@ -261,8 +264,8 @@
 	}
 #endif
 
-	driver->verify        = &cpufreq_p4_verify;
-	driver->setpolicy     = &cpufreq_p4_setpolicy;
+	driver->verify = &cpufreq_p4_verify;
+	driver->event  = &cpufreq_p4_event;
 
 	for (i=0;i<NR_CPUS;i++) {
 		if (has_N44_O17_errata)
diff -ruN linux-Kconfig/arch/i386/kernel/cpu/cpufreq/powernow-k6.c linux/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
--- linux-Kconfig/arch/i386/kernel/cpu/cpufreq/powernow-k6.c	2002-12-13 16:48:16.000000000 +0100
+++ linux/arch/i386/kernel/cpu/cpufreq/powernow-k6.c	2002-12-15 12:45:50.000000000 +0100
@@ -154,7 +154,10 @@
  *
  * sets a new CPUFreq policy
  */
-static int powernow_k6_setpolicy (struct cpufreq_policy *policy)
+static int powernow_k6_event (struct cpufreq_policy *policy,
+			      unsigned int event,
+			      unsigned int target_freq,
+			      unsigned int relation)
 {
 	unsigned int    number_states = 0;
 	unsigned int    i, j=4;
@@ -245,8 +248,8 @@
 	driver->cpu_cur_freq[0]  = busfreq * max_multiplier;
 #endif
 
-	driver->verify        = &powernow_k6_verify;
-	driver->setpolicy     = &powernow_k6_setpolicy;
+	driver->verify = &powernow_k6_verify;
+	driver->event  = &powernow_k6_event;
 
 	driver->policy[0].cpu    = 0;
 	driver->policy[0].min    = busfreq * 20;
diff -ruN linux-Kconfig/arch/i386/kernel/cpu/cpufreq/speedstep.c linux/arch/i386/kernel/cpu/cpufreq/speedstep.c
--- linux-Kconfig/arch/i386/kernel/cpu/cpufreq/speedstep.c	2002-12-13 16:48:16.000000000 +0100
+++ linux/arch/i386/kernel/cpu/cpufreq/speedstep.c	2002-12-15 12:47:35.000000000 +0100
@@ -567,7 +567,10 @@
  *
  * Sets a new CPUFreq policy.
  */
-static int speedstep_setpolicy (struct cpufreq_policy *policy)
+static int speedstep_event (struct cpufreq_policy *policy,
+			    unsigned int event,
+			    unsigned int target_freq,
+			    unsigned int relation)
 {
 	if (!speedstep_driver || !policy)
 		return -EINVAL;
@@ -696,8 +699,8 @@
 	driver->cpu_cur_freq[0] = speed;
 #endif
 
-	driver->verify      = &speedstep_verify;
-	driver->setpolicy   = &speedstep_setpolicy;
+	driver->verify = &speedstep_verify;
+	driver->event  = &speedstep_event;
 
 	driver->policy[0].cpu    = 0;
 	driver->policy[0].min    = speedstep_low_freq;
diff -ruN linux-Kconfig/drivers/acpi/processor.c linux/drivers/acpi/processor.c
--- linux-Kconfig/drivers/acpi/processor.c	2002-12-13 16:48:42.000000000 +0100
+++ linux/drivers/acpi/processor.c	2002-12-15 12:48:38.000000000 +0100
@@ -1655,8 +1655,10 @@
    -------------------------------------------------------------------------- */
 #ifdef CONFIG_ACPI_PROCESSOR_PERF
 static int
-acpi_cpufreq_setpolicy (
-	struct cpufreq_policy   *policy)
+acpi_cpufreq_event (struct cpufreq_policy *policy,
+		    unsigned int event,
+		    unsigned int target_freq,
+		    unsigned int relation)
 {
 	unsigned int cpu = 0;
 	unsigned int i = 0;
@@ -1664,7 +1666,7 @@
 	unsigned int next_state = 0;
 	unsigned int result = 0;
 
-	ACPI_FUNCTION_TRACE("acpi_cpufreq_setpolicy");
+	ACPI_FUNCTION_TRACE("acpi_cpufreq_event");
 
 	if (!policy)
 		return_VALUE(-EINVAL);
@@ -1858,8 +1860,8 @@
 			driver->policy[0].cpuinfo.transition_latency = pr->performance.states[i].transition_latency;
 	}
 
-	driver->verify      = &acpi_cpufreq_verify;
-	driver->setpolicy   = &acpi_cpufreq_setpolicy;
+	driver->verify = &acpi_cpufreq_verify;
+	driver->event  = &acpi_cpufreq_event;
 
 	for (i=0;i<NR_CPUS;i++) {
 		driver->policy[i].cpu    = pr->id;
diff -ruN linux-Kconfig/include/linux/cpufreq.h linux/include/linux/cpufreq.h
--- linux-Kconfig/include/linux/cpufreq.h	2002-12-13 16:48:47.000000000 +0100
+++ linux/include/linux/cpufreq.h	2002-12-15 12:39:32.000000000 +0100
@@ -104,27 +104,33 @@
 
 
 /*********************************************************************
- *                      DYNAMIC CPUFREQ INTERFACE                    *
+ *                      CPUFREQ GOVERNOR INTERFACE                   *
  *********************************************************************/
-#ifdef CONFIG_CPU_FREQ_DYNAMIC
-/* TBD */
-#endif /* CONFIG_CPU_FREQ_DYNAMIC */
+/* events */
+#define CPUFREQ_EVENT_INIT              1
+#define CPUFREQ_EVENT_EXIT              2
+#define CPUFREQ_EVENT_CHANGE_LIMITS     3
+
+/* relation */
+/* as close to target_freq as possible, but no higher */
+#define CPUFREQ_REL_H                   0 
+/* as close to target_freq as possible, but no lower */
+#define CPUFREQ_REL_L                   1
 
 
 /*********************************************************************
  *                      CPUFREQ DRIVER INTERFACE                     *
  *********************************************************************/
 
-typedef int (*cpufreq_policy_t)          (struct cpufreq_policy *policy);
-
 struct cpufreq_driver {
-	/* needed by all drivers */
-	cpufreq_policy_t        verify;
-	cpufreq_policy_t        setpolicy;
+	/* pointer to policy struct array for all CPUs */
 	struct cpufreq_policy   *policy;
-#ifdef CONFIG_CPU_FREQ_DYNAMIC
-	/* TBD */
-#endif
+	/* verify and event callbacks */
+	int     (*verify)       (struct cpufreq_policy *policy);
+	int     (*event)        (struct cpufreq_policy *policy,
+				 unsigned int event,
+				 unsigned int target_freq,
+				 unsigned int relation);
 	/* 2.4. compatible API */
 #ifdef CONFIG_CPU_FREQ_24_API
 	unsigned int            cpu_cur_freq[NR_CPUS];
diff -ruN linux-Kconfig/kernel/cpufreq.c linux/kernel/cpufreq.c
--- linux-Kconfig/kernel/cpufreq.c	2002-12-13 16:48:52.000000000 +0100
+++ linux/kernel/cpufreq.c	2002-12-15 13:08:07.000000000 +0100
@@ -798,7 +798,96 @@
 }
 EXPORT_SYMBOL(cpufreq_unregister_notifier);
 
+/*********************************************************************
+ *                          CPUFREQ GOVERNORS                        *
+ *********************************************************************/
+
+
+static int cpufreq_driver_event(struct cpufreq_policy *policy, 
+				unsigned int event, 
+				unsigned int target_freq, 
+				unsigned int relation)
+{
+	return cpufreq_driver->event(policy, event, target_freq, relation);
+}
+
+/*
+ * CPUfreq governor "performance": it selects the highest speed within
+ * the current cpufreq policy limit statically.
+ */
+static int cpufreq_governor_performance_event(struct cpufreq_policy *policy,
+					      unsigned int event)
+{
+	if (!policy)
+		return -EINVAL;
 
+	if (!cpu_online(policy->cpu))
+		return -ENODEV;
+
+	switch (event) {
+	case CPUFREQ_EVENT_INIT:
+		return 0;
+	case CPUFREQ_EVENT_CHANGE_LIMITS:
+		return cpufreq_driver_event(policy, event,
+					    policy->max, 
+					    CPUFREQ_REL_H);
+	case CPUFREQ_EVENT_EXIT:
+		return 0;
+	}
+	/* unknown event */
+	return -EINVAL;
+}
+
+/*
+ * CPUfreq governor "powersave": it selects the lowest speed within
+ * the current cpufreq policy limit statically.
+ */
+static int cpufreq_governor_powersave_event(struct cpufreq_policy *policy,
+					    unsigned int event)
+{
+	if (!policy)
+		return -EINVAL;
+
+	if (!cpu_online(policy->cpu))
+		return -ENODEV;
+
+	switch (event) {
+	case CPUFREQ_EVENT_INIT:
+		return 0;
+	case CPUFREQ_EVENT_CHANGE_LIMITS:
+		return cpufreq_driver_event(policy, event,
+					    policy->min, 
+					    CPUFREQ_REL_L);
+	case CPUFREQ_EVENT_EXIT:
+		return 0;
+	}
+	/* unknown event */
+	return -EINVAL;
+}
+
+
+/**
+ * cpufreq_governor_event_l - pass an event to the current cpufreq governor while all locks are held
+ * @cpu: affected CPU
+ * @event: event type
+ *
+ * This passes an event to the current cpufreq governor assigned to the specified CPU. It may only
+ * be called when all neccessary locks are held.
+ */
+int cpufreq_governor_event_l(unsigned int cpu, unsigned int event)
+{
+	if (!cpufreq_driver || !cpu_online(cpu))
+		return -ENODEV;
+	switch (cpufreq_driver->policy[cpu].policy) {
+	case CPUFREQ_POLICY_POWERSAVE:
+		return cpufreq_governor_powersave_event(&cpufreq_driver->policy[cpu], event);
+	case CPUFREQ_POLICY_PERFORMANCE:
+		return cpufreq_governor_performance_event(&cpufreq_driver->policy[cpu], event);
+	default:
+		return -EINVAL;
+	}
+	return -EINVAL;
+}
 
 /*********************************************************************
  *                          POLICY INTERFACE                         *
@@ -847,7 +936,7 @@
 
 	down(&cpufreq_driver_sem);
 	if (!cpufreq_driver || !cpufreq_driver->verify || 
-	    !cpufreq_driver->setpolicy || !policy ||
+	    !cpufreq_driver->event || !policy ||
 	    (policy->cpu >= NR_CPUS) || (!cpu_online(policy->cpu))) {
 		up(&cpufreq_driver_sem);
 		return -EINVAL;
@@ -909,8 +998,8 @@
 		cpu_cur_freq[policy->cpu] = policy->max;
 #endif
 
-	ret = cpufreq_driver->setpolicy(policy);
-	
+	ret = cpufreq_governor_event_l(policy->cpu, CPUFREQ_EVENT_CHANGE_LIMITS);
+
 	up(&cpufreq_driver_sem);
 
 	return ret;
@@ -920,15 +1009,6 @@
 
 
 /*********************************************************************
- *                    DYNAMIC CPUFREQ SWITCHING                      *
- *********************************************************************/
-#ifdef CONFIG_CPU_FREQ_DYNAMIC
-/* TBD */
-#endif /* CONFIG_CPU_FREQ_DYNAMIC */
-
-
-
-/*********************************************************************
  *            EXTERNALLY AFFECTING FREQUENCY CHANGES                 *
  *********************************************************************/
 
@@ -1005,7 +1085,7 @@
 		return -EBUSY;
 	
 	if (!driver_data || !driver_data->verify || 
-	    !driver_data->setpolicy)
+	    !driver_data->event)
 		return -EINVAL;
 
 	down(&cpufreq_driver_sem);

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: 2.4.20 st + aic7xxx (Adaptec 19160B) + VIA KT333 repeatable freeze
From: caf @ 2002-12-15 12:49 UTC (permalink / raw)
  To: Keith Owens; +Cc: Kevin Easton, linux-kernel
In-Reply-To: <1047.1039952560@ocs3.intra.ocs.com.au>

On Sun, Dec 15, 2002 at 10:42:40PM +1100, Keith Owens wrote:
> On Fri, 13 Dec 2002 11:51:27 +1100, 
> Kevin Easton <kevin@sylandro.com> wrote:
> >I'm not sure exactly where this problem fits in, but I'm getting a 
> >completely repeatable freeze (100% lockup, no response to keyboard)
> >triggered by writing to /dev/st0 (dd if=/dev/urandom of=/dev/st0 bs=512
> >count=163840 will reproduce it).
> >So... does anyone have any ideas how I should start trying to track this
> >down?
> 
> Boot with nmi_watchdog=1 (smp) or nmi_watchdog=2 (smp or up), cat
> /proc/interrupts to verify that NMI is being used.  If the problem is a
> disabled spinloop then the watchdog will trip after 5 seconds and give
> you a trace which can be run through ksymoops.  If that trace does not
> give enough data to debug the problem, apply the kdb patch[*], read
> Documentation/kdb and start digging, bt first and debug from there.

Thanks, will try that in the morning.

	- Kevin.


^ permalink raw reply

* [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (15/21)
From: Osamu Tomita @ 2002-12-15 12:47 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox
In-Reply-To: <3DFC50E9.656B96D0@cinet.co.jp>

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (15/21)
This is support for standard parallel port of PC98.

diffstat:
 drivers/parport/parport_pc.c |   68 +++++++++++++++++++++++++++++++++++++++----
 include/linux/parport_pc.h   |   10 ++++++
 2 files changed, 73 insertions(+), 5 deletions(-)

Regards,
Osamu Tomita

[-- Attachment #2: parport.patch --]
[-- Type: text/plain, Size: 5042 bytes --]

diff -urN linux/drivers/parport/parport_pc.c linux98/drivers/parport/parport_pc.c
--- linux/drivers/parport/parport_pc.c	2002-12-10 09:17:53.000000000 +0900
+++ linux98/drivers/parport/parport_pc.c	2002-12-10 10:40:21.000000000 +0900
@@ -85,6 +85,8 @@
 #define DPRINTK(stuff...)
 #endif
 
+/* Indicates PC-9800 architecture  No:0 Yes:1 */
+extern int pc98;
 
 #define NR_SUPERIOS 3
 static struct superio_struct {	/* For Super-IO chips autodetection */
@@ -332,7 +334,10 @@
 
 unsigned char parport_pc_read_status(struct parport *p)
 {
-	return inb (STATUS (p));
+	if (pc98 && p->base == 0x40)
+		return ((inb(0x42) & 0x04) << 5) | PARPORT_STATUS_ERROR;
+	else
+		return inb (STATUS (p));
 }
 
 void parport_pc_disable_irq(struct parport *p)
@@ -1644,6 +1649,8 @@
 {
 	unsigned char r, w;
 
+	if (pc98 && pb->base == 0x40)
+		return PARPORT_MODE_PCSPP;
 	/*
 	 * first clear an eventually pending EPP timeout 
 	 * I (sailer@ife.ee.ethz.ch) have an SMSC chipset
@@ -1777,6 +1784,9 @@
 {
 	int ok = 0;
   
+	if (pc98 && pb->base == 0x40)
+		return 0;  /* never support */
+
 	clear_epp_timeout(pb);
 
 	/* try to tri-state the buffer */
@@ -1908,6 +1918,9 @@
 			config & 0x80 ? "Level" : "Pulses");
 
 		configb = inb (CONFIGB (pb));
+		if (pc98 && (CONFIGB(pb) == 0x14d) && ((configb & 0x38) == 0x30))
+			configb = (configb & ~0x38) | 0x28; /* IRQ 14 */
+
 		printk (KERN_DEBUG "0x%lx: ECP port cfgA=0x%02x cfgB=0x%02x\n",
 			pb->base, config, configb);
 		printk (KERN_DEBUG "0x%lx: ECP settings irq=", pb->base);
@@ -2048,6 +2061,9 @@
 	ECR_WRITE (pb, ECR_CNF << 5); /* Configuration MODE */
 
 	intrLine = (inb (CONFIGB (pb)) >> 3) & 0x07;
+	if (pc98 && (CONFIGB(pb) == 0x14d) && (intrLine == 6))
+		intrLine = 5; /* IRQ 14 */
+
 	irq = lookup[intrLine];
 
 	ECR_WRITE (pb, oecr);
@@ -2212,7 +2228,14 @@
 	struct parport tmp;
 	struct parport *p = &tmp;
 	int probedirq = PARPORT_IRQ_NONE;
-	if (check_region(base, 3)) return NULL;
+	if (pc98 && base == 0x40) {
+		int i;
+		for (i = 0; i < 8; i += 2)
+			if (check_region(base + i, 1)) return NULL;
+	} else {
+		if (check_region(base, 3)) return NULL;
+	}
+
 	priv = kmalloc (sizeof (struct parport_pc_private), GFP_KERNEL);
 	if (!priv) {
 		printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base);
@@ -2245,7 +2268,7 @@
 	if (base_hi && !check_region(base_hi,3))
 		parport_ECR_present(p);
 
-	if (base != 0x3bc) {
+	if (!pc98 && base != 0x3bc) {
 		if (!check_region(base+0x3, 5)) {
 			if (!parport_EPP_supported(p))
 				parport_ECPEPP_supported(p);
@@ -2343,7 +2366,12 @@
 		printk(KERN_INFO "%s: irq %d detected\n", p->name, probedirq);
 	parport_proc_register(p);
 
-	request_region (p->base, 3, p->name);
+	if (pc98 && p->base == 0x40) {
+		int i;
+		for (i = 0; i < 8; i += 2)
+			request_region(p->base + i, 1, p->name);
+	} else
+		request_region (p->base, 3, p->name);
 	if (p->size > 3)
 		request_region (p->base + 3, p->size - 3, p->name);
 	if (p->modes & PARPORT_MODE_ECP)
@@ -2413,7 +2441,13 @@
 		free_dma(p->dma);
 	if (p->irq != PARPORT_IRQ_NONE)
 		free_irq(p->irq, p);
-	release_region(p->base, 3);
+	if (pc98 && p->base == 0x40) {
+		int i;
+		for (i = 0; i < 8; i += 2)
+			release_region(p->base + i, 1);
+	} else
+		release_region(p->base, 3);
+
 	if (p->size > 3)
 		release_region(p->base + 3, p->size - 3);
 	if (p->modes & PARPORT_MODE_ECP)
@@ -2996,6 +3030,30 @@
 {
 	int count = 0;
 
+	if (pc98) {
+		/* Set default resource settings for old style parport */
+		int	base = 0x40;
+		int	base_hi = 0;
+		int	irq = PARPORT_IRQ_NONE;
+		int	dma = PARPORT_DMA_NONE;
+
+		/* Check PC9800 old style parport */
+		outb(inb(0x149) & ~0x10, 0x149); /* disable IEEE1284 */
+		if (!(inb(0x149) & 0x10)) {  /* IEEE1284 disabled ? */
+			outb(inb(0x149) | 0x10, 0x149); /* enable IEEE1284 */
+			if (inb(0x149) & 0x10) {  /* IEEE1284 enabled ? */
+				/* Set default settings for IEEE1284 parport */
+				base = 0x140;
+				base_hi = 0x14c;
+				irq = 14;
+				/* dma = PARPORT_DMA_NONE; */
+			}
+		}
+
+		if (parport_pc_probe_port(base, base_hi, irq, dma, NULL))
+			count++;
+	}
+
 	if (parport_pc_probe_port(0x3bc, 0x7bc, autoirq, autodma, NULL))
 		count++;
 	if (parport_pc_probe_port(0x378, 0x778, autoirq, autodma, NULL))
diff -urN linux/include/linux/parport_pc.h linux98/include/linux/parport_pc.h
--- linux/include/linux/parport_pc.h	Tue Jun 12 11:15:27 2001
+++ linux98/include/linux/parport_pc.h	Sun Aug 19 14:13:09 2001
@@ -119,6 +119,11 @@
 #endif
 	ctr = (ctr & ~mask) ^ val;
 	ctr &= priv->ctr_writable; /* only write writable bits. */
+#ifdef CONFIG_PC9800
+	if (p->base == 0x40 && ((priv->ctr) ^ ctr) & 0x01)
+		outb(0x0e | ((ctr & 0x01) ^ 0x01), 0x46);
+	else
+#endif /* CONFIG_PC9800 */
 	outb (ctr, CONTROL (p));
 	priv->ctr = ctr;	/* Update soft copy */
 	return ctr;
@@ -191,6 +196,11 @@
 
 extern __inline__ unsigned char parport_pc_read_status(struct parport *p)
 {
+#ifdef CONFIG_PC9800
+	if (p->base == 0x40)
+		return ((inb(0x42) & 0x04) << 5) | PARPORT_STATUS_ERROR;
+	else
+#endif /* CONFIG_PC9800 */
 	return inb(STATUS(p));
 }
 

^ permalink raw reply

* [offtopic] Documentation about the Classic GUS schematics
From: Juan Linietsky @ 2002-12-15 12:40 UTC (permalink / raw)
  To: alsa-devel

Hello!

I am looking for documentation on the schematics and working of the 
Gravis Ultrasound Classic with the hopes to add support for it in 
DOSEMU. Unfortunatedly I failed to find information about it
on the net. Does anyone here know where can i find
such information?

Thanks in advance

Juan Linietsky


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/

^ permalink raw reply

* Re: Symlink indirection
From: John Bradford @ 2002-12-15 12:58 UTC (permalink / raw)
  To: Andrew Walrond; +Cc: junkio, linux-kernel
In-Reply-To: <3DFC72E4.30400@walrond.org>

> > "AW" == Andrew Walrond <andrew@walrond.org> gives an example of
> > a/{x,y,z}, b/{y,z}, c/z mounted on d/. in that order, later
> > mounts covering the earlier ones.
> > 
> > AW> echo "d/w" > d/w would create a new file in directory a.

I disagree.  It should create it in directory d, even though that is
the mount point.

A union mount should include files from another directory, but writes
should go to the actual named directory.

> > Back to your example; what do you wish to happen when we do
> > this?
> > 
> >     $ mv d/z d/zz && test -f d/z && cat d/z
> > 
> > Here we rename d/z (which is really c/z) to zz.  Does this
> > reveal z that used to be hidden by that, namely b/z, and "cat
> > d/z" now shows "b/z"?
> 
> Yes - exactly

Union mounts should be read only.

If read-write union mounts are needed, I don't think that we should
implement them significantly differently to the way they work in BSD.

John.

^ permalink raw reply

* help on subscribing
From: Nicholas Ho @ 2002-12-15 12:38 UTC (permalink / raw)
  To: linux-c-programming

Hi, how do i subscribe to this mailing list?
-Nicholas-


^ permalink raw reply

* [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (14/21)
From: Osamu Tomita @ 2002-12-15 12:43 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox
In-Reply-To: <3DFC50E9.656B96D0@cinet.co.jp>

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (14/21)
This patch contains changes under kernel/*.

diffstat:
 kernel/dma.c   |    3 +++
 kernel/ksyms.c |    4 ++++
 kernel/timer.c |    5 +++++
 3 files changed, 12 insertions(+)

Regards,
Osamu Tomita

[-- Attachment #2: kernel.patch --]
[-- Type: text/plain, Size: 1551 bytes --]

diff -urN linux/kernel/dma.c linux98/kernel/dma.c
--- linux/kernel/dma.c	Sun Aug 11 10:41:22 2002
+++ linux98/kernel/dma.c	Wed Aug 21 09:53:59 2002
@@ -9,6 +9,7 @@
  *   [It also happened to remove the sizeof(char *) == sizeof(int)
  *   assumption introduced because of those /proc/dma patches. -- Hennus]
  */
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -62,10 +63,12 @@
 	{ 0, 0 },
 	{ 0, 0 },
 	{ 0, 0 },
+#ifndef CONFIG_PC9800
 	{ 1, "cascade" },
 	{ 0, 0 },
 	{ 0, 0 },
 	{ 0, 0 }
+#endif
 };
 
 
diff -urN linux/kernel/ksyms.c linux98/kernel/ksyms.c
--- linux/kernel/ksyms.c	2002-12-10 09:17:59.000000000 +0900
+++ linux98/kernel/ksyms.c	2002-12-10 10:37:55.000000000 +0900
@@ -604,6 +604,10 @@
 EXPORT_SYMBOL(__per_cpu_offset);
 #endif
 
+/* Whether PC-9800 architecture or not  No:0 Yes:1 */
+int pc98 = 0;
+EXPORT_SYMBOL(pc98);
+
 /* debug */
 EXPORT_SYMBOL(dump_stack);
 
diff -urN linux/kernel/timer.c linux98/kernel/timer.c
--- linux/kernel/timer.c	Mon Nov 18 13:29:29 2002
+++ linux98/kernel/timer.c	Tue Nov 19 10:57:26 2002
@@ -433,8 +433,13 @@
 /*
  * Timekeeping variables
  */
+#ifndef CONFIG_PC9800
 unsigned long tick_usec = TICK_USEC; 		/* ACTHZ   period (usec) */
 unsigned long tick_nsec = TICK_NSEC(TICK_USEC);	/* USER_HZ period (nsec) */
+#else
+extern unsigned long tick_usec; 		/* ACTHZ   period (usec) */
+extern unsigned long tick_nsec;			/* USER_HZ period (nsec) */
+#endif
 
 /* The current time */
 struct timespec xtime __attribute__ ((aligned (16)));

^ permalink raw reply

* [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (13/21)
From: Osamu Tomita @ 2002-12-15 12:39 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alan Cox
In-Reply-To: <3DFC50E9.656B96D0@cinet.co.jp>

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (13/21)
This patch contains PC speaker driver for PC98 and changes for 
support japanese "KANA" characters. Japanese keybord has KANA
shift key and KANA LED.

diffstat:
 drivers/char/keyboard.c     |    4 +
 drivers/input/misc/98spkr.c |   95 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/input/misc/Kconfig  |    4 +
 drivers/input/misc/Makefile |    1 
 include/linux/kbd_kern.h    |    5 +-
 include/linux/keyboard.h    |    1 
 6 files changed, 108 insertions(+), 2 deletions(-)

Regards,
Osamu Tomita

[-- Attachment #2: input.patch --]
[-- Type: text/plain, Size: 5050 bytes --]

diff -urN linux/drivers/input/misc/98spkr.c linux98/drivers/input/misc/98spkr.c
--- linux/drivers/input/misc/98spkr.c	Thu Jan  1 09:00:00 1970
+++ linux98/drivers/input/misc/98spkr.c	Sat Nov 16 13:05:59 2002
@@ -0,0 +1,95 @@
+/*
+ *  PC-9800 Speaker beeper driver for Linux
+ *
+ *  Copyright (c) 2002 Osamu Tomita
+ *  Copyright (c) 2002 Vojtech Pavlik
+ *  Copyright (c) 1992 Orest Zborowski
+ *
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/input.h>
+#include <asm/io.h>
+
+MODULE_AUTHOR("Osamu Tomita <tomita@cinet.co.jp>");
+MODULE_DESCRIPTION("PC-9800 Speaker beeper driver");
+MODULE_LICENSE("GPL");
+
+static char spkr98_name[] = "PC-9801 Speaker";
+static char spkr98_phys[] = "isa3fdb/input0";
+static struct input_dev spkr98_dev;
+
+spinlock_t i8253_beep_lock = SPIN_LOCK_UNLOCKED;
+
+static int spkr98_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
+{
+	unsigned int count = 0;
+	unsigned long flags;
+
+	if (type != EV_SND)
+		return -1;
+
+	switch (code) {
+		case SND_BELL: if (value) value = 1000;
+		case SND_TONE: break;
+		default: return -1;
+	} 
+
+	if (value > 20 && value < 32767)
+		count = CLOCK_TICK_RATE / value;
+	
+	spin_lock_irqsave(&i8253_beep_lock, flags);
+
+	if (count) {
+		outb(0x76, 0x3fdf);
+		outb(0, 0x5f);
+		outb(count & 0xff, 0x3fdb);
+		outb(0, 0x5f);
+		outb((count >> 8) & 0xff, 0x3fdb);
+		/* beep on */
+		outb(6, 0x37);
+	} else {
+		/* beep off */
+		outb(7, 0x37);
+	}
+
+	spin_unlock_irqrestore(&i8253_beep_lock, flags);
+
+	return 0;
+}
+
+static int __init spkr98_init(void)
+{
+	spkr98_dev.evbit[0] = BIT(EV_SND);
+	spkr98_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
+	spkr98_dev.event = spkr98_event;
+
+	spkr98_dev.name = spkr98_name;
+	spkr98_dev.phys = spkr98_phys;
+	spkr98_dev.id.bustype = BUS_ISA;
+	spkr98_dev.id.vendor = 0x001f;
+	spkr98_dev.id.product = 0x0001;
+	spkr98_dev.id.version = 0x0100;
+
+	input_register_device(&spkr98_dev);
+
+        printk(KERN_INFO "input: %s\n", spkr98_name);
+
+	return 0;
+}
+
+static void __exit spkr98_exit(void)
+{
+        input_unregister_device(&spkr98_dev);
+}
+
+module_init(spkr98_init);
+module_exit(spkr98_exit);
diff -urN linux/drivers/input/misc/Kconfig linux98/drivers/input/misc/Kconfig
--- linux/drivers/input/misc/Kconfig	Mon Nov 11 12:28:11 2002
+++ linux98/drivers/input/misc/Kconfig	Sat Nov 16 13:08:21 2002
@@ -44,6 +44,10 @@
 	tristate "M68k Beeper support"
 	depends on M68K && INPUT && INPUT_MISC
 
+config INPUT_98SPKR
+	tristate "PC-9800 Speaker support"
+	depends on PC9800 && INPUT && INPUT_MISC
+
 config INPUT_UINPUT
 	tristate "User level driver support"
 	depends on INPUT && INPUT_MISC
diff -urN linux/drivers/input/misc/Makefile linux98/drivers/input/misc/Makefile
--- linux/drivers/input/misc/Makefile	Mon Nov 11 12:28:18 2002
+++ linux98/drivers/input/misc/Makefile	Sat Nov 16 13:09:03 2002
@@ -7,6 +7,7 @@
 obj-$(CONFIG_INPUT_SPARCSPKR)		+= sparcspkr.o
 obj-$(CONFIG_INPUT_PCSPKR)		+= pcspkr.o
 obj-$(CONFIG_INPUT_M68K_BEEP)		+= m68kspkr.o
+obj-$(CONFIG_INPUT_98SPKR)		+= 98spkr.o
 obj-$(CONFIG_INPUT_UINPUT)		+= uinput.o
 
 # The global Rules.make.
diff -urN linux/drivers/char/keyboard.c linux98/drivers/char/keyboard.c
--- linux/drivers/char/keyboard.c	Sat Oct 19 13:01:49 2002
+++ linux98/drivers/char/keyboard.c	Sun Oct 27 09:12:29 2002
@@ -58,7 +58,11 @@
  * Some laptops take the 789uiojklm,. keys as number pad when NumLock is on.
  * This seems a good reason to start with NumLock off.
  */
+#ifndef CONFIG_PC9800
 #define KBD_DEFLEDS 0
+#else
+#define KBD_DEFLEDS (1 << VC_NUMLOCK)
+#endif
 #endif
 
 #ifndef KBD_DEFLOCK
diff -urN linux/include/linux/kbd_kern.h linux98/include/linux/kbd_kern.h
--- linux/include/linux/kbd_kern.h	Sat Oct 19 13:02:28 2002
+++ linux98/include/linux/kbd_kern.h	Sun Oct 27 10:23:23 2002
@@ -43,11 +43,12 @@
 #define LED_SHOW_IOCTL 1        /* only change leds upon ioctl */
 #define LED_SHOW_MEM 2          /* `heartbeat': peek into memory */
 
-	unsigned char ledflagstate:3;	/* flags, not lights */
-	unsigned char default_ledflagstate:3;
+	unsigned char ledflagstate:4;	/* flags, not lights */
+	unsigned char default_ledflagstate:4;
 #define VC_SCROLLOCK	0	/* scroll-lock mode */
 #define VC_NUMLOCK	1	/* numeric lock mode */
 #define VC_CAPSLOCK	2	/* capslock mode */
+#define VC_KANALOCK	3	/* kanalock mode */
 
 	unsigned char kbdmode:2;	/* one 2-bit value */
 #define VC_XLATE	0	/* translate keycodes using keymap */
diff -urN linux/include/linux/keyboard.h linux98/include/linux/keyboard.h
--- linux/include/linux/keyboard.h	Sat Oct 19 13:01:13 2002
+++ linux98/include/linux/keyboard.h	Mon Oct 21 15:59:48 2002
@@ -9,6 +9,7 @@
 #define KG_ALT		3
 #define KG_ALTGR	1
 #define KG_SHIFTL	4
+#define KG_KANASHIFT	4
 #define KG_SHIFTR	5
 #define KG_CTRLL	6
 #define KG_CTRLR	7

^ permalink raw reply

* Re: detecting if compiled or loaded modules
From: Patrick Schaaf @ 2002-12-15 12:30 UTC (permalink / raw)
  To: 24; +Cc: netfilter-devel
In-Reply-To: <20021215133954.70ad328c.24@k0n.org>

>Is there a way to determine if one of the Netfilter Configs is loaded
>as module or built-in in the kernel?

Have a look at /proc/ksyms. But that's not portable, probably not even
to the future 2.6 kernel.

There is no other way. Normal, sane people don't need a GUI to load
their modules. Their init scripts do it for them already. So, there is
no pressing need, especially for an iptables specific solution.

The best you can probably do, is just try to load the module, and ignore
the error case which says "already loaded". Talk to the insmod maintainers
if you have trouble with detecting that error case properly.

best regards
  Patrick

-- 
Who runs GUI programs as root, anyway?

^ 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.