From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szelinsky.de (szelinsky.de [85.214.127.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A9CE3F7867; Wed, 26 Aug 2026 22:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.127.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787781865; cv=none; b=rAgzenfdS7gLbWqRr1n3uQmhRmXP5ZVgjwvibL6KjtXQysIXyROPiAym5Sc7aLU3hqN+gROFPA97NWFPOgZ5ZHiS+e8rtKa2IVrv67EPx7UFztfdfyUrDO3ScBNZuWy7pq/KRJ/5g9XoRsX+XxSykwulbRTRbG3lUlElmfi8Yis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787781865; c=relaxed/simple; bh=Xa/8+x3fbN/3+Jk52j6knMgpA06QVo/ahFSa00X/hN0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B/5XeEy68EX8B3gTMiQGMrUkNaXkhBVgaLSiI0XVrR/qk+Sty8O2zZVLyvaxsIAU4hYxnGgCYl+bVXj4D0gaNmiKPl6sNFfD0IOXDnDCOYldPZi5zvKJqTQyxWZsaSJyZTCignR/p8H7iEBOe3Ykl4JuwVrNc/ycS0Pdr3wnkN4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=szelinsky.de; spf=pass smtp.mailfrom=szelinsky.de; dkim=temperror (0-bit key) header.d=szelinsky.de header.i=@szelinsky.de header.b=iPEKHxgx; arc=none smtp.client-ip=85.214.127.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=szelinsky.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=szelinsky.de Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=szelinsky.de header.i=@szelinsky.de header.b="iPEKHxgx" Received: from localhost (localhost [127.0.0.1]) by szelinsky.de (Postfix) with ESMTP id BFD8BE83A69; Thu, 27 Aug 2026 00:04:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szelinsky.de; s=mail; t=1787781845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n8STXjNlKV0wvUn+1PYv95+ojGlTOJB8a3/kKnQWGP4=; b=iPEKHxgx2/4i/W1DiifvlYC4A9Lcahv4cfRYrLPNYOBUBMJDOMklci+bQtzyri/4xCrvwh 9G7/wV7NxsbMDZ6m0xd2/InXdBsneUReOu+cmvwl+48IE4bheC7rvz5pY9OaG7c0GvM0kt y7/8RKAWVjUFZLV8odpt5x0qUfXRU4k5p5cEnn3+mdB26e+p6kHyzLO0Ov6jm22cJ6rGzr wExWY9FPRlZpaHfhRJ5lvUhsNNLKYdt8b4PUUHwC/l4YgZNa0BLigvg61lkO01iIykWMSj ct1/xbidNS8aKmJlMo9Cb2dlTRxbUiiL5bsaI43ZaJ4LW3zklwn+rBotjGM5uw== X-Virus-Scanned: Debian amavis at szelinsky.de Received: from szelinsky.de ([127.0.0.1]) by localhost (szelinsky.de [127.0.0.1]) (amavis, port 10025) with ESMTP id FDXx5jRcPscu; Thu, 27 Aug 2026 00:04:05 +0200 (CEST) Received: from p14sgen5.lanhh (dslb-088-070-183-212.088.070.pools.vodafone-ip.de [88.70.183.212]) by szelinsky.de (Postfix) with ESMTPSA; Thu, 27 Aug 2026 00:04:05 +0200 (CEST) From: Carlo Szelinsky To: Oleksij Rempel , Kory Maincent , Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Corey Leavitt , Jonas Jelonek , Simon Horman , Aleksander Jan Bajkowski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Carlo Szelinsky Subject: [PATCH net-next v5 2/5] net: pse-pd: fire lifecycle events on controller register/unregister Date: Thu, 27 Aug 2026 00:03:41 +0200 Message-ID: <20260826220344.121865-3-github@szelinsky.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260826220344.121865-1-github@szelinsky.de> References: <20260826220344.121865-1-github@szelinsky.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Corey Leavitt Hook the newly-introduced pse_controller_notifier chain so that pse_controller_register() fires PSE_REGISTERED after the controller has been added to pse_controller_list (i.e. is now resolvable by of_pse_control_get()), and pse_controller_unregister() fires PSE_UNREGISTERED before the controller is removed from the list (while it is still valid to dereference from a subscriber's pse_control pointer targeting it). With no subscribers yet, this is observably a no-op. A later change wires the phy subsystem in as the first subscriber. Signed-off-by: Corey Leavitt Signed-off-by: Carlo Szelinsky Tested-by: Jonas Jelonek --- drivers/net/pse-pd/pse_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c index 3c4d09f1d6e4..0190fac33c78 100644 --- a/drivers/net/pse-pd/pse_core.c +++ b/drivers/net/pse-pd/pse_core.c @@ -1138,6 +1138,9 @@ int pse_controller_register(struct pse_controller_dev *pcdev) list_add(&pcdev->list, &pse_controller_list); mutex_unlock(&pse_list_mutex); + blocking_notifier_call_chain(&pse_controller_notifier, + PSE_REGISTERED, pcdev); + return 0; } EXPORT_SYMBOL_GPL(pse_controller_register); @@ -1148,6 +1151,9 @@ EXPORT_SYMBOL_GPL(pse_controller_register); */ void pse_controller_unregister(struct pse_controller_dev *pcdev) { + blocking_notifier_call_chain(&pse_controller_notifier, + PSE_UNREGISTERED, pcdev); + pse_flush_pw_ds(pcdev); pse_release_pis(pcdev); if (pcdev->irq) -- 2.43.0