All of lore.kernel.org
 help / color / mirror / Atom feed
* 2.6.12 breaks 8139cp
@ 2005-06-22 21:03 Pierre Ossman
  2005-06-22 21:34 ` Bjorn Helgaas
  2005-06-23 17:17 ` 2.6.12 breaks 8139cp Roberto Oppedisano
  0 siblings, 2 replies; 36+ messages in thread
From: Pierre Ossman @ 2005-06-22 21:03 UTC (permalink / raw)
  To: LKML; +Cc: jgarzik

Upgrading from 2.6.11 to 2.6.12 caused my 8139cp network card to stop
working. No error messages are emitted and everything seems to work
(from the local computers point of view). But nothing can be recieved
from the network.

Since 8139cp.c hasn't undergone any significant changes between the
versions the bug must be in something related. Any ideas?

Rgds
Pierre

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-22 21:03 2.6.12 breaks 8139cp Pierre Ossman
@ 2005-06-22 21:34 ` Bjorn Helgaas
  2005-06-23  7:50   ` Pierre Ossman
  2005-06-23 17:17 ` 2.6.12 breaks 8139cp Roberto Oppedisano
  1 sibling, 1 reply; 36+ messages in thread
From: Bjorn Helgaas @ 2005-06-22 21:34 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: LKML, jgarzik

On Wednesday 22 June 2005 3:03 pm, Pierre Ossman wrote:
> Upgrading from 2.6.11 to 2.6.12 caused my 8139cp network card to stop
> working. No error messages are emitted and everything seems to work
> (from the local computers point of view). But nothing can be recieved
> from the network.

You might post a little more information (i.e., the 2.6.12 dmesg and
possibly a diff vs. 2.6.11).  My guess is something's busted with its
IRQ.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-22 21:34 ` Bjorn Helgaas
@ 2005-06-23  7:50   ` Pierre Ossman
  2005-06-23 12:59     ` Felipe W Damasio
  2005-06-23 17:43     ` Bjorn Helgaas
  0 siblings, 2 replies; 36+ messages in thread
From: Pierre Ossman @ 2005-06-23  7:50 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: LKML, jgarzik

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

Bjorn Helgaas wrote:

>On Wednesday 22 June 2005 3:03 pm, Pierre Ossman wrote:
>  
>
>>Upgrading from 2.6.11 to 2.6.12 caused my 8139cp network card to stop
>>working. No error messages are emitted and everything seems to work
>>(from the local computers point of view). But nothing can be recieved
>>from the network.
>>    
>>
>
>You might post a little more information (i.e., the 2.6.12 dmesg and
>possibly a diff vs. 2.6.11).  My guess is something's busted with its
>IRQ.
>  
>

dmesg:s included. But they don't really differ more than some cosmetic
changes in the output strings.

The problem is I can't find anything that differs. 2.6.12 behaves more
or less like someone cut of the rx pins in the connector. ifconfig
doesn't report any errors so it isn't a problem with packets getting
dropped. tcpdump only shows the outgoing packets.

Any more ideas on what I should examine to find any differences?

Rgds
Pierre


[-- Attachment #2: dmesg-2.6.11 --]
[-- Type: text/plain, Size: 15412 bytes --]

000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000001ffd0000 (usable)
 BIOS-e820: 000000001ffd0000 - 000000001fff0c00 (reserved)
 BIOS-e820: 000000001fff0c00 - 000000001fffc000 (ACPI NVS)
 BIOS-e820: 000000001fffc000 - 0000000020000000 (reserved)
511MB LOWMEM available.
On node 0 totalpages: 131024
  DMA zone: 4096 pages, LIFO batch:1
  Normal zone: 126928 pages, LIFO batch:16
  HighMem zone: 0 pages, LIFO batch:1
DMI 2.3 present.
ACPI: RSDP (v000 COMPAQ                                ) @ 0x000f6560
ACPI: RSDT (v001 HP     CPQ0860  0x13090420 CPQ  0x00000001) @ 0x1fff0c84
ACPI: FADT (v002 HP     CPQ0860  0x00000002 CPQ  0x00000001) @ 0x1fff0c00
ACPI: SSDT (v001 COMPAQ  CPQGysr 0x00001001 MSFT 0x0100000e) @ 0x1fff5c3c
ACPI: DSDT (v001 HP       nx7000 0x00010000 MSFT 0x0100000e) @ 0x00000000
ACPI: PM-Timer IO Port: 0x1008
Allocating PCI resources starting at 20000000 (gap: 20000000:e0000000)
Built 1 zonelists
Kernel command line: ro root=/dev/hda5 rhgb quiet
Local APIC disabled by BIOS -- you can enable it with "lapic"
mapped APIC to ffffd000 (01404000)
Initializing CPU#0
CPU 0 irqstacks, hard=c0541000 soft=c0540000
PID hash table entries: 2048 (order: 11, 32768 bytes)
Detected 1594.918 MHz processor.
Using pmtmr for high-res timesource
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 512904k/524096k available (3371k kernel code, 10588k reserved, 732k data, 220k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay loop... 3162.11 BogoMIPS (lpj=1581056)
Security Framework v1.0.0 initialized
Capability LSM initialized
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: After generic identify, caps: a7e9f9bf 00000000 00000000 00000000 00000180 00000000 00000000
CPU: After vendor identify, caps: a7e9f9bf 00000000 00000000 00000000 00000180 00000000 00000000
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 1024K
CPU: After all inits, caps: a7e9f9bf 00000000 00000000 00000040 00000180 00000000 00000000
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU: Intel(R) Pentium(R) M processor 1600MHz stepping 05
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Checking 'hlt' instruction... OK.
ACPI: setting ELCR to 0200 (from 0c20)
checking if image is initramfs... it is
Freeing initrd memory: 1090k freed
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xf031f, last bus=3
PCI: Using configuration type 1
mtrr: v2.0 (20020519)
ACPI: Subsystem revision 20050211
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: PCI Root Bridge [C046] (00:00)
PCI: Probing PCI hardware (bus 00)
PCI: Ignoring BAR0-3 of IDE controller 0000:00:1f.1
PCI: Via IRQ fixup
PCI: Transparent bridge - 0000:00:1e.0
ACPI: PCI Interrupt Routing Table [\_SB_.C046._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.C046.C047._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.C046.C058._PRT]
ACPI: Embedded Controller [C0EA] (gpe 28)
ACPI: Power Resource [C18D] (on)
ACPI: Power Resource [C195] (on)
ACPI: Power Resource [C19C] (on)
ACPI: Power Resource [C1A6] (on)
ACPI: PCI Interrupt Link [C0C2] (IRQs 5 *10)
ACPI: PCI Interrupt Link [C0C3] (IRQs 5 *10)
ACPI: PCI Interrupt Link [C0C4] (IRQs *5 10)
ACPI: PCI Interrupt Link [C0C5] (IRQs *5 10)
ACPI: PCI Interrupt Link [C0C6] (IRQs 5 10) *0, disabled.
ACPI: PCI Interrupt Link [C0C7] (IRQs 5 10) *11
ACPI: PCI Interrupt Link [C0C8] (IRQs 5 10) *0, disabled.
ACPI: PCI Interrupt Link [C0C9] (IRQs *5 10)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
pnp: PnP ACPI: found 15 devices
PnPBIOS: Disabled by ACPI PNP
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Using ACPI for IRQ routing
** PCI interrupts are no longer routed automatically.  If this
** causes a device to stop working, it is probably because the
** driver failed to call pci_enable_device().  As a temporary
** workaround, the "pci=routeirq" argument restores the old
** behavior.  If this argument makes the device work again,
** please email the output of "lspci" to bjorn.helgaas@hp.com
** so I can fix the driver.
pnp: the driver 'system' has been registered
pnp: match found with the PnP device '00:00' and the driver 'system'
pnp: match found with the PnP device '00:0c' and the driver 'system'
pnp: match found with the PnP device '00:0d' and the driver 'system'
pnp: 00:0d: ioport range 0x4d0-0x4d1 has been reserved
pnp: 00:0d: ioport range 0x1000-0x107f could not be reserved
pnp: 00:0d: ioport range 0x1100-0x113f has been reserved
pnp: 00:0d: ioport range 0x1200-0x121f has been reserved
pnp: match found with the PnP device '00:0e' and the driver 'system'
apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16ac)
apm: overridden by ACPI.
audit: initializing netlink socket (disabled)
audit(1119514693.293:0): initialized
Total HugeTLB memory allocated, 0
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
SGI XFS with ACLs, security attributes, no debug enabled
SGI XFS Quota Management subsystem
Initializing Cryptographic API
ACPI: CPU0 (power states: C1[C1] C2[C2] C3[C3])
ACPI: Processor [CPU0] (supports 8 throttling states)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Real Time Clock Driver v1.12
Linux agpgart interface v0.100 (c) Dave Jones
agpgart: Detected an Intel 855PM Chipset.
agpgart: Maximum main memory to use for agp memory: 439M
agpgart: AGP aperture is 256M @ 0xb0000000
[drm] Initialized drm 1.0.0 20040925
ACPI: PS/2 Keyboard Controller [C1A3] at I/O 0x60, 0x64, irq 1
ACPI: PS/2 Mouse Controller [C1A4] at irq 12
i8042.c: Detected active multiplexing controller, rev 1.1.
serio: i8042 AUX0 port at 0x60,0x64 irq 12
serio: i8042 AUX1 port at 0x60,0x64 irq 12
serio: i8042 AUX2 port at 0x60,0x64 irq 12
serio: i8042 AUX3 port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS2 at I/O 0x3e8 (irq = 3) is a 16550A
pnp: the driver 'serial' has been registered
pnp: match found with the PnP device '00:03' and the driver 'serial'
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ACPI: PCI Interrupt Link [C0C3] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ACPI: PCI interrupt 0000:00:1f.6[B] -> GSI 10 (level, low) -> IRQ 10
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ICH4: IDE controller at PCI slot 0000:00:1f.1
PCI: Enabling device 0000:00:1f.1 (0005 -> 0007)
ACPI: PCI Interrupt Link [C0C4] enabled at IRQ 5
PCI: setting IRQ 5 as level-triggered
ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI 5 (level, low) -> IRQ 5
ICH4: chipset revision 1
ICH4: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0x4c40-0x4c47, BIOS settings: hda:DMA, hdb:pio
    ide1: BM-DMA at 0x4c48-0x4c4f, BIOS settings: hdc:DMA, hdd:pio
Probing IDE interface ide0...
hda: TOSHIBA MK4025GAS, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: HL-DT-STCD-RW/DVD DRIVE GCC-4241N, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
pnp: the driver 'ide' has been registered
ide2: I/O resource 0x3EE-0x3EE not free.
ide2: ports already in use, skipping probe
Probing IDE interface ide3...
Probing IDE interface ide4...
Probing IDE interface ide5...
hda: max request size: 128KiB
hda: 78140160 sectors (40007 MB), CHS=65535/16/63, UDMA(100)
hda: cache flushes supported
 hda: hda1 hda2 hda3 hda4 < hda5 hda6 >
hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache, DMA
Uniform CD-ROM driver Revision: 3.20
ide-floppy driver 0.99.newide
usbcore: registered new driver hiddev
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
mice: PS/2 mouse device common for all mice
input: AT Translated Set 2 keyboard on isa0060/serio0
Synaptics Touchpad, model: 1
 Firmware: 5.9
 Sensor: 35
 new absolute packet format
 Touchpad has extended capability bits
 -> multifinger detection
 -> palm detection
input: SynPS/2 Synaptics TouchPad on isa0060/serio4
NET: Registered protocol family 2
IP: routing cache hash table of 1024 buckets, 32Kbytes
TCP established hash table entries: 32768 (order: 6, 262144 bytes)
TCP bind hash table entries: 32768 (order: 7, 917504 bytes)
TCP: Hash tables configured (established 32768 bind 32768)
Initializing IPsec netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 17
Software Suspend Core.
Software Suspend text mode support loaded.
Software Suspend LZF Compression Driver registered.
Software Suspend Swap Writer registered.
ACPI wakeup devices: 
C058 C1AD C1A3 C1A4 C0AC C0B3 C0B4 C0B5 C0E7 C136 
ACPI: (supports S0 S3 S4 S4bios S5)
Freeing unused kernel memory: 220k freed
Looking for first block of swap header at block 0.
Setting logical block size of resume device to 4096.
Software Suspend 2.1.8: Swap space signature found.
Software Suspend 2.1.8: Suspending enabled.
Software Suspend 2.1.8: This is normal swap space.
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting.  Commit interval 5 seconds
8139cp: 10/100 PCI Ethernet driver v1.2 (Mar 22, 2004)
ACPI: PCI interrupt 0000:02:01.0[A] -> GSI 10 (level, low) -> IRQ 10
eth0: RTL-8139C+ at 0xe0828000, 00:02:3f:22:db:8c, IRQ 10
ieee80211_crypt: registered algorithm 'NULL'
ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.0.4
ipw2200: Copyright(c) 2003-2004 Intel Corporation
ACPI: PCI Interrupt Link [C0C5] enabled at IRQ 5
ACPI: PCI interrupt 0000:02:02.0[A] -> GSI 5 (level, low) -> IRQ 5
ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
ipw2200: Radio Frequency Kill Switch is On:
Kill switch must be turned off for wireless networking to work.
ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 10 (level, low) -> IRQ 10
PCI: Setting latency timer of device 0000:00:1f.5 to 64
intel8x0_measure_ac97_clock: measured 49284 usecs
intel8x0: clocking to 48000
ACPI: PCI interrupt 0000:00:1f.6[B] -> GSI 10 (level, low) -> IRQ 10
PCI: Setting latency timer of device 0000:00:1f.6 to 64
hw_random: RNG not detected
ACPI: PCI Interrupt Link [C0C9] enabled at IRQ 5
ACPI: PCI interrupt 0000:00:1d.7[D] -> GSI 5 (level, low) -> IRQ 5
ehci_hcd 0000:00:1d.7: EHCI Host Controller
PCI: Setting latency timer of device 0000:00:1d.7 to 64
ehci_hcd 0000:00:1d.7: irq 5, pci mem 0xa0000000
ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 1
PCI: cache line size of 32 is not supported by device 0000:00:1d.7
ehci_hcd 0000:00:1d.7: USB 2.0 initialized, EHCI 1.00, driver 10 Dec 2004
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 6 ports detected
USB Universal Host Controller Interface driver v2.2
ACPI: PCI Interrupt Link [C0C2] enabled at IRQ 10
ACPI: PCI interrupt 0000:00:1d.0[A] -> GSI 10 (level, low) -> IRQ 10
uhci_hcd 0000:00:1d.0: UHCI Host Controller
PCI: Setting latency timer of device 0000:00:1d.0 to 64
uhci_hcd 0000:00:1d.0: irq 10, io base 0x48c0
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
ACPI: PCI interrupt 0000:00:1d.1[B] -> GSI 5 (level, low) -> IRQ 5
uhci_hcd 0000:00:1d.1: UHCI Host Controller
PCI: Setting latency timer of device 0000:00:1d.1 to 64
uhci_hcd 0000:00:1d.1: irq 5, io base 0x48e0
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 3
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
ACPI: PCI interrupt 0000:00:1d.2[C] -> GSI 5 (level, low) -> IRQ 5
uhci_hcd 0000:00:1d.2: UHCI Host Controller
PCI: Setting latency timer of device 0000:00:1d.2 to 64
uhci_hcd 0000:00:1d.2: irq 5, io base 0x4c00
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 4
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 2 ports detected
Linux Kernel Card Services
  options:  [pci] [cardbus] [pm]
ACPI: PCI interrupt 0000:02:04.0[A] -> GSI 5 (level, low) -> IRQ 5
Yenta: CardBus bridge found at 0000:02:04.0 [0e11:0860]
Yenta: Using CSCINT to route CSC interrupts to PCI
Yenta: Routing CardBus interrupts to PCI
Yenta TI: socket 0000:02:04.0, mfunc 0x001c1112, devctl 0x44
Yenta: ISA IRQ mask 0x0000, PCI irq 5
Socket status: 30000006
ieee1394: Initialized config rom entry `ip1394'
ohci1394: $Rev: 1223 $ Ben Collins <bcollins@debian.org>
ACPI: PCI interrupt 0000:02:00.0[A] -> GSI 10 (level, low) -> IRQ 10
ohci1394: fw-host0: OHCI-1394 1.0 (PCI): IRQ=[10]  MMIO=[90200000-902007ff]  Max Packet=[1024]
ieee1394: Host added: ID:BUS[0-00:1023]  GUID[00023f454a000284]
ACPI: AC Adapter [C134] (on-line)
ACPI: Battery Slot [C11F] (battery absent)
ACPI: Power Button (FF) [PWRF]
ACPI: Lid Switch [C136]
ibm_acpi: ec object not found
ACPI: Video Device [C0D0] (multi-head: yes  rom: no  post: no)
EXT3 FS on hda5, internal journal
kjournald starting.  Commit interval 5 seconds
EXT3 FS on hda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Adding 977248k swap on /dev/hda2.  Priority:-1 extents:1
ip_tables: (C) 2000-2002 Netfilter core team
ip_conntrack version 2.1 (4094 buckets, 32752 max) - 244 bytes per conntrack
cs: IO port probe 0xc00-0xcff: clean.
cs: IO port probe 0x800-0x8ff: clean.
cs: IO port probe 0x100-0x4ff: excluding 0x140-0x14f 0x200-0x20f 0x378-0x37f
cs: IO port probe 0xa00-0xaff: clean.
Bluetooth: Core ver 2.7
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP ver 2.7
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM ver 1.5
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: HIDP (Human Interface Emulation) ver 1.1
NET: Registered protocol family 23
IrCOMM protocol (Dag Brattli)
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
IrDA: Registered device irda0 (irport io=0x3E8 irq=3)
drivers/net/irda/irport.c:442: spin_is_locked(drivers/net/irda/irport.c:db025608) already locked by drivers/net/irda/irport.c/912
drivers/net/irda/irport.c:443: spin_lock(drivers/net/irda/irport.c:db025608) already locked by drivers/net/irda/irport.c/912
drivers/net/irda/irport.c:919: spin_unlock(drivers/net/irda/irport.c:db025608) not locked
pnp: the driver 'parport_pc' has been registered
pnp: match found with the PnP device '00:05' and the driver 'parport_pc'
parport: PnPBIOS parport detected.
parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP,TRISTATE]
lp0: using parport0 (interrupt-driven).
lp0: console ready
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
ACPI: PCI interrupt 0000:01:00.0[A] -> GSI 10 (level, low) -> IRQ 10
[drm] Initialized radeon 1.14.0 20050125 on minor 0: 
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
ipw2200: failed to send SYSTEM_CONFIG command
ipw2200: ipw_send_system_config failed

