linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org, LKML <linux-kernel@vger.kernel.org>,
	huhb@lemote.com, yanh@lemote.com, Zhang Le <r0bertz@gentoo.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Nicholas Mc Guire <der.herr@hofr.at>,
	zhangfx@lemote.com, liujl@lemote.com
Subject: Re: [PATCH -queue v0 4/6] [loongson] add basic fuloong2f support
Date: Thu, 5 Nov 2009 14:16:03 +0100	[thread overview]
Message-ID: <20091105131603.GA18232@linux-mips.org> (raw)
In-Reply-To: <0f805f7d12c5a7cbcc125ba4a1b70113ec2047a6.1257325319.git.wuzhangjin@gmail.com>

On Wed, Nov 04, 2009 at 05:05:47PM +0800, Wu Zhangjin wrote:

> diff --git a/arch/mips/loongson/fuloong-2f/irq.c b/arch/mips/loongson/fuloong-2f/irq.c
> new file mode 100644
> index 0000000..22c45fd
> --- /dev/null
> +++ b/arch/mips/loongson/fuloong-2f/irq.c
> @@ -0,0 +1,114 @@
> +/*
> + * Copyright (C) 2007 Lemote Inc.
> + * Author: Fuxin Zhang, zhangfx@lemote.com
> + *
> + *  This program is free software; you can redistribute  it and/or modify it
> + *  under  the terms of  the GNU General  Public License as published by the
> + *  Free Software Foundation;  either version 2 of the  License, or (at your
> + *  option) any later version.
> + */
> +
> +#include <linux/interrupt.h>
> +
> +#include <asm/irq_cpu.h>
> +#include <asm/i8259.h>
> +#include <asm/mipsregs.h>
> +
> +#include <loongson.h>
> +#include <machine.h>
> +
> +#define LOONGSON_TIMER_IRQ	(MIPS_CPU_IRQ_BASE + 7)	/* cpu timer */
> +#define LOONGSON_PERFCNT_IRQ	(MIPS_CPU_IRQ_BASE + 6) /* cpu perf counter */
> +#define LOONGSON_NORTH_BRIDGE_IRQ	(MIPS_CPU_IRQ_BASE + 6)	/* bonito */
> +#define LOONGSON_UART_IRQ	(MIPS_CPU_IRQ_BASE + 3)	/* cpu serial port */
> +#define LOONGSON_SOUTH_BRIDGE_IRQ	(MIPS_CPU_IRQ_BASE + 2)	/* i8259 */
> +
> +#define LOONGSON_INT_BIT_INT0		(1 << 11)
> +#define LOONGSON_INT_BIT_INT1		(1 << 12)
> +
> +static int mach_i8259_irq(void)
> +{
> +	int irq, isr, imr;
> +
> +	irq = -1;
> +
> +	if ((LOONGSON_INTISR & LOONGSON_INTEN) & LOONGSON_INT_BIT_INT0) {
> +		imr = inb(0x21) | (inb(0xa1) << 8);
> +		isr = inb(0x20) | (inb(0xa0) << 8);
> +		isr &= ~0x4;	/* irq2 for cascade */
> +		isr &= ~imr;
> +		irq = ffs(isr) - 1;
> +	}

Any reason why you're not using i8259_irq() from <asm/i8259.h> here?
That function not only gets the locking right, it also minimizes the number
of accesses to the i8259 - which even on modern silicon can be stuningly
slow.

> +#if 1
> +	pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &val);
> +	printk(KERN_INFO "cs5536 acc latency 0x%x\n", val);
> +	pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xc0);
> +#endif

Seems like left over debug code?

> +	return;
> +}

And a useless return statement at the end of a void function.

  Ralf

  reply	other threads:[~2009-11-05 13:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1257325319.git.wuzhangjin@gmail.com>
2009-11-04  9:04 ` [PATCH -queue v0 1/6] [loongson] add basic loongson-2f support Wu Zhangjin
2009-11-04 10:28   ` Arnaud Patard
2009-11-04 11:04     ` Wu Zhangjin
2009-11-04 11:19       ` Ralf Baechle
2009-11-04 15:23         ` Wu Zhangjin
2009-11-04 20:15           ` Ralf Baechle
2009-11-05  1:39             ` Wu Zhangjin
2009-11-05  8:45               ` Ralf Baechle
2009-11-04 11:36       ` Arnaud Patard
2009-11-05  9:18   ` Ralf Baechle
2009-11-05  9:48     ` Wu Zhangjin
2009-11-05 10:28       ` Ralf Baechle
2009-11-05 11:00         ` Wu Zhangjin
2009-11-04  9:05 ` [PATCH -queue v0 2/6] [loongson] oprofile: avoid do_IRQ for perfcounter when the interrupt is from bonito Wu Zhangjin
2009-11-04  9:05 ` [PATCH -queue v0 3/6] [loongson] add basic cs5536 vsm support Wu Zhangjin
2009-11-04  9:05 ` [PATCH -queue v0 4/6] [loongson] add basic fuloong2f support Wu Zhangjin
2009-11-05 13:16   ` Ralf Baechle [this message]
2009-11-05 14:44     ` Wu Zhangjin
2009-11-06  5:39     ` Wu Zhangjin
2009-11-06  8:30       ` Ralf Baechle
2009-11-06 10:05         ` Wu Zhangjin
2009-11-06  8:34     ` Wu Zhangjin
2009-11-04  9:06 ` [PATCH -queue v0 5/6] [loongson] rtc: enable legacy RTC driver on fuloong2f Wu Zhangjin
2009-11-04 10:40   ` Arnaud Patard
2009-11-04 11:18     ` Wu Zhangjin
2009-11-04 11:34       ` Arnaud Patard
2009-11-04 14:15       ` Ralf Baechle
2009-11-04 15:12         ` Wu Zhangjin
2009-11-04  9:06 ` [PATCH -queue v0 6/6] [loongson] add default config file for fuloong2f Wu Zhangjin

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=20091105131603.GA18232@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=der.herr@hofr.at \
    --cc=huhb@lemote.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=liujl@lemote.com \
    --cc=r0bertz@gentoo.org \
    --cc=tglx@linutronix.de \
    --cc=wuzhangjin@gmail.com \
    --cc=yanh@lemote.com \
    --cc=zhangfx@lemote.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;
as well as URLs for NNTP newsgroup(s).