Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3214682imm; Fri, 10 Aug 2018 05:49:21 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyZV/UG8vGRmFG1Ronea44G1RmTNiua1zBb1rlg6QvgCyPG+OCFD5XQ6PGaX6Rw1P1qa7gC X-Received: by 2002:a62:b917:: with SMTP id z23-v6mr6982866pfe.131.1533905361122; Fri, 10 Aug 2018 05:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533905361; cv=none; d=google.com; s=arc-20160816; b=C42Wd8IW2g8902O5Cqcl6KOgUVWaCa63a7OvY9Pmnlw2x+MVO28aXKHPLQBPx49g8C QXDs+zUJeY3v6CE3chghNSj8pkDF15uswfvI5IZDvlLXBhS6UFu0uKJggRBxNitR6dzf oj63d+1mPne504t6LB04o7HtbN7sOUEB/+M95xGWl6HTm18IS2O+JczeU41JYuN2Uv/1 Tzj0fjWfnPO3woQ1nVTld2GZIwRbxHdUYNMovBfCPf6hVhJ7Qr8C5ItS48+P+KbxoJxi MW17EU7MdpTPbSZ168CCywquv6EC6vDFfDycJzszmiRYg2+roXJlClWDPqoi7PArPAtn hbqw== 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:arc-authentication-results; bh=0/BAzsY3ygWwvCiEZ/10Pn/Lg/p2uPBAkEn1J4zXy7s=; b=RdRNkkvGrmMe8YEEgTjyrcmT0dfncHM/mCAt/C72HpOFxScCvvKrtnQuAOVcKkRf0K WjTug7b9p5wROHn0ZOcWNZvQxOjFCCmrMy+Mj0Qg3n55tYa3maUiWA692oip2MeRRIRW 2qezIUf5UZ3RVfHA5lrg60E/nMsLlo/7Pvg7AhRSay+QTtNHG2ALdVz2WmYnaXSPMUqx Cn4/LgpsAoT7TH+pZr/ORXpaZj/KQvqyuv/yAuL2WsXT34bjzrBLrLLdo38OvgkNxFn1 LjgjVIXkbuuGvuiakNeeRhkrWBXqiyebGtmFpRsfN31RudrgkJI/D6jhMMSmHF4priju bQDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=elfy2KSg; 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 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 u26-v6si8185591pge.590.2018.08.10.05.49.06; Fri, 10 Aug 2018 05:49:21 -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; dkim=pass header.i=@linaro.org header.s=google header.b=elfy2KSg; 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 sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728239AbeHJPRK (ORCPT + 99 others); Fri, 10 Aug 2018 11:17:10 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:42834 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728188AbeHJPRK (ORCPT ); Fri, 10 Aug 2018 11:17:10 -0400 Received: by mail-lj1-f193.google.com with SMTP id f1-v6so7068411ljc.9 for ; Fri, 10 Aug 2018 05:47:23 -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=0/BAzsY3ygWwvCiEZ/10Pn/Lg/p2uPBAkEn1J4zXy7s=; b=elfy2KSglYDEJJxxOi/LXkMdCR5gy14vWgFCPrrD2WTXhDnvaUc1VJDFb0m6LYIODJ i63AlPUo3meeXB7hhfstAUfH6LFR25BNdJFVHeMzqBwAzFyY6bjS+cZEAOIwi7gvyQRV g0ZtlAxvALSeX2oqVwEh8x+KLpn64hiVpXNUk= 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=0/BAzsY3ygWwvCiEZ/10Pn/Lg/p2uPBAkEn1J4zXy7s=; b=aG2F8lxSNZc9mMv0SpJn+V+1TcW4VONQM2S9bNyp3NCzxbq4sUHSyTC4UsGoqfSFgG tdST/LKPrfrQOxkrnqnaBoJxFy3bulioPDz4zQ/kCtcQz2v/+LFqHD6Bi/hvsHy6ueIv kp2EvMcvgax0AVQZfpL1bubPfaJICgjUtZaYlCLWyIKBMG2Odo0Ns160rCdJYCt/t7i3 7NhJ7Wi5J3HrR8j23NMOWXLyscyiCk6QWwvUA1ensfJgniTO0YbAX5ph+T9RxP6ghSoK wH5OFprQkwLf7sZBEJ2UWLs14ytRvqlTM8ZBNUp1IRDXiyV3q1FZwKDb+NlCG4nC0aXv FgMg== X-Gm-Message-State: AOUpUlHbYYzY64aZcRLQnp6myuGGibve8jEqlbH7fP06ZVPputjNAWTs vwwXEauR3eWlmtcauhLZh92x1w== X-Received: by 2002:a2e:498:: with SMTP id a24-v6mr4875106ljf.27.1533905242306; Fri, 10 Aug 2018 05:47:22 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id 84-v6sm1626382lje.48.2018.08.10.05.47.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 05:47:21 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, davem@davemloft.net Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH 2/2] net: ethernet: ti: cpsw: fix runtime_pm while add/kill vlan Date: Fri, 10 Aug 2018 15:47:09 +0300 Message-Id: <20180810124709.25089-3-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180810124709.25089-1-ivan.khoronzhuk@linaro.org> References: <20180810124709.25089-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's exclusive with normal behaviour but if try to set vlan to one of the reserved values is made, the cpsw runtime pm is broken. Fixes: commit a6c5d14f5136 ("drivers: net: cpsw: ndev: fix accessing to suspended device") Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 9edac671f276..3e34cb8ac1d3 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -2086,14 +2086,16 @@ static int cpsw_ndo_vlan_rx_add_vid(struct net_device *ndev, int i; for (i = 0; i < cpsw->data.slaves; i++) { - if (vid == cpsw->slaves[i].port_vlan) - return -EINVAL; + if (vid == cpsw->slaves[i].port_vlan) { + ret = -EINVAL; + goto err; + } } } dev_info(priv->dev, "Adding vlanid %d to vlan filter\n", vid); ret = cpsw_add_vlan_ale_entry(priv, vid); - +err: pm_runtime_put(cpsw->dev); return ret; } @@ -2119,7 +2121,7 @@ static int cpsw_ndo_vlan_rx_kill_vid(struct net_device *ndev, for (i = 0; i < cpsw->data.slaves; i++) { if (vid == cpsw->slaves[i].port_vlan) - return -EINVAL; + goto err; } } @@ -2129,6 +2131,7 @@ static int cpsw_ndo_vlan_rx_kill_vid(struct net_device *ndev, HOST_PORT_NUM, ALE_VLAN, vid); ret |= cpsw_ale_del_mcast(cpsw->ale, priv->ndev->broadcast, 0, ALE_VLAN, vid); +err: pm_runtime_put(cpsw->dev); return ret; } -- 2.17.1