Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1004149rdg; Wed, 11 Oct 2023 11:20:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdXQUVFRVLSCdGlLO48DycyhX4tK+S4ybUGHFs+GDcm+H1ZlODgZi4dW8MuP26eLKhRa0b X-Received: by 2002:a05:6a00:1a92:b0:690:bdda:7c35 with SMTP id e18-20020a056a001a9200b00690bdda7c35mr23133200pfv.1.1697048410333; Wed, 11 Oct 2023 11:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697048410; cv=none; d=google.com; s=arc-20160816; b=IfN2ByK/DJ1VAgKXkzLND3p7sr2UiRW0jOjxftgotYARa6SbAX+egRPN6G7G7Pu/dV TdYSjcrGfGrgMntiOAk/zHX48IzVkQGVoABzS5teLu429wxmpzb+BFf1W1NCd1szwWKo rAySBjY+ub7bcG3zIpZ47bfrsfxv2wD0CEddJa+Zp64cjF7MjuvqEUVt2IJFgLhmBCd/ z4cQApOIp1r5/EnfHKb/fkw259qtKpOX/AA9/KvQ3+GPHr8J5TCc5VoLjX2/saBnHaWE 6b/O1bMxwSBa1IfDbUUB2hTrmelSxAp5okF8MeZ5EuYm1D0yFvpKVSnXCuGATSO6yHkZ dQEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NCX9re7aICe0lXbT2FhNiZpq5p9UZrMjxF3xq3TVI7g=; fh=Hf94CPEcQq76M2ch+b8La29OPrSUi0Ui1S7VhMQk0Sw=; b=CX35LmZvnw6QLK+sKgiw421SZi41gDeOityrm6CT+67ogeCmznxsfC04pIRTQu8nqH xxPA6niI63vtLtq+qHN0O1UdPeGSPwgJ52/l7HbIXJmB9gBabP9ttcL6LzR97t60TZ/y xi8fY1SKVcAnYYFfxm/fbVzuolhFTo95g28gmWpOl56Q+kXlupNt0eR7OmIIe7eDUQxM MsC5WBSBdgCs3SV5uxx7bMvrLce7JTIqnbgs1ZVGIfU09zwxtHPvSmPuJnlAoHHnmt9X r8ASifwAR5ZiBRSdrNNzLxSzrqkC70inaWO/XOjs5/9K8UIRpSI21wVDmbmzvaTDP9BP 7pHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Gz/caJMS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id z41-20020a056a001da900b0068fcf6fe22csi12573230pfw.304.2023.10.11.11.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 11:20:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Gz/caJMS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id DE3EC8061B55; Wed, 11 Oct 2023 11:20:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233213AbjJKSUH (ORCPT + 99 others); Wed, 11 Oct 2023 14:20:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232983AbjJKSUF (ORCPT ); Wed, 11 Oct 2023 14:20:05 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ACF193; Wed, 11 Oct 2023 11:20:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5CA8C433C9; Wed, 11 Oct 2023 18:20:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697048403; bh=YIm0FW45BPKvF+X1OFYkrHMeewnDQo6DSIeSnbcXoY4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gz/caJMS9XpLYzznkn7hbGtO6iBp5YQBwlWeXaVO2aeovc1X8OVQhZQ7jlcUIW7o+ ghCN+1bWAdy0HcDAyLR8SRpK7fumfmCZfanA/BiLwPgDo7ZH/LuzcYFGzxWET9HfLv i0+LbdnW8MGuGS/1sxtaXjNoZIRsAMHfSdJICxy7HM4cd5pM3HLStAi+sujH1YzqTm DgFgNbm57sUo9HuWgnWs8WhQsA59oXfgINZeLmcvjc2D4IeCxLI2Cd6tu8gHppiFbm 08tttYidJWmRwXBdRo+KbhJFrtevCU7wleE/0NkNQkL9cGp87SZOiOFA4vzEXrImMm +YnnjvkNJ4r4w== Date: Wed, 11 Oct 2023 11:20:02 -0700 From: Saeed Mahameed To: Niklas Schnelle Cc: Saeed Mahameed , Leon Romanovsky , Jason Gunthorpe , Matthew Rosato , Joerg Roedel , Robin Murphy , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shay Drory , Moshe Shemesh , Heiko Carstens , Alexander Gordeev , linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Jacob Keller Subject: Re: [PATCH net v3] net/mlx5: fix calling mlx5_cmd_init() before DMA mask is set Message-ID: References: <20231011-mlx5_init_fix-v3-1-787ffb9183c6@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20231011-mlx5_init_fix-v3-1-787ffb9183c6@linux.ibm.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 11:20:09 -0700 (PDT) On 11 Oct 09:57, Niklas Schnelle wrote: >Since commit 06cd555f73ca ("net/mlx5: split mlx5_cmd_init() to probe and >reload routines") mlx5_cmd_init() is called in mlx5_mdev_init() which is >called in probe_one() before mlx5_pci_init(). This is a problem because >mlx5_pci_init() is where the DMA and coherent mask is set but >mlx5_cmd_init() already does a dma_alloc_coherent(). Thus a DMA >allocation is done during probe before the correct mask is set. This >causes probe to fail initialization of the cmdif SW structs on s390x >after that is converted to the common dma-iommu code. This is because on >s390x DMA addresses below 4 GiB are reserved on current machines and >unlike the old s390x specific DMA API implementation common code >enforces DMA masks. > >Fix this by moving set_dma_caps() out of mlx5_pci_init() and into >probe_one() before mlx5_mdev_init(). To match the overall naming scheme >rename it to mlx5_dma_init(). How about we just call mlx5_pci_init() before mlx5_mdev_init(), instead of breaking it apart ? >