[-- Attachment #3: dmesg-2.6.12 --]
[-- Type: text/plain, Size: 14881 bytes --]

Linux version 2.6.12 (root@poseidon.drzeus.cx) (gcc version 4.0.0 20050616 (Red Hat 4.0.0-12)) #3 Wed Jun 22 21:10:33 CEST 2005
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000001ffd0000 (usable)
 BIOS-e820: 000000001ffd0000 - 000000001fff0c00 (reserved)
 BIOS-e820: 000000001fff0c00 - 000000001fffc000 (ACPI NVS)
 BIOS-e820: 000000001fffc000 - 0000000020000000 (reserved)
511MB LOWMEM available.
On node 0 totalpages: 131024
  DMA zone: 4096 pages, LIFO batch:1
  Normal zone: 126928 pages, LIFO batch:31
  HighMem zone: 0 pages, LIFO batch:1
DMI 2.3 present.
ACPI: RSDP (v000 COMPAQ                                ) @ 0x000f6560
ACPI: RSDT (v001 HP     CPQ0860  0x13090420 CPQ  0x00000001) @ 0x1fff0c84
ACPI: FADT (v002 HP     CPQ0860  0x00000002 CPQ  0x00000001) @ 0x1fff0c00
ACPI: SSDT (v001 COMPAQ  CPQGysr 0x00001001 MSFT 0x0100000e) @ 0x1fff5c3c
ACPI: DSDT (v001 HP       nx7000 0x00010000 MSFT 0x0100000e) @ 0x00000000
ACPI: PM-Timer IO Port: 0x1008
Allocating PCI resources starting at 20000000 (gap: 20000000:e0000000)
Built 1 zonelists
Kernel command line: ro root=/dev/hda5 rhgb quiet
Local APIC disabled by BIOS -- you can enable it with "lapic"
mapped APIC to ffffd000 (01404000)
Initializing CPU#0
CPU 0 irqstacks, hard=c0542000 soft=c0541000
PID hash table entries: 2048 (order: 11, 32768 bytes)
Detected 1594.880 MHz processor.
Using pmtmr for high-res timesource
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 512892k/524096k available (3386k kernel code, 10600k reserved, 725k data, 216k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay loop... 3162.11 BogoMIPS (lpj=1581056)
Security Framework v1.0.0 initialized
Capability LSM initialized
Mount-cache hash table entries: 512
CPU: After generic identify, caps: a7e9f9bf 00000000 00000000 00000000 00000180 00000000 00000000
CPU: After vendor identify, caps: a7e9f9bf 00000000 00000000 00000000 00000180 00000000 00000000
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 1024K
CPU: After all inits, caps: a7e9f9bf 00000000 00000000 00000040 00000180 00000000 00000000
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU: Intel(R) Pentium(R) M processor 1600MHz stepping 05
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Checking 'hlt' instruction... OK.
ACPI: setting ELCR to 0200 (from 0c20)
checking if image is initramfs... it is
Freeing initrd memory: 1090k freed
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xf031f, last bus=3
PCI: Using configuration type 1
mtrr: v2.0 (20020519)
ACPI: Subsystem revision 20050309
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: PCI Root Bridge [C046] (0000:00)
PCI: Probing PCI hardware (bus 00)
PCI: Ignoring BAR0-3 of IDE controller 0000:00:1f.1
Boot video device is 0000:01:00.0
PCI: Transparent bridge - 0000:00:1e.0
ACPI: PCI Interrupt Routing Table [\_SB_.C046._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.C046.C047._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.C046.C058._PRT]
ACPI: Embedded Controller [C0EA] (gpe 28)
ACPI: Power Resource [C18D] (on)
ACPI: Power Resource [C195] (on)
ACPI: Power Resource [C19C] (on)
ACPI: Power Resource [C1A6] (on)
ACPI: PCI Interrupt Link [C0C2] (IRQs 5 *10)
ACPI: PCI Interrupt Link [C0C3] (IRQs 5 *10)
ACPI: PCI Interrupt Link [C0C4] (IRQs *5 10)
ACPI: PCI Interrupt Link [C0C5] (IRQs *5 10)
ACPI: PCI Interrupt Link [C0C6] (IRQs 5 10) *0, disabled.
ACPI: PCI Interrupt Link [C0C7] (IRQs 5 10) *11
ACPI: PCI Interrupt Link [C0C8] (IRQs 5 10) *0, disabled.
ACPI: PCI Interrupt Link [C0C9] (IRQs *5 10)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
pnp: PnP ACPI: found 15 devices
PnPBIOS: Disabled by ACPI PNP
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
pnp: the driver 'system' has been registered
pnp: match found with the PnP device '00:00' and the driver 'system'
pnp: match found with the PnP device '00:0c' and the driver 'system'
pnp: match found with the PnP device '00:0d' and the driver 'system'
pnp: 00:0d: ioport range 0x4d0-0x4d1 has been reserved
pnp: 00:0d: ioport range 0x1000-0x107f could not be reserved
pnp: 00:0d: ioport range 0x1100-0x113f has been reserved
pnp: 00:0d: ioport range 0x1200-0x121f has been reserved
pnp: match found with the PnP device '00:0e' and the driver 'system'
audit: initializing netlink socket (disabled)
audit(1119514452.486:0): initialized
Total HugeTLB memory allocated, 0
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
SGI XFS with ACLs, security attributes, no debug enabled
SGI XFS Quota Management subsystem
Initializing Cryptographic API
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Real Time Clock Driver v1.12
Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected an Intel 855PM Chipset.
agpgart: AGP aperture is 256M @ 0xb0000000
[drm] Initialized drm 1.0.0 20040925
pnp: the driver 'i8042 kbd' has been registered
pnp: match found with the PnP device '00:0a' and the driver 'i8042 kbd'
pnp: the driver 'i8042 aux' has been registered
pnp: match found with the PnP device '00:0b' and the driver 'i8042 aux'
PNP: PS/2 Controller [PNP0303:C1A3,PNP0f13:C1A4] at 0x60,0x64 irq 1,12
i8042.c: Detected active multiplexing controller, rev 1.1.
serio: i8042 AUX0 port at 0x60,0x64 irq 12
serio: i8042 AUX1 port at 0x60,0x64 irq 12
serio: i8042 AUX2 port at 0x60,0x64 irq 12
serio: i8042 AUX3 port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS2 at I/O 0x3e8 (irq = 3) is a 16550A
pnp: the driver 'serial' has been registered
pnp: match found with the PnP device '00:03' and the driver 'serial'
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ACPI: PCI Interrupt Link [C0C3] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ACPI: PCI Interrupt 0000:00:1f.6[B] -> Link [C0C3] -> GSI 10 (level, low) -> IRQ 10
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ICH4: IDE controller at PCI slot 0000:00:1f.1
PCI: Enabling device 0000:00:1f.1 (0005 -> 0007)
ACPI: PCI Interrupt Link [C0C4] enabled at IRQ 5
PCI: setting IRQ 5 as level-triggered
ACPI: PCI Interrupt 0000:00:1f.1[A] -> Link [C0C4] -> GSI 5 (level, low) -> IRQ 5
ICH4: chipset revision 1
ICH4: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0x4c40-0x4c47, BIOS settings: hda:DMA, hdb:pio
    ide1: BM-DMA at 0x4c48-0x4c4f, BIOS settings: hdc:DMA, hdd:pio
Probing IDE interface ide0...
hda: TOSHIBA MK4025GAS, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: HL-DT-STCD-RW/DVD DRIVE GCC-4241N, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
pnp: the driver 'ide' has been registered
ide2: I/O resource 0x3EE-0x3EE not free.
ide2: ports already in use, skipping probe
Probing IDE interface ide3...
Probing IDE interface ide4...
Probing IDE interface ide5...
hda: max request size: 128KiB
hda: 78140160 sectors (40007 MB), CHS=65535/16/63, UDMA(100)
hda: cache flushes supported
 hda: hda1 hda2 hda3 hda4 < hda5 hda6 >
hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache, DMA
Uniform CD-ROM driver Revision: 3.20
ide-floppy driver 0.99.newide
usbmon: debugs is not available
usbcore: registered new driver hiddev
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.01:USB HID core driver
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP: routing cache hash table of 1024 buckets, 32Kbytes
TCP established hash table entries: 32768 (order: 6, 262144 bytes)
TCP bind hash table entries: 32768 (order: 7, 917504 bytes)
TCP: Hash tables configured (established 32768 bind 32768)
Initializing IPsec netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 17
Software Suspend Core.
Software Suspend Compression Driver loading.
Software Suspend Encryption Driver loading.
Software Suspend text mode support loading.
Software Suspend userspace UI support loading.
Software Suspend Swap Writer loading.
ACPI wakeup devices: 
C058 C1AD C1A3 C1A4 C0AC C0B3 C0B4 C0B5 C0E7 C136 
ACPI: (supports S0 S3 S4 S4bios S5)
Freeing unused kernel memory: 216k freed
Software Suspend 2.1.9.5: Swapwriter: Signature found.
Software Suspend 2.1.9.5: Suspending enabled.
input: AT Translated Set 2 keyboard on isa0060/serio0
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting.  Commit interval 5 seconds
Synaptics Touchpad, model: 1, fw: 5.9, id: 0x236eb3, caps: 0x904713/0x10008
input: SynPS/2 Synaptics TouchPad on isa0060/serio4
8139cp: 10/100 PCI Ethernet driver v1.2 (Mar 22, 2004)
ACPI: PCI Interrupt 0000:02:01.0[A] -> Link [C0C3] -> GSI 10 (level, low) -> IRQ 10
eth0: RTL-8139C+ at 0xe0828000, 00:02:3f:22:db:8c, IRQ 10
ACPI: PCI Interrupt 0000:00:1f.5[B] -> Link [C0C3] -> GSI 10 (level, low) -> IRQ 10
PCI: Setting latency timer of device 0000:00:1f.5 to 64
intel8x0_measure_ac97_clock: measured 49076 usecs
intel8x0: clocking to 48000
ACPI: PCI Interrupt 0000:00:1f.6[B] -> Link [C0C3] -> GSI 10 (level, low) -> IRQ 10
PCI: Setting latency timer of device 0000:00:1f.6 to 64
hw_random: RNG not detected
ACPI: PCI Interrupt Link [C0C9] enabled at IRQ 5
ACPI: PCI Interrupt 0000:00:1d.7[D] -> Link [C0C9] -> GSI 5 (level, low) -> IRQ 5
PCI: Setting latency timer of device 0000:00:1d.7 to 64
ehci_hcd 0000:00:1d.7: EHCI Host Controller
ehci_hcd 0000:00:1d.7: debug port 1
ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:1d.7: irq 5, io mem 0xa0000000
PCI: cache line size of 32 is not supported by device 0000:00:1d.7
ehci_hcd 0000:00:1d.7: USB 2.0 initialized, EHCI 1.00, driver 10 Dec 2004
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 6 ports detected
USB Universal Host Controller Interface driver v2.2
ACPI: PCI Interrupt Link [C0C2] enabled at IRQ 10
ACPI: PCI Interrupt 0000:00:1d.0[A] -> Link [C0C2] -> GSI 10 (level, low) -> IRQ 10
PCI: Setting latency timer of device 0000:00:1d.0 to 64
uhci_hcd 0000:00:1d.0: UHCI Host Controller
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
uhci_hcd 0000:00:1d.0: irq 10, io base 0x000048c0
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
ACPI: PCI Interrupt Link [C0C5] enabled at IRQ 5
ACPI: PCI Interrupt 0000:00:1d.1[B] -> Link [C0C5] -> GSI 5 (level, low) -> IRQ 5
PCI: Setting latency timer of device 0000:00:1d.1 to 64
uhci_hcd 0000:00:1d.1: UHCI Host Controller
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 3
uhci_hcd 0000:00:1d.1: irq 5, io base 0x000048e0
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
ACPI: PCI Interrupt 0000:00:1d.2[C] -> Link [C0C4] -> GSI 5 (level, low) -> IRQ 5
PCI: Setting latency timer of device 0000:00:1d.2 to 64
uhci_hcd 0000:00:1d.2: UHCI Host Controller
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 4
uhci_hcd 0000:00:1d.2: irq 5, io base 0x00004c00
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 2 ports detected
Linux Kernel Card Services
  options:  [pci] [cardbus] [pm]
ACPI: PCI Interrupt 0000:02:04.0[A] -> Link [C0C4] -> GSI 5 (level, low) -> IRQ 5
Yenta: CardBus bridge found at 0000:02:04.0 [0e11:0860]
Yenta: Using CSCINT to route CSC interrupts to PCI
Yenta: Routing CardBus interrupts to PCI
Yenta TI: socket 0000:02:04.0, mfunc 0x001c1112, devctl 0x44
Yenta: ISA IRQ mask 0x0000, PCI irq 5
Socket status: 30000006
ieee1394: Initialized config rom entry `ip1394'
ohci1394: $Rev: 1250 $ Ben Collins <bcollins@debian.org>
ACPI: PCI Interrupt 0000:02:00.0[A] -> Link [C0C2] -> GSI 10 (level, low) -> IRQ 10
ohci1394: fw-host0: OHCI-1394 1.0 (PCI): IRQ=[10]  MMIO=[90200000-902007ff]  Max Packet=[1024]
ACPI: AC Adapter [C134] (on-line)
ACPI: Battery Slot [C11F] (battery absent)
ACPI: Power Button (FF) [PWRF]
ACPI: Lid Switch [C136]
ACPI: CPU0 (power states: C1[C1] C2[C2] C3[C3])
ACPI: Processor [CPU0] (supports 8 throttling states)
ACPI: Video Device [C0D0] (multi-head: yes  rom: no  post: no)
EXT3 FS on hda5, internal journal
kjournald starting.  Commit interval 5 seconds
EXT3 FS on hda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Adding 977248k swap on /dev/hda2.  Priority:-1 extents:1
ip_tables: (C) 2000-2002 Netfilter core team
ip_conntrack version 2.1 (4094 buckets, 32752 max) - 240 bytes per conntrack
cs: IO port probe 0xc00-0xcff: clean.
cs: IO port probe 0x800-0x8ff: clean.
cs: IO port probe 0x100-0x4ff: excluding 0x140-0x14f 0x200-0x20f 0x378-0x37f
cs: IO port probe 0xa00-0xaff: clean.
Bluetooth: Core ver 2.7
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP ver 2.7
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM ver 1.5
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: HIDP (Human Interface Emulation) ver 1.1
NET: Registered protocol family 23
IrCOMM protocol (Dag Brattli)
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
IrDA: Registered device irda0 (irport io=0x3E8 irq=3)
drivers/net/irda/irport.c:406: spin_is_locked(drivers/net/irda/irport.c:db38c548) already locked by drivers/net/irda/irport.c/878
drivers/net/irda/irport.c:407: spin_lock(drivers/net/irda/irport.c:db38c548) already locked by drivers/net/irda/irport.c/878
drivers/net/irda/irport.c:885: spin_unlock(drivers/net/irda/irport.c:db38c548) not locked
pnp: the driver 'parport_pc' has been registered
pnp: match found with the PnP device '00:05' and the driver 'parport_pc'
parport: PnPBIOS parport detected.
parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP,TRISTATE]
lp0: using parport0 (interrupt-driven).
lp0: console ready
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
ACPI: PCI Interrupt 0000:01:00.0[A] -> Link [C0C2] -> GSI 10 (level, low) -> IRQ 10
[drm] Initialized radeon 1.16.0 20050311 on minor 0: 
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23  7:50   ` Pierre Ossman
@ 2005-06-23 12:59     ` Felipe W Damasio
  2005-06-23 17:43     ` Bjorn Helgaas
  1 sibling, 0 replies; 36+ messages in thread
From: Felipe W Damasio @ 2005-06-23 12:59 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Bjorn Helgaas, LKML, jgarzik

    Hi Pierre,

Pierre Ossman wrote:

>PCI: Using ACPI for IRQ routing
>** PCI interrupts are no longer routed automatically.  If this
>** causes a device to stop working, it is probably because the
>** driver failed to call pci_enable_device().  As a temporary
>** workaround, the "pci=routeirq" argument restores the old
>** behavior.  If this argument makes the device work again,
>** please email the output of "lspci" to bjorn.helgaas@hp.com
>** so I can fix the driver.
>
    As this shows on the 2.6.11 dmesg, and doesn't show on 2.6.12, could
be the cause of the problem.

    Although 8139cp calls pci_enable_device correctly, it may be worth
to try the pci=routeirq thing and see what happens.

    Cheers,

Felipe Damasio

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-22 21:03 2.6.12 breaks 8139cp Pierre Ossman
  2005-06-22 21:34 ` Bjorn Helgaas
@ 2005-06-23 17:17 ` Roberto Oppedisano
  2005-06-23 18:00   ` Bjorn Helgaas
  1 sibling, 1 reply; 36+ messages in thread
From: Roberto Oppedisano @ 2005-06-23 17:17 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: LKML, jgarzik

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

Pierre Ossman wrote:

>Upgrading from 2.6.11 to 2.6.12 caused my 8139cp network card to stop
>working. No error messages are emitted and everything seems to work
>(from the local computers point of view). But nothing can be recieved
>from the network.
>  
>
Hi there!
I'm seeing the same problem with 8139cp (everithing seems fine, mii-tool
works, but only seldom packets are received from the device). Last good
kernel for me was 2.6.11-bk4. I tried pci=routeirq on 2.6.12, but made
no difference. Here's lscpi output (on 2.6.11-bk4).

rao@poppero1:~$ lspci
0000:00:00.0 Host bridge: Intel Corp. 82855PM Processor to I/O
Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corp. 82855PM Processor to AGP Controller
(rev 03)
0000:00:1d.0 USB Controller: Intel Corp. 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
0000:00:1d.1 USB Controller: Intel Corp. 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
0000:00:1d.2 USB Controller: Intel Corp. 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
0000:00:1d.7 USB Controller: Intel Corp. 82801DB/DBM (ICH4/ICH4-M) USB
2.0 EHCI Controller (rev 01)
0000:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev 81)
0000:00:1f.0 ISA bridge: Intel Corp. 82801DBM LPC Interface Controller
(rev 01)
0000:00:1f.1 IDE interface: Intel Corp. 82801DBM (ICH4) Ultra ATA
Storage Controller (rev 01)
0000:00:1f.3 SMBus: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)
SMBus Controller (rev 01)
0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
0000:00:1f.6 Modem: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)
AC'97 Modem Controller (rev 01)
0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R250
Lf [Radeon Mobility 9000 M9] (rev 01)
0000:02:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host
Controller (rev 80)
0000:02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL-8139/8139C/8139C+ (rev 20)
0000:02:02.0 Network controller: Intel Corp. PRO/Wireless 2200BG (rev 05)
0000:02:04.0 CardBus bridge: ENE Technology Inc CB1410 Cardbus
Controller (rev 01)
rao@poppero1:~$             

Attached dmesg for a working (2.6.11bk4) and a non working kernel

Kind regards,
    Roberto Oppedisano

PS: attached dmesg shows a tainted kernel; the problem is exactly the
same also with a vanilla kernel (whitout ever loading slamr module).

[-- Attachment #2: 2.6.11-bk4ipw.gz --]
[-- Type: application/gzip, Size: 5238 bytes --]

[-- Attachment #3: 2.6.12-rc4-git7ipw.gz --]
[-- Type: application/gzip, Size: 4832 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23  7:50   ` Pierre Ossman
  2005-06-23 12:59     ` Felipe W Damasio
@ 2005-06-23 17:43     ` Bjorn Helgaas
  2005-06-23 22:14       ` Pierre Ossman
  1 sibling, 1 reply; 36+ messages in thread
From: Bjorn Helgaas @ 2005-06-23 17:43 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: LKML, jgarzik

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

On Thursday 23 June 2005 1:50 am, Pierre Ossman wrote:
> >On Wednesday 22 June 2005 3:03 pm, Pierre Ossman wrote:
> >>Upgrading from 2.6.11 to 2.6.12 caused my 8139cp network card to stop
> >>working. No error messages are emitted and everything seems to work
> >>(from the local computers point of view). But nothing can be recieved
> >>from the network.
> 
> dmesg:s included. But they don't really differ more than some cosmetic
> changes in the output strings.
> 
> The problem is I can't find anything that differs. 2.6.12 behaves more
> or less like someone cut of the rx pins in the connector. ifconfig
> doesn't report any errors so it isn't a problem with packets getting
> dropped. tcpdump only shows the outgoing packets.

Your 2.6.11 dmesg mentions the VIA IRQ fixup, but the 2.6.12 one
doesn't.  I bet something's broken there.

Can you try the attached debugging patch?  And please collect the
output of lspci, too.

[-- Attachment #2: via-irq --]
[-- Type: text/x-diff, Size: 528 bytes --]

Index: work/drivers/pci/quirks.c
===================================================================
--- work.orig/drivers/pci/quirks.c	2005-06-21 13:43:29.000000000 -0600
+++ work/drivers/pci/quirks.c	2005-06-23 10:40:55.000000000 -0600
@@ -510,7 +510,7 @@
 		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
 	}
 }
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq);
+DECLARE_PCI_FIXUP_ENABLE(PCI_ANY_ID, PCI_ANY_ID, quirk_via_irq);
 
 /*
  * PIIX3 USB: We have to disable USB interrupts that are

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23 17:17 ` 2.6.12 breaks 8139cp Roberto Oppedisano
@ 2005-06-23 18:00   ` Bjorn Helgaas
  2005-06-23 20:38     ` Ed Sweetman
  2005-06-23 21:07     ` Roberto Oppedisano
  0 siblings, 2 replies; 36+ messages in thread
From: Bjorn Helgaas @ 2005-06-23 18:00 UTC (permalink / raw)
  To: Roberto Oppedisano; +Cc: Pierre Ossman, LKML, jgarzik

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

On Thursday 23 June 2005 11:17 am, Roberto Oppedisano wrote:
> I'm seeing the same problem with 8139cp (everithing seems fine, mii-tool
> works, but only seldom packets are received from the device). Last good
> kernel for me was 2.6.11-bk4. I tried pci=routeirq on 2.6.12, but made
> no difference. Here's lscpi output (on 2.6.11-bk4).

> 0000:02:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)
> 0000:02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 20)

You have a VIA device with dev/function == 0, so 2.6.11 will do the
VIA IRQ fixup for all devices.  2.6.12 will do it only for VIA
devices.  Can you try the attached patch for debugging purposes?

[-- Attachment #2: via-irq --]
[-- Type: text/x-diff, Size: 528 bytes --]

Index: work/drivers/pci/quirks.c
===================================================================
--- work.orig/drivers/pci/quirks.c	2005-06-21 13:43:29.000000000 -0600
+++ work/drivers/pci/quirks.c	2005-06-23 10:40:55.000000000 -0600
@@ -510,7 +510,7 @@
 		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
 	}
 }
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq);
+DECLARE_PCI_FIXUP_ENABLE(PCI_ANY_ID, PCI_ANY_ID, quirk_via_irq);
 
 /*
  * PIIX3 USB: We have to disable USB interrupts that are

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23 18:00   ` Bjorn Helgaas
@ 2005-06-23 20:38     ` Ed Sweetman
  2005-06-23 20:55       ` Bjorn Helgaas
  2005-06-23 21:07     ` Roberto Oppedisano
  1 sibling, 1 reply; 36+ messages in thread
From: Ed Sweetman @ 2005-06-23 20:38 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Roberto Oppedisano, Pierre Ossman, LKML, jgarzik

Note: this is not with 8139cp, but with 8139too, particularly 8139b

in 2.6.12, 2.6.12-mm1 and 2.6.12-RT-V0.7.49-01
With preempt enabled/disabled/rt/voluntary...
With mmio and pio in 8139too , with old rx reset and combinations of 
enabled and disabled

Even changed ethernet cables ... nothing stopped my Tx problems.
This is all occurring on a box that until yesterday, had an uptime of 
over 410 days on 2.6.0-mm1, so it's not the hardware, also, reverting to 
that kernel remedied the problem.

Here is a snip from dmesg

NETDEV WATCHDOG: eth0: transmit timed out
eth0: Transmit timeout, status 0c 0055 c07f media 00.
eth0: Tx queue start entry 78  dirty entry 74.
eth0:  Tx descriptor 0 is 0008a03c.
eth0:  Tx descriptor 1 is 0008a03c.
eth0:  Tx descriptor 2 is 0008a03c. (queue head)
eth0:  Tx descriptor 3 is 0008a03c.
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

I'm not sure if this is exactly related to the thread, but it seemed too 
much of a coincidence to think that it's not. 

The symptoms of the problem is short bursts of traffic with 30 second or 
so pauses of absolutely no response, repeating. The higher the bandwidth 
the worse the situation, but it occurs regardless. 

No other errors are reported or seen on the box except this Tx problem.  
I'm tempted to go ahead and try 2.6.11, but haven't yet.


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23 20:38     ` Ed Sweetman
@ 2005-06-23 20:55       ` Bjorn Helgaas
  2005-06-23 21:14         ` Ed Sweetman
  0 siblings, 1 reply; 36+ messages in thread
From: Bjorn Helgaas @ 2005-06-23 20:55 UTC (permalink / raw)
  To: Ed Sweetman; +Cc: Roberto Oppedisano, Pierre Ossman, LKML, jgarzik

On Thursday 23 June 2005 2:38 pm, Ed Sweetman wrote:
> I'm tempted to go ahead and try 2.6.11, but haven't yet.

Please do.  If 2.6.11 works and you have any VIA devices,
please also try the 2.6.12 patch from earlier in the thread
and see whether that helps.

Thanks!

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23 18:00   ` Bjorn Helgaas
  2005-06-23 20:38     ` Ed Sweetman
@ 2005-06-23 21:07     ` Roberto Oppedisano
  1 sibling, 0 replies; 36+ messages in thread
From: Roberto Oppedisano @ 2005-06-23 21:07 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Pierre Ossman, LKML, jgarzik

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

Bjorn Helgaas wrote:

>>0000:02:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)
>>0000:02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 20)
>>    
>>
>
>You have a VIA device with dev/function == 0, so 2.6.11 will do the
>VIA IRQ fixup for all devices.  2.6.12 will do it only for VIA
>devices.  Can you try the attached patch for debugging purposes?
>
Hi!
I applied your patch to a vanilla 2.6.12.1 kernel and the card is still
not working.
Attached dmesg with and without pci=routeirq.

Kind regards,
    Roberto Oppedisano

[-- Attachment #2: 2.6.12.1-routeirq.gz --]
[-- Type: application/gzip, Size: 5053 bytes --]

[-- Attachment #3: 2.6.12.1.gz --]
[-- Type: application/gzip, Size: 4999 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23 20:55       ` Bjorn Helgaas
@ 2005-06-23 21:14         ` Ed Sweetman
  0 siblings, 0 replies; 36+ messages in thread
From: Ed Sweetman @ 2005-06-23 21:14 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Roberto Oppedisano, Pierre Ossman, LKML, jgarzik

Bjorn Helgaas wrote:

>On Thursday 23 June 2005 2:38 pm, Ed Sweetman wrote:
>  
>
>>I'm tempted to go ahead and try 2.6.11, but haven't yet.
>>    
>>
>
>Please do.  If 2.6.11 works and you have any VIA devices,
>please also try the 2.6.12 patch from earlier in the thread
>and see whether that helps.
>
>  
>
it's a via motherboard, so yes, i'll be trying that patch if 2.6.11 does 
work.  It seems to make sense to try the patch first, but i had already 
removed the 2.6.12 trees i had compiled before that patch was posted.  
It takes a while for this computer to compile the kernels so i'll report 
back tonight ...  in any case, if the patch doesn't work, i'll move up 
the rc for 2.6.12 until the problem occurs, figure out what happened 
with the 8139 drivers in that patchset and hopefully see a fix. But 
first, a concert to goto.

has anyone had their problem fixed by the patch to 2.6.12?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23 17:43     ` Bjorn Helgaas
@ 2005-06-23 22:14       ` Pierre Ossman
  2005-06-25  2:03         ` Ed Sweetman
  2005-06-28  6:28         ` Pierre Ossman
  0 siblings, 2 replies; 36+ messages in thread
From: Pierre Ossman @ 2005-06-23 22:14 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: LKML, jgarzik

Bjorn Helgaas wrote:

>
>Your 2.6.11 dmesg mentions the VIA IRQ fixup, but the 2.6.12 one
>doesn't.  I bet something's broken there.
>
>Can you try the attached debugging patch?  And please collect the
>output of lspci, too.
>  
>

I tried the attached patch and it had no effect. I also tried porting
the 2.6.11 way of handling the VIA quirk but it didn't have any effect.
I'll try a more complete port tomorrow (it was a bit of a hack this time).

Rgds
Pierre

lspci:

00:00.0 Host bridge: Intel Corporation 82855PM Processor to I/O
Controller (rev 03)
00:01.0 PCI bridge: Intel Corporation 82855PM Processor to AGP
Controller (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2
EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 81)
00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface
Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE
Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)
SMBus Controller (rev 01)
00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)
AC'97 Modem Controller (rev 01)
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R250 Lf
[FireGL 9000] (rev 01)
02:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host
Controller (rev 80)
02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL-8139/8139C/8139C+ (rev 20)
02:02.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)
02:04.0 CardBus bridge: ENE Technology Inc CB1410 Cardbus Controller
(rev 01)


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23 22:14       ` Pierre Ossman
@ 2005-06-25  2:03         ` Ed Sweetman
  2005-06-25  2:18           ` Ed Sweetman
  2005-06-25 10:34           ` Pierre Ossman
  2005-06-28  6:28         ` Pierre Ossman
  1 sibling, 2 replies; 36+ messages in thread
From: Ed Sweetman @ 2005-06-25  2:03 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Bjorn Helgaas, LKML, jgarzik

Pierre Ossman wrote:

>Bjorn Helgaas wrote:
>
>  
>
>>Your 2.6.11 dmesg mentions the VIA IRQ fixup, but the 2.6.12 one
>>doesn't.  I bet something's broken there.
>>
>>Can you try the attached debugging patch?  And please collect the
>>output of lspci, too.
>> 
>>
>>    
>>
>
>I tried the attached patch and it had no effect. I also tried porting
>the 2.6.11 way of handling the VIA quirk but it didn't have any effect.
>I'll try a more complete port tomorrow (it was a bit of a hack this time).
>
>  
>
2.6.11-mm4 doesn't work. So i'm guessing 2.6.11 wont work either which 
may be why backporting it's via fixes didn't do anything.  I'm gonna try 
vanilla and if that by some crazy chance works, then it'll be fairly 
easy to see what change did it since mm has a nice Changelog.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-25  2:03         ` Ed Sweetman
@ 2005-06-25  2:18           ` Ed Sweetman
  2005-06-25  2:32             ` Ed Sweetman
  2005-06-25 10:34           ` Pierre Ossman
  1 sibling, 1 reply; 36+ messages in thread
From: Ed Sweetman @ 2005-06-25  2:18 UTC (permalink / raw)
  To: Ed Sweetman; +Cc: Pierre Ossman, Bjorn Helgaas, LKML, jgarzik

this is in the changefile to 2.6.11.   This seems to be the real 
culprit.  I guarantee you if this patch is reverted, there will be no 
problems.

<romieu@fr.zoreil.com>
	[PATCH] r8169: hint for Tx flow control
	
	return 1 in start_xmit() when the required descriptors are not available
	and wait for more room.
	
	Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>




Ed Sweetman wrote:

> Pierre Ossman wrote:
>
>> Bjorn Helgaas wrote:
>>
>>  
>>
>>> Your 2.6.11 dmesg mentions the VIA IRQ fixup, but the 2.6.12 one
>>> doesn't.  I bet something's broken there.
>>>
>>> Can you try the attached debugging patch?  And please collect the
>>> output of lspci, too.
>>>
>>>
>>>   
>>
>>
>> I tried the attached patch and it had no effect. I also tried porting
>> the 2.6.11 way of handling the VIA quirk but it didn't have any effect.
>> I'll try a more complete port tomorrow (it was a bit of a hack this 
>> time).
>>
>>  
>>
> 2.6.11-mm4 doesn't work. So i'm guessing 2.6.11 wont work either which 
> may be why backporting it's via fixes didn't do anything.  I'm gonna 
> try vanilla and if that by some crazy chance works, then it'll be 
> fairly easy to see what change did it since mm has a nice Changelog.
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-25  2:18           ` Ed Sweetman
@ 2005-06-25  2:32             ` Ed Sweetman
  2005-06-25  3:15               ` Jeff Garzik
  0 siblings, 1 reply; 36+ messages in thread
From: Ed Sweetman @ 2005-06-25  2:32 UTC (permalink / raw)
  To: Ed Sweetman; +Cc: Pierre Ossman, Bjorn Helgaas, LKML, jgarzik

Sorry, i'm retarded, i pasted the wrong changelog line.

<hch@lst.de>
	[8139TOO]: Use rtnl_lock_interruptible()
	
	The 8139too thread needs to use rtnl_lock_interruptible so it can avoid
	doing the actual work once it's been kill_proc()ed on module removal
	time.
	
	Based on debugging and an earlier patch that adds a driver-private
	semaphore from Herbert Xu.
	
	Signed-off-by: David S. Miller <davem@davemloft.net>

This seems to be the only patch that contains a change to the 8139too code between 
working and non-working code.

nothing in mm's patchset seems to have anything to cause these problems.




Ed Sweetman wrote:

> this is in the changefile to 2.6.11.   This seems to be the real 
> culprit.  I guarantee you if this patch is reverted, there will be no 
> problems.
>
> <romieu@fr.zoreil.com>
>     [PATCH] r8169: hint for Tx flow control
>     
>     return 1 in start_xmit() when the required descriptors are not 
> available
>     and wait for more room.
>     
>     Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
>
>
>
>
> Ed Sweetman wrote:
>
>> Pierre Ossman wrote:
>>
>>> Bjorn Helgaas wrote:
>>>
>>>  
>>>
>>>> Your 2.6.11 dmesg mentions the VIA IRQ fixup, but the 2.6.12 one
>>>> doesn't.  I bet something's broken there.
>>>>
>>>> Can you try the attached debugging patch?  And please collect the
>>>> output of lspci, too.
>>>>
>>>>
>>>>   
>>>
>>>
>>>
>>> I tried the attached patch and it had no effect. I also tried porting
>>> the 2.6.11 way of handling the VIA quirk but it didn't have any effect.
>>> I'll try a more complete port tomorrow (it was a bit of a hack this 
>>> time).
>>>
>>>  
>>>
>> 2.6.11-mm4 doesn't work. So i'm guessing 2.6.11 wont work either 
>> which may be why backporting it's via fixes didn't do anything.  I'm 
>> gonna try vanilla and if that by some crazy chance works, then it'll 
>> be fairly easy to see what change did it since mm has a nice Changelog.
>> -
>> To unsubscribe from this list: send the line "unsubscribe 
>> linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-25  2:32             ` Ed Sweetman
@ 2005-06-25  3:15               ` Jeff Garzik
  0 siblings, 0 replies; 36+ messages in thread
From: Jeff Garzik @ 2005-06-25  3:15 UTC (permalink / raw)
  To: Ed Sweetman; +Cc: Pierre Ossman, Bjorn Helgaas, LKML

Ed Sweetman wrote:
> Sorry, i'm retarded, i pasted the wrong changelog line.
> 
> <hch@lst.de>
>     [8139TOO]: Use rtnl_lock_interruptible()
>     
>     The 8139too thread needs to use rtnl_lock_interruptible so it can avoid
>     doing the actual work once it's been kill_proc()ed on module removal
>     time.
>     
>     Based on debugging and an earlier patch that adds a driver-private
>     semaphore from Herbert Xu.
>     
>     Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> This seems to be the only patch that contains a change to the 8139too 
> code between working and non-working code.

Please verify that reverting this patch actually fixed your problem.

$subject talks about 8139cp, but you list a change to 8139too, which are 
two different drivers.

It's often wrong to focus on the driver.  If a driver suddenly stops 
working, that may indicate a problem in the interrupt subsystem, etc.

	Jeff



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-25  2:03         ` Ed Sweetman
  2005-06-25  2:18           ` Ed Sweetman
@ 2005-06-25 10:34           ` Pierre Ossman
  2005-06-26 13:31             ` Ed Sweetman
  1 sibling, 1 reply; 36+ messages in thread
From: Pierre Ossman @ 2005-06-25 10:34 UTC (permalink / raw)
  To: Ed Sweetman; +Cc: Bjorn Helgaas, LKML, jgarzik

Ed Sweetman wrote:

> 2.6.11-mm4 doesn't work. So i'm guessing 2.6.11 wont work either which
> may be why backporting it's via fixes didn't do anything.  I'm gonna
> try vanilla and if that by some crazy chance works, then it'll be
> fairly easy to see what change did it since mm has a nice Changelog.


2.6.11 works fine here so if you're having problems with it I'd say
we're experiencing two different bugs.

Rgds
Pierre


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-25 10:34           ` Pierre Ossman
@ 2005-06-26 13:31             ` Ed Sweetman
  0 siblings, 0 replies; 36+ messages in thread
From: Ed Sweetman @ 2005-06-26 13:31 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Bjorn Helgaas, LKML, jgarzik

Pierre Ossman wrote:

>Ed Sweetman wrote:
>
>  
>
>>2.6.11-mm4 doesn't work. So i'm guessing 2.6.11 wont work either which
>>may be why backporting it's via fixes didn't do anything.  I'm gonna
>>try vanilla and if that by some crazy chance works, then it'll be
>>fairly easy to see what change did it since mm has a nice Changelog.
>>    
>>
>
>
>2.6.11 works fine here so if you're having problems with it I'd say
>we're experiencing two different bugs.
>
>Rgds
>Pierre
>  
>

It seems that whatever is causing the bug i'm seeing was a change that 
involved the network driver/interrupt subsystem and not actually the 
8139too driver, this was done at around 2.6.3-2.6.4.   A NAPI patch that 
was introduced at that time basically reverted the interrupt function 
and removed the poll functions from the driver (via not enabling napi in 
Kconfig).   I have patched 2.6.12.1 with the NAPI patch and it works.  
Now i just have  a problem with messages about "Badness in __kfree_skb 
at net/core/skbuff.c:290" coming from the changes i made in the 8139too 
driver flooding my logs.  (very bad but also helpful)

That narrows it down, but i was unable to clean up the kfree errors.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-23 22:14       ` Pierre Ossman
  2005-06-25  2:03         ` Ed Sweetman
@ 2005-06-28  6:28         ` Pierre Ossman
  2005-06-28 12:32           ` Pierre Ossman
  1 sibling, 1 reply; 36+ messages in thread
From: Pierre Ossman @ 2005-06-28  6:28 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: LKML, jgarzik

Hmm... it seems that TPM has something to do with the bug. Not sure why
though, can't see anything TPM related in dmesg. If I disable the TPM
parts in kconfig then the network works just fine.

I'm going to do a test of 2.6.12-rc1 through rc6 today to see where the
problem appears.

Rgds
Pierre

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-28  6:28         ` Pierre Ossman
@ 2005-06-28 12:32           ` Pierre Ossman
  2005-06-28 14:09             ` Kylene Jo Hall
  0 siblings, 1 reply; 36+ messages in thread
From: Pierre Ossman @ 2005-06-28 12:32 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: LKML, jgarzik, kjhall, tpmdd-devel

Pierre Ossman wrote:
> Hmm... it seems that TPM has something to do with the bug. Not sure why
> though, can't see anything TPM related in dmesg. If I disable the TPM
> parts in kconfig then the network works just fine.
> 
> I'm going to do a test of 2.6.12-rc1 through rc6 today to see where the
> problem appears.
> 

Confirmed this behaviour. The problem appears in rc1 (where the TPM is
added). Unloading the module doesn't help, once it has been present the
system needs a reboot for the network card to function properly.

I don't really see how the TPM can screw things up for the network card
but I'm guessing it breaks something in the chipset (the TPM module gets
loaded for the LPC bridge).

