Received: by 10.213.65.68 with SMTP id h4csp840151imn; Tue, 27 Mar 2018 09:44:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/VFibWqiAGDP8kq/PqD1PtjGtyReN5Lr3UJ9Dg3x0koD3LBF8Di/vxgYehc8vPTwTLMGlF X-Received: by 2002:a17:902:22a:: with SMTP id 39-v6mr89928plc.128.1522169097462; Tue, 27 Mar 2018 09:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522169097; cv=none; d=google.com; s=arc-20160816; b=z/BCnILadPDKelTEdHJIMk2GiMCAv69hzaOii/gHqLcY8dkn3ebHPFpHJ2PN3QcxBk HAg743vWliY57RwCECJk7uoiSaoZUUMqFLviWMShcXRVM9A8Io0vLvbPq5J8GAXpcFML 0CxQiZPsyO1eSCg6GiHa0Dp45Fxa6acSz3qNABl6lCA7T/grjZBAjQ/2TlPocmc4vvFH yXkjyWJAZgFoNNxa4zZcuVU7mGBtQe6Y+cKAi7AG+YwF0DG+SdD1HHG1KPjUrA+Wth3V aSPigkwPYtlvs3gKpk2zIWT3njawIBCpB0Q49xQSvulGnsWZyLl/YgEhPSOhLpQvKwyi D1yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=evAwpUDKQIGS+ArFi03vOCkAUS7lUicLVBoYEAd4ATY=; b=K+mHsLjpUjdLACpyT/9Bo5xdjkBh0QXbkw25VSd2TlhGEfSqywnT1lqGaaw32IyNak sBxHT3vepj2mUVY2/a6HckSpsiJWOnZHJHkUNI8iD6XudRjiErzvSCZhAxUXxkKnOhOn 7Yg5iGuGNLlETHyTUFiEoVrquZi/o7CppIEtuHlKZF/1y5WdAnkmXmfO6prpNlaUyqSe cxW48HMNxkas7oJsXfaPB5/BfNdNei/g63tEcPveeJFQ4uFAmdxNXLijFpLn3nHngitn Ikyq7Gm4mH34SKycXjkbzD6A0m4IT9RtZEUeRAVir0HKiyZ/nA48n8QDhjV6hdNwK5lZ RfWA== ARC-Authentication-Results: i=1; mx.google.com; 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 t5si1106157pgo.96.2018.03.27.09.44.42; Tue, 27 Mar 2018 09:44:57 -0700 (PDT) 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; 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 S1750909AbeC0Qn1 (ORCPT + 99 others); Tue, 27 Mar 2018 12:43:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49500 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbeC0QnX (ORCPT ); Tue, 27 Mar 2018 12:43:23 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9ADAD10F2; Tue, 27 Mar 2018 16:43:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephane Grosjean , Marc Kleine-Budde Subject: [PATCH 4.15 076/105] can: peak/pcie_fd: remove useless code when interface starts Date: Tue, 27 Mar 2018 18:27:56 +0200 Message-Id: <20180327162802.613560973@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162757.813009222@linuxfoundation.org> References: <20180327162757.813009222@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stephane Grosjean commit ffd137f7043cb30067e1bff6fe62a073ae190b23 upstream. When an interface starts, the echo_skb array is empty and the network queue should be started only. This patch replaces useless code and locks when the internal RX_BARRIER message is received from the IP core, telling the driver that tx may start. Signed-off-by: Stephane Grosjean Cc: linux-stable Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/peak_canfd/peak_canfd.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) --- a/drivers/net/can/peak_canfd/peak_canfd.c +++ b/drivers/net/can/peak_canfd/peak_canfd.c @@ -333,7 +333,6 @@ static int pucan_handle_status(struct pe /* this STATUS is the CNF of the RX_BARRIER: Tx path can be setup */ if (pucan_status_is_rx_barrier(msg)) { - unsigned long flags; if (priv->enable_tx_path) { int err = priv->enable_tx_path(priv); @@ -342,16 +341,8 @@ static int pucan_handle_status(struct pe return err; } - /* restart network queue only if echo skb array is free */ - spin_lock_irqsave(&priv->echo_lock, flags); - - if (!priv->can.echo_skb[priv->echo_idx]) { - spin_unlock_irqrestore(&priv->echo_lock, flags); - - netif_wake_queue(ndev); - } else { - spin_unlock_irqrestore(&priv->echo_lock, flags); - } + /* start network queue (echo_skb array is empty) */ + netif_start_queue(ndev); return 0; }