From patchwork Wed Feb 6 18:10:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 1037686 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43vqYF0XT9z9sNG for ; Thu, 7 Feb 2019 05:22:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727797AbfBFSWX (ORCPT ); Wed, 6 Feb 2019 13:22:23 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:32946 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbfBFSWX (ORCPT ); Wed, 6 Feb 2019 13:22:23 -0500 Received: by mail-pf1-f196.google.com with SMTP id c123so3469092pfb.0 for ; Wed, 06 Feb 2019 10:22:23 -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=cSJLiK1N9ORutnoc8pdbfXlKbmEjRk9rF6bBA9EJhk4=; b=HjYKeSEfHogYD06xwRmMAiUD263jmbIOG3jJIYTSLSob4pMshRn4kIc6c5prVOK2eF bjcIRvp5V9JKi65cuRNoyc3P7odIVyA/tUOu+U4cuuQrbVm3J1I455oNiqCXEb0f+uWn eAL8gXYSxETUsO7mEl9eODnU5js8WYyBJXteme5c5a0CarsSuCioN97KqSplJpaMIqRc +gvEELvudzgzbKCubMxHmM0mfD5XIPk6Wsu1qC7hRq1rj5PZtK3lhr7JuG0S8K02L7im PKYiA2aHWjnJt8eKyY/FqResWHqfiybTE/knPiQ1InrivL3zOkl36s29QGSpObkaFAAP aXUA== X-Gm-Message-State: AHQUAuafPEI/CDV9K6eAnJGOTYsRQoe4KxfsDDhTPjaV2tfpqiA7JX+8 EmvFDgvnxX1XHAzJ3wm2NTZf/F6E4PU= X-Google-Smtp-Source: AHgI3IZrgTNPPrQD4zUa0UQm636UFyXfjtdZkSDFofX+T+Kk1PmlKO6tXrx5TB7OBR2MUE0QVkonFQ== X-Received: by 2002:a65:490e:: with SMTP id p14mr6175982pgs.373.1549477342313; Wed, 06 Feb 2019 10:22:22 -0800 (PST) Received: from localhost ([207.114.172.147]) by smtp.gmail.com with ESMTPSA id p2sm9412359pfb.28.2019.02.06.10.22.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Feb 2019 10:22:21 -0800 (PST) From: Moritz Fischer To: netdev@vger.kernel.org Cc: andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com, davem@davemloft.net, Moritz Fischer Subject: [PATCH net-next] net: phy: fixed_phy: Fix fixed_phy not checking GPIO Date: Wed, 6 Feb 2019 10:10:40 -0800 Message-Id: <20190206181040.29539-1-mdf@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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. Signed-off-by: Moritz Fischer Reviewed-by: Andrew Lunn --- Hi all, I've been trying to figure out where exactly this broke, it must've been somewhere when the file was refactored in connection with phylink? Unfortunately I couldn't tell exactly so I don't have a 'Fixes' tag. Should this also go be queued up for stable/5.0 if it is indeed a bug? Thanks, Moritz --- 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));