Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbbH2SOp (ORCPT ); Sat, 29 Aug 2015 14:14:45 -0400 Received: from shadow-play.misterjones.org ([91.121.53.221]:44707 "EHLO shadow-play.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751356AbbH2SOo (ORCPT ); Sat, 29 Aug 2015 14:14:44 -0400 To: Jiang Liu , Yang Yingliang Subject: Re: [PATCH] arm64: fix a migrating irq bug when hotplug cpu X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 29 Aug 2015 19:12:40 +0100 From: Marc Zyngier Cc: , Mark Rutland , Thomas Gleixner , Will Deacon , Organization: ARM Ltd In-Reply-To: <55E1CBE9.6080705@linux.intel.com> References: <55E1AD09.7020701@huawei.com> <55E1CBE9.6080705@linux.intel.com> Message-ID: <66e158e6da958d355d54543ef69e5e94@www.loen.fr> User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: jiang.liu@linux.intel.com, yangyingliang@huawei.com, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, tglx@linutronix.de, will.deacon@arm.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: marc.zyngier@arm.com X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1561 Lines: 38 On 2015-08-29 16:12, Jiang Liu wrote: > On 2015/8/29 21:00, Yang Yingliang wrote: >> From: Yang Yingliang >> >> When cpu is disabled, all irqs will be migratged to another cpu. >> In some cases, a new affinity is different, it needed to be coppied >> to irq's affinity. But if the type of irq is LPI, it's affinity will >> not be coppied because of irq_set_affinity's return value. >> So copy the affinity, when the return value is IRQ_SET_MASK_OK_DONE. > Hi Yingliang, > If irq_set_affinity callback returns IRQ_SET_MASK_OK_DONE, > it means that irq_set_affinity has copied the new CPU mask to irq > affinity mask. It would be better to change irq_set_affinity for LPI > to follow this rule. The main issue here seems to be that we do not call irq_set_affinity, but that we directly call into the top-level irqchip method, which relies on the core code to do the copy (see irq_do_set_affinity). Too bad. It feels like the arm/arm64 code would probably be better consolidated into kernel/irq/migration.c, which already deals with some of this for x86 and ia64. It would save us the duplication and will make sure we don't miss things next time we add a new return code, as irq_do_set_affinity would handle this properly. Thoughts? M. -- Fast, cheap, reliable. Pick two. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/