Re: [PATCH 13/15] ide: fix UDMA/MWDMA/SWDMA masks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Sergei Shtylyov
Date: Tuesday, January 23, 2007 - 7:51 am

Hello.

Alan wrote:



    I.e. MWDMA2 should be working due to the way the driver is written (it 
sets up PIO4 timings when auto-tuning DMA) but not the other modes since 
speedproc() method is brain-damaged in this part.


    Another buglet found by random glancing at this driver:

/**
  *      cmd648_dma_stop -       DMA stop callback
  *      @qc: Command in progress
  *
  *      DMA has completed.
  */

static void cmd648_bmdma_stop(struct ata_queued_cmd *qc)
{
         struct ata_port *ap = qc->ap;
         struct pci_dev *pdev = to_pci_dev(ap->host->dev);
         u8 dma_intr;
         int dma_reg = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0;
         int dma_mask = ap->port_no ? ARTTIM2 : CFR;

         ata_bmdma_stop(qc);

         pci_read_config_byte(pdev, dma_reg, &dma_intr);
         pci_write_config_byte(pdev, dma_reg, dma_intr | dma_mask);
}

    dma_reg and dma_mask initializers must have been swapped since ARTTIM2 and 
CFR are regster names.  So, the code reads/writes semi-random regs...


    Sent what I had on this machine.  Will looks for newer revision of 
PCJ0646U2 spec elsewhere...

MBR, Sergei
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/15] IDE quilt tree updated, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:30 pm)
[PATCH 1/15] ACPI support for IDE devices, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:31 pm)
[PATCH 2/15] via82cxxx/pata_via: correct PCI_DEVICE_ID_VIA ..., Bartlomiej Zolnierki ..., (Thu Jan 18, 5:31 pm)
[PATCH 3/15] it8213: fix build and ->ultra_mask, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:31 pm)
[PATCH 4/15] ide: convert ide_hwif_t.mmio into flag, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:31 pm)
[PATCH 5/15] hpt34x: hpt34x_tune_chipset() (->speedproc) fix, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:31 pm)
[PATCH 6/15] atiixp/jmicron/triflex: fix PIO fallback, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:31 pm)
[PATCH 7/15] piix: cleanup, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:31 pm)
[PATCH 8/15] ide: disable DMA in ->ide_dma_check for "no I ..., Bartlomiej Zolnierki ..., (Thu Jan 18, 5:31 pm)
[PATCH 9/15] sgiioc4: fix sgiioc4_ide_dma_check() to enabl ..., Bartlomiej Zolnierki ..., (Thu Jan 18, 5:32 pm)
[PATCH 10/15] ide: add ide_set_dma() helper, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:32 pm)
[PATCH 11/15] ide: make ide_hwif_t.ide_dma_{host_off,off_q ..., Bartlomiej Zolnierki ..., (Thu Jan 18, 5:32 pm)
[PATCH 12/15] ide: make ide_hwif_t.ide_dma_host_on void, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:32 pm)
[PATCH 13/15] ide: fix UDMA/MWDMA/SWDMA masks, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:32 pm)
[PATCH 14/15] ide: rework the code for selecting the best ..., Bartlomiej Zolnierki ..., (Thu Jan 18, 5:32 pm)
[PATCH 15/15] ide: add ide_tune_dma() helper, Bartlomiej Zolnierki ..., (Thu Jan 18, 5:32 pm)
Re: [PATCH 10/15] ide: add ide_set_dma() helper, Sergei Shtylyov, (Sat Jan 20, 1:22 pm)
Re: [PATCH 12/15] ide: make ide_hwif_t.ide_dma_host_on void, Sergei Shtylyov, (Sat Jan 20, 1:46 pm)
Re: [PATCH 13/15] ide: fix UDMA/MWDMA/SWDMA masks, Sergei Shtylyov, (Mon Jan 22, 9:19 am)
Re: [PATCH 13/15] ide: fix UDMA/MWDMA/SWDMA masks, Sergei Shtylyov, (Mon Jan 22, 11:17 am)
Re: [PATCH 13/15] ide: fix UDMA/MWDMA/SWDMA masks, Sergei Shtylyov, (Mon Jan 22, 1:28 pm)
Re: [PATCH 13/15] ide: fix UDMA/MWDMA/SWDMA masks, Jeff Garzik, (Mon Jan 22, 3:39 pm)
Re: [PATCH 13/15] ide: fix UDMA/MWDMA/SWDMA masks, Sergei Shtylyov, (Tue Jan 23, 7:51 am)
Re: [PATCH 13/15] ide: fix UDMA/MWDMA/SWDMA masks, Sergei Shtylyov, (Thu Jan 25, 8:40 am)
Re: [PATCH 13/15] ide: fix UDMA/MWDMA/SWDMA masks, Sergei Shtylyov, (Wed Jan 31, 1:38 pm)
Re: [PATCH 12/15] ide: make ide_hwif_t.ide_dma_host_on void, Sergei Shtylyov, (Mon Mar 26, 10:19 am)
Re: [PATCH 12/15] ide: make ide_hwif_t.ide_dma_host_on void, Sergei Shtylyov, (Fri Apr 20, 1:36 pm)