mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Ingo Molnar <mingo@elte.hu>
Cc: Mikael Pettersson <mikpe@it.uu.se>,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] floppy: suspend/resume fix
Date: Sun, 12 Nov 2006 23:54:10 +0000	[thread overview]
Message-ID: <20061112235410.GB31624@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20061112220318.GA3387@elte.hu>

On Sun, Nov 12, 2006 at 11:03:18PM +0100, Ingo Molnar wrote:
> 
> * Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> 
> > In which case isn't the real regression that it does IO?
> > 
> > Nevertheless, I give you two options:
> > 
> > 1. Abort all IO do inserted floppy disk after resume.
> > 2. Corrupt replaced floppy disk after resume.
> > 
> > You have to pick one and exactly one.  Which is inherently less risky 
> > to the end user?
> 
> this isnt about in-flight IO (suspend doesnt succeed if IO is in flight 
> anyway).

I wasn't talking about in-flight IO.  Take a moment to think about it.

- You have a floppy inserted and mounted.
- You write a file to it, and then suspend the machine.
  *** No IO was in progress when the suspend occurred.
- You remove the floppy disk and insert a different disk
- You resume
- The kernel submits the dirty buffers for writing out to the disk.

That would lead to a corrupted floppy disk.

> The bug is this:
> 
>   1) you use the floppy and then stop using it
>   2) 1 hour passes. Nothing uses the floppy.
>   3) you suspend and later resume
>   4) another hour passes. Nothing uses the floppy.
>   5) you try to use the floppy: you get a bunch of IO errors!
>   6) you try to use the floppy again: this time it works
> 
> that's the regression. For some reason suspend/resume puts the floppy 
> hardware into a state that confuses the floppy driver.
> 
> my patch adds all the right suspend/resume hooks for this, without 
> reintroducing the bug that was noticed by lockdep and which was fixed by 
> my patch that introduced this regression - we just have to figure out 
> what to do upon resume to get the floppy driver and the hardware match 
> up each other, without passing spurious IO errors to the user.

You need to step the head off track 0 and back again.  That clears the
disk changed status on the floppy drive hardware.

Now, if you'd actually taken the time to read my messages you'd have
realised that the floppy drive hardware defaults to reporting a
"disk changed" status after power on.  Ergo, after resume, it says
"disk changed" as well.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

  reply	other threads:[~2006-11-12 23:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2006-11-12 22:40 Mikael Pettersson
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
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=20061112235410.GB31624@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --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®