Re: ATA-Controller aussuchen

From: Bernd Walter <ticso(at)cicely12.cicely.de>
Date: Fri, 27 Apr 2007 17:36:25 +0200

On Fri, Apr 27, 2007 at 04:24:58PM +0200, Marc Santhoff wrote:
> Am Freitag, den 27.04.2007, 15:03 +0200 schrieb Bernd Walter:
> > On Fri, Apr 27, 2007 at 12:56:15PM +0200, Oliver Fromme wrote:
> > > Marc Santhoff wrote:
> > > > Bei mir umgekehrt, eine PATA-Platte im Wechselrahmen am SATA-Port. Damit
> > > > bekomme ich recht häufig (nicht immer!) Timeout-Meldungen beim
> > > > Schreiben.
> > >
> > > Solche Adapter sind mit Vorsicht zu genießen, da man
> > > i.allg. keinen Einfluss auf ihre Betriebsparameter hat.
> >
> > Ich bin auch ziemlich skeptisch, ob die Teile überhaupt ausreichend
> > dimensioniert sind, um dahinter noch einen Wechselrahmen zu treiben.
> >
> > > Wenn Du ein ganz ähnliches Problem hast -- was ich für
> > > durchaus wahrscheinlich halte --, kannst Du leider nichts
> > > ausrichten, da atacontrol nur den SATA-Link zum Adapter
> > > sieht. Dass daran eine PATA-Platte hängt, die irgend-
> > > einen UDMA-Modus fährt, kann atacontrol nicht wissen.
> >
> > Sollte man meinen, aber:
> > atapci1: <SiI 3114 SATA150 controller> port 0xeff0-0xeff7,0xefe4-0xefe7,0xefa8-0xefaf,0xefe0-0xefe3,0xef60-0xef6f mem 0xffafcc00-0xffafcfff irq 7 at device 15.0 on pci0
> > atapci1: [ITHREAD]
> > ata2: <ATA channel 0> on atapci1
> > ata2: [ITHREAD]
> > ata3: <ATA channel 1> on atapci1
> > ata3: [ITHREAD]
> > ata4: <ATA channel 2> on atapci1
> > ata4: [ITHREAD]
> > ata5: <ATA channel 3> on atapci1
> > ata5: [ITHREAD]
> > ad4: 98166MB <IC35L100AVVA07 0 VA5OA52A> at ata2-master UDMA100
> > ad6: 98166MB <IC35L100AVVA07 0 VA5OA52A> at ata3-master UDMA100
> >
> > [241]cicely14# atacontrol mode ad4
> > current mode = UDMA100
> Sieht bei mir ähnlich aus, aber atacontrol sieht den Controller und der
> "spricht" mit dem Adapter und nicht direkt mit der Platte, meinte Olli.
> Das würde bedeuten, das die Kommandos zum umschalten von Cache oder
> DMA-Modus nicht durch den Adapter zur Platte weitergereicht werden.

Weder noch - es ist ein Workaround im Treiber:
static void
ata_sata_setmode(device_t dev, int mode)
{
    struct ata_device *atadev = device_get_softc(dev);

    /*
     * if we detect that the device isn't a real SATA device we limit
     * the transfer mode to UDMA5/ATA100.
     * this works around the problems some devices has with the
     * Marvell 88SX8030 SATA->PATA converters and UDMA6/ATA133.
     */
    if (atadev->param.satacapabilities != 0x0000 &&
        atadev->param.satacapabilities != 0xffff) {
        struct ata_channel *ch = device_get_softc(device_get_parent(dev));

        /* on some drives we need to set the transfer mode */
        ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0,
                       ata_limit_mode(dev, mode, ATA_UDMA6));

        /* query SATA STATUS for the speed */
        if (ch->r_io[ATA_SSTATUS].res &&
           ((ATA_IDX_INL(ch, ATA_SSTATUS) & ATA_SS_CONWELL_MASK) ==
            ATA_SS_CONWELL_GEN2))
            atadev->mode = ATA_SA300;
        else
            atadev->mode = ATA_SA150;
    }
    else {
        mode = ata_limit_mode(dev, mode, ATA_UDMA5);
        if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode))
            atadev->mode = mode;
    }
}

-- 
B.Walter                http://www.bwct.de      http://www.fizon.de
bernd(at)bwct.de           info(at)bwct.de            support(at)fizon.de
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Fri 27 Apr 2007 - 17:38:34 CEST

search this site