Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp702422ybh; Wed, 11 Mar 2020 09:07:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt4cuOl0uaBYHGtVV932Vt75CSKjW5nQVZ17ZKT9YynMqFkolSGPdLTSJZABRMy4mI4ZUn5 X-Received: by 2002:aca:5f87:: with SMTP id t129mr2533740oib.36.1583942833488; Wed, 11 Mar 2020 09:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583942833; cv=none; d=google.com; s=arc-20160816; b=s3VJ5wrkdaAuHOaBkyzQ7VIMeVnj1GdyyzmT+pC7SSHEM5UxHJoV3A1LPAA3IYorq8 AbhPvI9P+NZbAk9raj4LaLffbNgr5C40lgvh8sHg2t1VAdPTP77fe0m6V/wSMehuPBYA fbiM60Kr8BBsEZZ0imVuiYtZHqRoPJG0Ah7/dSCDFkvK7z36t8scgi9QuUW/5HDweLf7 5B3iTHVNcFLlic5cZ/pXjtbzr1nN3sOAkjkkCDeIMcOt+69Y8CeKy2yNpin/BYGNaosx n1CYUa69pjyvEKg8Z/CtIgbwNDEMYFPLdCOH91U1t8tFBLoOsD+u9piCrv3eoz8KGOJ/ I//g== 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=h+VuhuPGFhbwMqe452us60wkvfvNn+3rUPpF1XpEBNM=; b=lll6DVB7qmG4khiC8JKWXH2APPvPHsr5zzp7af+Sore0CL5W4iAIV+Wbm7RSr6S9Hx 5WaZDF/uJc66SK236bb+VBAtccJDZdWUxIU9wi5WtXD+7M7+zrxfk5NGnV7cjTVyTr5w vMykxSaPGTUBsUXY8d0fIojZorOep3DBgUgfH54F/WPK1rKa3k0W0kuCZ/+Ejkj56pdF U5edXTLohmvstKvnq7xTr7mXLialz/LCAJk0j2Ji+0Rd5lNjYDriI+tDP46r5ZDzDnJP U0huqbw1KucG78ALaVvR0zglu5kMDE3n9R5hEfgxiPPTko0S/VNN/It3f5FdUVXKgPqC KAOg== 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 194si1391713oii.2.2020.03.11.09.06.53; Wed, 11 Mar 2020 09:07:13 -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 S1730046AbgCKQDj (ORCPT + 99 others); Wed, 11 Mar 2020 12:03:39 -0400 Received: from elvis.franken.de ([193.175.24.41]:34571 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729704AbgCKQDj (ORCPT ); Wed, 11 Mar 2020 12:03:39 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1jC3pW-0006pD-00; Wed, 11 Mar 2020 17:03:34 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 2C0B2C102E; Wed, 11 Mar 2020 17:03:07 +0100 (CET) Date: Wed, 11 Mar 2020 17:03:07 +0100 From: Thomas Bogendoerfer To: afzal mohammed Cc: Nathan Chancellor , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ralf Baechle , Paul Burton , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, "Maciej W. Rozycki" , Jiaxun Yang , Keguang Zhang , Huacai Chen , John Crispin Subject: Re: [PATCH v4] MIPS: Replace setup_irq() by request_irq() Message-ID: <20200311160307.GA15464@alpha.franken.de> References: <20200304203144.GA4323@alpha.franken.de> <20200305115759.3186-1-afzal.mohd.ma@gmail.com> <20200311053126.GA48442@ubuntu-m2-xlarge-x86> <20200311090308.GA5060@afzalpc> <20200311104217.GA10615@alpha.franken.de> <20200311131210.GA5115@afzalpc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200311131210.GA5115@afzalpc> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 11, 2020 at 06:42:10PM +0530, afzal mohammed wrote: > Hi Thomas, > > On Wed, Mar 11, 2020 at 11:42:17AM +0100, Thomas Bogendoerfer wrote: > > On Wed, Mar 11, 2020 at 02:33:08PM +0530, afzal mohammed wrote: > > > > diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c > > > > int r4k_clockevent_init(void) > > > { > > > - unsigned long flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED; > > > + unsigned long flags = IRQF_PERCPU | IRQF_TIMER; > > > I don't see why this should help. In my tree only sgi-ip30 removes > > IRQF_SHARED from flags, but then it uses setup_percpu_irq(). > > What do I miss ? > > You did not miss anything. Though it works, i took a wrong route > following the tags & arrived at that solution in a hurry. > (struct irqaction used in sgi-ip30 was used here earlier w/ setup_irq). > > The problem is sanity checks in request_irq() [ rather in > request_thread_iq() ] > > > if (((irqflags & IRQF_SHARED) && !dev_id) || > (!(irqflags & IRQF_SHARED) && (irqflags & IRQF_COND_SUSPEND)) || > ((irqflags & IRQF_NO_SUSPEND) && (irqflags & IRQF_COND_SUSPEND))) > return -EINVAL; > > If IRQF_SHARED is passed, it exepcts a non-NULL dev_id, here it is > NULL, setup_irq() doesn't have any check like that. so request_irq() is not a 1:1 replacement for our current setup_irq(). Or put it the another way our setup_irq() might be buggy, when used for shared interrupts. > So i think proper solution is to add a non NULL dev_id, as removing > IRQF_SHARED might affect some platforms that might be using that > interrupt line shared. > > Patch with non-NULL dev_id below, it works w/ Nathan's test case. I'm not sure, I like the adding of string pointers as dev_id arguments in your patch. How can we make sure they are unique enough for the use case ? I guess using handler as dev_id does a better job here. And before doing that, lets clean up some of the IRQF_SHARED usage first. All sni IRQF_SHARED can go away, the interrupt lines are exclusive there. loongson2ef/lemote-2f/irq.c: looks like the only user of LOONGSON_NORTH_BRIDGE_IRQ, so IRQF_SHARED could go as well. Could someone confirm that ? All other need to stay, IMHO. And v4 is already in mips-next, so I need an incremental patch please. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]