From patchwork Thu Mar 14 13:49:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 160330 Delivered-To: patch@linaro.org Received: by 2002:ac9:18c7:0:0:0:0:0 with SMTP id i7csp15718638oce; Thu, 14 Mar 2019 06:50:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEA1ORoSTk/K96ab3eM+D/QVdPw5S1tPKvlxGk5F8kTP1whzmx3KT2IqUNiXWx2d3TS0TR X-Received: by 2002:a63:f80f:: with SMTP id n15mr1632721pgh.283.1552571402771; Thu, 14 Mar 2019 06:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552571402; cv=none; d=google.com; s=arc-20160816; b=ZkDoP+tR2nT9WPFIJGW88n35ZRzY7dqeK7i0DkHN4MbeB/hfPIJBuZJPfHlDUl5AWt T1BQTB+mVRsUpLFz2I0+nBZR8qPvAtJEBNn4nr5WMAaKKskVphxbRzxkO2Y7+0AM+6kx gf9UX74a5pc9kDD+AhCgAF+B7zFCxVR2h0QuJ+i8nkbQE07HXbkT2RP/df+uFpOOX6ke 5EOOT3upq7QZB4wl60fk+NqGB7/Z/TBd4TsY1rH8fGNVTrPUN/kvsUUwia+uKqtWalck YTF2bnpEI0FEXjhcoYq6mCWJnJANn5gWB6Ryqwn4CaQJRq1hwMQAh9srMuX7p0NXDZ/N zocA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LopwxDimRT8UjyEYLKdAqKMp3HyHxeVVB6mLtEYK2Pg=; b=yQQulVBSaKYPG45YVSMhwhFjr/95mxfs5kDgvoHePZOakcZwvdql83edB7JSZ/fjjH iWUJ5Il/jKR/68pU0wjybI+URIyMpxf6nEeV1tUXAkbP4PTyzFgrB2F4AdRqm2LbgZdS 5tzq34+68xXttjKFnbQUE2ydFFpG4GayTN74r3B2w+Oklp75p4f+sSV6sjnefBbJoNmD 7x6kJduZt5wkygZfo3QvpQvSsZAgasbaDsV6HLOt7eZS23E9V2+x0mt9i6+mRDHt7Z5Y o21mVfMZbTETMPpiFB+W0lWehWhUUlLGtjPKgWReCsrII+VNFK/gnqdb0FVGUZqr+4ly wzkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=DEK3e7jX; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si11963974pgq.119.2019.03.14.06.50.02; Thu, 14 Mar 2019 06:50:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=DEK3e7jX; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727566AbfCNNuB (ORCPT + 10 others); Thu, 14 Mar 2019 09:50:01 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42685 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbfCNNuB (ORCPT ); Thu, 14 Mar 2019 09:50:01 -0400 Received: by mail-wr1-f67.google.com with SMTP id n9so1846323wrr.9 for ; Thu, 14 Mar 2019 06:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LopwxDimRT8UjyEYLKdAqKMp3HyHxeVVB6mLtEYK2Pg=; b=DEK3e7jXnx99b+eK6vj424kE8CI5tN/CLiNyjBVJ18/VABvP911FtXthdLqTHmqsKX z+rE5vXM55cY9r4xuv205zn6gwUONqfphvFtket9SqkAVLCKK04iW9MfE2zCRYl8wyZ6 shz7MU1wR74gXNfXPsexZLOgMXvjYOp0WMfee1ruxEUGo7PiYE9Dzwg449BcmEhyyWQ1 QOcQDJtvA9o6dWef3TfopSC05US2cbVmkW5Rl0nCLKXyWq8VGvzegNpTTww5f1d8M0jF LZ44RKAkfxq3QtG5rPc6cwVyp+wMb1+iR+gsRpXPwt0NBu02xOvGqLu64uJVQxsW2n3m ETlg== 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=LopwxDimRT8UjyEYLKdAqKMp3HyHxeVVB6mLtEYK2Pg=; b=Mxtvp6D5Ba8PtsvXs6YD+gjrCcweiGQ97eM8PCtzY+vkawLkXuONQ1OaJaphyDx8SJ gdVkNRimKUXniG38e1BeT4lsMXjEXOng13qSTOer2Pjbeu6ChemvYwD+yK1SnhmMikYH z8K/WykZ/aIrqnpYByjcWa04q/+0bRy+3XJ3KCOxKjMQ1pw3QtfuPcEoUyCFOLjTsxjN xD4asuQomfcP2bXFOxDfa2tx2S9WL55gtZHV9224F5BsBtQsO5AusdOeYLt1PGFpuBS6 bdJcCPy4QAYWjNuYGKvfqVnaPCCddY+a/9p+gmhYZefHFPOf1p1sE/gU3QgUL94AFDK8 o21g== X-Gm-Message-State: APjAAAXAl57R/RHrO1h+xHJo6Wsc7UUp3rOQajG+C8ZNI+Mebz586KZ+ r1F1JDrAxUVCAcc00881PlQEkw== X-Received: by 2002:a5d:6643:: with SMTP id f3mr11213036wrw.120.1552571399328; Thu, 14 Mar 2019 06:49:59 -0700 (PDT) Received: from boomer.local ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.googlemail.com with ESMTPSA id y8sm12079963wrm.8.2019.03.14.06.49.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Mar 2019 06:49:58 -0700 (PDT) From: Jerome Brunet To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , "David S. Miller" , Kevin Hilman Cc: Jerome Brunet , netdev@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net] net: phy: meson-gxl: fix interrupt support Date: Thu, 14 Mar 2019 14:49:45 +0100 Message-Id: <20190314134945.17300-1-jbrunet@baylibre.com> 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 If an interrupt is already pending when the interrupt is enabled on the GXL phy, no IRQ will ever be triggered. The fix is simply to make sure pending IRQs are cleared before setting up the irq mask. Fixes: cf127ff20af1 ("net: phy: meson-gxl: add interrupt support") Signed-off-by: Jerome Brunet --- drivers/net/phy/meson-gxl.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c index a238388eb1a5..0eec2913c289 100644 --- a/drivers/net/phy/meson-gxl.c +++ b/drivers/net/phy/meson-gxl.c @@ -201,6 +201,7 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev) static int meson_gxl_config_intr(struct phy_device *phydev) { u16 val; + int ret; if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { val = INTSRC_ANEG_PR @@ -213,6 +214,11 @@ static int meson_gxl_config_intr(struct phy_device *phydev) val = 0; } + /* Ack any pending IRQ */ + ret = meson_gxl_ack_interrupt(phydev); + if (ret) + return ret; + return phy_write(phydev, INTSRC_MASK, val); }