From patchwork Wed Jun 19 18:45:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13704446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C2E3C27C53 for ; Wed, 19 Jun 2024 18:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IuxLK+Kt4TA0IWlhERRNrzNbAxkSoJre0Y5sVJZCXq0=; b=zCDZwbFIpSwr356ASAQjNJMkU8 aHck13FDT3GE952uklSi9vOzag9AmTXXQPbiTC2QnqW+k56Z3NDcigLYjxH/7J//sNED3xJF0Sq6b WlOJWJsROEAfvcIwwd3Np7NpRNrfRsJGJoqHdJJWAWIYVamJRL1fd51V/xcGbltIXow37iKogwLdU pKGta9bL6zFmmCwUVunrTqHfQ7jX+jZfrclSGPwy2r3OJXPARoI3LFsd+Vnd6PUddCbmQggj9HmZd tLmbludkNlHY/iBexAjGXerD7kBdTiUWq4YqTnCMP8dRRYyunNNUz2HIU3kJdEQwSoOxM83nP1WPS CMrbu6hw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sK0K3-00000002QbS-3iBo; Wed, 19 Jun 2024 18:46:19 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sK0Ju-00000002QUm-39wY for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2024 18:46:12 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2ec3c0dada3so1003011fa.0 for ; Wed, 19 Jun 2024 11:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718822768; x=1719427568; darn=lists.infradead.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=IuxLK+Kt4TA0IWlhERRNrzNbAxkSoJre0Y5sVJZCXq0=; b=12J8kqAMRP4XwcyYw+bgRAtoeIA163PAenXTPdwQwgLR7pAVZNZNSDf/cVgrbzixpe q8OjpfKswJo6LixLLp2gusjyZpRJcitHnEe42ouYsSFt5RVJRJrmRasQtA1lR93TH0oa POdexRy8OGR7puS6v0+MNPPXAz7mHM19oVWuFMGxageSiG9Azdp1G/kiKLY1qmfLSg0l I9nowRlqTr5EsA5b9/kwAsSwnAYGIDB6X0tygzSjyT9ubgdp0pr9CTkVH0rjghr75uwK dHToJ1eJlSm63ga6zbqcmwfF8F7gSci/VZ1VYHzjPuo4hjVVaQ1qSQCbNyClzRkEbNaU P0nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718822768; x=1719427568; 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=IuxLK+Kt4TA0IWlhERRNrzNbAxkSoJre0Y5sVJZCXq0=; b=BHAE/ICX7wpktE34V/IoBoTo+b6b/tOYDlLCHDNDWXKEDxzCd2X7KjidcitNyvYSmX VSs16rsGkxdYiEcPfrT9LJAt+tVbjr30x3pFIJ/dsf32ETJ76J3V0J4ATuZXOtMCAuBC Qgh1RlCyrVHvGqcXpSw1f+S9blZkThWxaA+sqekCxTd2jiE3HiqOVgz2pQmjO4W+M8+K 7Yc7ZNNgy+ZHZrld72azmbLeZscTsva3p0A146pBJgKMUwbBTQnrygkxyWJCLzqfyHak rakj25zPh8XxFaXOZV78f6hgQECHNRQ8Tk7OYKijQj/uc2TyuRDn+30YaJzVIiU5W2RU NhvQ== X-Forwarded-Encrypted: i=1; AJvYcCW4pKucGj2riyFDyCZLR6/4n547EtSwqO/WBisSOJbNGiRJYPphS3zu9QgeBCISU8TJ8x7Yt24vEGMrxTEXX4zfrRHeqz8QZI/S42NJ0wpKx/ULCfs= X-Gm-Message-State: AOJu0YxzTTJHV8mjz/Ifrx0ozd0JRos3RLeXM4fHfAPMtup1SekSAYvU lb08b0LhSQZke/u2RwZnhduNzqwM5XGLdzTRLQB0Q4f1zYyFVQATyvg+WhY/Ufk= X-Google-Smtp-Source: AGHT+IE2yoi8eN59Efp4Zw4hc/t75lfTyLZp0Zgl91poYr5lN48FBw2FLHnhRe8TwdlAiWGWq9mpew== X-Received: by 2002:a2e:9d05:0:b0:2ec:efb:8b66 with SMTP id 38308e7fff4ca-2ec3cfe12acmr21926691fa.53.1718822768357; Wed, 19 Jun 2024 11:46:08 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:991f:deb8:4c5d:d73d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36098c8c596sm7594156f8f.14.2024.06.19.11.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 11:46:08 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH net-next 6/8] net: stmmac: provide the link_up() callback Date: Wed, 19 Jun 2024 20:45:47 +0200 Message-ID: <20240619184550.34524-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619184550.34524-1-brgl@bgdev.pl> References: <20240619184550.34524-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_114610_846706_201AB0C4 X-CRM114-Status: GOOD ( 11.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski Provide drivers with means to react to link-up events in the form of another platform callback. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ include/linux/stmmac.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 5ddbb0d44373..644bc8a24661 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1006,6 +1006,9 @@ static void stmmac_mac_link_up(struct phylink_config *config, struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev)); u32 old_ctrl, ctrl; + if (priv->plat->link_up) + priv->plat->link_up(priv->dev, priv->plat->bsp_priv); + if ((priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) && priv->plat->serdes_powerup) priv->plat->serdes_powerup(priv->dev, priv->plat->bsp_priv); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 9c54f82901a1..9dc54d6d65ae 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -271,6 +271,7 @@ struct plat_stmmacenet_data { void (*dump_debug_regs)(void *priv); int (*pcs_init)(struct stmmac_priv *priv); void (*pcs_exit)(struct stmmac_priv *priv); + void (*link_up)(struct net_device *ndev, void *priv); struct phylink_pcs *(*select_pcs)(struct stmmac_priv *priv, phy_interface_t interface); void *bsp_priv;