Re: ATA regression [PATCH]

From: Nicolai Schlenzig (ns_at_got2get.net)
Date: 12/28/04

  • Next message: Matthias Andree: "Re: ATA regression [PATCH]"
    To: Søren Schmidt <sos@DeepCore.dk>, "Ruslan Ermilov" <ru@freebsd.org>
    Date: Tue, 28 Dec 2004 15:16:20 +0100
    
    

    Is there any way for me to compile just this little part of world and install it (after applying that patch)?

    Doing "make buildworld" for CURRENT takes 8+ hours on my system... but this is exactly what I'm looking for. My Promise
    SATA TX2IIplus 150 gives "ATA_IDENTIFY" timeouts for anything I attach.

    I'd sure like to give it a try - but if you guys find a new and better patch within, say, 4 hours - I have to sit tight
    for 4 more only to restart my compile ;)

    Thanks in advance.

    // Nicolai

    ----- Original Message -----
    From: "Søren Schmidt" <sos@DeepCore.dk>
    To: "Ruslan Ermilov" <ru@freebsd.org>
    Cc: <current@freebsd.org>; "Soren Schmidt" <sos@freebsd.org>
    Sent: Tuesday, December 28, 2004 1:49 PM
    Subject: Re: ATA regression [PATCH]

    Ruslan Ermilov wrote:

    > So I analyzed what was changed in this ata-chipset.c revision
    > when it comes to my chip, and tried the following patch, and
    > it brought me back my ad8 drive:

    Hmm, there are grimlins in there alright. Could you try the attached
    patch as thats what I have in my WIP and it cleans up the code a bit as
    well..

    -- 
    -Søren
    --------------------------------------------------------------------------------
    Index: ata-chipset.c
    ===================================================================
    RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v
    retrieving revision 1.97
    diff -u -r1.97 ata-chipset.c
    --- ata-chipset.c 24 Dec 2004 13:36:04 -0000 1.97
    +++ ata-chipset.c 28 Dec 2004 12:47:10 -0000
    @@ -1367,6 +1367,11 @@
      return ENXIO;
         }
    +    if (ctlr->chip->max_dma >= ATA_SA150)
    + ctlr->setmode = ata_sata_setmode;
    +    else
    + ctlr->setmode = ata_promise_setmode;
    +
         switch  (ctlr->chip->cfg1) {
         case PRNEW:
      /* setup clocks */
    @@ -1413,22 +1418,33 @@
      ctlr->dmainit = ata_promise_mio_dmainit;
      ctlr->allocate = ata_promise_mio_allocate;
    - if (ctlr->chip->cfg2 & PRPATA) {
    -     ctlr->channels = ((ATA_INL(ctlr->r_res2, 0x48) & 0x01) > 0) +
    -      ((ATA_INL(ctlr->r_res2, 0x48) & 0x02) > 0) + 2;
    - }
    - else if (ctlr->chip->cfg2 & PRCMBO) {
    -     ATA_OUTL(ctlr->r_res2, 0x06c, 0x000000ff);
    -     ctlr->channels = ((ATA_INL(ctlr->r_res2, 0x48) & 0x02) > 0) + 3;
    - }
    - else if (ctlr->chip->cfg2 & PRCMBO2) {
    -     ATA_OUTL(ctlr->r_res2, 0x060, 0x000000ff);
    -     ctlr->channels = 3;
    - }
    - else
    -     ctlr->channels = 4;
    + switch (ctlr->chip->cfg2) {
    + case PRPATA:
    +            ctlr->channels = ((ATA_INL(ctlr->r_res2, 0x48) & 0x01) > 0) +
    +                             ((ATA_INL(ctlr->r_res2, 0x48) & 0x02) > 0) + 2;
    +     break;
    - if (ctlr->chip->cfg2 & PRSX4X) {
    + case PRCMBO:
    +            ATA_OUTL(ctlr->r_res2, 0x06c, 0x000000ff);
    +            ctlr->channels = ((ATA_INL(ctlr->r_res2, 0x48) & 0x02) > 0) + 3;
    +     break;
    +
    + case PRSATA:
    +            ATA_OUTL(ctlr->r_res2, 0x06c, 0x000000ff);
    +            ctlr->channels = 4;
    +     break;
    +
    + case PRCMBO2:
    +            ATA_OUTL(ctlr->r_res2, 0x060, 0x000000ff);
    +            ctlr->channels = 3;
    +     break;
    +
    + case PRSATA2:
    +            ATA_OUTL(ctlr->r_res2, 0x060, 0x000000ff);
    +            ctlr->channels = 4;
    +     break;
    +
    + case PRSX4X: {
          struct ata_promise_sx4 *hpkt;
          u_int32_t dimm = ATA_INL(ctlr->r_res2, 0x000c0080);
    @@ -1448,26 +1464,25 @@
          mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF);
          hpkt->busy = hpkt->head = hpkt->tail = 0;
    +            ctlr->channels = 4;
    +
          if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS,
      ata_promise_sx4_intr, ctlr, &ctlr->handle))) {
      device_printf(dev, "unable to setup interrupt\n");
      return ENXIO;
          }
    - }
    - else {
    -     if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS,
    - ata_promise_mio_intr, ctlr, &ctlr->handle))) {
    - device_printf(dev, "unable to setup interrupt\n");
    - return ENXIO;
    +     return 0;
          }
      }
    - break;
    +
    + if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS,
    +     ata_promise_mio_intr, ctlr, &ctlr->handle))) {
    +     device_printf(dev, "unable to setup interrupt\n");
    +     return ENXIO;
    + }
    + return 0;
         }
    -    if (ctlr->chip->max_dma >= ATA_SA150)
    - ctlr->setmode = ata_sata_setmode;
    -    else
    - ctlr->setmode = ata_promise_setmode;
    -    return 0;
    +    return ENXIO;
     }
     static int
    --------------------------------------------------------------------------------
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Matthias Andree: "Re: ATA regression [PATCH]"

    Relevant Pages

    • RE: Can someone please help I have been stuck for days.
      ... I am 100% positive I am now running FC3. ... I followed your instructions by downloading ... the patch and the instructions for installing it. ... go into that file and chmod +x compile and run it. ...
      (Fedora)
    • Re: 2.6.25.X-rtX compile errors on ARM due to cmpxchg() problems.
      ... A while ago I already mentioned that 2.6.25 did not compile on ARM. ... Looking at the generic implementation I believe that this code should ... Revert the patch named arm-cmpxchg.patch in the preempt-rt patchset ...
      (Linux-Kernel)
    • Re: [REGRESSION] Recent change to kernel spikes out ccache/distcc
      ... How about this simple patch. ... It does cause ccache to be functional again, ... least as far as causing the "cache hit" stats to get bumped. ... how ccache misleadingly categorizes "cc -S" requests to compile to ...
      (Linux-Kernel)
    • Re: modules, "modules" and CONFIG_LIST_SORT
      ... if kernel was compiled without that tiny amount of core kernel. ... And changing the config later and trying to compile and install a module ... So I guess we should just revert that commit. ... ago and now Christoph Hellwig has asked me to send the patch directly to Linus, ...
      (Linux-Kernel)
    • Re: [git pull] PCI pull request for 2.6.27
      ... I'm open to suggestions here about a couple of caveats with this pull: ... That said, when I inevitably fail, just humor me, and send me a patch to ... that it didn't even compile wasn't really my fault. ... think I put it in the right place, somebody needs to double-check it. ...
      (Linux-Kernel)