Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp775929imu; Tue, 20 Nov 2018 06:50:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/VXd1pXscD9LmYCbV9XD8qoYP5N9O4yiVKzoYqG7HZNKXaAS7ZQOpZ4lkaJlhYnQ7ViqgTw X-Received: by 2002:a17:902:8507:: with SMTP id bj7-v6mr2465914plb.99.1542725422658; Tue, 20 Nov 2018 06:50:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542725422; cv=none; d=google.com; s=arc-20160816; b=c/1bnqMg6+zxjqFXVEVSXKHghW9vmFE8LQAW1cSOIKgksueMwMlu426Clt6e2bBkFZ FiA2uAEr7MwSXsC8VBgO2KGyRISIGgfdanbf6WCULFft9m3cqU4p5TyOAl3dO6JUBy7b Hkc+aS5M2ApSPK6Rj++YQppapDRKNlJqeYNrNyo92gEMFQRVUp7DmM3L5DnDlv2wOwlr At/bMmsyQpsgCVl3TPwqLdfgHD0Q62VPTXKZtL9JMNmunzQ4xnFRMGiLtrrkriPeUlMP NhmKOphnw20A2DPpvR44NLAs7eMHjZscUcyVEnWnDtHWpLqiw4J6u8eBeljZEV4ZA2BQ tMMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=paBaZD/hdUpVreNEhq7MCPMxKPDZUaiDaFrGMXddyJU=; b=gnf/8SWtZ1dXGx2x5/yAN2tM/cgj3iEChwTcY8QOcJBy0FJjqs5Bthn6MDnRJCjj/R 7GW5kqAQVkOo6/PDE/W/HA3RNDiw6E1w+oUDWXH2DqYlVSUS3uQLvxXvRGYWnm3ckvL8 rL7nUZF/F7skBgw3sIGs+PxDSwW78CgUsqzqNOhs8r0wtyfEUVdYK5eENWRYJb/FV6nz nHcT4IcGzroXrRxzXZTBvtJ9uUdUjOc8NMEGiOcEv0YZVWxYGmr7p0X1RDgoh38JshDj ibrkufSoZWBW72/pC+W074RceMbS58jEPz9I7VhCA0z2V6Z6C96RXLshJu8GtFdkwwYP wKmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=rMoJPx9H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8-v6si44644788plh.188.2018.11.20.06.50.07; Tue, 20 Nov 2018 06:50:22 -0800 (PST) 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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=rMoJPx9H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729066AbeKTVnB (ORCPT + 99 others); Tue, 20 Nov 2018 16:43:01 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:3282 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727807AbeKTVm7 (ORCPT ); Tue, 20 Nov 2018 16:42:59 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 20 Nov 2018 03:14:31 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 20 Nov 2018 03:14:22 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 20 Nov 2018 03:14:22 -0800 Received: from [10.26.11.164] (10.124.1.5) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 20 Nov 2018 11:14:19 +0000 Subject: Re: omap5 fixing palmas IRQ_TYPE_NONE warning leads to gpadc timeouts To: Tony Lindgren , Peter Ujfalusi CC: Belisko Marek , LKML , , "Dr. H. Nikolaus Schaller" , Laxman Dewangan , Thierry Reding References: <20180703084516.GT112168@atomide.com> <20181113180656.GE53235@atomide.com> <46d271b2-35d3-6353-c530-3292cdac53ab@ti.com> <20181119161906.GP53235@atomide.com> <20181119171406.GQ53235@atomide.com> From: Jon Hunter Message-ID: <725df8e7-4aff-3751-d0b0-809b89e882e5@nvidia.com> Date: Tue, 20 Nov 2018 11:14:16 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181119171406.GQ53235@atomide.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1542712471; bh=paBaZD/hdUpVreNEhq7MCPMxKPDZUaiDaFrGMXddyJU=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=rMoJPx9HdHVMeGauON0ZpSQ6QdvCJmF7Ba5DNF4dWvXvCtiei9xVY/ZfzuaqLLbFD cmtZr3Fn9XtHeVthKYD8P5IZlD7+pNE7szyGC80M/r33i1rSE35oWGybfnc8Uc3FAr GzAQ6GzDrcjMZmnRCpWYB2cMGHquCDkqIF12IgYH3xGFp7A+FYBmV/rjBMGkoeoKFk 7V6gArhDH2snKrTG4Z92sf3PaYRCA4DcobyZfBafSJxb1RvhhUZ625/9Jk8rxFngFF JoSUC2DAYH4lrXJPw/wMGNB/1kzeFl6BThVaYuH1iNSuN3zYfrgjNBUdvcydRu4DCv KnrqfHCCqmgqg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/11/2018 17:14, Tony Lindgren wrote: > Hi, > > * Tony Lindgren [181119 16:19]: >> * Peter Ujfalusi [181119 10:16]: >>> On 2018-11-13 20:06, Tony Lindgren wrote: >>>> Looks like the IRQ_TYPE_NONE issue still is there for omap5 and >>>> should be fixed with IRQ_TYPE_HIGH. >>>> >>>> No idea about why palmas interrupts would stop working though, >>>> Peter, do you have any ideas on this one? >>> >>> No, I don't. >>> The INT polarity can be changed in Palmas. >>> based on the pdata->irq_flags (queried via irqd_get_trigger_type()) >>> the code configures it: >>> >>> if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH) >>> reg = PALMAS_POLARITY_CTRL_INT_POLARITY; >>> else >>> reg = 0; >>> >>> and we pass the same irq_flags to the regmap_add_irq_chip() >>> IRQ_TYPE_LEVEL_HIGH == IRQF_TRIGGER_HIGH == 0x00000004 >>> >>> A change in DT should be enough, no need to patch palmas.c, imho. >> >> But it's not. I'm now wondering if wakeupgen is inverting the >> polarity for this interrupt? >> >> GIC docs say this about SPI interrupts: >> >> "SPI is triggered on a rising edge or is active-HIGH level-sensitive." >> >> So when setting IRQ_TYPE_LEVEL_HIGH in dts, we still must not >> invert the polarity in palmas while tegra needs to. So either >> tegra114 hardware is inverting the polarity, or omap5 wakeupgen >> is. >> >> Does the palmas trm say which way PALMAS_POLARITY_CTRL >> triggers if PALMAS_POLARITY_CTRL_INT_POLARITY is set? >> >> Also note that dra7 is using a gpio for palmas interrupt. > > Well so commit 7e9d474954f4 ("ARM: tegra: Correct polarity for > Tegra114 PMIC interrupt") states that tegra114 inverts the > polarity of the PMIC interrupt. So adding Jon and Thierry to Cc. Yes Tegra can invert the polarity of the PMIC interrupt. > So it seems that commit df545d1cd01a ("mfd: palmas: Provide > irq flags through DT/platform data") wrongly sets the > PALMAS_POLARITY_CTRL_INT_POLARITY on IRQ_TYPE_LEVEL_HIGH > while it should set it on IRQ_TYPE_LEVEL_LOW. > > I think the fix needs to set the polarity using > of_machine_is_compatible() and probably also add a new > compatible to palmas.c for "ti,palmas-tegra114" to properly > deal with the inverted interrupt. Or add a property for > "interrupt-inverted". In any case, it seems that the > of_machine_is_compatible() is also needed too to avoid > breaking use with dtb files. > > Jon & Thierry, can you guys please check and confirm this? I don't fully understand what is being discussed here, but my understanding is that the palmas interrupt is active low. Let me know if this helps. Cheers Jon -- nvpublic