[PATCH 2.6.12-rc5] m32r: Update m32r_cfc.[ch] to support
Mappi-III platform
Hirokazu Takata
takata at linux-m32r.org
Wed Jun 29 07:09:16 EDT 2005
Hi,
Sorry for my late response, Dominik.
> > ... so now we have to determine why it doesn't work at boot time. Somewhen
> > during initialization pcmcia_register_socket() is called (can you check
> > _when_ this happens in your case), then pcmcia_parse_events() should lead to
> > socket_detect_change() being called eventually.
Yes.
I tried to check for the "pccard_static_ops" case in 2.6.12-mm2.
As I reported previously, a CF drive /dev/hda1 was not detected
at boot time (the detail boot log is attached below).
--- result ---------
ide-cs m32r_cfc result
-------- -------- ----------------------
built-in built-in CF card not detected.
module built-in CF card not detected.
pcmcia_register_socket() and pcmcia_parse_events() are called
via m32r_cfc.c::init_m32r_pcc() function at the follwing point of
the boot log message:
---
CF: Card is detected at socket 0 : stat = 0x00000001
m32r_cfc pcc at 0x00000000
---
> > If a card is present, it
> > should call socket_insert(); which in turn should cause ds_event() with
> > event==CS_EVENT_CARD_INSERTION being called eventually. Can you check
> > whether all this happens as expected for pccard_static_ops?
It seemed that these sequence was happened as you mentioned at this point.
But ide_disk_probe() was not called at boot time in the "pccard_static_ops"
case.
init_m32r_pcc()
pcmcia_register_socket()
pcmcia_parse_events()
:
pccardd()
socket_insert()
send_event() -> ds_event()
case CS_EVENT_CARD_INSERTION:
On the contrary, after booting, ide_disk_probe() was called for
card insert events like this.
pcmcia_device_probe()
ide_attach()
pcmcia_register_client()
ide_event()
idecs_register()
:
ide_disk_probe()
idedisk_setup()
--- boot log --------
Linux version 2.6.12-mm2 (takata at pcepx10) (gcc version 3.4.4 20050203 (prerelease) (Debian 3.4.3-9.1)) #21 SMP Wed Jun 29 11:09:24 JST 2005
user-defined physical RAM map:
Built 2 zonelists
Initializing CPU#0
Kernel command line: console=ttyS0,115200n8 root=/dev/nfs nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs2.6_04 ip=:::::eth0:dhcp mem=128M
PID hash table entries: 1024 (order: 10, 16384 bytes)
Timer start : latch = 7813
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 127948k/131592k available (1656k kernel code, 3488k reserved, 291k data, 96k init)
Mount-cache hash table entries: 512
M32R-mp information
On-chip CPUs : 2
CPU model : M32R-MP 012U2/CHAOS(Ver.)
CPU present map : 3
Booting processor 1/1
Waiting for send to finish...
Initializing CPU#1
CPU#1 (phys ID: 1) waiting for CALLOUT
+After Startup.
Before Callout 1.
After Callout 1.
OK.
Boot done.
Brought up 2 CPUs
CPU#0 : CPU clock 200.00MHz, Bus clock 100.00MHz, loops_per_jiffy[796672]
CPU#1 : CPU clock 200.00MHz, Bus clock 100.00MHz, loops_per_jiffy[796672]
Before bogomips.
Total of 2 processors activated (318.66 BogoMIPS).
Before bogocount - setting activated=1.
-> [0][1][ 65536] 0.0 [ 0.0] (0): ( 0 0)
-> [0][1][ 68985] 0.0 [ 0.0] (0): ( 0 0)
-> [0][1][ 72615] 0.0 [ 0.0] (0): ( 0 0)
-> [0][1][ 76436] 2.5 [ 2.5] (0): ( 2500000 1250000)
-> [0][1][ 80458] -2.-5 [ 2.5] (0): (-2500000 3125000)
-> [0][1][ 84692] 0.0 [ 2.5] (0): ( 0 2812500)
-> [0][1][ 89149] 0.0 [ 2.5] (0): ( 0 1406250)
-> [0][1][ 93841] -2.-5 [ 2.5] (0): (-2500000 1953125)
-> [0][1][ 98780] 0.0 [ 2.5] (0): ( 0 2226562)
-> [0][1][ 103978] 0.0 [ 2.5] (0): ( 0 1113281)
-> found max.
[0][1] working set size found: 76436, cost: 2500000
---------------------
| migration cost matrix (max_cache_size: 0, cpu: -1 MHz):
---------------------
[00] [01]
[00]: - 5.0(0)
[01]: 5.0(0) -
--------------------------------
| cacheflush times [1]: 5.0 (5000000)
| calibration delay: 0 seconds
--------------------------------
NET: Registered protocol family 16
inotify device minor=63
JFFS version 1.0, (C) 1999, 2000 Axis Communications AB
JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
cn_fork is registered
Serial: M32R SIO driver $Revision: 1.11 $ ttyS0 at I/O 0xefd000 (irq = 48) is a M32RSIO
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico at cam.org>
eth0: SMC91C11xFD (rev 1) at a0000300 IRQ 1
eth0: Ethernet addr: 08:00:70:25:6a:02
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
CF: Card is detected at socket 0 : stat = 0x00000001
m32r_cfc pcc at 0x00000000
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 8Kbytes
TCP established hash table entries: 8192 (order: 5, 131072 bytes)
TCP bind hash table entries: 8192 (order: 4, 98304 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
TCP bic registered
TCP westwood registered
TCP htcp registered
NET: Registered protocol family 1
eth0: link down
Sending DHCP requests .<6>eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
., OK
IP-Config: Got DHCP answer from 192.168.0.1, my address is 192.168.0.105
IP-Config: Complete:
device=eth0, addr=192.168.0.105, mask=255.255.255.0, gw=192.168.0.1,
host=mappi005, domain=, nis-domain=(none),
bootserver=192.168.0.1, rootserver=192.168.0.1, rootpath=
Looking up port of RPC 100003/2 on 192.168.0.1
Looking up port of RPC 100005/1 on 192.168.0.1
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 96k freed
INIT: version 2.86 booting
Mounting a tmpfs over /dev...done.
Creating initial device nodes...done.
Activating swap.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
System time was Thu Apr 17 00:02:13 UTC 2003.
Setting the System Clock using the Hardware Clock as reference...
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
System Clock set. System local time is now Thu Apr 17 09:02:13 JST 2003.
Cleaning up ifupdown...done.
Calculating module dependencies... done.
Loading modules...
All modules loaded.
Checking all file systems...
fsck 1.36 (05-Feb-2005)
fsck.ext3: No such file or directory while trying to open /dev/hda1
/dev/hda1:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
fsck failed. Please repair manually.
CONTROL-D will exit from this shell and continue system startup.
Give root password for maintenance
(or type Control-D to continue):
mappi005:~# exit
exit
Setting kernel variables ...
... done.
Mounting local filesystems...
mount: mount point /proc/bus/usb does not exist
mount: special device /dev/hda1 does not exist
Cleaning /tmp /var/run /var/lock.
/dev/shm/network/...Initializing: /etc/network/ifstate.
Starting hotplug subsystem:
pci
pci [success]
usb
usb [success]
isapnp
isapnp [success]
ide
ide [success]
input
input [success]
pcmcia
pcmcia [success]
pcmcia_socket
pcmcia_socket [success]
scsi
scsi [success]
done.
Configuring network interfaces...done.
Starting portmap daemon: portmap.
Starting portmapper...Mounting remote filesystems...
Setting the System Clock using the Hardware Clock as reference...
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
System Clock set. Local time: Thu Apr 17 09:03:02 JST 2003
Initializing random number generator...done.
Setting up X server socket directory /tmp/.X11-unix...done.
Setting up ICE socket directory /tmp/.ICE-unix...done.
INIT: Entering runlevel: 2
Starting portmap daemon: portmap.
Starting MTA: exim4.
Starting internet superserver: inetd.
Starting OpenBSD Secure Shell server: sshd.
Starting periodic command scheduler: cron.
Debian GNU/Linux 3.1 mappi005 ttyS0
mappi005 login: takata
takata at mappi005:~$
takata at mappi005:~$
takata at mappi005:~$
takata at mappi005:~$ ### remove a CF/Microdrive from a CF slot.
takata at mappi005:~$
takata at mappi005:~$ ### insert a CF/Microdrive again.
takata at mappi005:~$ hda: HMS360404D5CF00, CFA DISK drive
ide0 at 0x1000-0x1007,0x100e on irq 6
hda: max request size: 128KiB
hda: 7999488 sectors (4095 MB) w/128KiB Cache, CHS=7936/16/63
hda: cache flushes supported
hda: hda1
ide-cs: hda: Vcc = 3.3, Vpp = 0.0
takata at mappi005:~$
takata at mappi005:~$
--------
From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Sun, 26 Jun 2005 14:17:06 +0200
> Hi,
>
> A few minutes ago I found out that you indeed pushed a change from
> CONFIG_PCMCIA_STATIC to CONFIG_PCMCIA_NONSTATIC to Linus which is CLEARLY
> INVALID. Please re-read my last message where I propose to track down the
> problematic issue (let's call it a bug, even), instead of doing an invalid
> workaround.
>
> > OK, here's what I think causes the trouble:
> >
> > pccard_static_ops are for bridges where the ioports and iomem windows are
> > statically assigned by the firmwire, by the driver or some other entity
> > during the boot initialization time. Therefore, there must not be any
> > userspace interaction (most notably no /etc/pcmcia/config.opts), but the
> > driver must be able to determine these "windows" itself.
> >
> > pccard_nonstatic_ops means that the PCMCIA bridge is able to select ioports
> > and iomem differently for each card inserted.
> >
> > AFAICS your driver is clearly of the former category -- i.e. the memory and
> > ioports area the device has available is known in advance. The fact that
> > your driver works after "pccardctl insert" is a clear indication that this
> > is the correct approach...
> >
> > > NG ... In STATIC (!CONFIG_NONSTATIC, pccard_static_ops) case,
> > > a CF disk/memory device can *not* be probed automatically now.
> > > But a CF device can be mounted after "pccardctl insert" command
> > > execution, and also a CF device insert event can be handled
> > > correctly.
> >
> > ... so now we have to determine why it doesn't work at boot time. Somewhen
> > during initialization pcmcia_register_socket() is called (can you check
> > _when_ this happens in your case), then pcmcia_parse_events() should lead to
> > socket_detect_change() being called eventually. If a card is present, it
> > should call socket_insert(); which in turn should cause ds_event() with
> > event==CS_EVENT_CARD_INSERTION being called eventually. Can you check
> > whether all this happens as expected for pccard_static_ops? Then we'll also
> > be much closer to finding the cause for this bug.
>
> Dominik
>
Thanks,
--
Hirokazu Takata <takata at linux-m32r.org>
Linux/M32R Project: http://www.linux-m32r.org/
More information about the linux-pcmcia
mailing list