mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>
Cc: "Cyrill Gorcunov" <gorcunov@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: io-apic - get rid of __DO_ACTION macro
Date: Wed, 10 Sep 2008 10:30:39 -0700	[thread overview]
Message-ID: <86802c440809101030q758d2f92v470727c88654d91d@mail.gmail.com> (raw)
In-Reply-To: <20080910093105.GA5259@elte.hu>

On Wed, Sep 10, 2008 at 2:31 AM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>
>> On Tue, Sep 9, 2008 at 11:02 PM, Cyrill Gorcunov <gorcunov@gmail.com> wrote:
>> > On Wed, Sep 10, 2008 at 12:13 AM, Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>> > ...
>> >>
>> >> hope we can keep using MACRO..
>> >>
>> >> YH
>> >>
>> >
>> > Btw, Yinghai, what does it mean? To not touch this macro at all?
>> > Or you mean about implementation issue (ie the design itself)?
>>
>> do not touch this macro... and may revisit after 2.6.28
>
> anything you are particularly worried about? Regressions we should be
> able to find pretty quickly, in a central macro like that - and the
> macro is quite ugly.
>

ok, let remove unneeded "if", and use function pointer...

void (*extra_action_t)(struct irq_pin_list *entry);

+static inline void io_apic_modify_irq(unsigned int irq,
+                               int mask_and, int mask_or,
+                               int mask_and_not, extra_action_t action)
+{
+       int pin;
+       struct irq_cfg *cfg;
+       struct irq_pin_list *entry;
+       cfg = irq_cfg(irq);
+       for (entry = cfg->irq_2_pin; entry != NULL; entry = entry->next) {
+               unsigned int reg;
+               pin = entry->pin;
+               reg = io_apic_read(entry->apic, 0x10 + pin * 2);
+               reg &= mask_and;
+               reg |= mask_or;
+               reg &= ~mask_and_not;
+               io_apic_modify(entry->apic, 0x10 + pin * 2, reg);
+               if (action)
+                       action(entry);
+       }
+}

+void extra_read(struct irq_pin_list *entry)
+             {
+                       /*
+                        * Synchronize the IO-APIC and the CPU by doing
+                        * a dummy read from the IO-APIC
+                        */
+                       struct io_apic __iomem *io_apic;
+                       io_apic = io_apic_base(entry->apic);
+                       readl(&io_apic->data);
+               }


YH

  parent reply	other threads:[~2008-09-10 17:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09 18:46 Cyrill Gorcunov
2008-09-09 20:13 ` Yinghai Lu
2008-09-09 20:28   ` Cyrill Gorcunov
2008-09-10  6:02   ` Cyrill Gorcunov
2008-09-10  6:22     ` Yinghai Lu
2008-09-10  8:40       ` Cyrill Gorcunov
2008-09-10  9:31       ` Ingo Molnar
2008-09-10 10:53         ` Cyrill Gorcunov
2008-09-10 17:30         ` Yinghai Lu [this message]
2008-09-10 17:44           ` Cyrill Gorcunov
2008-09-10 18:19           ` Cyrill Gorcunov
2008-09-10 18:40             ` Yinghai Lu
2008-09-11  7:08               ` Ingo Molnar

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=86802c440809101030q758d2f92v470727c88654d91d@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=mingo@elte.hu \
    --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 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®