Re: [PATCH] Fix floppy hibernation

From: Andrew Morton
Date: Wed Jun 03 2009 - 02:25:33 EST


On Wed, 3 Jun 2009 08:13:26 +0200 Ondrej Zary <linux@xxxxxxxxxxxxxxxxxxxx> wrote:

> > > +static int floppy_resume(struct platform_device *dev)
> > > +{
> > > + int fdc;
> > > +
> > > + for (fdc = 0; fdc < N_FDC; fdc++)
> > > + if (FDCS->address != -1)
> > > + user_reset_fdc(-1, FD_RESET_ALWAYS, 0);
> > > +
> > > + return 0;
> > > +}
> >
> > The patch changes the driver so that it calls user_reset_fdc() for each
> > device at resume-time.
> >
> > Why? What effect does this have on the hardware and why does it fix
> > things?
>
> I don't know at all, it's complete guesswork. The first thing I tested was
> rmmod floppy && modprobe floppy after resume - it worked. Narrowing the
> initialization code down resulted in this patch.

lol, OK. I added this to the changelog:

This fix resets the floppy controller on resume. It was
experimentally determined to bring the controller back to life - we
don't really know why it works.

floppy_init() does the same thing at boot/modprobe time.

Let's see how it goes... If someone reports breakage then we can
always change the driver so that activation of your new code requires a
module parameter.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/