From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbcGORDO (ORCPT ); Fri, 15 Jul 2016 13:03:14 -0400 Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:59027 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751592AbcGORDK (ORCPT ); Fri, 15 Jul 2016 13:03:10 -0400 Date: Fri, 15 Jul 2016 13:02:59 -0400 From: Rich Felker To: Jason Cooper Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, Marc Zyngier , Thomas Gleixner Subject: Re: [PATCH v3 08/12] irqchip: add J-Core AIC driver Message-ID: <20160715170259.GT15995@brightrain.aerifal.cx> References: <05a5be0a4f1471272dcdd2259e4d97642ee43759.1464148904.git.dalias@libc.org> <20160715161917.GG31509@io.lakedaemon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160715161917.GG31509@io.lakedaemon.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 15, 2016 at 04:19:17PM +0000, Jason Cooper wrote: > > + u32 cpu_offset; > > + struct irq_chip chip; > > + struct irq_domain *domain; > > + struct notifier_block nb; > > +} aic_data; > > + > > +static int aic_irqdomain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hwirq) > > +{ > > + struct aic_data *aic = d->host_data; > > + > > + irq_set_chip_data(irq, aic); > > + irq_set_chip_and_handler(irq, &aic->chip, handle_simple_irq); > > + irq_set_probe(irq); > > + > > + return 0; > > +} > > + > > +static const struct irq_domain_ops aic_irqdomain_ops = { > > + .map = aic_irqdomain_map, > > + .xlate = irq_domain_xlate_onecell, > > +}; > > + > > +static void noop(struct irq_data *data) > > +{ > > +} > > + > > +static void aic1_localenable(struct aic_data *aic) > > +{ > > + unsigned cpu = smp_processor_id(); > > + pr_info("Local AIC enable on cpu %u\n", cpu); > > + writel(0xffffffff, aic->base + cpu * aic->cpu_offset + AIC1_INTPRI); > > +} > > + > > +static int aic1_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) > > +{ > > + switch (action & ~CPU_TASKS_FROZEN) { > > + case CPU_STARTING: > > + aic1_localenable(container_of(self, struct aic_data, nb)); > > + break; > > + } > > + return NOTIFY_OK; > > +} > > Please take a look at the series posted by Anna-Maria Gleixner for > recent changes to the cpu hp state machine. > > https://lkml.kernel.org/r/20160713153333.416260485@linutronix.de I saw this but was utterly confused about what's going on. Is the general notifier system that doesn't need to be aware of specific devices actually being replaced by a huge enum table of all possible devices that need special treatment as cpu starting/dying?? Or do I misunderstand what's going on? Rich