From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E1E8E3B1B16; Sat, 28 Feb 2026 17:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300312; cv=none; b=mzjBweF7ExaT7E4D8EVj67QzqO58JHdLbQFrgNc7+5M39V5Hd5pWsckV0HrvPrySo4yhrwfTCURNQg3KMM/1Q8lKywKLQtnC5F4G4ycOsEZLV0uUXbhPgndYd3OYupRaEm6L/wSPnTnqTRf6LIY9ARnKkPK2ZmCgTI5ZJNewtLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300312; c=relaxed/simple; bh=1lQuTfa/eJydjZkTVhAkq5sataUOWFIScvI3T0Fsi8I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tre+ZMKN+ZZVd1AzOVe9376OZ3dzKvSijcKz5tBQ8kQMWhYF1OSVd1akccEVNWfg/RhXzU39HOY2JYogJ8K0dYkQv2/2uJOqIqXtE/70EKO3RCT++QFVOPC0tP9USYc2ZW1ZyhzPqwBoSnDWN4H8drO1Sv8Ux6MVoNgAVU5y/Ag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XKrI1+Vz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XKrI1+Vz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F847C19423; Sat, 28 Feb 2026 17:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772300311; bh=1lQuTfa/eJydjZkTVhAkq5sataUOWFIScvI3T0Fsi8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XKrI1+Vz4Div1Bl+8TiadwS4ZjOdmW4L/FOqUFUWBej5isGbeTXy2x+qmjqyO9aSt z+UhtxcAFc6cXE1h00jyF4HFrGhrUpzwvN7N4AS7Iyr7kvka/N0T9dafbkRx+eHlTs HXyCcubtSd/eMj60SqC7uepfXVw9uYspq42Wu0TcOr23Uo+7Dz5jrxeT1T1YpEpfvD 2JeyZbYsA/tfikUPbIRAAxHEG1h5eN2OQaUpy0VoSxE+IuUGrh/2Y2oAqoe5hyHpzy /JgFT+rspK5JvhyJD/KYWpAmQodczAzRQnuxnM7UwdxLjkQN9mTHyzzyEGSxGQeqS8 RqHjSlHQNtkJg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Longfang Liu , Alex Williamson , Sasha Levin Subject: [PATCH 6.19 342/844] hisi_acc_vfio_pci: fix the queue parameter anomaly issue Date: Sat, 28 Feb 2026 12:24:15 -0500 Message-ID: <20260228173244.1509663-343-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228173244.1509663-1-sashal@kernel.org> References: <20260228173244.1509663-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Longfang Liu [ Upstream commit c3cbc276c2a33b04fc78a86cdb2ddce094cb3614 ] When the number of QPs initialized by the device, as read via vft, is zero, it indicates either an abnormal device configuration or an abnormal read result. Returning 0 directly in this case would allow the live migration operation to complete successfully, leading to incorrect parameter configuration after migration and preventing the service from recovering normal functionality. Therefore, in such situations, an error should be returned to roll back the live migration operation. Signed-off-by: Longfang Liu Link: https://lore.kernel.org/r/20260122020205.2884497-5-liulongfang@huawei.com Signed-off-by: Alex Williamson Signed-off-by: Sasha Levin --- drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c index 8a05fb91929fb..2b8ac97cef2d2 100644 --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c @@ -426,7 +426,7 @@ static int vf_qm_check_match(struct hisi_acc_vf_core_device *hisi_acc_vdev, ret = qm_get_vft(vf_qm, &vf_qm->qp_base); if (ret <= 0) { dev_err(dev, "failed to get vft qp nums\n"); - return ret; + return ret < 0 ? ret : -EINVAL; } if (ret != vf_data->qp_num) { -- 2.51.0