Re: patch: fix 30 second hang while resuming

From: Nate Lawson (nate_at_root.org)
Date: 02/28/05

  • Next message: Godwin Stewart: "Re: nice: Badly formed number"
    Date: Sun, 27 Feb 2005 15:12:23 -0800
    To: current@freebsd.org
    
    
    

    Nate Lawson wrote:
    > My system hangs a long time in ata_generic_reset() while resuming. I
    > did some hunting and found that the loop was running for the full 310 *
    > 100 ms (31 seconds). The bug is that the loop never exits when mask
    > goes to 0 even though this is a termination condition (see end of the
    > loop where the code masks off 1 and 2).
    >
    > The attached patch fixes this by exiting when the mask is set to 0
    > instead of looping the full 31 seconds. This is correct since setting
    > the mask to 0 is how the loop marks master/slave "done". It also has a
    > minor whitespace fix.

    Apologies, the last patch was not quite right. You need to check that
    both status values are not "busy" as well as the mask. This check could
    be merged in elsewhere as well. This was just a convenient place to put it.

    Please use the attached patch instead.

    -- 
    Nate
    
    

    Index: sys/dev/ata/ata-lowlevel.c
    ===================================================================
    RCS file: /home/ncvs/src/sys/dev/ata/ata-lowlevel.c,v
    retrieving revision 1.51
    diff -u -r1.51 ata-lowlevel.c
    --- sys/dev/ata/ata-lowlevel.c 24 Dec 2004 13:38:25 -0000 1.51
    +++ sys/dev/ata/ata-lowlevel.c 27 Feb 2005 23:09:17 -0000
    @@ -619,8 +619,11 @@
                     (stat1 == err && lsb == err && msb == err && timeout > 5))
                     mask &= ~0x02;
             }
    + if (mask == 0 && !(stat0 & ATA_S_BUSY) && !(stat1 & ATA_S_BUSY))
    + break;
    +
             ata_udelay(100000);
    - }
    + }
     
         if (bootverbose)
             ata_printf(ch, -1,

    
    

    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


  • Next message: Godwin Stewart: "Re: nice: Badly formed number"

    Relevant Pages

    • [PATCH] new /proc/irq cpumask format; consolidate cpumask display and input code
      ... This patch is a followup to one from Bill Irwin. ... The core routines work for any multi-word bitmask, ... My real motivation for consolidating this code will become ... A mask with just bit 127 set displays as "80000000,0,0,0". ...
      (Linux-Kernel)
    • Re: seperator error in __mask_snprintf_len
      ... cpumasks for 64 bit big endian architectures. ... The comments in the patch explain the details. ... * and a length, describing the mask contents. ... * as an array of unsigned ints, except on 64 bit big endian ...
      (Linux-Kernel)
    • Re: v2.6.19-rt6, yum/rpm
      ... Seeing that GENERIC_TIME has been thrown out from the -rt patch, ... .mask = xics_mask_irq, ... .unmask = xics_unmask_irq, ... .eoi = xics_eoi_direct, ...
      (Linux-Kernel)
    • Re: [PATCH] another minor bit of cpumask cleanup
      ... Makes sense to me that the hotplug CPU work would be in the drivers seat ... I like your patch. ... didn't you (Rusty) used to be the Trivial ... The basic goal of this patch-to-be will be to provide a solid 'mask' ...
      (Linux-Kernel)
    • Re: seperator error in __mask_snprintf_len
      ... Then, later, Joe sugguested a patch rewriting the lib/mask.c display ... Joe - question - is there any good reason not to use Paul M's ... I have a patch about ready (as soon as I can get time on my big system ... * A mask with just bit 127 set displays as "80000000,0,0,0". ...
      (Linux-Kernel)