Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp780236imu; Tue, 20 Nov 2018 06:54:41 -0800 (PST) X-Google-Smtp-Source: AJdET5dJuGL+lbfRI5s0dza3WfYQ7297810/+q/QfI5S5zcrEwuwiCU9oKehoq9QqzpdSBOQ6pft X-Received: by 2002:a62:1e83:: with SMTP id e125-v6mr2449565pfe.231.1542725681662; Tue, 20 Nov 2018 06:54:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542725681; cv=none; d=google.com; s=arc-20160816; b=K6Q+Sd4YwnPdew1Iks392Z9jQHAzJtaqP1BMkLt/nSqn8IGKlZ49pBusIJpFELXaRj Pp8I+iY3qOHncM225t3CziuD0Z2ODBeRJWQIKJ8jZ8PVtPitYlGln+tLETFDdA0Y4428 HlPDWTvUXG4RBnXgwnD9i/+DsZSP9umWwEFkh+W4/sfl6Pf3mL7XMjwofIP1/ZMrX05t QOBNPXT5Os3BXmk0cEFcHIq/Al3t6n5A3SdpHhnPhsjNdM2WVCGP9Vi3xxD9dI7UoTG+ 6gtJrJLCAemKMGavQoaPHJTnOKT3IAxQQjmD3iLu8hrCWQQkTeIinW/FV+1+AEHwr2LV 28vw== 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 :in-reply-to:mime-version:user-agent:date:message-id:from:cc :references:to:subject; bh=ILNDH4X7AMR5fQvIfj24/ek95ctOEnwRHpZvnQSQZUw=; b=0XR4I/0Cf+4ybe+f8x3p2RHBai2Av6JumjukE6pJeKx4CHP3qTQehPlDWXR4ujEecx N2RF0s4IlAXGE6lrBIC+lTUE1DWZp5L9GBlF8WzUSzAmE/ANVFuu5Dk0JrzEtsc3sVzs SQnFSnNtpZcGlkF1thps7cJfw/6pSB3CEVHmvJKXSTORNnyqFjth09ugvJswJ9Yp5DbY 2FNfwS0SD8u39iUMH1JtlltkH2GZr5n0GRPyqSkBrjMDNHXfnZomOBZ80SP/JyCnc08Y t66Gg3eVKqEHH7XOy7HLQuXpJ/OU1QyLgvilyw/2G6erro1EoFADW8t3Thj/h3J9I7aW HRpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=f8GNKaqN; 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 s5si5209703pfi.134.2018.11.20.06.54.25; Tue, 20 Nov 2018 06:54:41 -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=f8GNKaqN; 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 S1729381AbeKTWwL (ORCPT + 99 others); Tue, 20 Nov 2018 17:52:11 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:5551 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728375AbeKTWwK (ORCPT ); Tue, 20 Nov 2018 17:52:10 -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 04:23:26 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 20 Nov 2018 04:23:17 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 20 Nov 2018 04:23:17 -0800 Received: from [10.19.64.176] (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 12:23:14 +0000 Subject: Re: omap5 fixing palmas IRQ_TYPE_NONE warning leads to gpadc timeouts To: Tony Lindgren , Peter Ujfalusi References: <20180703084516.GT112168@atomide.com> <20181113180656.GE53235@atomide.com> <46d271b2-35d3-6353-c530-3292cdac53ab@ti.com> <20181119161906.GP53235@atomide.com> <20181119171406.GQ53235@atomide.com> CC: Belisko Marek , LKML , , "Dr. H. Nikolaus Schaller" , Jon Hunter , Thierry Reding From: Laxman Dewangan Message-ID: <3f2dc0f7-8f01-d6a1-bc0d-8c2586f6091b@nvidia.com> Date: Tue, 20 Nov 2018 17:52:56 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20181119171406.GQ53235@atomide.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL108.nvidia.com (172.18.146.13) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1542716606; bh=ILNDH4X7AMR5fQvIfj24/ek95ctOEnwRHpZvnQSQZUw=; h=X-PGP-Universal:Subject:To:References:CC:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Transfer-Encoding; b=f8GNKaqNCbFV7v+62NBJx3k+uupGuXJX9Y8ORRu0OWn6kGJtm3PrM5P8gN/ff80UZ XsxVmpwW1kAJrkCXRZvTKuMN4wQqFmt4SJudFqyPe808KUfsvwtraQJxRLH8jW9BDn hQdTtPMnj5GUX8XILEVveKXmdlf3dP+2sXv/RIKisTy66VH1MWFsrkIS1B3/GmDt0t abntFgVmrKqaWSy6J4HJ08pbJ3r3b978otMZ9jEfDw9533i6/ZRxqcX2Q1wJQ5ARaF DA5FejBxgfPZa+PgIWdjRhzQDwEe97hZaRj2g3J3KX8ebD/H/+ci/Pkk3KmOdv+N87 ie/zZxjJ3L2JA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 19 November 2018 10:44 PM, 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. > > 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. When I implemented, ARM GIC interrupt driver did not support the IRQ_TYPE_LEVEL_LOW. If we set this then it produces warning. [Commit ID commit df545d1cd01aab3ba3f687d5423e6c3687b069d8 mfd: palmas: Provide irq flags through DT/platform data] So from DT we can not really set the IRQ_TYPE_LEVEL_LOW as irq flag.