Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp248505rdb; Wed, 14 Feb 2024 21:09:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXoqi+/UBrPT0oMOQo1Y9YQDT12V2oVYRd/nNIOYSLlut/GA0GFMGLrsIjt0ao097jEeNu7PBTXDoE1Nyz5BXRa1Vo83Onuvp09gzfn4Q== X-Google-Smtp-Source: AGHT+IFoTPEEByvPw14bv8h0KLV155dXslKVjIkTrkA878zbTIxfci4gIRlCViX/UYeGY/enzT+L X-Received: by 2002:a17:90a:3484:b0:296:e2bf:3936 with SMTP id p4-20020a17090a348400b00296e2bf3936mr769619pjb.36.1707973757810; Wed, 14 Feb 2024 21:09:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707973757; cv=pass; d=google.com; s=arc-20160816; b=cn139Rl/8NmxDLzc5SEF4jnVB836d9YgwtuRjqbofS+J3Y5389HjHT+4q6NdYJs+lm DsEUy6ObLYyUYdMKgt5WnEExs401JVua78IGUN6sThTjKWeFQkK2jAmdL0vXlWAyMSFY 4h0kSz/uYPAuXZwOFutNdQSV5kxQLEZH+kOkYPInE9BxEaHANlE7YIGZvqvyJaw4D1U9 elu9oJxXoY3SXR74SOUOgVe5caed22zDVYZtxOFC8n8NA1FagL5Kukfe9oxLZHIuOu9S 7w75Wmf5v8yUiLKrDY0BfUTKE7mLxo6Ub/gan1enwSUk34F9Ipcow5sfSnLt7MvHbYC+ HNaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=JHHrre+o96csSayySONEgEMzx/5uu68tyovfUCTaB98=; fh=aymk4bFmXSiWc2aJOdE1mGlA7sWkZO5O9tNNmHT7id8=; b=ya61z31IJ44gQIURk55W6u+CWR94jW0RBioXoRtTE49NGeaqiX5TQHVXPCHxdjITIh qyRyPjpXc4umZpYxLIhl+XAjUR+nVJuIe9BTMm16NPDoNGRv7NpXMRCgn8ysJyi4UzGv LUzCNnXkDN3cZykxSSAGXop37jhhKzbk8GiMzJfJOAHiD3MgPOkZubhg+BhDqGS9J0di WKsFT4IEkqlz543J+AXWAtCq3TBWpaJVTdMRnBWQs8/fU9/U+AR4g9NAu8+U/YBnH58s UdP8+o+z3AzRETPpx6RLc9bIZusDNRRK9mgGr2Ak2oEl7uPRiCddY9QDGww9dC81kfje vS/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-66302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66302-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lr16-20020a17090b4b9000b00298f6678c68si1097286pjb.167.2024.02.14.21.09.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 21:09:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-66302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66302-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 77BCA281ADB for ; Thu, 15 Feb 2024 05:09:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03E4BBA2D; Thu, 15 Feb 2024 05:09:05 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87A3579DD; Thu, 15 Feb 2024 05:09:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707973744; cv=none; b=UwIdp+YtDpTDnEku/LDnfP71lYlre1Cur+k5YSdKkqwhHCChdCn4PKSIDaT1MMTynOvCUUgcyyvJvYRPLVAmUPok04ribA9pfl9QXQtVPqwEXjioLXALJkeowkbuSe7iqcG0CmMuWoyauSQuNS2TyYURzLZIMzGYveJFiEt/mQo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707973744; c=relaxed/simple; bh=cNwF0UBoZgTorJtcVmtOzDAYbe9MG8JuAeNdYwPv0w4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Pkoqr+mJ9kh0xIuq8XaRQ5mf5eQN1zj2uWpcUqynLg+uDryya95D+2LCd9P1//H0dR1GaqKNIJaOq25RdtTMYZHsGqs8BtMf4t9ztM8A5CsOhkGcpy18RFnJCepN2INW5SlbDDoDwphJ6QCS/iidysxCBorFYdzr2WhTwPWXskw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id D1E0D67373; Thu, 15 Feb 2024 06:08:57 +0100 (CET) Date: Thu, 15 Feb 2024 06:08:57 +0100 From: Christoph Hellwig To: Robin Murphy Cc: Alexander Lobakin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christoph Hellwig , Marek Szyprowski , Joerg Roedel , Will Deacon , Greg Kroah-Hartman , "Rafael J. Wysocki" , Magnus Karlsson , Maciej Fijalkowski , Alexander Duyck , bpf@vger.kernel.org, netdev@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v3 2/7] dma: avoid redundant calls for sync operations Message-ID: <20240215050857.GC4861@lst.de> References: <20240214162201.4168778-1-aleksander.lobakin@intel.com> <20240214162201.4168778-3-aleksander.lobakin@intel.com> <3a9dd580-1977-418f-a3f3-73003dd37710@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3a9dd580-1977-418f-a3f3-73003dd37710@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Wed, Feb 14, 2024 at 05:55:23PM +0000, Robin Murphy wrote: >> #define DMA_F_PCI_P2PDMA_SUPPORTED (1 << 0) >> +#define DMA_F_CAN_SKIP_SYNC BIT(1) > > Yuck, please be consistent - either match the style of the existing code, > or change that to BIT(0) as well. Just don't use BIT() ever. It doesn't save any typing and creates a totally pointless mental indirection. > I guess this was the existing condition from dma_need_sync(), but now it's > on a one-off slow path it might be nice to check the sync_sg_* ops as well > for completeness, or at least comment that nobody should be implementing > those without also implementing the sync_single_* ops. Implementing only one and not the other doesn't make any sense. Maybe a debug check for that is ok, but thing will break badly if they aren't in sync anyway.