Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2549779imu; Mon, 19 Nov 2018 02:19:22 -0800 (PST) X-Google-Smtp-Source: AJdET5fhe/PZVH3SwuZXBbSxbaP7l3mWxd/rADvbXo/ufG0rfeO24HwgiMrRBQJMpchKM0cDV/zC X-Received: by 2002:a62:ce0e:: with SMTP id y14mr8925913pfg.100.1542622762636; Mon, 19 Nov 2018 02:19:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542622762; cv=none; d=google.com; s=arc-20160816; b=OwrEPFBHEg6qa/cSjZQad3goNVquR8k/ITQIFh/73lJgMuZ/ZKrDQF9PbpCaBDzLUz EYTjBQmPzoJ6cavW5pZ//ZTtOt6ZK0e/KWdSV5jKhdGo4RgrHTihCtbKI431GmFrZCaq Uvj8nopovU12ozVBylbnzC21PUTuGyhv83B3NUVbbqriVIlfzHQ6XfSxxt4WtdBHzi8s jVw5xMQ7pKfR6hof/1B3siHfhz2AWEk54hTJUP6b1RhFRf0CT7yVnOka76E9vMPuD6N0 ND48YQl/B8++CLrkU+dHMlicKIlQ/xQaCqjRQ/Q4opMGaHf1Qx+ZPqlP5BAh8CzBq9Cq CmVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=RwpROdVH0xR9m6WqhAf2fFqF2QLkOQ3I+8XUVbWMEoc=; b=y2KQ6dbADY4ise8c8OXmG9ZrPBlmYBN4Y1zxnbkBvqK+RfKJ7hfQo23xyloQHTaaJa r5YFN9Vk3+93b+MD6ZvQCDXBYwZPyzGgC7HyI/JOjHb1Gd8njltWAlXu8jUBJxDJW8GN IkAIps/R6EQGJHCl9Ff8krnFx9u+3IH1dpGl2jXHLRprGCv7pklnHH+EvvJYLIIeNRby Xd/cRWRlhwaiySpucPNCc1hwgHWG7tODQgo6TOuOv0wmLbUUtgRkh0e0HmZxMOWqiCrh 5l4lwKsxL2RSRC0cR5Kqi/u7rCYoQJH5OB5fByzS/59dsLtZNpDmW2Hv20q/71WjKnlj Ia0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=AblXl1ZU; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si38506870pgi.256.2018.11.19.02.19.08; Mon, 19 Nov 2018 02:19: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=@ti.com header.s=ti-com-17Q1 header.b=AblXl1ZU; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727998AbeKSUkL (ORCPT + 99 others); Mon, 19 Nov 2018 15:40:11 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:42794 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbeKSUkK (ORCPT ); Mon, 19 Nov 2018 15:40:10 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id wAJAGk5G121574; Mon, 19 Nov 2018 04:16:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1542622606; bh=RwpROdVH0xR9m6WqhAf2fFqF2QLkOQ3I+8XUVbWMEoc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=AblXl1ZUhPeIjEAdKxfuoPnNaHe0kzA4jpnvMI9CjFFPS6LtSVKA/YebCAI+1PUuS dC4+NY9nAiU5Gs0CyHVNu/QBM8YSBplC5qVXwEQTW7h5QeGRzLCTQcO1RwRMRSc8T3 oVqWUxBKcjmUIsffz89kOdaNFd1njY+HqRxr3bl0= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wAJAGkjU095261 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 19 Nov 2018 04:16:46 -0600 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 19 Nov 2018 04:16:43 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 19 Nov 2018 04:16:43 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wAJAGgkJ012734; Mon, 19 Nov 2018 04:16:42 -0600 Subject: Re: omap5 fixing palmas IRQ_TYPE_NONE warning leads to gpadc timeouts To: Tony Lindgren , Belisko Marek CC: LKML , , "Dr. H. Nikolaus Schaller" References: <20180703084516.GT112168@atomide.com> <20181113180656.GE53235@atomide.com> From: Peter Ujfalusi Message-ID: <46d271b2-35d3-6353-c530-3292cdac53ab@ti.com> Date: Mon, 19 Nov 2018 12:18:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181113180656.GE53235@atomide.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-11-13 20:06, Tony Lindgren wrote: > Hi > > * Belisko Marek [180703 18:34]: >> Hi Tony, >> >> On Tue, Jul 3, 2018 at 10:45 AM Tony Lindgren wrote: >>> >>> * Belisko Marek [180620 09:40]: >>>> Hello, >>>> >>>> I'm trying to fix warning (for omap5 board) produced by recent change >>>> to avoid using IRQ_TYPE_NONE like: >>>> [ 1.818666] WARNING: CPU: 1 PID: 778 at >>>> drivers/irqchip/irq-gic.c:1016 gic_irq_domain_translate+0x78/0x100 >>>> [ 1.828839] Modules linked in: >>>> >>>> I did look to other commit which did update and without deep knowledge >>>> I just simply do this small change: >>>> diff --git a/arch/arm/boot/dts/omap5-board-common.dtsi >>>> b/arch/arm/boot/dts/omap5-board-common.dtsi >>>> index 218892b..ab2df8c 100644 >>>> --- a/arch/arm/boot/dts/omap5-board-common.dtsi >>>> +++ b/arch/arm/boot/dts/omap5-board-common.dtsi >>>> @@ -393,7 +393,7 @@ >>>> >>>> palmas: palmas@48 { >>>> compatible = "ti,palmas"; >>>> - interrupts = ; /* IRQ_SYS_1N */ >>>> + interrupts = ; /* IRQ_SYS_1N */ >>>> reg = <0x48>; >>>> interrupt-controller; >>>> #interrupt-cells = <2>; >>>> >>>> and it looks board boots fine. Only issue is that gpadc driver is not >>>> working (at least not getting interrupts at all ADC fails with >>>> timeout). I did look to gpadc driver and driver is not using >>>> interrupts defined in dts but request interrupt directly from palmas >>>> mfd module. Any ideas what needs to be changed to have gpadc again >>>> working with mentioned patch? >>> >>> Can you try with IRQF_TRIGGER_HIGH added also to the flags to >>> regmap_add_irq_chip() in drivers/mfd/palmas.c? >> Nope issue is till present also after this change like: >> diff --git a/arch/arm/boot/dts/omap5-board-common.dtsi >> b/arch/arm/boot/dts/omap5-board-common.dtsi >> index 218892b..6912769 100644 >> --- a/arch/arm/boot/dts/omap5-board-common.dtsi >> +++ b/arch/arm/boot/dts/omap5-board-common.dtsi >> @@ -393,7 +393,7 @@ >> >> palmas: palmas@48 { >> compatible = "ti,palmas"; >> - interrupts = ; /* IRQ_SYS_1N */ >> + interrupts = ; /* IRQ_SYS_1N */ >> reg = <0x48>; >> interrupt-controller; >> #interrupt-cells = <2>; >> @@ -432,9 +432,9 @@ >> >> gpadc: gpadc { >> compatible = "ti,palmas-gpadc"; >> - interrupts = <18 0 >> - 16 0 >> - 17 0>; >> + interrupts = <18 IRQ_TYPE_LEVEL_HIGH >> + 16 IRQ_TYPE_LEVEL_HIGH >> + 17 IRQ_TYPE_LEVEL_HIGH>; >> #io-channel-cells = <1>; >> ti,channel0-current-microamp = <5>; >> ti,channel3-current-microamp = <10>; >> diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c >> index 663a239..15d23db 100644 >> --- a/drivers/mfd/palmas.c >> +++ b/drivers/mfd/palmas.c >> @@ -601,7 +601,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, >> regmap_write(palmas->regmap[slave], addr, reg); >> >> ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq, >> - IRQF_ONESHOT | pdata->irq_flags, 0, >> + IRQF_ONESHOT | IRQF_TRIGGER_HIGH | >> pdata->irq_flags, 0, >> driver_data->irq_chip, &palmas->irq_data); >> if (ret < 0) >> goto err_i2c; > > 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. - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki