From nobody Thu Oct 20 15:00:00 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 4MtW3h6qS7z4fX53; Thu, 20 Oct 2022 15:00:00 +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 4MtW3h6JVjz41Zl; Thu, 20 Oct 2022 15:00:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666278000; 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=H/bRerIFq6H1DPO0FYA4D0BT6CGEeFrpaFbFdPFaTFE=; b=FGYWajY/Kl/Ydg7cP97cFW6PCY3jCSBqK4PSj8EBuFfxriZKeCuIZt+LLT6AIZlRd08MMt WTNWL7KfZpWhiM0SQQ/iOYjfH8E8FmHb58aaL2oo8J0CvzW/j6RJ+qSM+/nWiNbtRopw6P 83Er42Z3Dtcl3jvdc8Qu41z28rk0cPai/1qpFIIVzXLEAyGUTyP6cMHoBoYxgA/FjgSuZ+ Xf+mVx02ad170Bi2m2SvfM8XkMcjpUX6CP752vXc7yWJCib7XoJ7PmuhXUSi39Mj8/Ihmw NYvjec09WK4onbEaFoYdQ3tG+c6azhBlXBLKyC39W08vppphGPgETijmTLRcSA== 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 4MtW3h5MJCzvFG; Thu, 20 Oct 2022 15:00:00 +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 29KF007v079680; Thu, 20 Oct 2022 15:00:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29KF00bP079653; Thu, 20 Oct 2022 15:00:00 GMT (envelope-from git) Date: Thu, 20 Oct 2022 15:00:00 GMT Message-Id: <202210201500.29KF00bP079653@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: 956f15e74d66 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 956f15e74d66c7f9cfd35a8ac553c48fb5624b56 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666278000; 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=H/bRerIFq6H1DPO0FYA4D0BT6CGEeFrpaFbFdPFaTFE=; b=JfFC3hiIAFDcz5NMPYqRoxks6UzVuN8sAUrq2SdEVqQjHygxSg8Q9CfaurGzgqZHc3pF/D ObovcnE9Zl2sydIPm21pJyivOxYsXnNBENlnGczMBl7LB6xQk6eD2hDBsfSQafl4esrOfS rJfViBLe9HyubDF6ksi0q9BTW+J5arWRBYHtLTkDu/aw3Jp7pWLMqlHlP9tqVf59A7QjXl 54DjIo4Q8Bl1uksW7dAKDueY928CkpOyx12Gbwe8Nk0bz3rsjTHtO+vaYhju3xQLNjEBqo CmsBpoEOFGrEz5bcCzmS1jeK5o85x48tDez9Qh6DEvL4zdl/v5kFyaxafMtUFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666278000; a=rsa-sha256; cv=none; b=Yi8WZfi00hmwKtopD2lFGhrgNus2/GXsrR+2W+VGVwJc8Z6hmx8DA4CisQoOzDGAHkRLzi SA/s9hr8VVUSJeY8pQTfLM+joReWWPboOvzV8vhy2mp/VHe8FLUO55zuOjI/Jq5QmLscWB /NBDg5xVB30uKINDKp6JGSnKjj0kQ8MMhrtwr0LX/sHe08lSBEphZxKqUfw0rDP9+ryQ4u VuoosiRwj8O5TCBzb0njxNiC7sVqPGH9jQifvh72gSzOcDphwAyZtCXFNzVBJfbLw9gCnM nLJecrLNc1427QOpFLBhAiI6ZWJuPIshUhZrfDlgJ6vX6ucbczgYaRP1qVNAtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=956f15e74d66c7f9cfd35a8ac553c48fb5624b56 commit 956f15e74d66c7f9cfd35a8ac553c48fb5624b56 Author: Kenneth D. Merry AuthorDate: 2022-10-17 16:48:34 +0000 Commit: Kenneth D. Merry CommitDate: 2022-10-20 14:57:55 +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 82e3e552f21e..308c88112168 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -737,7 +737,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);