Problem with card services on Sony PCG-C1MHP and kernel2.6(more details)

Patrick Brunner astaroth at nethaus.ch
Wed Apr 14 00:24:49 BST 2004


Russell King wrote:

>On Tue, Apr 13, 2004 at 11:01:51PM +0200, Patrick Brunner wrote:
>  
>
>>Dominik Brodowski wrote:
>>
>>    
>>
>>>AFAICS, the Yenta socket driver does not properly start up. Can you try
>>>"modprobe yenta_socket"
>>>and then execute
>>>"cardmgr"
>>>or the appropriate pcmcia init-script?
>>>
>>>	Dominik
>>>
>>>
>>> 
>>>
>>>      
>>>
>>Executing
>>
>>modprobe yenta_socket
>>cardmgr
>>
>>works great; that solved the problem! I'd like to thank you and Russell very much for your assistance and the quick response. Finally, I can switch to 2.6... :-)
>>    
>>
>
>However, you're going to have to type those each time until we work out
>why your pcmcia init script isn't working.  However, really its an
>issue for Mandrake to resolve before they ship a distro based on a
>2.6 kernel.
>
>  
>
In fact, it seems to be a common problem for several distributions at 
the moment. I've tried Fedore Core 2 test 2, Mandrake 10 Community 
Edition, and Knoppix 3.4 c't Edition (Debian-based). And I had the same 
problem with all of them. I'll just try out the lines above with Knoppix....

By the way, here's the /etc/init.d/pcmcia script from Mandrake 10 CE:

#!/bin/sh

# rc.pcmcia 1.45 2002/08/08 06:43:43 (David Hinds)
#
# This is designed to work in BSD as well as SysV init setups.  See
# the HOWTO for customization instructions.

# Tags for Red Hat init configuration tools
#
# chkconfig: 2345 04 96
# processname: cardmgr
# pidfile: /var/run/cardmgr.pid
# config: /etc/pcmcia/config
# config: /etc/pcmcia/config.opts
# description: PCMCIA support is usually to support things like ethernet \
#              and modems in laptops.  It won't get started unless \
#              configured so it is safe to have it installed on machines \
#              that don't need it.

# Exit if pcmcia-cs is not installed
test -x /sbin/cardmgr || exit 0

# Save option values passed in through the environment
for N in PCMCIA PCIC PCIC_OPTS CORE_OPTS CARDMGR_OPTS SCHEME ; do
    V=`eval echo '$'$N` ; if [ "$V" ] ; then eval ENV_$N=\"$V\" ; fi
done

# Source PCMCIA configuration, if available
if [ -f /etc/pcmcia.conf ] ; then
    # Debian startup option file
    . /etc/pcmcia.conf
elif [ -f /etc/sysconfig/pcmcia ] ; then
    # Red Hat startup option file
    . /etc/sysconfig/pcmcia
else
    # Slackware startup options go right here:
    # Should be either i82365 or tcic
    PCIC=i82365
    # Put socket driver timing parameters here
    PCIC_OPTS=
    # Put pcmcia_core options here
    CORE_OPTS=
    # Put cardmgr options here
    CARDMGR_OPTS=
    # To set the PCMCIA scheme at startup...
    SCHEME=
fi
for N in PCMCIA PCIC PCIC_OPTS CORE_OPTS CARDMGR_OPTS SCHEME ; do
    V=`eval echo '$'ENV_$N` ; if [ "$V" ] ; then eval $N=\"$V\" ; fi
done
if [ "$PCMCIA" -a "$PCMCIA" != "yes" ] ; then exit 0 ; fi

usage()
{
    echo "Usage: $0 {start|stop|status|restart|reload}"
}

cleanup()
{
    while read SN CLASS MOD INST DEV EXTRA ; do
	if [ "$SN" != "Socket" ] ; then
	    /etc/pcmcia/$CLASS stop $DEV 2> /dev/null
	fi
    done
}

