lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 27 Oct 2007 07:45:56 +0000
From:	Pavel Machek <pavel@....cz>
To:	Rodolfo Giometti <giometti@...eenne.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: PCMCIA insert on resume

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