Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1376847ybv; Thu, 6 Feb 2020 03:04:49 -0800 (PST) X-Google-Smtp-Source: APXvYqwJzHv8rk8OsD8lLdQjbNwwnyuF1P9ot8gZFyshfacZ4DH0cwjOKluhr1b4ZrMWRuOhSXLs X-Received: by 2002:a9d:6f82:: with SMTP id h2mr29593154otq.69.1580987089630; Thu, 06 Feb 2020 03:04:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580987089; cv=none; d=google.com; s=arc-20160816; b=BW53xQ7nNQOOvoaW3bM2It/y5AdMB0aIeHE5BqZ7mEVYLxD6t6WT7OKxfVTElJw79W 09x9AlX/8Y9+ATPgGX/ks3p3m8CCbdYOiDJmMvxCTFvpdVhqpbelLx7ghrLrDp/rJGXW dVsl/JMQoR7EikG96N5IQBd1W5ok6qoSCnAH1cQgzXYkKvUnLd8AZSYeIHGMz339+3TF h/JCKJnj51bPAZS3aTR6OwsMBvZu8est/nf60uvBNGRPClQdum9JnzwWltJIUh0E3nPo jaqrDQimnDAL0ni8zjaIzoojT+dS1AOeSPDLNM3gG2vh8HHsLZogKGAJI38WyNJfmnl/ NdtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=onB0wSKjC5MARlgiELpA7tYBWf/cx5sQU1rz5jG1aZg=; b=K3UL9GG4lgy2Eg+SJ6dJSIHFyqwHvXQnDeFgJJ4Eu6hZ1Fu8nAFS1owmOzmA7RyMcM 2K6p9R6Jh2L3TnhN9lxnisBQHINGpnmiolgYVeE/3GYxZvuCF0sSbVNIWROkC2II6wpc o7wMCHDRPdYK+VEIMad/7BR9DSujVllIlPDt9JAYTm/gzhkALkrZUOv80v60U3HR9Ho2 JcTeWRp4fqJhMIuH1dWRV89c1tVBeO674QuyDxSLmFzCe8RoM+GK/2EvMsB4D3bYvq5A CqnBxl2dAgHL2D5BHCj0VQCZhxOOPL1Eob1gkzHhXDUehmraRZ5C/nsJxLfM4ywoQekZ L9LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DHREm+Ty; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h138si1899918oib.6.2020.02.06.03.04.36; Thu, 06 Feb 2020 03:04:49 -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=@kernel.org header.s=default header.b=DHREm+Ty; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728297AbgBFJP5 (ORCPT + 99 others); Thu, 6 Feb 2020 04:15:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:54038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbgBFJP5 (ORCPT ); Thu, 6 Feb 2020 04:15:57 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B3001206CC; Thu, 6 Feb 2020 09:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580980556; bh=rQxdXGb3JBObZixrLXhy0G1L2s3YNcGekksClrmrHRo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DHREm+Ty+0AsFxcgp5M0I4HD7EFZJvI1s2CepcnjEDWaMxgL35WipfJK4R73meckj 2VrfXkdrnGk108m+83h+r33Y7R4b2Ke453jmIRAURghZwoGftr+9DSUTd2gCOWVDUm jsRcF2c11YdSD18KTefyAHVzStDT7MhXZ+pccbt4= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1izdGM-003HSq-Vh; Thu, 06 Feb 2020 09:15:55 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 06 Feb 2020 09:15:54 +0000 From: Marc Zyngier To: Michal Simek Cc: Mubin Usman Sayyed , tglx@linutronix.de, jason@lakedaemon.net, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, siva.durga.paladugu@xilinx.com, anirudha.sarangi@xilinx.com Subject: Re: [PATCH v2] irqchip: xilinx: Add support for multiple instances In-Reply-To: <575c6350-139b-65b9-f9e2-2633656baa85@xilinx.com> References: <1580911535-19415-1-git-send-email-mubin.usman.sayyed@xilinx.com> <3d6077c1-2b13-acc6-e8f4-3d1ab23dc159@xilinx.com> <8b5c5b5d601856ddc3f4388e267c4cd0@kernel.org> <575c6350-139b-65b9-f9e2-2633656baa85@xilinx.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/1.3.8 X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: michal.simek@xilinx.com, mubin.usman.sayyed@xilinx.com, tglx@linutronix.de, jason@lakedaemon.net, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, siva.durga.paladugu@xilinx.com, anirudha.sarangi@xilinx.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-06 09:11, Michal Simek wrote: > On 06. 02. 20 10:09, Marc Zyngier wrote: >> On 2020-02-06 07:06, Michal Simek wrote: >>> On 05. 02. 20 17:53, Marc Zyngier wrote: >>>> On 2020-02-05 14:05, Mubin Usman Sayyed wrote: >> >> [...] >> >>>>>  unsigned int xintc_get_irq(void) >>>>>  { >>>>> -       unsigned int hwirq, irq = -1; >>>>> +       int hwirq, irq = -1; >>>>> >>>>> -       hwirq = xintc_read(IVR); >>>>> +       hwirq = xintc_read(primary_intc->base + IVR); >>>>>         if (hwirq != -1U) >>>>> -               irq = irq_find_mapping(xintc_irqc->root_domain, >>>>> hwirq); >>>>> +               irq = irq_find_mapping(primary_intc->root_domain, >>>>> hwirq); >>>>> >>>>>         pr_debug("irq-xilinx: hwirq=%d, irq=%d\n", hwirq, irq); >>>> >>>> I have the ugly feeling I'm reading the same code twice... Surely >>>> you >>>> can >>>> make these two functions common code. >>> >>> I have some questions regarding this. >>> I have updated one patchset which is adding support for Microblaze >>> SMP. >>> And when I was looking at current wiring of this driver I have >>> decided >>> to change it. >>> >>> I have enabled  GENERIC_IRQ_MULTI_HANDLER and HANDLE_DOMAIN_IRQ. >>> This driver calls set_handle_irq(xil_intc_handle_irq) >>> and MB do_IRQ() call handle_arch_irq() >>> and IRQ routine here is using handle_domain_irq(). >>> >>> I would expect that this chained IRQ handler can also use >>> handle_domain_irq(). >>> >>> Is that correct understanding? >> >> handle_domain_irq() implies that you have a set of pt_regs, >> representing >> the context you interrupted. You can't fake that up, so I can't see >> how >> you use it in a chained context. > > ok. What's your recommendation for chained controller? Just go with > irq_find_mapping? For now, yes. I have (distant) plans to improve this. M. -- Jazz is not dead. It just smells funny...