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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09CC6C433EF for ; Sat, 21 May 2022 17:44:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344293AbiEURog (ORCPT ); Sat, 21 May 2022 13:44:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbiEURoe (ORCPT ); Sat, 21 May 2022 13:44:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E69C5D5F6; Sat, 21 May 2022 10:44:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4017F60C85; Sat, 21 May 2022 17:44:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29773C385A5; Sat, 21 May 2022 17:44:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653155072; bh=EO84JGczgpntqsBiE0PFKKUwtkIBC7vQT45PS1nrYTM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mLf/GRtnZ3q1ciVMuzDkYnEOKTsDT2jfwFJXyiuutQp8dgnkLSAC+iqUKGoddB38U eNtiepYn+un7FTXa4fS+9fUCbQRWSC4uQZp7J5AsFGqxplizWSjG824CwOEi4IAViT V8Q8rSPKq2THHVLB0DQhc6CuWzygK3Pllx91p4JRconHLosADsY2jespf42KWlWxnG kYda1VOAsx28iaQfIdjkqflGklVkLc47XuInXCyEOnksXin+L2PQqm4dWZr8KNAagF vVA0cZohdBxcoqO/yOR7IxARweX4iEqPGvLppqn31NPcPEuHk/gsgkfUTq7C1es5vO CFajLlyyvFlBA== Date: Sat, 21 May 2022 10:44:30 -0700 From: Jakub Kicinski To: Christophe Leroy Cc: =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= , Pantelis Antoniou , "David S. Miller" , Eric Dumazet , Paolo Abeni , Vitaly Bordug , Dan Malek , Joakim Tjernlund , "linuxppc-dev@lists.ozlabs.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] net: fs_enet: sync rx dma buffer before reading Message-ID: <20220521104430.1212bed5@kernel.org> In-Reply-To: References: <20220519192443.28681-1-mans@mansr.com> <03f24864-9d4d-b4f9-354a-f3b271c0ae66@csgroup.eu> <20220520104347.2b1b658a@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, 21 May 2022 06:44:41 +0000 Christophe Leroy wrote: > > Hm, I think the patch is necessary, sorry if you're also saying that > > and I'm misinterpreting. > > Well, I say the contrary. > > On the mainline the patch may be applied as is, it won't harm. > > However, it is gets applied to kernel 4.9 (based on the fixes: tag), it > will break the driver for at least powerpc 8xx. I see, we should make a note of that in the commit message so it doesn't get sucked into stable. > > Without the dma_sync_single_for_cpu() if swiotlb is used the data > > will not be copied back into the original buffer if there is no sync. > > I don't know how SWIOTLB works or even what it is, does any of the > microcontrollers embedding freescale ethernet uses that at all ? AFAIU SWIOTLB basically forces the use of bounce buffers even if the device can reach the entire DRAM. I think some people also use it for added security? IDK. I mostly use it to check if I'm using the DMA API "right" :)