(added TPM maintainer and list as cc)

Rgds
Pierre

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-28 12:32           ` Pierre Ossman
@ 2005-06-28 14:09             ` Kylene Jo Hall
  2005-06-28 14:40               ` Pierre Ossman
  0 siblings, 1 reply; 36+ messages in thread
From: Kylene Jo Hall @ 2005-06-28 14:09 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

I believe that the reason that unloading the module does not help is
because the module_exit is calling pci_disable in the tpm_remove
function.  I'll generate a patch to remove this.

Additionally this version of the driver  was doing a bunch of stuff to
the LPC bus that I have since found not to be necessary and removed in
patches that have been applied to the mm tree and were pushed to
mainline this week.  Can anyone verify if this is still happening with
the -mm patch?

Regards,
Kylie

On Tue, 2005-06-28 at 14:32 +0200, Pierre Ossman wrote:
> Pierre Ossman wrote:
> > Hmm... it seems that TPM has something to do with the bug. Not sure why
> > though, can't see anything TPM related in dmesg. If I disable the TPM
> > parts in kconfig then the network works just fine.
> > 
> > I'm going to do a test of 2.6.12-rc1 through rc6 today to see where the
> > problem appears.
> > 
> 
> Confirmed this behaviour. The problem appears in rc1 (where the TPM is
> added). Unloading the module doesn't help, once it has been present the
> system needs a reboot for the network card to function properly.
> 
> I don't really see how the TPM can screw things up for the network card
> but I'm guessing it breaks something in the chipset (the TPM module gets
> loaded for the LPC bridge).
> 
> (added TPM maintainer and list as cc)
> 
> Rgds
> Pierre
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-28 14:09             ` Kylene Jo Hall
@ 2005-06-28 14:40               ` Pierre Ossman
  2005-06-28 15:08                 ` Kylene Jo Hall
  0 siblings, 1 reply; 36+ messages in thread
