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.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 1AE44C5519F for ; Sat, 14 Nov 2020 17:42:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA93E2222C for ; Sat, 14 Nov 2020 17:42:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="wns8gZ2x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726070AbgKNRm1 (ORCPT ); Sat, 14 Nov 2020 12:42:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:39700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbgKNRm1 (ORCPT ); Sat, 14 Nov 2020 12:42:27 -0500 Received: from localhost (otava-0257.koleje.cuni.cz [78.128.181.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D02F2222C; Sat, 14 Nov 2020 17:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605375746; bh=tmOHDtqwX1mqdiPILnvO/BND4vMYxKO3WQ5b/8ldZE4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=wns8gZ2xhj0OfXUDTPktQ043Socjjpa2/wzu9ZrlS5VKS3LOqPDA422nK1vhTVQAi Ub2g5oLF2J8GEqTJXWuGmg6gkLjIENAld0s8oShEi9QUO3BCHaN19jYc/p3hTgK//b JzKOqVZdkFD2SAaEcMFb9b5PMbzIQhRR8bNjNu+k= Date: Sat, 14 Nov 2020 18:42:21 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Andrew Lunn Cc: Gregory CLEMENT , arm@kernel.org, Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , Jason Cooper , Andreas =?UTF-8?B?RsOkcmJlcg==?= , Rob Herring , devicetree@vger.kernel.org Subject: Re: [PATCH mvebu-dt 3/6] ARM: dts: turris-omnia: describe ethernet-phy interrupt Message-ID: <20201114184221.1f74de86@kernel.org> In-Reply-To: <20201114171639.GO1456319@lunn.ch> References: <20201114160409.19670-1-kabel@kernel.org> <20201114160409.19670-4-kabel@kernel.org> <20201114174928.5ab4f8ae@kernel.org> <20201114171639.GO1456319@lunn.ch> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Sat, 14 Nov 2020 18:16:39 +0100 Andrew Lunn wrote: > On Sat, Nov 14, 2020 at 05:49:28PM +0100, Marek Beh=C3=BAn wrote: > > On Sat, 14 Nov 2020 17:04:06 +0100 > > Marek Beh=C3=BAn wrote: > > =20 > > > + interrupt-parent =3D <&pcawan>; > > > + interrupt =3D <7 IRQ_TYPE_LEVEL_LOW>; =20 > >=20 > > Also we need to use IRQ_TYPE_EDGE_FALLING. The gpio-pca953x driver does > > not support IRQ_TYPE_LEVEL_LOW... =20 >=20 > Please check the datasheet for the PHY. I expect you will find it is > level triggering, not edge. So you can miss interrupts, and have the > wrong state. >=20 > I've also had bad experiences with pca953x and interrupt storms. I > hope you are using one with the extended registers including the > interrupt mask. >=20 > Andrew Andrew, the PHY is a 88E1514, which triggers on level. We can set either active-low or active-high, but not edge. Default is active-low. The expander is a PCA9538 (in schematics called PCA9538PWR). The driver does not support level interrupts: if (!(type & IRQ_TYPE_EDGE_BOTH)) { dev_err(&chip->client->dev, "irq %d: unsupported type %d\n", d->irq, type); return -EINVAL; } It seems that for PCA9538 the interrupts are read from input. Some of the chips supported by this driver can latch interrupt status into special register, but this chip does not... On interrupt the driver looks at the input register, compares it with cached state and looks which bits changed. So theoretically level support could be implemented in this driver, but currently it is not. Do you think we should just poll for interrupts with the PHY? Marek