Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jul 2019 08:36:50 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350025 - head/sys/dev/bge
Message-ID:  <201907160836.x6G8aor8053749@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Jul 16 08:36:49 2019
New Revision: 350025
URL: https://svnweb.freebsd.org/changeset/base/350025

Log:
  bge: check that the bus is a pci bus before using it as such
  
  This fixes the following panic on powerpc:
    pci_get_vendor failed for pcib1 on bus ofwbus0, error = 2
  
  PR:		238730
  Reported by:	Dennis Clarke <dclarke@blastwave.org>
  Tested by:	Dennis Clarke <dclarke@blastwave.org>
  MFC after:	2 weeks

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Tue Jul 16 04:17:25 2019	(r350024)
+++ head/sys/dev/bge/if_bge.c	Tue Jul 16 08:36:49 2019	(r350025)
@@ -3276,6 +3276,8 @@ bge_mbox_reorder(struct bge_softc *sc)
 		bus = device_get_parent(dev);
 		if (device_get_devclass(dev) != pcib)
 			break;
+		if (device_get_devclass(bus) != pci)
+			break;
 		for (i = 0; i < nitems(mbox_reorder_lists); i++) {
 			if (pci_get_vendor(dev) ==
 			    mbox_reorder_lists[i].vendor &&
@@ -3287,8 +3289,6 @@ bge_mbox_reorder(struct bge_softc *sc)
 				return (1);
 			}
 		}
-		if (device_get_devclass(bus) != pci)
-			break;
 	}
 	return (0);
 }



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