From owner-cvs-all@FreeBSD.ORG Mon Oct 29 17:38:13 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A352816A417; Mon, 29 Oct 2007 17:38:13 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp2.yandex.ru (smtp2.yandex.ru [213.180.200.18]) by mx1.freebsd.org (Postfix) with ESMTP id 0171213C4A7; Mon, 29 Oct 2007 17:37:53 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from ns.kirov.so-cdu.ru ([77.72.136.145]:63976 "EHLO [127.0.0.1]" smtp-auth: "bu7cher" TLS-CIPHER: "DHE-RSA-AES256-SHA keybits 256/256 version TLSv1/SSLv3" TLS-PEER-CN1: ) by mail.yandex.ru with ESMTP id S4395624AbXJ2FgG (ORCPT + 2 others); Mon, 29 Oct 2007 08:36:06 +0300 X-Comment: RFC 2476 MSA function at smtp2.yandex.ru logged sender identity as: bu7cher Message-ID: <4725713F.5010409@yandex.ru> Date: Mon, 29 Oct 2007 08:35:59 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: =?KOI8-R?Q?S=F8ren_Schmidt?= References: <200710260857.l9Q8v8HI099233@repoman.freebsd.org> In-Reply-To: <200710260857.l9Q8v8HI099233@repoman.freebsd.org> Content-Type: multipart/mixed; boundary="------------080402060406020200060409" Cc: cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/ata ata-pci.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2007 17:38:13 -0000 This is a multi-part message in MIME format. --------------080402060406020200060409 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8bit Søren Schmidt wrote: > Modified files: > sys/dev/ata ata-pci.c > Log: > Fix treating some modern chips (mem mapped) as legacy devices. Hi, Søren. Seems that PCIP_STORAGE_IDE_MASTERDEV, PCIP_STORAGE_IDE_MODEPRIM and PCIP_STORAGE_IDE_MODESEC should be related to the PCIS_STORAGE_IDE subclass. My Marvell 88SE6141 chip have PCIS_STORAGE_SATA subclass and PCIP_STORAGE_SATA_AHCI_1_0|PCIS_STORAGE_OTHER programming interface. And this chip detected as a legacy controller. What you think about the attached patch? -- WBR, Andrey V. Elsukov --------------080402060406020200060409 Content-Type: text/plain; name="ata-pci.c.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata-pci.c.diff.txt" --- /usr/src/sys/dev/ata/ata-pci.c 2007-10-29 08:01:06.000000000 +0300 +++ ata-pci.c 2007-10-29 08:11:20.000000000 +0300 @@ -59,15 +59,17 @@ int ata_legacy(device_t dev) { - return (((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV)&& - ((pci_read_config(dev, PCIR_PROGIF, 1) & - (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) != + uint32_t pi, scc; + pi = pci_read_config(dev, PCIR_PROGIF, 1); + scc = pci_read_config(dev, PCIR_SUBCLASS, 1); + return ((scc == PCIS_STORAGE_IDE && (pi & PCIP_STORAGE_IDE_MASTERDEV) && + ((pi & (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) != (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))) || - (!pci_read_config(dev, PCIR_BAR(0), 4) && - !pci_read_config(dev, PCIR_BAR(1), 4) && - !pci_read_config(dev, PCIR_BAR(2), 4) && - !pci_read_config(dev, PCIR_BAR(3), 4) && - !pci_read_config(dev, PCIR_BAR(5), 4))); + (pci_read_config(dev, PCIR_BAR(0), 4) == 0 && + pci_read_config(dev, PCIR_BAR(1), 4) == 0 && + pci_read_config(dev, PCIR_BAR(2), 4) == 0 && + pci_read_config(dev, PCIR_BAR(3), 4) == 0 && + pci_read_config(dev, PCIR_BAR(5), 4) == 0)); } int --------------080402060406020200060409--