Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp137110pxb; Thu, 14 Jan 2021 01:50:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzT0+v76c8NnQyM/b72p9vMTgG7NcKKDVKMMUuXnxQtyVxJS7GZvMhjRjdwFWlz5Ay46j6 X-Received: by 2002:a17:906:7cc:: with SMTP id m12mr3973660ejc.386.1610617832424; Thu, 14 Jan 2021 01:50:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610617832; cv=none; d=google.com; s=arc-20160816; b=yWvHX7WRSUF+G3M70gLjZkTUAktoWgESFyCflFkWQKYOq6dZCLeVIEGHjet77DtLAl B9Vw+zSsYPBjahMyew0bu9/zqcb7paTugEjjcsm+pe13egGwAOQijuAOYGGwAmjiWLsz Jur+koKuV98Tot3MqdEfhnvf+P5qzaM/DVf+MyCS68QLhg+mPZSI1Sd3ctLgdKBxc4/1 iqjMvO0ItTYeETnZGvdWinQNEJ9rRnz+9mtqYZ/dEHZKLMJxJsId6cZCPjeEEhiV3LC3 qa1h6eM4N+7rqTfolNnZZHeo1dSUp2srtT7D3Olay7FbaVOs/anq9e4HoFrfjudbQkPi br+A== 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=Ve0K+4mFsy8VhopXYROFi++Wpwnj6ByqFKDcnhRH7JI=; b=r5beqsjGe3sBsEriulxTj/rDlE0yXuTuwF6O3iMHOd1gh65SFUS4HZ1CxK5xG0RCJ0 Azr6u3hnuq1IRERayAme6pXEyOkfClLTyzTfxp8x/ePUkGjidbVplUb9s+SbUZow4a9w +vuGPEn2THq42Dn+ZXF5e6b9cjxuZZ8ytmDtnRUMx0IkG2KllpvUoPJ2pTLgatmnDgmL FbqyYyGWJoMCxB/g3co2nJMgC/1uruaNtRhv8YoDMgTUz0jZtPLaf16c0hZtp1kINbKU xFxSpds86ZWWmSPMiQdzIAusqMgRBi/n0ETUGm/cuvxGi3zkuC6cJBx58sJBKGGGv67e 6VtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=eU7fYhf8; 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 v18si2309737ejj.255.2021.01.14.01.50.08; Thu, 14 Jan 2021 01:50:32 -0800 (PST) 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=@messagingengine.com header.s=fm1 header.b=eU7fYhf8; 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 S1727965AbhANJsW (ORCPT + 99 others); Thu, 14 Jan 2021 04:48:22 -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: linux-kernel@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