Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1291317pxb; Fri, 13 Nov 2020 08:55:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5O+mdIPWbDN/EVE7sAvY7Lo/d7g/2I+yASBjc72GTURsA4sIspmJYVe7U9qmIL/10VHke X-Received: by 2002:a17:906:660b:: with SMTP id b11mr2961299ejp.190.1605286530821; Fri, 13 Nov 2020 08:55:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605286530; cv=none; d=google.com; s=arc-20160816; b=ewyM5SSncZpADL8Mp95wO2bDxPThiLNowVOY9R6j32WKjg4M8OEFqNQlq8MZYUNrul lMTvKcDqfwnYvTeeJ6TOZhgxIRNpRKa6VWKlOhQW5yeeFvqHlu7cpHa9u6NLDqCz5mEF AYVrcOSxWm++SSs9ozWeWB6dbxuofCsW/Rm9jvB3zDOctDZTWw+Uh1PZfv+70gxpeY3a SKPnvBTcQJj4LjYPz6w/TIQepZkwvlZxCJKKKRp2iOYlwYxKi8c4BMyqh3Ig8Zv6nlTD VSIjpUUWYUIcAw9Q2z2JsmdwS6+4so/jNA8DzGlxDggMapTxpyceS3rzxnePodb0WL/S eukQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kaxRXeGuXfHak60d13Nyjn4fY/R1ELgbzE8j8qdmc+o=; b=QzDrKL4I5Nrfrun1srDlTzUZwGfBVgcdCOzl8tuLOaKvpS9kLp8jOfoCN239ZVrq1a KSJaJwO7i+qpfHjfjXkTIN91dJr25n/NTWdC5/tapnteZ6yrqMC5WCFPVnL7SirEOkiT O/e4lESFFRFl3jPBqYb6LQOqDudDuGAqqEs1Zqm1dJDxNjZ/PN59LGtY8f8cQkl9979C sodRVRapXkKMd2pXG01OgqkNrkV+YMN0+I12QrOvDZe19AiJ4Ii5ojhA+1NC7Y6CKWc8 cI2ilGWXoyyPxMIgEfbr0RkRU+Vmdc7GS65bAJcNbeZfpsIjz1ex6cLA3Lp3YCTYsKjj aDDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UdVXk3LX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r6si6492987ejs.731.2020.11.13.08.55.07; Fri, 13 Nov 2020 08:55:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UdVXk3LX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726594AbgKMQxT (ORCPT + 99 others); Fri, 13 Nov 2020 11:53:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726507AbgKMQxQ (ORCPT ); Fri, 13 Nov 2020 11:53:16 -0500 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89BE1C0617A7; Fri, 13 Nov 2020 08:53:15 -0800 (PST) Received: by mail-ed1-x544.google.com with SMTP id b9so11462737edu.10; Fri, 13 Nov 2020 08:53:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kaxRXeGuXfHak60d13Nyjn4fY/R1ELgbzE8j8qdmc+o=; b=UdVXk3LX0+GRq7VBXDPnmTmleY12yk6LDleSJEieYCQGg10aLewuXKmLP1yJGOuvTh pXjWnPphcb0PhsiW18phrbleNUx/HoLwJDJzXT9wUCRv/gxAF0C+AwooGVadqthIpE4l KmujtiEihqKxJoRiNPh/suTxu5EKU5/Gf7gT1q9U3Yv3l7/2ecodHeqxFIod7aY66HwK xsB3yFt06C85d43/ulRvqnuQIZaOC7fSTa109X8x2B+VstjyMSRsRzVu0neWuhYwJsEK n3SxrQe/TPIr3rjhca6ij0lgWvGKpm5F/mPf+CqXm57Pake9mLBi8y2/KYQD6v3PIGbA GJDQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=kaxRXeGuXfHak60d13Nyjn4fY/R1ELgbzE8j8qdmc+o=; b=B2lcka4hTtj9Tp84VVZ9Gh8MrKVX+l+MyEpy8jZIWFVGxBJvytbvS9fmw3FtmHXgor nvLc+WvTLf8gUuJ9pMalXK9mw+tZB6T2ieS0D1VPeAsgozbuNro9lzSsFWWxVpVEwO8K Ec2ODWXEB1zS9jWBcSrI5v3VossrR+MXHip/pWigNemxe9jh+hSH0AnGMyeXiFO2UqxB 8q2S0t8UuJhMN81PDEKA1VWfR04iIAw6/KuRRT1Z7XFwXISjRyEBnSucJl6jIeHef11+ L3SgApYPU4hXJO915eapuKIJpn6CEQHl+DSwGHPE1epoybp5mYrVkj6EHE9oQ/BkVrEn H+QA== X-Gm-Message-State: AOAM532tia2MPzeTRYTWZE+9qolrAqHZn/Z5hUPyL1ipKSrvSfd7L71T 9HkcRjGGQPyoYk15/z9pr6G8ov9Gr064gg== X-Received: by 2002:a05:6402:141:: with SMTP id s1mr3247800edu.87.1605286394096; Fri, 13 Nov 2020 08:53:14 -0800 (PST) Received: from yoga-910.localhost ([188.25.2.177]) by smtp.gmail.com with ESMTPSA id rp28sm4076570ejb.77.2020.11.13.08.53.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:53:12 -0800 (PST) From: Ioana Ciornei To: Andrew Lunn , Heiner Kallweit , Russell King , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ioana Ciornei , Alexandru Ardelean Subject: [PATCH RESEND net-next 17/18] net: phy: adin: implement generic .handle_interrupt() callback Date: Fri, 13 Nov 2020 18:52:25 +0200 Message-Id: <20201113165226.561153-18-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201113165226.561153-1-ciorneiioana@gmail.com> References: <20201113165226.561153-1-ciorneiioana@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ioana Ciornei In an attempt to actually support shared IRQs in phylib, we now move the responsibility of triggering the phylib state machine or just returning IRQ_NONE, based on the IRQ status register, to the PHY driver. Having 3 different IRQ handling callbacks (.handle_interrupt(), .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY driver implement directly an IRQ handler like any other device driver. Make this driver follow the new convention. Cc: Alexandru Ardelean Signed-off-by: Ioana Ciornei --- drivers/net/phy/adin.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/phy/adin.c b/drivers/net/phy/adin.c index 3727b38addf7..ba24434b867d 100644 --- a/drivers/net/phy/adin.c +++ b/drivers/net/phy/adin.c @@ -479,6 +479,24 @@ static int adin_phy_config_intr(struct phy_device *phydev) ADIN1300_INT_MASK_EN); } +static irqreturn_t adin_phy_handle_interrupt(struct phy_device *phydev) +{ + int irq_status; + + irq_status = phy_read(phydev, ADIN1300_INT_STATUS_REG); + if (irq_status < 0) { + phy_error(phydev); + return IRQ_NONE; + } + + if (!(irq_status & ADIN1300_INT_LINK_STAT_CHNG_EN)) + return IRQ_NONE; + + phy_trigger_machine(phydev); + + return IRQ_HANDLED; +} + static int adin_cl45_to_adin_reg(struct phy_device *phydev, int devad, u16 cl45_regnum) { @@ -879,6 +897,7 @@ static struct phy_driver adin_driver[] = { .set_tunable = adin_set_tunable, .ack_interrupt = adin_phy_ack_intr, .config_intr = adin_phy_config_intr, + .handle_interrupt = adin_phy_handle_interrupt, .get_sset_count = adin_get_sset_count, .get_strings = adin_get_strings, .get_stats = adin_get_stats, @@ -902,6 +921,7 @@ static struct phy_driver adin_driver[] = { .set_tunable = adin_set_tunable, .ack_interrupt = adin_phy_ack_intr, .config_intr = adin_phy_config_intr, + .handle_interrupt = adin_phy_handle_interrupt, .get_sset_count = adin_get_sset_count, .get_strings = adin_get_strings, .get_stats = adin_get_stats, -- 2.28.0