Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754020AbdC2Pv2 (ORCPT ); Wed, 29 Mar 2017 11:51:28 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:8203 "EHLO smtp5-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752248AbdC2PvZ (ORCPT ); Wed, 29 Mar 2017 11:51:25 -0400 Subject: Re: [PATCH v3 1/2] PCI: Add tango MSI controller support From: Mason To: Marc Zyngier , Thomas Gleixner Cc: Marc Gonzalez , Bjorn Helgaas , Robin Murphy , Lorenzo Pieralisi , Liviu Dudau , David Laight , linux-pci , Linux ARM , Thibaud Cornic , Phuong Nguyen , LKML , DT References: <5309e718-5813-5b79-db57-9d702b50d0f9@sigmadesigns.com> <0541e62a-c87a-2e69-a7d1-28f886ad04c2@free.fr> Message-ID: Date: Wed, 29 Mar 2017 17:50:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48 MIME-Version: 1.0 In-Reply-To: <0541e62a-c87a-2e69-a7d1-28f886ad04c2@free.fr> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1025 Lines: 38 On 29/03/2017 15:16, Mason wrote: > But I don't understand how to get my pcie pointer back in irq_ack > or irq_unmask, or the relevant msi. Can you throw me a clue? Let's see... the irq_chip call-backs receive an irq_data pointer. struct irq_data - per irq chip data passed down to chip functions struct irq_chip - hardware interrupt chip descriptor irq_data contains a void *chip_data member. Can I use chip_data to stash a struct tango_pcie pointer? /** * irq_set_chip_data - set irq chip data for an irq * @irq: Interrupt number * @data: Pointer to chip specific data * * Set the hardware irq chip data for an irq */ int irq_set_chip_data(unsigned int irq, void *data) But where would I call it? And for which irq? Otherwise, I found by trial-and-error that I can reach pcie through data->domain->parent->host_data data->domain == msi_dom msi_dom->parent == irq_dom irq_dom->host_data == pcie But data->irq and data->hwirq don't hold the MSI index :-( I suppose I have to ask for some mapping? Regards.