Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3425565yba; Mon, 29 Apr 2019 02:01:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTTywczcoilGxhcj70E5hkjABcmbnAzSjRwjXqgUCZ5woY2/z0O1dm2B2rnMyhOF/CZ1ZW X-Received: by 2002:a17:902:2825:: with SMTP id e34mr61206972plb.264.1556528494524; Mon, 29 Apr 2019 02:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556528494; cv=none; d=google.com; s=arc-20160816; b=MKl5Kdx1jUI/i1Tgjc6JrpTrD+K8Gev0w+VBF2UnTU+N9knZNhAXlRBeE1qdj5p2pM PsZSNEhltC842PPkaqgTlrQsVln/ZvMWpdY5QzKle4ILMzPylXGLjZe2X0jq+txyjA2K 1OSsybONzMP+2AQlK91AiZgi/BoNl3oIaFWMjSPM5RQiikYetBCCIkTZlQfIVk4ng6l2 XryLs2CwwcIi9H2FHbX7vWH0KDs4XdBoUnzXBIdt3q2IS3V6HmvBOV0CGjEYGjDyx8h4 ijaX3e+kH9y5N8NRzLVig6vHLHxutvTY1SLYIZtxmIoRK0ZXkOQcf+rrsTiljuDbGeGt 1v5w== 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=6AoMSEP6k0dB31rGEgSMYkvxlMJV2xJSnrQQRDzjTkg=; b=zpzTL3nM2u23PLwOJLhiTkZRshkMVec4araCh7T2jTV2He3E0stYMK34d4CRKjzVkc zVO1GUckL2jz0XdexsMPxfp/rkfneF/7viV6+qLSye+pzSvznRYuwHMb/08JjgjUWMfR 8F1O3cjpJFmbEsGBC8Kt/UoK8SGQ5cEmBHmLOckng3GVr+1nXj6Br7Of+kClPQiFWIFw 3fdXKQ4h8mJRf7dGG25E2naofLtiPhJFlLLqqedf3HVazbYqaPLYkHXJGc2AtY9ITs95 pTipKiEv8BoHHrnUtDZ50qwsxXW2Hj02uc1QbmK9wkmgUuYkxkqkRxiMPmhuiRJEnr5U iR0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=QHusFS31; 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 r124si30623069pgr.201.2019.04.29.02.01.18; Mon, 29 Apr 2019 02:01:34 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=QHusFS31; 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 S1727627AbfD2JA0 (ORCPT + 99 others); Mon, 29 Apr 2019 05:00:26 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:39180 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727525AbfD2JA0 (ORCPT ); Mon, 29 Apr 2019 05:00:26 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3T903GW088945; Mon, 29 Apr 2019 04:00:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1556528404; bh=6AoMSEP6k0dB31rGEgSMYkvxlMJV2xJSnrQQRDzjTkg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=QHusFS31q57Y1idKXPWuRPB3aAlPnoJ6+bqdgRkwp9l0rv6O9c4jqBlV85q7HRDyj vLWYrI7/yaTELtP7ZOi2HzAuXGXfn1Ki5cNYEvDS7aRbtXPMR4w8Y6R1Sxx1ntWnGV kGZzxdL54oGX44+iLcSQnOh0+5qIeqd8Cqz4t8/k= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3T903xl065793 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Apr 2019 04:00:03 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 29 Apr 2019 04:00:03 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 29 Apr 2019 04:00:03 -0500 Received: from [172.24.190.117] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3T8xwEq020597; Mon, 29 Apr 2019 03:59:59 -0500 Subject: Re: [PATCH v7 11/14] irqchip: ti-sci-inta: Add support for Interrupt Aggregator driver To: Marc Zyngier , Santosh Shilimkar , Rob Herring , Nishanth Menon , , CC: Linux ARM Mailing List , , Tero Kristo , Sekhar Nori , Tony Lindgren , , Peter Ujfalusi , Grygorii Strashko , Device Tree Mailing List References: <20190420100950.7997-1-lokeshvutla@ti.com> <20190420100950.7997-12-lokeshvutla@ti.com> <79b34c45-023b-2df4-26f4-e151e74a46ac@arm.com> From: Lokesh Vutla Message-ID: <7d012633-e540-df8f-7c21-07702447cb8a@ti.com> Date: Mon, 29 Apr 2019 14:29:33 +0530 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: <79b34c45-023b-2df4-26f4-e151e74a46ac@arm.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit 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 29/04/19 2:17 PM, Marc Zyngier wrote: > On 23/04/2019 11:00, Lokesh Vutla wrote: >> Hi Marc, > > [...] > >>> +/** >>> + * ti_sci_inta_set_type() - Update the trigger type of the irq. >>> + * @data: Pointer to corresponding irq_data >>> + * @type: Trigger type as specified by user >>> + * >>> + * Note: This updates the handle_irq callback for level msi. >>> + * >>> + * Return 0 if all went well else appropriate error. >>> + */ >>> +static int ti_sci_inta_set_type(struct irq_data *data, unsigned int type) >>> +{ >>> + struct irq_desc *desc = irq_to_desc(data->irq); >>> + >>> + /* >>> + * .alloc default sets handle_edge_irq. But if the user specifies >>> + * that IRQ is level MSI, then update the handle to handle_level_irq >>> + */ >>> + if (type & IRQF_TRIGGER_HIGH) >>> + desc->handle_irq = handle_level_irq; >>> + >>> + return 0; >> >> >> Returning error value is causing request_irq to fail, so still returning 0. Do >> you suggest any other method to handle this? > > But that is the very point, isn't it? If you pass the wrong triggering > type to request_irq, it *must* fail. What you should have is something like: > > switch (type & IRQ_TYPE_SENSE_MASK) { > case IRQF_TRIGGER_HIGH: > desc->handle_irq = handle_level_irq; > return 0; > case IRQ_TYPE_EDGE_RISING: > return 0; > default: > return -EINVAL; > } > > (adjust as necessary). > > What's wrong with this? I get it. Will fix it in next version. I also got the firmware update as well. If you are okay with rest of the series, I want to post the next version with the firmware update. Thanks and regards, Lokesh