Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3761735imw; Mon, 11 Jul 2022 15:32:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uCq7k4a9Z37KsKKjJeYIqmYo20kNdy6nTroX7s5nXD8rFmu6G4x6yv8LY/xopQR5/ry3PL X-Received: by 2002:a17:90b:38cd:b0:1ef:b4c2:3624 with SMTP id nn13-20020a17090b38cd00b001efb4c23624mr686293pjb.168.1657578757990; Mon, 11 Jul 2022 15:32:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657578757; cv=pass; d=google.com; s=arc-20160816; b=e1VGF+w1Gk1cafkx57qiW5eCfn8Joyb/ckfa3t5XAYufSLEW7649trvd4z0wCbcHpR zKYSbebAH2ShknpaIqXm40fC3nFmgNMkyRjcrEAuflOCfpvBkCNIj3GwroPs/f44t7Nf nDGFQs7zJc4QGynW2D9KYyd475uEQLUX1p/5KuyBPncp+XI56HInH6zhn/cRdA9oGD3x Pvm29wfcPT9BZyRXu6iAx3ULmWfsD2jh2lW9nens1yz46vX3mx9k8cSq24CnIzGPpVbP xJtvBuuV2MKGANU3BZanQx4+QEOZdmfI0ueKPtX82UtIOurPeWOYdxtLq965LrAD6hhX 5XBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:references :cc:to:from:subject:dkim-signature; bh=cJF+E5gQKrK9RlHGVJF4vpSWAXTQCyvK2+uORg2FSvU=; b=chO5FPScWLQ11nRYGZASYvR4XQNLuetbFe0qu5FaN303NpZtAvF5JqczKAVL363Nlw P+7riDOsLVHmM6+aIlIBDEeWJeBoSxHwjiF0acPrTRYzfRUnzNDaneR5aHjOylcmsD2G G+ngbQRDP7nV5NeJcftVMEiYENG4t2rCQ3/5nD56SMn0R6LmzcWTgisJsMNfhIJTxAiq jL9Vy3MNPIYwveKROqrfhTJ60mhXYIEk2CskEZ2XBPZTs7qN121iJkonzrmQzsOVT2Yu TDRHdRwK9GLy2xUF/813R8rRgPBHWsZFvTqvOcnGpj7TBVnbAKE9oxNH0V5iB9aa8ixd q3sg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=X2QXurba; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a17090311c400b0016a2bfe5c7csi15524550plh.172.2022.07.11.15.32.22; Mon, 11 Jul 2022 15:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=X2QXurba; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232017AbiGKVzQ (ORCPT + 99 others); Mon, 11 Jul 2022 17:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbiGKVzO (ORCPT ); Mon, 11 Jul 2022 17:55:14 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2067.outbound.protection.outlook.com [40.107.22.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A8B32A95D; Mon, 11 Jul 2022 14:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JqCFKN4WgHra6ueOCfcJphLB4TRYwL1cDUcrhpJWlFju3+jwmvNXcAGy4Q3joV7beEIkTU5ydgBkS0lbsv1zkO3gBqtfxmQTW1w2m8A9oq4iAM3WE31F9EW/xRBbAuHRUsnSXYMqj52v0hCe+/M09cFDQjx22zrITqsG2o5/q3oS2/mixDfA1a5kPKadrV0MU4Uv6pfOavesBx/LyihsRsfMJURfGRK1BONnvUA5/r4J0JuyW8xcVRLxQADqUg6Ls84QIFywf51hcQchVcxtl59hXbH2zoQr3kySpxtOc/354kHpLquUqjoep4b/Jywr6WWKKLAsOFzUAF4slPmCpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cJF+E5gQKrK9RlHGVJF4vpSWAXTQCyvK2+uORg2FSvU=; b=JcHW73oNZiiEDA0MKPPpUNOUZ18dW4cC9E69wbmhHZ2U2GZNe7ySTKAbt4vFDKU/8uhljlwxD+gKJwGbszAml9EjJ5fLG/nuRssahx8nu24PFKfU7MiX0n5Qib4hDrTDa92TYn080UENr1wn53qkG8emTEX36tVwvpjKRA4y4wW14HyTBp7OCdmR524kNyTrTjIpguoQ+EbI9xhaA7eqjpbiTNU/cxKvhZ7sRM/X+0DDmq6VuoXpyctU7q+cQD5Gi3jhgcyxrfHam8jq90fBm6H4yHgpzB4P0EHfVZ1tNjb/fNzI3qcli+wmCxoD6RED3AJG9u2pu8ayf36YaB8ZKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cJF+E5gQKrK9RlHGVJF4vpSWAXTQCyvK2+uORg2FSvU=; b=X2QXurbaWewylQMDK58tgFuutuwNO22CR0zfcArobhWJe6kQ8Tz75aaaPzGUDJwzSnzv66WU/eM5EuY9xAJKgfMj7pVpJNY40E5sbkLEmdYNH3JDtTVgQ5az9e3MLycvERaYUvJTK0a2yChmDboeCe8VMbt26Qmf3izRGXqnihIyZDiVssigO9+lzHbSmerMUAcrUwvviydT8gugH3Le0caspez3ztAZpoEBKY/eox+Mdxaoi2/rLw7W+bGS648zvLAq3HykAEFB/LHmJ3BF2WiXwXi0SPvngd/BlIzyDeX3uNBJ/M6e5hmUptr9WhDPEqWj29Xtu1Y/UUwS8z6v0g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by PA4PR03MB7376.eurprd03.prod.outlook.com (2603:10a6:102:107::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26; Mon, 11 Jul 2022 21:55:10 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1%6]) with mapi id 15.20.5417.026; Mon, 11 Jul 2022 21:55:10 +0000 Subject: Re: [RFC PATCH net-next 3/9] net: pcs: Add helpers for registering and finding PCSs From: Sean Anderson To: "Russell King (Oracle)" Cc: Heiner Kallweit , netdev@vger.kernel.org, Jakub Kicinski , Madalin Bucur , "David S . Miller" , Paolo Abeni , Ioana Ciornei , linux-kernel@vger.kernel.org, Eric Dumazet , Andrew Lunn , Frank Rowand , Rob Herring , Saravana Kannan , devicetree@vger.kernel.org References: <20220711160519.741990-1-sean.anderson@seco.com> <20220711160519.741990-4-sean.anderson@seco.com> <3aad4e83-4aee-767e-b36d-e014582be7bd@seco.com> Message-ID: <77824ea3-7d74-9738-4bdf-e624d46e0003@seco.com> Date: Mon, 11 Jul 2022 17:55:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <3aad4e83-4aee-767e-b36d-e014582be7bd@seco.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MN2PR20CA0013.namprd20.prod.outlook.com (2603:10b6:208:e8::26) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 737cdc76-70bf-41a9-f274-08da638806c5 X-MS-TrafficTypeDiagnostic: PA4PR03MB7376:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mO9lZe5MSWxbEQvV0vYDTr6NYrLs++KEbZeRJXeKy3qdsNO/TJH1jgNHoqheBPdg7XepMQ5TB9IWnHBkGgZE2YpYfXO+e56l3OIlJcstuVOHV5IdRlD09iWZALec8+GWDRgsmrhqx/Dc3pxbBmmP95R0swiZJP9RoU9WMk2bS1k4AyBLpqHyLaAu0/PcCIh85v2HX3TAXn69AmO2kOwLd1JhMaw/hz/NQuXGvnBRasisdKfuNpICut4Rfh2XZV0LSmCH8/xHH9z2JvZRsgcSb6+QU2BA9xCXi1pz90ehuiKbvLU83yG0JycGGwWnb4t8S9usilnlhH0KDkrN3uUqkat6f2McF0TnznJZlyaOpfc5CF7jnUvxyX1/eoKD/V61vpl8ANrJKDH9w9rd1RBXdArgoRXFT3YJUyurFVV9OubufVVnCpVURxOY5YOlxLjPQa/n4ZNaDrMkxKPCaJEA/c6jMvlDMVpcXUfJyxU6mgBrt4T6JItXwm94WwXwNbVrAyA0Luw5tkrYXP9W7Cnqvs40bRCCPl0gG5pa3SLa6VkkbREEj8aJNhMMH3noPu1ve0IXoz73vmZs1Q8SMX2DZyYqBotNcJQ4SEo9zLgo4zjsY0jDZi/FNzF8MwLbjalv3odUCtYDg89S+Pk02IJJCuGABKW9/ywN9ejOL9cKbv5/9j/yG05Lh2V2jiChR1q8y1SphZX3x1dWPn9W8K9nofF4CR6Lz2lyciW9eMz2MGcMckEL2kNLyYrB68yzI6ByKUN78InOc6p1Jbg/VQVEXpQ0gAQ61vcI7+U3ZrsgTH9FhMMeKNR+h8TrVK5+8k3QO1Do+7kMks7AdsMo8sIB0l3c4b6IX9nTMvT58oQlXJWXiFOW064jtEh4ESPpe4E7 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39850400004)(136003)(346002)(366004)(396003)(376002)(6506007)(478600001)(6666004)(6512007)(2906002)(86362001)(38100700002)(53546011)(41300700001)(26005)(6486002)(44832011)(38350700002)(52116002)(8936002)(5660300002)(7416002)(2616005)(31696002)(83380400001)(66556008)(316002)(66946007)(4326008)(66476007)(54906003)(36756003)(6916009)(8676002)(186003)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TFVIUm1wSUVqUGlaODZ5WjkvY0tVSVE3UW16c2pTQlJIRi9NZHl5L29hY2dL?= =?utf-8?B?azk3SGEvZkVhZ0Q1OTdwYkJDdE5CQTd2RHhiQUszdmVac1J5NlR5Q0xIUlI1?= =?utf-8?B?aVF6TGM5RkpicW10ZVZWTHpPdWJuQ01qc3N3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I?= =?utf-8?B?ZE04TitnSndiOS9nL1RhbE1oeGIrQ29DVTlLTGNha0J3c0dLN1AwaUlhcTRX?= =?utf-8?B?T3lOdmJhQVNNak9qT04vaHU2ODBoR2V3UEMvZXE5WldIYkxvY3doU2I5Z0JT?= =?utf-8?B?ZGJvVUVTckhzM3gwUGJ4bitEajcvS0h0MkVVMUNVT0tUUXJZQzdGM1dyVXUz?= =?utf-8?B?M3llcWFFWmJ4bWVPL3RaUVhyMVV1RVh0WGNxWjd0T1A5KzZsVjR3Zi9hK3NZ?= =?utf-8?B?N0E9PQ==?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 737cdc76-70bf-41a9-f274-08da638806c5 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2022 21:55:10.7934 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Z/49V6nNJXN24BAkMYVzCgJg84GAUivkmJNl6THRoIloSov3x14Mm3jIotk2GSR+VTo8q9mWf/2iap6clkC/AA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB7376 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/11/22 5:47 PM, Sean Anderson wrote: > Hi Russell, > > On 7/11/22 4:59 PM, Russell King (Oracle) wrote: >> Hi Sean, >> >> It's a good attempt and may be nice to have, but I'm afraid the >> implementation has a flaw to do with the lifetime of data structures >> which always becomes a problem when we have multiple devices being >> used in aggregate. >> >> On Mon, Jul 11, 2022 at 12:05:13PM -0400, Sean Anderson wrote: >>> +/** >>> + * pcs_get_tail() - Finish getting a PCS >>> + * @pcs: The PCS to get, or %NULL if one could not be found >>> + * >>> + * This performs common operations necessary when getting a PCS (chiefly >>> + * incrementing reference counts) >>> + * >>> + * Return: @pcs, or an error pointer on failure >>> + */ >>> +static struct phylink_pcs *pcs_get_tail(struct phylink_pcs *pcs) >>> +{ >>> + if (!pcs) >>> + return ERR_PTR(-EPROBE_DEFER); >>> + >>> + if (!try_module_get(pcs->ops->owner)) >>> + return ERR_PTR(-ENODEV); >> >> What you're trying to prevent here is the PCS going away - but holding a >> reference to the module doesn't prevent that with the driver model. The >> driver model design is such that a device can be unbound from its driver >> at any moment. Taking a reference to the module doesn't prevent that, >> all it does is ensure that the user can't remove the module. It doesn't >> mean that the "pcs" structure will remain allocated. > > So how do things like (serdes) phys work? Presumably the same hazard > occurs any time a MAC uses a phy, because the phy can disappear at any time. > > As it happens I can easily trigger an Oops by unbinding my serdes driver > and the plugging in an ethernet cable. Presumably this means that the phy > subsystem needs the devlink treatment? There are already several in-tree > MAC drivers using phys... > >> The second issue that this creates is if a MAC driver creates the PCS >> and then "gets" it through this interface, then the MAC driver module >> ends up being locked in until the MAC driver devices are all unbound, >> which isn't friendly at all. > > The intention here is not to use this for "internal" PCSs, but only for > external ones. I suppose you're referring to (looks like I forgot a sentence here) ...things like MAC->MDIO->PCS. I'll have to investigate whether this can be removed properly. >> So, anything that proposes to create a new subsystem where we have >> multiple devices that make up an aggregate device needs to nicely cope >> with any of those devices going away. For that to happen in this >> instance, phylink would need to know that its in-use PCS for a >> particular MAC is going away, then it could force the link down before >> removing all references to the PCS device. >> >> Another solution would be devlinks, but I am really not a fan of that >> when there may be a single struct device backing multiple network >> interfaces, where some of them may require PCS and others do not. I wonder if we could add an enable/disable callback of some kind, and remove the devlink when the PCS was not in use. Not ideal, but then all you have to do is set the interface correctly before removing the PCS. >> One >> wouldn't want the network interface with nfs-root to suddenly go away >> because a PCS was unbound from its driver! > > Well, you can also do > > echo "mmc0:0001" > /sys/bus/mmc/drivers/mmcblk/unbind > > which will (depending on your system) have the same effect. > > If being able to unbind any driver at any time is intended, > then I don't think we can save userspace from itself. > >>> + get_device(pcs->dev); >> >> This helps, but not enough. All it means is the struct device won't >> go away, the "pcs" can still go away if the device is unbound from the >> driver. >> > > --Sean >