Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2941631rdb; Tue, 13 Feb 2024 01:47:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUquJYW/nI4GdGpfsKLs8wg9qiVBpWqAH14jqNVIRqP+QKugVnlD4zx3ruiLQu9NGveTKGcRC4ze6XGObNDWFR1/EIvFI9BnmrFu9Sf4g== X-Google-Smtp-Source: AGHT+IEMw7djjEFiPsfeEZKYyr6jGVt8/G226uWV82tYe5085SR1Lg5so9zTNEaEenWVUae/7k6q X-Received: by 2002:aa7:ca4c:0:b0:560:aca:6344 with SMTP id j12-20020aa7ca4c000000b005600aca6344mr5982326edt.0.1707817669155; Tue, 13 Feb 2024 01:47:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707817669; cv=pass; d=google.com; s=arc-20160816; b=h7uuuA03Mfr99uk18I7rtn7jiodgYU0ZX0t3JrJxdMPknKp0RGL6Vni4TwE+fp2ysF q+Cfp080MEz7cdyBUtAAqwZQg6AdaPVU4igY5yA8n88h+8Y1o4IhpnOvM4s94wTm1RUv 16MbqUS9TDgjjKhD1b9ex3FWcIdjheCTd/MoYdGtoHe5ZDgZ52sId3Y3JI90zdLdwViv XLJr/7X0V4BHUcT7HSAAItsaPgi/qXVqwvAM9ACs7pToEv3NrqmtJOyjtr9ZRAUHbCZi Q2+rPYccBkdR5CrgoRmMjovsS5xdPyti1wM507yExb3fqLrdYAj19YjYk5b70sOXAUgl XfWw== 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=aAa50mXZbPqqgphxhzpCHoCd19uwy4xnnSSFW1+XwKE=; fh=K8KHhGLk10x0C1wld94MUcaRzcOH+wxDRojrnbVlK74=; b=c0fESVZaGstwdeODxjBFekLsQyBAnjlmBGaUSRS3nmAYago/WMi6SKWGnf54eBTDn0 L5RmExVpl5BX6yvNSMiWCjbANIWAKafs1H/zbff0sW+/AIY6hBhiNu0UGP2HN9pskfnd Vpp+ez7izgIr/MRZg/03qURZESySwEpWKeiK9FRLn4HssfYVuplWVYyXEIOSb675CRF8 LLdwLDhnvutWpZ3lyz1tAOVFMKBNf1N/lwh+tiHbIoyA6qNRqnPqnJBSGnEzqSfdMk/S J/9YtiW1/SOLt2F+NpkrCDj/6Ct6NgGJC6h143A8mWl9eZbL3TaN6ioV4ouz3Vrxv2ez XpxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=KJfPgRHL; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-63248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63248-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCV0dG6HYu1SmbsN5KWETYIKKnennNlFxPJxhFJqmPZbXOux0Y5mZT4re3Zv/ynXb/jaAjEQPm2L5sJEGMXrGWv5gfDWdjrbpQIe4L4ZOA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y7-20020a056402440700b00561e9c48fd6si766418eda.390.2024.02.13.01.47.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 01:47:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=KJfPgRHL; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-63248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63248-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D41D51F28457 for ; Tue, 13 Feb 2024 09:47:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 175204206C; Tue, 13 Feb 2024 09:41:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="KJfPgRHL" Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (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 51DB239AF0 for ; Tue, 13 Feb 2024 09:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707817307; cv=none; b=i0obhsMOtJY5lR3JE/gKrPAP0J0s/ABIrL/GZ35CP5pOydvFU9bLFyNre43eOi9d4RgBbMLIXl8O/AbQJ8gLImTlpry4H/tzm9XbRUjNTbJr/y7wSC05l7hF7ZUbrdtxFZcoafPXZ50HLANXsCpoM0vp/E0SSMlISdFoQ8Yrso4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707817307; c=relaxed/simple; bh=enmy+LoY5r8g/P1HcJj+4PzEb3nLIvXmdJEA1A5e1ZY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pzMidNP4T3wQ60YAIVSHU/YdslatKZaDoA0CSlD86xHBynCwemjedeLW+pffVkx6r4SP660CDP1b/cwH3ajYmuzlg30KsVxnpkhzna9+BVxY/2pIzfAV0pQhiKljYRBmTZ6qapMIt0Wo1L7+Wr/UUwaiA0nUnUxP9XNfDOl0uLI= 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=KJfPgRHL; arc=none smtp.client-ip=209.85.167.54 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-lf1-f54.google.com with SMTP id 2adb3069b0e04-51165a488baso5433204e87.2 for ; Tue, 13 Feb 2024 01:41:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1707817303; x=1708422103; 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=aAa50mXZbPqqgphxhzpCHoCd19uwy4xnnSSFW1+XwKE=; b=KJfPgRHLm9Eq94KaPzNNmX+TEPHUXD96exrxaHIMiQrUYOXbxmZa2eY58kj0aQ35EU X+uKVtSHqqW0St7ruKV8XAL5bR+lY4EBPNM8rh0J7R9fUM53YwoKDnk5Jr5zm6UFyedY VYY43gxGBsCQ10CC1njy2L6xRdR4gaQzrVEu4ssnSzhw3GLF3xYOZnUXnMywj7HjfkKG QCbPjakxCPXdDJzwTEqkyM40+5kKyCajfn2Agrcm+3JCTt50xSlzsRc3eNVLG23XM8iu nRKCaVJQghoEcUFLDDobCzPAg0lYUt5n7g3mh0nPrIE81eLVhUKVSnHfId41pKC+0fEM 1LmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707817303; x=1708422103; 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=aAa50mXZbPqqgphxhzpCHoCd19uwy4xnnSSFW1+XwKE=; b=gq49cQe4Fwq55x4yCVmBoeJ0HOUEAaXShcSPgcMOzFcIzjEnuifgJ8503WJTfvdbQL nyxh0tXZi58jNw247AZm8jbjMQMTMmjMAZULtunicDhBi0BIjg0n0g1fQ4XLHhDEl3UH rGOGdoUvK3HABcHvUQMX7ryHx1Ki1Q/5tYcrT/x38Wd77YmWeKJp2Lh6c2YHUAVWMPI6 PbZvLs2VYxX32yWP6JQImolA1lj1g837bZ1vVX46IXgtnPs07W7eKjPyJjpBfy3GwSgz NJ3UO5lO1ilb7k5sdMAxN/Ve6rUm2NrrEsINOap2qaJlS0yPw9RBsgXqzpFbLn8lrQIK UEJQ== X-Forwarded-Encrypted: i=1; AJvYcCUrNsdWjHwL7aosqZAeYboQNgvDOYGR/5LDomNPptfqjH2IbQ6vIUBGLyCj/uFajerBK99heOBVFp2JNAvDDDbWLthpRDKXdIssZtwL X-Gm-Message-State: AOJu0YxC227iOMJ3ZPNQl2GBC36cV5X7pPIc/xJdCBOisbgpNnoqfVGy dLesUILfpmB7M3Hcghl1FFoP7bYcctjAzZyKW3A90l6d5QE0aQ8bg8A7Iy7VvyM= X-Received: by 2002:a05:6512:49e:b0:511:4ee3:dc0f with SMTP id v30-20020a056512049e00b005114ee3dc0fmr5561325lfq.19.1707817303330; Tue, 13 Feb 2024 01:41:43 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW69Al/3XiflcXDZn21jWBYjJTg/9YKAkSVPu7lcjXWsEFj22RQh8x78vO7ZDXQ2jbkrOg2+H2Jh5cJoPHYHc1gWmn2Fmy3w0baKaxs1oaLpab7PQLXyv8vthemHmcCWqIGDr6FF6lBFIb7DvWYESwnS1UNT00GA0k9KBsTi6QWmNOH9CFVFt8X8RT/jDoJ6Q8jfZ36yOJ5r+EJ47XzX4aW/ykfx3Y3TirLNuMe7uraNmJIN25disnVBZUpPUtbIqOlHes6vKvSHqoTIfkRlMq9GqFaPyD/D2+69D7wmqp1/2Oc9SG4LcLI5lpESA+o9VHA7gYHgo12c+jW3DzcQNrbPsomBPmgT3cZHDH32ar0o5soRVXm Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id fs20-20020a05600c3f9400b00410232ffb2csm11207446wmb.25.2024.02.13.01.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 01:41:42 -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, biju.das.jz@bp.renesas.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 v3 2/6] net: ravb: Keep the reverse order of operations in ravb_close() Date: Tue, 13 Feb 2024 11:41:06 +0200 Message-Id: <20240213094110.853155-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240213094110.853155-1-claudiu.beznea.uj@bp.renesas.com> References: <20240213094110.853155-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 v3: - none 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