Message ID | 20221116144305.2317573-2-xiaolei.wang@windriver.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp181164wru; Wed, 16 Nov 2022 06:50:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ym6/p+IFLiAe9o1D8NwkEucpqU9BS1X6EOLwioAAr/MSt2QPIm/JhipX1yLut4WohuVhW X-Received: by 2002:a17:906:5e4b:b0:782:9b27:94aa with SMTP id b11-20020a1709065e4b00b007829b2794aamr17176981eju.542.1668610208075; Wed, 16 Nov 2022 06:50:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668610208; cv=pass; d=google.com; s=arc-20160816; b=Q4fJdvZaq7+XH5H8ZpZicCrCPnYvXxqd5PjHRsTo/hbL0eg0iGD9aE2JYvJavMV3r6 HOP/P5hLTMGN7tbiaCWrcSRBE83cpulDL9fm5m0PZLjLpe6omOg2pKF/d3cq65hrFgq1 qBZhIx55XxNHw0l87OSrCWw96GxmKWZ9vY/HnCBVbW0pYmMlgDRvEgVHI7Akd0LTJdqJ uCmW09cDTU2KQzaH97kjeh8NeBHIUJx+JvyOL94spxiUUBhFaJle42iaazdhNZQqjksM M5HreizCsE6ycPFkuD7XVp5gYsoUS7f6hFukN1+RCUOddx4CG6wLcdjlBMa/6zzv3Jt1 2Ggw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CzwstQNtn4atjVSRVM5JAP2bytjugRovtqE0xBOj9pY=; b=bCKSQnDVWR6NUXS4zi1jI62PKPXMOKkJAl0FjYKIedGpSac0XX9UHG8FRKU6ro1c2+ Wf2VZHUStoDdqPh1gC3GRh+yX/KztkfaR+2XpBsl1bVjNmikEjrV4+XQR4haFrI7zoDZ PY8PtsihnxXS0agsjGdZAmaUQ5UXuOt1qSBJGSk/2KNz7iOqNMHb+6Q2c7LqblMG+UED fBMn+JYl5OPxc1BGCsrrhdbNH5MiSaGw7vq24yo1jhG9Ykvyt/swA6IxZNKG6Ph2UjT4 sG2q3ci6RWxGWxlySxd+NdtLKbWXgSV0LfQE+G+WLPPPEFt/bIYkjoUGYfdstbPaRgs4 r5zA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=lFvqtzpx; arc=pass (i=1 spf=pass spfdomain=windriver.com dkim=pass dkdomain=windriver.com dmarc=pass fromdomain=windriver.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=NONE sp=NONE dis=NONE) header.from=windriver.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020a056402269100b0046276ef250asi16052179edd.298.2022.11.16.06.49.42; Wed, 16 Nov 2022 06:50:08 -0800 (PST) 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=@windriver.com header.s=PPS06212021 header.b=lFvqtzpx; arc=pass (i=1 spf=pass spfdomain=windriver.com dkim=pass dkdomain=windriver.com dmarc=pass fromdomain=windriver.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=NONE sp=NONE dis=NONE) header.from=windriver.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233556AbiKPOoJ (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Wed, 16 Nov 2022 09:44:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233132AbiKPOn7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 16 Nov 2022 09:43:59 -0500 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C7793F071; Wed, 16 Nov 2022 06:43:56 -0800 (PST) Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AGC2iqk004595; Wed, 16 Nov 2022 14:43:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=CzwstQNtn4atjVSRVM5JAP2bytjugRovtqE0xBOj9pY=; b=lFvqtzpxRrJDFqbfnUWPd2JkBOp+dFdoRoqNAcXZF0hUSreTgxo9S5zf5VMti8Lv3jZC nobX0TaGBSJvEKQp+yZuKrDP1xiOum5zfDvRgFn5USmB0y3KSGJdkHWL9AMez1Lij3bH yrp3bwFWpBIvG2ndIz2QYV/xfo+ofU9IHsayMjQsEVvUgvveU7o+teHeq8pEjxP7DhEH 9YI6mqBYI+iTbvYW7/ZpdIUpkgJ5eIE2wZW3bU3HLWyvgnp7il7jAhLAzPrpwPED2y0Y 0PiXXwn8elpGf//thSM0ao6dwFu35XwdlJjvN6+Jf8AaMOwpOubDt3BRsCKwhJso0emK IQ== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2042.outbound.protection.outlook.com [104.47.74.42]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3kv75cs6yh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Nov 2022 14:43:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F8w0dvg+F6A15ufpLQZLNoNNX+7KsaESlPpHKs2ET56FuJRz/sd1xuXBkeotuGpHTt7tDMt9sIlbA46GGgonomLcP4v0+ttfhsP/xyDiWbXPB4La0olSQuOfiKBx1Xwi7Fsh1EkEnNHkQy2ZeZg8dcOUwlZ23/6bTqN572EACghp3XmDelVKCIuNKNZVt8S9X+GcvZMkfbxa2slGHJ89dec4G/+HlG5gADTBaHYfOc/MqkzIBOBdgVS+1irzJBUdisuaxq91YJSq8q/MPggfxZ2X5zt5Dj1R1Pnmg+GqPHea/5fLm56mlYjP4M1F+UP2hitTBq8lqlGpsfYiWNMNfg== 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=CzwstQNtn4atjVSRVM5JAP2bytjugRovtqE0xBOj9pY=; b=iVZd46qTc0aAVQeFnqTSf6mYei0MGjdy1Qm2MHvjEYUTIRwULMpckj/iWz42+QqzhFR0+meQBOVHvlpu02snOeFsjIGs9FBBnswClDtYzDnTL08w512bpBRfe411G/iE3P8cnpXwCBzisK6MGVAxK5mbgy92IXWAHQ300gFAeJCz+gez+kfR49W9vtDl65u5wPl18dN3dAiS+ROPui0uHhmVQbW9kc8Ap2gj1nw5PjJUJEyecK7hqTYA4ayoSMPoQyjwKFKhmojHpaCv9cD95/NiNFKH1JdW5OSooXDSjgRsBmWjKA5301YqOs1fUslzylAwGqoq0KODxbpFr5SLxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from MW5PR11MB5764.namprd11.prod.outlook.com (2603:10b6:303:197::8) by PH8PR11MB6927.namprd11.prod.outlook.com (2603:10b6:510:225::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17; Wed, 16 Nov 2022 14:43:28 +0000 Received: from MW5PR11MB5764.namprd11.prod.outlook.com ([fe80::d789:b673:44d7:b9b2]) by MW5PR11MB5764.namprd11.prod.outlook.com ([fe80::d789:b673:44d7:b9b2%5]) with mapi id 15.20.5813.018; Wed, 16 Nov 2022 14:43:28 +0000 From: Xiaolei Wang <xiaolei.wang@windriver.com> To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] net: phy: Add link between phy dev and mac dev Date: Wed, 16 Nov 2022 22:43:04 +0800 Message-Id: <20221116144305.2317573-2-xiaolei.wang@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221116144305.2317573-1-xiaolei.wang@windriver.com> References: <20221116144305.2317573-1-xiaolei.wang@windriver.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SL2P216CA0216.KORP216.PROD.OUTLOOK.COM (2603:1096:101:18::11) To MW5PR11MB5764.namprd11.prod.outlook.com (2603:10b6:303:197::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW5PR11MB5764:EE_|PH8PR11MB6927:EE_ X-MS-Office365-Filtering-Correlation-Id: cbb79cd4-bd57-48ee-254f-08dac7e0ec58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o3NdMB1Jm9R9/9sWcFwxPbuRwkugzOKKIdiMNobinP34rf8cdpkMxIlpwVUwRH5vwbSdHn5ttvU5En1oCvoAEloEcf3+ueZWQ+aY56Tm+aWodRtRVvEoQcVpWWY/wy3FxcaSoXvKULBY9tnE6FI9BYi8ubEC8VVp53RcJ67kT3jM1TsUbUvM0QEvqWMTa1iRXunEwzDtxmFFIeOkzanFAG5bydIsJ2vnF2tJ0T9QxBPBcrXBZBmb88xwTTg7PSMAF1tKb3Vi47AN+qH3mWpwWnGseH98DOqrlgZ4AIPjKJ8035OS44V0zuvudDcX9pSPB9RyW//hCcvRrSDnZ7NwHXKuEjbTw0Qw3BOKSOkQLWPEYErrWQNnptWb2zV1P7ezcju22JMSoXyXrRgDyYbgCfMTthWtHllWsnETDGeAzlg2MwV8RnTWyKtozh+uxR2ucW5LQRcPUhMeq67ZO2fbxoMX3ZN1jHgNWZVQZ6zOmt8GZqd+HSBBEWZ9gRKqg+5cIhrmeGSccS8X5v2mRHiuFrgXWmFZS6uM3CPAA4Ujfe0pEHkEAQKYuAPy4CERpYWk7UWHO5ODVNBUJuZJ6vuReKZw95SPhy3apHEZn95TjVmIFn4aOmtGKcBPkPRvsoyzBH6Ogdf3WYUAugR2gRu9ajb/zgWGVeq1tXyE16Lhtq7sL63JPNdE7vB6H/NmjTsX1dylv1vU3P63rhmd8IbfXBj9NT9mqyywtsYo7zzNePtYABwnQc8Js08yT858peEJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW5PR11MB5764.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39850400004)(376002)(366004)(346002)(136003)(396003)(451199015)(38350700002)(186003)(2616005)(1076003)(38100700002)(2906002)(8936002)(52116002)(44832011)(6486002)(6666004)(6506007)(26005)(5660300002)(66556008)(66476007)(41300700001)(8676002)(6512007)(66946007)(4326008)(478600001)(316002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nYnKk6ZiMUUPk7H/UT9LXpC9dxMgat6toErn86vW9oYXqFd9ZwlVYuuR4uqbMPza8oCt8hnAL2TPL81ed+hv4T5m6q4CMds9UvlColgpJF2ennMROKMCgClqoQItfI7Jfj2YPnhGTdXpKvKPV2mkOhgrZXXRAus6miVN66YOMdBEi7xVDfIfJOC5B3ciIBsdwhd2yTCEmjb+LN1ev4fhVKizx8yFe8JWvorDKrFbxB444E2qMUU1LmAC6ABYLZUBx3vIRIj7JDEB/GXO+PICsuswJfZVKns4mqSOABmS8dDl6aZ6iFdhNyf6aA0ePvE1K5xAt10KaYjZiaEYAk3YmlQWkXif5dMa03JqbuRE/xxm83PBBM1WsWxnXn4n4C93dSgHFmYmVRWgxHgc12mkAG0CSYSdL9cmNxzINarZmgcKdGUZQ2RnsRPVNd2160Wa7cKkzgSg0xRlBA4HLIalPlOomEQBA72NJZ3o+fopxfzUz1BEE0omryYOtUIlA/KNu3vT94eulaIpamO+8JOCNsqNOcUxmLN0NG6X3Cz+9RVFAPBCX/WRyIMVTgDvNmJuWKDvIZCzZlooI6iBGT7nr+O62TeQl8r7Af/2yvrgaYS/VlnMKeAERe0DsV4V9Orn50zL+Z6vEgOsQFGFtH1ClP3aV1ACXOTa6pGC14Xk1O11a+xwAAgwVIKzcUmw6l9yeEgOY7fWikWEBD0yBOlxU5su5fco2csIBdYVhgwAhrR/SopzXbYiA9mhRPpG1DyflFJsPha91Kpl/8+fjNYL/er1Xa/o+0nvXoBNN+S/GOqvGfQ7khGdxYw/vomnVXsbHszwZ+Hfo5QGPpBUzvDrF2gMWZUlkaFILMTIdV6c8PonXg0Ku3RFDPNJDXcju5LeCQU/g/x1Oa7Zl9MFr2YwEUtkgRRYPGu6SGgKEKhv1Sh/pA1+3lf+tl1pJyNiIndQggrpZr/WFLrTVtdRS0I3pK6K4kP/RGD3f9HuTKLbJfLL1JzVzlAKAmH7vwtW5WGgr0BrCvsK2Qls27ISPOmTJiT9GPGTbyTxznhpDvrMc0YTEXWAXGrwLpLqA5vuT6bvBqpqvWZpJACTNseIu/buuJbp4Geo7/izowdCfTPmacWe1F7o7Oq2q7U6pqb4JbN97NP3BdMMmLwWS3nmC4n/x1/JEBefznNBoYfd9iNz1vWgnwqcouGo9abpzNJNbFgBRSZvUDOJ8Tid6Ot1VHi/CkscOMso72TVBzOWg4keqwm32j6eZz0nFRVcDYXCHyxIWna77gwkwzBJ+a3oPlM0xrB3XdISfDntR5zcV3vYBBeLnGxTanLSpVUwc1TkSpr4J4VK10Nq/bExQXtRPH4iJZNnGgelZ3BfFBrbZMq0rOqsS4JXWyFVroiM+ADWl6jSbfO2laBLECIRa5vLkOIjD/i7OE+Z9L9aap6qaHH+6wRLly7ecXQsGocpHdnMhImAjCGDXFkqgV6nJGu3j6EuIV0od6jtz2U8i65/7IKtDAVwY7yn2PvqJ6nYHJWLon6uWp1TRNnQJts8NzxaiCoyikJvwjNlo+aR1U8iYUQ6VkLke7j0P/b8lhKo6Igwg4dZlwBp21YEIMNvFtbef44Ajg== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbb79cd4-bd57-48ee-254f-08dac7e0ec58 X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5764.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2022 14:43:28.0011 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I37u1XfuubSZASrmpoIXemtHu+7sIf7ScSIOSR5CQfRaONZ8Cz3cKutXNP61d1mfsZP0HypBQc6CrsJqPVQiYPCLSqHbQfmqgw8N0hFh0n4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB6927 X-Proofpoint-GUID: 9vRy97bLMSsbe7arUNuI7b4KOs6mk60g X-Proofpoint-ORIG-GUID: 9vRy97bLMSsbe7arUNuI7b4KOs6mk60g X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-16_03,2022-11-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 mlxlogscore=910 clxscore=1015 adultscore=0 bulkscore=0 spamscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211160102 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749664617486785689?= X-GMAIL-MSGID: =?utf-8?q?1749664617486785689?= |
Series |
Add link between phy dev and mac dev
|
|
Commit Message
xiaolei wang
Nov. 16, 2022, 2:43 p.m. UTC
The external phy used by current mac interface
is managed by another mac interface, so we should
create a device link between phy dev and mac dev.
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
---
drivers/net/phy/phy.c | 20 ++++++++++++++++++++
include/linux/phy.h | 1 +
2 files changed, 21 insertions(+)
Comments
Hi Xiaolei, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on net-next/master] [also build test WARNING on net/master linus/master v6.1-rc5 next-20221116] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Xiaolei-Wang/Add-link-between-phy-dev-and-mac-dev/20221116-224621 patch link: https://lore.kernel.org/r/20221116144305.2317573-2-xiaolei.wang%40windriver.com patch subject: [PATCH 1/2] net: phy: Add link between phy dev and mac dev config: m68k-allyesconfig compiler: m68k-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/a5e03a412891ff1a482e9a53794432817fd9e84e git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Xiaolei-Wang/Add-link-between-phy-dev-and-mac-dev/20221116-224621 git checkout a5e03a412891ff1a482e9a53794432817fd9e84e # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/net/phy/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): >> drivers/net/phy/phy.c:1542: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * The external phy used by current mac interface is managed by vim +1542 drivers/net/phy/phy.c 1540 1541 /** > 1542 * The external phy used by current mac interface is managed by
On 11/16/22 06:43, Xiaolei Wang wrote: > The external phy used by current mac interface > is managed by another mac interface, so we should > create a device link between phy dev and mac dev. > > Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com> > --- > drivers/net/phy/phy.c | 20 ++++++++++++++++++++ > include/linux/phy.h | 1 + > 2 files changed, 21 insertions(+) > > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > index e741d8aebffe..0ef6b69026c7 100644 > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c > @@ -35,6 +35,7 @@ > #include <net/netlink.h> > #include <net/genetlink.h> > #include <net/sock.h> > +#include <linux/of_mdio.h> > > #define PHY_STATE_TIME HZ > > @@ -1535,3 +1536,22 @@ int phy_ethtool_nway_reset(struct net_device *ndev) > return phy_restart_aneg(phydev); > } > EXPORT_SYMBOL(phy_ethtool_nway_reset); > + > +/** > + * The external phy used by current mac interface is managed by > + * another mac interface, so we should create a device link between > + * phy dev and mac dev. > + */ > +void phy_mac_link_add(struct device_node *phy_np, struct net_device *ndev) > +{ > + struct phy_device *phy_dev = of_phy_find_device(phy_np); > + struct device *dev = phy_dev ? &phy_dev->mdio.dev : NULL; > + > + if (dev && ndev->dev.parent != dev) > + device_link_add(ndev->dev.parent, dev, > + DL_FLAG_PM_RUNTIME); Where is the matching device_link_del()?
On 11/17/2022 7:22 AM, Florian Fainelli wrote: > CAUTION: This email comes from a non Wind River email account! > Do not click links or open attachments unless you recognize the sender > and know the content is safe. > > On 11/16/22 06:43, Xiaolei Wang wrote: >> The external phy used by current mac interface >> is managed by another mac interface, so we should >> create a device link between phy dev and mac dev. >> >> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com> >> --- >> drivers/net/phy/phy.c | 20 ++++++++++++++++++++ >> include/linux/phy.h | 1 + >> 2 files changed, 21 insertions(+) >> >> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c >> index e741d8aebffe..0ef6b69026c7 100644 >> --- a/drivers/net/phy/phy.c >> +++ b/drivers/net/phy/phy.c >> @@ -35,6 +35,7 @@ >> #include <net/netlink.h> >> #include <net/genetlink.h> >> #include <net/sock.h> >> +#include <linux/of_mdio.h> >> >> #define PHY_STATE_TIME HZ >> >> @@ -1535,3 +1536,22 @@ int phy_ethtool_nway_reset(struct net_device >> *ndev) >> return phy_restart_aneg(phydev); >> } >> EXPORT_SYMBOL(phy_ethtool_nway_reset); >> + >> +/** >> + * The external phy used by current mac interface is managed by >> + * another mac interface, so we should create a device link between >> + * phy dev and mac dev. >> + */ >> +void phy_mac_link_add(struct device_node *phy_np, struct net_device >> *ndev) >> +{ >> + struct phy_device *phy_dev = of_phy_find_device(phy_np); >> + struct device *dev = phy_dev ? &phy_dev->mdio.dev : NULL; >> + >> + if (dev && ndev->dev.parent != dev) >> + device_link_add(ndev->dev.parent, dev, >> + DL_FLAG_PM_RUNTIME); > > Where is the matching device_link_del()? Hi Oh, what do you mean when some modules are uninstalled, should we delete the link? My original idea was to wait for the dev (consumer or supplier) to be unregistered and automatically deleted, I read the comment of device_link_add, if DL_FLAG_STATELESS is not set, the caller of this function will completely hand over the management of the link to the driver core, then The link will remain until one of the devices it points to (consumer or provider) is unregistered. thanks xiaolei > -- > Florian >
Hi Xiaolei, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on net-next/master] [also build test WARNING on net/master linus/master v6.1-rc5 next-20221117] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Xiaolei-Wang/Add-link-between-phy-dev-and-mac-dev/20221116-224621 patch link: https://lore.kernel.org/r/20221116144305.2317573-2-xiaolei.wang%40windriver.com patch subject: [PATCH 1/2] net: phy: Add link between phy dev and mac dev config: x86_64-randconfig-a016 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/a5e03a412891ff1a482e9a53794432817fd9e84e git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Xiaolei-Wang/Add-link-between-phy-dev-and-mac-dev/20221116-224621 git checkout a5e03a412891ff1a482e9a53794432817fd9e84e # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/phy/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): >> drivers/net/phy/phy.c:1542: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * The external phy used by current mac interface is managed by vim +1542 drivers/net/phy/phy.c 1540 1541 /** > 1542 * The external phy used by current mac interface is managed by
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index e741d8aebffe..0ef6b69026c7 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -35,6 +35,7 @@ #include <net/netlink.h> #include <net/genetlink.h> #include <net/sock.h> +#include <linux/of_mdio.h> #define PHY_STATE_TIME HZ @@ -1535,3 +1536,22 @@ int phy_ethtool_nway_reset(struct net_device *ndev) return phy_restart_aneg(phydev); } EXPORT_SYMBOL(phy_ethtool_nway_reset); + +/** + * The external phy used by current mac interface is managed by + * another mac interface, so we should create a device link between + * phy dev and mac dev. + */ +void phy_mac_link_add(struct device_node *phy_np, struct net_device *ndev) +{ + struct phy_device *phy_dev = of_phy_find_device(phy_np); + struct device *dev = phy_dev ? &phy_dev->mdio.dev : NULL; + + if (dev && ndev->dev.parent != dev) + device_link_add(ndev->dev.parent, dev, + DL_FLAG_PM_RUNTIME); + + if (phy_dev) + put_device(&phy_dev->mdio.dev); +} +EXPORT_SYMBOL(phy_mac_link_add); diff --git a/include/linux/phy.h b/include/linux/phy.h index ddf66198f751..11cdfbd81153 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1758,6 +1758,7 @@ int phy_package_join(struct phy_device *phydev, int addr, size_t priv_size); void phy_package_leave(struct phy_device *phydev); int devm_phy_package_join(struct device *dev, struct phy_device *phydev, int addr, size_t priv_size); +void phy_mac_link_add(struct device_node *phy_np, struct net_device *ndev); #if IS_ENABLED(CONFIG_PHYLIB) int __init mdio_bus_init(void);