Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3858928rwb; Tue, 20 Sep 2022 05:54:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5nQiW6GBYO39hmMUXGnVjmRQGCkpOb/oZjNtAS37ArVdtWcu3kMzTV/a4XpfjbrUZqg+Zf X-Received: by 2002:aa7:d614:0:b0:453:f01:75c4 with SMTP id c20-20020aa7d614000000b004530f0175c4mr19937209edr.302.1663678442717; Tue, 20 Sep 2022 05:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663678442; cv=none; d=google.com; s=arc-20160816; b=x/dnpbZvppicrgBIWHOmzEncqWXKBrA3Yl1KDv2J7dnCh5UBurgMyBjFlx/UJZ8Lhd x+/ilWiA7s8IUFbPJ8fWEHKZS9PUIPqBJzMMPK59PePcFE23rSuNNtW9F74ecD3k42L4 qZjrO/K8W5EGG0UcUVHHkzcIRxOJX4hFeBpF8GiWiNTtoFEqRU0mKrzX4L696myW5Rwd 0PZOvstuB22A9vJW2Q5EbralztZtyDr+ZybDgbZAGoR2ZftE0HErjln1om5zqh1JG4jd ELvmA0MJiECRyNroRUB73YK3aMQ/oN1Ed/CoYFbLMfVk/1HykTIXXsqirzd+RaozZ3I6 n16A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=x/dpCo5isvN6L6y4460xJDzd0mKTKQeLQI6ROjAtcPE=; b=jN0VVhD85/QmNT8PzmbxT/i8M/vxg2mZysZfXN3v0rbb0aZLbBjfZgDjGZEZE1cTws XgPrDXUCpyT3OGn/jc07wTC0a8gi53iq/MuTFlAnqdX7v+reESccAW/BoxbB2nE4/Sd8 YqhK1H5cKuyXSiW9TgN55De/+sC5tbxDxC2p0Zm3l9hIolL01+kYit7p2U26FGLgm3e/ rro3f1J2xl+9VD3rV0AQrbx3/4Io28B24MI7BzSP4T7TgtaU96Xi+efZYBquWQV7aiws I5EW43cx8G5G2/zkKDQFfaOIpkH2VXQTtQuXpxsZ1j2G4jhRvQj6Lk6hhJwFg8vk1ySe Y1Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o+8/eyHI"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b63-20020a509f45000000b0045209818732si1494254edf.498.2022.09.20.05.53.36; Tue, 20 Sep 2022 05:54:02 -0700 (PDT) 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=@linaro.org header.s=google header.b="o+8/eyHI"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbiITM3C (ORCPT + 99 others); Tue, 20 Sep 2022 08:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbiITM26 (ORCPT ); Tue, 20 Sep 2022 08:28:58 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B92CC53021 for ; Tue, 20 Sep 2022 05:28:57 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id a41so3605971edf.4 for ; Tue, 20 Sep 2022 05:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=x/dpCo5isvN6L6y4460xJDzd0mKTKQeLQI6ROjAtcPE=; b=o+8/eyHIZ+W+h8BCccsh2J61rtQyvRmlSe79hoETQtKbpuUQvaCWb5bN+xiCpIvBT/ eRw/3UuHBSkh86ua/Y2jMZBQOOBoUBqV5nbJjzuOvvy+7fggrggQkhUmHMEaActfSM7l UlsBqnZ6AAj87rXx3XSv5+i1vlEz8Werunkp1xMIFYbCRWQwHWk1ULUqKqBC90VRwkI7 XdxPuNPwTSD6rpqBx3I19vo7nBhNCEf+amTGk/dvBqyXZhZMgxZ5X9cP3Sq4IBS/42kj P4p8BanWS656h/FsN6Ki75rYosSS8YiNRgV5Bh7tZI86ByOx5ADzfkqAhvD9qhAZKAIf l4bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=x/dpCo5isvN6L6y4460xJDzd0mKTKQeLQI6ROjAtcPE=; b=tl0TvBvQigI7NkIumfE/EayPsSeERTXUhBcv/cu35AScvTmmj5dwaK/TQn28PvslOg +r4ayBi7aFO24Z2v37lcJo4VliRsLJrkUmxLj9v2yO1/feCUMcumPWb0oAoLw24vLJ9V 1ecTQ3HGCcjAPORN6fMEkxgJZLV7ZRUNl2Toc3Wa9y73tybmFcami/hvGsWmwTpG99lV miccBLHJjcGbmuXLlyLEy3gDXUcyI3LMKWyTnHCq6gkMxzGpYjYo3ODC9zpXNVoIsyXO 75zmWhMzBidwq5Ds/y+xfGTvM2HrlD3Dbl4TFcxcztMq11n0fMPKGuBBMhovkrf7Y00Y ONEw== X-Gm-Message-State: ACrzQf3/HjmVA9KfWFD2YOZsCXNW8upfgB5H7PZswL/vQ50d1e9Nfydk Z+Xc0jUQzbL1OGH8siWeNTQBJ8O6uHy5ayMMFVqqNA== X-Received: by 2002:aa7:c050:0:b0:453:4427:a947 with SMTP id k16-20020aa7c050000000b004534427a947mr18822439edo.172.1663676936357; Tue, 20 Sep 2022 05:28:56 -0700 (PDT) MIME-Version: 1.0 References: <20220909145942.844102-1-horatiu.vultur@microchip.com> <20220920120642.690340-1-michael@walle.cc> In-Reply-To: <20220920120642.690340-1-michael@walle.cc> From: Linus Walleij Date: Tue, 20 Sep 2022 14:28:44 +0200 Message-ID: Subject: Re: [PATCH v3] pinctrl: ocelot: Fix interrupt controller To: Michael Walle Cc: horatiu.vultur@microchip.com, UNGLinuxDriver@microchip.com, andy.shevchenko@gmail.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 On Tue, Sep 20, 2022 at 2:06 PM Michael Walle wrote: > Our board has a shared active low interrupt line, connected to a quad PHY > LAN8814 and two GPY215 PHYs. I've gave this a try but it doesn't seem to > work. It seems the interrupt fires multiple times. If I plug a cable in > one of the LAN8814 ports, I see that the interrupt count in > /proc/interrupts has increased by two. If I use a GPY215 port, I see about > 40 interrupts firing. A lot of interrupts firing is very typical for level IRQs. So I assume these are wire-OR, i.e. exploiting open drain with a pull-up resistor. Just checking: since these drivers obviously must pass pass IRQF_SHARED, have you also made sure that each driver also will properly return IRQ_HANDLED if the interrupt was for them (triggered by "their" hardware) but IRQ_NONE if the interrupt was not for them (triggered by something else)? The IRQ core relies on all drivers to do the right thing here. Otherwise the IRQ will just re-fire until someone/something manages to properly handle it and drive the line high again. A typical case would be the LAN8814 driver having been probed first, thus its IRQ handler will be visited first, and always returning IRQ_HANDLED thereby "stealing" the irq from everyone else. Another possible problem is if you don't have an external pull-up resistor and you need some pin config to enable pull-up on the SoC input line. This will generate a lot of IRQs. A third problem would be that the line need time to rise. But that should be uncommon. Yours, Linus Walleij