Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp461801pxb; Thu, 12 Nov 2020 08:02:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6Wwmy/AMuQvBv5vInZNCUCN6R0Q+jgxCqbZwOiEDvbPsBDTF/yXSgNkeb6gqrn+KIXIOl X-Received: by 2002:a17:906:2895:: with SMTP id o21mr32413411ejd.332.1605196925976; Thu, 12 Nov 2020 08:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605196925; cv=none; d=google.com; s=arc-20160816; b=ZhCulK797bbCqSPnS9q0SxMgFRj+iGchfqtd6mH58irKV2fnxzNsn8A03s3z8E9D1y ubJCDFZIqEJPOXm2GpAkodS7LY2iN/jxhG091HUiu3x9WpqxnB/n1zBLmhGrrhUdFBmb C8BJeDGS3yke7+OThel0umAOOU9yhmG2yg9ATm0bC4h2seFbn68D4nYOAOlbFEqhwQXc dToF/o0/4Jvqi8NpZnPx5x+UlQAj2aU9M8Y+fXNKJ/5HJ9ivokXBn+9ABeos4HwSo0Gu 1e0jdHizJUHuX7LiXX2taGhA5oMIViZpxiqmGx/MJfOD967WqBkx017RnRjX79/qWZUZ NnMQ== 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=WRj8kGX7s7SWFRxtrV/mPs1BTo8dFHEN4BaCHQWnYmQ=; b=oBz5VD6s5Fj6GDQHwSt3nNXmcyGIs0Mj3nEndaoxU8rfBAHOZkrTbQ9DIT/P1MHR/1 ZFLdpOXEFDqxVBbeZjtylHPXb6UgZsCcHzE/RiE4BvZifTPA+tzu7FekBLpHvh34EeC6 ZaLdLRZ0HVjsVZmN+/T0CbvVvq4fSLxYBa2n4OLLQPITqR34Idod4AMbQcURqgFywFcj rGHeoQQa3zvMo8ZXMXWGno/tpF5z8UJN8P41KprfDS0V3LWNKJoFAP0lpxaRJgrDWCUn H8S+MYAnYP4vdYnhNf3SzVTn1jVDaplZEuzNTfVMtGkM3ZqkQrga1Bsuie6ec4/w+mFu ci7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pUZkhamB; 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 n23si4165970edy.328.2020.11.12.08.01.37; Thu, 12 Nov 2020 08:02:05 -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=pUZkhamB; 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 S1729025AbgKLP7W (ORCPT + 99 others); Thu, 12 Nov 2020 10:59:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728913AbgKLP6h (ORCPT ); Thu, 12 Nov 2020 10:58:37 -0500 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F801C0617A6; Thu, 12 Nov 2020 07:58:36 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id cq7so6862638edb.4; Thu, 12 Nov 2020 07:58:36 -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=WRj8kGX7s7SWFRxtrV/mPs1BTo8dFHEN4BaCHQWnYmQ=; b=pUZkhamB3UDP4y1yRLxxo8fo/wUnYQ1KGoozgaEN91Du3bLl3lbR9yngsaecATSE92 yJYh0BcSf9/g9GASTVltcLg/ydJYnBYsiJSHsVab5+bgE9ovjoNGAdnjgEXdpbJ3Qid3 THvfvHM0AYl1JSZDLUQqYw2+iX23Px5va22OjFC0pqK/unEDY0xY8vBZl3gN80ntOKG/ ROccObgrlW5H/089ubAYy3/ydnyGB/W8jd3BHF1t5l+f+U3K0nfvCs6B0cBHlH3P9Z4S aeju7qu8xTTkJmWl0KICsETtwhAfUEMLWJDDf+FxyxnfbYl2HKgKYPmTNd65etEmMVbp WIaw== 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=WRj8kGX7s7SWFRxtrV/mPs1BTo8dFHEN4BaCHQWnYmQ=; b=Z0PGT6BXE0WspMhvFAksQIz+gJK+zB2M7w+7yKV3gKO2eY+rlMu+A9jYTt9+vIf9dz vycXng2buJhVjfpaaLm2Xh92To003PTHk/j+04RGEi8880VmBxdM8hqm0LrhG9T6t0iE VkNA71TskygnJDb0mUX+UhDXz6waZpEImdR2yvbZLccNqmgucLG2pbb2e0uGlT7elyTd DhFXJCyw9sLeqw0vmdRTVJ0S25ivGt/43fF6BwC3w/2X1B7BX/0Da07sEmsxdNbc86cg pXq/McXVrEWxfUe3xFoCp8VZlny+CrechPdPP3FC6sy+NNVZwalExYX/kyI6gwem10hk 5uTA== X-Gm-Message-State: AOAM531Q41FjN2EWIIeC5IQ6b4nFb1pKfsxTGG4dy//kIjmR3JqS8Bm7 iPw8wLHLmoNPLo/K/aLQk10= X-Received: by 2002:a05:6402:22c6:: with SMTP id dm6mr397606edb.139.1605196715324; Thu, 12 Nov 2020 07:58:35 -0800 (PST) Received: from yoga-910.localhost ([188.25.2.177]) by smtp.gmail.com with ESMTPSA id q15sm2546540edt.95.2020.11.12.07.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 07:58:34 -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 Subject: [PATCH net-next 15/18] net: phy: ste10Xp: implement generic .handle_interrupt() callback Date: Thu, 12 Nov 2020 17:55:10 +0200 Message-Id: <20201112155513.411604-16-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201112155513.411604-1-ciorneiioana@gmail.com> References: <20201112155513.411604-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. Signed-off-by: Ioana Ciornei --- drivers/net/phy/ste10Xp.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/phy/ste10Xp.c b/drivers/net/phy/ste10Xp.c index d735a01380ed..9f315332e0f2 100644 --- a/drivers/net/phy/ste10Xp.c +++ b/drivers/net/phy/ste10Xp.c @@ -76,6 +76,24 @@ static int ste10Xp_ack_interrupt(struct phy_device *phydev) return 0; } +static irqreturn_t ste10Xp_handle_interrupt(struct phy_device *phydev) +{ + int irq_status; + + irq_status = phy_read(phydev, MII_XCIIS); + if (irq_status < 0) { + phy_error(phydev); + return IRQ_NONE; + } + + if (!(irq_status & MII_XIE_DEFAULT_MASK)) + return IRQ_NONE; + + phy_trigger_machine(phydev); + + return IRQ_HANDLED; +} + static struct phy_driver ste10xp_pdriver[] = { { .phy_id = STE101P_PHY_ID, @@ -85,6 +103,7 @@ static struct phy_driver ste10xp_pdriver[] = { .config_init = ste10Xp_config_init, .ack_interrupt = ste10Xp_ack_interrupt, .config_intr = ste10Xp_config_intr, + .handle_interrupt = ste10Xp_handle_interrupt, .suspend = genphy_suspend, .resume = genphy_resume, }, { @@ -95,6 +114,7 @@ static struct phy_driver ste10xp_pdriver[] = { .config_init = ste10Xp_config_init, .ack_interrupt = ste10Xp_ack_interrupt, .config_intr = ste10Xp_config_intr, + .handle_interrupt = ste10Xp_handle_interrupt, .suspend = genphy_suspend, .resume = genphy_resume, } }; -- 2.28.0