Received: by 10.223.176.5 with SMTP id f5csp2076814wra; Thu, 8 Feb 2018 08:05:59 -0800 (PST) X-Google-Smtp-Source: AH8x227z32GwbsDP9PYWpxNULzbOf8cbz6euSMxkRNwmRjCjVAFiW5sVLXgRfVmVP4djKcFGrrR2 X-Received: by 10.98.64.9 with SMTP id n9mr1189588pfa.194.1518105959517; Thu, 08 Feb 2018 08:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518105959; cv=none; d=google.com; s=arc-20160816; b=pltwp3XTmtU121rrdn7P1C/cRXd9otsiPeEEQdZJeRm/+oxAUKxnChZ5XMlRWd+LIE 8YeyZWzZFma1iucDMZLjBS2Ze5noLLgyTlG/USQl+OOALtZpdLyttLfXCnu1IpKYz5gj AILBDOW1lM1KPzQOBGXfoKnh3Ia7JKQRCNCd5WZpcP/8r0OfW17NykXVUOnGt044dC7q 2ExeLdepIJ9N5d00KGOQQ2KwM55J0zXG+56WrDrLLI0jhwjLoaGQqpFSxX3I+pjRAI6n V/2OP8pQCeF14lve9HqFjnW/npNRffDZZNQT9v1Oy+CjljvkuLz6bgZgUJZdASTo6EA5 Y5Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=S9PSE5p/2l8IOHzLz7JbUoF5uEihVpDCIUM6KrMSd9c=; b=eLmzqSP5wzddoUS8o8VqgACXFDxWH8hDGX3QQFeuUQE8YrnWzN36AGRg3n1XcX2vDg JqJUlEMGMha6XMj3+t/zVwaV6e653oTvSOqXeLN9qxqktz89gt5WUlnoVlVQfvG5OJx5 M32Lk+ZyWJc1BBCXwZGFrfGINQkuaC8qws8O96SOpyCVr50OD3GfHNCiJMffgS2FkHmd Ikr/Zn3ItOhfeKAS+kFZyGk4fSpnip6AtFXYKX+6xpiKCepqcy25j6Byhu+JhNn6sguo EWGuxSVpbd2YtI9A3B0UqeY+AfFo7uSqX7YUovNrCLjuYYswZQrcdW5ruiq9D0fwhyAr /sOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=eWZ6FD9s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f31-v6si119167plb.685.2018.02.08.08.05.42; Thu, 08 Feb 2018 08:05:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=eWZ6FD9s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752218AbeBHQEf (ORCPT + 99 others); Thu, 8 Feb 2018 11:04:35 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:22463 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929AbeBHQEd (ORCPT ); Thu, 8 Feb 2018 11:04:33 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w18G4Wxj001851; Thu, 8 Feb 2018 10:04:32 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518105872; bh=9a63CkZLjf/yAG47ydvEyg+3Pqzv0ryZcUjDL/67DYI=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=eWZ6FD9sJz4CSonTrQd+psXL/XQ3IX7sF22eDIzgYhfdHkT3V7UJABTIo6ujHDxwI lb43tUz4+WpflWrGfhaiF1CpcmJgYoonJFe4nyh7WX2Z2/vmmNOkn9k5mV3JxFX+Lf WJfXKjZ7rtAi+gP5FGBVyMUw/13HrBB4bIKNjZwM= Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w18G4VSY025231; Thu, 8 Feb 2018 10:04:31 -0600 Received: from [128.247.59.147] (128.247.59.147) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Thu, 8 Feb 2018 10:04:31 -0600 Subject: Re: [PATCH] net: ethernet: ti: cpsw: fix net watchdog timeout To: David Miller CC: , , , References: <20180207011706.13393-1-grygorii.strashko@ti.com> <20180207.215735.1518454397358783732.davem@davemloft.net> From: Grygorii Strashko Message-ID: Date: Thu, 8 Feb 2018 10:04:31 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180207.215735.1518454397358783732.davem@davemloft.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [128.247.59.147] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/07/2018 08:57 PM, David Miller wrote: > From: Grygorii Strashko > Date: Tue, 6 Feb 2018 19:17:06 -0600 > >> It was discovered that simple program which indefinitely sends 200b UDP >> packets and runs on TI AM574x SoC (SMP) under RT Kernel triggers network >> watchdog timeout in TI CPSW driver (<6 hours run). The network watchdog >> timeout is triggered due to race between cpsw_ndo_start_xmit() and >> cpsw_tx_handler() [NAPI] >> >> cpsw_ndo_start_xmit() >> if (unlikely(!cpdma_check_free_tx_desc(txch))) { >> txq = netdev_get_tx_queue(ndev, q_idx); >> netif_tx_stop_queue(txq); >> >> ^^ as per [1] barier has to be used after set_bit() otherwise new value >> might not be visible to other cpus >> } >> >> cpsw_tx_handler() >> if (unlikely(netif_tx_queue_stopped(txq))) >> netif_tx_wake_queue(txq); >> >> and when it happens ndev TX queue became disabled forever while driver's HW >> TX queue is empty. >> >> Fix this, by adding smp_mb__after_atomic() after netif_tx_stop_queue() >> calls and double check for free TX descriptors after stopping ndev TX queue >> - if there are free TX descriptors wake up ndev TX queue. >> >> [1] https://www.kernel.org/doc/html/latest/core-api/atomic_ops.html >> Signed-off-by: Grygorii Strashko > > Applied, thanks. > Thank you David. Could this be marked as stable material 4.9+? -- regards, -grygorii