Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp142693rwb; Mon, 28 Nov 2022 18:17:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Vsh2XV3EbHFYWADkjg8aECadXCnEy71+I5ILoDM5fZuHoOdnNRR025+0m3XG68/PI/wn9 X-Received: by 2002:a63:1a07:0:b0:477:cb5a:ad48 with SMTP id a7-20020a631a07000000b00477cb5aad48mr21499070pga.63.1669688230631; Mon, 28 Nov 2022 18:17:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669688230; cv=none; d=google.com; s=arc-20160816; b=HqcbV0fIwumMuVlUsqx6Vb5w57UWLTnITKUQszfFPkSZSAA9QzP4RNZ1izzgztLV61 kiGFeSDYhkKux9T2mAsu9aU3JQdu6iPV+7LWJxJUfQych7F5YGBmISVSoqKC7BIqTnKT m5ZzaPY8KyaXzXE7PvNWXz5MwnA84wrviaPrLRx4xQd+SWUyBzfVO7ZNZ3xEU2O7hETF JP7zaBkviPR9raeJ7B+4yyGYwJNDqSk5jcD6KyQ9BM4SVBV6a3z4p3+p506P809jCKlO 8vI9wqjG1tq+3mUZxMSQxIIp5KLAzl+hoJRFKC4lpsfDfeqSQ6mALHBaBxM0ENfzflvz A20Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=usZUOMkU9Ty6JJAzRqT6r6+tEKYrvZxUQ4t0B2SRfAQ=; b=GaCBzuwI+99GaSdUpaQLILGl7CplOxvv6VE4unJUOHv/dlPEYWA0JPngqIFP10QxPF eUoGQKRwcAhHTLuPdsYfkycMzEOycgh9MHX+gNnNcp9ABS8hUIfLG2GNcdwuQ8mMqwmB ZN2DilQFT9DcNTk9c60422XkyC9Dc10Yqgt6xhLMgFHG1cLcVd+qp0ogBh0ohu/BxJyW 6Rsz2ER/ppY2kyPkVv5xlzlNVdl2dQQHJBHsNhELkjeeb3eG1Ivkr1L2/2jVQRWqOumA NCOcqqZx2M9Ls397hFJbGBlSyjPSHyRmo4A8JRZ9PktThXGIe1AOzpmq6QYBOUtspX7W PCgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WI+xdAMF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a635842000000b0046f51cbaf53si13710695pgm.529.2022.11.28.18.17.00; Mon, 28 Nov 2022 18:17:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WI+xdAMF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234816AbiK2Brc (ORCPT + 82 others); Mon, 28 Nov 2022 20:47:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234851AbiK2BrY (ORCPT ); Mon, 28 Nov 2022 20:47:24 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 739E542F49 for ; Mon, 28 Nov 2022 17:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669686443; x=1701222443; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cOMinmP7YwLoFZtj6w7noAJ/JiJuR8Y8SegQlnLGlQs=; b=WI+xdAMFokhtvEceetlMLtkQG8vrfS7A3KDT9CYLckKdaHG8Jn6zEkWZ GfXpvsa1hwFz2qU1bVdBdmOCkSQwBywPDSh9EooFThb+wvhJuKOYeBE/s mN/zO70ILHmD9UvZnBYY0/wOtg0DrEpN1RPvlgFRVw3Ww9FnCarYGPTJt pZA2gOae8WgpJLtRUC+IfQs5fWU4NvhkSu4TNaSDbO0pQkq8lplOezqg6 DmN34FXpbyEqqCFJhhrUCHC9eC/h0lkM4paW22MwSvjA7BOGquZ8rwely +HX3h80zeCUwy3gydp5/0F82JYXFzulgj41SxToBE7TjCyGlkqtUVSTQp g==; X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="315024945" X-IronPort-AV: E=Sophos;i="5.96,201,1665471600"; d="scan'208";a="315024945" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 17:47:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="768260495" X-IronPort-AV: E=Sophos;i="5.96,201,1665471600"; d="scan'208";a="768260495" Received: from leirao-pc.bj.intel.com ([10.238.156.101]) by orsmga004.jf.intel.com with ESMTP; 28 Nov 2022 17:47:21 -0800 From: Lei Rao To: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Lei Rao Subject: [PATCH] nvme: clear the prp2 field of the nvme command. Date: Tue, 29 Nov 2022 09:47:11 +0800 Message-Id: <20221129014711.91305-1-lei.rao@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the prp2 field is not filled in nvme_setup_prp_simple(), the prp2 field is garbage data. According to nvme spec, the prp2 is reserved if the data transfer does not cross a memory page boundary. Writing a reserved coded value into a controller property field produces undefined results, so it needs to be cleared in nvme_setup_rw(). Signed-off-by: Lei Rao --- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index da55ce45ac70..332367b66fbe 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -891,6 +891,7 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns, cmnd->rw.reftag = 0; cmnd->rw.apptag = 0; cmnd->rw.appmask = 0; + cmnd->rw.dptr.prp2 = 0; if (ns->ms) { /* -- 2.34.1