From: Pierre Ossman @ 2005-06-28 14:40 UTC (permalink / raw)
  To: Kylene Jo Hall; +Cc: Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

Kylene Jo Hall wrote:

>I believe that the reason that unloading the module does not help is
>because the module_exit is calling pci_disable in the tpm_remove
>function.  I'll generate a patch to remove this.
>
>Additionally this version of the driver  was doing a bunch of stuff to
>the LPC bus that I have since found not to be necessary and removed in
>patches that have been applied to the mm tree and were pushed to
>mainline this week.  Can anyone verify if this is still happening with
>the -mm patch?
>
>  
>

You wouldn't happen to have just your patches available?

Rgds
Pierre


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-28 14:40               ` Pierre Ossman
@ 2005-06-28 15:08                 ` Kylene Jo Hall
  2005-06-28 16:51                   ` Pierre Ossman
  2005-06-28 17:23                   ` Chris Wright
  0 siblings, 2 replies; 36+ messages in thread
From: Kylene Jo Hall @ 2005-06-28 15:08 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Bjorn Helgaas, LKML, jgarzik, tpmdd-devel


> You wouldn't happen to have just your patches available?

Here is the tpm portion of -mm patch

--- linux-2.6.12/drivers/char/tpm/tpm_atmel.c	2005-06-17 16:03:59.000000000 -0700
+++ 25/drivers/char/tpm/tpm_atmel.c	2005-06-26 02:20:35.000000000 -0700
@@ -22,17 +22,23 @@
 #include "tpm.h"
 
 /* Atmel definitions */
-#define	TPM_ATML_BASE			0x400
+enum tpm_atmel_addr {
+	TPM_ATMEL_BASE_ADDR_LO = 0x08,
+	TPM_ATMEL_BASE_ADDR_HI = 0x09
+};
 
 /* write status bits */
-#define	ATML_STATUS_ABORT		0x01
-#define	ATML_STATUS_LASTBYTE		0x04
-
+enum tpm_atmel_write_status {
+	ATML_STATUS_ABORT = 0x01,
+	ATML_STATUS_LASTBYTE = 0x04
+};
 /* read status bits */
-#define	ATML_STATUS_BUSY		0x01
-#define	ATML_STATUS_DATA_AVAIL		0x02
-#define	ATML_STATUS_REWRITE		0x04
-
+enum tpm_atmel_read_status {
+	ATML_STATUS_BUSY = 0x01,
+	ATML_STATUS_DATA_AVAIL = 0x02,
+	ATML_STATUS_REWRITE = 0x04,
+	ATML_STATUS_READY = 0x08
+};
 
 static int tpm_atml_recv(struct tpm_chip *chip, u8 * buf, size_t count)
 {
@@ -121,13 +127,29 @@ static struct file_operations atmel_ops 
 	.release = tpm_release,
 };
 
+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
+static DEVICE_ATTR(cancel, S_IWUSR |S_IWGRP, NULL, tpm_store_cancel);
+
+static struct attribute* atmel_attrs[] = {
+	&dev_attr_pubek.attr,
+	&dev_attr_pcrs.attr,
+	&dev_attr_caps.attr,
+	&dev_attr_cancel.attr,
+	0,
+};
+
+static struct attribute_group atmel_attr_grp = { .attrs = atmel_attrs };
+
 static struct tpm_vendor_specific tpm_atmel = {
 	.recv = tpm_atml_recv,
 	.send = tpm_atml_send,
 	.cancel = tpm_atml_cancel,
 	.req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
 	.req_complete_val = ATML_STATUS_DATA_AVAIL,
-	.base = TPM_ATML_BASE,
+	.req_canceled = ATML_STATUS_READY,
+	.attr_group = &atmel_attr_grp,
 	.miscdev = { .fops = &atmel_ops, },
 };
 
@@ -136,27 +158,29 @@ static int __devinit tpm_atml_init(struc
 {
 	u8 version[4];
 	int rc = 0;
+	int lo, hi;
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
+	lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO);
+	hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI);
+
+	tpm_atmel.base = (hi<<8)|lo;
+	dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
 
 	/* verify that it is an Atmel part */
-	if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
-	    || tpm_read_index(6) != 'M' || tpm_read_index(7) != 'L') {
+	if (tpm_read_index(TPM_ADDR, 4) != 'A' || tpm_read_index(TPM_ADDR, 5) != 'T'
+	    || tpm_read_index(TPM_ADDR, 6) != 'M' || tpm_read_index(TPM_ADDR, 7) != 'L') {
 		rc = -ENODEV;
 		goto out_err;
 	}
 
 	/* query chip for its version number */
-	if ((version[0] = tpm_read_index(0x00)) != 0xFF) {
-		version[1] = tpm_read_index(0x01);
-		version[2] = tpm_read_index(0x02);
-		version[3] = tpm_read_index(0x03);
+	if ((version[0] = tpm_read_index(TPM_ADDR, 0x00)) != 0xFF) {
+		version[1] = tpm_read_index(TPM_ADDR, 0x01);
+		version[2] = tpm_read_index(TPM_ADDR, 0x02);
+		version[3] = tpm_read_index(TPM_ADDR, 0x03);
 	} else {
 		dev_info(&pci_dev->dev, "version query failed\n");
 		rc = -ENODEV;
@@ -183,6 +207,7 @@ static struct pci_device_id tpm_pci_tbl[
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12)},
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0)},
 	{PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_LPC)},
+	{PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6LPC)},
 	{0,}
 };
 
--- linux-2.6.12/drivers/char/tpm/tpm.c	2005-06-17 16:03:59.000000000 -0700
+++ 25/drivers/char/tpm/tpm.c	2005-06-26 02:20:35.000000000 -0700
@@ -19,7 +19,7 @@
  * 
  * Note, the TPM chip is not interrupt driven (only polling)
  * and can have very long timeouts (minutes!). Hence the unusual
- * calls to schedule_timeout.
+ * calls to msleep.
  *
  */
 
@@ -28,19 +28,16 @@
 #include <linux/spinlock.h>
 #include "tpm.h"
 
-#define	TPM_MINOR			224	/* officially assigned */
-
-#define	TPM_BUFSIZE			2048
-
-/* PCI configuration addresses */
-#define	PCI_GEN_PMCON_1			0xA0
-#define	PCI_GEN1_DEC			0xE4
-#define	PCI_LPC_EN			0xE6
-#define	PCI_GEN2_DEC			0xEC
+enum tpm_const {
+	TPM_MINOR = 224,	/* officially assigned */
+	TPM_BUFSIZE = 2048,
+	TPM_NUM_DEVICES = 256,
+	TPM_NUM_MASK_ENTRIES = TPM_NUM_DEVICES / (8 * sizeof(int))
+};
 
 static LIST_HEAD(tpm_chip_list);
 static DEFINE_SPINLOCK(driver_lock);
-static int dev_mask[32];
+static int dev_mask[TPM_NUM_MASK_ENTRIES];
 
 static void user_reader_timeout(unsigned long ptr)
 {
@@ -52,92 +49,17 @@ static void user_reader_timeout(unsigned
 	up(&chip->buffer_mutex);
 }
 
-void tpm_time_expired(unsigned long ptr)
-{
-	int *exp = (int *) ptr;
-	*exp = 1;
-}
-
-EXPORT_SYMBOL_GPL(tpm_time_expired);
-
-/*
- * Initialize the LPC bus and enable the TPM ports
- */
-int tpm_lpc_bus_init(struct pci_dev *pci_dev, u16 base)
-{
-	u32 lpcenable, tmp;
-	int is_lpcm = 0;
-
-	switch (pci_dev->vendor) {
-	case PCI_VENDOR_ID_INTEL:
-		switch (pci_dev->device) {
-		case PCI_DEVICE_ID_INTEL_82801CA_12:
-		case PCI_DEVICE_ID_INTEL_82801DB_12:
-			is_lpcm = 1;
-			break;
-		}
-		/* init ICH (enable LPC) */
-		pci_read_config_dword(pci_dev, PCI_GEN1_DEC, &lpcenable);
-		lpcenable |= 0x20000000;
-		pci_write_config_dword(pci_dev, PCI_GEN1_DEC, lpcenable);
-
-		if (is_lpcm) {
-			pci_read_config_dword(pci_dev, PCI_GEN1_DEC,
-					      &lpcenable);
-			if ((lpcenable & 0x20000000) == 0) {
-				dev_err(&pci_dev->dev,
-					"cannot enable LPC\n");
-				return -ENODEV;
-			}
-		}
-
-		/* initialize TPM registers */
-		pci_read_config_dword(pci_dev, PCI_GEN2_DEC, &tmp);
-
-		if (!is_lpcm)
-			tmp = (tmp & 0xFFFF0000) | (base & 0xFFF0);
-		else
-			tmp =
-			    (tmp & 0xFFFF0000) | (base & 0xFFF0) |
-			    0x00000001;
-
-		pci_write_config_dword(pci_dev, PCI_GEN2_DEC, tmp);
-
-		if (is_lpcm) {
-			pci_read_config_dword(pci_dev, PCI_GEN_PMCON_1,
-					      &tmp);
-			tmp |= 0x00000004;	/* enable CLKRUN */
-			pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,
-					       tmp);
-		}
-		tpm_write_index(0x0D, 0x55);	/* unlock 4F */
-		tpm_write_index(0x0A, 0x00);	/* int disable */
-		tpm_write_index(0x08, base);	/* base addr lo */
-		tpm_write_index(0x09, (base & 0xFF00) >> 8);	/* base addr hi */
-		tpm_write_index(0x0D, 0xAA);	/* lock 4F */
-		break;
-	case PCI_VENDOR_ID_AMD:
-		/* nothing yet */
-		break;
-	}
-
-	return 0;
-}
-
-EXPORT_SYMBOL_GPL(tpm_lpc_bus_init);
-
 /*
  * Internal kernel interface to transmit TPM commands
  */
 static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
 			    size_t bufsiz)
 {
-	ssize_t len;
+	ssize_t rc;
 	u32 count;
-	__be32 *native_size;
+	unsigned long stop;
 
-	native_size = (__force __be32 *) (buf + 2);
-	count = be32_to_cpu(*native_size);
+	count = be32_to_cpu(*((__be32 *) (buf + 2)));
 
 	if (count == 0)
 		return -ENODATA;
@@ -149,53 +71,49 @@ static ssize_t tpm_transmit(struct tpm_c
 
 	down(&chip->tpm_mutex);
 
-	if ((len = chip->vendor->send(chip, (u8 *) buf, count)) < 0) {
+	if ((rc = chip->vendor->send(chip, (u8 *) buf, count)) < 0) {
 		dev_err(&chip->pci_dev->dev,
-			"tpm_transmit: tpm_send: error %zd\n", len);
-		return len;
+			"tpm_transmit: tpm_send: error %zd\n", rc);
+		goto out;
 	}
 
-	down(&chip->timer_manipulation_mutex);
-	chip->time_expired = 0;
-	init_timer(&chip->device_timer);
-	chip->device_timer.function = tpm_time_expired;
-	chip->device_timer.expires = jiffies + 2 * 60 * HZ;
-	chip->device_timer.data = (unsigned long) &chip->time_expired;
-	add_timer(&chip->device_timer);
-	up(&chip->timer_manipulation_mutex);
-
+	stop = jiffies + 2 * 60 * HZ;
 	do {
 		u8 status = inb(chip->vendor->base + 1);
 		if ((status & chip->vendor->req_complete_mask) ==
 		    chip->vendor->req_complete_val) {
-			down(&chip->timer_manipulation_mutex);
-			del_singleshot_timer_sync(&chip->device_timer);
-			up(&chip->timer_manipulation_mutex);
 			goto out_recv;
 		}
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(TPM_TIMEOUT);
+
+		if ((status == chip->vendor->req_canceled)) {
+			dev_err(&chip->pci_dev->dev, "Operation Canceled\n");
+			rc = -ECANCELED;
+			goto out;
+		}
+
+		msleep(TPM_TIMEOUT);	/* CHECK */
 		rmb();
-	} while (!chip->time_expired);
+	} while (time_before(jiffies, stop));
 
 
 	chip->vendor->cancel(chip);
-	dev_err(&chip->pci_dev->dev, "Time expired\n");
-	up(&chip->tpm_mutex);
-	return -EIO;
+	dev_err(&chip->pci_dev->dev, "Operation Timed out\n");
+	rc = -ETIME;
+	goto out;
 
 out_recv:
-	len = chip->vendor->recv(chip, (u8 *) buf, bufsiz);
-	if (len < 0)
+	rc = chip->vendor->recv(chip, (u8 *) buf, bufsiz);
+	if (rc < 0)
 		dev_err(&chip->pci_dev->dev,
-			"tpm_transmit: tpm_recv: error %zd\n", len);
+			"tpm_transmit: tpm_recv: error %zd\n", rc);
+out:
 	up(&chip->tpm_mutex);
-	return len;
+	return rc;
 }
 
 #define TPM_DIGEST_SIZE 20
 #define CAP_PCR_RESULT_SIZE 18
-static u8 cap_pcr[] = {
+static const u8 cap_pcr[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
 	0, 0, 0, 22,		/* length */
 	0, 0, 0, 101,		/* TPM_ORD_GetCapability */
@@ -205,75 +123,94 @@ static u8 cap_pcr[] = {
 };
 
 #define READ_PCR_RESULT_SIZE 30
-static u8 pcrread[] = {
+static const u8 pcrread[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
 	0, 0, 0, 14,		/* length */
 	0, 0, 0, 21,		/* TPM_ORD_PcrRead */
 	0, 0, 0, 0		/* PCR index */
 };
 
-static ssize_t show_pcrs(struct device *dev, char *buf)
+ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr,
+		      char *buf)
 {
 	u8 data[READ_PCR_RESULT_SIZE];
 	ssize_t len;
-	int i, j, index, num_pcrs;
+	int i, j, num_pcrs;
+	__be32 index;
 	char *str = buf;
 
 	struct tpm_chip *chip =
-	    pci_get_drvdata(container_of(dev, struct pci_dev, dev));
+	    pci_get_drvdata(to_pci_dev(dev));
 	if (chip == NULL)
 		return -ENODEV;
 
 	memcpy(data, cap_pcr, sizeof(cap_pcr));
 	if ((len = tpm_transmit(chip, data, sizeof(data)))
-	    < CAP_PCR_RESULT_SIZE)
-		return len;
+	    < CAP_PCR_RESULT_SIZE) {
+		dev_dbg(&chip->pci_dev->dev, "A TPM error (%d) occurred "
+				"attempting to determine the number of PCRS\n",
+			be32_to_cpu(*((__be32 *) (data + 6))));
+		return 0;
+	}
 
-	num_pcrs = be32_to_cpu(*((__force __be32 *) (data + 14)));
+	num_pcrs = be32_to_cpu(*((__be32 *) (data + 14)));
 
 	for (i = 0; i < num_pcrs; i++) {
 		memcpy(data, pcrread, sizeof(pcrread));
 		index = cpu_to_be32(i);
 		memcpy(data + 10, &index, 4);
 		if ((len = tpm_transmit(chip, data, sizeof(data)))
-		    < READ_PCR_RESULT_SIZE)
-			return len;
+		    < READ_PCR_RESULT_SIZE){
+			dev_dbg(&chip->pci_dev->dev, "A TPM error (%d) occurred"
+				" attempting to read PCR %d of %d\n",
+				be32_to_cpu(*((__be32 *) (data + 6))), i, num_pcrs);
+			goto out;
+		}
 		str += sprintf(str, "PCR-%02d: ", i);
 		for (j = 0; j < TPM_DIGEST_SIZE; j++)
 			str += sprintf(str, "%02X ", *(data + 10 + j));
 		str += sprintf(str, "\n");
 	}
+out:
 	return str - buf;
 }
-
-static DEVICE_ATTR(pcrs, S_IRUGO, show_pcrs, NULL);
+EXPORT_SYMBOL_GPL(tpm_show_pcrs);
 
 #define  READ_PUBEK_RESULT_SIZE 314
