Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1912825pxk; Tue, 1 Sep 2020 10:39:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvA3CsyQ1aHjVDCxICS1zZzBOJYfCvIJtb7NB2gJK6xwCUvfn0AS2EODrlADGiYXVDONh7 X-Received: by 2002:a17:906:d8cd:: with SMTP id re13mr2518881ejb.140.1598981997204; Tue, 01 Sep 2020 10:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598981997; cv=none; d=google.com; s=arc-20160816; b=VcTKaDfmqedYRU+vQ1JwdDAeXFdMNNCzgA0Ld7krfG8CCzqTwq66bBRJ7o9URf/Vbs ngC3s5uH6mOCB4pW/Mn4Ay4euoKtt9J4r2QiboqWeG0/yFDW/BXXxuG49N7PEzNwNopJ yyF74gA4xiPrwB8u/jv8sY19xBQvrHrxip0ZweZgy9oaiKelZNmEDvS8N7bnN8qLCvHA riRxszyJpDtyk73ykZrH50mgkmgLYuurRVhF8j/+obBXd+VYMWYViUhmHewbgIcf4okj 7L3kuk8bpDi31hv1AqAGl0fyIVBx1QGVgIfssLbF1l6o5+4Ole216UkNrNt11GGighCX jULw== 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=8C7PWE23QUyPYQXG7O/mzZ1h5BXYA95yJkU2U+Ngrl4=; b=j/k746XQapVgSKYAqbwQHwE+HTYXL5CM21gfnHlrIt/UingVXcDPIY+l3nw/S1r9/H z7HX9OnJ61QJkFY7nHsE1BFIm7wLnGc35Ug1AI/Kepawe3iJwvo1g/jF8y5uhzHvCOpO n4A+Nj7nuEcBZnC6bZBjYZ8KirnXSFQfgYvo0WmP3UU3EsxseuPH92gfsFxYYZh7a83J re+2cUXR9MD8q+pJitlgxBFQVMXdXvTtaLzeENd/w+Kt6lRgOBr6ceid41BMabYKXZOp 71D+H9uEbJ/74As8vP4UiERih6Bxvx/LHl9YicGdGvAP86M96UeI8ugTcAdjOLgtCkDX ufjA== 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 l11si989353edr.73.2020.09.01.10.39.33; Tue, 01 Sep 2020 10:39:57 -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 S1729186AbgIARix (ORCPT + 99 others); Tue, 1 Sep 2020 13:38:53 -0400 Received: from elvis.franken.de ([193.175.24.41]:46057 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729009AbgIARiu (ORCPT ); Tue, 1 Sep 2020 13:38:50 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1kDAF0-0004vS-00; Tue, 01 Sep 2020 19:38:42 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 46A35C0E70; Tue, 1 Sep 2020 19:38:10 +0200 (CEST) Date: Tue, 1 Sep 2020 19:38:10 +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: <20200901173810.GA25282@alpha.franken.de> References: <20200819065555.1802761-1-hch@lst.de> <20200819065555.1802761-23-hch@lst.de> <20200901152209.GA14288@alpha.franken.de> <20200901171241.GA20685@alpha.franken.de> <20200901171627.GA8255@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200901171627.GA8255@lst.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 07:16:27PM +0200, Christoph Hellwig wrote: > Well, if IP22 doesn't speculate (which I'm pretty sure is the case), > dma_sync_single_for_cpu should indeeed be a no-op. But then there > also shouldn't be anything in the cache, as the previous > dma_sync_single_for_device should have invalidated it. So it seems like > we are missing one (or more) ownership transfers to the device. I'll > try to look at the the ownership management in a little more detail > tomorrow. this is the problem: /* Always check for received packets. */ sgiseeq_rx(dev, sp, hregs, sregs); so the driver will look at the rx descriptor on every interrupt, so we cache the rx descriptor on the first interrupt and if there was $no rx packet, we will only see it, if cache line gets flushed for some other reason. kick_tx() does a busy loop checking tx descriptors, with just sync_desc_cpu... Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]