Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8134145imu; Tue, 4 Dec 2018 03:35:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/WY2wQGN1jUIRwuF9MBgAl6utrNi62HBNNOiqucjloki1gkbmT1PVoyN7tzyOZ8qLLQKvbW X-Received: by 2002:a63:6bc1:: with SMTP id g184mr16852563pgc.25.1543923353226; Tue, 04 Dec 2018 03:35:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543923353; cv=none; d=google.com; s=arc-20160816; b=n21ws5+Bq3K18n3nRJu2UlQYlUFFwd5n3zg8hidQsDnCNkoK4HpTJ72uODmrjKLx7z 6VKExR0zQXBmHkt0WK5kvKsljYFQznidowlzg7iX6yXxjgzLWtHZ2msZVGfhaWb2E/a5 EBpAy8HiT/ZAcdbDJCr0ZJD8gFLP52DVAuxEYtS3lGhuNFfz3cjq/FsGRPOKA/tll8Ue bwokNkAgNLFxVPjCwe/nWwjDnTRw/iYdG1rtJTygFtbYoP5gIO/bwJztQryPSWFBufEl J79qI4iR+eIjmqVwN7c44/zGU78gkugE3y+YQEW91cAAFdWB9wij8KWfihQVCXiFEep4 rYOA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i+YL4zsKPe8HBs9qvQWNGQameXxvTXqngQAQzgGomBw=; b=TE5cOVklNrTBsgDpwfG4M5QgTKNvWil9fw+KMlG9G1w2TwvXW8PQacZwuufvsQAZEc V66zNZ47bunqdAnHI+LFv25iJtO3b+yFV47sE0lqMR3HqM73UUzd7s/Lvw71h7v/HPp+ vGSb2Hp1uJigtUDOO8z3Bh0jHmFXaaYI20Daw2vpT6sFP+c3ni5H6l4zizO2Hmor43c9 JZtJHrZZqfYoW185m/8jTCC/JV2deskRKqncRRPh+NsFnPzedHqr2EJ0FeuvT45YxznM P0qF1EpBpDhL8c6c/TGNlm2vinzZWg2QtKpCSXluNR2gZU9iFHIFnv260KJeyxFjx+sV RqXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PBmiOVUd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o195si18340393pfg.106.2018.12.04.03.35.37; Tue, 04 Dec 2018 03:35:53 -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=@kernel.org header.s=default header.b=PBmiOVUd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726434AbeLDLdn (ORCPT + 99 others); Tue, 4 Dec 2018 06:33:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:38068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbeLDKzT (ORCPT ); Tue, 4 Dec 2018 05:55:19 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9A83214C1; Tue, 4 Dec 2018 10:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543920919; bh=nPMvCg3ji7G6MT0dfQO3wg2D9wB1JrYhK136ZjvTWnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PBmiOVUdfhsEX3XBERlCOEHHeBPhUkSCamhJHq7qUFdMmb9OuTMW6SQnPyyOX6R81 vgPpfzAd3ta31zzO2iWZzjfgvdj2SerT8XJgPveMgX1YWB+xRUoY1+2thzEFYOJuXH gwcjOiiZzBfik1eYy0Y4YE2Mv4WcGED9nscO4wPw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bryan Whitehead , "David S. Miller" Subject: [PATCH 4.19 011/139] lan743x: fix return value for lan743x_tx_napi_poll Date: Tue, 4 Dec 2018 11:48:12 +0100 Message-Id: <20181204103650.456389414@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bryan Whitehead [ Upstream commit cc5922054131f9abefdc0622ae64fc55e6b2671d ] The lan743x driver, when under heavy traffic load, has been noticed to sometimes hang, or cause a kernel panic. Debugging reveals that the TX napi poll routine was returning the wrong value, 'weight'. Most other drivers return 0. And call napi_complete, instead of napi_complete_done. Additionally when creating the tx napi poll routine. Changed netif_napi_add, to netif_tx_napi_add. Updates for v3: changed 'fixes' tag to match defined format Updates for v2: use napi_complete, instead of napi_complete_done in lan743x_tx_napi_poll use netif_tx_napi_add, instead of netif_napi_add for registration of tx napi poll routine fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Bryan Whitehead Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/microchip/lan743x_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/microchip/lan743x_main.c +++ b/drivers/net/ethernet/microchip/lan743x_main.c @@ -1675,7 +1675,7 @@ static int lan743x_tx_napi_poll(struct n netif_wake_queue(adapter->netdev); } - if (!napi_complete_done(napi, weight)) + if (!napi_complete(napi)) goto done; /* enable isr */ @@ -1684,7 +1684,7 @@ static int lan743x_tx_napi_poll(struct n lan743x_csr_read(adapter, INT_STS); done: - return weight; + return 0; } static void lan743x_tx_ring_cleanup(struct lan743x_tx *tx) @@ -1873,9 +1873,9 @@ static int lan743x_tx_open(struct lan743 tx->vector_flags = lan743x_intr_get_vector_flags(adapter, INT_BIT_DMA_TX_ (tx->channel_number)); - netif_napi_add(adapter->netdev, - &tx->napi, lan743x_tx_napi_poll, - tx->ring_size - 1); + netif_tx_napi_add(adapter->netdev, + &tx->napi, lan743x_tx_napi_poll, + tx->ring_size - 1); napi_enable(&tx->napi); data = 0;