From nobody@FreeBSD.org  Mon Oct 18 02:01:12 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2E56E16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Oct 2004 02:01:12 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2050643D1D
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Oct 2004 02:01:12 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i9I21BgB030822
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Oct 2004 02:01:11 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i9I21B8g030821;
	Mon, 18 Oct 2004 02:01:11 GMT
	(envelope-from nobody)
Message-Id: <200410180201.i9I21B8g030821@www.freebsd.org>
Date: Mon, 18 Oct 2004 02:01:11 GMT
From: "James E. Flemer" <jflemer@alum.rpi.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pccard ata locking problem
X-Send-Pr-Version: www-2.3

>Number:         72805
>Category:       kern
>Synopsis:       pccard ata locking problem
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 18 02:10:28 GMT 2004
>Closed-Date:    Tue Oct 19 10:29:25 GMT 2004
>Last-Modified:  Tue Oct 19 10:29:25 GMT 2004
>Originator:     James E. Flemer
>Release:        6.0-CURRENT
>Organization:
n/a
>Environment:
FreeBSD null.speednaked.com 6.0-CURRENT FreeBSD 6.0-CURRENT #13: Sun Oct 17 18:14:23 MDT 2004     root@:/usr/src/sys/i386/compile/NULL6  i386

>Description:
      The locking changes to ata-all.c made in r1.229 expect the locking method to return ch->unit.  The pccard ata (ata-card.c) driver has bogus locking which was not updated to return ch->unit, it returns 1.  This causes ata-all.c enter an infinite loop trying to lock in ata_attach().
>How-To-Repeat:
      Insert a pcmcia ata device or compact flash ata device and watch it not attach.  Ejecting the device will cause a panic as soon as something (atacontrol) tries to touch it.
>Fix:
      This has an extremely trivial fix, so it should probably be applied and merged to 5.x quickly (for 5.3).  Note: this was submitted via web form so whitespace will be broken, but its a simple enough patch.

--- ata-card.c  6 Oct 2004 19:46:07 -0000       1.26
+++ ata-card.c  18 Oct 2004 01:41:58 -0000
@@ -91,7 +91,7 @@
 static int
 ata_pccard_locknoop(struct ata_channel *ch, int type)
 {
-    return 1;
+    return ch->unit;
 }
 
 static void

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: le 
State-Changed-When: Tue Oct 19 10:29:16 GMT 2004 
State-Changed-Why:  
Thank you, patch committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72805 
>Unformatted:
