Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp497190pxb; Wed, 3 Mar 2021 08:16:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYxYfWLnAtqiTjbz6r0MYqFyJxhjKpRV5uodTADLZiZBn8IEdMrLtmGJzEvG4Ixo1QVY+S X-Received: by 2002:a17:906:66cf:: with SMTP id k15mr26048740ejp.296.1614788208502; Wed, 03 Mar 2021 08:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614788208; cv=none; d=google.com; s=arc-20160816; b=T/EWABsyc9Wak6axpbMTVEBVn7hqWVZNzlwmSO5ikdWgax8jHCapIRrVMT4hUANsNG lebnAO0VzJV90RfqyNUhrHnF4UhkN/JZ1PyXXSKzLZFORC6r9z/AJ3E4X2nQ1L7hf8Ua BDyBKC4VJUdK1oI3pzXrXfOg1K0g+lOtodcziARuUbgaa7joqspVWYAVkf2M23/dnvUr 6gIAFHeD2bJnVyWBn5OchPfB/T/Vx/bIJwr1wjMt9AQLCPIeIjFfC3DfVEMYTq14nzx2 DyJEezbGAcgJkdjVXafdfeKm6muWBWvk0EtlqnnL++KqAkwZF3wGVR0kiyzGQ9VYH+aE C2Hg== 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=0UQHmwJbVcOQOv+xgEPoxi/MgqL/gG14PAYSp+//EWo=; b=Oxm9jDYlA+XWQOTaKEY27kirxvplYfNb5ztvZrq6IOMDjljDmVH5czJhxfjXzxKBKP peQMQd8f+RnxFXYQi6yOgRlUXbud2yP18QJlsTUBNga/h8m8zs6wrZlJ9CuV0ZyEHGBS oLoPtD4M1kiJw+xHZU4w/dMAThJt0j+162UTz3FbhXs/dKjgWrCz/duodeL9xRefqBXa k1z8IDFjBm3dcXOtsKk9ZB9efYbXajaQSnkl9Q6oJoRLaBxYWkTdJqV6GV4+VwyK84dU vArUnR2taGkRNDjZmQ8ZmlVnWpxoCg/N8ZAmcfdRQMniOfKp0UvmHZf4TX7ct4EYGPlx ymMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="p/ZmKozy"; 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 jz2si11833489ejb.140.2021.03.03.08.16.14; Wed, 03 Mar 2021 08:16:48 -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="p/ZmKozy"; 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 S1346658AbhCAXtw (ORCPT + 99 others); Mon, 1 Mar 2021 18:49:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:60784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239314AbhCASLi (ORCPT ); Mon, 1 Mar 2021 13:11:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E522065002; Mon, 1 Mar 2021 17:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618552; bh=3TSOCWSbxMbv+ZLvWWzVp+G1pgJtUN/C9RJnkdffBhg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p/ZmKozy9lLjGPNtSnTKEJKPvsEPBt79ZLJiLQINg1dOCt9KpKhGVQG8HI3zKd5g3 uVJOKFkdkJbny0k7XiyPd/p31DE1Vs60KGXtKRPdlE7aw9TWUEj7NygL8p3VoEP1pY 4yoTuok/IOj/TwOaSZquKM5NOliANAmbgEokBBjE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , Florian Fainelli , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 127/663] net: dsa: felix: perform teardown in reverse order of setup Date: Mon, 1 Mar 2021 17:06:15 +0100 Message-Id: <20210301161148.028960679@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 d19741b0f54487cf3a11307900f8633935cd2849 ] In general it is desirable that cleanup is the reverse process of setup. In this case I am not seeing any particular issue, but with the introduction of devlink-sb for felix, a non-obvious decision had to be made as to where to put its cleanup method. When there's a convention in place, that decision becomes obvious. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/dsa/ocelot/felix.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 89d7c9b231863..7e506a1d8b2ff 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -635,14 +635,14 @@ static void felix_teardown(struct dsa_switch *ds) struct felix *felix = ocelot_to_felix(ocelot); int port; - if (felix->info->mdio_bus_free) - felix->info->mdio_bus_free(ocelot); + ocelot_deinit_timestamp(ocelot); + ocelot_deinit(ocelot); for (port = 0; port < ocelot->num_phys_ports; port++) ocelot_deinit_port(ocelot, port); - ocelot_deinit_timestamp(ocelot); - /* stop workqueue thread */ - ocelot_deinit(ocelot); + + if (felix->info->mdio_bus_free) + felix->info->mdio_bus_free(ocelot); } static int felix_hwtstamp_get(struct dsa_switch *ds, int port, -- 2.27.0