EXITCODE=1
for x in "1" ; do

    if [ "$PCIC" = "" ] ; then
	echo "PCIC module not defined in startup options!"
	break
    fi

    if [ $# -lt 1 ] ; then usage ; break ; fi
    action=$1

    case "$action" in

    start)
	echo -n "Starting PCMCIA services: "

	if [ -d /var/lib/pcmcia ] ; then
	    SC=/var/lib/pcmcia/scheme
	    RUN=/var/lib/pcmcia
	else
	    SC=/var/run/pcmcia-scheme
	    RUN=/var/run
	fi
	if [ -L $SC -o ! -O $SC ] ; then rm -f $SC ; fi
	if [ ! -f $SC ] ; then umask 022 ; touch $SC ; fi
	if [ "$SCHEME" ] ; then umask 022 ; echo $SCHEME > $SC ; fi
	    
	if ! grep -q pcmcia /proc/devices ; then
	    if [ -d /lib/modules/preferred ] ; then
		PC=/lib/modules/preferred/pcmcia
	    else
		PC=/lib/modules/`uname -r`/pcmcia
	    fi
	    KD=/lib/modules/`uname -r`/kernel/drivers/pcmcia
	    if [ -x /sbin/modprobe ] ; then
		/sbin/modprobe pcmcia_core $CORE_OPTS || break
		/sbin/modprobe $PCIC $PCIC_OPTS >/dev/null 2>&1 ||
		  (/sbin/modprobe yenta_socket >/dev/null 2>&1 &&
		   echo "using yenta_socket instead of $PCIC") ||
		  /sbin/modprobe $PCIC $PCIC_OPTS || break
		/sbin/modprobe ds || break
	    elif [ -d $PC ] ; then
		/sbin/insmod $PC/pcmcia_core.o $CORE_OPTS
		/sbin/insmod $PC/$PCIC.o $PCIC_OPTS
		/sbin/insmod $PC/ds.o
	    else
		echo "module directory $PC not found."
		break
	    fi
	fi

	if [ -s /var/run/cardmgr.pid ] && \
	    kill -0 `cat /var/run/cardmgr.pid` 2>/dev/null ; then
	    echo "cardmgr is already running."
	else
	    if [ -r $RUN/stab ] ; then
		cat $RUN/stab | cleanup
	    fi
	    /sbin/cardmgr $CARDMGR_OPTS
	fi

	echo "done."
	touch /var/lock/subsys/pcmcia 2>/dev/null
	EXITCODE=0
	;;

    stop)
	echo -n "Shutting down PCMCIA services: "
	if [ -s /var/run/cardmgr.pid ] ; then
	    PID=`cat /var/run/cardmgr.pid`
	    kill $PID
	    # Give cardmgr a few seconds to handle the signal
	    for N in 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 ; do
		kill -0 $PID 2>/dev/null || break
		sleep 2
	    done
	fi
	killall -q "CardBus Watcher"
	if grep -q "ds  " /proc/modules ; then
	    /sbin/rmmod ds
	    /sbin/rmmod $PCIC 2>/dev/null || \
		/sbin/rmmod yenta_socket 2>/dev/null
	    /sbin/rmmod pcmcia_core
	fi
	echo "done."
	rm -f /var/lock/subsys/pcmcia
	EXITCODE=0
	;;

    status)
	pid=`/sbin/pidof cardmgr`
	if [ "$pid" != "" ] ; then
	    echo "cardmgr (pid $pid) is running..."
	    EXITCODE=0
	else
	    echo "cardmgr is stopped"
	    EXITCODE=3
	fi
	;;

    restart|reload)
	$0 stop
	$0 start
	EXITCODE=$?
	;;

    *)
	usage
	;;

    esac

done

# Only exit if we're in our own subshell
case $0 in *rc.pcmcia) exit $EXITCODE ;; esac







More information about the linux-pcmcia mailing list