From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4083C433DB for ; Thu, 14 Jan 2021 09:48:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63822239EB for ; Thu, 14 Jan 2021 09:48:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728077AbhANJsY (ORCPT ); Thu, 14 Jan 2021 04:48:24 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:53395 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbhANJsV (ORCPT ); Thu, 14 Jan 2021 04:48:21 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 05FE85C0207; Thu, 14 Jan 2021 04:47:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 14 Jan 2021 04:47:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Ve0K+4 mFsy8VhopXYROFi++Wpwnj6ByqFKDcnhRH7JI=; b=eU7fYhf8YFmshjN2b62qia Kv+MWc5xWdxVT64bsCDd5lMOM9mtGMNz0LSyhLwRPTp1+eIebYn4ODXKHIBK4Hog GEh1osXaD0aRJfh3JeXanasSen0Lv9UVO0OrWdNh8OBABlfXZ5PCg60SLpZTICJ1 fspk6fWWJFw+Rqo4MLGB2nTiqdEpHJ/MFQuIXBB2dmhPW8+2v6Ar9IFG40Yc0/y1 cGKm16oTf4mQxIZ8VIPBCshOHr0ViSBB7VFbtC2JXSTFJDKfb7G+PpdUdKeVFP7P UsJfZf/ZAOUfph/DPkIK2j1yfCeJTgB+X7YQe7OI8xe6IRvSbfOAvyFlSJxUbsOA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedukedrtdehgddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcuufgt hhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrthhtvg hrnheptdffkeekfeduffevgeeujeffjefhtefgueeugfevtdeiheduueeukefhudehleet necukfhppeekgedrvddvledrudehfedrgeegnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: from localhost (igld-84-229-153-44.inter.net.il [84.229.153.44]) by mail.messagingengine.com (Postfix) with ESMTPA id 198181080068; Thu, 14 Jan 2021 04:47:21 -0500 (EST) Date: Thu, 14 Jan 2021 11:47:07 +0200 From: Ido Schimmel To: Christophe JAILLET Cc: jiri@nvidia.com, idosch@nvidia.com, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] mlxsw: pci: switch from 'pci_' to 'dma_' API Message-ID: <20210114094707.GA1979201@shredder.lan> References: <20210114084757.490540-1-christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210114084757.490540-1-christophe.jaillet@wanadoo.fr> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Jan 14, 2021 at 09:47:57AM +0100, Christophe JAILLET wrote: > The wrappers in include/linux/pci-dma-compat.h should go away. > > The patch has been generated with the coccinelle script below and has been > hand modified to replace GFP_ with a correct flag. > It has been compile tested. > > When memory is allocated in 'mlxsw_pci_queue_init()' and > 'mlxsw_pci_fw_area_init()' GFP_KERNEL can be used because both functions > are already using this flag and no lock is acquired. > > When memory is allocated in 'mlxsw_pci_mbox_alloc()' GFP_KERNEL can be used > because it is only called from the probe function and no lock is acquired > in the between. > The call chain is: > --> mlxsw_pci_probe() > --> mlxsw_pci_cmd_init() > --> mlxsw_pci_mbox_alloc() > > While at it, also replace the 'dma_set_mask/dma_set_coherent_mask' sequence > by a less verbose 'dma_set_mask_and_coherent() call. [...] > > Signed-off-by: Christophe JAILLET For net-next: Tested-by: Ido Schimmel Thanks