Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752410AbdHIHgZ (ORCPT ); Wed, 9 Aug 2017 03:36:25 -0400 Received: from gate.crashing.org ([63.228.1.57]:34573 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbdHIHgY (ORCPT ); Wed, 9 Aug 2017 03:36:24 -0400 Message-ID: <1502264039.2563.38.camel@kernel.crashing.org> Subject: Re: [PATCH] powerpc: xive: ensure active irqd when setting affinity From: Benjamin Herrenschmidt To: Michael Ellerman , Sukadev Bhattiprolu Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 09 Aug 2017 17:33:59 +1000 In-Reply-To: <87a839nu5z.fsf@concordia.ellerman.id.au> References: <20170803013822.GD28905@us.ibm.com> <87zibamjfi.fsf@concordia.ellerman.id.au> <20170809000034.GB17162@us.ibm.com> <87a839nu5z.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.4 (3.24.4-1.fc26) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1027 Lines: 26 On Wed, 2017-08-09 at 16:15 +1000, Michael Ellerman wrote: > I'm not sure I'm convinced. We can't handle every possible case of the > higher level code calling us in situations we don't expect. > > For example irq_data could be NULL, but we trust the higher level code > not to do that to us. > > Also I don't see any other driver doing this check. > > $ git grep irqd_is_started > include/linux/irq.h:static inline bool irqd_is_started(struct irq_data *d) > kernel/irq/chip.c: if (irqd_is_started(d)) { > kernel/irq/chip.c: if (irqd_is_started(&desc->irq_data)) { > kernel/irq/cpuhotplug.c: if (irqd_is_per_cpu(d) || !irqd_is_started(d) || !irq_needs_fixup(d)) { irqd_is_started is brand new so you won't find any :-) For most cases the problem is a non-issue. Due to how xive works, it's more of a problem for us because a non-started interrupt has no targetting information at all. So this is *somewhat* related to xive internal and I'd rather have that sanity check in there. Cheers, Ben.