Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp775032rwb; Wed, 16 Nov 2022 07:31:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf4otModib9YC4z+SRIidd/K7JXzjLfEf/fHN6daTj9JRO5yOfo2KeY2al5rY5AzCNvGVpVZ X-Received: by 2002:a17:90a:5e4d:b0:20c:c0f:ab4c with SMTP id u13-20020a17090a5e4d00b0020c0c0fab4cmr4151056pji.195.1668612683632; Wed, 16 Nov 2022 07:31:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668612683; cv=none; d=google.com; s=arc-20160816; b=xYILApAQTzvilg86/sRbY3X5h+aWfw/JdaMRHq7/lvkHUX6oM09FxfJ/UCYA112Y1p iFRUWyTNudqRS2NiERZvKr1W5Xl+t7cq7vO6N36OwVxl+vcxBdKEZ6RvDN+4mfO7zL9g rXzZUiivKACEWFOGzAMAfd+PlvBBqCdjXYzj0ddK6yqnhF5Qn1y9OMBBNBYSsoRYR8jy A/w8xLCKTqZaJCeT2R1iJT+Sv0oqe1J9kb/mBopJVIIf3yT9soVmcHxIFD3LmYlIov3R nPDDg9arHfI0kB9eEQn0pdGh08Auns/hpsGWwMVy5yV9DpBXLfvOTZNUWgK/y0Tfm5fZ m6CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Bkf7J5SqtYP5TrkKMJu0ChRTpG1efo8rA+SBT3dpslY=; b=r4oRMmK9SWIvyhu1Q38YKZb+5SrKr4vRObjRCtsZC5NMjTJ3X/QMRHegooFivYezLv DMzQ7q1d7BqnQhgKX8S1BDkg96rfirK8RespdypGwFo7THwN7qXuq5g4NNubjuQl4eb2 zVimuRMMT0nKQHpEJ1ZEHgvtqRVbQ98KIYL+2dOuJW0uccjXq1ZAyV6WwyAYe4jajMUK AW30kxiUOb4oCDVhTi4xJOm1crUOtMuzGitu/XgVQHqjTzHX3MdtCMYfHXR7oAoowiw0 9lIKWOsAQdG821YVw9A8Ct9tYCp15CbJdr57ymr5qV4eG70hiV9JrJUtRHl2HjLOpz8b 4qkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ckZ+5LgI; 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=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd8-20020a17090b4cc800b002136ad22b32si2140684pjb.39.2022.11.16.07.31.08; Wed, 16 Nov 2022 07:31:23 -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=@lunn.ch header.s=20171124 header.b=ckZ+5LgI; 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=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232778AbiKPPIa (ORCPT + 91 others); Wed, 16 Nov 2022 10:08:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbiKPPIV (ORCPT ); Wed, 16 Nov 2022 10:08:21 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5D8149B60; Wed, 16 Nov 2022 07:08:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Bkf7J5SqtYP5TrkKMJu0ChRTpG1efo8rA+SBT3dpslY=; b=ckZ+5LgILd7SJauDEX8D9WSniU vV7XA+63iywuvGDYY6fw+NcUMh72A36Cbke5bQ/WqmYT3eETkEadHmF0soQ5dYw9OG/6UK5btZbyi phgDd4KPB20KW3ALmtRVboByLAqqvmd4CiNsP4PwinIkKckxR/3f1PYXhbgimCtC6+NA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1ovK0w-002Zu1-Eh; Wed, 16 Nov 2022 16:07:46 +0100 Date: Wed, 16 Nov 2022 16:07:46 +0100 From: Andrew Lunn To: Xiaolei Wang Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] net: fec: Create device link between phy dev and mac dev Message-ID: References: <20221116144305.2317573-1-xiaolei.wang@windriver.com> <20221116144305.2317573-3-xiaolei.wang@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221116144305.2317573-3-xiaolei.wang@windriver.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 16, 2022 at 10:43:05PM +0800, Xiaolei Wang wrote: > On imx6sx, there are two fec interfaces, but the external > phys can only be configured by fec0 mii_bus. That means > the fec1 can't work independently, it only work when the > fec0 is active. It is alright in the normal boot since the > fec0 will be probed first. But then the fec0 maybe moved > behind of fec1 in the dpm_list due to various device link. > So in system suspend and resume, we would get the following > warning when configuring the external phy of fec1 via the > fec0 mii_bus due to the inactive of fec0. In order to fix > this issue, we create a device link between phy dev and fec0. > This will make sure that fec0 is always active when fec1 > is in active mode. > > WARNING: CPU: 0 PID: 24 at drivers/net/phy/phy.c:983 phy_error+0x20/0x68 > Modules linked in: > CPU: 0 PID: 24 Comm: kworker/0:2 Not tainted 6.1.0-rc3-00011-g5aaef24b5c6d-dirty #34 > Hardware name: Freescale i.MX6 SoloX (Device Tree) > Workqueue: events_power_efficient phy_state_machine > unwind_backtrace from show_stack+0x10/0x14 > show_stack from dump_stack_lvl+0x68/0x90 > dump_stack_lvl from __warn+0xb4/0x24c > __warn from warn_slowpath_fmt+0x5c/0xd8 > warn_slowpath_fmt from phy_error+0x20/0x68 > phy_error from phy_state_machine+0x22c/0x23c > phy_state_machine from process_one_work+0x288/0x744 > process_one_work from worker_thread+0x3c/0x500 > worker_thread from kthread+0xf0/0x114 > kthread from ret_from_fork+0x14/0x28 > Exception stack(0xf0951fb0 to 0xf0951ff8) Please add an explanation why you only do this for the FEC? Is this not a problem for any board which has the PHY on an MDIO bus not direct child of the MAC? Andrew