From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77EB1384230; Sat, 12 Sep 2026 15:30:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789227004; cv=none; b=car9tm10Uyc4e0+7EnTYx7umFA3rsRioAmDn40klOE5yQN7Kb4YbZLD7Y6sjjQcCNEwSd8NkLD7bgjUbVdpdYbM+5BKz7brGKIN91Yvs9h94/nUPhIeUNV191D+GslYEtlUaFcI17bnmfr2Fz/lTcFqmoXZoKU9zmJHF1CelozE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789227004; c=relaxed/simple; bh=AcZ2Y3U8z+kOkbmdCmksnfDQJ9BMd+UsX+a4vG4vWuQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S/y1kNr/mD0jUJ8Y+JAZd0VdgwfvkGzVbmGXOBuqqIRmZvzamJS+vczUqZ0Guy6Fm2ZCFwAJ6VFyamQgFJ1rqFo0gEXNH9GmEHDEXM2mbmZUIozTxlYTClNfbRc624Ga5JqMed6gO1ARkrTkUn26MuFzFRynWBzQLMJ2w8Jw5ng= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Zq+J71UC; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Zq+J71UC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 947B91F000FF; Sat, 12 Sep 2026 15:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789227003; bh=AsEeAi/jbeZMHs+DeV1jEU6Dbxzom0qLI1sjSiumfC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Zq+J71UCusjR+BhAckeD97mxDJHhGr1jtfxjzZgkfjhVhLsn9Usi4mrH7gQtXduGT 9MLmp6MgrBT6VOFy+KwB4iq0lcBb91WxfyiXtkI3AK+QXcDGVyGVpM8AfOehOrJpxu +XO6tDjuTva7VSldSk096CyLvRWp86Gmym8DS/xo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tien Sung Ang , Tze Yee Ng , Xu Yilun , Xu Yilun Subject: [PATCH 6.1 0091/1191] fpga: stratix10-soc: Fix SVC mailbox handling during reconfiguration Date: Sat, 12 Sep 2026 08:46:59 +0200 Message-ID: <20260912065550.222484266@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065548.086904252@linuxfoundation.org> References: <20260912065548.086904252@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tien Sung Ang commit c14a8b15c87b49efc3ef898cec8ac7c30336a080 upstream. Fix incorrect stratix10_svc_done() usage during FPGA reconfiguration. Do not call stratix10_svc_done() at the end of write_init() on success, so the SVC session remains active through write() and write_complete(). Call stratix10_svc_done() on failure in write_init() and write() so the shared SVC mailbox is released when reconfiguration aborts, allowing coexistence with other SVC clients such as soc64-hwmon. Fixes: e7eef1d7633a ("fpga: add intel stratix10 soc fpga manager driver") Cc: stable@vger.kernel.org # 5.1+ Signed-off-by: Tien Sung Ang Signed-off-by: Tze Yee Ng Reviewed-by: Xu Yilun Link: https://lore.kernel.org/r/8768ce3260489c9febdfce08e27d03f5f5ed9c33.1782801986.git.tze.yee.ng@altera.com Signed-off-by: Xu Yilun Signed-off-by: Greg Kroah-Hartman --- drivers/fpga/stratix10-soc.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) --- a/drivers/fpga/stratix10-soc.c +++ b/drivers/fpga/stratix10-soc.c @@ -194,20 +194,18 @@ static int s10_ops_write_init(struct fpg ret = s10_svc_send_msg(priv, COMMAND_RECONFIG, &ctype, sizeof(ctype)); if (ret < 0) - goto init_done; + goto init_error; - ret = wait_for_completion_timeout( - &priv->status_return_completion, S10_RECONFIG_TIMEOUT); - if (!ret) { + if (!wait_for_completion_timeout(&priv->status_return_completion, + S10_RECONFIG_TIMEOUT)) { dev_err(dev, "timeout waiting for RECONFIG_REQUEST\n"); ret = -ETIMEDOUT; - goto init_done; + goto init_error; } - ret = 0; if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) { ret = -ETIMEDOUT; - goto init_done; + goto init_error; } /* Allocate buffers from the service layer's pool. */ @@ -216,14 +214,16 @@ static int s10_ops_write_init(struct fpg if (IS_ERR(kbuf)) { s10_free_buffers(mgr); ret = PTR_ERR(kbuf); - goto init_done; + goto init_error; } priv->svc_bufs[i].buf = kbuf; priv->svc_bufs[i].lock = 0; } -init_done: + return 0; + +init_error: stratix10_svc_done(priv->chan); return ret; } @@ -341,6 +341,9 @@ static int s10_ops_write(struct fpga_man if (!s10_free_buffers(mgr)) dev_err(dev, "%s not all buffers were freed\n", __func__); + if (ret < 0) + stratix10_svc_done(priv->chan); + return ret; }