From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53C15C433E0 for ; Sun, 21 Feb 2021 22:42:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1856A64EBE for ; Sun, 21 Feb 2021 22:42:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1856A64EBE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4Zc4ZfukagZ9isl9LF/HWmnVFmFX9y6DdIAk4Rma4+k=; b=tde5VVgg0blqQBZPUlm0nLEYm HPqXNUn34E7AAKScCw0oNlCsMCvehVYQx4KHIUHrw+oqFvMBkGNwSuxQOVVp07t9pRLYanPHOHrj5 zdrEQttccUEfXiVa20kgHjR41oi69YGVWkxrfquy5QIJKBnsxtJcczrsrbWxnMHTxTCooqJ5oSL3/ wWiULVMewtITyigXXPjJivnteMe6taCRbSTI3IdSgA22GL/SnOltGq55B0+fzH4150X0EE26set+C knEti85LmLEKSrQY/CjVcfaK6BaDGQ+mywVBWExpQlzssZnQNJz6Hv+CaI3u0R2MszcUPURKK3/yc U6hkVIjwg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDxOt-000683-E0; Sun, 21 Feb 2021 22:40:27 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDxOq-00067d-Qn for linux-arm-kernel@lists.infradead.org; Sun, 21 Feb 2021 22:40:25 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id B90B464DEC; Sun, 21 Feb 2021 22:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613947222; bh=baXjPoBQbqjfVUYjCiZRD8nOg7OnrLQQYrPT4lQChgo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uSxc5btfZ0mg83/kIVoO1jrg3sFcnECNFv/9gzlAZfwJFgPm086Ma+WrA7Tyh0gzR mExG+9urn98IOOfUGsWqqxGtPHEPxcnAXZZva/Cxv2/jk5exl/EsnBqngcVCK9R8tP 8CP1VP3zhW3zmoQHGlbN3vtNtPGfob8BI+RWj1OZxA0jHxNvcoZQzgDhFpfKcW0W5I 0O1DN94wvkQYpMLCe/GxBRm5xN6X2qvxzMoKRUnOePeU1j7F82lJS2XDxXU8lrmsOz 322fjfz1zmtAuJG8zMgbE2Jvdm0urVZ3VGFZEmfbjf1ZrrTO08rJV5vaRqT3ZafMWK vyDAO1bx78LTA== Date: Sun, 21 Feb 2021 23:40:19 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Andrew Lunn Subject: Re: [PATCH mvebu-dt] ARM: dts: turris-omnia: configure LED[2]/INTn pin as interrupt pin Message-ID: <20210221234019.53284201@kernel.org> In-Reply-To: References: <20210220231144.32325-1-kabel@kernel.org> <20210221014756.7c444c08@kernel.org> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210221_174024_996540_E76A7D17 X-CRM114-Status: GOOD ( 23.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@vger.kernel.org, Gregory CLEMENT , linux-arm-kernel@lists.infradead.org, Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , Rui Salvaterra Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, 21 Feb 2021 22:18:48 +0100 Andrew Lunn wrote: > > BTW do you have some experience where pca9538 or compatible cause > > errors when used for interrupts? Because I am thinking about trying > > to update the pca953x driver to support IRQs via the gpio_chip it > > registers, instead of a separate irq_chip. > > I had a board which just died at boot with an interrupt storm. It was > probably a PCA9554, at least, i have that datasheet in my collection. But why did an interrupt storm kill it? The interrupt handler was called too many times? > First off, the hardware needs to designed correctly. All unused pins > need a pull up/down since they default to inputs, and hence will > trigger interrupts. Or you need to make unused pins outputs before you > enable interrupts. And that probably goes against the design of the > GPIO subsystem. I don't think you actually know when a pin is unused. Omnia has proper pull ups/downs on all 8 pins on this device. 5 of these pins are used from SFP cage, 1 as interrupt from PHY and 2 are unused. Only the interrupt pin was causing problems because marvell PHY driver configured it as blink on activity LED. > I'm not sure i would want to touch this driver. Given how badly this > device implements interrupts, any board which does successfully use it > for interrupts might regress if you make code changes. And then you > are going to have to try to figure out what you actually changed and > why it regressed. The problem in this driver is: - interrupt handler is called every time an input pin changes - not all input pins must be used as interrupt sources - if at least one input pin is used as an interrupt source, the interrupt handler is being called on every change of every input pin - but if the change occurs on a pin that is not used as an interrupt source, the interrupt handler returns IRQ_NONE - a simple scenario to achieve error: 1. use pin P0 as interrupt source and P1 as GPIO input; other pins as outputs 2. connect P1 to something that changes value 3. after 10000 changes of P1 (more if there was a change on P0 at the same time) the interrupt handler will return IRQ_NONE 10000 times and kernel will start ignoring interrupts from this driver because it was returning IRQ_NONE I think this needs to be fixed in this driver. Either this function should return IRQ_HANDLED in this case, or there should be a third option to return, something like IRQ_NONE_BUT_THATS_OK Marek _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel