Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2631862pxx; Sun, 1 Nov 2020 04:55:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCFVltIzZ5BPaLx+5nuIqdFoiQ+98HxWApU/vp/JlKBAD9favhgb5f/uyasJXoboDyOUFl X-Received: by 2002:a17:906:268c:: with SMTP id t12mr10571043ejc.377.1604235339234; Sun, 01 Nov 2020 04:55:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604235339; cv=none; d=google.com; s=arc-20160816; b=dHdH44+adhFZCZzGyDF3yXEQfW6t9jPD4Jazp8MsrlmL1NhZRVtvfl78LgqUt2iUVA 5wwqkbyOsYlrQE97yyt+qIPC9vRNEqdl0ZVQLQrLyi+HCDCJfM05Cdtm4lmkX5BO1kvR GmhgWF5MkhuDRYtFjpeeYp0Vj68H9sefuYnNzpyulWthCLliZgVzATlzDqavzl+sBGqT 9Eh3n8KAQ+DjdNpeG5dYFYasFOmf5lvY33AVAz6BJrNlwYJfd6IZ3bXIkZQc3m+l38s1 hvsqDIKK/AMg9XP3BatWX3CCMUTgvjh+Zv2o85fj+32LFmN9ZZwMcUwsZv1lnXwmR2XT zZ5Q== 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=hO8iEAWXFC7W/MF6vT8UKXWiO7uCrbk5wP0QUGzUSFk=; b=LRgnmipzVTLXoTFXivXdqnaKiFBdBMzWiEWw2MhweL1oeTvbZ+0WoSLLno2NBwDDX4 W5qWK8vO9MDAwOikdu6j9VujJ1W8KCWe1C8huW9deAbaJiBRv786MbrTn5kw9MhUaKfb DrUGvgZTmnu+kMynqdj3iYteFO6ZN9j9SGbTNE1Vn81r2NgKFBHPGsYLcBnIA/FQNEZP t0bfB6tIV7+pErpycyWF7ywfiUoIPD7wcjuF+aqzrgluFUBq0h7x2xdXCVCCkVMHShxy YHLBhxUbvtrp0LyWcb2XfueqozCkC1dHTZ1y66MNqwYZ43rrNimOtchFsSXYzQVqwE0+ IE/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pIqD7R0E; 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 62si869479edc.231.2020.11.01.04.55.17; Sun, 01 Nov 2020 04:55:39 -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=pIqD7R0E; 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 S1727054AbgKAMxJ (ORCPT + 99 others); Sun, 1 Nov 2020 07:53:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726973AbgKAMwp (ORCPT ); Sun, 1 Nov 2020 07:52:45 -0500 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66344C061A04; Sun, 1 Nov 2020 04:52:44 -0800 (PST) Received: by mail-ed1-x541.google.com with SMTP id l24so11347704edj.8; Sun, 01 Nov 2020 04:52:44 -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=hO8iEAWXFC7W/MF6vT8UKXWiO7uCrbk5wP0QUGzUSFk=; b=pIqD7R0EAHt+2uEyvaVLLyrbWqgJtipiyZxV7FZ+O//0GDRRnkcS/EbwMbisPEqvvA uBlrsNXQbDJkb25jFG16C5Ref4vi+9MxYomFNnS5tGtM8jVSK2MmaipDLGff/aQefZ7n cm4rIUgVMEnY1LaW05o64w/9h4hcPLsEdHnwkQq61dtfiGxp8NcRrx2rF4fLJEd+ESlz BNcTv4gQa/hH1A2o/aiObIJ3vAXoTtFH7Gc8QnZfP9z+b7NZ0S0g5uNTj0bqbHR+r5hP c8LfgPdTKazgfKiB963b21Ze6rNGFtFrgctpVWs5xS8lAVJdV8TRNFfzrH4Z9+5dp6Yx /3RA== 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=hO8iEAWXFC7W/MF6vT8UKXWiO7uCrbk5wP0QUGzUSFk=; b=txiPmOJjLV67pWBghfP3c7ucLbDg/x3Zy7MppGfM+yX4OplsIdEZVIFiYz1c2vK33V Otq8XCjt7B0D1txVUD6zXqwVNe3sk4tU5OE7I24HStnPYlPrtHSzKpeMcXI41PzMFbas vvSdqnN8UHRRL33SLs0DBcbG6ltFM0F/VCmv63M7Tk7mQkOrjvfGI5v1FetEnThOK3Ay DHhc0jzxDNfbTAWbLQlPzZtbhgB0+Tr+5TPKJVC3Ilbad5Cbk4E1uZNvdIwb6PBuMe16 GZNKT7RhQXrghCHStYrVrkVY2DCWhEvjP36pb8m/Xp8ifAAIPWUe11pYaPrOWpoW/5rF ahtQ== X-Gm-Message-State: AOAM532yD6Ub/vZW8/iJxoVTv9OCHy3R3q504WaGDpZJCbrFaqMp6u7W p2TKpuUDq/isNqtA3x1Y0O4zzBbwHmR5+gp7 X-Received: by 2002:a05:6402:3136:: with SMTP id dd22mr378857edb.256.1604235163120; Sun, 01 Nov 2020 04:52:43 -0800 (PST) Received: from yoga-910.localhost ([188.25.2.177]) by smtp.gmail.com with ESMTPSA id c5sm8133603edx.58.2020.11.01.04.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Nov 2020 04:52:42 -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 v2 17/19] net: phy: add genphy_handle_interrupt_no_ack() Date: Sun, 1 Nov 2020 14:51:12 +0200 Message-Id: <20201101125114.1316879-18-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201101125114.1316879-1-ciorneiioana@gmail.com> References: <20201101125114.1316879-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 It seems there are cases where the interrupts are handled by another entity (ie an IRQ controller embedded inside the PHY) and do not need any other interraction from phylib. For this kind of PHYs, like the RTL8366RB, add the genphy_handle_interrupt_no_ack() function which just triggers the link state machine. Signed-off-by: Ioana Ciornei --- Changes in v2: - none drivers/net/phy/phy_device.c | 13 +++++++++++++ include/linux/phy.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index f54f483d7fd6..e13a46c25437 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2463,6 +2463,19 @@ int genphy_soft_reset(struct phy_device *phydev) } EXPORT_SYMBOL(genphy_soft_reset); +irqreturn_t genphy_handle_interrupt_no_ack(struct phy_device *phydev) +{ + /* It seems there are cases where the interrupts are handled by another + * entity (ie an IRQ controller embedded inside the PHY) and do not + * need any other interraction from phylib. In this case, just trigger + * the state machine directly. + */ + phy_trigger_machine(phydev); + + return 0; +} +EXPORT_SYMBOL(genphy_handle_interrupt_no_ack); + /** * genphy_read_abilities - read PHY abilities from Clause 22 registers * @phydev: target phy_device struct diff --git a/include/linux/phy.h b/include/linux/phy.h index 566b39f6cd64..4f158d6352ae 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1510,6 +1510,7 @@ int genphy_suspend(struct phy_device *phydev); int genphy_resume(struct phy_device *phydev); int genphy_loopback(struct phy_device *phydev, bool enable); int genphy_soft_reset(struct phy_device *phydev); +irqreturn_t genphy_handle_interrupt_no_ack(struct phy_device *phydev); static inline int genphy_config_aneg(struct phy_device *phydev) { -- 2.28.0