Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2959685ybi; Mon, 10 Jun 2019 01:35:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqz53eHonSyKql/sqnrzBAgWxRDFykTshtV+zcZS49l7UsLSSUlBs64hCzD/5UarzRu4SM12 X-Received: by 2002:a17:902:aa88:: with SMTP id d8mr60891348plr.73.1560155747566; Mon, 10 Jun 2019 01:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560155747; cv=none; d=google.com; s=arc-20160816; b=GvCp+UQzYJWW4N9GwjjDE56OvDb7ZQcDYFZnPz8hnecqj3jwIbGw2mSUF/0H5ER4/0 s+bgO9BRMOzV77WLYdeH9jcCJAXcXt9mZpNEm/sj9aIOY1S6fyO1ChqOpbdKaf1JI/8Y F4LaPBArtl3tSW82H9FGdA+MHym7QFTPgeAAf02+peIkfrdjzjUdroLuHZa3h1gy7UlY Xz5mrNkIRBxhu0g/vtXvIH4jnzyLkq0VEv62V0kwlBMt8sPH7v5pIdmjwqV1gR0lFnsa VwqARR2h6oNHZsRyfRBTZbuz0NNE3HerczgpHxAtbDzrtPBnT3bp7v4ISgQa2jzb8rJg Rihg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9+28MMXMMEciRYR7I0KJ57aosgglvJIdqBJInmSBeo0=; b=PXa+nUWMxj5zWG09dl2b7uCd16HqrSgfq5AZHlpyS2z3SbHfUQ/oNy20vo5hNHX4gZ MYOnNRB9R1JKNB+LCyKNk3IfZjoy/wqfrX9tZcgLUCcMWjPICuWYjtAprNKXdtIeeG1/ Sj8ZUatPoIWuTjb9QOoF2j6gpfG9lvhkoIs/46163l/Ka5mrh34FmF1FgYSNQ4XnX968 xRSMu0xNrq8jPJsctWQjntBLOYI7E33W+WB30Pdqwshzhyu/yUPDS2asdUZdM6+7oenl fOtlsH3IYe3Ay6rOI7JOoTxE22ghThoqol5EWgmg7/z+VjW6TmhQ1yTecZEwvO922MZS T32w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si9179249pjt.61.2019.06.10.01.35.32; Mon, 10 Jun 2019 01:35:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388504AbfFJIaS (ORCPT + 99 others); Mon, 10 Jun 2019 04:30:18 -0400 Received: from muru.com ([72.249.23.125]:52442 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387862AbfFJIaS (ORCPT ); Mon, 10 Jun 2019 04:30:18 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id AEF5E807E; Mon, 10 Jun 2019 08:30:36 +0000 (UTC) Date: Mon, 10 Jun 2019 01:30:12 -0700 From: Tony Lindgren To: Kalle Valo Cc: Eugeniu Rosca , Geert Uytterhoeven , Simon Horman , "David S. Miller" , Greg Kroah-Hartman , Randy Dunlap , Ulf Hansson , John Stultz , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Spyridon Papageorgiou , Joshua Frkuska , "George G . Davis" , Andrey Gusakov , Linux-Renesas , Eugeniu Rosca , eyalr@ti.com Subject: Re: [PATCH] wlcore/wl18xx: Add invert-irq OF property for physically inverted IRQ Message-ID: <20190610083012.GV5447@atomide.com> References: <20190607172958.20745-1-erosca@de.adit-jv.com> <87tvcxncuq.fsf@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87tvcxncuq.fsf@codeaurora.org> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, * 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. But in some cases we also do not want to invert the interrupt, so I think this property should take IRQ_TYPE_EDGE_RISING and IRQ_TYPE_EDGE_RISING values to override the setting for the WLAN end of the hardware? Let's wait a bit longer for comments from Eyal too. Regards, Tony