Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1498500ybk; Thu, 14 May 2020 10:25:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJLAniJzQ3YmZPXligi2RtIoUMIa5zHXgOAvMFIJR1bJ4MAtwxqv3F4hXRqdy+UhSVUNjv X-Received: by 2002:a50:fc04:: with SMTP id i4mr5129477edr.236.1589477103478; Thu, 14 May 2020 10:25:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589477103; cv=none; d=google.com; s=arc-20160816; b=ZeEhVp3lO8qcGjE7A0gse0/ViAnLEa5U9daiCYBiEMDPfR+IxlnWCkLBa0dlVFQA9s FsKjxziWqsTUlY7h1UpcASA54zf41wc/xmudpW7hh1cqwDcpn6toz5ftY1nW1qZU5ESG plD6NGc84/mRUzgHxz1k0Des7kKkmlVCZNN0BqpnKXJ41q7EsNafmE6K18h6xlByW1gC U6p9LBuxVDcQsNcY1Gxi+UelBHAS9ZeqbXaavhARALITLDLbK4u4IK6knx+w31GAierK qRD9/Nk4xPq0vF/UzhEl+Rz7cFck71mbjpTGibF8+YIDySH+a5Bl9q2Ylgx6IKVyHqdp ujWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=YjaeP1YuO75n8REWp2PGU3NDd6TGXLEe8CLGvX3zlS0=; b=bQILkkZxSUenJHNyGvjYo+kR0mXR1/l+G/CG3mDXQ9dw1DTzxsGOVH7Iqmgbs23y/u gK0I/ge/cK5EtH3L6UjIy36cSOaZr4Z8e051CXUwef4yLFJ+LR0+pFBp0z1EP4lBvrRS 0dJPe3efCK6KjTjsssC6dMypB/vr3BnhmFDA3mC17mmhhu5yI1qyN6gH+exU85XqqzpK 3Rvgp1SF6siYIwVFmuk8ULTLeM65Dw6j22pIGo2OFHZ1iooByReobmJa768sj+vRzKdL wK2zz+9l9Yf4KZmZo25X8oBWxPhABtDNJaysSRfKYg6bjyLg4KKdvKIlEn1rx8fUn5ZS CCGg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si1850549edt.222.2020.05.14.10.24.39; Thu, 14 May 2020 10:25:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726192AbgENRXP (ORCPT + 99 others); Thu, 14 May 2020 13:23:15 -0400 Received: from ale.deltatee.com ([207.54.116.67]:46930 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbgENRXM (ORCPT ); Thu, 14 May 2020 13:23:12 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZHZV-00021i-Ty; Thu, 14 May 2020 11:23:12 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1jZHZU-0001gr-6D; Thu, 14 May 2020 11:23:00 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Christoph Hellwig , Sagi Grimberg , Keith Busch , Jens Axboe , Chaitanya Kulkarni , Max Gurtovoy , Stephen Bates , Logan Gunthorpe Date: Thu, 14 May 2020 11:22:45 -0600 Message-Id: <20200514172253.6445-2-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200514172253.6445-1-logang@deltatee.com> References: <20200514172253.6445-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me, kbusch@kernel.org, axboe@fb.com, Chaitanya.Kulkarni@wdc.com, maxg@mellanox.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH v13 1/9] nvme-core: Clear any SGL flags in passthru commands X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The host driver should decide whether to use SGLs or PRPs and they currently assume the flags are cleared after the call to nvme_setup_cmd(). However, passed-through commands may erroneously set these bits; so clear them for all cases. Signed-off-by: Logan Gunthorpe Reviewed-by: Sagi Grimberg --- drivers/nvme/host/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index f3c037f5a9ba..d22859543e4b 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -756,6 +756,8 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req, case REQ_OP_DRV_IN: case REQ_OP_DRV_OUT: memcpy(cmd, nvme_req(req)->cmd, sizeof(*cmd)); + /* passthru commands should let the driver set the SGL flags */ + cmd->common.flags &= ~NVME_CMD_SGL_ALL; break; case REQ_OP_FLUSH: nvme_setup_flush(ns, cmd); -- 2.20.1