From patchwork Mon Jan 9 12:30:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 40826 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2130392wrt; Mon, 9 Jan 2023 04:36:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXtGfGQgOxJzQ7I5YY4YM4Pc664ckAz+/yFsw+/B0Wy1CFf+PmBta/qkuPFn4wfTz5uxn9S1 X-Received: by 2002:a17:907:c20b:b0:7c1:7442:8b77 with SMTP id ti11-20020a170907c20b00b007c174428b77mr52694853ejc.5.1673267809024; Mon, 09 Jan 2023 04:36:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673267809; cv=none; d=google.com; s=arc-20160816; b=HnoEXJQp1pQxeySbYGHEt33Qj6CFI2XqHqRHugI460K74Ks871IdecxMSHMYiVWmG/ Q1+QRwyDWEMYydiXoqIJ4isJUDvlqIAiW7UfoG524qW14aq3S5SryVixLm8lkB4yYXUH Rg1O5VAGYiRWknlRgeznpN4kmiXqp77+Xc2AERIoKkCZy/V0lZPWdrgrnEDDBA/Aua90 Mi2funiP7+lP43oTD2NPLSxfG9q4Y9yR1HIu5uSt4HVkQZiF3x05Pfkj6SWSDIoxbhrp ALhBGhOno1I4BePdO6qXjzlRLj0MiYWHixW9fdoIaIla+IeVqezK5XsEvHHl6Jz0prvz LPow== 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=2k0VUgvl/cd0SNCrte7LIJhV9pJzMXyCEPZG6Vz+Pqc=; b=KwQ3lK3kbtXASh8nbwzHNUO5epVi1+V79Ib8N9KXQ4fax3HT2OPhnc3pVPvlk3ewXx sLSfbNhIoFPbj1rAzy/K/CTYGD4NidnThG0vvpVreEkxqgYHYc/73Xj9lQU0zAdzlGFc qAfHDTRs/0K3joKfvUFzij3E7ggxaGA/lEBfWQ/FFoBINZSKg7o3AA8WdSq0pEqGq2H+ bhbyYfDzcdvEpX7GvILzA7vywkxVbUR6PNCNFyuumxqtw1ml9ZEKgrnKofF7ami7oFZZ xFummIq2fGmLtti3g8ZDBch96K4s0W6fFz6CCtlHnhnXnz5P86DzUDHY3CkUxvtknBwE faGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=P9jezsvs; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg35-20020a170907a42300b0084f1fb57f55si464225ejc.523.2023.01.09.04.36.24; Mon, 09 Jan 2023 04:36:48 -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=P9jezsvs; 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 S229890AbjAIMbB (ORCPT + 99 others); Mon, 9 Jan 2023 07:31:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237269AbjAIMaZ (ORCPT ); Mon, 9 Jan 2023 07:30:25 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D56E11BE94; Mon, 9 Jan 2023 04:30:22 -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 883EB127C; Mon, 9 Jan 2023 13:30:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1673267420; 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: in-reply-to:in-reply-to:references:references; bh=2k0VUgvl/cd0SNCrte7LIJhV9pJzMXyCEPZG6Vz+Pqc=; b=P9jezsvsSJyYDRaBaSIN5g7AuKjbzi7Zg0Q/aK5xWSVPa9F7C+HOSBwaF/ASL8HKfmhLTC FPLkzAjxlLXM6rdBmrR6uuag4xrqllLtEkc4JW5UKbReMiCj+XtsoCGe1qYDaKG5q5tn+5 TLOJW/zGFxA/myVG/sgBrRRcr6vM1v7NLV7v5/+0meNOqF5CakTWscGSmpHvCQyTOPKzE6 qv/ydvzQXgE1qXHV8k5jY7XIbMMnmhvWvm3cvZs0mry1pyrHGVeBYVs0sdmii3eZK+x7s1 7arCnpFPpcxNH5UUaH0mag+ylgTheByuIHjgZZn9sufIFFL5Lv5mp9PtkX5qPA== From: Michael Walle To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Xu Liang , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle , Krzysztof Kozlowski Subject: [PATCH net-next v3 1/4] dt-bindings: vendor-prefixes: add MaxLinear Date: Mon, 9 Jan 2023 13:30:10 +0100 Message-Id: <20230109123013.3094144-2-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230109123013.3094144-1-michael@walle.cc> References: <20230109123013.3094144-1-michael@walle.cc> MIME-Version: 1.0 X-Spam: Yes 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754548466068953752?= X-GMAIL-MSGID: =?utf-8?q?1754548466068953752?= MaxLinear is a manufacturer of integrated circuits. https://www.maxlinear.com Signed-off-by: Michael Walle Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 66bf0da6f60e..60ca96163937 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -777,6 +777,8 @@ patternProperties: description: MaxBotix Inc. "^maxim,.*": description: Maxim Integrated Products + "^maxlinear,.*": + description: MaxLinear Inc. "^mbvl,.*": description: Mobiveil Inc. "^mcube,.*": From patchwork Mon Jan 9 12:30:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 40822 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2129381wrt; Mon, 9 Jan 2023 04:34:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXsYMgrU/zIH0a1r/UEydSmNzZnHqeSyOLHAwh5mMZ44XZ/ZGrFPCwjybbSRVer7rpwSFng8 X-Received: by 2002:aa7:d857:0:b0:495:77a9:f109 with SMTP id f23-20020aa7d857000000b0049577a9f109mr10750872eds.42.1673267669132; Mon, 09 Jan 2023 04:34:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673267669; cv=none; d=google.com; s=arc-20160816; b=H7sdw8kQSoKEV7ZkiGicLe/xw50vbaR+sgEDxtDvf9jCTKD2+OWoUuWAd6bDIaGI23 cVmABAyMhJfc8WzkOwiuDoQKydxSCdcp1tasoEnsogAq1Dl1jfKZ+ju0XwfV6YyBxz7b d+j8HngXW3v93E4xdhf0Y7HCzGLSUh/VNRhDpTZvXps65py1IfhrbOHQ9BnIkuxJmVXS G3bXva6R97rVWbIxV/6Vraq2QzlhYCc9GCa+h367niqJ/P4Ii6EahLAWdfrC3HotLMrW Ah/WfC8prsFSRs4C0+q29THhcaxyOZAl6Wjjy/DAKWcldM5HtMQyapOhnBhxx8ctVFUl WpPg== 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=XZ7Vzky1BdtRbR9tf/hknfjGnQGFjK6uHVN2tAqUR48=; b=WhRHfJ7dcf01BdwVRRBW7o75WXC7kCoPoQmhVxQeO9FvBLxL3soJaGZpaWGPfSRxPK 1MCEQXFXStZz/bDczQ0oc8wpgW25ydZrMEou6hA9I+HMPPe1CJbO6gOgTk154gXqrIZD D1vr9reqJNfftKi0N33BlZmT6dq9VolBa/GnGF9VmqLRglTthRwrXGxOYFLdJTENXjmE GFixavtQrSESVcjPQiE850ItXhZGcGg+XTHkROqqIt2coHDyvfXThlQlPtLxzFGeNI8J E7cGggy/TflBpB4z0vdV+CXTYaCjq2JYjlpfgdqemEK2j6fk/fhRbFPb4aAwxO3akndi UYOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=RTuO1odZ; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d23-20020a50fb17000000b0048ed1c1d839si8505514edq.204.2023.01.09.04.34.05; Mon, 09 Jan 2023 04:34:29 -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=RTuO1odZ; 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 S237016AbjAIMaz (ORCPT + 99 others); Mon, 9 Jan 2023 07:30:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237271AbjAIMaZ (ORCPT ); Mon, 9 Jan 2023 07:30:25 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7835D1ADB9; Mon, 9 Jan 2023 04:30:23 -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 5DF19164B; Mon, 9 Jan 2023 13:30:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1673267421; 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: in-reply-to:in-reply-to:references:references; bh=XZ7Vzky1BdtRbR9tf/hknfjGnQGFjK6uHVN2tAqUR48=; b=RTuO1odZs0w2M76H1FEFV3eKQe4v7gCl+bT2ZnjEt5Qsgwg0U+Y08UHRB4sFCq3Afoc5zm yFsMW9hmL7gCwSWYrB7duIRSnOkTCUxqKlH5hfC4lio1b9KPqGd7FEEmLunkIXDQHkJiKV sOujvZpTEM4svfbe+haAMl1RWfVV4v7sg5etKaJwDhq0fmfmCcGXgU/EgadIKnSOGejs8+ u+rZVfqze4ZR1Rh1q8V2uap/lx2zWSgQcsuCHr7S/d3E6oYISzuQTcMMld3k/mCs1sa0Zm jUR0hMtuCdDrevOGSw9JLWPl89hP5ST4fKBk1xBwVf638Z4yCzs33kr47q830g== From: Michael Walle To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Xu Liang , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH net-next v3 2/4] dt-bindings: net: phy: add MaxLinear GPY2xx bindings Date: Mon, 9 Jan 2023 13:30:11 +0100 Message-Id: <20230109123013.3094144-3-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230109123013.3094144-1-michael@walle.cc> References: <20230109123013.3094144-1-michael@walle.cc> MIME-Version: 1.0 X-Spam: Yes 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754548319601710338?= X-GMAIL-MSGID: =?utf-8?q?1754548319601710338?= Add the device tree bindings for the MaxLinear GPY2xx PHYs, which essentially adds just one flag: maxlinear,use-broken-interrupts. One might argue, that if interrupts are broken, just don't use the interrupt property in the first place. But it needs to be more nuanced. First, this interrupt line is also used to wake up systems by WoL, which has nothing to do with the (broken) PHY interrupt handling. Second and more importantly, there are devicetrees which have this property set. Thus, within the driver we have to switch off interrupt handling by default as a workaround. But OTOH, a systems designer who knows the hardware and knows there are no shared interrupts for example, can use this new property as a hint to the driver that it can enable the interrupt nonetheless. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn --- .../bindings/net/maxlinear,gpy2xx.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml diff --git a/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml new file mode 100644 index 000000000000..d71fa9de2b64 --- /dev/null +++ b/Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/maxlinear,gpy2xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MaxLinear GPY2xx PHY + +maintainers: + - Andrew Lunn + - Michael Walle + +allOf: + - $ref: ethernet-phy.yaml# + +properties: + maxlinear,use-broken-interrupts: + description: | + Interrupts are broken on some GPY2xx PHYs in that they keep the + interrupt line asserted even after the interrupt status register is + cleared. Thus it is blocking the interrupt line which is usually bad + for shared lines. By default interrupts are disabled for this PHY and + polling mode is used. If one can live with the consequences, this + property can be used to enable interrupt handling. + + Affected PHYs (as far as known) are GPY215B and GPY215C. + type: boolean + +dependencies: + maxlinear,use-broken-interrupts: [ interrupts ] + +unevaluatedProperties: false + +examples: + - | + ethernet { + #address-cells = <1>; + #size-cells = <0>; + + ethernet-phy@0 { + reg = <0>; + interrupts-extended = <&intc 0>; + maxlinear,use-broken-interrupts; + }; + }; + +... From patchwork Mon Jan 9 12:30:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 40824 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2129991wrt; Mon, 9 Jan 2023 04:35:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXsqBE7soDC7YLbMoq35bXx9KdG6q9ufihUo1ZZX/jSG3IqABGhyl6QEgzBk/XRF0gZhEf38 X-Received: by 2002:a17:907:1c9a:b0:7c1:2f05:7fd6 with SMTP id nb26-20020a1709071c9a00b007c12f057fd6mr61444705ejc.39.1673267750940; Mon, 09 Jan 2023 04:35:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673267750; cv=none; d=google.com; s=arc-20160816; b=mHW7I+DXwslqjmwsFSbgpmSS1S2fKBTXcPSov4t9ZCcCU2QbqaKGdzF6bV8XtfiPY4 zYcymz48FbRD3ilJKIbe2kjYbpN0J2o11wPTvdPAK6MSB+sxRM9d+JnOlTG0IrloMx8U TF+pIztWheWMowC7BFO1yYAGAd2mRSjLfyZ8+ndbtFNW78PxXWfkev2KaXAjLvRnMUJf JEneC/1+fIymYkG5Dz9yDP+Jkok4ICTRH++ql/iWuDKGuiq80UQZrQjb0jhq4d3cS2kO CF7ZS/VhCAOf1UI/CjtEjRN7YoRV0/CZnCgoYqNMNp2IA4mh57T+EHs3QJgb5ae1ntdn Mwng== 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=+pGsNIHjitpKn7MDw9fSh//e+FCcst6QZrjhQXHPk7c=; b=x+99JAMw7y/xus6wURDgapjztkOrxqpdDt5ZoowINXXLBbuVR0eWS9vPA3nJMwWh3t j2+apQOUM+yb6kzIvDK7kGDTgWn9vYXtFsJDK8c6v0DYfeNrbYGcB9UnIzjjpZ5pP0mL KGunetogDYxPupma3CvW89drmSqs/uKVVwU2v67/ofPLqyVWlhEjZ05UGWl0BcHeLN6s 0hko1Zs8bx0SsHj+pVyUkemOgN9rk/nfKKrieKYKaOZXqh7fmLZLJH4BfvT8yi1NQ+lR 9iAO3ie/vMTKCtdmp3T6tD0mNc7UD0R9g/C5eKfBbt5G/R6SEX+S7pOOid0oxhjEAUdT TuZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=dDYFZ1ou; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji6-20020a170907980600b007877b1c7f27si10231470ejc.829.2023.01.09.04.35.27; Mon, 09 Jan 2023 04:35:50 -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=dDYFZ1ou; 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 S234691AbjAIMbJ (ORCPT + 99 others); Mon, 9 Jan 2023 07:31:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237273AbjAIMaZ (ORCPT ); Mon, 9 Jan 2023 07:30:25 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 124561BCB4; Mon, 9 Jan 2023 04:30:24 -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 0614F16A5; Mon, 9 Jan 2023 13:30:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1673267422; 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: in-reply-to:in-reply-to:references:references; bh=+pGsNIHjitpKn7MDw9fSh//e+FCcst6QZrjhQXHPk7c=; b=dDYFZ1ouWPdjgrngTgusZbE+C5ahWILXMIQtW8byw1W0TAmH6iyRgWUA/7vYCYpmBFL2RD xcHW8P7Z9Tjf1Unz0qCYYf94jzehULbi/cNdCR2OBC8FnnVZmz+UiuVIevl31EhhyF38g8 RphRHhBnoYZ5fHBS6RZsNYOjSewmbw9WlEHWngW7ZEItH2Mf6OhCuhnM2Id0MSj9HFmDJ0 qvP2Puv1UejJNH9JgsdbYAyK2uxtiNVyqTzyMn6vcXukGCFfGVtXzi0hpv9gnCvz6s/r0g h+dAaDArPKW+WDQQ0fkLiDe39/q09eqJ3UN/MRPZRpH9TFARlkwoLI9efrnM6g== From: Michael Walle To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Xu Liang , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH net-next v3 3/4] net: phy: allow a phy to opt-out of interrupt handling Date: Mon, 9 Jan 2023 13:30:12 +0100 Message-Id: <20230109123013.3094144-4-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230109123013.3094144-1-michael@walle.cc> References: <20230109123013.3094144-1-michael@walle.cc> MIME-Version: 1.0 X-Spam: Yes 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754548405506336965?= X-GMAIL-MSGID: =?utf-8?q?1754548405506336965?= Until now, it is not possible for a PHY driver to disable interrupts during runtime. If a driver offers the .config_intr() as well as the .handle_interrupt() ops, it is eligible for interrupt handling. Introduce a new flag for the dev_flags property of struct phy_device, which can be set by PHY driver to skip interrupt setup and fall back to polling mode. At the moment, this is used for the MaxLinear PHY which has broken interrupt handling and there is a need to disable interrupts in some cases. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn --- drivers/net/phy/phy_device.c | 7 +++++++ include/linux/phy.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 716870a4499c..e4562859ac00 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1487,6 +1487,13 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, phydev->interrupts = PHY_INTERRUPT_DISABLED; + /* PHYs can request to use poll mode even though they have an + * associated interrupt line. This could be the case if they + * detect a broken interrupt handling. + */ + if (phydev->dev_flags & PHY_F_NO_IRQ) + phydev->irq = PHY_POLL; + /* Port is set to PORT_TP by default and the actual PHY driver will set * it to different value depending on the PHY configuration. If we have * the generic PHY driver we can't figure it out, thus set the old diff --git a/include/linux/phy.h b/include/linux/phy.h index 6378c997ded5..742754d72fc0 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -739,6 +739,9 @@ struct phy_device { #endif }; +/* Generic phy_device::dev_flags */ +#define PHY_F_NO_IRQ 0x80000000 + static inline struct phy_device *to_phy_device(const struct device *dev) { return container_of(to_mdio_device(dev), struct phy_device, mdio); From patchwork Mon Jan 9 12:30:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 40825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2130005wrt; Mon, 9 Jan 2023 04:35:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXut1bdszKxql7wXYTE/Z0e+NuZHlndhED+W2SH60SKh+rtB/j1efafd3SfiO2xryiXhcMYr X-Received: by 2002:a17:907:a588:b0:84d:43e4:3633 with SMTP id vs8-20020a170907a58800b0084d43e43633mr3807930ejc.36.1673267752906; Mon, 09 Jan 2023 04:35:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673267752; cv=none; d=google.com; s=arc-20160816; b=RRWf3Q6kdY72NUzesl2KtQ2W9nB6XGEQ5QNOG/5cZXT1huHaReY//ax0Be9xxuhEyR piTuqQUKcTtblW1nTGra+0bKPXvox5L8Q49iuFY1FoMr4bLd4l4ZhHOc2+cT9aViUKEa oH26JCNuGGryWA+EDtN9XztoC0OixwJf0Ec9wTGo/06CkN42dFfIgafOdimt3tY1GISY 1AVDclxfDCINvPR5m7nZEiTrkSAFinsRajAUHtQaz0lFqtDazp/z1Pl6pk33Rqgz77Yj 4lwQT1SWevyOU+RqHUOfbQhD0xnACPJrzt3/RAuTqaIGlQIMsv5WXQsM4MVJf0n2pmow IkhA== 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=08E5qi8vxqr6+TC+1BFlozXvA3KflPEceb13Px12www=; b=W2P0ZMIaBF5U8idB0R+hofbQ5BIXNFXS11T6zAkcq99FS2Um8jJNcqUe7x/OxVeraX aocZpa8Oua2V4VW27CeKQlTg6R+5O/IpyG9JtxujnFAZmOKpLIZRK4ap5HZ+8+1DIRu9 DwxJcE9cB+1IlRxAqrU5UOow6UBLXijdiniE1yI7f0LPn5KdEVEfopBiZDBQPGKMSfIg LGt0xZAtqWLm2TFlZy1W+fFVJf4+A/f6IjPz3bT9m3kB08NYJxyr4FumI0+XL+TWREso upwOWd8ytng5XkFSv2l1w9oRZlDuFo7loWflSr7sA2qQuidTpXtTYZO+ADqXNGKECcf5 TCcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=dOKdBQ8u; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a056402358600b0046aa4908162si11018987edc.46.2023.01.09.04.35.29; Mon, 09 Jan 2023 04:35:52 -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=dOKdBQ8u; 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 S237212AbjAIMbP (ORCPT + 99 others); Mon, 9 Jan 2023 07:31:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237279AbjAIMa1 (ORCPT ); Mon, 9 Jan 2023 07:30:27 -0500 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 702F11BE9C; Mon, 9 Jan 2023 04:30:24 -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 8C27216AB; Mon, 9 Jan 2023 13:30:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1673267422; 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: in-reply-to:in-reply-to:references:references; bh=08E5qi8vxqr6+TC+1BFlozXvA3KflPEceb13Px12www=; b=dOKdBQ8uqyyE6MBH9TUYo+iQ0CRxnYEg0ja4lXvoXxM77ndF1zyiCeiRMzeWAzt1/8LkiP iClmXZfFVWzDP+xAIQ/H2g9OMYPEQKzVng1NF/F1jWIBnlfgtUiDkXAC4fLVEBQbC2bwLZ SqV4qdP6XbcJ6ZBPYfAYIUuc9N7582EIW3di8KxxpvzJqlMq9NQMKZO/YA1aB+ucjdunu0 lA6SL1hn2Ljz3YXTTSfMrW954MjrpDAky4QjBGEH6ZuIQDeujX3mw7g9TQUlkrc6zgtpTJ UITrnQSr366XXiF7uhXE9LtQzTsp1W5NjMvkAM/loHXBWJzyGNVtZwPdHTJHSA== From: Michael Walle To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Xu Liang , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH net-next v3 4/4] net: phy: mxl-gpy: disable interrupts on GPY215 by default Date: Mon, 9 Jan 2023 13:30:13 +0100 Message-Id: <20230109123013.3094144-5-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230109123013.3094144-1-michael@walle.cc> References: <20230109123013.3094144-1-michael@walle.cc> MIME-Version: 1.0 X-Spam: Yes 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754548406887405788?= X-GMAIL-MSGID: =?utf-8?q?1754548406887405788?= The interrupts on the GPY215B and GPY215C are broken and the only viable fix is to disable them altogether. There is still the possibilty to opt-in via the device tree. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn --- drivers/net/phy/mxl-gpy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c index 147d7a5a9b35..e5972b4ef6e8 100644 --- a/drivers/net/phy/mxl-gpy.c +++ b/drivers/net/phy/mxl-gpy.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* PHY ID */ @@ -292,6 +293,10 @@ static int gpy_probe(struct phy_device *phydev) phydev->priv = priv; mutex_init(&priv->mbox_lock); + if (gpy_has_broken_mdint(phydev) && + !device_property_present(dev, "maxlinear,use-broken-interrupts")) + phydev->dev_flags |= PHY_F_NO_IRQ; + fw_version = phy_read(phydev, PHY_FWV); if (fw_version < 0) return fw_version;