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 X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE4D6C4332F for ; Tue, 7 Sep 2021 19:30:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0AA76109D for ; Tue, 7 Sep 2021 19:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244083AbhIGTbH (ORCPT ); Tue, 7 Sep 2021 15:31:07 -0400 Received: from mxout03.lancloud.ru ([45.84.86.113]:46666 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233485AbhIGTbG (ORCPT ); Tue, 7 Sep 2021 15:31:06 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 3BFDF20F0031 Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: Re: [PATCH] net: renesas: sh_eth: Fix freeing wrong tx descriptor To: Yoshihiro Shimoda , , CC: , References: <20210907112940.967985-1-yoshihiro.shimoda.uh@renesas.com> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Tue, 7 Sep 2021 22:29:56 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210907112940.967985-1-yoshihiro.shimoda.uh@renesas.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 9/7/21 2:29 PM, Yoshihiro Shimoda wrote: > The cur_tx counter must be incremented after TACT bit of > txdesc->status was set. However, a CPU is possible to reorder > instructions and/or memory accesses between cur_tx and > txdesc->status. And then, if TX interrupt happened at such a > timing, the sh_eth_tx_free() may free the descriptor wrongly. > So, add wmb() before cur_tx++. Not dma_wmb()? :-) > Otherwise NETDEV WATCHDOG timeout is possible to happen. > > Fixes: 86a74ff21a7a ("net: sh_eth: add support for Renesas SuperH Ethernet") > Signed-off-by: Yoshihiro Shimoda Reviewed-by: Sergey Shtylyov [...] MBR, Sergey