11// SPDX-License-Identifier: GPL-2.0
2-
3- #define pr_fmt (fmt ) "i8259: " fmt
4-
52#include <linux/linkage.h>
63#include <linux/errno.h>
74#include <linux/signal.h>
1916#include <linux/io.h>
2017#include <linux/delay.h>
2118#include <linux/pgtable.h>
22- #include <linux/dmi.h>
2319
2420#include <linux/atomic.h>
2521#include <asm/timer.h>
@@ -302,39 +298,11 @@ static void unmask_8259A(void)
302298 raw_spin_unlock_irqrestore (& i8259A_lock , flags );
303299}
304300
305- /*
306- * DMI table to identify devices with quirky probe behavior. See comment in
307- * probe_8259A() for more details.
308- */
309- static const struct dmi_system_id retry_probe_quirk_table [] = {
310- {
311- .ident = "Microsoft Surface Laptop 4 (AMD)" ,
312- .matches = {
313- DMI_MATCH (DMI_SYS_VENDOR , "Microsoft Corporation" ),
314- DMI_MATCH (DMI_PRODUCT_SKU , "Surface_Laptop_4_1952:1953" )
315- },
316- },
317- {}
318- };
319-
320301static int probe_8259A (void )
321302{
322303 unsigned long flags ;
323304 unsigned char probe_val = ~(1 << PIC_CASCADE_IR );
324305 unsigned char new_val ;
325- unsigned int i , imax = 1 ;
326-
327- /*
328- * Some systems have a legacy PIC that doesn't immediately respond
329- * after boot. We know it's there, we know it should respond and is
330- * required for proper interrupt handling later on, so let's try a
331- * couple of times.
332- */
333- if (dmi_check_system (retry_probe_quirk_table )) {
334- pr_warn ("system with broken legacy PIC detected, re-trying multiple times if necessary\n" );
335- imax = 10 ;
336- }
337-
338306 /*
339307 * Check to see if we have a PIC.
340308 * Mask all except the cascade and read
@@ -344,24 +312,15 @@ static int probe_8259A(void)
344312 */
345313 raw_spin_lock_irqsave (& i8259A_lock , flags );
346314
347- for (i = 0 ; i < imax ; i ++ ) {
348- outb (0xff , PIC_SLAVE_IMR ); /* mask all of 8259A-2 */
349- outb (probe_val , PIC_MASTER_IMR );
350- new_val = inb (PIC_MASTER_IMR );
351- if (new_val == probe_val )
352- break ;
353- }
354-
355- if (i == imax ) {
356- pr_info ("using NULL legacy PIC\n" );
315+ outb (0xff , PIC_SLAVE_IMR ); /* mask all of 8259A-2 */
316+ outb (probe_val , PIC_MASTER_IMR );
317+ new_val = inb (PIC_MASTER_IMR );
318+ if (new_val != probe_val ) {
319+ printk (KERN_INFO "Using NULL legacy PIC\n" );
357320 legacy_pic = & null_legacy_pic ;
358321 }
359322
360323 raw_spin_unlock_irqrestore (& i8259A_lock , flags );
361-
362- if (imax > 1 && i < imax )
363- pr_info ("got legacy PIC after %d tries\n" , i + 1 );
364-
365324 return nr_legacy_irqs ();
366325}
367326
0 commit comments