From: Olaf Dabrunz <od@suse.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Olaf Dabrunz <od@suse.de>, Ingo Molnar <mingo@elte.hu>,
"H. Peter Anvin" <hpa@zytor.com>,
Jon Masters <jonathan@jonmasters.org>,
LKML <linux-kernel@vger.kernel.org>,
Stefan Assmann <sassmann@suse.de>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Ihno Krumreich <ihno@suse.de>, Sven Dietrich <sdietrich@suse.de>,
Daniel Gollub <dgollub@suse.de>,
Felix Foerster <ffoerster@suse.de>
Subject: Re: [PATCH 5/7] disable AMD/ATI legacy boot interrupt generation
Date: Thu, 12 Jun 2008 16:14:25 +0200 [thread overview]
Message-ID: <20080612141425.GD6811@suse.de> (raw)
In-Reply-To: <alpine.LFD.1.10.0806031246180.3235@apollo.tec.linutronix.de>
On 03-Jun-08, Thomas Gleixner wrote:
> On Mon, 2 Jun 2008, Olaf Dabrunz wrote:
> >
> > /*
> > + * disable boot interrupts on AMD and ATI chipsets
> > + */
> > +#define PCI_X_MISC 0x40
> > +#define PCI_X_AMD813X_NIOAMODE (1<<0)
>
> new line before the function and consistent spacing
>
> > +static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev)
> > +{
> > + u32 pci_x_misc;
> > +
> > + if (nobootirqquirk)
> > + return;
> > +
> > + pci_read_config_dword(dev, PCI_X_MISC, &pci_x_misc);
> > + pci_x_misc &= ~PCI_X_AMD813X_NIOAMODE;
> > + pci_write_config_dword(dev, PCI_X_MISC, pci_x_misc);
> > +
> > + printk(KERN_INFO "disabled boot interrupts on PCI device "
> > + "0x%04x:0x%04x\n", dev->vendor, dev->device);
> > +}
> > +#undef PCI_X_MISC
> > +#undef PCI_X_AMD813X_NIOAMODE
>
> why #undef ?
To prevent spilling of constants to other code... Probably unneeded...
> > +
> > +#define PCI_AMD8111_PCI_IRQ_ROUTING 0x56
> > +static void quirk_disable_amd_8111_boot_interrupt(struct pci_dev *dev)
> > +{
> > + u16 pci_irq_routing;
> > +
> > + if (nobootirqquirk)
> > + return;
> > +
> > + pci_read_config_word(dev, PCI_AMD8111_PCI_IRQ_ROUTING,
> > + &pci_irq_routing);
> > + if (!pci_irq_routing) {
> > + printk(KERN_INFO "boot interrupts on PCI "
> > + "device 0x%04x:0x%04x were "
> > + "already disabled\n",
> > + dev->vendor, dev->device);
> > + return;
> > + }
> > + pci_write_config_word(dev, PCI_AMD8111_PCI_IRQ_ROUTING, 0);
> > + printk(KERN_INFO "disabled boot interrupts on PCI device "
> > + "0x%04x:0x%04x\n", dev->vendor, dev->device);
> > +}
> > +#undef PCI_AMD8111_PCI_IRQ_ROUTING
> > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS, quirk_disable_amd_8111_boot_interrupt);
> > +
> > +#define PCI_AMD_SB700S_FEATURES_ENABLE 0x64
> > +#define PCI_AMD_SB700S_PIC_ENABLE (1<<0)
> > +#define PIC_PCI_INTR_INDEX 0xC00
> > +#define PIC_PCI_INTR_DATA 0xC01
> > +#define CLEAR_PIC_IRQ_ROUTING(irq) \
> > + outb(irq, PIC_PCI_INTR_INDEX); \
> > + outb(0x00, PIC_PCI_INTR_DATA);
>
> Please use an inline function
>
> > +static void quirk_disable_amd_sb700s_boot_interrupt(struct pci_dev *dev)
> > +{
> > + u32 feature_enable;
> > + u32 saved_feature_enable;
> > +
> > + if (nobootirqquirk)
> > + return;
> > +
> > + pci_read_config_dword(dev, PCI_AMD_SB700S_FEATURES_ENABLE,
> > + &feature_enable);
> > + saved_feature_enable = feature_enable;
> > + feature_enable |= PCI_AMD_SB700S_PIC_ENABLE;
> > + pci_write_config_dword(dev, PCI_AMD_SB700S_FEATURES_ENABLE,
> > + feature_enable);
> > +
> > + CLEAR_PIC_IRQ_ROUTING(0x0);
> > + CLEAR_PIC_IRQ_ROUTING(0x1);
> > + CLEAR_PIC_IRQ_ROUTING(0x2);
> > + CLEAR_PIC_IRQ_ROUTING(0x3);
> > + CLEAR_PIC_IRQ_ROUTING(0x4);
> > + CLEAR_PIC_IRQ_ROUTING(0x9);
> > + CLEAR_PIC_IRQ_ROUTING(0xA);
> > + CLEAR_PIC_IRQ_ROUTING(0xB);
> > + CLEAR_PIC_IRQ_ROUTING(0xC);
>
> int i, irqs[] = {0x0,.....0x0c};
>
> for (i = 0; i < ARRAY_SIZE(irqs); i++) {
> outb(...);
> outb(...);
> }
>
> perhaps ?
Yep :)
> > +
> > + pci_write_config_dword(dev, PCI_AMD_SB700S_FEATURES_ENABLE,
> > + saved_feature_enable);
> > +
> > + printk(KERN_INFO "disabled boot interrupts on PCI device "
> > + "0x%04x:0x%04x\n", dev->vendor, dev->device);
> > +}
> > +#undef PCI_AMD_SB700S_FEATURES_ENABLE
> > +#undef PCI_AMD_SB700S_PIC_ENABLE
> > +#undef PIC_PCI_INTR_INDEX
> > +#undef PIC_PCI_INTR_DATA
> > +#undef CLEAR_PIC_IRQ_ROUTING
>
> grmbl
murmur... :)
> > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SMBUS, quirk_disable_amd_sb700s_boot_interrupt);
> > +
> > +/*
> > * disabled boot interrupts on HT-1000
> > */
> > static void quirk_disable_broadcom_boot_interrupt(struct pci_dev *dev)
> > --
> > 1.5.2.4
> >
> > --
> > Olaf Dabrunz (od/odabrunz), SUSE Linux Products GmbH, N??rnberg
> >
--
Olaf Dabrunz (od/odabrunz), SUSE Linux Products GmbH, Nürnberg
next prev parent reply other threads:[~2008-06-12 14:14 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-02 12:45 [PATCH 0/7] Boot IRQ quirks and rerouting Olaf Dabrunz
2008-06-02 12:45 ` [PATCH 1/7] add kernel cmdline option to disable pci-irq quirks Olaf Dabrunz
2008-06-03 10:13 ` Thomas Gleixner
2008-06-03 17:00 ` Stefan Assmann
2008-06-02 12:45 ` [PATCH 2/7] reroute PCI interrupt to legacy boot interrupt equivalent Olaf Dabrunz
2008-06-03 10:37 ` Thomas Gleixner
2008-06-03 22:59 ` Randy Dunlap
2008-06-12 14:14 ` Olaf Dabrunz
2008-06-02 12:45 ` [PATCH 3/7] disable legacy boot interrupt generation Olaf Dabrunz
2008-06-03 10:40 ` Thomas Gleixner
2008-06-02 12:45 ` [PATCH 4/7] disable broadcomm " Olaf Dabrunz
2008-06-03 10:46 ` Thomas Gleixner
2008-06-03 15:46 ` Jon Masters
2008-06-03 15:59 ` Olaf Dabrunz
2008-06-03 16:05 ` Jon Masters
2008-06-03 17:27 ` Olaf Dabrunz
2008-06-02 12:45 ` [PATCH 5/7] disable AMD/ATI " Olaf Dabrunz
2008-06-03 10:54 ` Thomas Gleixner
2008-06-12 14:14 ` Olaf Dabrunz [this message]
2008-06-02 12:45 ` [PATCH 6/7] disable pci legacy boot irq quirks on noapic boot Olaf Dabrunz
2008-06-03 10:55 ` Thomas Gleixner
2008-06-02 12:45 ` [PATCH 7/7] bootirqquirk= parameter to enable bootirq quirks for additional chips Olaf Dabrunz
2008-06-03 10:56 ` Thomas Gleixner
2008-06-04 10:06 ` Olaf Dabrunz
2008-06-02 16:43 ` [PATCH 0/7] Boot IRQ quirks and rerouting Olaf Dabrunz
2008-06-03 10:11 ` Thomas Gleixner
2008-06-03 17:08 ` Olaf Dabrunz
2008-06-03 10:21 ` Olaf Dabrunz
2008-06-03 15:52 ` Jon Masters
2008-06-03 16:17 ` Stefan Assmann
2008-06-03 16:56 ` Olaf Dabrunz
2008-06-04 2:35 ` Eric W. Biederman
2008-06-04 9:49 ` Stefan Assmann
2008-06-04 10:45 ` Eric W. Biederman
2008-06-04 11:33 ` Stefan Assmann
2008-06-04 15:52 ` Maciej W. Rozycki
2008-06-04 16:08 ` Thomas Gleixner
2008-06-04 17:18 ` Maciej W. Rozycki
2008-06-04 17:33 ` Thomas Gleixner
2008-06-04 17:53 ` Maciej W. Rozycki
2008-06-04 18:35 ` Thomas Gleixner
2008-06-04 18:51 ` Maciej W. Rozycki
2010-02-16 0:30 ` Yuhong Bao
2008-06-04 18:57 ` Jon Masters
2008-06-04 19:19 ` Maciej W. Rozycki
2008-06-04 19:59 ` Jon Masters
2008-06-04 22:07 ` Maciej W. Rozycki
2008-06-04 22:27 ` Jon Masters
2008-06-04 23:08 ` Maciej W. Rozycki
2008-06-04 11:37 ` Olaf Dabrunz
2008-06-04 18:44 ` Jon Masters
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=20080612141425.GD6811@suse.de \
--to=od@suse.de \
--cc=dgollub@suse.de \
--cc=ebiederm@xmission.com \
--cc=ffoerster@suse.de \
--cc=hpa@zytor.com \
--cc=ihno@suse.de \
--cc=jbarnes@virtuousgeek.org \
--cc=jonathan@jonmasters.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=sassmann@suse.de \
--cc=sdietrich@suse.de \
--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