-static u8 readpubek[] = {
+static const u8 readpubek[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
 	0, 0, 0, 30,		/* length */
 	0, 0, 0, 124,		/* TPM_ORD_ReadPubek */
 };
 
-static ssize_t show_pubek(struct device *dev, char *buf)
+ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
+		       char *buf)
 {
-	u8 data[READ_PUBEK_RESULT_SIZE];
+	u8 *data;
 	ssize_t len;
-	__be32 *native_val;
-	int i;
+	int i, rc;
 	char *str = buf;
 
 	struct tpm_chip *chip =
-	    pci_get_drvdata(container_of(dev, struct pci_dev, dev));
+	    pci_get_drvdata(to_pci_dev(dev));
 	if (chip == NULL)
 		return -ENODEV;
 
+	data = kmalloc(READ_PUBEK_RESULT_SIZE, GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
 	memcpy(data, readpubek, sizeof(readpubek));
 	memset(data + sizeof(readpubek), 0, 20);	/* zero nonce */
 
-	if ((len = tpm_transmit(chip, data, sizeof(data))) <
-	    READ_PUBEK_RESULT_SIZE)
-		return len;
+	if ((len = tpm_transmit(chip, data, READ_PUBEK_RESULT_SIZE)) <
+	    READ_PUBEK_RESULT_SIZE) {
+		dev_dbg(&chip->pci_dev->dev, "A TPM error (%d) occurred "
+				"attempting to read the PUBEK\n",
+			    be32_to_cpu(*((__be32 *) (data + 6))));
+		rc = 0;
+		goto out;
+	}
 
 	/* 
 	   ignore header 10 bytes
@@ -286,8 +223,6 @@ static ssize_t show_pubek(struct device 
 	   ignore checksum 20 bytes
 	 */
 
-	native_val = (__force __be32 *) (data + 34);
-
 	str +=
 	    sprintf(str,
 		    "Algorithm: %02X %02X %02X %02X\nEncscheme: %02X %02X\n"
@@ -298,21 +233,23 @@ static ssize_t show_pubek(struct device 
 		    data[15], data[16], data[17], data[22], data[23],
 		    data[24], data[25], data[26], data[27], data[28],
 		    data[29], data[30], data[31], data[32], data[33],
-		    be32_to_cpu(*native_val)
-	    );
+		    be32_to_cpu(*((__be32 *) (data + 34))));
 
 	for (i = 0; i < 256; i++) {
-		str += sprintf(str, "%02X ", data[i + 39]);
+		str += sprintf(str, "%02X ", data[i + 38]);
 		if ((i + 1) % 16 == 0)
 			str += sprintf(str, "\n");
 	}
-	return str - buf;
+	rc = str - buf;
+out:
+	kfree(data);
+	return rc;
 }
 
-static DEVICE_ATTR(pubek, S_IRUGO, show_pubek, NULL);
+EXPORT_SYMBOL_GPL(tpm_show_pubek);
 
 #define CAP_VER_RESULT_SIZE 18
-static u8 cap_version[] = {
+static const u8 cap_version[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
 	0, 0, 0, 18,		/* length */
 	0, 0, 0, 101,		/* TPM_ORD_GetCapability */
@@ -321,7 +258,7 @@ static u8 cap_version[] = {
 };
 
 #define CAP_MANUFACTURER_RESULT_SIZE 18
-static u8 cap_manufacturer[] = {
+static const u8 cap_manufacturer[] = {
 	0, 193,			/* TPM_TAG_RQU_COMMAND */
 	0, 0, 0, 22,		/* length */
 	0, 0, 0, 101,		/* TPM_ORD_GetCapability */
@@ -330,14 +267,15 @@ static u8 cap_manufacturer[] = {
 	0, 0, 1, 3
 };
 
-static ssize_t show_caps(struct device *dev, char *buf)
+ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr,
+		      char *buf)
 {
-	u8 data[READ_PUBEK_RESULT_SIZE];
+	u8 data[sizeof(cap_manufacturer)];
 	ssize_t len;
 	char *str = buf;
 
 	struct tpm_chip *chip =
-	    pci_get_drvdata(container_of(dev, struct pci_dev, dev));
+	    pci_get_drvdata(to_pci_dev(dev));
 	if (chip == NULL)
 		return -ENODEV;
 
@@ -348,7 +286,7 @@ static ssize_t show_caps(struct device *
 		return len;
 
 	str += sprintf(str, "Manufacturer: 0x%x\n",
-		       be32_to_cpu(*(data + 14)));
+		       be32_to_cpu(*((__be32 *) (data + 14))));
 
 	memcpy(data, cap_version, sizeof(cap_version));
 
@@ -363,8 +301,20 @@ static ssize_t show_caps(struct device *
 
 	return str - buf;
 }
+EXPORT_SYMBOL_GPL(tpm_show_caps);
+
+ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
+			const char *buf, size_t count)
+{
+	struct tpm_chip *chip = dev_get_drvdata(dev);
+	if (chip == NULL)
+		return 0;
+
+	chip->vendor->cancel(chip);
+	return count;
+}
+EXPORT_SYMBOL_GPL(tpm_store_cancel);
 
-static DEVICE_ATTR(caps, S_IRUGO, show_caps, NULL);
 
 /*
  * Device file system interface to the TPM
@@ -422,24 +372,15 @@ EXPORT_SYMBOL_GPL(tpm_open);
 int tpm_release(struct inode *inode, struct file *file)
 {
 	struct tpm_chip *chip = file->private_data;
-	
-	file->private_data = NULL;
 
 	spin_lock(&driver_lock);
+	file->private_data = NULL;
 	chip->num_opens--;
-	spin_unlock(&driver_lock);
-
-	down(&chip->timer_manipulation_mutex);
-	if (timer_pending(&chip->user_read_timer))
-		del_singleshot_timer_sync(&chip->user_read_timer);
-	else if (timer_pending(&chip->device_timer))
-		del_singleshot_timer_sync(&chip->device_timer);
-	up(&chip->timer_manipulation_mutex);
-
-	kfree(chip->data_buffer);
+	del_singleshot_timer_sync(&chip->user_read_timer);
 	atomic_set(&chip->data_pending, 0);
-
 	pci_dev_put(chip->pci_dev);
+	kfree(chip->data_buffer);
+	spin_unlock(&driver_lock);
 	return 0;
 }
 
@@ -453,10 +394,8 @@ ssize_t tpm_write(struct file * file, co
 
 	/* cannot perform a write until the read has cleared
 	   either via tpm_read or a user_read_timer timeout */
-	while (atomic_read(&chip->data_pending) != 0) {
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(TPM_TIMEOUT);
-	}
+	while (atomic_read(&chip->data_pending) != 0)
+		msleep(TPM_TIMEOUT);
 
 	down(&chip->buffer_mutex);
 
@@ -476,13 +415,7 @@ ssize_t tpm_write(struct file * file, co
 	up(&chip->buffer_mutex);
 
 	/* Set a timeout by which the reader must come claim the result */
-	down(&chip->timer_manipulation_mutex);
-	init_timer(&chip->user_read_timer);
-	chip->user_read_timer.function = user_reader_timeout;
-	chip->user_read_timer.data = (unsigned long) chip;
-	chip->user_read_timer.expires = jiffies + (60 * HZ);
-	add_timer(&chip->user_read_timer);
-	up(&chip->timer_manipulation_mutex);
+	mod_timer(&chip->user_read_timer, jiffies + (60 * HZ));
 
 	return in_size;
 }
@@ -493,29 +426,19 @@ ssize_t tpm_read(struct file * file, cha
 		 size_t size, loff_t * off)
 {
 	struct tpm_chip *chip = file->private_data;
-	int ret_size = -ENODATA;
+	int ret_size;
 
-	if (atomic_read(&chip->data_pending) != 0) {	/* Result available */
-		down(&chip->timer_manipulation_mutex);
-		del_singleshot_timer_sync(&chip->user_read_timer);
-		up(&chip->timer_manipulation_mutex);
+	del_singleshot_timer_sync(&chip->user_read_timer);
+	ret_size = atomic_read(&chip->data_pending);
+	atomic_set(&chip->data_pending, 0);
+	if (ret_size > 0) {	/* relay data */
+		if (size < ret_size)
+			ret_size = size;
 
 		down(&chip->buffer_mutex);
-
-		ret_size = atomic_read(&chip->data_pending);
-		atomic_set(&chip->data_pending, 0);
-
-		if (ret_size == 0)	/* timeout just occurred */
-			ret_size = -ETIME;
-		else if (ret_size > 0) {	/* relay data */
-			if (size < ret_size)
-				ret_size = size;
-
-			if (copy_to_user((void __user *) buf,
-					 chip->data_buffer, ret_size)) {
-				ret_size = -EFAULT;
-			}
-		}
+		if (copy_to_user
+		    ((void __user *) buf, chip->data_buffer, ret_size))
+			ret_size = -EFAULT;
 		up(&chip->buffer_mutex);
 	}
 
@@ -541,14 +464,13 @@ void __devexit tpm_remove(struct pci_dev
 
 	pci_set_drvdata(pci_dev, NULL);
 	misc_deregister(&chip->vendor->miscdev);
+	kfree(&chip->vendor->miscdev.name);
 
-	device_remove_file(&pci_dev->dev, &dev_attr_pubek);
-	device_remove_file(&pci_dev->dev, &dev_attr_pcrs);
-	device_remove_file(&pci_dev->dev, &dev_attr_caps);
+	sysfs_remove_group(&pci_dev->dev.kobj, chip->vendor->attr_group);
 
 	pci_disable_device(pci_dev);
 
-	dev_mask[chip->dev_num / 32] &= !(1 << (chip->dev_num % 32));
+	dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES));
 
 	kfree(chip);
 
@@ -590,10 +512,6 @@ int tpm_pm_resume(struct pci_dev *pci_de
 	if (chip == NULL)
 		return -ENODEV;
 
-	spin_lock(&driver_lock);
-	tpm_lpc_bus_init(pci_dev, chip->vendor->base);
-	spin_unlock(&driver_lock);
-
 	return 0;
 }
 
@@ -609,7 +527,9 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume);
 int tpm_register_hardware(struct pci_dev *pci_dev,
 			  struct tpm_vendor_specific *entry)
 {
-	char devname[7];
+#define DEVNAME_SIZE 7
+
+	char *devname;
 	struct tpm_chip *chip;
 	int i, j;
 
@@ -622,17 +542,21 @@ int tpm_register_hardware(struct pci_dev
 
 	init_MUTEX(&chip->buffer_mutex);
 	init_MUTEX(&chip->tpm_mutex);
-	init_MUTEX(&chip->timer_manipulation_mutex);
 	INIT_LIST_HEAD(&chip->list);
 
+	init_timer(&chip->user_read_timer);
+	chip->user_read_timer.function = user_reader_timeout;
+	chip->user_read_timer.data = (unsigned long) chip;
+
 	chip->vendor = entry;
 
 	chip->dev_num = -1;
 
-	for (i = 0; i < 32; i++)
-		for (j = 0; j < 8; j++)
+	for (i = 0; i < TPM_NUM_MASK_ENTRIES; i++)
+		for (j = 0; j < 8 * sizeof(int); j++)
 			if ((dev_mask[i] & (1 << j)) == 0) {
-				chip->dev_num = i * 32 + j;
+				chip->dev_num =
+				    i * TPM_NUM_MASK_ENTRIES + j;
 				dev_mask[i] |= 1 << j;
 				goto dev_num_search_complete;
 			}
@@ -648,7 +572,8 @@ dev_num_search_complete:
 	else
 		chip->vendor->miscdev.minor = MISC_DYNAMIC_MINOR;
 
-	snprintf(devname, sizeof(devname), "%s%d", "tpm", chip->dev_num);
+	devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL);
+	scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num);
 	chip->vendor->miscdev.name = devname;
 
 	chip->vendor->miscdev.dev = &(pci_dev->dev);
@@ -665,31 +590,20 @@ dev_num_search_complete:
 		return -ENODEV;
 	}
 
+	spin_lock(&driver_lock);
+
 	pci_set_drvdata(pci_dev, chip);
 
 	list_add(&chip->list, &tpm_chip_list);
 
-	device_create_file(&pci_dev->dev, &dev_attr_pubek);
-	device_create_file(&pci_dev->dev, &dev_attr_pcrs);
-	device_create_file(&pci_dev->dev, &dev_attr_caps);
-
-	return 0;
-}
+	spin_unlock(&driver_lock);
 
-EXPORT_SYMBOL_GPL(tpm_register_hardware);
+	sysfs_create_group(&pci_dev->dev.kobj, chip->vendor->attr_group);
 
-static int __init init_tpm(void)
-{
 	return 0;
 }
 
-static void __exit cleanup_tpm(void)
-{
-
-}
-
-module_init(init_tpm);
-module_exit(cleanup_tpm);
+EXPORT_SYMBOL_GPL(tpm_register_hardware);
 
 MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)");
 MODULE_DESCRIPTION("TPM Driver");
--- linux-2.6.12/drivers/char/tpm/tpm.h	2005-06-17 16:03:59.000000000 -0700
+++ 25/drivers/char/tpm/tpm.h	2005-06-26 02:20:35.000000000 -0700
@@ -25,23 +25,38 @@
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 
-#define TPM_TIMEOUT msecs_to_jiffies(5)
+enum tpm_timeout {
+	TPM_TIMEOUT = 5,	/* msecs */
+};
 
 /* TPM addresses */
-#define	TPM_ADDR			0x4E
-#define	TPM_DATA			0x4F
+enum tpm_addr {
+	TPM_SUPERIO_ADDR = 0x2E,
+	TPM_ADDR = 0x4E,
+};
+
+extern ssize_t tpm_show_pubek(struct device *, struct device_attribute *attr,
+				char *);
+extern ssize_t tpm_show_pcrs(struct device *, struct device_attribute *attr,
+				char *);
+extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr,
+				char *);
+extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr,
+				const char *, size_t);
 
 struct tpm_chip;
 
 struct tpm_vendor_specific {
 	u8 req_complete_mask;
 	u8 req_complete_val;
+	u8 req_canceled;
 	u16 base;		/* TPM base address */
 
 	int (*recv) (struct tpm_chip *, u8 *, size_t);
 	int (*send) (struct tpm_chip *, u8 *, size_t);
 	void (*cancel) (struct tpm_chip *);
 	struct miscdevice miscdev;
+	struct attribute_group *attr_group;
 };
 
 struct tpm_chip {
@@ -58,29 +73,24 @@ struct tpm_chip {
 
 	struct timer_list user_read_timer;	/* user needs to claim result */
 	struct semaphore tpm_mutex;	/* tpm is processing */
-	struct timer_list device_timer;	/* tpm is processing */
-	struct semaphore timer_manipulation_mutex;
 
 	struct tpm_vendor_specific *vendor;
 
 	struct list_head list;
 };
 
-static inline int tpm_read_index(int index)
+static inline int tpm_read_index(int base, int index)
 {
-	outb(index, TPM_ADDR);
-	return inb(TPM_DATA) & 0xFF;
+	outb(index, base);
+	return inb(base+1) & 0xFF;
 }
 
-static inline void tpm_write_index(int index, int value)
+static inline void tpm_write_index(int base, int index, int value)
 {
-	outb(index, TPM_ADDR);
-	outb(value & 0xFF, TPM_DATA);
+	outb(index, base);
+	outb(value & 0xFF, base+1);
 }
 
-extern void tpm_time_expired(unsigned long);
-extern int tpm_lpc_bus_init(struct pci_dev *, u16);
-
 extern int tpm_register_hardware(struct pci_dev *,
 				 struct tpm_vendor_specific *);
 extern int tpm_open(struct inode *, struct file *);
--- linux-2.6.12/drivers/char/tpm/tpm_nsc.c	2005-06-17 16:03:59.000000000 -0700
+++ 25/drivers/char/tpm/tpm_nsc.c	2005-06-26 02:20:35.000000000 -0700
@@ -22,43 +22,52 @@
 #include "tpm.h"
 
 /* National definitions */
-#define	TPM_NSC_BASE			0x360
-#define	TPM_NSC_IRQ			0x07
+enum tpm_nsc_addr{
+	TPM_NSC_IRQ = 0x07,
+	TPM_NSC_BASE0_HI = 0x60,
+	TPM_NSC_BASE0_LO = 0x61,
+	TPM_NSC_BASE1_HI = 0x62,
+	TPM_NSC_BASE1_LO = 0x63
+};
+
+enum tpm_nsc_index {
+	NSC_LDN_INDEX = 0x07,
+	NSC_SID_INDEX = 0x20,
+	NSC_LDC_INDEX = 0x30,
+	NSC_DIO_INDEX = 0x60,
+	NSC_CIO_INDEX = 0x62,
+	NSC_IRQ_INDEX = 0x70,
+	NSC_ITS_INDEX = 0x71
+};
 
-#define	NSC_LDN_INDEX			0x07
-#define	NSC_SID_INDEX			0x20
-#define	NSC_LDC_INDEX			0x30
-#define	NSC_DIO_INDEX			0x60
-#define	NSC_CIO_INDEX			0x62
-#define	NSC_IRQ_INDEX			0x70
-#define	NSC_ITS_INDEX			0x71
-
-#define	NSC_STATUS			0x01
-#define	NSC_COMMAND			0x01
-#define	NSC_DATA			0x00
+enum tpm_nsc_status_loc {
+	NSC_STATUS = 0x01,
+	NSC_COMMAND = 0x01,
+	NSC_DATA = 0x00
+};
 
 /* status bits */
-#define	NSC_STATUS_OBF			0x01	/* output buffer full */
-#define	NSC_STATUS_IBF			0x02	/* input buffer full */
-#define	NSC_STATUS_F0			0x04	/* F0 */
-#define	NSC_STATUS_A2			0x08	/* A2 */
-#define	NSC_STATUS_RDY			0x10	/* ready to receive command */
-#define	NSC_STATUS_IBR			0x20	/* ready to receive data */
+enum tpm_nsc_status {
+	NSC_STATUS_OBF = 0x01,	/* output buffer full */
+	NSC_STATUS_IBF = 0x02,	/* input buffer full */
+	NSC_STATUS_F0 = 0x04,	/* F0 */
+	NSC_STATUS_A2 = 0x08,	/* A2 */
+	NSC_STATUS_RDY = 0x10,	/* ready to receive command */
+	NSC_STATUS_IBR = 0x20	/* ready to receive data */
+};
 
 /* command bits */
-#define	NSC_COMMAND_NORMAL		0x01	/* normal mode */
-#define	NSC_COMMAND_EOC			0x03
-#define	NSC_COMMAND_CANCEL		0x22
-
+enum tpm_nsc_cmd_mode {
+	NSC_COMMAND_NORMAL = 0x01,	/* normal mode */
+	NSC_COMMAND_EOC = 0x03,
+	NSC_COMMAND_CANCEL = 0x22
+};
 /*
  * Wait for a certain status to appear
  */
 static int wait_for_stat(struct tpm_chip *chip, u8 mask, u8 val, u8 * data)
 {
-	int expired = 0;
-	struct timer_list status_timer =
-	    TIMER_INITIALIZER(tpm_time_expired, jiffies + 10 * HZ,
-			      (unsigned long) &expired);
+	unsigned long stop;
 
 	/* status immediately available check */
 	*data = inb(chip->vendor->base + NSC_STATUS);
@@ -66,17 +75,14 @@ static int wait_for_stat(struct tpm_chip
 		return 0;
 
 	/* wait for status */
-	add_timer(&status_timer);
+	stop = jiffies + 10 * HZ;
 	do {
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(TPM_TIMEOUT);
+		msleep(TPM_TIMEOUT);
 		*data = inb(chip->vendor->base + 1);
-		if ((*data & mask) == val) {
-			del_singleshot_timer_sync(&status_timer);
+		if ((*data & mask) == val)
 			return 0;
-		}
 	}
-	while (!expired);
+	while (time_before(jiffies, stop));
 
 	return -EBUSY;
 }
@@ -84,10 +90,7 @@ static int wait_for_stat(struct tpm_chip
 static int nsc_wait_for_ready(struct tpm_chip *chip)
 {
 	int status;
-	int expired = 0;
-	struct timer_list status_timer =
-	    TIMER_INITIALIZER(tpm_time_expired, jiffies + 100,
-			      (unsigned long) &expired);
+	unsigned long stop;
 
 	/* status immediately available check */
 	status = inb(chip->vendor->base + NSC_STATUS);
@@ -97,19 +100,16 @@ static int nsc_wait_for_ready(struct tpm
 		return 0;
 
 	/* wait for status */
-	add_timer(&status_timer);
+	stop = jiffies + 100;
 	do {
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(TPM_TIMEOUT);
+		msleep(TPM_TIMEOUT);
 		status = inb(chip->vendor->base + NSC_STATUS);
 		if (status & NSC_STATUS_OBF)
 			status = inb(chip->vendor->base + NSC_DATA);
-		if (status & NSC_STATUS_RDY) {
-			del_singleshot_timer_sync(&status_timer);
+		if (status & NSC_STATUS_RDY)
 			return 0;
-		}
 	}
-	while (!expired);
+	while (time_before(jiffies, stop));
 
 	dev_info(&chip->pci_dev->dev, "wait for ready failed\n");
 	return -EBUSY;
@@ -150,7 +150,8 @@ static int tpm_nsc_recv(struct tpm_chip 
 		*p = inb(chip->vendor->base + NSC_DATA);
 	}
 
-	if ((data & NSC_STATUS_F0) == 0) {
+	if ((data & NSC_STATUS_F0) == 0 &&
+	(wait_for_stat(chip, NSC_STATUS_F0, NSC_STATUS_F0, &data) < 0)) {
 		dev_err(&chip->pci_dev->dev, "F0 not set\n");
 		return -EIO;
 	}
@@ -228,100 +229,95 @@ static struct file_operations nsc_ops = 
 	.release = tpm_release,
 };
 
+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
+static DEVICE_ATTR(cancel, S_IWUSR|S_IWGRP, NULL, tpm_store_cancel);
+
+static struct attribute * nsc_attrs[] = {
+	&dev_attr_pubek.attr,
+	&dev_attr_pcrs.attr,
+	&dev_attr_caps.attr,
+	&dev_attr_cancel.attr,
+	0,
+};
+
+static struct attribute_group nsc_attr_grp = { .attrs = nsc_attrs };
+
 static struct tpm_vendor_specific tpm_nsc = {
 	.recv = tpm_nsc_recv,
 	.send = tpm_nsc_send,
 	.cancel = tpm_nsc_cancel,
 	.req_complete_mask = NSC_STATUS_OBF,
 	.req_complete_val = NSC_STATUS_OBF,
-	.base = TPM_NSC_BASE,
+	.req_canceled = NSC_STATUS_RDY,
+	.attr_group = &nsc_attr_grp,
 	.miscdev = { .fops = &nsc_ops, },
-	
 };
 
 static int __devinit tpm_nsc_init(struct pci_dev *pci_dev,
 				  const struct pci_device_id *pci_id)
 {
 	int rc = 0;
+	int lo, hi;
+	int nscAddrBase = TPM_ADDR;
+
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
+	/* select PM channel 1 */
+	tpm_write_index(nscAddrBase,NSC_LDN_INDEX, 0x12);
 
 	/* verify that it is a National part (SID) */
-	if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
-		rc = -ENODEV;
-		goto out_err;
+	if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) {
+		nscAddrBase = (tpm_read_index(TPM_SUPERIO_ADDR, 0x2C)<<8)|
+			(tpm_read_index(TPM_SUPERIO_ADDR, 0x2B)&0xFE);
+		if (tpm_read_index(nscAddrBase, NSC_SID_INDEX) != 0xF6) {
+			rc = -ENODEV;
+			goto out_err;
+		}
 	}
 
+	hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI);
+	lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO);
+	tpm_nsc.base = (hi<<8) | lo;
+
 	dev_dbg(&pci_dev->dev, "NSC TPM detected\n");
 	dev_dbg(&pci_dev->dev,
 		"NSC LDN 0x%x, SID 0x%x, SRID 0x%x\n",
-		tpm_read_index(0x07), tpm_read_index(0x20),
-		tpm_read_index(0x27));
+		tpm_read_index(nscAddrBase,0x07), tpm_read_index(nscAddrBase,0x20),
+		tpm_read_index(nscAddrBase,0x27));
 	dev_dbg(&pci_dev->dev,
 		"NSC SIOCF1 0x%x SIOCF5 0x%x SIOCF6 0x%x SIOCF8 0x%x\n",
-		tpm_read_index(0x21), tpm_read_index(0x25),
-		tpm_read_index(0x26), tpm_read_index(0x28));
+		tpm_read_index(nscAddrBase,0x21), tpm_read_index(nscAddrBase,0x25),
+		tpm_read_index(nscAddrBase,0x26), tpm_read_index(nscAddrBase,0x28));
 	dev_dbg(&pci_dev->dev, "NSC IO Base0 0x%x\n",
-		(tpm_read_index(0x60) << 8) | tpm_read_index(0x61));
+		(tpm_read_index(nscAddrBase,0x60) << 8) | tpm_read_index(nscAddrBase,0x61));
 	dev_dbg(&pci_dev->dev, "NSC IO Base1 0x%x\n",
-		(tpm_read_index(0x62) << 8) | tpm_read_index(0x63));
+		(tpm_read_index(nscAddrBase,0x62) << 8) | tpm_read_index(nscAddrBase,0x63));
 	dev_dbg(&pci_dev->dev, "NSC Interrupt number and wakeup 0x%x\n",
-		tpm_read_index(0x70));
+		tpm_read_index(nscAddrBase,0x70));
 	dev_dbg(&pci_dev->dev, "NSC IRQ type select 0x%x\n",
-		tpm_read_index(0x71));
+		tpm_read_index(nscAddrBase,0x71));
 	dev_dbg(&pci_dev->dev,
 		"NSC DMA channel select0 0x%x, select1 0x%x\n",
-		tpm_read_index(0x74), tpm_read_index(0x75));
+		tpm_read_index(nscAddrBase,0x74), tpm_read_index(nscAddrBase,0x75));
 	dev_dbg(&pci_dev->dev,
 		"NSC Config "
 		"0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
-		tpm_read_index(0xF0), tpm_read_index(0xF1),
-		tpm_read_index(0xF2), tpm_read_index(0xF3),
-		tpm_read_index(0xF4), tpm_read_index(0xF5),
-		tpm_read_index(0xF6), tpm_read_index(0xF7),
-		tpm_read_index(0xF8), tpm_read_index(0xF9));
+		tpm_read_index(nscAddrBase,0xF0), tpm_read_index(nscAddrBase,0xF1),
+		tpm_read_index(nscAddrBase,0xF2), tpm_read_index(nscAddrBase,0xF3),
+		tpm_read_index(nscAddrBase,0xF4), tpm_read_index(nscAddrBase,0xF5),
+		tpm_read_index(nscAddrBase,0xF6), tpm_read_index(nscAddrBase,0xF7),
+		tpm_read_index(nscAddrBase,0xF8), tpm_read_index(nscAddrBase,0xF9));
 
 	dev_info(&pci_dev->dev,
-		 "NSC PC21100 TPM revision %d\n",
-		 tpm_read_index(0x27) & 0x1F);
-
-	if (tpm_read_index(NSC_LDC_INDEX) == 0)
-		dev_info(&pci_dev->dev, ": NSC TPM not active\n");
-
-	/* select PM channel 1 */
-	tpm_write_index(NSC_LDN_INDEX, 0x12);
-	tpm_read_index(NSC_LDN_INDEX);
-
-	/* disable the DPM module */
-	tpm_write_index(NSC_LDC_INDEX, 0);
-	tpm_read_index(NSC_LDC_INDEX);
-
-	/* set the data register base addresses */
-	tpm_write_index(NSC_DIO_INDEX, TPM_NSC_BASE >> 8);
-	tpm_write_index(NSC_DIO_INDEX + 1, TPM_NSC_BASE);
-	tpm_read_index(NSC_DIO_INDEX);
-	tpm_read_index(NSC_DIO_INDEX + 1);
-
-	/* set the command register base addresses */
-	tpm_write_index(NSC_CIO_INDEX, (TPM_NSC_BASE + 1) >> 8);
-	tpm_write_index(NSC_CIO_INDEX + 1, (TPM_NSC_BASE + 1));
-	tpm_read_index(NSC_DIO_INDEX);
-	tpm_read_index(NSC_DIO_INDEX + 1);
-
-	/* set the interrupt number to be used for the host interface */
-	tpm_write_index(NSC_IRQ_INDEX, TPM_NSC_IRQ);
-	tpm_write_index(NSC_ITS_INDEX, 0x00);
-	tpm_read_index(NSC_IRQ_INDEX);
+		 "NSC TPM revision %d\n",
+		 tpm_read_index(nscAddrBase, 0x27) & 0x1F);
 
 	/* enable the DPM module */
