From nobody@FreeBSD.org  Thu Apr 12 16:02:05 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 7081B16A402
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Apr 2007 16:02:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D63713C458
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Apr 2007 16:02:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l3CG25HD091733
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Apr 2007 16:02:05 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l3CFv3M3084825;
	Thu, 12 Apr 2007 15:57:03 GMT
	(envelope-from nobody)
Message-Id: <200704121557.l3CFv3M3084825@www.freebsd.org>
Date: Thu, 12 Apr 2007 15:57:03 GMT
From: Thomas Nystrm<thn@saeab.se>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Unsupported Compact Flash (Viking 256MB)
X-Send-Pr-Version: www-3.0

>Number:         111516
>Category:       kern
>Synopsis:       [ata] [patch] Unsupported Compact Flash (Viking 256MB)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    remko
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 12 16:10:02 GMT 2007
>Closed-Date:    Sat Jul 07 11:37:42 GMT 2007
>Last-Modified:  Sat Jul  7 11:40:02 GMT 2007
>Originator:     Thomas Nystrm
>Release:        6.2-RELEASE
>Organization:
Svensk Aktuell Elektronik AB
>Environment:
FreeBSD ture.saeab.se 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Tue Jan 16 17:58:45 CET 2007     root@ture.saeab.se:/export2/obj/usr/src/sys/FIREWALL.SAE  i386
>Description:
Some variants of the Viking Interworks 256MB Compact Flash cards doesn't work,
it is not recognized as a disk. The disc-controller is detected but no disk.

The problem variant returns the code 0x8400 in the configuration word. FreeBSD
looks for the magic words 0x844a or 0x848a (in sys/dev/ata/ata-disk.c, function
ad_probe).

The attached patch also looks for the 0x8400 magic word.

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- ata-all.h.orig	Thu Apr 12 17:49:43 2007
+++ ata-all.h	Thu Apr 12 17:51:41 2007
@@ -271,6 +271,7 @@
 #define ATA_DEV(device)                 ((device == ATA_MASTER) ? 0 : 1)
 #define ATA_CFA_MAGIC1                  0x844A
 #define ATA_CFA_MAGIC2                  0x848A
+#define ATA_CFA_MAGIC3                  0x8400
 #define ATAPI_MAGIC_LSB                 0x14
 #define ATAPI_MAGIC_MSB                 0xeb
 #define ATAPI_P_READ                    (ATA_S_DRQ | ATA_I_IN)
--- ata-disk.c.orig	Sat Sep 30 16:51:49 2006
+++ ata-disk.c	Thu Apr 12 17:51:49 2007
@@ -72,7 +72,8 @@
 
     if (!(atadev->param.config & ATA_PROTO_ATAPI) ||
 	(atadev->param.config == ATA_CFA_MAGIC1) ||
-	(atadev->param.config == ATA_CFA_MAGIC2))
+	(atadev->param.config == ATA_CFA_MAGIC2) ||
+	(atadev->param.config == ATA_CFA_MAGIC3))
 	return 0;
     else
 	return ENXIO;

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Apr 12 20:37:28 UTC 2007 
Responsible-Changed-Why:  
Soeren, can you take a look at this one? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111516 
Responsible-Changed-From-To: sos->remko 
Responsible-Changed-By: remko 
Responsible-Changed-When: Thu Apr 12 20:44:45 UTC 2007 
Responsible-Changed-Why:  
No i will look at it (after discussing with Soren earlier today ;-)) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111516 
State-Changed-From-To: open->patched 
State-Changed-By: remko 
State-Changed-When: Tue Jun 26 22:14:06 UTC 2007 
State-Changed-Why:  
Patched in -current will MFC in a little. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111516 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/111516: commit references a PR
Date: Tue, 26 Jun 2007 22:13:52 +0000 (UTC)

 remko       2007-06-26 22:13:44 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/dev/ata          ata-all.h ata-disk.c 
   Log:
   Add Viking Interworks 256MB as an ata device; this might give
   some false positives but at this moment it is better to add
   support then to dont have it at all (comment from Soren).
   
   PR:             kern/111516
   Submitted by:   Thomas Nystrom <thn at saeab dot se>
   Approved by:    re (kensmith)
   Approved by:    imp (mentor)
   OK'ed by:       sos (With the comment noted above about false
                   positives).
   
   Revision  Changes    Path
   1.124     +1 -0      src/sys/dev/ata/ata-all.h
   1.204     +2 -1      src/sys/dev/ata/ata-disk.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: remko 
State-Changed-When: Sat Jul 7 11:37:40 UTC 2007 
State-Changed-Why:  
The updates had been backported to RELENG_6 as well, i will not backport 
this to RELENG_5, since the changes required there are much much more 
then this simple change (there is a different ATA framework in 5.x then 
in 6.x). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111516 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/111516: commit references a PR
Date: Sat,  7 Jul 2007 11:36:49 +0000 (UTC)

 remko       2007-07-07 11:36:44 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     sys/dev/ata          ata-all.h ata-disk.c 
   Log:
   MFC v 1.124 ata-all.h
   MFC v 1.204 ata-disk.c
   
     Add Viking Interworks 256MB as an ata device; this might give
     some false positives but at this moment it is better to add
     support then to dont have it at all (comment from Soren).
   
     PR: kern/111516
     Submitted by: Thomas Nystrom <thn at saeab dot se>
     Approved by: re (kensmith)
     Approved by: imp (mentor)
     OK'ed by: sos (With the comment noted above about false
     positives).
   
   Approved by:    imp (mentor,implicit)
   
   Revision    Changes    Path
   1.103.2.11  +1 -0      src/sys/dev/ata/ata-all.h
   1.189.2.6   +2 -1      src/sys/dev/ata/ata-disk.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
