[Bug 252165] usb network and mii bus media status race condition

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 08 Apr 2022 16:58:43 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252165

--- Comment #19 from Ali Abdallah <ali.abdallah@suse.com> ---
(In reply to Hans Petter Selasky from comment #18)
Compiling the kernel with COPTFLAGS=-O0 and CFLAGS=-O0 resulted in non-working
dtrace... (dtrace: invalid probe specifier... "/usr/lib/dtrace/mbuf.d", line 1:
failed to copy type of 'm_data': Type information is in parent and
unavailable.) But anyway the problem occurs, with no particular dmesg from
witness or debug_lock.

On the other hand, on the standard generic kernel, when the issue is not
occurring, the following dtrace is shown

# dtrace -n
"fbt:kernel:mii_pollstat:*,fbt:uether:ue_tick_task:*,fbt:if_ure:ure_tick:*,fbt:if_ure:ure_ifmedia_sts:*,fbt:kernel:mii_tick:*"

  0  92491            ure_ifmedia_sts:entry 
  0  35254               mii_pollstat:entry 
  2  35255              mii_pollstat:return 
  2  92492           ure_ifmedia_sts:return 

  3  92425               ue_tick_task:entry 
  3  92489                   ure_tick:entry 
  3  35276                   mii_tick:entry 
  3  35277                  mii_tick:return 
  3  92490                  ure_tick:return 

Which are the two "code-path" checking for link status. Now with the same
dtrace probes, when the link up/down problem occurs, I see 

  3  92425               ue_tick_task:entry 
  3  92489                   ure_tick:entry 
  3  35276                   mii_tick:entry 
  0  92491            ure_ifmedia_sts:entry  <----
  0  35254               mii_pollstat:entry  <----
  3  35277                  mii_tick:return 
  3  92490                  ure_tick:return

How that is possible? ure_ifmedia_sts should acquire the same mutex lock as
ue_tick_task before calling mii_pollstat. And this is not happening apparently.

-- 
You are receiving this mail because:
You are the assignee for the bug.