-	tpm_write_index(NSC_LDC_INDEX, 0x01);
-	tpm_read_index(NSC_LDC_INDEX);
+	tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01);
 
 	if ((rc = tpm_register_hardware(pci_dev, &tpm_nsc)) < 0)
 		goto out_err;
@@ -339,6 +335,9 @@ static struct pci_device_id tpm_pci_tbl[
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0)},
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12)},
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0)},
+	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0)},
+	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1)},
+	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0)},
 	{PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_LPC)},
 	{0,}
 };
--- linux-2.6.12/include/linux/pci_ids.h	2005-06-17 16:04:03.000000000 -0700
+++ 25/include/linux/pci_ids.h	2005-06-26 02:21:57.000000000 -0700
@@ -1567,6 +1571,7 @@
 #define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220
 #define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB
 #define PCI_DEVICE_ID_SERVERWORKS_CSB6USB 0x0221
+#define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227
 #define PCI_DEVICE_ID_SERVERWORKS_GCLE    0x0225
 #define PCI_DEVICE_ID_SERVERWORKS_GCLE2   0x0227
 #define PCI_DEVICE_ID_SERVERWORKS_CSB5ISA 0x0230



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-28 15:08                 ` Kylene Jo Hall
@ 2005-06-28 16:51                   ` Pierre Ossman
  2005-06-28 17:03                     ` Kylene Jo Hall
  2005-06-28 17:23                   ` Chris Wright
  1 sibling, 1 reply; 36+ messages in thread
From: Pierre Ossman @ 2005-06-28 16:51 UTC (permalink / raw)
  To: Kylene Jo Hall; +Cc: Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

Kylene Jo Hall wrote:

>>You wouldn't happen to have just your patches available?
>>    
>>
>
>Here is the tpm portion of -mm patch
>
>  
>

Thanks. I've tried the patch and everthing seems to work fine now. :)

(btw. does no output in dmesg mean that no TPM chip was found? it seems
to have found a pci id it likes atleast.)

Rgds
Pierre

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-28 16:51                   ` Pierre Ossman
@ 2005-06-28 17:03                     ` Kylene Jo Hall
  2005-06-29  7:03                       ` Pierre Ossman
  0 siblings, 1 reply; 36+ messages in thread
From: Kylene Jo Hall @ 2005-06-28 17:03 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Bjorn Helgaas, LKML, jgarzik, tpmdd-devel


> (btw. does no output in dmesg mean that no TPM chip was found? it seems
> to have found a pci id it likes atleast.)
> 

True I think if a chip is found there should be info in dmesg.  Are you
loading tpm_atmel or tpm_nsc?  You can look at /proc/misc or see
if /sys/class/misc/tpm0 exists.

Do you know if your machine has a TPM?  Is it activated in BIOS?

Thanks,
Kylie

> Rgds
> Pierre
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-28 15:08                 ` Kylene Jo Hall
  2005-06-28 16:51                   ` Pierre Ossman
@ 2005-06-28 17:23                   ` Chris Wright
  2005-06-28 20:29                     ` 2.6.12 breaks 8139cp [PATCH 1 of 2] Kylene Jo Hall
  2005-06-28 20:30                     ` 2.6.12 breaks 8139cp [PATCH 2 " Kylene Jo Hall
  1 sibling, 2 replies; 36+ messages in thread
From: Chris Wright @ 2005-06-28 17:23 UTC (permalink / raw)
  To: Kylene Jo Hall; +Cc: Pierre Ossman, Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

* Kylene Jo Hall (kjhall@us.ibm.com) wrote:
> 
> > You wouldn't happen to have just your patches available?
> 
> Here is the tpm portion of -mm patch

Can you narrow this down to a fix that's reasonable for -stable?

thanks,
-chris

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp [PATCH 1 of 2]
  2005-06-28 17:23                   ` Chris Wright
@ 2005-06-28 20:29                     ` Kylene Jo Hall
  2005-06-28 20:34                       ` Chris Wright
  2005-06-28 20:30                     ` 2.6.12 breaks 8139cp [PATCH 2 " Kylene Jo Hall
  1 sibling, 1 reply; 36+ messages in thread
From: Kylene Jo Hall @ 2005-06-28 20:29 UTC (permalink / raw)
  To: Chris Wright; +Cc: Pierre Ossman, Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

On Tue, 2005-06-28 at 10:23 -0700, Chris Wright wrote:
> * Kylene Jo Hall (kjhall@us.ibm.com) wrote:
> > 
> > > You wouldn't happen to have just your patches available?
> > 
> > Here is the tpm portion of -mm patch
> 
> Can you narrow this down to a fix that's reasonable for -stable?

I'll be sending two patches to fix this problem.  The first one just
changes a bunch of #define's to named emums.  The second is the real
fix.  This was the easiest way for me, let me know if this is not ok.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---
diff -uprN linux-2.6.12-rc2/drivers/char/tpm/tpm_atmel.c linux-2.6.12-rc2-tpmdd/drivers/char/tpm/tpm_atmel.c
--- linux-2.6.12-rc2/drivers/char/tpm/tpm_atmel.c	2005-04-15 16:31:21.000000000 -0500
+++ linux-2.6.12-rc2-tpmdd/drivers/char/tpm/tpm_atmel.c	2005-04-15 16:26:17.000000000 -0500
@@ -22,17 +22,22 @@
 #include "tpm.h"
 
 /* Atmel definitions */
-#define	TPM_ATML_BASE			0x400
+enum tpm_atmel_addr{
+	TPM_ATML_BASE = 0x400
+};
 
 /* write status bits */
-#define	ATML_STATUS_ABORT		0x01
-#define	ATML_STATUS_LASTBYTE		0x04
-
+enum tpm_atmel_write_status {
+	ATML_STATUS_ABORT = 0x01,
+	ATML_STATUS_LASTBYTE = 0x04
+};
 /* read status bits */
-#define	ATML_STATUS_BUSY		0x01
-#define	ATML_STATUS_DATA_AVAIL		0x02
-#define	ATML_STATUS_REWRITE		0x04
-
+enum tpm_atmel_read_status {
+	ATML_STATUS_BUSY = 0x01,
+	ATML_STATUS_DATA_AVAIL = 0x02,
+	ATML_STATUS_REWRITE = 0x04,
+	ATML_STATUS_READY = 0x08
+};

 static int tpm_atml_recv(struct tpm_chip *chip, u8 * buf, size_t count)
 {
diff -uprN linux-2.6.12-rc2/drivers/char/tpm/tpm.c linux-2.6.12-rc2-tpmdd/drivers/char/tpm/tpm.c
--- linux-2.6.12-rc2/drivers/char/tpm/tpm.c	2005-04-15 16:30:55.000000000 -0500
+++ linux-2.6.12-rc2-tpmdd/drivers/char/tpm/tpm.c	2005-04-15 16:28:55.000000000 -0500
@@ -28,19 +28,35 @@
 #include <linux/spinlock.h>
 #include "tpm.h"
 
-#define	TPM_MINOR			224	/* officially assigned */
+enum tpm_const {
+	TPM_MINOR = 224,	/* officially assigned */
+	TPM_BUFSIZE = 2048,
+	TPM_NUM_DEVICES = 256,
+	TPM_NUM_MASK_ENTRIES = TPM_NUM_DEVICES / (8 * sizeof(int))
+};
 
-#define	TPM_BUFSIZE			2048
+  /* PCI configuration addresses */
+enum tpm_pci_config_addr {
+	PCI_GEN_PMCON_1 = 0xA0,
+	PCI_GEN1_DEC = 0xE4,
+	PCI_LPC_EN = 0xE6,
+	PCI_GEN2_DEC = 0xEC
+};
+
+enum tpm_config {
+	TPM_LOCK_REG = 0x0D,
+	TPM_INTERUPT_REG = 0x0A,
+	TPM_BASE_ADDR_LO = 0x08,
+	TPM_BASE_ADDR_HI = 0x09,
+	TPM_UNLOCK_VALUE = 0x55,
+	TPM_LOCK_VALUE = 0xAA,
+	TPM_DISABLE_INTERUPT_VALUE = 0x00
+};
 
-/* PCI configuration addresses */
-#define	PCI_GEN_PMCON_1			0xA0
-#define	PCI_GEN1_DEC			0xE4
-#define	PCI_LPC_EN			0xE6
-#define	PCI_GEN2_DEC			0xEC
 
 static LIST_HEAD(tpm_chip_list);
 static DEFINE_SPINLOCK(driver_lock);
-static int dev_mask[32];
+static int dev_mask[TPM_NUM_MASK_ENTRIES];
 
 static void user_reader_timeout(unsigned long ptr)
 {
@@ -102,17 +118,18 @@ int tpm_lpc_bus_init(struct pci_dev *pci
 			pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,
 					       tmp);
 		}
-		tpm_write_index(0x0D, 0x55);	/* unlock 4F */
-		tpm_write_index(0x0A, 0x00);	/* int disable */
-		tpm_write_index(0x08, base);	/* base addr lo */
-		tpm_write_index(0x09, (base & 0xFF00) >> 8);	/* base addr hi */
-		tpm_write_index(0x0D, 0xAA);	/* lock 4F */
 		break;
 	case PCI_VENDOR_ID_AMD:
 		/* nothing yet */
 		break;
 	}

+	tpm_write_index(TPM_LOCK_REG, TPM_UNLOCK_VALUE);
+	tpm_write_index(TPM_INTERUPT_REG, TPM_DISABLE_INTERUPT_VALUE);
+	tpm_write_index(TPM_BASE_ADDR_LO, base);
+	tpm_write_index(TPM_BASE_ADDR_HI, (base & 0xFF00) >> 8); 
+	tpm_write_index(TPM_LOCK_REG, TPM_LOCK_VALUE);
+
	return 0;
 }
 
diff -uprN linux-2.6.12-rc2/drivers/char/tpm/tpm_nsc.c linux-2.6.12-rc2-tpmdd/drivers/char/tpm/tpm_nsc.c
--- linux-2.6.12-rc2/drivers/char/tpm/tpm_nsc.c	2005-04-15 16:31:31.000000000 -0500
+++ linux-2.6.12-rc2-tpmdd/drivers/char/tpm/tpm_nsc.c	2005-04-15 16:26:28.000000000 -0500
@@ -22,34 +22,42 @@
 #include "tpm.h"
 
 /* National definitions */
-#define	TPM_NSC_BASE			0x360
-#define	TPM_NSC_IRQ			0x07
+enum tpm_nsc_addr {
+	TPM_NSC_BASE = 0x360,
+	TPM_NSC_IRQ = 0x07
+};
 
-#define	NSC_LDN_INDEX			0x07
-#define	NSC_SID_INDEX			0x20
-#define	NSC_LDC_INDEX			0x30
-#define	NSC_DIO_INDEX			0x60
-#define	NSC_CIO_INDEX			0x62
-#define	NSC_IRQ_INDEX			0x70
-#define	NSC_ITS_INDEX			0x71
-
-#define	NSC_STATUS			0x01
-#define	NSC_COMMAND			0x01
-#define	NSC_DATA			0x00
+enum tpm_nsc_index {
+	NSC_LDN_INDEX = 0x07,
+	NSC_SID_INDEX = 0x20,
+	NSC_LDC_INDEX = 0x30,
+	NSC_DIO_INDEX = 0x60,
+	NSC_CIO_INDEX = 0x62,
+	NSC_IRQ_INDEX = 0x70,
+	NSC_ITS_INDEX = 0x71
+};
 
-/* status bits */
-#define	NSC_STATUS_OBF			0x01	/* output buffer full */
-#define	NSC_STATUS_IBF			0x02	/* input buffer full */
-#define	NSC_STATUS_F0			0x04	/* F0 */
-#define	NSC_STATUS_A2			0x08	/* A2 */
-#define	NSC_STATUS_RDY			0x10	/* ready to receive command */
-#define	NSC_STATUS_IBR			0x20	/* ready to receive data */
+enum tpm_nsc_status_loc {
+	NSC_STATUS = 0x01,
+	NSC_COMMAND = 0x01,
+	NSC_DATA = 0x00
+};
 
+/* status bits */
+enum tpm_nsc_status{
+	NSC_STATUS_OBF = 0x01,	/* output buffer full */
+	NSC_STATUS_IBF = 0x02,	/* input buffer full */
+	NSC_STATUS_F0 = 0x04,	/* F0 */
+	NSC_STATUS_A2 = 0x08,	/* A2 */
+	NSC_STATUS_RDY = 0x10,	/* ready to receive command */
+	NSC_STATUS_IBR = 0x20	/* ready to receive data */
+};
 /* command bits */
-#define	NSC_COMMAND_NORMAL		0x01	/* normal mode */
-#define	NSC_COMMAND_EOC			0x03
-#define	NSC_COMMAND_CANCEL		0x22
-
+enum tpm_nsc_cmd_mode {
+	NSC_COMMAND_NORMAL = 0x01,	/* normal mode */
+	NSC_COMMAND_EOC = 0x03,
+	NSC_COMMAND_CANCEL = 0x22
+};
 /*
  * Wait for a certain status to appear
  */
+};
diff -uprN linux-2.6.12-rc2/drivers/char/tpm/tpm.h linux-2.6.12-rc2-tpmdd/drivers/char/tpm/tpm.h
--- linux-2.6.12-rc2/drivers/char/tpm/tpm.h     2005-04-15 15:13:29.000000000 -0500
+++ linux-2.6.12-rc2-tpmdd/drivers/char/tpm/tpm.h       2005-04-15 16:25:18.000000000 -0500
@@ -25,11 +25,16 @@
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 
-#define TPM_TIMEOUT msecs_to_jiffies(5)
+enum tpm_timeout {
+	TPM_TIMEOUT = 5,	/* msecs */
+};
 
 /* TPM addresses */
-#define	TPM_ADDR			0x4E
-#define	TPM_DATA			0x4F
+enum tpm_addr {
+	TPM_ADDR = 0x4E,
+	TPM_DATA = 0x4F
+};
+
 
 struct tpm_chip;
 
--- linux-2.6.12-rc2/drivers/char/tpm/tpm.c	2005-04-25 18:44:16.000000000 -0500
+++ linux-2.6.12-rc2-tpmdd/drivers/chat/tpm/tpm.c	2005-04-25 18:45:30.000000000 -0500
@@ -566,7 +566,7 @@ void __devexit tpm_remove(struct pci_dev
 
 	pci_disable_device(pci_dev);
 
-	dev_mask[chip->dev_num / 32] &= !(1 << (chip->dev_num % 32));
+	dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES));
 
 	kfree(chip);
 
