Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 May 2018 16:31:34 -0700
From:      Matthew Macy <mmacy@freebsd.org>
To:        Mark Johnston <markj@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org, Stephen Hurd <shurd@freebsd.org>
Subject:   Re: svn commit: r333345 - head/sys/dev/e1000
Message-ID:  <CAPrugNpu6XuR3sg3r1cjLGROmAh57%2BBmNVE0GkiG2Esk0rv_aA@mail.gmail.com>
In-Reply-To: <20180508221025.GA4249@raichu>
References:  <201805080139.w481djMX062724@repo.freebsd.org> <20180508221025.GA4249@raichu>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Can you please try the attached patch? (Note that gmail may insert
carriage returns)

-M

On Tue, May 8, 2018 at 3:10 PM, Mark Johnston <markj@freebsd.org> wrote:
> On Tue, May 08, 2018 at 01:39:45AM +0000, Matt Macy wrote:
>> Author: mmacy
>> Date: Tue May  8 01:39:45 2018
>> New Revision: 333345
>> URL: https://svnweb.freebsd.org/changeset/base/333345
>>
>> Log:
>>   Sleep rather than spin in e1000 when doing long running config operations.
>>
>>   With r333218 it is now possible for drivers to use an sx lock and thus sleep while
>>   waiting on long running operations rather than DELAY().
>>
>>   Reported by:        gallatin
>>   Reviewed by:        sbruno
>>   Approved by:        sbruno
>>   MFC after:  1 month
>>   Sponsored by:       Limelight Networks
>>   Differential Revision:      https://reviews.freebsd.org/D14984
>
> I'm getting a panic during boot with this change: "unknown mac type d".
>
> It occurs while the driver is attaching to:
>
> em0@pci0:1:0:0: class=0x020000 card=0x7044103c chip=0x105e8086 rev=0x06 hdr=0x00
>     vendor     = 'Intel Corporation'
>     device     = '82571EB Gigabit Ethernet Controller'
>     class      = network
>     subclass   = ethernet

[-- Attachment #2 --]
diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c
index da7934f9fb6..79283cf3296 100644
--- a/sys/dev/e1000/e1000_mac.c
+++ b/sys/dev/e1000/e1000_mac.c
@@ -2196,7 +2196,6 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
 	s32 i = 0;
 	
 	DEBUGFUNC("e1000_get_hw_semaphore");
-#ifdef notyet
 	/* _82571 */
 	/* If we have timedout 3 times on trying to acquire
 	 * the inter-port SMBI semaphore, there is old code
@@ -2208,7 +2207,6 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
 	if (hw->dev_spec._82571.smb_counter > 2)
 		sw_timeout = 1;
 
-#endif
 	/* Get the SW semaphore */
 	while (i < timeout) {
 		swsm = E1000_READ_REG(hw, E1000_SWSM);
@@ -2220,7 +2218,7 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
 	}
 
 	if (i == timeout) {
-#ifdef notyet
+
 		/*
 		 * XXX This sounds more like a driver bug whereby we either
 		 * recursed accidentally or missed clearing it previously
@@ -2239,7 +2237,6 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
                                usec_delay(50);
                        }
                }
-#endif
 
 		DEBUGOUT("Driver can't access device - SMBI bit is set.\n");
 		return -E1000_ERR_NVM;

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPrugNpu6XuR3sg3r1cjLGROmAh57%2BBmNVE0GkiG2Esk0rv_aA>