Received: by 10.213.65.68 with SMTP id h4csp48611imn; Mon, 19 Mar 2018 19:08:27 -0700 (PDT) X-Google-Smtp-Source: AG47ELvQYLQafL/ibNocAVG5lqYOkZ4eR9X7a+Sidm+LGbIxRyp8yPRXjgGnu2YzI1eYyRkVIFEO X-Received: by 10.98.49.135 with SMTP id x129mr12045692pfx.75.1521511707625; Mon, 19 Mar 2018 19:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521511707; cv=none; d=google.com; s=arc-20160816; b=w+x1Upw/JKMz4c4mNNMUPLDCdv1fowlwDhFeq/C2GBYdQatmyo4W1Db9sUC0pOaR32 MGMJzO53tFPYhF/5z/+pmdH1Stwatpa3gseenbRrR1rpfwAHlJG0urwqzCd3nUzjE0hV Fp4dHE8qR2TN9xLGmcRaNtNxuwalVO47Nr74KCPAQwR6mf5cGnddtF4rOzS+EUhkStIN /y6EUbv0NxGB7I7I4HTyvCz9TsVUvwcnx4uCl/kfbUHfFsrpbqY/3T9U8sV5ztgrlBDk jqKE3ynftCdWKtIsy0rghejZzsFUKEcSI9sCQ7T+dG2iyaB3mfFl0TumhAaVFPTUGm2j wUUw== 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:arc-authentication-results; bh=GO5mextuP4+d7OaHHRrpGEherELIUy10TKCO0SpRhJI=; b=IKUxfFb/qIU6X6HcFmwc5x9+hZYKX4t+kB6gB/gTd8NWetLHsTxB8I+8E2Pi1VUP+t jUgBElrTbtgzI6w0Ig7aJESEDKVT5P34ux7SsDYL1N1bCpyDmvIxNrKGm6VnNA+Uk7AH cUdZV05M1oMFvKm7aZfJo3O9OtOJvFCTGG/rGeZbqd1+547yo+NzUfuL3x7VlEAp96Fe cpwMcuBsqcdnVUc4Jryt7kJpLATSo4rrWcDDnNolcvkT/T1qlFWhHOvxjC9PT5/pNyk+ 2U5efkfaHHe+4YH3jOtvcMTIdqcNPy8tUTeQ4WWo3r/5Ziwm0FSBu78M9/6NS9crZmTm Qf7w== 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 w10si408906pgv.486.2018.03.19.19.08.13; Mon, 19 Mar 2018 19:08:27 -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 S1751128AbeCTCHJ (ORCPT + 99 others); Mon, 19 Mar 2018 22:07:09 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:35234 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750731AbeCTCHG (ORCPT ); Mon, 19 Mar 2018 22:07:06 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.02912532|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03296;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=10;RT=10;SR=0;TI=SMTPD_---.BN7lK90_1521511614; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:223.93.147.148) by smtp.aliyun-inc.com(10.147.41.231); Tue, 20 Mar 2018 10:06:54 +0800 Date: Tue, 20 Mar 2018 10:06:54 +0800 From: Guo Ren To: Thomas Gleixner Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, daniel.lezcano@linaro.org, jason@lakedaemon.net, arnd@arndb.de, c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, thomas.petazzoni@bootlin.com, wbx@uclibc-ng.org Subject: Re: [PATCH 06/19] csky: IRQ handling Message-ID: <20180320020651.GA14709@guoren> References: <28baa2d92e5c3145afdff68ca784075afbb64d88.1521399976.git.ren_guo@c-sky.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thomas, On Mon, Mar 19, 2018 at 02:16:37PM +0100, Thomas Gleixner wrote: > > +static inline unsigned long arch_local_irq_save(void) > > +{ > > + unsigned long flags; > > Newline between declaration and code please. OK > > +void csky_do_IRQ(int irq, struct pt_regs *regs) > > static? If not, then it needs a declaration in a header somewhere. Yes, need static. > > +asmlinkage void csky_do_auto_IRQ(struct pt_regs *regs) > > +{ > > + unsigned long irq, psr; > > + > > + asm volatile("mfcr %0, psr":"=r"(psr)); > > + > > + irq = (psr >> 16) & 0xff; > > + > > + if (irq == 10) > > + irq = csky_get_auto_irqno(); > > + else > > + irq -= 32; > > Please add a comment explaining this magic here. Magic numbers w/o > explanation are bad. Yes, you are right. I will fixup them next. PSR is our Processor Status Register and it store the vector number. '10' is our auto-interrupt exception entry and we need get the irqno from the interrupt-controller. The "vector num > 32" is our vector interrupt exception entries, so we can calculate the irq-num by vector-num and no need to access the interrupt-controller's io regs. Best Regards Guo Ren