All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: linux-kernel@vger.kernel.org
Subject: PCMCIA insert on resume
Date: Wed, 24 Oct 2007 16:34:45 +0200	[thread overview]
Message-ID: <20071024143444.GF9748@enneenne.com> (raw)

Hello,

I don't understand why, on resume, the function socket_resume() (in
drivers/pcmcia/cs.c) do:

       if (!(skt->state & SOCKET_PRESENT)) {
               skt->state &= ~SOCKET_SUSPEND;
               return socket_insert(skt);
       }

This cause a powered off socket before suspend to be powered on during
resume.

To avoid such (erroneous?) behaviour I propose this patch:

diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 729e37d..d69de74 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -562,10 +562,8 @@ static int socket_resume(struct pcmcia_socket *skt)
        skt->ops->init(skt);
        skt->ops->set_socket(skt, &skt->socket);
 
-       if (!(skt->state & SOCKET_PRESENT)) {
-               skt->state &= ~SOCKET_SUSPEND;
-               return socket_insert(skt);
-       }
+       if (!(skt->state & SOCKET_PRESENT))
+               goto resume_exit;
 
        ret = socket_setup(skt, SS_COMA, resume_delay);
        if (ret == CS_SUCCESS) {
@@ -599,6 +597,7 @@ static int socket_resume(struct pcmcia_socket *skt)
                socket_shutdown(skt);
        }
 
+resume_exit:
        skt->state &= ~SOCKET_SUSPEND;
 
        return CS_SUCCESS;

With this patch if the socket was powered down before the suspend, at
resume time it's not powered on and you need a "pccardctl insert" to
activate the socket.

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

             reply	other threads:[~2007-10-24 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24 14:34 Rodolfo Giometti [this message]
2007-10-27  7:45 ` PCMCIA insert on resume Pavel Machek
2007-10-28 18:55   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071024143444.GF9748@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.