Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1490571rdb; Sat, 10 Feb 2024 04:34:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXPVzrJdjxym+et+n9LN72ZgLaFUp460rJwJ9HSDjfguo2nFcgeNb3s6lrcPv3qAxRD2zb9PqnT6oIveM6wtErxMW52yGQ68+m88IhoNA== X-Google-Smtp-Source: AGHT+IGzVcVi4F/tXS2/hiHf7NcxazpIIvfp+60bJ3EhEpuwaBISfjMbMhuWVjBsrmOtOBQtKuZa X-Received: by 2002:a05:6a20:a93:b0:19e:c32f:35eb with SMTP id b19-20020a056a200a9300b0019ec32f35ebmr1604584pzf.3.1707568441010; Sat, 10 Feb 2024 04:34:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707568440; cv=pass; d=google.com; s=arc-20160816; b=syiWTOtVUbnWeZRHz5ea/jciiSAHE9qUFmaV2ngTjuJiHZo8ocFCIoqN+ZDKohqS7h sFAECKtbzGL8ndXsZ5sNlWB8cpwAsPnuJ9rr3nRdlYniU5ToYJs9giB+yjY9/4MzDCtu 9g+8YXyOR2i/xdtdTWO/zmOmyaGhJh9nYpXxa2952UgM+Blz5MdFGWX6rE8lBqEBd//G fjG7WnSOysEwiSJUy5oNa93l5NNpGz6KpP/KM64g9/qvjnPXZ+8pxDaicryWIqPYoacG HGsz2BDE26+YikOgG40r0alJo2SKPvNFVVke6XSfBAw1dea/JndNycHrAML3QTGESDCF Npaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=sJVjrzAqciRb2/LRj7N8tiqtGPPPqEc7yCwP1DwWHTU=; fh=CPKSYJEmok/wUr3oXWHHE3ZbyoML2AacQfOYJ9lzqRo=; b=SKxHnYJ0ohji3H4yYCGArsRBwe5gnyCJ7cRruRHlSrMXmIJdLpKINPBgO4VwsnfboT UtiuO6LaMfg8N/htYKWE7EAuuC2wNcZ79pZEbHtmUFLRIcQ9jd/tnYfofBh29emqON7M C+a7BFCLW1LO/e9dKW8ObRW1b3FrRckH6c6S1Afus++duxH09Jm8PbOKVFyUlqxwAI/7 AEwl038GUfD/st11y/aYGW9eK6hEwltSx/rbuyTC+3BBvkafwTD0Vktrolc1ZujT3ieK wYt/YTzLGfZw4PPey3I9hVHV1XHk1teT7WhaSpvJ0pxyETZ7MFTBCju0e0h9GbC9W5ip XGbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=l7T8VIHe; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-59696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59696-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVQCxRyRqg9ZLhV0QE48uJ4uK+cXS/KIjH7xsU6dkQj725Nc1xXXVJdU61c68lWS+CrkRArHUZiwbDMyQfVuIMy91IxUIxRBY1ZEtTU7g== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ch11-20020a056a0208cb00b005ce0be7966fsi3605480pgb.898.2024.02.10.04.34.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 04:34:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=l7T8VIHe; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-59696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59696-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 73CD928AAC0 for ; Fri, 9 Feb 2024 17:06:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C743F80BFC; Fri, 9 Feb 2024 17:05:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="l7T8VIHe" Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DB2E7CF37 for ; Fri, 9 Feb 2024 17:05:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707498312; cv=none; b=RMKLTgNUcXRC5Vxs6/eVJHpCyJ8u2sAgxoycWCMnhPqpQl6bEIUuAcmdoDLbXAkiezh8DUVKOwE+MghtDhuetz8rgSG+gl6mNbC5hCzDs6QCjoLtsH2S/2DB6aIkZPTQ8dJpTuFntArblc9AjhQOlAWosJsgAcBVjgWfrsUlLt4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707498312; c=relaxed/simple; bh=E9qfFlPW1e6QyyiFWyQNW8LWGspZ155/NwV+vfM7aoA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HXEW2FScKo1XqKyxJ0zdfBEOu7gFe82JET3NFPov0MTM2SChNApQYTqYOOD56Iz0BEc24B4IhwQxKkL28NovT+P1YSPlcRP6bbSoODyRH46fiI7kAU2n5dUUVPUoUusTUiijy2HWC5v59xD9FR602GaCAc15xauS4vIIlb5RmDI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=l7T8VIHe; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-33b0e5d1e89so727217f8f.0 for ; Fri, 09 Feb 2024 09:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1707498309; x=1708103109; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sJVjrzAqciRb2/LRj7N8tiqtGPPPqEc7yCwP1DwWHTU=; b=l7T8VIHegpD1YRWTO6MaIW2hj6CeU+uTg5tmRZ3y2TRklBUpQTWPvdsoLPhKmVOqUv QgRzKMXBg0ut+7cipkcImfG6GD6hpaRcqtiPlauQAOX4xqqqKt5rQGJKAytvzIrlWTcT b6pkLV1KFEm5HKWkfBDmIc4VFq3kyKvd4nwjgTJWDsarNV7ziH3wQSSi6bA4DJ7iiJPp 19I731vgH5Sys0J51pDwf8WM1UaL9vzNeC2m/KUXED+yaiBleWTGuhGeBpf3pTfrmqdV jU2oMlTH/Y3xBdJ4yGrIcJKaS8eUcPLmt+/vG9l4GU+bq7jY74RyTRDAPBmLA6IF3lZO SeOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707498309; x=1708103109; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sJVjrzAqciRb2/LRj7N8tiqtGPPPqEc7yCwP1DwWHTU=; b=KERJgesn/UksiohgAxBnttYf14ldnoCh5V/6CDKR/I6gWnIsIVqle24oeYoI/6rH9t bZONxtibKQVggXCw1yBfhbHd+Vf48CztnODFowR6xa5vBojyKXUAR7pCRUSRcUTvxzN+ ntbQJmysS3juzyIzD+ESzXHSIs0964RUJbnlFRT90vspJRnQMNLjDVK9bGiwMTjs/962 n+aonykvci24tGIAAgHcUXACD0x38vEaK/SkyuyW5MlBrt0h6l4VqMA6N7qOmihnp6pP zStt61t74eQJvk6vnADBv56xNEJnSKkKiCarvXhEheMszvi1IRicmt9Z2CY6ZIFYmAVc rdfw== X-Forwarded-Encrypted: i=1; AJvYcCXuXUEFButP+HeMc7Xs2byS8kb6ubhuwmCPJNC7ABdRLZaSSe3ZX3JC26ICSB64xKcO9Jm4wRdwkKuAYws0E13L9Nm7czf/KhGC3DeY X-Gm-Message-State: AOJu0YyNiKfEvJsj/XypcMkLSY4B0ETtdW81FKkwJ+C4bYJ60b/JAF+5 t6Vu8Me/bfe2QkPb3Igch2i0vVJ7vydNaaYQjrxqdPic14xhRmJB9y4YK5/Zwx0= X-Received: by 2002:adf:f987:0:b0:33a:e7de:aa8b with SMTP id f7-20020adff987000000b0033ae7deaa8bmr1508064wrr.26.1707498309451; Fri, 09 Feb 2024 09:05:09 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUL4NavJtL5JVa5Qyv6YHLP16s54U4xbfNKAHPk4QSUTjHRZVC7rScJU2FPwmIlt5b5HX+LCfOT34/72Q9ciLLpeaEVxL8z/63tDftL56fqTjsDzwzwsxM+iS1lUHZau+4yGYUkv+XDo762sSc/3MQxMQ5D0ilM5MW0hgWRBglOy31oJFFWTMnMF6SkJCf9copIVlu0I3rUm5CSFm/rzAEogw0wWxINU2/ly9Qpl0O3lkygYzXQpUGpEXQb8+MyVWTeI94r22kUn9+84bXezFq3HEc6y1fzHZxhoWLC27uKfqO6GOK/gDoRwy7Ue+KEw4ZmJ826uZE2e5Q= Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id j18-20020a056000125200b0033afe816977sm2254998wrx.66.2024.02.09.09.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 09:05:08 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH net-next v2 2/5] net: ravb: Keep the reverse order of operations in ravb_close() Date: Fri, 9 Feb 2024 19:04:56 +0200 Message-Id: <20240209170459.4143861-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209170459.4143861-1-claudiu.beznea.uj@bp.renesas.com> References: <20240209170459.4143861-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Claudiu Beznea Keep the reverse order of operations in ravb_close() when compared with ravb_open(). This is the recommended configuration sequence. Signed-off-by: Claudiu Beznea Reviewed-by: Sergey Shtylyov --- Changes in v2: - none Changes since [2]: - none Changes in v3 of [2]: - fixed typos in patch description - collected tags Changes in v2 of [2]: - none; this patch is new [2] https://lore.kernel.org/all/20240105082339.1468817-1-claudiu.beznea.uj@bp.renesas.com/ drivers/net/ethernet/renesas/ravb_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index a1bf54de0e4c..c81cbd81826e 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2321,6 +2321,14 @@ static int ravb_close(struct net_device *ndev) ravb_write(ndev, 0, RIC2); ravb_write(ndev, 0, TIC); + /* PHY disconnect */ + if (ndev->phydev) { + phy_stop(ndev->phydev); + phy_disconnect(ndev->phydev); + if (of_phy_is_fixed_link(np)) + of_phy_deregister_fixed_link(np); + } + /* Stop PTP Clock driver */ if (info->gptp || info->ccc_gac) ravb_ptp_stop(ndev); @@ -2339,14 +2347,6 @@ static int ravb_close(struct net_device *ndev) } } - /* PHY disconnect */ - if (ndev->phydev) { - phy_stop(ndev->phydev); - phy_disconnect(ndev->phydev); - if (of_phy_is_fixed_link(np)) - of_phy_deregister_fixed_link(np); - } - cancel_work_sync(&priv->work); if (info->nc_queues) -- 2.39.2