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 X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham 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 1547CC282C2 for ; Thu, 7 Feb 2019 05:45:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D49622147C for ; Thu, 7 Feb 2019 05:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549518341; bh=DRfV4szs40ya1bPVdGMiDE25rLGT0suhLe2d7FVAIxM=; h=From:To:Cc:Subject:Date:List-ID:From; b=jvpNA+32eYGYH4dBVG1PjL+7QV+bNNwMS+d7lPhA7KSCKt1vQ0a71ZEAVkhsyh3zd 4qBMEkJSC8AujHp691F+nG5CCXSmM7bcn5SBcl8teT4q+zmalnqZQIYUDwBkqVT/Hh VjPge3pqNcelIeTFbO6a2lzMtbbJQdOW4mWaP/80= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbfBGFpk (ORCPT ); Thu, 7 Feb 2019 00:45:40 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43454 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfBGFpk (ORCPT ); Thu, 7 Feb 2019 00:45:40 -0500 Received: by mail-pl1-f193.google.com with SMTP id gn14so4281969plb.10 for ; Wed, 06 Feb 2019 21:45:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1/XuKC06w0o2tfOG+IZnGnEkIbmY1Io4BgDh5iGJOPY=; b=Q4qs2L7+troxkYgNtz25n1NKGcMy/o+mPZ5yVgZqVu6Hb1jOPofHY1jZmyYZ0/MljZ 8qaWoG4LoSVBQR6CQT90cki9VSRwakfBHycqFN0BvpPLYOdSczpT3J6gwHtFC29xqXnc elEn6r0JK/W3s9o4FdN/4bYQ2G0hHA1ooHe0YqAtWySc++WsyBjdnW4b8lUE3rr/fmXE VfK7o/XnRIUHmT2VMKF2kL+CQO0bWwbHlehrGTSMY/n6fRh+SToh2ZQEMEUdbtnd++Bf KzzxOJKndT0kW8qX/3TtF+Vr4sNVzuUYFWhagVyykTWut2o3EsLssWokKmx7ucqUufTC qEjA== X-Gm-Message-State: AHQUAubb0vfCXxPPHYO700xqmUo/F/HwjBH7Q6lkpVo2/ycsEWkHxrSJ umMEVLb4ST4GOl9eR29hYdJB0cgOqjoYvg== X-Google-Smtp-Source: AHgI3IbUDAOfIEn43rGSI5w0tZaQ96eaAsFZkda7/euF95HRQPbL5Oc26Rpo0HSHB9LiOLPumuxuhA== X-Received: by 2002:a17:902:be11:: with SMTP id r17mr14824848pls.308.1549518338861; Wed, 06 Feb 2019 21:45:38 -0800 (PST) Received: from localhost ([2601:647:4700:93d:6db5:e35d:dacd:7872]) by smtp.gmail.com with ESMTPSA id t3sm11702771pfa.50.2019.02.06.21.45.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Feb 2019 21:45:38 -0800 (PST) From: Moritz Fischer To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, davem@davemloft.net, hkallweit1@gmail.com, f.fainelli@gmail.com, andrew@lunn.ch, moritz@ettus.com, Moritz Fischer Subject: [PATCH v2 net-next] net: phy: fixed_phy: Fix fixed_phy not checking GPIO Date: Wed, 6 Feb 2019 21:45:29 -0800 Message-Id: <20190207054529.2865-1-mdf@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- Changes from v1: - Added Andrew's Reviewed-by: tag - Added Fixes: tag (Thanks for digging, Andrew!) --- 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 f136a23c1a35..d810f914aaa4 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c @@ -85,11 +85,11 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num) s = read_seqcount_begin(&fp->seqcount); fp->status.link = !fp->no_carrier; /* 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)); -- 2.20.1