From nobody Sun Apr 27 18:38:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZlwLr5S6Qz5vBJ5; Sun, 27 Apr 2025 18:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZlwLr2g5gz3G5j; Sun, 27 Apr 2025 18:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745779092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c8a0SeJ/MVEw4ZLnQxGLoli3ts/5HgR+84Zh7h5Uw0o=; b=FtW618ALxsoiRo3zMAjxAZAQSImhagegRsL1pJ2iq9T+xISb/4oXyaGPn0XEMIiyzTLCuf TPGqJwO1CN9XKDNbI1ZXL6ONQgwDCD5P/JLqOfTBToau2kt9iRNyBxNnkgsfNt9ZNJ92HB GoEfQOiHjA2g+3gn3JUbI7W5LcnJtWS7IUMCB3a1zeMG3EbDVJPaIUIGsQQXHQTmY9Agib QyMXgknuPbWpL4gYvrvJ01IVFLevBQs09DTJ947kkXGbaTR+PD+kdER9kkL9R6BYpnCIzA d9BoOyTXKD7jsE8w/WeB7X9juGAUTXsgtAIWC5XdOpiA4RgE5T8H4778XW19tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745779092; a=rsa-sha256; cv=none; b=ay7gRE/OQaRdK6zebWyzsnQGGEfmnkz6rNJr/jm1SkZKEWb+7IPeqWo8FF59CNEWI7LYNF vEdl0XGki3cmQOvPTlH3zMIG6/fmTr4NDdm+MVPbdflnSqIH6Z1pK4d/UuXWui6HF+ZMeC mNFHQjDPhHefSO2AncZgluPuvh8lLkJn0HbQZyQVoBMePEe8xWaz7T9hIq2bLcQTTdUxH7 0MIF55LS64hJO/VUBeMZBky9YYqAhm6L86JLAk4rfepe/s+NPtKFJmFAIvINTOwAWg+2fa 4PkG34pTopcQdu2kUIT5AH4fB2C4ManUAiLChwfR6/msOkii2hl7/zmHj4bsMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745779092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c8a0SeJ/MVEw4ZLnQxGLoli3ts/5HgR+84Zh7h5Uw0o=; b=myY5CGmtOozCNYfNUdzeK6Tv8jeooFxOigjVZYm93y1asRds6sY/vemXlqQCXzmWon782I NVY9KKqnR7M+DjG0P1xdXw3yyH7SKfb/JSSO02U9E7kAjvz9i7J3kqpW3oL/jUM341HEns 9avFSkNikRzg5l2R3zXEApp5q9De3F5+IZnGsF8hdRAMEqKDIMmX/VeuHZxf4SdQ5copFU x+hI2gDE/GNdEZvmZn4GZzBgBLBMxn7goHJiw3YMhKy9XOjigSzPXrSxP0bBY/n4DChlGw q3idkNhH0ZJr6uPI33eiYuR++R1fEcG3qdlfZe1mHKwSHfk7DSFApvUg70O2Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZlwLq69fNz1FnD; Sun, 27 Apr 2025 18:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53RIcBea020634; Sun, 27 Apr 2025 18:38:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53RIcB4C020631; Sun, 27 Apr 2025 18:38:11 GMT (envelope-from git) Date: Sun, 27 Apr 2025 18:38:11 GMT Message-Id: <202504271838.53RIcB4C020631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: c78f603ab77f - main - e6000sw: schedule e6000sw_tick() to occur once a second List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c78f603ab77ff3a2910d9b7ef190b30b611fc311 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=c78f603ab77ff3a2910d9b7ef190b30b611fc311 commit c78f603ab77ff3a2910d9b7ef190b30b611fc311 Author: Adrian Chadd AuthorDate: 2025-04-25 18:44:22 +0000 Commit: Adrian Chadd CommitDate: 2025-04-27 18:11:19 +0000 e6000sw: schedule e6000sw_tick() to occur once a second Although all the machinery is present, the tick routine only ran once. It was never rescheduled. So, reschedule it. However in practice I've discovered that the tick routine is running whilst a bunch of phys are actually being probe/attached on each per-port MII bus being created and probed off of the switch itself. Until that's debugged (and likely the whole PHY management stuff is cleaned up here), just add a NULL check and thus don't panic. Differential Revision: https://reviews.freebsd.org/D50031 Reviewed by: imp --- sys/dev/etherswitch/e6000sw/e6000sw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c index be02edb3d5e6..19d8e85decf6 100644 --- a/sys/dev/etherswitch/e6000sw/e6000sw.c +++ b/sys/dev/etherswitch/e6000sw/e6000sw.c @@ -1613,6 +1613,17 @@ e6000sw_tick(void *arg, int p __unused) &mii->mii_media_status, &mii->mii_media_active); LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { + /* + * Note: this is sometimes NULL during PHY + * enumeration, although that shouldn't be + * happening /after/ tick runs. To work + * around this whilst the problem is being + * debugged, just do a NULL check here and + * continue. + */ + if (mii->mii_media.ifm_cur == NULL) + continue; + if (IFM_INST(mii->mii_media.ifm_cur->ifm_media) != miisc->mii_inst) continue; @@ -1620,6 +1631,7 @@ e6000sw_tick(void *arg, int p __unused) } } E6000SW_UNLOCK(sc); + taskqueue_enqueue_timeout(sc->sc_tq, &sc->sc_tt, hz); } static void