Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp725595ybh; Wed, 11 Mar 2020 09:33:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtt/iz8cT/NYWxDqEqv2chb/RRibpyrHjY2W+FZ4NSuStFqdGn4OuHuh++brwXDJDZ5R9gS X-Received: by 2002:a05:6808:195:: with SMTP id w21mr2601852oic.18.1583944417248; Wed, 11 Mar 2020 09:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583944417; cv=none; d=google.com; s=arc-20160816; b=ByVLOaYMz1ymkxbTyu0Nxrj1vXPl/9DjJje5P+qRZjm6imMcUDmAF65bZN++Bol2ER V6iMf3Rg9yG0b+14ihX5k8plo3Kvlaf3wIM4rgc3XScJzCAyLPGQ6dLEIeMMezNyHfkl AKHXoz91/G0bFaeyoU5VLuyuySaLEhpLwysBdF9Sri1d5slOGi8OiRd/qSCDjpuZKZFa H2zpPNeFfV202Kz41MD82KmErbFzXD21mFQLf5Kfj5HuCUCpRcwXFg4+W1TSalczHoHf 9Jv/hYZwVzuHHNScDgsuevqZBHKuZEbYpQ8wXA2ea4rMTP1L/Gqa7kFyyB0hKNeoblBr wDFQ== 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:dkim-signature; bh=zmUBvFmNMYqAgE4hUh5PxorZyEbBCYGzea7UV2DPByM=; b=nKhHWquDjCsz3KIhkRSNRoeLxtllcRMjpUhN5vkGKBWiETfu6F6eZKS+BevzGOVgP8 hfhvR9xS9FiTG+cm+oMkzhDzfdcWUlF5dLVfX8dCVaeMvF471kVfAgo7Vdr6+mitCC2v 3i0+Dq8SqnCM7ofBsUnlHmXF+/ihPYnvkP2bDT/UI8kSvkU1NtMBRYsCV8y/zXao6/8E zPkQKYfYAFwclhyiCl1cYWJc/xM8eZLQPHkYMKRMb78rNy8gBmC8PVqJLiqgS18DijJK +A0VkQKQXhQFmo83J7eccd9lC7Bl94xvhOpNHX28DDnQneFSy2IKDGNKJdOiXb9SNPRn i4FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=okn3wxox; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si1456255ota.239.2020.03.11.09.33.25; Wed, 11 Mar 2020 09:33:37 -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=pass header.i=@gmail.com header.s=20161025 header.b=okn3wxox; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730202AbgCKQcx (ORCPT + 99 others); Wed, 11 Mar 2020 12:32:53 -0400 Received: from mail-pj1-f67.google.com ([209.85.216.67]:40409 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729852AbgCKQcx (ORCPT ); Wed, 11 Mar 2020 12:32:53 -0400 Received: by mail-pj1-f67.google.com with SMTP id gv19so1283476pjb.5; Wed, 11 Mar 2020 09:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zmUBvFmNMYqAgE4hUh5PxorZyEbBCYGzea7UV2DPByM=; b=okn3wxoxdRHK59h+9WIq7oUfCZKvj8jYSlljDW2vEtjcLJX7mgYZASlfNT2PSYE6Ew hTxbbboBZjfEQPOaLaDTKkp2kAaVqZVROy0sVYOndeFLtoC7w9dk7d90z8EtJQq0Vx0R vy9cgKIwOxAWv5BdqTYwtuiYYyguWrlCbqRIYcLTabjY59Uz+WnOAb8XXE+r/5G2b4FS 0hKP4XWaegGUW05mM/tuyOjn8lu6DjLqOKDzuzDjE1W3KtsqetyMjI5B1hTR1nJumbKu vF4IfBaBzIIt5RZA++Mg8wN3WcVTwUS5m/euqks2Ta8zJGfFhw2KCVKjQnHaLV+MY2Wg tbuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zmUBvFmNMYqAgE4hUh5PxorZyEbBCYGzea7UV2DPByM=; b=M2rJnaR+2K0b0xNvw2qg5sMWEgCUFV4UCXZ8hobAzrGHHQOaQ2grG7zapKyvKEmSrL Y4v3UvtNubOz1sbXM3xfGmYmD1f8+hXo31TQxzhuCK7AH+4nHmQerGgCZBzlZi3mxnIK THm6TTztIXKvFUuzAyoiUAF7dqplG9NPaU8gQxrTLc3nPU0xqtYlnGMkqF9EP1GwTBKV bMw1kLZhtEOC7UncLgHZWmA9p8fe18T8ato76Y/gPva91gei4lZSawLk+RjNXVqTB1wn uI5/xL+yJhazasWX+/WN8lqEHBhGAccthdM+GLk2rzq3XG4v3H/4fauKf5QpxDkFs2T1 MumA== X-Gm-Message-State: ANhLgQ2exVk2bdb2LEHaWKGGz+sAf8ONpUiaIfulgCKP6WuIBlA9EjZy pyd6AeXon2a8IokAbvl/iOY= X-Received: by 2002:a17:90a:4487:: with SMTP id t7mr4170485pjg.104.1583944371770; Wed, 11 Mar 2020 09:32:51 -0700 (PDT) Received: from localhost ([106.51.232.35]) by smtp.gmail.com with ESMTPSA id q12sm51720409pfh.158.2020.03.11.09.32.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Mar 2020 09:32:50 -0700 (PDT) Date: Wed, 11 Mar 2020 22:02:49 +0530 From: afzal mohammed To: Thomas Bogendoerfer 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: <20200311163249.GA4984@afzalpc> 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> <20200311160307.GA15464@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200311160307.GA15464@alpha.franken.de> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Mar 11, 2020 at 05:03:07PM +0100, Thomas Bogendoerfer wrote: > On Wed, Mar 11, 2020 at 06:42:10PM +0530, afzal mohammed wrote: > > 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. AFAIU, this causes problems only while freeing irq, but not sure. Seems it is not happening with any of the cases in the diff. > > 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. There was one prior similar usage using string pointers, another way i have seen is using irq no. itself, but then it has to be typecasted, in file arch/mips/txx9/generic/pci.c, request_irq(irq, &i8259_interrupt, IRQF_SHARED, "cascade(i8259)", (void *)(long)irq); [ but i think that double casting is not required, only (void *) might suffice ] If you prefer handler function pointer, i will use that. > 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. Okay, i am venturing into MIPS the first time as part of this patch series, so no MIPS specific knowledge, just let me know loongson2ef/lemote-2f case as well, i will prepare patch accordingly. > And v4 is already in mips-next, so I need an incremental patch please. Okay, i already sent a patch, it crossed your mail, i will make a new patch based on the outcome of the discusson here. Since there is some issue w/ lore.kernel.org, i send it again, but both are not seen in archives. Regards afzal