Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3063707pxp; Mon, 14 Mar 2022 10:04:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUsCZnRt4YQUQc2P9VF5DW8HvLoO1xQZpCkqV4gX+6epDzFoT21jDqWGMKHOqigGTsXmLN X-Received: by 2002:a65:6091:0:b0:35e:d274:5f54 with SMTP id t17-20020a656091000000b0035ed2745f54mr20838278pgu.200.1647277475746; Mon, 14 Mar 2022 10:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647277475; cv=none; d=google.com; s=arc-20160816; b=U00jjdRkAiw9DpWF9FXvjiG68po1i/COf9ghC9TWTBP/ZJvUlE8v2kR2mIPCmh3/dl OBFY0sL57QEZlWlfBw/ZnyaJipPhprKogJ/AWQclwG3Q8gni5hfupF2fr4Xj3zKa8xS0 G8XuAAPu++LzoQXXYhXhdHFSadHi4EUr+jnG5QfdlBKXnVffS/+CLOBthVD7lbMW9HR/ eq4JW58zXrY4eApmvSuPoOrCrTawqJ0xbx3mXE/9roueHhmRtHXTRDR5/I96+e13YO7X MW+tzHoL/fESXqyZJUbvC9WbNsXze7Ccf1a9XiBm0ELdIunB8MgvkaaPQLADkH6CgMsB KtvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u2p9Tah9Xo7zKeoe0eoj37ycBY5sUO0U9+t/ooY04Lg=; b=c4i6zfmS+KyGzAhx0zgFEw0eRUhzG7nRsuXC5H2iPgXlsrcU64qd01yY+IoLXvOvVU 8RmhL8vS6z2/XbRzCFucZt3sjFpI6E8tHsfBQIvbQN/2HZHuxlUTDdqSUqJHmueQbu3G dPVmChi7MTEBoBNJxm+4GDDH5ejI4LYPubksNDmOQdbuKKCXPLpkRNzBL5LF2A/YosvQ ilOLzg0bJgSLimMPSDEjxWF+5vIb706uaUkDsPoRgM4vKnzcNdxs5+1ff7TRdey4VQWk FLpHdjU55jH2OUVCazcQxfnvC/5EbssGU1z1gydC8D/icMABOqtoYMcv5G3rcaF9gnND CdrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lt1LJ11z; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d8-20020a17090ad98800b001bf0205ffa3si12210377pjv.25.2022.03.14.10.04.11; Mon, 14 Mar 2022 10:04:35 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=lt1LJ11z; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235543AbiCNMRS (ORCPT + 99 others); Mon, 14 Mar 2022 08:17:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242306AbiCNMJv (ORCPT ); Mon, 14 Mar 2022 08:09:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A1626ADB; Mon, 14 Mar 2022 05:07:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5ABA5B80DEC; Mon, 14 Mar 2022 12:07:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1AB9C340E9; Mon, 14 Mar 2022 12:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647259620; bh=rg6mB/XZeyc4/94kQYCm4veWrHrTIgQhki3atHfiu7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lt1LJ11zVOHvfNz135VdE1eXlp60KDPZHfPJ5XYhaP+ELjpUY0CqOTu9b0obWfRz3 kfZvex04kU+PTUHo6xi34lZIIYCr/f8EL5/nZaVSemZFhQxDZWro7Hqr/Fa/KHTecG weL4TnJGF36SWijsWHp+jGgqRzrvUahGp2ZQsSz4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Erico Nunes , Heiner Kallweit , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 051/110] net: phy: meson-gxl: improve link-up behavior Date: Mon, 14 Mar 2022 12:53:53 +0100 Message-Id: <20220314112744.461533566@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112743.029192918@linuxfoundation.org> References: <20220314112743.029192918@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Heiner Kallweit [ Upstream commit 2c87c6f9fbddc5b84d67b2fa3f432fcac6d99d93 ] 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 Link: https://lore.kernel.org/r/e3473452-a1f9-efcf-5fdd-02b6f44c3fcd@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- 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 c49062ad72c6..73f7962a37d3 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; } -- 2.34.1