From patchwork Fri Nov 11 14:10:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 81842 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp1484017obn; Fri, 11 Nov 2016 06:11:09 -0800 (PST) X-Received: by 10.99.147.6 with SMTP id b6mr5162152pge.22.1478873469909; Fri, 11 Nov 2016 06:11:09 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si2827658pgj.173.2016.11.11.06.11.09; Fri, 11 Nov 2016 06:11:09 -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=@linaro.org; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756653AbcKKOK4 (ORCPT + 27 others); Fri, 11 Nov 2016 09:10:56 -0500 Received: from mail-lf0-f54.google.com ([209.85.215.54]:35316 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756069AbcKKOKy (ORCPT ); Fri, 11 Nov 2016 09:10:54 -0500 Received: by mail-lf0-f54.google.com with SMTP id b14so13202418lfg.2 for ; Fri, 11 Nov 2016 06:10:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=BpGusO43BpPZ6gicLF/gJL8oLqFZYaKNkDOM0vhaYGU=; b=YHUH+prMytxm7fvitsGOGZTmtl0AfwzWTnjEgkSCljbcvb5ii4inSk7GaP3jN2SwaS oUKx/B57TjJhiH//D+dHifwnd8aingjQflanyHUrx1231RoAvnTW75lmv48vtVVlVP3B bmxsHKOpobx+gNdN5OAHf/XLYjir7tgGZKDaQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BpGusO43BpPZ6gicLF/gJL8oLqFZYaKNkDOM0vhaYGU=; b=NUsp756vJrtHp9wcga7iTGpbLnSOsj1QLZ8AFMbZWIATZtmmE9t3dYvXbCWRhX4KUd qmkpDdR4daFgbpaz16OoMA+NbPEWXNhcoc0wzd2hJjWsGvnzun9MEdedJ5nbkKZFQhEa FK4zaftAY18HRnEW+MaHchwL8AV3G2AiX4ryYlMKbfoI2IoUbob6AIxYkcEPfLfCb0Mg sc0MlJjubMM8BzzmMqq68t7l4REYwdsIOElKxN/l4D/7v0bJj1/bHT6EXnGHb+WvqSAP RyyMxpTgKIfEtl3pTKsxWJxX2FOOWy0oassVP/ca23RBLzDcbHZGxkSbbVjKIaczxhR9 nSUA== X-Gm-Message-State: ABUngvf+ufdgIq0q4/72APLtqNCS0sql328TbFrRuWZmpLOrEN7QXWT1ACg976OEPtpjhmUx X-Received: by 10.25.14.81 with SMTP id 78mr1866620lfo.183.1478873452971; Fri, 11 Nov 2016 06:10:52 -0800 (PST) Received: from localhost.localdomain (183-224-132-95.pool.ukrtel.net. [95.132.224.183]) by smtp.gmail.com with ESMTPSA id 5sm2258056ljf.18.2016.11.11.06.10.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Nov 2016 06:10:52 -0800 (PST) From: Ivan Khoronzhuk To: mugunthanvnm@ti.com, grygorii.strashko@ti.com, netdev@vger.kernel.org Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH] net: ethernet: ti: davinci_cpdma: don't stop ctlr if it was stopped Date: Fri, 11 Nov 2016 16:10:47 +0200 Message-Id: <1478873447-1309-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No need to stop ctlr if it was already stopped. It can cause timeout warns. Steps: - ifconfig eth0 down - ethtool -l eth0 rx 8 tx 8 - ethtool -l eth0 rx 1 tx 1 Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/davinci_cpdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c index 56395ce..56708a7 100644 --- a/drivers/net/ethernet/ti/davinci_cpdma.c +++ b/drivers/net/ethernet/ti/davinci_cpdma.c @@ -387,7 +387,7 @@ int cpdma_ctlr_stop(struct cpdma_ctlr *ctlr) int i; spin_lock_irqsave(&ctlr->lock, flags); - if (ctlr->state == CPDMA_STATE_TEARDOWN) { + if (ctlr->state != CPDMA_STATE_ACTIVE) { spin_unlock_irqrestore(&ctlr->lock, flags); return -EINVAL; }