From patchwork Tue Jan 28 14:03:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 232519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2083BC33CB3 for ; Tue, 28 Jan 2020 14:39:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE61120702 for ; Tue, 28 Jan 2020 14:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580222368; bh=5htcjhtbHdq0Ost+KCtaiwAzMuhIrqKE1/rT2KnWr9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sUxm4JAHj8f0y5pc6EXbKGlfMuyCXkfn0ORG32KOMnnDw7xgoj4v2Xc/reQ9NPjs7 PqxiqlX1uVsaY2o+ZRCFcnXAHA/1sVO+kuMwrIhhs/oP8egeN4FeaoFAHZAmepVRAF K6OquVlRGBqKlu1zYY16kUU9sFvEOsOANWvKZ9Ls= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730477AbgA1ORP (ORCPT ); Tue, 28 Jan 2020 09:17:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:40938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729986AbgA1ORP (ORCPT ); Tue, 28 Jan 2020 09:17:15 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7A5B324688; Tue, 28 Jan 2020 14:17:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221034; bh=5htcjhtbHdq0Ost+KCtaiwAzMuhIrqKE1/rT2KnWr9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y6O8YdmD+HeY8ySsh9ZBd1Jwn/Bg44kxW6TRJXetKo//D6d8xeaet2Z3H96K1UJvg DMoXbJZ8lqCAfn3Bn+dvVZl6no6UNN/WCGdOiUXWoOH1qVy41HFRBFlxfKrtifyHIZ 0jAPJshL+1lJG4DGUvP2rh+egyzc0hqbYc4/GXKM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Lunn , Moritz Fischer , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 061/271] net: phy: fixed_phy: Fix fixed_phy not checking GPIO Date: Tue, 28 Jan 2020 15:03:30 +0100 Message-Id: <20200128135857.168617889@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Moritz Fischer [ Upstream commit 8f289805616e81f7c1690931aa8a586c76f4fa88 ] Fix fixed_phy not checking GPIO if no link_update callback is registered. In the original version all users registered a link_update callback so the issue was masked. Fixes: a5597008dbc2 ("phy: fixed_phy: Add gpio to determine link up/down.") Reviewed-by: Andrew Lunn Signed-off-by: Moritz Fischer Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/fixed_phy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index eb51672106811..3ab2eb677a599 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c @@ -67,11 +67,11 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num) do { s = read_seqcount_begin(&fp->seqcount); /* Issue callback if user registered it. */ - if (fp->link_update) { + if (fp->link_update) fp->link_update(fp->phydev->attached_dev, &fp->status); - fixed_phy_update(fp); - } + /* Check the GPIO for change in status */ + fixed_phy_update(fp); state = fp->status; } while (read_seqcount_retry(&fp->seqcount, s));