@@ -646,10 +646,11 @@ int tpm_register_hardware(struct pci_dev
 
 	chip->dev_num = -1;
 
-	for (i = 0; i < 32; i++)
-		for (j = 0; j < 8; j++)
+	for (i = 0; i < TPM_NUM_MASK_ENTRIES; i++)
+		for (j = 0; j < 8 * sizeof(int); j++)
 			if ((dev_mask[i] & (1 << j)) == 0) {
-				chip->dev_num = i * 32 + j;
+				chip->dev_num =
+				    i * TPM_NUM_MASK_ENTRIES + j;
 				dev_mask[i] |= 1 << j;
 				goto dev_num_search_complete;
 			}




^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp [PATCH 2 of 2]
  2005-06-28 17:23                   ` Chris Wright
  2005-06-28 20:29                     ` 2.6.12 breaks 8139cp [PATCH 1 of 2] Kylene Jo Hall
@ 2005-06-28 20:30                     ` Kylene Jo Hall
  1 sibling, 0 replies; 36+ messages in thread
From: Kylene Jo Hall @ 2005-06-28 20:30 UTC (permalink / raw)
  To: Chris Wright; +Cc: Pierre Ossman, Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

On Tue, 2005-06-28 at 10:23 -0700, Chris Wright wrote:
> * Kylene Jo Hall (kjhall@us.ibm.com) wrote:
> > 
> > > You wouldn't happen to have just your patches available?
> > 
> > Here is the tpm portion of -mm patch
> 
> Can you narrow this down to a fix that's reasonable for -stable?
> 
I'll be sending two patches to fix this problem.  The first one just
changes a bunch of #define's to named emums.  The second is the real
fix.  This was the easiest way for me, let me know if this is not ok.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---

 drivers/char/tpm/tpm.c       |   90 -------------------------------------------
 drivers/char/tpm/tpm.h       |    2 
 drivers/char/tpm/tpm_atmel.c |   16 ++++---
 drivers/char/tpm/tpm_nsc.c   |   22 ++++++----
 4 files changed, 22 insertions(+), 108 deletions(-)

diff -puN drivers/char/tpm/tpm_atmel.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm_atmel.c
--- 25/drivers/char/tpm/tpm_atmel.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm_atmel.c	2005-06-23 21:26:00.000000000 -0700
@@ -22,8 +22,9 @@
 #include "tpm.h"
 
 /* Atmel definitions */
-enum tpm_atmel_addr{
-	TPM_ATML_BASE = 0x400
+enum tpm_atmel_addr {
+	TPM_ATMEL_BASE_ADDR_LO = 0x08,
+	TPM_ATMEL_BASE_ADDR_HI = 0x09
 };
 
 /* write status bits */
@@ -148,5 +149,4 @@ static struct tpm_vendor_specific tpm_at
 	.req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
 	.req_complete_val = ATML_STATUS_DATA_AVAIL,
-	.base = TPM_ATML_BASE,
 	.miscdev = { .fops = &atmel_ops, },
 };
@@ -158,14 +158,16 @@ static int __devinit tpm_atml_init(struc
 {
 	u8 version[4];
 	int rc = 0;
+	int lo, hi;
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
+	lo = tpm_read_index( TPM_ATMEL_BASE_ADDR_LO );
+	hi = tpm_read_index( TPM_ATMEL_BASE_ADDR_HI );
+
+	tpm_atmel.base = (hi<<8)|lo;
+	dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
 
 	/* verify that it is an Atmel part */
 	if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
diff -puN drivers/char/tpm/tpm.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm.c
--- 25/drivers/char/tpm/tpm.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm.c	2005-06-23 21:52:40.000000000 -0700
@@ -35,25 +35,6 @@ enum tpm_const {
 	TPM_NUM_MASK_ENTRIES = TPM_NUM_DEVICES / (8 * sizeof(int))
 };
 
-  /* PCI configuration addresses */
-enum tpm_pci_config_addr {
-	PCI_GEN_PMCON_1 = 0xA0,
-	PCI_GEN1_DEC = 0xE4,
-	PCI_LPC_EN = 0xE6,
-	PCI_GEN2_DEC = 0xEC
-};
-
-enum tpm_config {
-	TPM_LOCK_REG = 0x0D,
-	TPM_INTERUPT_REG = 0x0A,
-	TPM_BASE_ADDR_LO = 0x08,
-	TPM_BASE_ADDR_HI = 0x09,
-	TPM_UNLOCK_VALUE = 0x55,
-	TPM_LOCK_VALUE = 0xAA,
-	TPM_DISABLE_INTERUPT_VALUE = 0x00
-};
-
-
 static LIST_HEAD(tpm_chip_list);
 static DEFINE_SPINLOCK(driver_lock);
 static int dev_mask[TPM_NUM_MASK_ENTRIES];
@@ -77,73 +77,6 @@ void tpm_time_expired(unsigned long ptr)
 EXPORT_SYMBOL_GPL(tpm_time_expired);
 
 /*
- * Initialize the LPC bus and enable the TPM ports
- */
-int tpm_lpc_bus_init(struct pci_dev *pci_dev, u16 base)
-{
-	u32 lpcenable, tmp;
-	int is_lpcm = 0;
-
-	switch (pci_dev->vendor) {
-	case PCI_VENDOR_ID_INTEL:
-		switch (pci_dev->device) {
-		case PCI_DEVICE_ID_INTEL_82801CA_12:
-		case PCI_DEVICE_ID_INTEL_82801DB_12:
-			is_lpcm = 1;
-			break;
-		}
-		/* init ICH (enable LPC) */
-		pci_read_config_dword(pci_dev, PCI_GEN1_DEC, &lpcenable);
-		lpcenable |= 0x20000000;
-		pci_write_config_dword(pci_dev, PCI_GEN1_DEC, lpcenable);
-
-		if (is_lpcm) {
-			pci_read_config_dword(pci_dev, PCI_GEN1_DEC,
-					      &lpcenable);
-			if ((lpcenable & 0x20000000) == 0) {
-				dev_err(&pci_dev->dev,
-					"cannot enable LPC\n");
-				return -ENODEV;
-			}
-		}
-
-		/* initialize TPM registers */
-		pci_read_config_dword(pci_dev, PCI_GEN2_DEC, &tmp);
-
-		if (!is_lpcm)
-			tmp = (tmp & 0xFFFF0000) | (base & 0xFFF0);
-		else
-			tmp =
-			    (tmp & 0xFFFF0000) | (base & 0xFFF0) |
-			    0x00000001;
-
-		pci_write_config_dword(pci_dev, PCI_GEN2_DEC, tmp);
-
-		if (is_lpcm) {
-			pci_read_config_dword(pci_dev, PCI_GEN_PMCON_1,
-					      &tmp);
-			tmp |= 0x00000004;	/* enable CLKRUN */
-			pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,
-					       tmp);
-		}
-		break;
-	case PCI_VENDOR_ID_AMD:
-		/* nothing yet */
-		break;
-	}
-
-	tpm_write_index(TPM_LOCK_REG, TPM_UNLOCK_VALUE);
-	tpm_write_index(TPM_INTERUPT_REG, TPM_DISABLE_INTERUPT_VALUE);
-	tpm_write_index(TPM_BASE_ADDR_LO, base);
-	tpm_write_index(TPM_BASE_ADDR_HI, (base & 0xFF00) >> 8); 
-	tpm_write_index(TPM_LOCK_REG, TPM_LOCK_VALUE);
-
-	return 0;
-}
-
-EXPORT_SYMBOL_GPL(tpm_lpc_bus_init);
-
-/*
  * Internal kernel interface to transmit TPM commands
  */
 static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
@@ -586,10 +500,6 @@ int tpm_pm_resume(struct pci_dev *pci_de
 	if (chip == NULL)
 		return -ENODEV;
 
-	spin_lock(&driver_lock);
-	tpm_lpc_bus_init(pci_dev, chip->vendor->base);
-	spin_unlock(&driver_lock);
-
 	return 0;
 }
 
diff -puN drivers/char/tpm/tpm.h~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm.h
--- 25/drivers/char/tpm/tpm.h~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm.h	2005-06-23 21:26:00.000000000 -0700
@@ -91,9 +91,7 @@ static inline void tpm_write_index(int i
 	outb(value & 0xFF, TPM_DATA);
 }

 extern void tpm_time_expired(unsigned long);
-extern int tpm_lpc_bus_init(struct pci_dev *, u16);
-
 extern int tpm_register_hardware(struct pci_dev *,
 				 struct tpm_vendor_specific *);
 extern int tpm_open(struct inode *, struct file *);
diff -puN drivers/char/tpm/tpm_nsc.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm_nsc.c
--- 25/drivers/char/tpm/tpm_nsc.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm_nsc.c	2005-06-23 21:26:00.000000000 -0700
@@ -22,9 +22,13 @@
 #include "tpm.h"
 
 /* National definitions */
-enum tpm_nsc_addr {
+enum tpm_nsc_addr{
 	TPM_NSC_BASE = 0x360,
-	TPM_NSC_IRQ = 0x07
+	TPM_NSC_IRQ = 0x07,
+	TPM_NSC_BASE0_HI = 0x60,
+	TPM_NSC_BASE0_LO = 0x61,
+	TPM_NSC_BASE1_HI = 0x62,
+	TPM_NSC_BASE1_LO = 0x63
 };
 
 enum tpm_nsc_index {
@@ -44,7 +48,7 @@ enum tpm_nsc_status_loc {
 };
 
 /* status bits */
-enum tpm_nsc_status{
+enum tpm_nsc_status {
 	NSC_STATUS_OBF = 0x01,	/* output buffer full */
 	NSC_STATUS_IBF = 0x02,	/* input buffer full */
 	NSC_STATUS_F0 = 0x04,	/* F0 */
@@ -246,5 +250,4 @@ static struct tpm_vendor_specific tpm_ns
 	.req_complete_mask = NSC_STATUS_OBF,
 	.req_complete_val = NSC_STATUS_OBF,
-	.base = TPM_NSC_BASE,
 	.miscdev = { .fops = &nsc_ops, },
 };
@@ -255,15 +258,16 @@ static int __devinit tpm_nsc_init(struct
 				  const struct pci_device_id *pci_id)
 {
 	int rc = 0;
+	int lo, hi;
+
+	hi = tpm_read_index(TPM_NSC_BASE0_HI);
+	lo = tpm_read_index(TPM_NSC_BASE0_LO);
+
+	tpm_nsc.base = (hi<<8) | lo;
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
-
 	/* verify that it is a National part (SID) */
 	if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
 		rc = -ENODEV;
_




^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp [PATCH 1 of 2]
  2005-06-28 20:29                     ` 2.6.12 breaks 8139cp [PATCH 1 of 2] Kylene Jo Hall
@ 2005-06-28 20:34                       ` Chris Wright
  2005-06-28 22:10                         ` Kylene Jo Hall
  0 siblings, 1 reply; 36+ messages in thread
From: Chris Wright @ 2005-06-28 20:34 UTC (permalink / raw)
  To: Kylene Jo Hall
  Cc: Chris Wright, Pierre Ossman, Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

* Kylene Jo Hall (kjhall@us.ibm.com) wrote:
> On Tue, 2005-06-28 at 10:23 -0700, Chris Wright wrote:
> > * Kylene Jo Hall (kjhall@us.ibm.com) wrote:
> > > 
> > > > You wouldn't happen to have just your patches available?
> > > 
> > > Here is the tpm portion of -mm patch
> > 
> > Can you narrow this down to a fix that's reasonable for -stable?
> 
> I'll be sending two patches to fix this problem.  The first one just
> changes a bunch of #define's to named emums.  The second is the real
> fix.  This was the easiest way for me, let me know if this is not ok.

Just the real fix is the best for -stable, please.

thanks,
-chris

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp [PATCH 1 of 2]
  2005-06-28 20:34                       ` Chris Wright
@ 2005-06-28 22:10                         ` Kylene Jo Hall
  2005-06-29  8:22                           ` Pierre Ossman
  0 siblings, 1 reply; 36+ messages in thread
From: Kylene Jo Hall @ 2005-06-28 22:10 UTC (permalink / raw)
  To: Chris Wright; +Cc: Pierre Ossman, Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

> > > > Here is the tpm portion of -mm patch
> > > 
> > > Can you narrow this down to a fix that's reasonable for -stable?
> > 
> > I'll be sending two patches to fix this problem.  The first one just
> > changes a bunch of #define's to named emums.  The second is the real
> > fix.  This was the easiest way for me, let me know if this is not ok.
> 
> Just the real fix is the best for -stable, please.

Here is the patch that should fix the problem.  Pierre can you remove
the first patch I sent and test this one?

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---

 drivers/char/tpm/tpm.c       |   90 -------------------------------------------
 drivers/char/tpm/tpm.h       |    2 
 drivers/char/tpm/tpm_atmel.c |   16 ++++---
 drivers/char/tpm/tpm_nsc.c   |   22 ++++++----
 4 files changed, 22 insertions(+), 108 deletions(-)

diff -puN drivers/char/tpm/tpm_atmel.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm_atmel.c
--- 25/drivers/char/tpm/tpm_atmel.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm_atmel.c	2005-06-23 21:26:00.000000000 -0700
@@ -22,6 +22,8 @@
 #include "tpm.h"
 
 /* Atmel definitions */
-#define	TPM_ATML_BASE			0x400
+enum tpm_atmel_addr {
+	TPM_ATMEL_BASE_ADDR_LO = 0x08,
+	TPM_ATMEL_BASE_ADDR_HI = 0x09
 
 /* write status bits */
@@ -148,5 +149,4 @@ static struct tpm_vendor_specific tpm_at
 	.req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
 	.req_complete_val = ATML_STATUS_DATA_AVAIL,
-	.base = TPM_ATML_BASE,
 	.miscdev = { .fops = &atmel_ops, },
 };
@@ -158,14 +158,16 @@ static int __devinit tpm_atml_init(struc
 {
 	u8 version[4];
 	int rc = 0;
+	int lo, hi;
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
+	lo = tpm_read_index( TPM_ATMEL_BASE_ADDR_LO );
+	hi = tpm_read_index( TPM_ATMEL_BASE_ADDR_HI );
+
+	tpm_atmel.base = (hi<<8)|lo;
+	dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
 
 	/* verify that it is an Atmel part */
 	if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
diff -puN drivers/char/tpm/tpm.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm.c
--- 25/drivers/char/tpm/tpm.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm.c	2005-06-23 21:52:40.000000000 -0700
@@ -35,10 +35,4 @@ 
 #define	TPM_BUFSIZE			2048
 
-/* PCI configuration addresses */
-#define	PCI_GEN_PMCON_1			0xA0
-#define	PCI_GEN1_DEC			0xE4
-#define	PCI_LPC_EN			0xE6
-#define	PCI_GEN2_DEC			0xEC
-
 static LIST_HEAD(tpm_chip_list);
 static DEFINE_SPINLOCK(driver_lock);
@@ -61,72 +61,6 @@ void tpm_time_expired(unsigned long ptr)
 EXPORT_SYMBOL_GPL(tpm_time_expired);
 
 /*
- * Initialize the LPC bus and enable the TPM ports
- */
-int tpm_lpc_bus_init(struct pci_dev *pci_dev, u16 base)
-{
-	u32 lpcenable, tmp;
-	int is_lpcm = 0;
-
-	switch (pci_dev->vendor) {
-	case PCI_VENDOR_ID_INTEL:
-		switch (pci_dev->device) {
-		case PCI_DEVICE_ID_INTEL_82801CA_12:
-		case PCI_DEVICE_ID_INTEL_82801DB_12:
-			is_lpcm = 1;
-			break;
-		}
-		/* init ICH (enable LPC) */
-		pci_read_config_dword(pci_dev, PCI_GEN1_DEC, &lpcenable);
-		lpcenable |= 0x20000000;
-		pci_write_config_dword(pci_dev, PCI_GEN1_DEC, lpcenable);
-
-		if (is_lpcm) {
-			pci_read_config_dword(pci_dev, PCI_GEN1_DEC,
-					      &lpcenable);
-			if ((lpcenable & 0x20000000) == 0) {
-				dev_err(&pci_dev->dev,
-					"cannot enable LPC\n");
-				return -ENODEV;
-			}
-		}
-
-		/* initialize TPM registers */
-		pci_read_config_dword(pci_dev, PCI_GEN2_DEC, &tmp);
-
-		if (!is_lpcm)
-			tmp = (tmp & 0xFFFF0000) | (base & 0xFFF0);
-		else
-			tmp =
-			    (tmp & 0xFFFF0000) | (base & 0xFFF0) |
-			    0x00000001;
-
-		pci_write_config_dword(pci_dev, PCI_GEN2_DEC, tmp);
-
-		if (is_lpcm) {
-			pci_read_config_dword(pci_dev, PCI_GEN_PMCON_1,
-					      &tmp);
-			tmp |= 0x00000004;	/* enable CLKRUN */
-			pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,
-					       tmp);
-		}
-		tpm_write_index(0x0D, 0x55);	/* unlock 4F */
-		tpm_write_index(0x0A, 0x00);	/* int disable */
-		tpm_write_index(0x08, base);	/* base addr lo */
-		tpm_write_index(0x09, (base & 0xFF00) >> 8);	/* base addr hi */
-		tpm_write_index(0x0D, 0xAA);	/* lock 4F */
-		break;
-	case PCI_VENDOR_ID_AMD:
-		/* nothing yet */
-		break;
-	}
-
-	return 0;
-}
-
-EXPORT_SYMBOL_GPL(tpm_lpc_bus_init);
-
-/*
  * Internal kernel interface to transmit TPM commands
  */
 static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
@@ -586,10 +500,6 @@ int tpm_pm_resume(struct pci_dev *pci_de
 	if (chip == NULL)
 		return -ENODEV;
 
-	spin_lock(&driver_lock);
-	tpm_lpc_bus_init(pci_dev, chip->vendor->base);
-	spin_unlock(&driver_lock);
-
 	return 0;
 }
 
diff -puN drivers/char/tpm/tpm.h~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm.h
--- 25/drivers/char/tpm/tpm.h~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm.h	2005-06-23 21:26:00.000000000 -0700
@@ -91,9 +91,7 @@ static inline void tpm_write_index(int i
 	outb(value & 0xFF, TPM_DATA);
 }

 extern void tpm_time_expired(unsigned long);
-extern int tpm_lpc_bus_init(struct pci_dev *, u16);
-
 extern int tpm_register_hardware(struct pci_dev *,
 				 struct tpm_vendor_specific *);
 extern int tpm_open(struct inode *, struct file *);
diff -puN drivers/char/tpm/tpm_nsc.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm_nsc.c
--- 25/drivers/char/tpm/tpm_nsc.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm_nsc.c	2005-06-23 21:26:00.000000000 -0700
@@ -22,6 +22,10 @@
 /* National definitions */
 #define 	TPM_NSC_BASE			0x360
 #define	TPM_NSC_IRQ			0x07
+#define	TPM_NSC_BASE0_HI		0x60
+#define	TPM_NSC_BASE0_LO		0x61
+#define	TPM_NSC_BASE1_HI		0x62
+#define	TPM_NSC_BASE1_LO		0x63

 #define	NSC_LDN_INDEX			0x07
 #define	NSC_SID_INDEX			0x20
@@ -246,5 +250,4 @@ static struct tpm_vendor_specific tpm_ns
 	.req_complete_mask = NSC_STATUS_OBF,
 	.req_complete_val = NSC_STATUS_OBF,
-	.base = TPM_NSC_BASE,
 	.miscdev = { .fops = &nsc_ops, },
 };
@@ -255,15 +258,16 @@ static int __devinit tpm_nsc_init(struct
 				  const struct pci_device_id *pci_id)
 {
 	int rc = 0;
+	int lo, hi;
+
+	hi = tpm_read_index(TPM_NSC_BASE0_HI);
+	lo = tpm_read_index(TPM_NSC_BASE0_LO);
+
+	tpm_nsc.base = (hi<<8) | lo;
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
-
 	/* verify that it is a National part (SID) */
 	if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
 		rc = -ENODEV;
_






^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
  2005-06-28 17:03                     ` Kylene Jo Hall
@ 2005-06-29  7:03                       ` Pierre Ossman
  0 siblings, 0 replies; 36+ messages in thread
From: Pierre Ossman @ 2005-06-29  7:03 UTC (permalink / raw)
  To: Kylene Jo Hall; +Cc: LKML, tpmdd-devel

Kylene Jo Hall wrote:

>>(btw. does no output in dmesg mean that no TPM chip was found? it seems
>>to have found a pci id it likes atleast.)
>>
>>    
>>
>
>True I think if a chip is found there should be info in dmesg.  Are you
>loading tpm_atmel or tpm_nsc?  You can look at /proc/misc or see
>if /sys/class/misc/tpm0 exists.
>  
>

I'm using tpm_atmel (its PCI id list matches my LPC bridge). Nothing
shows up in /proc or /sys though.

>Do you know if your machine has a TPM?  Is it activated in BIOS?
>
>  
>

Haven't the slightest. :)
My BIOS is barely advanced enough to configure the clock. So no fancy
stuff like enabling/disabling parts of the hardware. ;)

Rgds
Pierre


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp [PATCH 1 of 2]
  2005-06-28 22:10                         ` Kylene Jo Hall
@ 2005-06-29  8:22                           ` Pierre Ossman
  2005-06-29 14:32                             ` Kylene Jo Hall
  0 siblings, 1 reply; 36+ messages in thread
From: Pierre Ossman @ 2005-06-29  8:22 UTC (permalink / raw)
  To: Kylene Jo Hall; +Cc: Chris Wright, Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

Kylene Jo Hall wrote:

>
>Here is the patch that should fix the problem.  Pierre can you remove
>the first patch I sent and test this one?
>
>  
>

Apart from an improperly closed enum the patch worked fine. Great work!

Rgds
Pierre


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp [PATCH 1 of 2]
  2005-06-29  8:22                           ` Pierre Ossman
@ 2005-06-29 14:32                             ` Kylene Jo Hall
       [not found]                               ` <20050705153512.GJ9046@shell0.pdx.osdl.net>
  0 siblings, 1 reply; 36+ messages in thread
From: Kylene Jo Hall @ 2005-06-29 14:32 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Chris Wright, Bjorn Helgaas, LKML, jgarzik, tpmdd-devel

On Wed, 2005-06-29 at 10:22 +0200, Pierre Ossman wrote:
> Kylene Jo Hall wrote:
> 
> >
> >Here is the patch that should fix the problem.  Pierre can you remove
> >the first patch I sent and test this one?
> >
> Apart from an improperly closed enum the patch worked fine. Great work!
> 
> Rgds
> Pierre

Please accept this patch.  The enum closing Pierre mentioned has been
fixed.  This patch fixes the 8309 networking problem.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---

 drivers/char/tpm/tpm.c       |   90 -------------------------------------------
 drivers/char/tpm/tpm.h       |    2 
 drivers/char/tpm/tpm_atmel.c |   16 ++++---
 drivers/char/tpm/tpm_nsc.c   |   22 ++++++----
 4 files changed, 22 insertions(+), 108 deletions(-)

diff -puN drivers/char/tpm/tpm_atmel.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm_atmel.c
--- 25/drivers/char/tpm/tpm_atmel.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm_atmel.c	2005-06-23 21:26:00.000000000 -0700
@@ -22,6 +22,9 @@
 #include "tpm.h"
 
 /* Atmel definitions */
-#define	TPM_ATML_BASE			0x400
+enum tpm_atmel_addr {
+	TPM_ATMEL_BASE_ADDR_LO = 0x08,
+	TPM_ATMEL_BASE_ADDR_HI = 0x09
+};
 
 /* write status bits */
@@ -148,5 +149,4 @@ static struct tpm_vendor_specific tpm_at
 	.req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
 	.req_complete_val = ATML_STATUS_DATA_AVAIL,
-	.base = TPM_ATML_BASE,
 	.miscdev = { .fops = &atmel_ops, },
 };
@@ -158,14 +158,16 @@ static int __devinit tpm_atml_init(struc
 {
 	u8 version[4];
 	int rc = 0;
+	int lo, hi;
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
+	lo = tpm_read_index( TPM_ATMEL_BASE_ADDR_LO );
+	hi = tpm_read_index( TPM_ATMEL_BASE_ADDR_HI );
+
+	tpm_atmel.base = (hi<<8)|lo;
+	dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
 
 	/* verify that it is an Atmel part */
 	if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
diff -puN drivers/char/tpm/tpm.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm.c
--- 25/drivers/char/tpm/tpm.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm.c	2005-06-23 21:52:40.000000000 -0700
@@ -35,10 +35,4 @@ 
 #define	TPM_BUFSIZE			2048
 
-/* PCI configuration addresses */
-#define	PCI_GEN_PMCON_1			0xA0
-#define	PCI_GEN1_DEC			0xE4
-#define	PCI_LPC_EN			0xE6
-#define	PCI_GEN2_DEC			0xEC
-
 static LIST_HEAD(tpm_chip_list);
 static DEFINE_SPINLOCK(driver_lock);
@@ -61,72 +61,6 @@ void tpm_time_expired(unsigned long ptr)
 EXPORT_SYMBOL_GPL(tpm_time_expired);
 
 /*
- * Initialize the LPC bus and enable the TPM ports
- */
-int tpm_lpc_bus_init(struct pci_dev *pci_dev, u16 base)
-{
-	u32 lpcenable, tmp;
-	int is_lpcm = 0;
-
-	switch (pci_dev->vendor) {
-	case PCI_VENDOR_ID_INTEL:
-		switch (pci_dev->device) {
-		case PCI_DEVICE_ID_INTEL_82801CA_12:
-		case PCI_DEVICE_ID_INTEL_82801DB_12:
-			is_lpcm = 1;
-			break;
-		}
-		/* init ICH (enable LPC) */
-		pci_read_config_dword(pci_dev, PCI_GEN1_DEC, &lpcenable);
-		lpcenable |= 0x20000000;
-		pci_write_config_dword(pci_dev, PCI_GEN1_DEC, lpcenable);
-
-		if (is_lpcm) {
-			pci_read_config_dword(pci_dev, PCI_GEN1_DEC,
-					      &lpcenable);
-			if ((lpcenable & 0x20000000) == 0) {
-				dev_err(&pci_dev->dev,
-					"cannot enable LPC\n");
-				return -ENODEV;
-			}
-		}
-
-		/* initialize TPM registers */
-		pci_read_config_dword(pci_dev, PCI_GEN2_DEC, &tmp);
-
-		if (!is_lpcm)
-			tmp = (tmp & 0xFFFF0000) | (base & 0xFFF0);
-		else
-			tmp =
-			    (tmp & 0xFFFF0000) | (base & 0xFFF0) |
-			    0x00000001;
-
-		pci_write_config_dword(pci_dev, PCI_GEN2_DEC, tmp);
-
-		if (is_lpcm) {
-			pci_read_config_dword(pci_dev, PCI_GEN_PMCON_1,
-					      &tmp);
-			tmp |= 0x00000004;	/* enable CLKRUN */
-			pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,
-					       tmp);
-		}
-		tpm_write_index(0x0D, 0x55);	/* unlock 4F */
-		tpm_write_index(0x0A, 0x00);	/* int disable */
-		tpm_write_index(0x08, base);	/* base addr lo */
-		tpm_write_index(0x09, (base & 0xFF00) >> 8);	/* base addr hi */
-		tpm_write_index(0x0D, 0xAA);	/* lock 4F */
-		break;
-	case PCI_VENDOR_ID_AMD:
-		/* nothing yet */
-		break;
-	}
-
-	return 0;
-}
-
-EXPORT_SYMBOL_GPL(tpm_lpc_bus_init);
-
-/*
  * Internal kernel interface to transmit TPM commands
  */
 static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
@@ -586,10 +500,6 @@ int tpm_pm_resume(struct pci_dev *pci_de
 	if (chip == NULL)
 		return -ENODEV;
 
-	spin_lock(&driver_lock);
-	tpm_lpc_bus_init(pci_dev, chip->vendor->base);
-	spin_unlock(&driver_lock);
-
 	return 0;
 }
 
diff -puN drivers/char/tpm/tpm.h~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm.h
--- 25/drivers/char/tpm/tpm.h~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm.h	2005-06-23 21:26:00.000000000 -0700
@@ -91,9 +91,7 @@ static inline void tpm_write_index(int i
 	outb(value & 0xFF, TPM_DATA);
 }

 extern void tpm_time_expired(unsigned long);
-extern int tpm_lpc_bus_init(struct pci_dev *, u16);
-
 extern int tpm_register_hardware(struct pci_dev *,
 				 struct tpm_vendor_specific *);
 extern int tpm_open(struct inode *, struct file *);
diff -puN drivers/char/tpm/tpm_nsc.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm_nsc.c
--- 25/drivers/char/tpm/tpm_nsc.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm_nsc.c	2005-06-23 21:26:00.000000000 -0700
@@ -22,6 +22,10 @@
 /* National definitions */
 #define 	TPM_NSC_BASE			0x360
 #define	TPM_NSC_IRQ			0x07
+#define	TPM_NSC_BASE0_HI		0x60
+#define	TPM_NSC_BASE0_LO		0x61
+#define	TPM_NSC_BASE1_HI		0x62
+#define	TPM_NSC_BASE1_LO		0x63

 #define	NSC_LDN_INDEX			0x07
 #define	NSC_SID_INDEX			0x20
@@ -246,5 +250,4 @@ static struct tpm_vendor_specific tpm_ns
 	.req_complete_mask = NSC_STATUS_OBF,
 	.req_complete_val = NSC_STATUS_OBF,
-	.base = TPM_NSC_BASE,
 	.miscdev = { .fops = &nsc_ops, },
 };
@@ -255,15 +258,16 @@ static int __devinit tpm_nsc_init(struct
 				  const struct pci_device_id *pci_id)
 {
 	int rc = 0;
+	int lo, hi;
+
+	hi = tpm_read_index(TPM_NSC_BASE0_HI);
+	lo = tpm_read_index(TPM_NSC_BASE0_LO);
+
+	tpm_nsc.base = (hi<<8) | lo;
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
-
 	/* verify that it is a National part (SID) */
 	if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
 		rc = -ENODEV;
_





^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp [PATCH 1 of 2]
       [not found]                               ` <20050705153512.GJ9046@shell0.pdx.osdl.net>
@ 2005-07-07 20:01                                 ` Kylene Jo Hall
  2005-07-08  6:14                                   ` Chris Wright
  0 siblings, 1 reply; 36+ messages in thread
From: Kylene Jo Hall @ 2005-07-07 20:01 UTC (permalink / raw)
  To: Chris Wright; +Cc: Bjorn Helgaas, LKML, jgarzik, tpmdd-devel, Pierre Ossman

On Tue, 2005-07-05 at 08:35 -0700, Chris Wright wrote:
> * Kylene Jo Hall (kjhall@us.ibm.com) wrote:
> > On Wed, 2005-06-29 at 10:22 +0200, Pierre Ossman wrote:
> > > Kylene Jo Hall wrote:
> > > 
> > > >
> > > >Here is the patch that should fix the problem.  Pierre can you remove
> > > >the first patch I sent and test this one?
> > > >
> > > Apart from an improperly closed enum the patch worked fine. Great work!
> > > 
> > > Rgds
> > > Pierre
> > 
> > Please accept this patch.  The enum closing Pierre mentioned has been
> > fixed.  This patch fixes the 8309 networking problem.
> 
> Kylene, is there any way you can narrow this down to the core, critical
> fix?  Something on the order of 10's of lines rather than 100's?  Also,
> a better patch description would be great (what's broken, what fixes
> it).

The patch below is the smallest I can make this.
> 
> thanks!
> -chris
> 

A problem was reported that the tpm driver was interfereing with
networking on the 8139 chipset.  The tpm driver was using a hard coded
the memory address instead of the value the BIOS was putting the chip
at.  This was in the tpm_lpc_bus_init function.  That function can be
replaced with querying the value at Vendor specific locations.  This
patch replaces all calls to tpm_lpc_bus_init and the hardcoding of the
base address with a lookup of the address at the correct vendor
location.

Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
---
diff -puN drivers/char/tpm/tpm_atmel.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm_atmel.c
--- 25/drivers/char/tpm/tpm_atmel.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm_atmel.c	2005-06-23 21:26:00.000000000 -0700
@@ -22,6 +22,9 @@
 #include "tpm.h"
 
 /* Atmel definitions */
-#define	TPM_ATML_BASE			0x400
+enum tpm_atmel_addr {
+	TPM_ATMEL_BASE_ADDR_LO = 0x08,
+	TPM_ATMEL_BASE_ADDR_HI = 0x09
+};
 
 /* write status bits */
@@ -148,5 +149,4 @@ static struct tpm_vendor_specific tpm_at
 	.req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
 	.req_complete_val = ATML_STATUS_DATA_AVAIL,
-	.base = TPM_ATML_BASE,
 	.miscdev = { .fops = &atmel_ops, },
 };
