From mboxrd@z Thu Jan 1 00:00:00 1970 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 B316CC433EF for ; Thu, 21 Jul 2022 21:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=pdCQNSWMf5h6ILtwyU1OTkjiidgaox9kqGDsxoHLoas=; b=2LGv066nAE3xKMyx0eAM3uRC2F XEDyyLYqooinnIiN6rTrqC8oSa8wIg1xjUYcNNhYc8np6PQ7v1CRiEKRaUHVB1HSoFgw39QqwIbyX 4pjCZO5rhG4EOXYNvEn1JUqXiA1254lzN2Nxz/ID+fcZMsKuZTd3Ed/EXn85CRym73ho1I4V8AqsM aDy2CSU3osCQcAZJOw3JQYNufOPf9N67hmqe0751e17RmBMCGGENyloY/SKGOLytItj7v4sUE9PCB qnJOG+FKHuxaz7JwDx9XlKT/uvpqI3vpWyBp1bKxzA1lCwfKAO2RnXEH0JJ/r/54XC+HFSgxQbnUx H44HqIbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEdw0-00CWl5-AV; Thu, 21 Jul 2022 21:42:16 +0000 Received: from mail-eopbgr130045.outbound.protection.outlook.com ([40.107.13.45] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEdvv-00CWhj-Ar for linux-arm-kernel@lists.infradead.org; Thu, 21 Jul 2022 21:42:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k0PeJ2+fYe185hEZTnSs1KY4lk6gsIQYMLK2zIdc7e9VcSf8s71/SdqTsHyzKPHQzcpweTXXKNkygUZNrvnHRpNe7AazU4wSP7/9TC0/nAU3hWM7mF1nZDED49PwgdQ1h5rY/++FROBdS3yeOB7j9tp2vJFig2ILrdZQBlxWZWq0YE4cRvJE0oJJ1qSnbXuKSULlaAu+yz1/Y3QmxY1Ucp36bLjEghVx4q7ynlKc+CwAcl17efvG4v+EM8tBHH4FYZRg4bjGWR3VGankFErSTggEcL45L+8XNbUhZQ2Xs4D23/O5D3LkWk4ootg+H1NyKarfQQy848npJXLRSQMM4A== 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=7qAQGzw+4hg5GUHDmsZA7N8RrZtma3gzz71viTwPHSo=; b=mexUO5buAcL9ScxgbVlIuEmftDKREujnqQYhY9ErQnCvrcvTCujeovLa6Zon0xWxLKL10mjWCTDzTuRwkgDsA5GaZ/6iaLJYZjeE3MHBU3KLieDoqXwhE4nEkB6qBmODgNcoU7YLU/DXwD3ufEj46eMXgmwOE7GegQqG7SKgnhScQxlyfTghEOPrncqVHDkftKUGG4HDbOceUuk3wDYHTSlC5HFPRbju59e0NcrSEly+2scGsSvvcMP02fCyLLNFcHuyc8MAqPkKdfVqRiLKDAo+733DVn3v/cwlpE2XkAclYtRoSmDjf7asFQjr7JGq0mXTA7sWFsLK61xVWJe+Cw== 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=7qAQGzw+4hg5GUHDmsZA7N8RrZtma3gzz71viTwPHSo=; b=SSCqPJrKT4YJd5imnVRsIqCxMGpi1zroRLGaGgVfXm8EUkaUNl+0b7OXWb5CgrJyqBFH83TwRcdLdslPmnwt0s7FKSL4Hptr3lVxm+jyExkXLw1rD5va4GpeXgLFC8z3aRM295LrtJqTP2/CLe5y6srF09VB3b8Iub7TTiSoMj5U/k+x6qc0FH4Tc/AYge7riPW+rOqNYNg3vOghaHmyUDJ+G6eUb0+VCVI4LZwaQOh+WwIzrnt9b/wAkpNVmXTMxGvtRfE1VCLZGBz9bqOTZ2idVs8zKqJmRkPwIpSqDDtYOLamKWcz87ixZSq3lm93+TEA495Sk+jNra2Js4ZczQ== 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 AS8PR03MB6839.eurprd03.prod.outlook.com (2603:10a6:20b:29a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Thu, 21 Jul 2022 21:42:06 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Thu, 21 Jul 2022 21:42:05 +0000 Subject: Re: [RFC PATCH net-next 0/9] net: pcs: Add support for devices probed in the "usual" manner To: Vladimir Oltean Cc: Heiner Kallweit , Russell King , netdev@vger.kernel.org, Jakub Kicinski , Madalin Bucur , "David S . Miller" , Paolo Abeni , Ioana Ciornei , linux-kernel@vger.kernel.org, Eric Dumazet , Andrew Lunn , Alexandre Belloni , Benjamin Herrenschmidt , Claudiu Manoil , Florian Fainelli , Frank Rowand , Krzysztof Kozlowski , Li Yang , Michael Ellerman , Paul Mackerras , Rob Herring , Saravana Kannan , Shawn Guo , UNGLinuxDriver@microchip.com, Vivien Didelot , Vladimir Oltean , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org References: <2d028102-dd6a-c9f6-9e18-5abf84eb37a1@seco.com> <20220719181113.q5jf7mpr7ygeioqw@skbuf> <20220711160519.741990-1-sean.anderson@seco.com> <20220719152539.i43kdp7nolbp2vnp@skbuf> <20220719153811.izue2q7qff7fjyru@skbuf> <2d028102-dd6a-c9f6-9e18-5abf84eb37a1@seco.com> <20220719181113.q5jf7mpr7ygeioqw@skbuf> <20220720135314.5cjxiifrq5ig4vjb@skbuf> From: Sean Anderson Message-ID: <075c5ced-1185-2003-a265-12bce5a82076@seco.com> Date: Thu, 21 Jul 2022 17:42:00 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <20220720135314.5cjxiifrq5ig4vjb@skbuf> Content-Language: en-US X-ClientProxiedBy: MN2PR12CA0003.namprd12.prod.outlook.com (2603:10b6:208:a8::16) 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: 0848227a-f20f-4a43-33a9-08da6b61dafb X-MS-TrafficTypeDiagnostic: AS8PR03MB6839:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z+Ia1XkMSZSk8WLnKZTGLac4L8xdzFZa5uZ+tZGAP/NjflbduKBYGMdUs/3ge6VdjHlpVMeEZFTzYcqxqgz5pjyHJPwItvcTbRmdCFqaB805LwG7qEJvWLcgagTxzKcB93WIahm0+8repoARdNJH9BIHQf2mCRl4suf0tU/K+3Vcav3mA96ZE3c2LeIewpHKnG1GuVHIT8KS08aW4FmIdDt4IIGTauuuouuP/xJzQAhPRs5UbNwRxZDMv3HWIGZ+Q9J9BktCYQuEM83qLMs0J+mbKdoBj+JL6V50tcBQ6Cvu1MorMAPVuiUb0qtMnYvTsK/42X2++TXFO0oLTpH+2V8cjWBykQvb6E57PoRCuo2vfsvhtkFl7N5uVb55k4wAkRmuNxVETpprKEecgSwID+Jf/be1LIuWw2oFZmu16T+LBOEcob7VL8Yb2bK8ziJhqwA67eG2vGOm19RwsVHjlORqw2wS3zNr6p7R9bVhrR+aG2VhOtHyce+UUM5UeEQvi8NSaTRLg0kzx4r5SiNkRxfUD6uLJpHJnCCTc3qxDa2UttjxwGgGHdTOuh1HkZMGoJ2F1o2LJ/3fBhWcGT39zEqrPa1g6x6p3aHnBZMG5hVYS/HCZKgBjjH4Lm0+DaKL6a2dTO1gi6X5p5XJA2FXZegi7Wrnrm4haRxfwQThWlRjyy7kJHBpfrIqCo2Y7mV0utsuX+6Snrw8Q3KG6smSzq5V0H2ruW2O76q+vbqzcLUaa7Id0/91exOgLt488naWoCHz1dd22J1xHmOrzIA4HgE2R0kfoeUXoC4os8D+9yyssUrf3RzDIE0BVpMFrLy9mtMtWB4gLNH71PSFV/ZAZGQr5Hogd/RFB4qmwXa5ztCrNxvWCosgtjav8mUVzTz5 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)(136003)(39850400004)(346002)(376002)(396003)(366004)(38350700002)(2616005)(36756003)(6916009)(38100700002)(54906003)(31686004)(316002)(186003)(83380400001)(478600001)(2906002)(8676002)(7406005)(6486002)(8936002)(5660300002)(4326008)(66946007)(66476007)(66556008)(41300700001)(7416002)(44832011)(6666004)(31696002)(53546011)(26005)(52116002)(6506007)(6512007)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VVpNcmM2VjAyUzVmZlVVWE5VQ0JLekgwS1lCKzBhbVRXc1FJOUxjV09kWlhV?= =?utf-8?B?Y2wyZ1JvMTVubWx6R0Jqdnh2eFlJaSsyMGQzbHJFQ1VmcTdwRG5DLzNjS0gw?= =?utf-8?B?MkZ6M0pBWWpNUGdtcmZXRG55Q1htTnBvNS9DWXk0VEVva2dGN0x2c3VDdjRO?= =?utf-8?B?RWFST3RXdHJuM292VVhYNWdLYjNKR2NMNDBUZEsxQzVTSkdyU3R5cFc2QWJr?= =?utf-8?B?UTlmR29QMy9BWkl2cDhhdEsvZjNuN0xwQml2VngyQk1WZVltejlkVUJsdDAy?= =?utf-8?B?aHhBRVN4eHZBYWFxSmdwNXN3eWcxMWJ3bnJqUjJlVGhkUi9QYnpYK3dxcERM?= =?utf-8?B?bys1b25FdU9sNjROdFQzdGlJcjJzNnNTSVE2czlJTnBXMkNKeStsNTlGbzRk?= =?utf-8?B?Z3MyKzFDb3ptTEI3ZHlpU2FZNS9WVkhnZ3YxUXNKWGkrZXJzcGQwNmNJUkZZ?= =?utf-8?B?ZUg2ZSs3b2I5dWQ3UDBBMVQvZ0UyUVFzRW9oV3h5bUZtbmhHOGxuMnlRb0dD?= =?utf-8?B?WmJHTDR3c29hSHhobnNzSFdSMDBLQUVVaVhpU0VFOXRBVWpFQ0djWENkL2VC?= =?utf-8?B?UFBUcVlIQ3dBaWV5Y1paNTBNOWF6dmh2TW8vRlNkUlN4SE5RbWVEZzdIdkNB?= =?utf-8?B?UE9iWHkyMkx6eGZRSG11K1Y1UE9MeCtJYzFVcVd2eTZQaEozM2w0cmNWN0xM?= =?utf-8?B?dlBYTEIzaUJqdmNGelRhcmxLNjFQeURqYW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JZc1BVRFpWWFNzYTEyU0U0SUdWWFRqcDBSYTkyOERW?= =?utf-8?B?QnJwZmlLa0gyaG1rMmlaZkRNSmpaTmVvMm1aVUNicGtwbkVOQWhBbzM4WGg4?= =?utf-8?B?T2JILzE0RnBoa1lxbmlsVlIvZEx4Um5tMElKaHFKQk1WRGIxT3NMZGp6amFV?= =?utf-8?B?T0dhYWNNNWZhUnViSEV0azZZS3Y3NTBkMFZ0K091aE5BbFRHRGtaaG5GUDlM?= =?utf-8?B?bHhJQ1BkNzFMNGRIemQ5bHVFUEUzdEpmZHJ6TmZMY2NscWJhOTJDaHd6WEc3?= =?utf-8?B?R3pxQ2duRFFHYWVld1ZMeEprU0MreU9pMlJpRnNUNnRDcGk3T2xNc3M5cy9k?= =?utf-8?B?ZGVmOUFLQXpHNkRZWk95NFFjbXVrQ3h1UTlNbWdFcFdkcnRhaE5neDdpV3pD?= =?utf-8?B?SjhZVEg0TUFuN2xqbVRRY2duU1lnOUF1K2x4ano1SEhCbDRidVpJUmVXM0Rm?= =?utf-8?B?d3RiV2dwUlQyRVkvRHkzSlNvODRIVHRBZExvTDJNc1JnYXNLSDhta1hxQlhI?= =?utf-8?B?elE9PQ==?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0848227a-f20f-4a43-33a9-08da6b61dafb X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2022 21:42:05.8273 (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: 1FfjKhaxoOAi2Ol/pfivKCXeW/WNRPgJt61YQGshnt651JPSSYsq7CSXKK9CHYPY5y/3/Zo6l5itCADNFh6B1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB6839 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220721_144211_953072_CC8B78FB X-CRM114-Status: GOOD ( 29.25 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/20/22 9:53 AM, Vladimir Oltean wrote: > On Tue, Jul 19, 2022 at 03:34:45PM -0400, Sean Anderson wrote: >> We could do it, but it'd be a pretty big hack. Something like the >> following. Phylink would need to be modified to grab the lock before >> every op and check if the PCS is dead or not. This is of course still >> not optimal, since there's no way to re-attach a PCS once it goes away. > > You assume it's just phylink who operates on a PCS structure, but if you > include your search pool to also cover include/linux/pcs/pcs-xpcs.h, > you'll see a bunch of exported functions which are called directly by > the client drivers (stmmac, sja1105). At this stage it gets pretty hard > to validate that drivers won't attempt from any code path to do > something stupid with a dead PCS. All in all it creates an environment > with insanely weak guarantees; that's pretty hard to get behind IMO. Right. To do this properly, we'd need wrapper functions for all the PCS operations. And the super-weak guarantees is why I referred to this as a "hack". But we could certainly make it so that removing a PCS might not bring down the MAC. >> IMO a better solution is to use devlink and submit a patch to add >> notifications which the MAC driver can register for. That way it can >> find out when the PCS goes away and potentially do something about it >> (or just let itself get removed). > > Not sure I understand what connection there is between devlink (device > links) and PCS {de}registration notifications. The default action when a supplier is going to be removed is to remove the consumers. However, it'd be nice to notify the consumer beforehand. If we used device links, this would need to be integrated (since otherwise we'd only find out that a PCS was gone after the MAC was gone too). > We could probably add those > notifications without any intervention from the device core: we would > just need to make this new PCS "core" to register an blocking_notifier_call_chain > to which interested drivers could add their notifier blocks. How a> certain phylink user is going to determine that "hey, this PCS is > definitely mine and I can use it" is an open question. In any case, my > expectation is that we have a notifier chain, we can at least continue > operating (avoid unbinding the struct device), but essentially move our > phylink_create/phylink_destroy calls to within those notifier blocks. > Again, retrofitting this model to existing drivers, phylink API (and > maybe even its internal structure) is something that's hard to hop on > board of; I think it's a solution waiting for a problem, and I don't > have an interest to develop or even review it. I don't either. I'd much rather just bring down the whole MAC when any PCS gets removed. Whatever we decide on doing here should also be done for (serdes) phys as well, since they have all the same pitfalls. For that reason I'd rather use a generic, non-intrusive solution like device links. I know Russell mentioned composite devices, but I think those would have similar advantages/drawbacks as a device-link-based solution (unbinding of one device unbinds the rest). --Sean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel