Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4792619rwl; Wed, 28 Dec 2022 08:53:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXvb2Fko23N/p8ABTLa1viGM15kzI9ArcT6hhsPKPr64FutMoZ4bYhzbJpKmMNcnzTeOtNLJ X-Received: by 2002:a62:e303:0:b0:576:d946:604a with SMTP id g3-20020a62e303000000b00576d946604amr25064075pfh.27.1672246437668; Wed, 28 Dec 2022 08:53:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672246437; cv=none; d=google.com; s=arc-20160816; b=amJrRjHCHsW8WNPg0CuiBQqep5XNoNUaGY5efkABc6VMC5ZHRNnWKl7/t9LlFHUfjH Th5Yn16Q+r55nvWEsnfvPcb549cGscpjrTEnT6gFbomJ4ZjNgiaQ8sHScvtfF/eZ17nC uLljQ/bMU6rz7L8ajNG3jz2Rqx5/SdodBtw+HdFT6KPo5X2451MXqjf0bbIiSskbqbVA EBxeapyWC8FGHdm4JyZqDFkJ1HUQXK+kqgFCzyH8M/yunTEu3p3/X+B+qrqKxwSIJYKP 5K6q5KdRLka62xtp3nDIWmLCJwvEJfPMODAzV1ieozNPcK8L0j/K6b53uKCCXwE+x1R8 rzeQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=OF6pNjdZAXe8urQNvfbusgLAE7XXO8YnOK8O7h3K4sk=; b=OmeL3zO0vp1DN2BxVBKy12Ei/o9BiMm4tR9GP/uRNI5qCqCsnqXy8sroGcPVI8W0ug V8E7Huj/gTJCbebPzKB1QrbNfM+uq6nrWfaXiWvhiPcWqiha2bqXtAsU79C3j/JUQhL6 JV/uleP91ce6KBYBCyXotPgmfdE7H+0e+D4z2OyHLN9YkJ2Qbc1DNuuE8ji1Jecelu02 0GM/S/PxLLGFnPMse7fWP5+bD+fL/Nxs3T08tw31FqIUnkEDOeC4J1Z5/LmRh/CSobyX MXBu0RKyxmOg+wUbPCM1dEPpJ31NEq5Pz3cQ70f+qise0wenCi0XDyjyJLsOoZlmEvXL Xvsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=Ah1y53r1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020a623604000000b0058138cd5b84si6530188pfa.25.2022.12.28.08.53.48; Wed, 28 Dec 2022 08:53:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=Ah1y53r1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234492AbiL1Qo6 (ORCPT + 64 others); Wed, 28 Dec 2022 11:44:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233617AbiL1Qoe (ORCPT ); Wed, 28 Dec 2022 11:44:34 -0500 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 657BE1CB1B; Wed, 28 Dec 2022 08:40:15 -0800 (PST) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 94A29126D; Wed, 28 Dec 2022 17:40:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1672245613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=OF6pNjdZAXe8urQNvfbusgLAE7XXO8YnOK8O7h3K4sk=; b=Ah1y53r1SoaYhGaLT1mCfX0ZzP3dffDssK1tuulZ5b3k/asOK0d/ha5BdoFml52iFM1pXV kfrp17rsGQU0nMTHTp1Ol5x85QL7TWcPDfByIakREo3aXIme0FvsQgDm5gJ1ce4L8xNAwk 3N4qkbT1Ur7KeqdgNnwvazdIa2GFZTUMNFxvuHSi/yMGpqsRDYIKyEaPHtPF5XkXfyrBOX uUn8M4yxcJUcevUCn9SW78t1TXZNoI5zMxWgxA6JFbHkKr+foIAJiFHmTrEUlCAB2igNR4 RUVvPJZE/4TwFUFuSoeof6Pl6KkcDIsXoJ9iWO5hzl8HbNIuUgn4K15WEfgONw== From: Michael Walle To: Xu Liang , Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH RFC net-next v2 0/2] net: phy: mxl-gpy: broken interrupt fixes Date: Wed, 28 Dec 2022 17:40:06 +0100 Message-Id: <20221228164008.1653348-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The GPY215 has a broken interrupt pin. This patch series tries to workaround that and because in general that is not possible, disables the interrupts by default and falls back to polling mode. There is an opt-in via the devicetree. The devicetree binding is missing for now because there is still an ongoing discussion. I'm sending this, because I want to get some feedback on the new handling in the phy core. As Andrew pointed out, we cannot change the irq in the PHY's .probe() because a MAC driver might overwrite it afterwards, e.g. the stmmac does so. Instead introduce a new flag which can be set by the PHY driver and which is evaluated just before the PHY is attached and thus the interrupt is requested. Btw. I'm not sure dev_flags is the correct place here. I couldn't see when to use dev_flags and when to use the plain one-bit properties in the struct phy_device. The latter seems to be used internally, but of course there is at least one exception, the .mac_managed_pm is set by the MAC drivers. v2: - new handling of how to disable the interrupts Michael Walle (2): net: phy: allow a phy to opt-out of interrupt handling net: phy: mxl-gpy: disable interrupts on GPY215 by default drivers/net/phy/mxl-gpy.c | 5 +++++ drivers/net/phy/phy_device.c | 7 +++++++ include/linux/phy.h | 2 ++ 3 files changed, 14 insertions(+) -- 2.30.2