Received: by 10.213.65.68 with SMTP id h4csp4188995imn; Tue, 10 Apr 2018 10:36:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx499pd/ircSJkYbBCOayJZJrNrpeSc1vqJdRBRZsDK6/QqvqJS5uitM4DutU9dg8q+cZH6b8 X-Received: by 2002:a17:902:b94c:: with SMTP id h12-v6mr1380294pls.321.1523381808396; Tue, 10 Apr 2018 10:36:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523381808; cv=none; d=google.com; s=arc-20160816; b=ymDhOW/+60oKvtdKaeKus0q1bsuddIbaO7XjsLaQxR/sFgzozE5GD/TK85M9o9AoXj wEWclbOIItwtl3fb3PTMXRGW1cl7jXj2cxleKHjoIJRz8aMY576nM71aCP7CaDvgGdPh M28N+Z/sQHGRfPJKHwF6mibpWuUl3shHTE1+6OIS/UMKyQBCfkDpwdO5Wo30b+Jp7Pa2 owq9su3504/yijgpcxj7U7BN7upvaFiLoFlY8/D52Pq+FOyhFSJ5gzC10OMbNcTLJeUq fy0CgW8sU5ZwcZyo7va+5Ur3lqw42a4iZCpv0mjQTnimdrYgXAsfHGekq3T96vWvxwMz t3yg== 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:organization:references:cc:to:from:subject :arc-authentication-results; bh=jzY17Mhtf4TDYscqznbg6GW8L2misLV3QY4I1EPWteg=; b=loRRS+BUFMq4iqLGCviZ/t0/XzlrZbcBmARmW+woiqxzZsfffLRDfrEOrSSErNKe6n S9TVnZYkXXs4FWIIts2IDlikTc7GrFp/DAlr1q1paYfNBe1vkVsKH+7PgsYY9iXNSEV6 B0E0X13ko74E+pFymsf+E0TULr6OlMHNPx+AlNZvOCO6YQd1FSr6RkPI/hQo1uMBUZRb NmYWEAFg9k223mS8dey09jQnCh+KANh1nKtYF5e8iU9TNjaZHVHoK/chw4YjGWIklhbb Bnxz8cYJdJsfbnWZfjGdX7UuACvYkBalX1JZWvJ63xuKrKsK0YvkbIeRO+ZSf39qz7dy NjWw== 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 a12si2372623pfd.235.2018.04.10.10.36.10; Tue, 10 Apr 2018 10:36:48 -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 S1752134AbeDJRav (ORCPT + 99 others); Tue, 10 Apr 2018 13:30:51 -0400 Received: from foss.arm.com ([217.140.101.70]:41132 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820AbeDJRau (ORCPT ); Tue, 10 Apr 2018 13:30:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D5B171435; Tue, 10 Apr 2018 10:30:49 -0700 (PDT) Received: from [10.1.206.75] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 163AA3F592; Tue, 10 Apr 2018 10:30:47 -0700 (PDT) Subject: Re: [PATCH] irqchip/gic-v3: Support v2m frame backwards compatibility mode From: Marc Zyngier To: Thomas Petazzoni Cc: Stephen Boyd , Thomas Gleixner , Jason Cooper , linux-arm-msm@vger.kernel.org, Srinivas Kandagatla , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Hanna Hawa , =?UTF-8?Q?Miqu=c3=a8l_Raynal?= References: <20170320223614.1351-1-sboyd@codeaurora.org> <20180410170155.6e07113d@windsurf> Organization: ARM Ltd Message-ID: <41edab13-83db-4d57-583a-782144463857@arm.com> Date: Tue, 10 Apr 2018 18:30:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04/18 16:23, Marc Zyngier wrote: > I have a vague idea how to support this. Given that level-triggered MSIs > have to be platform MSIs (because it is just madness otherwise), we can > probably store an extra message in the struct platform_msi_desc for the > "lower the line" write. On activation, you'd get two callbacks, probably > with a flag of some sort to indicate whether this is for the rising or > falling edge. Actually, we can get away with a single call and no extra storage if we do something like below, and check the trigger in the backends: diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index 2a8571f72b17..85408be6d752 100644 --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -89,13 +89,13 @@ int msi_domain_set_affinity(struct irq_data *irq_data, const struct cpumask *mask, bool force) { struct irq_data *parent = irq_data->parent_data; - struct msi_msg msg; + struct msi_msg msg[2]; int ret; ret = parent->chip->irq_set_affinity(parent, mask, force); if (ret >= 0 && ret != IRQ_SET_MASK_OK_DONE) { - BUG_ON(irq_chip_compose_msi_msg(irq_data, &msg)); - irq_chip_write_msi_msg(irq_data, &msg); + BUG_ON(irq_chip_compose_msi_msg(irq_data, msg)); + irq_chip_write_msi_msg(irq_data, msg); } return ret; @@ -104,20 +104,20 @@ int msi_domain_set_affinity(struct irq_data *irq_data, static int msi_domain_activate(struct irq_domain *domain, struct irq_data *irq_data, bool early) { - struct msi_msg msg; + struct msi_msg msg[2]; - BUG_ON(irq_chip_compose_msi_msg(irq_data, &msg)); - irq_chip_write_msi_msg(irq_data, &msg); + BUG_ON(irq_chip_compose_msi_msg(irq_data, msg)); + irq_chip_write_msi_msg(irq_data, msg); return 0; } static void msi_domain_deactivate(struct irq_domain *domain, struct irq_data *irq_data) { - struct msi_msg msg; + struct msi_msg msg[2]; - memset(&msg, 0, sizeof(msg)); - irq_chip_write_msi_msg(irq_data, &msg); + memset(msg, 0, sizeof(msg)); + irq_chip_write_msi_msg(irq_data, msg); } static int msi_domain_alloc(struct irq_domain *domain, unsigned int virq, Is it disgusting? You bet. Does it work? Probably. M. -- Jazz is not dead. It just smells funny...