All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qais Yousef <qais.yousef@imgtec.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: <linux-kernel@vger.kernel.org>, <jason@lakedaemon.net>,
	<marc.zyngier@arm.com>, <jiang.liu@linux.intel.com>,
	<ralf@linux-mips.org>, <linux-mips@linux-mips.org>
Subject: Re: [RFC v2 PATCH 07/14] irq: add a new generic IPI reservation code to irq core
Date: Tue, 13 Oct 2015 15:38:49 +0100	[thread overview]
Message-ID: <561D1779.7060307@imgtec.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1510131531290.25029@nanos>

On 10/13/2015 02:37 PM, Thomas Gleixner wrote:
> On Tue, 13 Oct 2015, Qais Yousef wrote:
>
>> +	if (domain == NULL)
>> +		domain = irq_default_domain; /* need a separate ipi_default_domain? */
> No tail comments please.
>
> We should neither use irq_default_domain nor have an
> ipi_default_domain.

OK though I understood that you were OK with using the irq_default_domain.

This means that arch code must parse the DT for an IPI domain. I think 
I've seen arch code using the root FDT to search for a specific node. 
I'll try to do something similar to search for an IPI domain.

>> +
>> +	virq = irq_domain_alloc_descs(-1, nr_irqs, 0, NUMA_NO_NODE);
>> +	if (virq <= 0) {
>> +		pr_warn("Can't reserve IPI, failed to alloc descs\n");
>> +		return 0;
>> +	}
>> +
>> +	/* we are reusing hierarchy alloc function, should we create another one? */
>> +	virq = __irq_domain_alloc_irqs(domain, virq, nr_irqs, NUMA_NO_NODE,
>> +					(void *) dest, true);
>> +	if (virq <= 0) {
>> +		pr_warn("Can't reserve IPI, failed to alloc irqs\n");
>> +		goto free_descs;
>> +	}
>> +
>> +	data = irq_get_irq_data(virq);
>> +	bitmap_copy(data->ipi_mask.cpumask, dest->cpumask, dest->nbits);
>> +	data->ipi_mask.nbits = dest->nbits;
> This does only initialize the first virq data. What about the others?

Right I missed that. I'll fix it.


>
>> +	return virq;
>> +
>> +free_descs:
>> +	irq_free_descs(virq, nr_irqs);
>> +	return 0;
>> +}
>> +
>> +/**
>> + * irq_destroy_ipi() - unreserve an IPI that was previously allocated
>> + * @irq: linux irq number to be destroyed
>> + *
>> + * Return an IPI allocated with irq_reserve_ipi() to the system.
> That wants to explain that it actually destroys a number of virqs not
> just the primary one.
>
>

OK I'll expand on that.

Thanks,
Qais

WARNING: multiple messages have this Message-ID (diff)
From: Qais Yousef <qais.yousef@imgtec.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, jason@lakedaemon.net,
	marc.zyngier@arm.com, jiang.liu@linux.intel.com,
	ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: [RFC v2 PATCH 07/14] irq: add a new generic IPI reservation code to irq core
Date: Tue, 13 Oct 2015 15:38:49 +0100	[thread overview]
Message-ID: <561D1779.7060307@imgtec.com> (raw)
Message-ID: <20151013143849.wHWzrZGQgPIF_6Ezql6wQQ9FtUZ5PHSIGczZm-mMAMw@z> (raw)
In-Reply-To: <alpine.DEB.2.11.1510131531290.25029@nanos>

On 10/13/2015 02:37 PM, Thomas Gleixner wrote:
> On Tue, 13 Oct 2015, Qais Yousef wrote:
>
>> +	if (domain == NULL)
>> +		domain = irq_default_domain; /* need a separate ipi_default_domain? */
> No tail comments please.
>
> We should neither use irq_default_domain nor have an
> ipi_default_domain.

OK though I understood that you were OK with using the irq_default_domain.

This means that arch code must parse the DT for an IPI domain. I think 
I've seen arch code using the root FDT to search for a specific node. 
I'll try to do something similar to search for an IPI domain.

>> +
>> +	virq = irq_domain_alloc_descs(-1, nr_irqs, 0, NUMA_NO_NODE);
>> +	if (virq <= 0) {
>> +		pr_warn("Can't reserve IPI, failed to alloc descs\n");
>> +		return 0;
>> +	}
>> +
>> +	/* we are reusing hierarchy alloc function, should we create another one? */
>> +	virq = __irq_domain_alloc_irqs(domain, virq, nr_irqs, NUMA_NO_NODE,
>> +					(void *) dest, true);
>> +	if (virq <= 0) {
>> +		pr_warn("Can't reserve IPI, failed to alloc irqs\n");
>> +		goto free_descs;
>> +	}
>> +
>> +	data = irq_get_irq_data(virq);
>> +	bitmap_copy(data->ipi_mask.cpumask, dest->cpumask, dest->nbits);
>> +	data->ipi_mask.nbits = dest->nbits;
> This does only initialize the first virq data. What about the others?

