floppy.c - workaround for FDC initialization error

From: Hans-Juergen Tappe (hjt_at_sysgo.com)
Date: 07/16/04

  • Next message: Jesse Barnes: "Re: [PATCH] reduce inter-node balancing frequency"
    Date:	Fri, 16 Jul 2004 16:40:59 +0200
    To: linux-kernel@vger.kernel.org
    
    

    Hi!

    I worked on a problem with linux-2.6.7 and linux-2.4.25 not detecting
    the floppy controller:
    When compiled into the kernel, the kernel said: "no floppy controllers
    found", even though linux had been loaded from floppy via BIOS access.
    When loaded as a module, everything worked fine.
    This sounded very much like the bug at
    http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57253 ,
    http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=60887 and
    http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=75687 , but this
    problem occurs again on the new hardware.

    It seems that the interrupt mask had not been set, so the answering
    interrupt never reaches the system and the driver initialization times out.

    The controller is part of a Winbond W83627HF SuperIO, connected via LPC
    and Intel ICH4 to a Pentium mobile Processor system.

    The workaround was to insert a udelay() for the controller to settle
    from it's first reset, if compiled as a module and only on the
    initializing reset, if the version is still FDC_NONE.

    For other tests, I moved around the code in the process of linking and
    with my own entry point within main.c. I wanted to figure out, whether
    any dependency on other modules or processes before init() would become
    visible. This did not help, as did inserting waiting code as found in
    fdc_dtr, where similar circumstances have been documented.

    Some questions to this mailing list:
    - Does anyone have an idea of what the winbond controller is waiting
       for?
    - Is this an appropriate workaround or patch?
    - Is this the right place to wait or should I wait within floppy_init()
       somewhere before user_reset_fdc(-1,FD_RESET_ALWAYS,0)?
    - Is this the right way of waiting 2200 usec?
    - Are there any other experiences with the Winbond W83627HF SuperIO
       regarding floppy functionality?

    Regards,
    Hans-Jürgen Tappe

    --- linux/drivers/block/floppy.c_orig 2004-06-16 07:18:59 +0200
    +++ linux/drivers/block/floppy.c 2004-07-16 15:51:53 +0200
    @@ -4458,6 +4458,12 @@
                     if (FDCS->address != -1) {
                             reset_fdc_info(1);
                             fd_outb(FDCS->dor, FD_DOR);
    +#ifndef MODULE
    + /* only before initialization */
    + if (FDCS->version == FDC_NONE)
    + /* Wait for the FDC to be ready */
    + udelay(2200);
    +#endif
                     }
             }
             fdc = 0;

    -- 
    Hans-Jürgen Tappe
    SYSGO AG
    Am Pfaffenstein 14
    55270 Klein-Winternheim
    Phone: +49-61 36-99 48-0
    Fax:   +49-61 36-99 48-10
    hjtappe@sysgo.com
    www.sysgo.com
    www.elinos.com
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Jesse Barnes: "Re: [PATCH] reduce inter-node balancing frequency"

    Relevant Pages

    • Re: ahc driver now borked in -current?
      ... of those pesky 3.5" floppy drives, ... > controller (one of the older ASUS motherboards we all used to covet when they ... Using a kernel compiled ... > said, with the non-functioning kernel, we don't get any further than waiting ...
      (freebsd-current)
    • Re: 6502
      ... g. Powered down and connected 8 inch floppy to the floppy controller. ... Powered up, inserted boot diskette in drive, and executed monitor command to boot --> head load but time out after a few seconds, i.e., no boot. ... Problem was my bad memory - I forgot that both Z80 & 6502 boot initializes the Xebec host adapter and hard disk controller & the hard drive. ...
      (comp.os.cpm)
    • Re: Needed.....Boot disk for Kayro 2x
      ... All Kaypro's have MFM Floppy Disks used, and so all PC Floppy controller are able to write this too. ... All floppy controllers with WD chips should be able to write single density coded floppies, but PC compatibles don't have this controller by default. ...
      (comp.os.cpm)
    • PROBLEM: HT1000 drops network packets during disk writes
      ... HT1000 drops network packets during disk writes ... _any_ disk writes are done on onboard SATA controller at the ... All tested kernel versions are affected. ...
      (Linux-Kernel)
    • KERNEL OOPS: Unable to handle kernel paging request at virtual address 6c000000
      ... Unable to handle kernel paging request at virtual address 6c000000 ... 00:01.0 PCI bridge: Silicon Integrated Systems: Unknown device 0003 ... Subsystem: Micro-Star International Co., Ltd.: Unknown device 7060 ... 00:03.0 USB Controller: Silicon Integrated Systems USB 1.0 Controller ...
      (Linux-Kernel)