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: 159087 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2439297jaa; Fri, 22 Feb 2019 18:37:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IYrhhQqXP7GqHHo3tf0yO8q3xURTOnDSKFPnnKZiKHDzl/jAzoetW7/Qxdsthjkcol8g+lN X-Received: by 2002:a17:902:9894:: with SMTP id s20mr7317592plp.135.1550889454183; Fri, 22 Feb 2019 18:37:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550889454; cv=none; d=google.com; s=arc-20160816; b=krw6vVPhf1FxuSZ9RTyLWyZz0cQVr0mGjGHgX+QCXmjUGJLPuRh3UI5oBAXLnpqOqy LlOn2VEgX0j+XlfDLCzgXLrq5aA2rIKGDeD1h8jYP2WfNE1rc/h4u+g5rt2zRqDYrYid jSsyxxadogl0Wii8ReIXauj8tiejK0+BTDgOHJzsNcccqeGRAUWrQdRGzrXcJcq3f1Vu F7mkJlIA+qiGrZD5ERw81cCWE2cYUDBzSRXB9GVTKGb90zRqSzFJ8Em26AZMAjR/z1yJ UXb2qMcDiHbngyLrgfQS0pcTbLa59ohjvnEdAWTBNSKCIyXnJxo23tsLUCuEqDoejm38 R7Zw== 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=2CeoghqMJ3yTTiTCNZeI0/04Gdqk8OHY+Xya77XLxYc=; b=G7OIyxU+ZM3gmrmFEPoApbnLDhuz05bEaY+O2hlagwrryJldEUlA6W3KHxdbvpdfw0 e0uKTJs4Zu1QksobeDe5obGuuBFUItY/H3vGPgqdnm4TwQskxbqUdn/FjYqb2aUkvQ/J MDRXqTL7lRAoimyXD6U8ufvLScPONl36xgehh6DrrpdmdC33vMdrQyCqZhunKPDY0pTx xea5G/ggLxVKM49gRWr9Kttus1pVO+pLW+fu2suPcEIMblZ9B5tioSsGlK8FT/XpQqha khf0iJVxoAxUGXbAGKLSk1ZvkrR/SfqyAbmZDqJ7nfODaT+sY9LQpChuQfj2mIbAjIz5 33+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zu4PoApH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si2981281pgt.73.2019.02.22.18.37.33; Fri, 22 Feb 2019 18:37:34 -0800 (PST) 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=@linaro.org header.s=google header.b=Zu4PoApH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbfBWChc (ORCPT + 10 others); 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-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(+) -- 2.20.1 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, },