mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@it.uu.se>
To: 7eggert@gmx.de, akpm@osdl.org, linux-kernel@vger.kernel.org,
	mikpe@it.uu.se, mingo@elte.hu
Subject: Re: [patch] floppy: suspend/resume fix
Date: Sun, 12 Nov 2006 23:40:28 +0100 (MET)	[thread overview]
Message-ID: <200611122240.kACMeS7l005120@harpo.it.uu.se> (raw)

On Sun, 12 Nov 2006 22:44:28 +0100, Bodo Eggert wrote:
> > 1. You suspend and then resume, leaving the disk in the floppy drive.
> > 
> > 2. You suspend, remove the floppy disk, insert a totally different disk
> >    in the same drive, and then resume.
> > 
> > What should you do?  (Hint: without reading the disk and comparing it
> > with what you have cached you don't know if the disk has been changed
> > or not.)
> > 
> > If you argue that in case (1) you should continue to allow IO, then
> > you potentially end up scribbling over a disk when someone does (2).
> > 
> > So I'd argue that the behaviour being seen by Mikael is the _safest_
> > behaviour, and the most correct behaviour given the limitations of
> > the hardware.
> 
> - If a user suspends with a floppy in the drive, it will mostly be an error,
>   and he'll unsuspend in order to correct it.
> - If it is no error, putting a different/modified floppy into the drive
>   before resume is unlikely
> - Even if somebody does this, you can mostly detect the different disk
>   by comparing the first sector or just the FAT "serial number".
> 
> Therefore you can implement a relatively safe resume that will mostly DTRT
> but destroy data in some unlikely cases, while doing the "safe thing" would
> mostly cause a harmless (unless not noticed) kind of data loss and sometimes
> safe you from real data loss.

The bug occurs regardless of whether I leave the floppy disc in the drive
during suspend or not. 2.6.19-rc5 (vanilla and with Ingo's suspend/resume
hooks) fails the following use case as well:

1. boot
2. insert floppy disc
3. tar tvf /dev/fd0 (works)
4. manually eject floppy disc
5. suspend, later resume 
6. insert floppy disc
7. tar tvf /dev/fd0 (fails with I/O errors)
8. tar tvf /dev/fd0 (works)

Like Ingo said, something happens to the HW during suspend and we
need to figure out how to reinitialise the HW and the driver so that
things work immediately after resume.

/Mikael

             reply	other threads:[~2006-11-12 22:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-12 22:40 Mikael Pettersson [this message]
2006-11-12 23:58 ` Russell King
2006-11-15 18:53   ` Ingo Molnar
     [not found] <7grMO-2YO-55@gated-at.bofh.it>
     [not found] ` <7gs69-46A-37@gated-at.bofh.it>
     [not found]   ` <7gtvd-7xg-23@gated-at.bofh.it>
2006-11-12 21:44     ` Bodo Eggert
2006-11-14 11:05       ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2006-11-12 20:47 Mikael Pettersson
2006-11-12 21:29 ` Russell King
2006-11-12 22:03   ` Ingo Molnar
2006-11-12 23:54     ` Russell King
2006-11-14 11:09       ` Pavel Machek
2006-11-14 16:34         ` Lee Revell
2006-11-15 20:24           ` Pavel Machek
2006-11-15 20:34             ` Lee Revell
2006-11-15 20:49             ` Alan
2006-11-15 20:49               ` Pavel Machek
2006-11-15 21:03                 ` Rafael J. Wysocki
2006-11-15 21:14                 ` Arjan van de Ven
2006-11-16 12:38                 ` Russell King
2006-11-15 18:46         ` Ingo Molnar
2006-11-12 17:53 Mikael Pettersson
2006-11-12 18:09 ` Ingo Molnar
2006-11-12 19:30   ` Andrew Morton
2006-11-12 20:35     ` Arjan van de Ven
2006-11-12 19:40   ` Russell King
2006-11-11 20:48 [BUG] floppy: broken after resume due to 2.6.18-rc1 lockdep changes Mikael Pettersson
2006-11-12 15:47 ` [patch] floppy: suspend/resume fix Ingo Molnar

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=200611122240.kACMeS7l005120@harpo.it.uu.se \
    --to=mikpe@it.uu.se \
    --cc=7eggert@gmx.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®