Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp760838ybb; Wed, 25 Mar 2020 09:05:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt8NV8VwPPcyr3N+Id7N9KrENpDTfoFpqg9AL6Pc8xuKXZvdbqCkPCichZSU3Rcu5DORDSy X-Received: by 2002:a05:6830:168b:: with SMTP id k11mr3147889otr.156.1585152336356; Wed, 25 Mar 2020 09:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585152336; cv=none; d=google.com; s=arc-20160816; b=C2tfj+lmINJa6qLBPF/9MwwBZqdhMAGWvb9QoSCaZBJsN3ykBjFTCnm0ue4Ll11SRr 1TsfD6KEdIfWd7SGuIDf9c/yrwzJBYecsvNwtexxOGdQ3W3+EDH/sFf3jcOoo03XY/78 pe4CTs47aXy+iwkcXWRIv6bG4BXFLjebNy+i0LILz2htqTOEo0Y5aGZ9sfrLSuC/Epmd j5Y+a2KI/Ordw2ac7S7j81m5ZkcWMcTgTqNG+4WsuV5eT1yMW7tz/sZKdo0j0Ezu6Bfn fb4f/Iy0wKosaqZmUO1VgSW8hYQYC19M2eZBpSeqbY/r90j7LWtGVBp92lzxHhqrExWi JJsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature; bh=CRLfE2jz7muXeJ6qeLvUrod4IRB84jHCPnWRdiwg/sA=; b=oU5W9GoeWdjGrHYzqJnXPPAJ1XmO8Sn0nMDy+AInFuYsjRTd7ysNYza8GGcBrnrlf7 LahFGRll6wZDHN9S0zeZSBxdiMQF7ej1V+YMtexXDckwDB5Oe5oNaJLqxAo/k5yW1wWq aY9X0rGNrbBwoMu0rBK6NvZd48iryK67RjOuleV107FDn0XGbF/kezmj60aNeu69qNuC aR+5tFFXmnrz/Tgqtwzz/Ny0qZ8PzdZADm8WLGwwndDVe9SwqVQ8KEf/vn0Egd4PDAwd v6EtTDdae57Mm0bAFbieFDLHQ9BuQVaYTuyC+f6nX4rSC3r8B2ohDQhVzaBGctFqvbFR Gh6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=mail header.b=SSYChqb1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l129si11205355oif.15.2020.03.25.09.05.22; Wed, 25 Mar 2020 09:05:36 -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=fail header.i=@flygoat.com header.s=mail header.b=SSYChqb1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728092AbgCYQEo (ORCPT + 99 others); Wed, 25 Mar 2020 12:04:44 -0400 Received: from sender3-op-o12.zoho.com.cn ([124.251.121.243]:17805 "EHLO sender3-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbgCYQEo (ORCPT ); Wed, 25 Mar 2020 12:04:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1585152166; s=mail; d=flygoat.com; i=jiaxun.yang@flygoat.com; h=Date:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Subject:To:CC:From:Message-ID; bh=CRLfE2jz7muXeJ6qeLvUrod4IRB84jHCPnWRdiwg/sA=; b=SSYChqb1m1zrASxa3+5zJjrUtMKnv9+6kTT50o212WoZGJBKE+2duup3tWenPe99 EGwtRDYOrgwoJ8RtPYjwvnjMdGG7AM1H2zWyeo1d9z99Rt1kbP2qdd/KPHatUNPgUy0 d706UjL0F/enoxNjBmfFPAbALumoy1HCfJEvY/mE= Received: from [10.233.233.252] (183.157.60.227 [183.157.60.227]) by mx.zoho.com.cn with SMTPS id 1585152161181504.9058622774445; Thu, 26 Mar 2020 00:02:41 +0800 (CST) Date: Thu, 26 Mar 2020 00:02:28 +0800 User-Agent: K-9 Mail for Android In-Reply-To: <20200325154600.GA14923@alpha.franken.de> References: <20200325035537.156911-7-jiaxun.yang@flygoat.com> <20200325123742.GA9911@alpha.franken.de> <5eb9ce9ea665ee32da40779f00fc9b37@kernel.org> <4BB367D3-B8AD-47B6-ACC2-30752137BC1B@flygoat.com> <39CF835E-D1D9-4B52-ABDC-BDB17B650936@flygoat.com> <20200325150437.GA14217@alpha.franken.de> <777D8DAA-F462-4E8D-9012-C114DE6D56DE@flygoat.com> <20200325154600.GA14923@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v8 06/11] irqchip: mips-cpu: Convert to simple domain To: Thomas Bogendoerfer CC: Marc Zyngier , linux-mips@vger.kernel.org, Huacai Chen , Thomas Gleixner , Jason Cooper , Rob Herring , Mark Rutland , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , Andy Shevchenko , Allison Randal , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org From: Jiaxun Yang Message-ID: <8F2B64C3-A887-4D4B-ABEA-4BE3D30F4632@flygoat.com> X-ZohoCNMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =E4=BA=8E 2020=E5=B9=B43=E6=9C=8825=E6=97=A5 GMT+08:00 =E4=B8=8B=E5=8D=881= 1:46:00, Thomas Bogendoerfer =E5=86=99=E5= =88=B0: >On Wed, Mar 25, 2020 at 11:09:10PM +0800, Jiaxun Yang wrote: >>=20 >>=20 >> =E4=BA=8E 2020=E5=B9=B43=E6=9C=8825=E6=97=A5 GMT+08:00 =E4=B8=8B=E5=8D= =8811:04:37, Thomas Bogendoerfer > =E5=86=99=E5=88=B0: >> >On Wed, Mar 25, 2020 at 10:31:21PM +0800, Jiaxun Yang wrote: >> >>=20 >> >>=20 >> >> =E4=BA=8E 2020=E5=B9=B43=E6=9C=8825=E6=97=A5 GMT+08:00 =E4=B8=8B=E5= =8D=8810:15:16, Marc Zyngier >=E5=86=99=E5=88=B0: >> >> >On 2020-03-25 13:59, Jiaxun Yang wrote: >> >> > >> >> >[=2E=2E=2E] >> >> > >> >> >>>> So probably we can use legacy domain when MIPS IRQ BASE is >in >> >the >> >> >>>> range of legacy IRQ >> >> >>>> and switch to simple domain when it's not in that range? >> >> >>>=20 >> >> >>> No, see below=2E >> >> >>>=20 >> >> >>>> Here in Loongson systems IRQ 0-15 is occupied by I8259 so I >did >> >> >this >> >> >>>> hack=2E >> >> >>>=20 >> >> >>> Well, if you have to consider which Linux IRQ gets assigned, >> >> >>> then your platform is definitely not ready for non-legacy >> >> >>> irqdomains=2E Just stick to legacy for now until you have >removed >> >> >>> all the code that knows the hwirq mapping=2E >> >> >>=20 >> >> >> Thanks=2E >> >> >>=20 >> >> >> So I have to allocate irq_desc here in driver manually? >> >> > >> >> >No, you are probably better off just dropping this patch, as MIPS >> >> >doesn't seem to be ready for a wholesale switch to virtual >> >interrupts=2E >> >>=20 >> >> It can't work without this patch=2E >> >>=20 >> >> Legacy domain require IRQ number within 0-15=20 >> >> however it's already occupied by i8259 or "HTPIC" driver=2E >> > >> >what's the problem here ? AFAIK there could be more than one >> >legacy domain, at least that's what at least IP22/SNI in MIPS world=20 >> >are doing=2E >>=20 >> MIPS_IRQ_BASE must be higher than 15, otherwise it will conflict with >i8259=2E > >I still don't get it=2E > >We have following in arch/mips/include/asm/mach-generic/irq=2Eh: > >#ifndef MIPS_CPU_IRQ_BASE >#ifdef CONFIG_I8259 >#define MIPS_CPU_IRQ_BASE 16 >#else >#define MIPS_CPU_IRQ_BASE 0 >#endif /* CONFIG_I8259 */ >#endif > >So every legacy platform with i8259 has MIPS_CPU_IRQ_BASE =3D 16=2E > >> However we have only preallocated irq_desc for 0-15=2E >> And legacy domain require irq_desc being preallocated=2E > >maybe I'm too fast by judging the irq code, but without >CONFIG_SPARSE_IRQ >the whole irq_desc is pre-allocated=2E Sorry=2E You're right=2E I found the problem is CONFIG_SPARSE_IRQ is accidentally enabled in my con= fig due to another out-of-tree patch during my initial test and I always consider it as a problem=2E So we can drop this patch safely for now=2E But just need to consider how to deal with it when we want to enable SPARS= E_IRQ=2E Thanks=2E > >Thomas=2E --=20 Jiaxun Yang