Received: by 10.213.65.68 with SMTP id h4csp879140imn; Tue, 27 Mar 2018 10:27:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/WqdXUF8w+d+L/LhA7y94BkrxIixmuFZ3Fc6ezZ7BJRErhLK0zE5gIzoBfJFNhNLpJjHb6 X-Received: by 10.101.67.135 with SMTP id m7mr154645pgp.26.1522171638534; Tue, 27 Mar 2018 10:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522171638; cv=none; d=google.com; s=arc-20160816; b=tj8j/DWboUXvPGg1RIibbPuzlf+rRI68vtcb3vji2JniB5TLtXoxfzJpNL7a4K37CF w9GfV16Vj/NU+iHnHrGt0i758yWoUZhzEsCBUUvAndmGhWgnT2QPN5Vl1353sMNYiO8S 3LKWHYyg9R3lj8O3GqzoESHGqzQrQo+K3q2VFMAfPfp8688rTW6iyuNvUM4CsMForDk7 nWRNM1X23805mgTTwSK8YaRRRCgh0V3uleQCeczdl5Cvn1zaNdzvhORJTt62by+NFWhw +w6N6uXckqj0R6M15jfJtWrqpZ+jNf2lbslsuw/8pfFT2C5XUrKNyQ+x+eS+eEi8+Atg vx5Q== 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=+aav3LMyCOgJpeYizY3gAsWlklz7QbIf1xs+DIbb9Wg=; b=X8jSjNxb61BJjEUWT4gp/kg/6nyJQe9VQ9eZa/1kF8bqkdqd8ukRO/PwAtiE4A51GO ROqqvLJLxi6xI/c+1UoolU3/13eBFtjt/vqdJIl3DFFtmukFMo58GgDifxVhOMEs/XVo 3q44QO8Y1OlAwPv2VKJddcL43UmBXtBhOqo8c73g+PX2F09tg79B7Gh3lx/kRkpgab3y +uM11wRSmREpPtoJ0trfZQzDCyziSxNDb1gxwwUiOz/TKiOeT06s9SyI89KjnyOkcVIL Dl++Ls1aZ1VucC/qyNWPKEkd+Yyp4/vHgxCmH4iV5wxq7xONWUqvsCkQ0mtGEBcLtrJw WH+w== 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 ay10-v6si1686078plb.258.2018.03.27.10.27.03; Tue, 27 Mar 2018 10:27:18 -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 S1754815AbeC0Qg6 (ORCPT + 99 others); Tue, 27 Mar 2018 12:36:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45934 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754784AbeC0Qgw (ORCPT ); Tue, 27 Mar 2018 12:36:52 -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 521F7F3D; Tue, 27 Mar 2018 16:36:51 +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.14 071/101] can: peak/pcie_fd: remove useless code when interface starts Date: Tue, 27 Mar 2018 18:27:43 +0200 Message-Id: <20180327162754.459017834@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162749.993880276@linuxfoundation.org> References: <20180327162749.993880276@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.14-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; }