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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B33C4C433F5 for ; Wed, 23 Feb 2022 11:40:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239700AbiBWLlA (ORCPT ); Wed, 23 Feb 2022 06:41:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240059AbiBWLkx (ORCPT ); Wed, 23 Feb 2022 06:40:53 -0500 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0292E9680E; Wed, 23 Feb 2022 03:40:22 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=guoheyi@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0V5JES-R_1645616419; Received: from 30.225.139.254(mailfrom:guoheyi@linux.alibaba.com fp:SMTPD_---0V5JES-R_1645616419) by smtp.aliyun-inc.com(127.0.0.1); Wed, 23 Feb 2022 19:40:19 +0800 Message-ID: Date: Wed, 23 Feb 2022 19:40:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH 3/3] drivers/net/ftgmac100: fix DHCP potential failure with systemd Content-Language: en-US To: Andrew Lunn Cc: linux-kernel@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Joel Stanley , Guangbin Huang , Hao Chen , Arnd Bergmann , Dylan Hung , netdev@vger.kernel.org References: <20220223031436.124858-1-guoheyi@linux.alibaba.com> <20220223031436.124858-4-guoheyi@linux.alibaba.com> From: Heyi Guo In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/2/23 下午6:48, Andrew Lunn 写道: >> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c >> index c1deb6e5d26c5..d5356db7539a4 100644 >> --- a/drivers/net/ethernet/faraday/ftgmac100.c >> +++ b/drivers/net/ethernet/faraday/ftgmac100.c >> @@ -1402,8 +1402,17 @@ static void ftgmac100_adjust_link(struct net_device *netdev) >> /* Disable all interrupts */ >> iowrite32(0, priv->base + FTGMAC100_OFFSET_IER); >> >> - /* Reset the adapter asynchronously */ >> - schedule_work(&priv->reset_task); >> + /* Release phy lock to allow ftgmac100_reset to aquire it, keeping lock >> + * order consistent to prevent dead lock. >> + */ >> + if (netdev->phydev) >> + mutex_unlock(&netdev->phydev->lock); > No need to do this test. The fact that adjust_link is being called > indicates there must be a PHY. OK, will remove the check in v2. Thanks, Heyi > > Andrew