From patchwork Fri Oct 19 01:08:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 149196 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2680822lji; Thu, 18 Oct 2018 18:10:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV63DnMyrFhRoRKKu1pgBIIe033Tf6Twu1ODHxfA8TDTXmxwdBmeAb+v2wPZJr7+hU9FPME0P X-Received: by 2002:a63:30c8:: with SMTP id w191-v6mr30063266pgw.447.1539911434869; Thu, 18 Oct 2018 18:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539911434; cv=none; d=google.com; s=arc-20160816; b=PMb1H5lxYR3BOxJ+4ul09PdyGNgR3G9pzdMyKxBD+3j+aOE67DOWWzt1FEPJGJZzXn qG1xa6r3GEh9gIPVgpaE7N6YYed1UZuLGyOwBPmA1O8Dt87m4x8izKWU/8SCApSau0np 815nYqJJuDRj1Gdh7ckJU+nB4OI2eQnuDZvEFh9DYnh+Sxaf2w/pA3xoqUtp6R5iwi7E Trx8yIN6sVf3wJbhZ703AX9FT+BpbFa2teC7tkbX9owy1U6v2LjgPC0fCm0KmA9XUjmi +a7tNntnxaVS39YRNeUGd542I+Eh5k1xdKgB2dkEg1B/coaUz7CKMj7MwPzGNu+RF2/c SsxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=zup1u/FBvCTqA8w/OBz9sjLyaTKGoKh65IYPknttpgs=; b=oCAlF8cX11upVbj00SvrpOURKE548Ws0cPjKhZ0MKfueGjS32QJBeHzNveKEg188YI nFDg7SmhKVXmBzxge6JDdS5Ev13GOgGXr9eC+TTcc0JaOpP7I80AYR5ZOMbWGjGrsUH3 +Lo3+7r8lGzTnaFUKLpAbyRk7xtaanVxmqOh1vJVS2Zz/STYRBNKxFP4VWmIQ6FFGD0b rOrGkU6hvtCOZogCqAyGlTCQJK34ICrtQjMOZqCaW+AqvfJs6zRBIGVe9OJGE5a8ghCY MHsetZD6i4Jf1GTw51mmcc0nNCGIxE9HrvSgCTSnBkIBkEeTZFDv1cymvZHwfg/YWryd l+fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V+V6Z1hD; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si22893275plh.50.2018.10.18.18.10.34; Thu, 18 Oct 2018 18:10:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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 header.s=google header.b=V+V6Z1hD; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726566AbeJSJOP (ORCPT + 10 others); Fri, 19 Oct 2018 05:14:15 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:36247 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbeJSJOP (ORCPT ); Fri, 19 Oct 2018 05:14:15 -0400 Received: by mail-yb1-f195.google.com with SMTP id 5-v6so12645671ybf.3 for ; Thu, 18 Oct 2018 18:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zup1u/FBvCTqA8w/OBz9sjLyaTKGoKh65IYPknttpgs=; b=V+V6Z1hDFT8ARhOl0L+rYMJoEQs7Q7L6hYR99OUysDd6HShy5W/+IjX74jtbWRDfSS J9IDOZXfnNoaiaWXnyozUcbD3Sr/EHfS7ch0zDNXRGas0+8piHYCVy9vHKzVqd1QrIZp +ZVto3gKWxxJ0nnz6ApOdKf77dl0tryt61vCk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zup1u/FBvCTqA8w/OBz9sjLyaTKGoKh65IYPknttpgs=; b=okKlzcJkvFu1JdtnOyfpwALOfLue5t0H9JxOaF+LqZ97CgCS/4Ovm9NoGO7ETiaa9O hYFFZhxBcAzEOApcI+YAoni1dwDB9mWwRKqpRgIYroJVdpuqqtrNzedSN0cLJ+OOIiPe ZQ/iMKkVmw9EM0B9On8K0OA62HOgDPfqpDRhifUUEHRiwK/zp3ElcJwNvm8JAEOczbKF 7Jb89GpnniP5dXwH6VCSP12h5DNoughPcFPNwNAsf2V6zQcpE+/jPj/+ae3J9A1lzyh3 2A+xMXe2oqvvm9e2ELPrXulYg7njKR4nNEcLhmkYaE84g1tMjKFnqGjO3VcB4i+GHMKz od+A== X-Gm-Message-State: ABuFfohlF0Y7nRY9KFyEGf35eEnD12QQUxgg06Ur0qlOfLTLBpEh+URu xMYC/aqZE2mtHkI/jMejsxGP1AcyfUk= X-Received: by 2002:a25:b88d:: with SMTP id w13-v6mr21581335ybj.213.1539911432088; Thu, 18 Oct 2018 18:10:32 -0700 (PDT) Received: from localhost ([121.95.100.191]) by smtp.gmail.com with ESMTPSA id n186-v6sm7608373ywn.16.2018.10.18.18.10.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 18:10:31 -0700 (PDT) From: masahisa.kojima@linaro.org To: netdev@vger.kernel.org Cc: ilias.apalodimas@linaro.org, jaswinder.singh@linaro.org, ard.biesheuvel@linaro.org, osaki.yoshitoyo@socionext.com, Masahisa Kojima Subject: [PATCH 1/3] net: socionext: Stop PHY before resetting netsec Date: Fri, 19 Oct 2018 10:08:41 +0900 Message-Id: <20181019010843.3605-2-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20181019010843.3605-1-masahisa.kojima@linaro.org> References: <20181019010843.3605-1-masahisa.kojima@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Masahisa Kojima After resetting netsec IP, driver have to wait until netsec mode turns to NRM mode. But sometimes mode transition to NRM will not complete if the PHY is in normal operation state. To avoid this situation, stop PHY before resetting netsec. Signed-off-by: Masahisa Kojima Signed-off-by: Yoshitoyo Osaki --- drivers/net/ethernet/socionext/netsec.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) -- 2.14.2 diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index 4289ccb26e4e..273cc5fc07e0 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -1343,11 +1343,11 @@ static int netsec_netdev_stop(struct net_device *ndev) netsec_uninit_pkt_dring(priv, NETSEC_RING_TX); netsec_uninit_pkt_dring(priv, NETSEC_RING_RX); - ret = netsec_reset_hardware(priv, false); - phy_stop(ndev->phydev); phy_disconnect(ndev->phydev); + ret = netsec_reset_hardware(priv, false); + pm_runtime_put_sync(priv->dev); return ret; @@ -1415,7 +1415,7 @@ static const struct net_device_ops netsec_netdev_ops = { }; static int netsec_of_probe(struct platform_device *pdev, - struct netsec_priv *priv) + struct netsec_priv *priv, u32 *phy_addr) { priv->phy_np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); if (!priv->phy_np) { @@ -1423,6 +1423,8 @@ static int netsec_of_probe(struct platform_device *pdev, return -EINVAL; } + *phy_addr = of_mdio_parse_addr(&pdev->dev, priv->phy_np); + priv->clk = devm_clk_get(&pdev->dev, NULL); /* get by 'phy_ref_clk' */ if (IS_ERR(priv->clk)) { dev_err(&pdev->dev, "phy_ref_clk not found\n"); @@ -1473,6 +1475,7 @@ static int netsec_register_mdio(struct netsec_priv *priv, u32 phy_addr) { struct mii_bus *bus; int ret; + u16 data; bus = devm_mdiobus_alloc(priv->dev); if (!bus) @@ -1486,6 +1489,10 @@ static int netsec_register_mdio(struct netsec_priv *priv, u32 phy_addr) bus->parent = priv->dev; priv->mii_bus = bus; + /* set phy power down */ + data = netsec_phy_read(bus, phy_addr, 0) | 0x800; + netsec_phy_write(bus, phy_addr, 0, data); + if (dev_of_node(priv->dev)) { struct device_node *mdio_node, *parent = dev_of_node(priv->dev); @@ -1623,7 +1630,7 @@ static int netsec_probe(struct platform_device *pdev) } if (dev_of_node(&pdev->dev)) - ret = netsec_of_probe(pdev, priv); + ret = netsec_of_probe(pdev, priv, &phy_addr); else ret = netsec_acpi_probe(pdev, priv, &phy_addr); if (ret) From patchwork Fri Oct 19 01:08:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 149197 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2681183lji; Thu, 18 Oct 2018 18:11:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV63b0XZ+S29/zSWqSmflC8sIgbRQMW0+wu51D3mgyL88+6wS/d50QY8fapxIKOADypIw5cM9 X-Received: by 2002:a62:1551:: with SMTP id 78-v6mr32391999pfv.178.1539911462369; Thu, 18 Oct 2018 18:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539911462; cv=none; d=google.com; s=arc-20160816; b=P3GvZVECWb02PTqh5MDp/3bOZSQYgrY+objezBqy8m2Qwy9zIO0y/t9IN4pTgSFcLQ qEpVl/2p7QvwbRq5Avb0T9Z21iaLg6xtY/+hSFdvXkFw+GNIUGJhVtnJqmlgCamie7eg kSdZrSbNiMpj0yOnJV9IU+ugaeDPY1ui0o5EYqkIyu/FGoCsogbu0EbJuSXqiwouzc9t uRDNTyNNiUov+xO5hw1/vy2jdiryHxdVvg7NU6Cf08kWvCiWIexPJplIPs2u9WemSt0m 51AP/k4MbKgdlP6dbYY5ihw6yizXk10libjfcMQMK9zn1VUsm8ZO77690WmeHvti2+OU gvSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=vERzpTd8PFyshf2pm/39BUZZNvqkHOHkVNwWtxqM1k4=; b=l4XFYlEP4nIzwaE7K2EvtdG16QEb6PlIyFQqLG9PUdRFw/N+tl/fMFzra987KkKX9z +bF+I/1KoOr0XDsii/Wwu2k5pTCA3uUKspBOpXVmulR2ztmee7mkNQwOQn1ov5WGKRrU 3rXO+jU7YCEc03VlhIDPuFO2DSiVQazb+AvVa766fzNQdJoGuwJaCAUlQEI3w4BhuP5r dKXZ5cGD0JSG1C88gjG5hahGITi+AVgh2k/esChXEVTEWmIhcMZ5ZlqaamjPnlm1HBGu IyNjkuhgFU71MrLjqeh7act+ymT5Y5B/4Q+TKKvbwNZpPe9E+S8pCYG6kVdGnWnwEyEI /JrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b9p42Az8; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si22893275plh.50.2018.10.18.18.11.02; Thu, 18 Oct 2018 18:11:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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 header.s=google header.b=b9p42Az8; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbeJSJOn (ORCPT + 10 others); Fri, 19 Oct 2018 05:14:43 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:41902 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbeJSJOn (ORCPT ); Fri, 19 Oct 2018 05:14:43 -0400 Received: by mail-yw1-f68.google.com with SMTP id 135-v6so12574902ywo.8 for ; Thu, 18 Oct 2018 18:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vERzpTd8PFyshf2pm/39BUZZNvqkHOHkVNwWtxqM1k4=; b=b9p42Az8SLZnMrei5M0Z/irgkHo4HigCpgizRZffM97//DBy0PmLb1b85anZfafMca ecxM74uheGMCpJkRHt7L8eK6m0XgogAVzABbRprH4LZgiyCstDQbsuwZ4MlD/yYsmToi Upbf4wXhqoYt5PxHoCQSDGQcIzwPsgvZL3g+w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vERzpTd8PFyshf2pm/39BUZZNvqkHOHkVNwWtxqM1k4=; b=Jl6TYF70OwSg5ATzwrTYuyOMq4IBiUoYnuLzxXes7QumcewYDiw+kSLEzrwbd6KHYR BtTzhP3I3NLv+rtadzbLfn+ulPaIpF4h1IF6nopcliNa1/ShxrmQxYdkdtjLAJwJF9F5 v6d0AqYHZoGiR9Zknoq9mP5KZWUG/M2GWlR0Mo9GG0r1g+dN9174+2zKZ8qlt0N1/wFC hat4HhssBTFoxood+AIoBCOtcfp1c+bgmVaQW3IerLhGSQufyeGDPs5kK84jkUmZRbtE DdLzXTr2K7BKIeXsQlXfWa38APIyXzNvo89pp2z9B4mt8k3I12aOPeAZzWlS6msbdFvI QsIw== X-Gm-Message-State: ABuFfoiRaoquI+3BVQBQZtITc11C3g81BSRIf6rXVcWh2OErn5GStOF5 jNXKZ/Irbpc2AWxS5Gw99FwM9JpomoE= X-Received: by 2002:a81:4a55:: with SMTP id x82-v6mr21252592ywa.3.1539911459131; Thu, 18 Oct 2018 18:10:59 -0700 (PDT) Received: from localhost ([121.95.100.191]) by smtp.gmail.com with ESMTPSA id n7-v6sm5481622ywb.8.2018.10.18.18.10.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 18:10:58 -0700 (PDT) From: masahisa.kojima@linaro.org To: netdev@vger.kernel.org Cc: ilias.apalodimas@linaro.org, jaswinder.singh@linaro.org, ard.biesheuvel@linaro.org, osaki.yoshitoyo@socionext.com, Masahisa Kojima Subject: [PATCH 2/3] net: socionext: Add dummy PHY register read in phy_write() Date: Fri, 19 Oct 2018 10:08:42 +0900 Message-Id: <20181019010843.3605-3-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20181019010843.3605-1-masahisa.kojima@linaro.org> References: <20181019010843.3605-1-masahisa.kojima@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Masahisa Kojima There is a compatibility issue between RTL8211E implemented in Developerbox and netsec network controller IP(F_GMAC4). RTL8211E expects MDC clock must be kept toggling for several clock cycle with MDIO high before entering the IDLE state. To meet this requirement, netsec driver needs to issue dummy read(e.g. read PHYID1(offset 0x2) register) right after write. Signed-off-by: Masahisa Kojima Signed-off-by: Yoshitoyo Osaki --- drivers/net/ethernet/socionext/netsec.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) -- 2.14.2 diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index 273cc5fc07e0..e7faaf8be99e 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -431,9 +431,12 @@ static int netsec_mac_update_to_phy_state(struct netsec_priv *priv) return 0; } +static int netsec_phy_read(struct mii_bus *bus, int phy_addr, int reg_addr); + static int netsec_phy_write(struct mii_bus *bus, int phy_addr, int reg, u16 val) { + int status; struct netsec_priv *priv = bus->priv; if (netsec_mac_write(priv, GMAC_REG_GDR, val)) @@ -446,8 +449,19 @@ static int netsec_phy_write(struct mii_bus *bus, GMAC_REG_SHIFT_CR_GAR))) return -ETIMEDOUT; - return netsec_mac_wait_while_busy(priv, GMAC_REG_GAR, - NETSEC_GMAC_GAR_REG_GB); + status = netsec_mac_wait_while_busy(priv, GMAC_REG_GAR, + NETSEC_GMAC_GAR_REG_GB); + + /* Developerbox implements RTL8211E PHY and there is + * a compatibility problem with F_GMAC4. + * RTL8211E expects MDC clock must be kept toggling for several + * clock cycle with MDIO high before entering the IDLE state. + * To meet this requirement, netsec driver needs to issue dummy + * read(e.g. read PHYID1(offset 0x2) register) right after write. + */ + netsec_phy_read(bus, phy_addr, 2); + + return status; } static int netsec_phy_read(struct mii_bus *bus, int phy_addr, int reg_addr) From patchwork Fri Oct 19 01:08:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 149198 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2681459lji; Thu, 18 Oct 2018 18:11:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV61v/G0Qt+oCMZnmcsuwNfMCO3l5/kxroPDjyVuRHDF1b84sZfIe58z43FI/9tc4ncA24ciW X-Received: by 2002:a17:902:a618:: with SMTP id u24-v6mr31774260plq.77.1539911484470; Thu, 18 Oct 2018 18:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539911484; cv=none; d=google.com; s=arc-20160816; b=LofSEFM7mCxiB803NTiJZ782n2omnWFmqsFnbBV7B1fNWaEKHwOn+KUPcJJwYHKTtG SUuoC3DZCWrWOor1rcvI7YtZo9hAAaZkciNiHWtbCrQJKqH3N6YXEmm2wCuh8T/afW7X rgQ1DttEDsmMqWnlRHaPla7p2wlk1BeKJvSR29q/IgW5dQ8goCnX74c7y1n76S4h6nHX MDQEHGAmBSxi3J5fhng/Bup6dcHWzWUR9WfTnI4182vtxlSPKif05TLQrLcn7uTAf7QZ pvxBJre1mOt5tFuIBnRRYcy6Y8VV/OKoKHHmc9CViGyTddWV4g7feg+qpPRqNFEtOJqA b+Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=mvsMdqlrZflUMcGarFKUW1cQ+K9e6pvoW52898rH0kU=; b=lFZxKV3xmh1d8s35W7kCbRMXlxS2UMrlWUXIbp0vuypoeD2waHnrIamRv1RJ2fk7UT PAY0JYwt93ad0k6Sh3GSdGk/JCQql8Hhyxp/+7gg48dRo7jIzhUa0nWKjTECrvcTi/lT You4SpD1XkqXEygLA+bOexrLktlGwyB67XkRIc+rXbOn32Iiz51UYAjFdoZz88m0cQ1a Y2/12C32ze58S9cqgn8PcMTro2xglgLgeg47g5VkEAEfRYda4g4cQA01+GtV0C0gMIZ6 WgIWP866SQAwGkHpKHoMoKtZ4iQ8jh8RQVzVRYRDVvh6JwSNJh3EA0dT5qx3fKs/2w5q fS/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="iUfIg/9o"; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si22893275plh.50.2018.10.18.18.11.24; Thu, 18 Oct 2018 18:11:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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 header.s=google header.b="iUfIg/9o"; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbeJSJPF (ORCPT + 10 others); Fri, 19 Oct 2018 05:15:05 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:40587 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbeJSJPF (ORCPT ); Fri, 19 Oct 2018 05:15:05 -0400 Received: by mail-yw1-f68.google.com with SMTP id l79-v6so12581212ywc.7 for ; Thu, 18 Oct 2018 18:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mvsMdqlrZflUMcGarFKUW1cQ+K9e6pvoW52898rH0kU=; b=iUfIg/9oAbi1aeXeSLTrR8n40Yflsjc1TkE1aFsY64WZz+Krw7ALnb4bIzWwOpFdz3 S6PpwvjwjOsOJzfMFB5yf97P15hCuj4QrbBdwgHt9UyluDO66qwpZM2Gl92sGMlOLXtj I9s3BHuV8FLWijHCNuSLTGpOVtOv+EKU7J9dU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mvsMdqlrZflUMcGarFKUW1cQ+K9e6pvoW52898rH0kU=; b=PSQDSPwsiGNTADZ5z7gL7ZAsTet9OGhwuu/vq2pPblnQnSxyXBCNrjme8QwjfpcIHL lrmUSpJZOhpp1PCwSGWW1kUz5evyysFILL9mRCikRko0P44mRhrlaUTpskheVAH9Hctc lVyrUQh6x5l58HHAGfSnJgUEX7wb9kBXEOHakoVFkwkOWpVrwZ+fTJsecSodw+d4HTSJ 3++FbEDXHLLWmRdAm1lx+4Z3lcqkLEwo0iHmTvr01Uacz+lIQUjMT04uFRf4VGmTMf9S dE0pLhpJowKcSIVN7N1K+aH18aeGdgAGhlekSAI72Xt2V03xs+hCyU7NnbkeiUTdYOcr PvKA== X-Gm-Message-State: ABuFfogvhohW6A+kU1tljUiLo8xbLXcbWgGt5DeLB2bW39M3tJvpknQ7 nXzQ/RXvDhTrl9VgMLfadHV8BFI92lk= X-Received: by 2002:a81:7cd:: with SMTP id 196-v6mr19929645ywh.434.1539911482018; Thu, 18 Oct 2018 18:11:22 -0700 (PDT) Received: from localhost ([121.95.100.191]) by smtp.gmail.com with ESMTPSA id n7-v6sm5481918ywb.8.2018.10.18.18.11.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 18:11:21 -0700 (PDT) From: masahisa.kojima@linaro.org To: netdev@vger.kernel.org Cc: ilias.apalodimas@linaro.org, jaswinder.singh@linaro.org, ard.biesheuvel@linaro.org, osaki.yoshitoyo@socionext.com, Masahisa Kojima Subject: [PATCH 3/3] net: socionext: Reset tx queue in ndo_stop Date: Fri, 19 Oct 2018 10:08:43 +0900 Message-Id: <20181019010843.3605-4-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20181019010843.3605-1-masahisa.kojima@linaro.org> References: <20181019010843.3605-1-masahisa.kojima@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Masahisa Kojima Without resetting tx queue in ndo_stop, packets and bytes count are not reset when the interface is down. Eventually, tx queue is exhausted and packets will not be sent out. Signed-off-by: Masahisa Kojima Signed-off-by: Yoshitoyo Osaki --- drivers/net/ethernet/socionext/netsec.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.14.2 diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index e7faaf8be99e..4b32da76d577 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -954,6 +954,9 @@ static void netsec_uninit_pkt_dring(struct netsec_priv *priv, int id) dring->head = 0; dring->tail = 0; dring->pkt_cnt = 0; + + if (id == NETSEC_RING_TX) + netdev_reset_queue(priv->ndev); } static void netsec_free_dring(struct netsec_priv *priv, int id)