From nobody@FreeBSD.org  Thu Sep 20 21:21:16 2012
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 8E801106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 20 Sep 2012 21:21:16 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 55EEE8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 20 Sep 2012 21:21:16 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q8KLLFPR041860
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 20 Sep 2012 21:21:15 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q8KLLFsC041859;
	Thu, 20 Sep 2012 21:21:15 GMT
	(envelope-from nobody)
Message-Id: <201209202121.q8KLLFsC041859@red.freebsd.org>
Date: Thu, 20 Sep 2012 21:21:15 GMT
From: Axel Drfler <axeld@pinc-software.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ale driver msix setup typo
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         171825
>Category:       kern
>Synopsis:       [ale] [patch] ale driver msix setup typo
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 20 21:30:09 UTC 2012
>Closed-Date:    Tue Nov 06 07:59:20 UTC 2012
>Last-Modified:  Tue Nov 06 07:59:20 UTC 2012
>Originator:     Axel Drfler
>Release:        head
>Organization:
Haiku
>Environment:
>Description:
The number of MSI-X messages pci_alloc_msix() fills in (msixc) is never checked - instead, msic is checked. In r233888 the problem is in line 554, not sure if my patch manages to apply (it should be against the 9.0 release version where the line is 517).

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff --git a/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_ale.c b/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_ale.c
index 9c3dfd9..25da00a 100644
--- a/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_ale.c
+++ b/src/add-ons/kernel/drivers/network/ar81xx/dev/ale/if_ale.c
@@ -514,7 +514,7 @@ ale_attach(device_t dev)
 	if (msix_disable == 0 || msi_disable == 0) {
 		if (msix_disable == 0 && msixc == ALE_MSIX_MESSAGES &&
 		    pci_alloc_msix(dev, &msixc) == 0) {
-			if (msic == ALE_MSIX_MESSAGES) {
+			if (msixc == ALE_MSIX_MESSAGES) {
 				device_printf(dev, "Using %d MSIX messages.\n",
 				    msixc);
 				sc->ale_flags |= ALE_FLAG_MSIX;


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Oct 5 03:43:27 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171825 
Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Mon Oct 8 06:56:31 UTC 2012 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171825 
State-Changed-From-To: open->patched 
State-Changed-By: yongari 
State-Changed-When: Mon Oct 8 07:04:22 UTC 2012 
State-Changed-Why:  
Fixed in r241340. 
Thanks for reporting! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/171825: commit references a PR
Date: Mon,  8 Oct 2012 07:01:19 +0000 (UTC)

 Author: yongari
 Date: Mon Oct  8 07:01:07 2012
 New Revision: 241340
 URL: http://svn.freebsd.org/changeset/base/241340
 
 Log:
   Fix typo. Check against number of allocated MSI-X vectors.
   There is no ale(4) controller that supports MSI-X so this is not
   real issue.
   
   PR:	kern/171825
 
 Modified:
   head/sys/dev/ale/if_ale.c
 
 Modified: head/sys/dev/ale/if_ale.c
 ==============================================================================
 --- head/sys/dev/ale/if_ale.c	Mon Oct  8 05:51:47 2012	(r241339)
 +++ head/sys/dev/ale/if_ale.c	Mon Oct  8 07:01:07 2012	(r241340)
 @@ -551,7 +551,7 @@ ale_attach(device_t dev)
  	if (msix_disable == 0 || msi_disable == 0) {
  		if (msix_disable == 0 && msixc == ALE_MSIX_MESSAGES &&
  		    pci_alloc_msix(dev, &msixc) == 0) {
 -			if (msic == ALE_MSIX_MESSAGES) {
 +			if (msixc == ALE_MSIX_MESSAGES) {
  				device_printf(dev, "Using %d MSIX messages.\n",
  				    msixc);
  				sc->ale_flags |= ALE_FLAG_MSIX;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: yongari 
State-Changed-When: Tue Nov 6 07:58:42 UTC 2012 
State-Changed-Why:  
Merge complete. 

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