@@ -158,14 +158,16 @@ static int __devinit tpm_atml_init(struc
 {
 	u8 version[4];
 	int rc = 0;
+	int lo, hi;
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
+	lo = tpm_read_index( TPM_ATMEL_BASE_ADDR_LO );
+	hi = tpm_read_index( TPM_ATMEL_BASE_ADDR_HI );
+
+	tpm_atmel.base = (hi<<8)|lo;
+	dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
 
 	/* verify that it is an Atmel part */
 	if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
diff -puN drivers/char/tpm/tpm.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm.c
--- 25/drivers/char/tpm/tpm.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm.c	2005-06-23 21:52:40.000000000 -0700
@@ -586,10 +500,6 @@ int tpm_pm_resume(struct pci_dev *pci_de
 	if (chip == NULL)
 		return -ENODEV;
 
-	spin_lock(&driver_lock);
-	tpm_lpc_bus_init(pci_dev, chip->vendor->base);
-	spin_unlock(&driver_lock);
-
 	return 0;
 }
 
diff -puN drivers/char/tpm/tpm_nsc.c~tpm-replace-odd-LPC-init-function drivers/char/tpm/tpm_nsc.c
--- 25/drivers/char/tpm/tpm_nsc.c~tpm-replace-odd-LPC-init-function	2005-06-23 21:26:00.000000000 -0700
+++ 25-akpm/drivers/char/tpm/tpm_nsc.c	2005-06-23 21:26:00.000000000 -0700
@@ -22,6 +22,10 @@
 /* National definitions */
 #define 	TPM_NSC_BASE			0x360
 #define	TPM_NSC_IRQ			0x07
+#define	TPM_NSC_BASE0_HI		0x60
+#define	TPM_NSC_BASE0_LO		0x61
+#define	TPM_NSC_BASE1_HI		0x62
+#define	TPM_NSC_BASE1_LO		0x63

 #define	NSC_LDN_INDEX			0x07
 #define	NSC_SID_INDEX			0x20
@@ -246,5 +250,4 @@ static struct tpm_vendor_specific tpm_ns
 	.req_complete_mask = NSC_STATUS_OBF,
 	.req_complete_val = NSC_STATUS_OBF,
-	.base = TPM_NSC_BASE,
 	.miscdev = { .fops = &nsc_ops, },
 };
@@ -255,15 +258,16 @@ static int __devinit tpm_nsc_init(struct
 				  const struct pci_device_id *pci_id)
 {
 	int rc = 0;
+	int lo, hi;
+
+	hi = tpm_read_index(TPM_NSC_BASE0_HI);
+	lo = tpm_read_index(TPM_NSC_BASE0_LO);
+
+	tpm_nsc.base = (hi<<8) | lo;
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
 
-	if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
-		rc = -ENODEV;
-		goto out_err;
-	}
-
 	/* verify that it is a National part (SID) */
 	if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
 		rc = -ENODEV;
_




^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp [PATCH 1 of 2]
  2005-07-07 20:01                                 ` Kylene Jo Hall
@ 2005-07-08  6:14                                   ` Chris Wright
  0 siblings, 0 replies; 36+ messages in thread
From: Chris Wright @ 2005-07-08  6:14 UTC (permalink / raw)
  To: Kylene Jo Hall
  Cc: Chris Wright, Bjorn Helgaas, LKML, jgarzik, tpmdd-devel, Pierre Ossman

* Kylene Jo Hall (kjhall@us.ibm.com) wrote:
> A problem was reported that the tpm driver was interfereing with
> networking on the 8139 chipset.  The tpm driver was using a hard coded
> the memory address instead of the value the BIOS was putting the chip
> at.  This was in the tpm_lpc_bus_init function.  That function can be
> replaced with querying the value at Vendor specific locations.  This
> patch replaces all calls to tpm_lpc_bus_init and the hardcoding of the
> base address with a lookup of the address at the correct vendor
> location.

Thanks Kylene.  Looks like it's just no longer deleting tpm_lpc_bus_init.
So with that nice changelog, I think we'll just go with the full version.
Sorry for the extra work, I thought there might be a simple method by
passing lo/hi and doing tpm_read_index in tpm_lpc_bus_init to set base.

thanks,
-chris

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: 2.6.12 breaks 8139cp
@ 2005-06-26 13:46 Nick Warne
  0 siblings, 0 replies; 36+ messages in thread
From: Nick Warne @ 2005-06-26 13:46 UTC (permalink / raw)
  To: linux-kernel

> It seems that whatever is causing the bug i'm seeing was a change that 
> involved the network driver/interrupt subsystem and not actually the 
> 8139too driver, this was done at around 2.6.3-2.6.4.   A NAPI patch that 
> was introduced at that time basically reverted the interrupt function 
> and removed the poll functions from the driver (via not enabling napi in 
> Kconfig).

Ummm.  I was involved in this.  Here is the 'final' post after Mr Hirofumi 
found the cause of my issues:

http://www.ussg.iu.edu/hypermail/linux/kernel/0402.3/1709.html

But I looked at what he said and found the real problem on my system (after 
all that):

http://www.ussg.iu.edu/hypermail/linux/kernel/0403.1/1537.html

Nick
-- 
"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2005-07-08  6:14 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-22 21:03 2.6.12 breaks 8139cp Pierre Ossman
2005-06-22 21:34 ` Bjorn Helgaas
2005-06-23  7:50   ` Pierre Ossman
2005-06-23 12:59     ` Felipe W Damasio
2005-06-23 17:43     ` Bjorn Helgaas
2005-06-23 22:14       ` Pierre Ossman
2005-06-25  2:03         ` Ed Sweetman
2005-06-25  2:18           ` Ed Sweetman
2005-06-25  2:32             ` Ed Sweetman
2005-06-25  3:15               ` Jeff Garzik
2005-06-25 10:34           ` Pierre Ossman
2005-06-26 13:31             ` Ed Sweetman
2005-06-28  6:28         ` Pierre Ossman
2005-06-28 12:32           ` Pierre Ossman
2005-06-28 14:09             ` Kylene Jo Hall
2005-06-28 14:40               ` Pierre Ossman
2005-06-28 15:08                 ` Kylene Jo Hall
2005-06-28 16:51                   ` Pierre Ossman
2005-06-28 17:03                     ` Kylene Jo Hall
2005-06-29  7:03                       ` Pierre Ossman
2005-06-28 17:23                   ` Chris Wright
2005-06-28 20:29                     ` 2.6.12 breaks 8139cp [PATCH 1 of 2] Kylene Jo Hall
2005-06-28 20:34                       ` Chris Wright
2005-06-28 22:10                         ` Kylene Jo Hall
2005-06-29  8:22                           ` Pierre Ossman
2005-06-29 14:32                             ` Kylene Jo Hall
     [not found]                               ` <20050705153512.GJ9046@shell0.pdx.osdl.net>
2005-07-07 20:01                                 ` Kylene Jo Hall
2005-07-08  6:14                                   ` Chris Wright
2005-06-28 20:30                     ` 2.6.12 breaks 8139cp [PATCH 2 " Kylene Jo Hall
2005-06-23 17:17 ` 2.6.12 breaks 8139cp Roberto Oppedisano
2005-06-23 18:00   ` Bjorn Helgaas
2005-06-23 20:38     ` Ed Sweetman
2005-06-23 20:55       ` Bjorn Helgaas
2005-06-23 21:14         ` Ed Sweetman
2005-06-23 21:07     ` Roberto Oppedisano
2005-06-26 13:46 Nick Warne

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.