mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zwane Mwaikambo <zwane@linuxpower.ca>
To: long <tlnguyen@snoqualmie.dp.intel.com>
Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
	davidm@napali.hpl.hp.com, grep@kroah.com, jgarzik@pobox.com,
	jun.nakajima@intel.com, tom.l.nguyen@intel.com,
	tony.luck@intel.com
Subject: Re: RE[PATCH]2.6.4-rc3 MSI Support for IA64
Date: Fri, 12 Mar 2004 18:26:39 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0403121743310.29087@montezuma.fsmlabs.com> (raw)
In-Reply-To: <200403130008.i2D08SMQ011709@snoqualmie.dp.intel.com>

On Fri, 12 Mar 2004, long wrote:

> Thanks for all inputs received from the previous patch posted a few
> weeks ago. Based on Zwane Mwaikambo's suggestion of using a
> standard name like assign_irq_vector(), we made some changes to
> the previous posted patch. Attached is an update version, based on
> kernel 2.6.4-rc3.

Thanks for doing this, i have a few comments;

> diff -urN linux-2.6.4-rc3/arch/ia64/kernel/irq_ia64.c linux-2.6.4-rc3-msi/arch/ia64/kernel/irq_ia64.c
> --- linux-2.6.4-rc3/arch/ia64/kernel/irq_ia64.c	2004-03-09 19:00:26.000000000 -0500
> +++ linux-2.6.4-rc3-msi/arch/ia64/kernel/irq_ia64.c	2004-03-11 14:52:57.000000000 -0500
> @@ -60,12 +60,18 @@
>  int
>  ia64_alloc_vector (void)
>  {
> +#ifdef CONFIG_PCI_USE_VECTOR
> +	extern int assign_irq_vector(int irq);
> +
> +	return assign_irq_vector(AUTO_ASSIGN);
> +#else
>  	static int next_vector = IA64_FIRST_DEVICE_VECTOR;
>
>  	if (next_vector > IA64_LAST_DEVICE_VECTOR)
>  		/* XXX could look for sharable vectors instead of panic'ing... */
>  		panic("ia64_alloc_vector: out of interrupt vectors!");
>  	return next_vector++;
> +#endif
>  }

This one is slightly confusing readability wise since ia64 already does
the vector based interrupt numbering. Perhaps CONFIG_PCI_USE_VECTOR should
really be CONFIG_MSI but that's up to you. I wonder if we could
consolidate these vector allocators as assign_irq_vector(AUTO_ASSIGN) has
the same semantics as ia64_alloc_vector() and the one for i386 is also
almost the same as its MSI ilk.

> +static inline int vector_resources(void)
> +{
> + 	int res;
> +#ifndef CONFIG_IA64
> + 	int i, repeat;
> + 	for (i = NR_REPEATS; i > 0; i--) {
> + 		if ((FIRST_DEVICE_VECTOR + i * 8) > FIRST_SYSTEM_VECTOR)
> + 			continue;
> + 		break;
> + 	}
> + 	i++;
> + 	repeat = (FIRST_SYSTEM_VECTOR - FIRST_DEVICE_VECTOR)/i;
> + 	res = i * repeat - NR_RESERVED_VECTORS + 1;
>  #else
> -extern void restore_ioapic_irq_handler(int irq);
> + 	res = LAST_DEVICE_VECTOR - FIRST_DEVICE_VECTOR - 1;
>  #endif
> +
> + 	return res;
> +}

Is this supposed to return number of vectors available for external
devices? Also regarding vector allocation, assign_irq_vector() in
drivers/pci/msi.c only can allocate 166 vectors before going -ENOSPC is
this intentional?

Thanks,
	Zwane

  reply	other threads:[~2004-03-12 23:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-13  0:08 long
2004-03-12 23:26 ` Zwane Mwaikambo [this message]
2004-03-12 23:34   ` David Mosberger
2004-03-12 23:47   ` Bjorn Helgaas
2004-03-13  0:14 Nguyen, Tom L
2004-03-13  0:22 Nguyen, Tom L
2004-03-13  1:44 Nakajima, Jun

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=Pine.LNX.4.58.0403121743310.29087@montezuma.fsmlabs.com \
    --to=zwane@linuxpower.ca \
    --cc=davidm@napali.hpl.hp.com \
    --cc=grep@kroah.com \
    --cc=jgarzik@pobox.com \
    --cc=jun.nakajima@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tlnguyen@snoqualmie.dp.intel.com \
    --cc=tom.l.nguyen@intel.com \
    --cc=tony.luck@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®