From nobody Sat Feb 12 01:50:11 2022 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 5E13B19C9C2D; Sat, 12 Feb 2022 01:50:11 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JwYMl1lGBz4ThB; Sat, 12 Feb 2022 01:50:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644630611; 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=Youn+iHZQYVT1Cik03YLb+kIevKwiNPE/r7Q8RxE1AQ=; b=d6M6M1b0g3S3cFLNuEkzoNC7KZ4XBseLB4F3EsVgsyxhuxMKoQUzmeDSjb7gDHGsEwcjWg anadf52QzYnFOsBbpxQFpu2cVw0x88HrBKiH2KAgJmDY/a67sUrck6CU8gYXewTGHy+DVv EehpfCgEaMDm5CNTv08llX2xnOzA/o9ODfj3lZdZQdcXksrJpm8qelPsiNRNcDeLhakV5D FA/IV5dLa74sD8fACwHSYjSsYvouLZsdkFEjWJdrViNxVPYqr/lPZnGeELuO/KejGor3lS 1xS0Klt3EjVkujdAGM/XBmmRRP76S6chqHL/q9DlAXk1q7WMqXhNBviRNB3ltA== 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 153191EFCB; Sat, 12 Feb 2022 01:50:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21C1oBO4044230; Sat, 12 Feb 2022 01:50:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21C1oBtM044226; Sat, 12 Feb 2022 01:50:11 GMT (envelope-from git) Date: Sat, 12 Feb 2022 01:50:11 GMT Message-Id: <202202120150.21C1oBtM044226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 39a36707bd33 - main - cxgbe(4): Avoid unsafe hardware access in the ifmedia ioctls. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39a36707bd33b86a115651678028baeb616c8365 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644630611; 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=Youn+iHZQYVT1Cik03YLb+kIevKwiNPE/r7Q8RxE1AQ=; b=u7aM8PgqHGz/Z19IZauXdvshnEXW0P0CJjr0lgo349p0VtkuinLBViBFT6VZv+aAzdWLaq s6ccL+8G/iVcWEEqPzxQf+pLa75nzk343v1Ny3UMaYN01CrSRseIfKeNZvDK0N27uRDLGN JNymmdObZddLJvDQ20LD2bNJnNgtPiSL8QeAW3lU0WSbHtUQ+ZchWVOUIDyeNOBxeNW3Gx EnQdoL2PNWzG14CVfsgQ55eSEB9q8lyIR6DrqIwulPHlfejrAgwm4sLLMIluNrjcZhFTkb ItEfLbL5BiDWeAcZdN2CFWePYjjvnTcATkArDoeWzkoMcm/oPCT/tH8Syo4yGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644630611; a=rsa-sha256; cv=none; b=gcBIWG9La9g9adgePWfV+BxbVN8hke1P7kf2E6FPf7yu7W+zjMEuGHFe/5JJI0bIK8xlWw 73CnSTbuZvh9siatD1quPgsNcZP9ISlxWhyq3DJKasYsjOj0clRWX5B/Yb/b15V8OIU4Uu H03cvmOZ7LdBHzTynRodFcDk7h4NwKI0sL7o+vR0OZHFR0IJsTkNd5WxClBapXuWAV/yDZ 1redfVHfQIQHEKV3gJ5HniL/3lMShcC9Twc2yvIcZnLdFzOsuC51wsVlrqgXr3p5DZrpt+ cwaMrjk1t/yOXpl+iYtIRb8yIv53dyKpGOAi6Y+Yn5axBeQ74fxVavz96faVCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=39a36707bd33b86a115651678028baeb616c8365 commit 39a36707bd33b86a115651678028baeb616c8365 Author: Navdeep Parhar AuthorDate: 2022-02-11 23:37:17 +0000 Commit: Navdeep Parhar CommitDate: 2022-02-12 00:35:27 +0000 cxgbe(4): Avoid unsafe hardware access in the ifmedia ioctls. The hardware is unavailable when the device is suspended or in the middle of a reset. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index e7f6c239266b..08e9b32cf4d2 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -3165,7 +3165,7 @@ cxgbe_media_change(struct ifnet *ifp) if (IFM_OPTIONS(ifm->ifm_media) & IFM_ETH_TXPAUSE) lc->requested_fc |= PAUSE_TX; } - if (pi->up_vis > 0) { + if (pi->up_vis > 0 && !hw_off_limits(sc)) { fixup_link_config(pi); rc = apply_link_config(pi); } @@ -3333,7 +3333,7 @@ cxgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) return; PORT_LOCK(pi); - if (pi->up_vis == 0) { + if (pi->up_vis == 0 && !hw_off_limits(sc)) { /* * If all the interfaces are administratively down the firmware * does not report transceiver changes. Refresh port info here