From: "H. Peter Anvin" <hpa@zytor.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
x86@kernel.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com,
tglx@linutronix.de, JBeulich@suse.com
Subject: Re: [PATCH V1 1/1] X86: Probe for PIC and set legacy_pic appropriately
Date: Fri, 11 Apr 2014 16:59:23 -0700 [thread overview]
Message-ID: <534881DB.40901@zytor.com> (raw)
In-Reply-To: <1397263802-5934-1-git-send-email-kys@microsoft.com>
On 04/11/2014 05:50 PM, K. Y. Srinivasan wrote:
>
> + /*
> + * Check to see if we have a PIC.
> + * Mask all except the cascade and read
> + * back the value we just wrote. If we don't
> + * have a PIC, we will read 0xff as opposed to the
> + * value we wrote.
> + */
> + outb(probe_val, PIC_MASTER_IMR);
> + probe_val = inb(PIC_MASTER_IMR);
> + if (probe_val == 0xff) {
> + printk(KERN_INFO "Using NULL legacy PIC\n");
> + legacy_pic = &null_legacy_pic;
> + raw_spin_unlock_irqrestore(&i8259A_lock, flags);
> + return;
> + }
> +
> outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
> outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */
>
Again, I would do at least the slave masking above the probe.
Also, I would compare to make sure we get the probe_val back and compare
with != instead of comparing with ==.
-hpa
next prev parent reply other threads:[~2014-04-11 23:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-12 0:50 [PATCH V1 1/1] X86: Probe for PIC and set legacy_pic appropriately K. Y. Srinivasan
2014-04-11 23:59 ` H. Peter Anvin [this message]
2014-04-12 2:46 ` KY Srinivasan
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=534881DB.40901@zytor.com \
--to=hpa@zytor.com \
--cc=JBeulich@suse.com \
--cc=apw@canonical.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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