Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp722943ybt; Fri, 26 Jun 2020 09:59:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwggCatiiub413IX97Pb6iy+UhIgn7yyTVSkBVTwEhyj+xWr8Va8rjTFthy7ueDVzfet/Nx X-Received: by 2002:a05:6402:c83:: with SMTP id cm3mr4451672edb.307.1593190773738; Fri, 26 Jun 2020 09:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593190773; cv=none; d=google.com; s=arc-20160816; b=jDWbhAVdIH7yr0Gv88mPK855lQaxl4W+zr/9uEJCQDkSO7BU/xVeHSY2TIEsdXK2q6 qFKvl4Rp+hRcRSYcCyiEllrdMIFG3VebJcMMCMDiDGG5ANIdUQFar/mbDpLxhn6AXkA7 QO6BCPVfgxEvQpees1pVk8gvfi1+aG/gsL8HYCAm4C4HOUH0o9bGx/7IO5bOEpa/40Q7 DLulHpY4jtLcNJ3HUJx+TUNy5SFGYSVc6NRlS2GuVLyvL3lHmfslo5zj3KqzbbtscR4y SAQUDWQpNKT98IPEDxBiYGcC4nwSWHHfO6A9KAJbtRQTGsxfqExbB51tPbfY4E3Y6AYD RR1g== 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 :dkim-signature; bh=5c5mOz9cajuSsUfxoXbE66AQfvvJ11lbbLas4S99oK4=; b=g/3ig3Mm/Db7OSZBZL9iNGCC3TTP0A5gBjZwAQNWnez9TTyJxCPjPjjepBoQwNVPXz 5Vo5VMfFx1l40HThZ1zYRVSS/fya6OBZCdvJXKCx/BMGF4yG9nEldHWfx8vf9fUXKIHH vQkX7buX+AIcROCC7TV2CaqSJwgYX1qVWJoJ2ZMPmx3PI9tA4r38+ywFytDSZKG2/wn4 aqzkWsUGjGuOOGdHvCIWUMmZwwjNRdgkt8UHEHk/0YnhfjQBhsTXH5pPCWC7p1siRWXd A6YWzF0VpTEkN+27m+7GbFJQoSSobKB3gkKpSA1m6e+UnuReXx16OngUxvvOazDji0jY lojw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@deltatee.com header.s=20200525 header.b=IJ5O901n; 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 v16si12394618edr.93.2020.06.26.09.59.11; Fri, 26 Jun 2020 09:59:33 -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=fail header.i=@deltatee.com header.s=20200525 header.b=IJ5O901n; 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 S1729705AbgFZPjf (ORCPT + 99 others); Fri, 26 Jun 2020 11:39:35 -0400 Received: from ale.deltatee.com ([207.54.116.67]:34826 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbgFZPje (ORCPT ); Fri, 26 Jun 2020 11:39:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5c5mOz9cajuSsUfxoXbE66AQfvvJ11lbbLas4S99oK4=; b=IJ5O901nujje0Q3D3dF4tdpJC1 f+WAvAV+p2x9ZEwj1bGNsemBR4WA5eDIKCF9+Nhja36ZBPsNu0AAEkiNcM0sKvYPFcBnA3yEcKCaM QaOq1ARjPwjNjZwvmeG6jFz4ANNkygi9ziVkZarAyz5PimLcU1HnhQLO9XhulTOwY5UGKFa0As0vt 1PDXDfZLXZ4krrxnU49oHUoQNehJA6ubTnluQvEw6AYKy8ljLPsJ3eN04I/X/9ZWFMIu7+IpFNDGb RrCMN92enxZ5qyNizblxuC7Dc5wTErUDhozkstq/lcsad7xElfW+cNZGshT+utLyILVkhpp8Z+Hly x4rVDcCQ==; 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 1joqRu-0000oO-45; Fri, 26 Jun 2020 09:39:32 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1joqRm-0007HN-QP; Fri, 26 Jun 2020 09:39:22 -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: Fri, 26 Jun 2020 09:39:10 -0600 Message-Id: <20200626153918.27929-2-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200626153918.27929-1-logang@deltatee.com> References: <20200626153918.27929-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 v14 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 c10e44873e96..c0f5d82f2c3d 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -752,6 +752,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