From patchwork Sat Feb 23 02:36:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1047251 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=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Zu4PoApH"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 445snC3Hqyz9sBL for ; Sat, 23 Feb 2019 13:37:34 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbfBWChc (ORCPT ); Fri, 22 Feb 2019 21:37:32 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:41042 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbfBWChc (ORCPT ); Fri, 22 Feb 2019 21:37:32 -0500 Received: by mail-lf1-f68.google.com with SMTP id e27so3146533lfj.8 for ; Fri, 22 Feb 2019 18:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2CeoghqMJ3yTTiTCNZeI0/04Gdqk8OHY+Xya77XLxYc=; b=Zu4PoApHbJMHTjWA0UdwcTEGVBDAjp42BgBMUJiGoOWigwYKg4I6Zd/+OLx9rdO+0L g54HGhEg3TcFJSgta5YiezMYkHvrBRtdWEsiwqaxQk6wRpxSgLjTbwzShzKxcryUUszG Xrvbsx2diT7c6awaz/KxKOa4imU6Qbkr7BEfWJYcqksbDeJQMKZXJTpVpBOmqCtgNUyv Roo+a6Uivha/c2BiQ0vCZ1UXbM8oVKzFpaZNAorNIB4EBMGLitZTJSUsGVOiGs0qw5iT nkZFWMOKQP6s5umzyTDDhy04OAhIoDR5AfDboX+2UeRUBj4AfItp5h+B0eqRXzcqjmAJ +pIw== 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=2CeoghqMJ3yTTiTCNZeI0/04Gdqk8OHY+Xya77XLxYc=; b=E4zaYnEHPivN2+MuEBfBJEd+T92ckdcLURYKeuK7raUgRRel8Yd0SI4dNnQL/t0odI aSK/p6lyFt7WL+uuk6ZofnoUI3Jlk617yRPgVTdl4nn8tdyLBqJwEw+zSezWsb2hqDDf /aw9MVGQUh/gejAFLsVurtuX/q4b5je4Aj7RSDvC1goWPzn07WuppUPkKp5YXXaOY/lc R7hWbEZ5fXeHaBY0k9a9xg1W7lCFab/3ZETkD26TnuGhi8QyfXsdQDQZUGFtsqm1lH7J s3C1Z747Hc2W7P13AnEJSbkcv1gUcoRIAFgrWLxz5rCj2hme8rUnN0VU9zqxJujxakFj 4hyQ== X-Gm-Message-State: AHQUAubvlWFhkF4ht2LuHAE3AYFAFLJUcZgtLgVICihGKv6oz+3dXrdd e4bUu2OAZDsFi3yv6hNtWLnt8SPcF7w= X-Google-Smtp-Source: AHgI3IY9+RpRJ18IGGesYf2EbYwb5gK9HSCpvTcUg3rdWOg35F5NKdC3yVzq+8VuAKSM1exrRnxeqg== X-Received: by 2002:a19:e601:: with SMTP id d1mr4502329lfh.71.1550889449937; Fri, 22 Feb 2019 18:37:29 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id n20sm991697lfh.53.2019.02.22.18.37.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Feb 2019 18:37:26 -0800 (PST) From: Linus Walleij To: Andrew Lunn , Florian Fainelli Cc: netdev@vger.kernel.org, Linus Walleij , Heiner Kallweit Subject: [PATCH] net: phy: realtek: Dummy IRQ calls for RTL8366RB Date: Sat, 23 Feb 2019 03:36:39 +0100 Message-Id: <20190223023639.27038-1-linus.walleij@linaro.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 This fixes a regression introduced by commit 0d2e778e38e0ddffab4bb2b0e9ed2ad5165c4bf7 "net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt". This assumes that a PHY cannot trigger interrupt unless it has .config_intr() or .ack_interrupt() implemented. A later patch makes the code assume both need to be implemented for interrupts to be present. But this PHY (which is inside a DSA) will happily fire interrupts without either callback. Implement a dummy callback for .config_intr() and .ack_interrupt() as a workaround. Tested on the RTL8366RB on D-Link DIR-685. Fixes: 0d2e778e38e0 ("net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt") Cc: Heiner Kallweit Signed-off-by: Linus Walleij --- drivers/net/phy/realtek.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index c6010fb1aa0f..31372be44570 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -211,6 +211,17 @@ static int rtl8366rb_config_init(struct phy_device *phydev) return ret; } +static int rtl8366rb_ack_interrupt(struct phy_device *phydev) +{ + return 0; +} + +static int rtl8366rb_config_intr(struct phy_device *phydev) +{ + /* Dummy function to make sure we get interrupts */ + return 0; +} + static struct phy_driver realtek_drvs[] = { { PHY_ID_MATCH_EXACT(0x00008201), @@ -282,6 +293,8 @@ static struct phy_driver realtek_drvs[] = { .name = "RTL8366RB Gigabit Ethernet", .features = PHY_GBIT_FEATURES, .config_init = &rtl8366rb_config_init, + .ack_interrupt = &rtl8366rb_ack_interrupt, + .config_intr = &rtl8366rb_config_intr, .suspend = genphy_suspend, .resume = genphy_resume, },