From owner-freebsd-amd64@FreeBSD.ORG Wed Dec 10 09:11:09 2008 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD37106564A; Wed, 10 Dec 2008 09:11:09 +0000 (UTC) (envelope-from victor@bsdes.net) Received: from alf.bsdes.net (244.Red-217-126-240.staticIP.rima-tde.net [217.126.240.244]) by mx1.freebsd.org (Postfix) with ESMTP id 0DC368FC17; Wed, 10 Dec 2008 09:11:09 +0000 (UTC) (envelope-from victor@bsdes.net) Received: by alf.bsdes.net (Postfix, from userid 1001) id CFDF3119CF7; Wed, 10 Dec 2008 10:11:07 +0100 (CET) Date: Wed, 10 Dec 2008 10:11:07 +0100 From: Victor Balada Diaz To: "Andrey V. Elsukov" Message-ID: <20081210091107.GC1320@alf.bsdes.net> References: <20081209185236.GA1320@alf.bsdes.net> <493F84A4.1080308@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <493F84A4.1080308@yandex.ru> User-Agent: Mutt/1.4.2.3i X-Mailman-Approved-At: Wed, 10 Dec 2008 14:10:00 +0000 Cc: freebsd-stable@freebsd.org, freebsd-amd64@freebsd.org, =?iso-8859-1?Q?S=F8ren?= Schmidt Subject: Re: [ATA] and re(4) stability issues X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 09:11:09 -0000 On Wed, Dec 10, 2008 at 11:58:12AM +0300, Andrey V. Elsukov wrote: > Victor Balada Diaz wrote: > >Digging at linux source code i've found that they do some special things > >for this chipset that i've been unable to find on our code. This is > >linux code for my chipset: > > > >371 AHCI_HFLAGS (AHCI_HFLAG_IGN_SERR_INTERNAL | > >372 AHCI_HFLAG_32BIT_ONLY | > >AHCI_HFLAG_NO_MSI | > >373 AHCI_HFLAG_SECT255), > > > >File and the rest of the code in here[3]. > > > >As i saw AHCI_HFLAG_NO_MSI i tried doing the easiest thing i could > >think of, switching MSI and MSI-x off for the whole system, so > >i added to /boot/loader.conf this tunables: > > FreeBSD's ata(4) driver doesn't support MSI. This flag in linux's libata > used in > > if ((hpriv->flags & AHCI_HFLAG_NO_MSI) || pci_enable_msi(pdev)) > pci_intx(pdev, 1); > > In FreeBSD's code we have the same: > > /* enable PCI interrupt */ > pci_write_config(dev, PCIR_COMMAND, > pci_read_config(dev, PCIR_COMMAND, 2) & ~0x0400, 2); > > AHCI_HFLAG_IGN_SERR_INTERNAL flag targeted to ignore SERR_INTERNAL errors. > FreeBSD's ata(4) driver ignores they too. > > AHCI_HFLAG_32BIT_ONLY flag limits to use 32-bit DMA only. > If AHCI CAP register reports that controller supports 64-bit DMA driver > will use 64-bit. > So i think there can be added one quirk for you, but i'm not sure that > problem is here.. > > AHCI_HFLAG_SECT255 flag limits I/O operation to 255 sectors, FreeBSD uses > 128-limit > by default. Thanks for explaining me what the flags do. I'm not skilled enough to create the DMA quirks but if you could give me some patches i'll test them. Also if you have any other idea on what could i test or how can i debug this it would be more than welcome. Thanks. Regards. -- La prueba más fehaciente de que existe vida inteligente en otros planetas, es que no han intentado contactar con nosotros.