Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4617819pxj; Wed, 12 May 2021 09:20:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0jN3CYVZLHrE9Dhqe+lk0hGJ80IwpM3RotPzpnzVowwv2Oj0RJ+wuNV9rRaf5Fj0cHDyV X-Received: by 2002:a17:906:914d:: with SMTP id y13mr7604709ejw.489.1620836426053; Wed, 12 May 2021 09:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836426; cv=none; d=google.com; s=arc-20160816; b=YEoa+EgxltEtHugNAOPuD/+R4u3SkyFWKoZSUPnsAHrpVugf6V6ZypErNXteppi7I8 VaI6wiVGQPq2yAfvHGBN9SOIpDu/gld4rJ+kxtUiOLGvEd23iuVpK2a0AfnQiR9Dfbfw PpuxIKAJnUkmF5dHrBQmBJkU7qB13l8pnBHPH3FAjZfNgFzQ9N4wjWIkQaUkmrBrIc0D 2pHbj/r1Zfrg2YFSSE7cm/YQP6HYPLnn5JxNvD8Avfnm0omTTFxoClLe235u8mrvZs0Y wclBBnL0UzxDcEDsA0TVxXVuTCUAQ0WuqCb65IL/VqPd7N1R6m40PGtcTQtkfpv2NKNS GZTA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Z8WSZ6KnZ0xSegnyLbg8f/CZMLludl3dbEQ9zQdBXhI=; b=xAHGdAQ+pqHpVr8ED5DAFvPSJs9kgrYX2DzfrWHTcHn4yYZ32mri8vGMpj1hNzm1Qf N0361ogKQQEODe7kFqiNMID3pqHSA30YK8VXxbl3KBXaPjF2P+bjQWxOz4q23WCrVr4f 7AQfsr9es0yZ/Ckzea5RGruiawBe0DvdKdqWzYbFemGgStcn74y/PhvHybwQS2zlIQpM l7k6QsO4FyHS3dthIZh9GDCus6QcHO3SRhJ0pTa+X9ijnpyIch3qGaFB7kIeLdzq4gXD Azivy+pMnEhttqmjmZliWYIgjgn02tjbSWqop/RuGsdKpsaZCQKz2D9nPCfQX0MNHj0T Xarg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Adyd6+O7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kb26si378996ejc.352.2021.05.12.09.20.01; Wed, 12 May 2021 09:20:26 -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=pass header.i=@linuxfoundation.org header.s=korg header.b=Adyd6+O7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238167AbhELQPH (ORCPT + 99 others); Wed, 12 May 2021 12:15:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:50038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233946AbhELPbw (ORCPT ); Wed, 12 May 2021 11:31:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0B2D361958; Wed, 12 May 2021 15:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832581; bh=i66NaLw3/86HD+UUp8BgJWUhyz2LXWq1sz5dqkJiVSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Adyd6+O7rVtyXpygVPr+FrnhjhC/x0sEL/dg01x77V8/bKXYciLFtqQS1XmtAsYmd M0vVh6RbyOERgFfUJvtaWZ//eelWOXinC0MvGNfsg3U76tcKIDs71vT/8vAicedQq+ ZobwiSFrxMA3Mtc+1GJQSYSSeDA1OKKsai9DaBew= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.10 339/530] nvme-pci: dont simple map sgl when sgls are disabled Date: Wed, 12 May 2021 16:47:29 +0200 Message-Id: <20210512144830.938015593@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Niklas Cassel [ Upstream commit e51183be1fa96dc6d3cd11b3c25a0f595807315e ] According to the module parameter description for sgl_threshold, a value of 0 means that SGLs are disabled. If SGLs are disabled, we should respect that, even for the case where the request is made up of a single physical segment. Fixes: 297910571f08 ("nvme-pci: optimize mapping single segment requests using SGLs") Signed-off-by: Niklas Cassel Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 716039ea4450..c1f3446216c5 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -852,7 +852,7 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req, return nvme_setup_prp_simple(dev, req, &cmnd->rw, &bv); - if (iod->nvmeq->qid && + if (iod->nvmeq->qid && sgl_threshold && dev->ctrl.sgls & ((1 << 0) | (1 << 1))) return nvme_setup_sgl_simple(dev, req, &cmnd->rw, &bv); -- 2.30.2