Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp342657rwb; Wed, 21 Sep 2022 23:41:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5u+N5k95INqC6sb1luhOEm7Q4evmCeC/n+dSo7oA5/G7IFWspJmdPLDDY1iSAOVlorLcSB X-Received: by 2002:a17:907:3e93:b0:781:c99a:f217 with SMTP id hs19-20020a1709073e9300b00781c99af217mr1433368ejc.517.1663828893302; Wed, 21 Sep 2022 23:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663828893; cv=none; d=google.com; s=arc-20160816; b=G9MBdQkcwqT+Snfr7bEPQZ/p8eoW4zSDhN4Futhsyfy38McnGylOT/u+hJ7JuNBwJK NBx4KfOyCttFl2Hz4kR2ZuUUxh0bhOGfTZ5UuMUfsBQ6ehOU/ZlTkVdYgL4io4K89kwL HT8R7awMA4Yc9qRrctTRIWNwYEHmDlP11+zumYqijRUyXGCEdZm5YSwyVza/EEpNU3LC EVPNi8j/Zvrcid7ao92cMOQPNkZ6mewdsQgMQJEiuwNKeapvdrijKNthwPFDM+GIs0aS R7V5duXxzDshpef7wrKBjYCsvqrsd1inTVuFt97wjxmNvV0RO53Jz+z7uI/tbbDcasA7 GjAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=VEUuXH1wJwT7DnWdTGmQ6tvd4zeMna005D0inzt3B/8=; b=hsQicd1FZO3ApF2GqZIKRCSKlLjrXDZ0CHZJJpO76xXiTls811aGbQ75W+YiefrI7L tX8SmgmgKZvATYC2n4ANk+ONzWD3ctG+NuTx2c6giUy+752DcvTtc1+tzGV9QFJJbJ5G Oy6lNJ10u8qETOL6zxvajFLvoKvQoHWn+9k5foeGF9XCWX5LU6cTwK7+asPfevPS+bi5 7r3MpyZovVsaNnRJBLwx3ZCWNXw5CyJAdfTx0ipLya0Iv4DYganBKR9uSzU52MDAmecK UZ0GJpU3ipdBd91biolWs3jdh4PIR3WLroEu6bRmGTys0d0tEbD+KOty40mvicGeFFOI cUBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a170906640300b00780828d3399si4293513ejm.955.2022.09.21.23.41.06; Wed, 21 Sep 2022 23:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbiIVF6W (ORCPT + 99 others); Thu, 22 Sep 2022 01:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiIVF6U (ORCPT ); Thu, 22 Sep 2022 01:58:20 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B74DDB4428 for ; Wed, 21 Sep 2022 22:58:19 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 593C568AFE; Thu, 22 Sep 2022 07:58:15 +0200 (CEST) Date: Thu, 22 Sep 2022 07:58:15 +0200 From: Christoph Hellwig To: Sagi Grimberg Cc: Rishabh Bhatnagar , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, hch@lst.de, axboe@fb.com, kbusch@kernel.org, mbacco@amazon.com Subject: Re: [PATCH] nvme-pci: Set min align mask before calculating max_hw_sectors Message-ID: <20220922055815.GA27619@lst.de> References: <20220920191932.22797-1-risbhat@amazon.com> <871c0e19-9272-e92b-28dc-a50ae705bba8@grimberg.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871c0e19-9272-e92b-28dc-a50ae705bba8@grimberg.me> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 21, 2022 at 11:10:58AM +0300, Sagi Grimberg wrote: > >> If swiotlb is force enabled dma_max_mapping_size ends up calling >> swiotlb_max_mapping_size which takes into account the min align >> mask for the device. >> Set the min align mask for nvme driver before calling >> dma_max_mapping_size while calculating max hw sectors. > > Does this fix a specific bug? if so it needs a fixes tag so it can > go to stable backports as well. Hmm. Basically this is another fixlet for nvme on swiotlb, which already drove adding the max_mapping size and the align_mask, and it seems we still hadn't covered all corner cases properly. So I think it basically has been broken since day 1, but nvme on swiotlb only started becoming "interesting" with the trusted hypervisor schemes.