Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp647130pxb; Wed, 3 Mar 2021 11:39:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJz49k5Ak48bJoWJFySnDlpQmAmCuE1sehcTD7Tc4AVyVE4E3j4OiTHXib8YO5Ymh1oRv5Nd X-Received: by 2002:a17:906:bcfc:: with SMTP id op28mr425125ejb.238.1614800376246; Wed, 03 Mar 2021 11:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614800376; cv=none; d=google.com; s=arc-20160816; b=od3oaFiqySOe7NEkA8ZbM69ASZQ8zxBD7KZPiGR9QjB3M4v6zTfg28SQS0wYEBtToY sDH0hfv76FGova+/A6quar837jBVrYbGxzWn3oT8orHfERHmMTkSdPHhXSgw+0Y4cEUz m27XDltIqLPSg0sIV26WKHKy8J0Mql5jRKwu/F0NgiXBVnaQEE5ZVdBb9GpfadEdmSab WO2facbC3Z14cNE/Hj2omR1jhCaSqWw2n8AUdqPQz6wZPCM7Ww19fTFjMGqALUbOtrVL Fof/Yxj+ImFBHKtGmd5eYatLLZGdltIzqraezFUXmNlA6LjRpVyMyE/vEnt9vxTBLwxA 2wlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NBDhmIRYkAReW1HMgKe8BKECTnarIJCh0pjYwG5AqKc=; b=h3/CDCCguhXFtvQZHHAAieRJrUYBPhwE2YbSM9HeS3pwIw9mWIHSzPbYUpVRQ5yT2+ oFnNjJRiQtzS+ZwVL2vqFfkWB+eHUrpdnNj6TX2SvP5vRkHE8/BwEh40/xLRMNwA8Zun KKGDiYiW2kZBDzesxSkY11USo4R956+hnAdac5jeeNHfpnWLSMfgFF88pNLpZOPLcIrg j+j0G7URzunOyCJXIVcMjgYoLwTsd33w0yYtvjLQWuZ8lWF/mdRhxeLHT3/vwnudsbSk bVoANg5pXwVXLAu3dCIXtbsCBJlkUmqTexXsM3V0dWNLgp1GU1wPDbBmEdvNJVyIuQ6C iRNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LbJ1frU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si15292266edu.474.2021.03.03.11.38.05; Wed, 03 Mar 2021 11:39:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LbJ1frU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348893AbhCBB0H (ORCPT + 99 others); Mon, 1 Mar 2021 20:26:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:39720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238330AbhCATKS (ORCPT ); Mon, 1 Mar 2021 14:10:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E19A265013; Mon, 1 Mar 2021 17:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618658; bh=auMRN0G+5fsj0k1DzJGn4zdrLsPMVxOR0hAixXmAYjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LbJ1frU4wRHOjeTguBGbAUSy1Px4NWnVz0whZD0HWfwUEavTbc1CG/GfoFbn1JlnK ZwxrZyFvDLoQgBevwvcXl3meB31aHyryi7INv2axb+FheVhmYVK0XxPHpnYZbnJXrg sTbIngThgHFM73EZND6diaHiiriR1ia5rsCpIb4k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 128/663] net: dsa: felix: dont deinitialize unused ports Date: Mon, 1 Mar 2021 17:06:16 +0100 Message-Id: <20210301161148.080490383@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Oltean [ Upstream commit 42b5adbbac03bdb396192316c015fa3e64ffd5a1 ] ocelot_init_port is called only if dsa_is_unused_port == false, however ocelot_deinit_port is called unconditionally. This causes a warning in the skb_queue_purge inside ocelot_deinit_port saying that the spin lock protecting ocelot_port->tx_skbs was not initialized. Fixes: e5fb512d81d0 ("net: mscc: ocelot: deinitialize only initialized ports") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/ocelot/felix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 7e506a1d8b2ff..4e53464411edf 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -638,8 +638,12 @@ static void felix_teardown(struct dsa_switch *ds) ocelot_deinit_timestamp(ocelot); ocelot_deinit(ocelot); - for (port = 0; port < ocelot->num_phys_ports; port++) + for (port = 0; port < ocelot->num_phys_ports; port++) { + if (dsa_is_unused_port(ds, port)) + continue; + ocelot_deinit_port(ocelot, port); + } if (felix->info->mdio_bus_free) felix->info->mdio_bus_free(ocelot); -- 2.27.0