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=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 D46BAC4321A for ; Tue, 11 Jun 2019 09:00:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A95D720657 for ; Tue, 11 Jun 2019 09:00:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404391AbfFKJAt (ORCPT ); Tue, 11 Jun 2019 05:00:49 -0400 Received: from foss.arm.com ([217.140.110.172]:55810 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403860AbfFKJAt (ORCPT ); Tue, 11 Jun 2019 05:00:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DCA2E337; Tue, 11 Jun 2019 02:00:47 -0700 (PDT) Received: from [10.1.197.61] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0612D3F73C; Tue, 11 Jun 2019 02:00:42 -0700 (PDT) Subject: Re: [PATCH] wlcore/wl18xx: Add invert-irq OF property for physically inverted IRQ To: Geert Uytterhoeven , Tony Lindgren Cc: Kalle Valo , Eugeniu Rosca , Simon Horman , "David S. Miller" , Greg Kroah-Hartman , Randy Dunlap , Ulf Hansson , John Stultz , linux-wireless , netdev , Linux Kernel Mailing List , Spyridon Papageorgiou , Joshua Frkuska , "George G . Davis" , Andrey Gusakov , Linux-Renesas , Eugeniu Rosca , eyalr@ti.com, Thomas Gleixner , Jason Cooper References: <20190607172958.20745-1-erosca@de.adit-jv.com> <87tvcxncuq.fsf@codeaurora.org> <20190610083012.GV5447@atomide.com> From: Marc Zyngier Openpgp: preference=signencrypt Autocrypt: addr=marc.zyngier@arm.com; prefer-encrypt=mutual; keydata= mQINBE6Jf0UBEADLCxpix34Ch3kQKA9SNlVQroj9aHAEzzl0+V8jrvT9a9GkK+FjBOIQz4KE g+3p+lqgJH4NfwPm9H5I5e3wa+Scz9wAqWLTT772Rqb6hf6kx0kKd0P2jGv79qXSmwru28vJ t9NNsmIhEYwS5eTfCbsZZDCnR31J6qxozsDHpCGLHlYym/VbC199Uq/pN5gH+5JHZyhyZiNW ozUCjMqC4eNW42nYVKZQfbj/k4W9xFfudFaFEhAf/Vb1r6F05eBP1uopuzNkAN7vqS8XcgQH qXI357YC4ToCbmqLue4HK9+2mtf7MTdHZYGZ939OfTlOGuxFW+bhtPQzsHiW7eNe0ew0+LaL 3wdNzT5abPBscqXWVGsZWCAzBmrZato+Pd2bSCDPLInZV0j+rjt7MWiSxEAEowue3IcZA++7 ifTDIscQdpeKT8hcL+9eHLgoSDH62SlubO/y8bB1hV8JjLW/jQpLnae0oz25h39ij4ijcp8N t5slf5DNRi1NLz5+iaaLg4gaM3ywVK2VEKdBTg+JTg3dfrb3DH7ctTQquyKun9IVY8AsxMc6 lxl4HxrpLX7HgF10685GG5fFla7R1RUnW5svgQhz6YVU33yJjk5lIIrrxKI/wLlhn066mtu1 DoD9TEAjwOmpa6ofV6rHeBPehUwMZEsLqlKfLsl0PpsJwov8TQARAQABtCNNYXJjIFp5bmdp ZXIgPG1hcmMuenluZ2llckBhcm0uY29tPokCTwQTAQIAOQIbAwYLCQgHAwIGFQgCCQoLBBYC AwECHgECF4AWIQSf1RxT4LVjGP2VnD0j0NC60T16QwUCXO+WxgAKCRAj0NC60T16Qzf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5a-927b5fbe7619@arm.com> Date: Tue, 11 Jun 2019 10:00:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org On 11/06/2019 09:45, Geert Uytterhoeven wrote: > CC irqchip > > Original thread at > https://lore.kernel.org/lkml/20190607172958.20745-1-erosca@de.adit-jv.com/ > > On Mon, Jun 10, 2019 at 10:30 AM Tony Lindgren wrote: >> * Kalle Valo [190610 07:01]: >>> Eugeniu Rosca writes: >>> >>>> The wl1837mod datasheet [1] says about the WL_IRQ pin: >>>> >>>> ---8<--- >>>> SDIO available, interrupt out. Active high. [..] >>>> Set to rising edge (active high) on powerup. >>>> ---8<--- >>>> >>>> That's the reason of seeing the interrupt configured as: >>>> - IRQ_TYPE_EDGE_RISING on HiKey 960/970 >>>> - IRQ_TYPE_LEVEL_HIGH on a number of i.MX6 platforms >>>> >>>> We assert that all those platforms have the WL_IRQ pin connected >>>> to the SoC _directly_ (confirmed on HiKey 970 [2]). >>>> >>>> That's not the case for R-Car Kingfisher extension target, which carries >>>> a WL1837MODGIMOCT IC. There is an SN74LV1T04DBVR inverter present >>>> between the WLAN_IRQ pin of the WL18* chip and the SoC, effectively >>>> reversing the requirement quoted from [1]. IOW, in Kingfisher DTS >>>> configuration we would need to use IRQ_TYPE_EDGE_FALLING or >>>> IRQ_TYPE_LEVEL_LOW. >>>> >>>> Unfortunately, v4.2-rc1 commit bd763482c82ea2 ("wl18xx: wlan_irq: >>>> support platform dependent interrupt types") made a special case out >>>> of these interrupt types. After this commit, it is impossible to provide >>>> an IRQ configuration via DTS which would describe an inverter present >>>> between the WL18* chip and the SoC, generating the need for workarounds >>>> like [3]. >>>> >>>> Create a boolean OF property, called "invert-irq" to specify that >>>> the WLAN_IRQ pin of WL18* is connected to the SoC via an inverter. >>>> >>>> This solution has been successfully tested on R-Car H3ULCB-KF-M06 using >>>> the DTS configuration [4] combined with the "invert-irq" property. >>>> >>>> [1] http://www.ti.com/lit/ds/symlink/wl1837mod.pdf >>>> [2] https://www.96boards.org/documentation/consumer/hikey/hikey970/hardware-docs/ >>>> [3] https://github.com/CogentEmbedded/meta-rcar/blob/289fbd4f8354/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0024-wl18xx-do-not-invert-IRQ-on-WLxxxx-side.patch >>>> [4] https://patchwork.kernel.org/patch/10895879/ >>>> ("arm64: dts: ulcb-kf: Add support for TI WL1837") >>>> >>>> Signed-off-by: Eugeniu Rosca >>> >>> Tony&Eyal, do you agree with this? >> >> Yeah if there's some hardware between the WLAN device and the SoC >> inverting the interrupt, I don't think we have clear a way to deal >> with it short of setting up a separate irqchip that does the >> translation. > > Yeah, inverting the interrupt type in DT works only for simple devices, > that don't need configuration. > A simple irqchip driver that just inverts the type sounds like a good > solution to me. Does something like that already exists? We already have plenty of that in the tree, the canonical example probably being drivers/irqchip/irq-mtk-sysirq.c. It should be pretty easy to turn this driver into something more generic. Thanks, M. -- Jazz is not dead. It just smells funny...