Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1895844pxk; Tue, 1 Sep 2020 10:14:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznc0mQOjtMjRoiqWW0qBY6xucv2WYKlIBAap8HlwSREZfmDuP20KxlxPWQP7IPz2WBlKcY X-Received: by 2002:a05:6402:138a:: with SMTP id b10mr2673934edv.113.1598980473911; Tue, 01 Sep 2020 10:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598980473; cv=none; d=google.com; s=arc-20160816; b=xKY40yTOROaV+qv2+rjbWFsCCzqyhx8a7g6zC3sFwZPkv+HqWBJLHWlEHDYQiXH9dG WmfO/eyrCUZfebIAIndCjgdElm1m5FNtwfZO4iXgKCTA6aV8kgijrKb9F/h8d/unCyRh VT6RWRYzKwz/WosON4Afw9ajBuBpViAgRlL9DHCQyWQuKm94bpnjaRjy2uex3vfjL0N/ 4iqzbqnnfOSBR1THkubWoM3JKeSzQNesHQo3hxSlf2WZCgJeRYCvIvMSp9QpiDQ95ted ubf7OpztXk6djG7ur7OcKCXTS+8HYMwQn/2VExZybo35R79Y37S3c+X7L+Afm5LwOseq UNzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=X37g1NS31Xz8/5IEm6tdN3evw7gvpMQuHzfFZgQyiEk=; b=GrUllW6yRQhQ/Sxv9WG+SgErc4etXT702vf1QMIotUN9hpmFst/8HnJ9+vwSpWC5VA Sy+eMS+/vr9A25o7rAPe+rN1H7qWiaoVKVPcdUXBNg6SJn75KzRm7NFa+bnLihEtBZAH oO0DaDRcUTm6fEZGsag/n8nQfmWW2jQCbBdSK2VqBeOrWMCLw/YiDchBteDQWWtInCFb lWNT1qRm3hc0LCYLHY9j/IoFMweJvLy+qEU5mytSOHzZqRSlH+9xdwH23Wds0kVS6Dv2 jbU7KJFqW1ako7yidZzS3OqCU7hvCs0I2ugIzGEUsO9sq+M35hfw7Io6erFteFguPGbR YdcA== ARC-Authentication-Results: i=1; mx.google.com; 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 y26si884309edi.329.2020.09.01.10.14.10; Tue, 01 Sep 2020 10:14:33 -0700 (PDT) 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; 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 S1729460AbgIARN2 (ORCPT + 99 others); Tue, 1 Sep 2020 13:13:28 -0400 Received: from elvis.franken.de ([193.175.24.41]:46009 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729705AbgIARNL (ORCPT ); Tue, 1 Sep 2020 13:13:11 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1kD9qC-0004aY-00; Tue, 01 Sep 2020 19:13:04 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id A3E0EC0E68; Tue, 1 Sep 2020 19:12:41 +0200 (CEST) Date: Tue, 1 Sep 2020 19:12:41 +0200 From: Thomas Bogendoerfer To: Christoph Hellwig Cc: alsa-devel@alsa-project.org, linux-ia64@vger.kernel.org, linux-doc@vger.kernel.org, nouveau@lists.freedesktop.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , linux-mm@kvack.org, Marek Szyprowski , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , linux-scsi@vger.kernel.org, Kyungmin Park , Ben Skeggs , Matt Porter , linux-media@vger.kernel.org, Tom Lendacky , Pawel Osciak , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org, netdev@vger.kernel.org, Seung-Woo Kim , linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org Subject: Re: [PATCH 22/28] sgiseeq: convert from dma_cache_sync to dma_sync_single_for_device Message-ID: <20200901171241.GA20685@alpha.franken.de> References: <20200819065555.1802761-1-hch@lst.de> <20200819065555.1802761-23-hch@lst.de> <20200901152209.GA14288@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200901152209.GA14288@alpha.franken.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 01, 2020 at 05:22:09PM +0200, Thomas Bogendoerfer wrote: > On Wed, Aug 19, 2020 at 08:55:49AM +0200, Christoph Hellwig wrote: > > Use the proper modern API to transfer cache ownership for incoherent DMA. > > > > Signed-off-by: Christoph Hellwig > > --- > > drivers/net/ethernet/seeq/sgiseeq.c | 12 ++++++++---- > > 1 file changed, 8 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/net/ethernet/seeq/sgiseeq.c b/drivers/net/ethernet/seeq/sgiseeq.c > > index 39599bbb5d45b6..f91dae16d69a19 100644 > > --- a/drivers/net/ethernet/seeq/sgiseeq.c > > +++ b/drivers/net/ethernet/seeq/sgiseeq.c > > @@ -112,14 +112,18 @@ struct sgiseeq_private { > > > > static inline void dma_sync_desc_cpu(struct net_device *dev, void *addr) > > { > > - dma_cache_sync(dev->dev.parent, addr, sizeof(struct sgiseeq_rx_desc), > > - DMA_FROM_DEVICE); > > + struct sgiseeq_private *sp = netdev_priv(dev); > > + > > + dma_sync_single_for_cpu(dev->dev.parent, VIRT_TO_DMA(sp, addr), > > + sizeof(struct sgiseeq_rx_desc), DMA_BIDIRECTIONAL); > > } > > > > static inline void dma_sync_desc_dev(struct net_device *dev, void *addr) > > { > > - dma_cache_sync(dev->dev.parent, addr, sizeof(struct sgiseeq_rx_desc), > > - DMA_TO_DEVICE); > > + struct sgiseeq_private *sp = netdev_priv(dev); > > + > > + dma_sync_single_for_device(dev->dev.parent, VIRT_TO_DMA(sp, addr), > > + sizeof(struct sgiseeq_rx_desc), DMA_BIDIRECTIONAL); > > } > > this breaks ethernet on IP22 completely, but I haven't figured out why, yet. the problem is that dma_sync_single_for_cpu() doesn't flush anything for IP22, because it only flushes for CPUs which do speculation. So either MIPS arch_sync_dma_for_cpu() should always flush or sgiseeq needs to use a different sync funktion, when it wants to re-read descriptors from memory. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]