Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1072504ybv; Thu, 20 Feb 2020 12:37:27 -0800 (PST) X-Google-Smtp-Source: APXvYqza9iK9FJNqS254tI6cPKhNq7Xb8oxml3gj4GrT4JS/GDUmWYGvcGFV8WuOp7BZaZ9iWVtu X-Received: by 2002:a05:6808:611:: with SMTP id y17mr3352711oih.146.1582231047539; Thu, 20 Feb 2020 12:37:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582231047; cv=none; d=google.com; s=arc-20160816; b=O8PWimwoN0FUB9z6QQWlzUaqi8YcFlvNMyndZdIqjo0Q3z+HmNjYcGIdh09PwNxAbQ MJwaZ36wKQhjkJeEnTVe2aYWb5qjU4alvvAi6Z5T5lBI+B1iqtL0NDE2hZcfSzqynMTY FUWO/FeiX7ZA19ceMgHhxwWgW0FKfW/FQ50PhdnsurD5oAiXmc2RsowZvT0P0yCX6n22 +lEwKndfh+olz2nrYjjFoJYVxVJo7R1jhWCTiBFxKMhU56iFUtjsJsS5ScE41sbC7reL Z2j9ir8E77+nhefjWuWvP0IS5roAR1xYFPTg0Dm2C8H/IrRjPDN/DZl+JCl9T9IW+RVl OJHw== 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=QtCXaAj0OH1y6VbjWN0RJVhXT4mdBB4tTB5xd3V8nuQ=; b=ufELW+FwbLa7uSrsjWb29WeNcV+3NGk8ArBzsz+48MIX+gzoVOfrOQNF7dZ7dJIDTd 0c5KRIjfkrN+HycoKHdeVg6rVZPvpG6GUdFp2sje0UfnYC8inGYMplyvkdfA3HYuZRqo EFhDqCBmVymXVww3SutYCdtqH/gcvhFk05IDnEOkYa3hTMP099Kj0gKqD7YbiOdke2l+ Zq1VhAWLdJrHbWufLDwk90hx8sx9qeVpuToAVWZPh74CeYvTe4SJNanaufn6ZJE1mZpP dwL9GhgK+Aad3rRIFyyopsGJs8trgNiMLcSAWQWC03kr0glQ4Q/GUczzsVoR3r7lyDm2 EP8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e126si231325oib.21.2020.02.20.12.37.15; Thu, 20 Feb 2020 12:37:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729141AbgBTUhE (ORCPT + 99 others); Thu, 20 Feb 2020 15:37:04 -0500 Received: from ale.deltatee.com ([207.54.116.67]:45120 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728926AbgBTUhA (ORCPT ); Thu, 20 Feb 2020 15:37:00 -0500 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 1j4sZ8-0005cO-BQ; Thu, 20 Feb 2020 13:36:59 -0700 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1j4sZ7-0006y7-N5; Thu, 20 Feb 2020 13:36:57 -0700 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, 20 Feb 2020 13:36:44 -0700 Message-Id: <20200220203652.26734-2-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200220203652.26734-1-logang@deltatee.com> References: <20200220203652.26734-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 v11 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 --- 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 ada59df642d2..330b05ef1b16 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -764,6 +764,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