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:	Mon, 1 Jun 2009 16:45:20 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Ondrej Zary <linux@...nbow-software.org>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu,
	"Rafael J. Wysocki" <rjw@...k.pl>
Subject: Re: [PATCH] Fix floppy hibernation

On Sat, 30 May 2009 18:04:25 +0200
Ondrej Zary <linux@...nbow-software.org> wrote:

> Hello,
> floppy driver was always missing hibernation support. After resume, floppy did
> not work (until a couple of disk reinserts and retries), producing errors like
> this:
> end_request: I/O error, dev fd0, sector 0
> 
> Ingo Molnar tried to fix it in 2006: http://lkml.org/lkml/2006/11/12/92
> 
> 
> 
> 
> Based on Ingo Molnar's patch from 2006, this makes the floppy work after
> resume from hibernation, at least on my machine.
> 
> 
> Signed-off-by: Ondrej Zary <linux@...nbow-software.org>
> 
> --- linux-2.6.29.4-orig/drivers/block/floppy.c	2009-05-30 14:38:29.000000000 +0200
> +++ linux/drivers/block/floppy.c	2009-05-30 17:50:32.000000000 +0200
> @@ -4148,6 +4148,24 @@
>  {
>  }
>  
> +static int floppy_resume(struct platform_device *dev)
> +{
> +	int i;
> +
> +	for (i = 0; i < N_FDC; i++)
> +		if (FDCS->address != -1)
> +			user_reset_fdc(-1, FD_RESET_ALWAYS, 0);
> +
> +	return 0;
> +}

hm, how does this work?

FDCS is a revolting should-not-exist macro which assumes the presence
of a local variable called `fdc'.

So I think the loop control variable here should be called `fdc', not `i'.

It's pretty amazing that something like this still exists in a core
driver.  Someone please save us!

--
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