Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jul 2016 00:26:57 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r302791 - stable/10/sys/dev/ahci
Message-ID:  <201607140026.u6E0QvgY027297@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Jul 14 00:26:57 2016
New Revision: 302791
URL: https://svnweb.freebsd.org/changeset/base/302791

Log:
  MFC r302402: Fix ahci(4) driver attach to controller with 32 ports.
  
  Incorrect sign expansion in variables that supposed to be a bit fields
  caused infinite loop.  Fixing this allows system properly detect maximal
  possible 32 devices configured on AHCI HBA of BHyVe.  That case did not
  happen in a wild before due to lack of hardware AHCI HBAs with 32 ports.

Modified:
  stable/10/sys/dev/ahci/ahci.c
  stable/10/sys/dev/ahci/ahci.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/ahci/ahci.c
==============================================================================
--- stable/10/sys/dev/ahci/ahci.c	Wed Jul 13 23:49:45 2016	(r302790)
+++ stable/10/sys/dev/ahci/ahci.c	Thu Jul 14 00:26:57 2016	(r302791)
@@ -154,8 +154,8 @@ int
 ahci_attach(device_t dev)
 {
 	struct ahci_controller *ctlr = device_get_softc(dev);
-	int error, i, u, speed, unit;
-	u_int32_t version;
+	int error, i, speed, unit;
+	uint32_t u, version;
 	device_t child;
 
 	ctlr->dev = dev;

Modified: stable/10/sys/dev/ahci/ahci.h
==============================================================================
--- stable/10/sys/dev/ahci/ahci.h	Wed Jul 13 23:49:45 2016	(r302790)
+++ stable/10/sys/dev/ahci/ahci.h	Thu Jul 14 00:26:57 2016	(r302791)
@@ -472,7 +472,7 @@ struct ahci_enclosure {
 	uint8_t			status[AHCI_MAX_PORTS][4]; /* ArrayDev statuses */
 	int			quirks;
 	int			channels;
-	int			ichannels;
+	uint32_t		ichannels;
 };
 
 /* structure describing a AHCI controller */
@@ -503,7 +503,7 @@ struct ahci_controller {
 	int			quirks;
 	int			numirqs;
 	int			channels;
-	int			ichannels;
+	uint32_t		ichannels;
 	int			ccc;		/* CCC timeout */
 	int			cccv;		/* CCC vector */
 	int			direct;		/* Direct command completion */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607140026.u6E0QvgY027297>