Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp269415imm; Thu, 11 Oct 2018 20:22:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV6163Y82ZEmD0UD/WvIWGef2gatTWpMZAs2yoFzeKNAkEjoznWqlnmvOKRl3RdUn7KIRGVZ/ X-Received: by 2002:a17:902:6a4:: with SMTP id 33-v6mr4034144plh.11.1539314532978; Thu, 11 Oct 2018 20:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539314532; cv=none; d=google.com; s=arc-20160816; b=TE5ZnIYigrpvHWvNYJ1CG3MAfMbX0YI9C2X/rk4vaw2eaz1xMjjKqhQNwMm7pxPqda CNqjp9mHC7ZPPo03/WLkvC07A6mcLznSMABUxSgGhDVl5lw2YGhVbZTrjXC/Fqe/B/5N 1ETNe1hhidNruS+1qCi+qAVXeBYiZ+3AIF7nCK5sb09WZIVisEeoDlcGabTauUXOoqL0 R4QJYbQhlcQaPVY4q0d9PJdMIks85x2bP67rz2RTcpFo3v6eKfiZ8sa9VR9TX80IBYVb 8K+VzjrkXuy3IhZUIsupjw29N4gsdGLrm3OZqcO9gc9UkAgrGUTZgS2q+F5HRShoQqhA b0xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Hzmt+Msb47tRnvfCR5+CwYVx6nSJDbTTFjdKV+LPpbA=; b=br1DygF3Mdh297ryHq5fwkKVb40IMLPDoTNwEWe9d75EzGTuI0nz3Xp2TF6LcSn7L4 t0dochXQxbK40/HdC4bGyN9OtCsA/xs8KtlDoU/M1ZyYpNI7L0UDP6fBxt6MR8+XrJNn Fgtis+WlyHbQTimCNfl5xDw9ePxYi1w3/71ElZrdQOaDWphShE5nBd15ezSdrjHN3vLr FGuOFtr92JkoQF1wRTednD+aD5pGcDKn5nVGkomqEpfB6qz0EYCjv0nzBqypKIVh6z7T PxWz7rVWFpTdkATFjAfVu9TNqJLpQ3oD9GL1n/7PPIkEdgLxmtLP0ZAchqn89NV+8Ic7 YhSA== 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 h21-v6si31140557plr.98.2018.10.11.20.21.56; Thu, 11 Oct 2018 20:22:12 -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 S1726869AbeJLKvu (ORCPT + 99 others); Fri, 12 Oct 2018 06:51:50 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:36522 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbeJLKvu (ORCPT ); Fri, 12 Oct 2018 06:51:50 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07480073|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03291;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=13;RT=13;SR=0;TI=SMTPD_---.D0thR3Q_1539314483; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.D0thR3Q_1539314483) by smtp.aliyun-inc.com(10.147.44.118); Fri, 12 Oct 2018 11:21:23 +0800 Date: Fri, 12 Oct 2018 11:21:23 +0800 From: Guo Ren To: Marc Zyngier Cc: tglx@linutronix.de, jason@lakedaemon.net, robh+dt@kernel.org, mark.rutland@arm.com, daniel.lezcano@linaro.org, will.deacon@arm.com, jhogan@kernel.org, paul.burton@mips.com, peterz@infradead.org, arnd@arndb.de, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH V11 1/8] irqchip: add C-SKY SMP interrupt controller Message-ID: <20181012032122.GA20643@guoren-Inspiron-7460> References: <83d216b3fed039037ebe8b8513f3c51a36934e74.1539095312.git.ren_guo@c-sky.com> <8772c090-a139-04e4-a55f-820afe1bb5bd@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8772c090-a139-04e4-a55f-820afe1bb5bd@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On Tue, Oct 09, 2018 at 04:11:05PM +0100, Marc Zyngier wrote: > On 09/10/18 15:41, Guo Ren wrote: > > - Irq-csky-mpintc is C-SKY smp system interrupt controller and it > > could support 16 soft irqs, 16 private irqs, and 992 max common > > irqs. > > > >Changelog: > > - Convert the cpumask to an interrupt-controller specific representation > > in driver's code, and not the SMP code's. > > - pass checkpatch.pl > > - Move IPI_IRQ into the driver > > - Remove irq_set_default_host() and use set_ipi_irq_mapping() > > - Change name with upstream feed-back > > - Change irq map, reserve soft_irq & private_irq space > > - Add License and Copyright > > - Support set_affinity for irq balance in SMP > > > >Signed-off-by: Guo Ren > >Cc: Marc Zyngier > > [...] > > >+/* C-SKY multi processor interrupt controller */ > >+static int __init > >+csky_mpintc_init(struct device_node *node, struct device_node *parent) > >+{ > >+ unsigned int cpu, nr_irq; > >+ int ret; > >+ > >+ if (parent) > >+ return 0; > >+ > >+ ret = of_property_read_u32(node, "csky,num-irqs", &nr_irq); > >+ if (ret < 0) > >+ nr_irq = INTC_IRQS; > >+ > >+ if (INTCG_base == NULL) { > >+ INTCG_base = ioremap(mfcr("cr<31, 14>"), > >+ INTCL_SIZE*nr_cpu_ids + INTCG_SIZE); > >+ if (INTCG_base == NULL) > >+ return -EIO; > >+ > >+ INTCL_base = INTCG_base + INTCG_SIZE; > >+ > >+ writel_relaxed(BIT(0), INTCG_base + INTCG_ICTLR); > >+ } > >+ > >+ root_domain = irq_domain_add_linear(node, nr_irq, &csky_irqdomain_ops, > >+ NULL); > >+ if (!root_domain) > >+ return -ENXIO; > >+ > >+ /* for every cpu */ > >+ for_each_present_cpu(cpu) { > >+ per_cpu(intcl_reg, cpu) = INTCL_base + (INTCL_SIZE * cpu); > >+ writel_relaxed(BIT(0), per_cpu(intcl_reg, cpu) + INTCL_PICTLR); > >+ } > >+ > >+ set_handle_irq(&csky_mpintc_handler); > >+ > >+#ifdef CONFIG_SMP > >+ set_send_ipi(&csky_mpintc_send_ipi); > >+ > >+ set_ipi_irq_mapping(&csky_mpintc_ipi_irq_mapping); > > Same remark as before. > > You do not need this second callback, and you should redefine set_send_ipi > to take an irq number: > > ipi_irq = irq_create_mapping(root_domain, IPI_IRQ); > if (!ipi_irq) > [handle error] > > set_send_ipi(csky_mpintc_send_ipi, ipi_irq); > > and you can then delete both set_ipi_irq_mapping and csky_mpintc_handler, > none of which serve any purpose. > > In your SMP code: > > void __init set_send_ipi(void (*func)(const struct cpumask *), int irq) > { > if (send_arch_ipi) > return; > > send_arch_ipi = func; > ipi_irq = irq; > } > > and simplify setup_smp_ipi. Ok, remove the set_ipi_irq_mapping. See my next version patch. Best Regards Guo Ren