From patchwork Wed Mar 9 21:04:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 12775607 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 B9B42C4332F for ; Wed, 9 Mar 2022 21:06:12 +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:Subject:From:Cc:To:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=80wbhQU2pBkn4XNjiyLZHzIanZwQM4ZDi3CNStffOxM=; b=1ifh5z+RWCDQNw ANot2mJbqW4YDeWC/tEM+u36JM8QAlDrQfKu4bGmHnFY3USW5YhyE18qC93W36VkHYpQsprCovxYr 9AmF52N9hwvXoB0K9aY5mrOpa2zgqB5d/iaABTIeIGecTqr2FHfKTlOiHzke/wlSUGmO8lWawkDuo /8KjB6cND6AjawXJI0HRzNMHrTr81jTk7IEjbeTbQvQBPhDNn6+IzVkunihmDG8A43Ah0G/PcfNsD A5E3MU1WK2SHqM5Su8zL5nkB3KjjqCUbIHh3NpOc67NZuD2po5Jez0vBBroCCpYz1yfRFEa689rnH 7ZQupaRP/V0r/78XuaxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nS3UW-00AUrx-0J; Wed, 09 Mar 2022 21:05:04 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nS3UR-00AUqK-9o; Wed, 09 Mar 2022 21:05:00 +0000 Received: by mail-ed1-x52c.google.com with SMTP id b15so366831edn.4; Wed, 09 Mar 2022 13:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:to:cc:from :subject:content-transfer-encoding; bh=WF5uaCx5pmP5JX00+D6eM3lqNw9uHLykZUlLYCW0P94=; b=pBssSHtqJ3GHfnXCagspkMeb1FLvSrigdCSjwEUL/I6u0bWka05gHXuYYNxMI9rphQ 7PPvmnlrS7MTUHgpp60ha8HMFxGloV4Mf6eMQW/226fX3BI++EJibG1egtYlCYKkF8fm 9ExlgOtqchacYMVfei10qogWH6kyVNHMzKH+1kxsja3W96S0YW3vDDyWDXw+V0iciHgh BD4aATLWrKxjZK7nzoMTmw5CWLxjSeeo6Ia/nVR+AZe9TBh7b/5/TkAvcHl/PGaFKarL l3oRsoFCKhfsoWzfAHy21C6DJ1zOrl1FLUqDv+QNKZk9gwVXd7iXxVDdyGX2K+tHPp99 yO3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:from:subject:content-transfer-encoding; bh=WF5uaCx5pmP5JX00+D6eM3lqNw9uHLykZUlLYCW0P94=; b=u4q0H7Cm5LAwVQt3/UicpSw788tCtJu4BmH9ssexGgNKf80FfNKp09tJ5aEd4kC5zC xshuD9vVZv2B1DvbHzH0GbdFBln/RlJ7L+GGDpCdn56vHEdydGPsLn2IsUDktjeOHkRf RV33Ci54weeWIunkjOLwKAzySVYWIZyj+xQb+sAkvGqRqZMnSrXDUyFEbcWZoxK5glPp G3Ays6sbWvpvOHjJFgbqBS0rNKLx3ROlUOn7ro8/UUG61AW85OlIu0J0QpX07K92tgxA 1fE1DrtXR6yAPjL/8wlgCGHfIMp66npDR5VRvIVfftHqEQ3LpMFr6yUeoLFFXu0BnGs4 6pew== X-Gm-Message-State: AOAM530626ki0YCL+q+qU6cCQ8TH6gqatUQ4XPogYybIreVo182LBCNp kV3vSM/lq/68BaQX3hwWJ7g= X-Google-Smtp-Source: ABdhPJyp5mxviqtMbA4kMNRShBPCiGJmb4vHPX46WP1NIXbPD3e4/lbbcT3rIHTP/GFzv39ZS0UPYw== X-Received: by 2002:a50:d592:0:b0:415:e599:4166 with SMTP id v18-20020a50d592000000b00415e5994166mr1291406edi.195.1646859897467; Wed, 09 Mar 2022 13:04:57 -0800 (PST) Received: from ?IPV6:2a01:c22:7793:600:9d6a:7788:3389:da6c? (dynamic-2a01-0c22-7793-0600-9d6a-7788-3389-da6c.c22.pool.telefonica.de. [2a01:c22:7793:600:9d6a:7788:3389:da6c]) by smtp.googlemail.com with ESMTPSA id x18-20020a05640226d200b00416a502c147sm606601edd.10.2022.03.09.13.04.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Mar 2022 13:04:54 -0800 (PST) Message-ID: Date: Wed, 9 Mar 2022 22:04:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Content-Language: en-US To: Andrew Lunn , Russell King - ARM Linux , Jakub Kicinski , David Miller , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: "netdev@vger.kernel.org" , "open list:ARM/Amlogic Meson..." , "linux-arm-kernel@lists.infradead.org" From: Heiner Kallweit Subject: [PATCH net] net: phy: meson-gxl: improve link-up behavior X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220309_130459_389965_331AB57F X-CRM114-Status: GOOD ( 11.67 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Sometimes the link comes up but no data flows. This patch fixes this behavior. It's not clear what's the root cause of the issue. According to the tests one other link-up issue remains. In very rare cases the link isn't even reported as up. Fixes: 84c8f773d2dc ("net: phy: meson-gxl: remove the use of .ack_callback()") Tested-by: Erico Nunes Signed-off-by: Heiner Kallweit --- drivers/net/phy/meson-gxl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c index c49062ad7..73f7962a3 100644 --- a/drivers/net/phy/meson-gxl.c +++ b/drivers/net/phy/meson-gxl.c @@ -243,7 +243,13 @@ static irqreturn_t meson_gxl_handle_interrupt(struct phy_device *phydev) irq_status == INTSRC_ENERGY_DETECT) return IRQ_HANDLED; - phy_trigger_machine(phydev); + /* Give PHY some time before MAC starts sending data. This works + * around an issue where network doesn't come up properly. + */ + if (!(irq_status & INTSRC_LINK_DOWN)) + phy_queue_state_machine(phydev, msecs_to_jiffies(100)); + else + phy_trigger_machine(phydev); return IRQ_HANDLED; }