From nobody Thu Oct 20 15:02:37 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 4MtW6j4ldWz4fXdF; Thu, 20 Oct 2022 15:02:37 +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 4MtW6j44rKz42Fy; Thu, 20 Oct 2022 15:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666278157; 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=iwCb1hPd/jj8OCNCatF2ti13kyABnq+fNaUtHE/g/S4=; b=WBFZrPnNl1MIoAKcy0tg09KoGdP41OavFRoXFIhQBcNvQRnW/P5ccEPyK7COKSFl/b16mR 8vGuUHjADiTlyve/Kd0n00UiBVico7TxKTHyHdYuL/3T778FTbnEA/yssIjTWAoqPZLG02 rn04CTdkYJHBppiX7/QL4mVLWwas+bTeEwpi2y/AWyJ9IyZ8H/7sOp6y4k6jb91LgVdIuP ZJIvQ6d6SudlNl/C0LpQzT2w4U77HiYq0s5IIoIl2+QPzJSkmfn2caWstpsU1qQTnZ255e NlmXWzebQdBbpcMj9Qa/9rhPbF0GoqrGccZ8GRwGKPtZD6I9AYYt74goYJheLw== 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 4MtW6j37f0zvGH; Thu, 20 Oct 2022 15:02:37 +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 29KF2b3Y090316; Thu, 20 Oct 2022 15:02:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29KF2bN3090315; Thu, 20 Oct 2022 15:02:37 GMT (envelope-from git) Date: Thu, 20 Oct 2022 15:02:37 GMT Message-Id: <202210201502.29KF2bN3090315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Kenneth D. Merry" Subject: git: 2edc70060d1e - stable/13 - Fix mpr(4) panic during a firmware update. 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: ken X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2edc70060d1e0f75eb975b4318345343600852d8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666278157; 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=iwCb1hPd/jj8OCNCatF2ti13kyABnq+fNaUtHE/g/S4=; b=psVIG1ctuZ/lTckMcJ7jqH2IgQ9PPysWGF+D5obNLARLes7fvr/InwGgkrQUwo0NuImccq GItU3ydLIhUm1dpqXoVfflVjr9PGBgxQg7RzP9ilpCGvSWKLRBzUXZQSJWpQA0LeYCPOUx efFwfuhgCAa//gbmYR/speGqGb0dlOeGhSUjIl+U6jViaUm41HzUwTwQbCtZkOwOVV+eFD JDZ/End8qfu2bEQravozrlSgBApHWrBiCdVw8NWV+Zt7HWFdxDFMi2dpmLR7DUKCSzbXpn 64X8pOeyJO4Z6Kwtq6sDF0kyK+IzjhzefNpdsDhGb8a1gAAhgaYcL7VixzfteA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666278157; a=rsa-sha256; cv=none; b=frHFfIMYzONLWd93C9+FjGIa/+d0KoK4yisTbg70ozsvzmFeru0xR/6Ikp0VWrtpxWjI89 DOVgEifh5alyiEyoJhMPPzHPU3B3dgojVLVHfb3oB3NxxiY/EqiY88O/qyzSLQrMVTHRtA dnRExnmVclNDY7qXWJnsUMYksxPi/EKIKMzK+A7PJP3o4k3UGJwW7t9/lI/weB5UOctdQ0 VAtTEXvPHz4yzMORa01+iEHTh4IXREQ4FRT88vl9ROLrjTGloKcrGCpUATvTrrqTSWR2Ak pWIlUoTTvJ17Qwq0MdcxrfsBxm+1W2IDiVhYI5iXoj2MQcJMhzmym92KU4cH4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=2edc70060d1e0f75eb975b4318345343600852d8 commit 2edc70060d1e0f75eb975b4318345343600852d8 Author: Kenneth D. Merry AuthorDate: 2022-10-17 16:48:34 +0000 Commit: Kenneth D. Merry CommitDate: 2022-10-20 15:01:03 +0000 Fix mpr(4) panic during a firmware update. Issue Description: The RequestCredits field of IOCFacts got changed between the Phase23 firmware to Phase24 firmware. So as part of firmware update operation, driver has to free the resources & pools which are created with the Phase23 Firmware's IOCFacts data (i.e. during driver load time) and has to reallocate the resources and pools using Phase24's IOCFacts data. Here driver has freed the interrupts but missed to reallocate the interrupts and hence config page read operation is getting timed out and controller is going for recursive reinit (controller reset) operations and leading to kernel panic. Fix: Reallocate the interrupts if the interrupts are disabled as part of firmware update/downgrade operation. Submitted by: Sreekanth Ready Tested by: ken MFC after: 3 days (cherry picked from commit 11778fca4a83f5e3b597c75785aa5c0ee0dc518e) --- sys/dev/mpr/mpr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 0f4c5c906216..6f54b1f57950 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -740,7 +740,7 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t attaching) * XXX If the number of MSI-X vectors changes during re-init, this * won't see it and adjust. */ - if (attaching && (error = mpr_pci_setup_interrupts(sc)) != 0) { + if ((attaching || reallocating) && (error = mpr_pci_setup_interrupts(sc)) != 0) { mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Failed to setup interrupts\n"); mpr_free(sc);