From owner-freebsd-current@FreeBSD.ORG Thu Mar 25 14:54:12 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 164B016A4CE for ; Thu, 25 Mar 2004 14:54:12 -0800 (PST) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5103743D39 for ; Thu, 25 Mar 2004 14:54:11 -0800 (PST) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i2PMrDJj065742 for freebsd-current@freebsd.org.checked; (8.12.8/vak/2.1) Fri, 26 Mar 2004 01:53:13 +0300 (MSK) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (rik.cronyx.ru [172.22.4.1]) by hanoi.cronyx.ru with ESMTP id i2PMn3MC065543; (8.12.8/vak/2.1) Fri, 26 Mar 2004 01:49:03 +0300 (MSK) (envelope-from rik@cronyx.ru) Message-ID: <406363EE.2030805@cronyx.ru> Date: Fri, 26 Mar 2004 01:57:50 +0300 From: Roman Kurakin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Content-Type: multipart/mixed; boundary="------------070708020200040009060405" Subject: [Fwd: [Fwd: Re: ATA/CHS problem]] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 22:54:12 -0000 This is a multi-part message in MIME format. --------------070708020200040009060405 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit S?ren Schmidt wrote: > Roman Kurakin wrote: > >> This is not an LBA request. ATA driver thinks that I have 80G CHS >> device, cause it's ATA_FLAG_54_58 >> is zero. (This decision is incorrect, we shouldn't relay on this >> flag). I've checked another seagate 80G drive in >> CHS mode(by driver hacking), and problematic one with LBA mode. I get >> the same behavior on both with CHS. >> And both work fine in LBA mode. It also should be mentioned that I >> get this problem on machine with >> ICH2 controller, and it seems that I don't have such problem on other >> machine with ICH5 > > > Hmm, we could loosen up this check (Se patch below) but that will > probably break support for real old ATA disks (note that those old Probably I'll do something like that, but since I've already lost some time on this problem I want to get why CHS mode doesn't works. I can't understand how using of ICH2 could lead to such problems ... (I'll try to get access to other ICH2 and non ICH2 machines to make extra checks). As I understand before using CHS we issue command 91h, to set proper CHS mode. I have one really CHS device and it seems to be working. > systems most likely will have trouble with -current anyways). > If I coul dhave my ways, we wouldn't even try to support disks that > doesn't support LBA.... I think we could use another way to check old ata. Why no to use bit9 from word 49 and if device really ATA, why it's 60-61 words are non zero? >> PS. If you have any ideas, or if you have any materials (standards >> for example) about ATA/ATAPI and you >> can share them with me, please let me know. I am not ata developer, >> so this is a bit difficalt for me to >> dig this problem. > > > Go to t13.org they are the standards body for ATA etc... I already have a couple of drafts, but probably I need to get some more information. Please take a look to my patch. It makes output more informative. If I have it before I started to dig, I didn't lost so much time. There is a couple of places where we may need to apply the alike patches. rik --------------070708020200040009060405 Content-Type: text/plain; name="ata-queue.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata-queue.patch" --- ata-queue.c.orig Tue Mar 23 20:39:22 2004 +++ ata-queue.c Thu Mar 25 00:45:51 2004 @@ -316,7 +316,9 @@ (request->dmastat & ATA_BMSTAT_ERROR)) printf(" dma=0x%02x", request->dmastat); if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL))) - printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); + printf((request->device->flags & ATA_D_USE_CHS) + ? " CHS=%llx" : " LBA=%llu", + (unsigned long long)request->u.ata.lba); printf("\n"); } --------------070708020200040009060405--