FreeBSD Bugzilla – Attachment 221274 Details for
Bug 252165
usb network and mii bus media status race condition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Workaround race in link status change
0001-Avoid-race-condition-in-miibus-link-code.patch (text/plain), 1.50 KB, created by
Ali Abdallah
on 2021-01-04 19:37:43 UTC
(
hide
)
Description:
Workaround race in link status change
Filename:
MIME Type:
Creator:
Ali Abdallah
Created:
2021-01-04 19:37:43 UTC
Size:
1.50 KB
patch
obsolete
>From 4a7890dd58aa944963f65ffceeea75347e4dafee Mon Sep 17 00:00:00 2001 >From: Ali Abdallah <ali.abdallah@suse.com> >Date: Sat, 2 Jan 2021 12:02:29 +0100 >Subject: [PATCH] Avoid race condition in miibus link code > >--- > sys/dev/mii/mii.c | 3 --- > sys/dev/mii/rgephy.c | 11 +++++++---- > 2 files changed, 7 insertions(+), 7 deletions(-) > >diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c >index 57294f4c096..d387ac15ef2 100644 >--- a/sys/dev/mii/mii.c >+++ b/sys/dev/mii/mii.c >@@ -615,9 +615,6 @@ mii_pollstat(struct mii_data *mii) > struct mii_softc *child; > struct ifmedia_entry *ife = mii->mii_media.ifm_cur; > >- mii->mii_media_status = 0; >- mii->mii_media_active = IFM_NONE; >- > LIST_FOREACH(child, &mii->mii_phys, mii_list) { > /* > * If we're not polling this PHY instance, just skip it. >diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c >index 362aa200cba..5e4b06b0ac4 100644 >--- a/sys/dev/mii/rgephy.c >+++ b/sys/dev/mii/rgephy.c >@@ -312,14 +312,17 @@ static void > rgephy_status(struct mii_softc *sc) > { > struct mii_data *mii = sc->mii_pdata; >+ int linkup; > int bmsr, bmcr; > uint16_t ssr; > >- mii->mii_media_status = IFM_AVALID; >- mii->mii_media_active = IFM_ETHER; >+ linkup = rgephy_linkup(sc); > >- if (rgephy_linkup(sc) != 0) >- mii->mii_media_status |= IFM_ACTIVE; >+ if (linkup != 0) >+ mii->mii_media_status = IFM_AVALID | IFM_ACTIVE; >+ else >+ mii->mii_media_status = IFM_AVALID; >+ mii->mii_media_active = IFM_ETHER; > > bmsr = PHY_READ(sc, RGEPHY_MII_BMSR); > bmcr = PHY_READ(sc, RGEPHY_MII_BMCR); >-- >2.29.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 252165
:
221274
|
236901
|
251770
|
255142
|
255162
|
255301