From: Pavel Machek <pavel@ucw.cz>
To: Rodolfo Giometti <giometti@enneenne.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PCMCIA insert on resume
Date: Sat, 27 Oct 2007 07:45:56 +0000 [thread overview]
Message-ID: <20071027074556.GC6043@ucw.cz> (raw)
In-Reply-To: <20071024143444.GF9748@enneenne.com>
Hi!
> 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.
Seems okay to me, but I do not know much about pcmcia. Add
signed-off-by, changelog at the beggining, cc me, rafael and akpm... ?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2007-10-28 18:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-24 14:34 PCMCIA insert on resume Rodolfo Giometti
2007-10-27 7:45 ` Pavel Machek [this message]
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=20071027074556.GC6043@ucw.cz \
--to=pavel@ucw.cz \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox