Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2722230pxv; Sun, 11 Jul 2021 23:50:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEJQnUtrmh1Vw2vbQ+3ojleQoYj6qtKxobmnIUXz3XsfWQ7tfXgGalxYo80H8UdpcCbFZK X-Received: by 2002:aa7:c801:: with SMTP id a1mr35838035edt.293.1626072656453; Sun, 11 Jul 2021 23:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626072656; cv=none; d=google.com; s=arc-20160816; b=mfQldzmiIsG2daF2Jsxa6vRH7UT0/1Y3+09HeXOs3LRZtSWe0ytTeOQh2L2xXDkQFy 9zoNOwBHnvSGhJks5XR/OygxfG2sY/Fgokvs1QxqEY9iE1kWr2HLeTHqIe5IF1h+sEaD KpVnzalzxfuYxMSFIuxiNQXbZx5kc01gT0P1KgvAx1pgHx+uLXL9cb7vpRo6lA9EDQR3 KPlDct0WiorZlrYJjpMwpvQY1H6f+OBfT76eLsmLuCW9Hg15O5TX74pVaERP0jIEUb1q vgqvMuYBfn3jz1pKE8FrXPl2N4XgnBDPcGUJhf1VVhPRTPHBJ7ykddoVLDNYAz8LwUZO Wb/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FCL4+xKy8kH2nZOVRceHTlnODtV1xuysIwyMVjgVgV4=; b=m65MUacPyAUqsuFmtL1QgCRC0YKidCJbBq5QI6v1mLyj1mRqzoGYgLsSZi5FWV0X7k aopNol1qyz4fLrTwB8ZOZAuZbmrU7VrGol710o/xntDFeLeEmoCRI0ileqRgQ2G9bDFb cJ6sNMtsVsdXbvbZl0qleYeFnpRShKOPHsxCRSTzCx9m1CqduFjf+6F0q8IsP4IGIQ9e rc/GbhIqkC9D834inOKhtPuuZvTO1Rj5A8l6vJrY1VUaEoYvu1UgVAlTdz5Ko9e+B7UO kTOvH/+Oj9PgLFz6Yb0YVzldCGA8WdxHEKxz+NJxFqKIgq89lSgbYVQFtD73a9/NVRGb weMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l0XEfV0N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si16171998ejb.712.2021.07.11.23.50.33; Sun, 11 Jul 2021 23:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l0XEfV0N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239241AbhGLGte (ORCPT + 99 others); Mon, 12 Jul 2021 02:49:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:34338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237792AbhGLGjj (ORCPT ); Mon, 12 Jul 2021 02:39:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E1D226113E; Mon, 12 Jul 2021 06:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626071726; bh=P1wCF5MjMasoUsUhzJZ3trQHMHTl86FvkoaoOo0K928=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l0XEfV0NqBkXaoUjQBrG+AwoVhs0JZs/TszJwyfV9nxWs+eD0NwMSCi5WhWuL76yh 8v67lZmQh8OFkwsNJBgu1CHZQpt+TFhVGQLuW+6AyWh9pEnh44WGUSeUUAXvl2bSwL kh+LBAC2j8aXUVgGilD15RVw7oU3MLzOEOVJeVlQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, JK Kim , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.10 192/593] nvme-pci: fix var. type for increasing cq_head Date: Mon, 12 Jul 2021 08:05:52 +0200 Message-Id: <20210712060904.133790591@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060843.180606720@linuxfoundation.org> References: <20210712060843.180606720@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: JK Kim [ Upstream commit a0aac973a26d1ac814b9e131e209eb39472a67ce ] nvmeq->cq_head is compared with nvmeq->q_depth and changed the value and cq_phase for handling the next cq db. but, nvmeq->q_depth's type is u32 and max. value is 0x10000 when CQP.MSQE is 0xffff and io_queue_depth is 0x10000. current temp. variable for comparing with nvmeq->q_depth is overflowed when previous nvmeq->cq_head is 0xffff. in this case, nvmeq->cq_phase is not updated. so, fix data type for temp. variable to u32. Signed-off-by: JK Kim Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index c1f3446216c5..56263214ea06 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1027,7 +1027,7 @@ static inline void nvme_handle_cqe(struct nvme_queue *nvmeq, u16 idx) static inline void nvme_update_cq_head(struct nvme_queue *nvmeq) { - u16 tmp = nvmeq->cq_head + 1; + u32 tmp = nvmeq->cq_head + 1; if (tmp == nvmeq->q_depth) { nvmeq->cq_head = 0; -- 2.30.2