Right I missed that. I'll fix it.


>
>> +	return virq;
>> +
>> +free_descs:
>> +	irq_free_descs(virq, nr_irqs);
>> +	return 0;
>> +}
>> +
>> +/**
>> + * irq_destroy_ipi() - unreserve an IPI that was previously allocated
>> + * @irq: linux irq number to be destroyed
>> + *
>> + * Return an IPI allocated with irq_reserve_ipi() to the system.
> That wants to explain that it actually destroys a number of virqs not
> just the primary one.
>
>

OK I'll expand on that.

Thanks,
Qais

  reply	other threads:[~2015-10-13 14:38 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13 10:16 [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Qais Yousef
2015-10-13 10:16 ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 01/14] irq: add new IRQ_DOMAIN_FLAGS_IPI Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 02/14] irq: add GENERIC_IRQ_IPI Kconfig symbol Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 03/14] irq: add new struct ipi_mask Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 13:26   ` Thomas Gleixner
2015-10-13 14:26     ` Qais Yousef
2015-10-13 14:26       ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 04/14] irq: add a new irq_send_ipi() to irq_chip Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 05/14] irq: add struct ipi_mask to irq_data Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 12:36   ` kbuild test robot
2015-10-13 12:36     ` kbuild test robot
2015-10-14 14:50   ` Davidlohr Bueso
2015-10-14 15:46     ` Qais Yousef
2015-10-14 15:46       ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 06/14] irq: add struct ipi_mapping and its helper functions Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 13:31   ` Thomas Gleixner
2015-10-13 14:30     ` Qais Yousef
2015-10-13 14:30       ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 07/14] irq: add a new generic IPI reservation code to irq core Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 10:56   ` kbuild test robot
2015-10-13 10:56     ` kbuild test robot
2015-10-13 10:56   ` kbuild test robot
2015-10-13 10:56     ` kbuild test robot
2015-10-13 13:37   ` Thomas Gleixner
2015-10-13 14:38     ` Qais Yousef [this message]
2015-10-13 14:38       ` Qais Yousef
2015-10-28 15:46       ` Qais Yousef
2015-10-28 15:46         ` Qais Yousef
2015-10-29 10:39         ` Qais Yousef
2015-10-29 10:39           ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 08/14] irq: implement irq_send_ipi Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 11:12   ` kbuild test robot
2015-10-13 11:12     ` kbuild test robot
2015-10-13 11:29   ` kbuild test robot
2015-10-13 11:29     ` kbuild test robot
2015-10-13 13:40   ` Thomas Gleixner
2015-10-13 14:41     ` Qais Yousef
2015-10-13 14:41       ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 09/14] MIPS: add support for generic SMP IPI support Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 13:48   ` Thomas Gleixner
2015-10-13 14:43     ` Qais Yousef
2015-10-13 14:43       ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 10/14] MIPS: make smp CMP, CPS and MT use the new generic IPI functions Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 13:49   ` Thomas Gleixner
2015-10-13 14:46     ` Qais Yousef
2015-10-13 14:46       ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 11/14] MIPS: delete smp-gic.c Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 12/14] irqchip: mips-gic: add a IPI hierarchy domain Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 13/14] irqchip: mips-gic: implement the new irq_send_ipi Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 10:16 ` [RFC v2 PATCH 14/14] irqchip: mips-gic: remove IPI init code Qais Yousef
2015-10-13 10:16   ` Qais Yousef
2015-10-13 13:53 ` [RFC v2 PATCH 00/14] Implement generic IPI support mechanism Thomas Gleixner
2015-10-13 14:48   ` Qais Yousef
2015-10-13 14:48     ` Qais Yousef
2015-10-13 17:24   ` Sergei Shtylyov
2015-10-13 17:27     ` Thomas Gleixner
2015-10-14 15:04 ` Davidlohr Bueso
2015-10-14 15:49   ` Qais Yousef
2015-10-14 15:49     ` Qais Yousef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561D1779.7060307@imgtec.com \
    --to=qais.yousef@imgtec.com \
    --cc=jason@lakedaemon.net \
    --cc=jiang.liu@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=marc.zyngier@arm.com \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.