Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3809808ybz; Mon, 20 Apr 2020 09:50:47 -0700 (PDT) X-Google-Smtp-Source: APiQypLKbFDh9TIUvC85S51TE4q38k7h76iyGopa1GODKCHUgfHHxjSoVcjNsx0DzST5gNQTe05u X-Received: by 2002:a17:906:d04b:: with SMTP id bo11mr17252979ejb.20.1587401447110; Mon, 20 Apr 2020 09:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587401447; cv=none; d=google.com; s=arc-20160816; b=gyyl9NLLKmIdPIuOOLlkkhJG50SjPmdkVijJ61qKS03Qr+TH/5M/BiDtYmpISK0dH9 Xr+kF/rMKp80taXmsAHhwpObZay6NtDvWcm1alWf/i7RMwXXhQvsuJ1BWIbnxCX35ksb 1NQOHhdo/BsTEEwslcH7HnlCghkEwtaFqVf9lG1a5Nb5LizVAlagL7gt1wHfqhGOQZqo zHj8mfyTraI1LlcVWqGXPQGDHr079Bg+s9ln/tH8Vv5ws6WkKwi+0DjMdVpe6du+wsvc bLvhqf9D2sR64lFwGKegPLFQILfxxPjQaz8yq/VIbhOqjQFvHkp2qzL/sBw2MxlXqp+t FcSg== 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=CZrFP4u+AQQBFc1fHW4MDDX+bUIauJsYZRie0ZY622I=; b=tAM2na0DC41cO1jsLXKqfDhZAQJa/uX3o+22i3dkcXnyKRzIB8Pz+IURiMPwWa3EAv r228Kli7Ts646cyEUiyABlit6WedzoJNqQhurSrlc2Ux53Dl3pUnVAaTR0aCiSi3Jato 5eT58Ctt22k9dTtq1E1EhxAArLBdOBMpbpNgSXYaPynHWBMm3KqcLMdHdD5GDbwNoFIA hqy14J0BEWXrq+ORYTG72zNsiJ0/8bnJnMMGgERCxaoO3CdnaKlnAuE6Nr8MvYpcGzbj RotQmJ193YDgM75/cvFuJu+mSfDMaklDMqy4O5d+yfaeZ2J4TNCqSaWAMJWQPLJGSg+H B5eA== 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 bi17si878610edb.370.2020.04.20.09.50.24; Mon, 20 Apr 2020 09:50:47 -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 S1726492AbgDTQrS (ORCPT + 99 others); Mon, 20 Apr 2020 12:47:18 -0400 Received: from ale.deltatee.com ([207.54.116.67]:43056 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726024AbgDTQrN (ORCPT ); Mon, 20 Apr 2020 12:47:13 -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 1jQZZb-0008F1-BL; Mon, 20 Apr 2020 10:47:12 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1jQZZZ-0005dc-RX; Mon, 20 Apr 2020 10:47:05 -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: Mon, 20 Apr 2020 10:46:52 -0600 Message-Id: <20200420164700.21620-2-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200420164700.21620-1-logang@deltatee.com> References: <20200420164700.21620-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 autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH v12 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 91c1bd659947..f5283b300e87 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