@@ -299,59 +299,6 @@ static acpi_status iort_match_node_callback(struct acpi_iort_node *node,
299
299
return status ;
300
300
}
301
301
302
- struct iort_workaround_oem_info {
303
- char oem_id [ACPI_OEM_ID_SIZE + 1 ];
304
- char oem_table_id [ACPI_OEM_TABLE_ID_SIZE + 1 ];
305
- u32 oem_revision ;
306
- };
307
-
308
- static bool apply_id_count_workaround ;
309
-
310
- static struct iort_workaround_oem_info wa_info [] __initdata = {
311
- {
312
- .oem_id = "HISI " ,
313
- .oem_table_id = "HIP07 " ,
314
- .oem_revision = 0 ,
315
- }, {
316
- .oem_id = "HISI " ,
317
- .oem_table_id = "HIP08 " ,
318
- .oem_revision = 0 ,
319
- }
320
- };
321
-
322
- static void __init
323
- iort_check_id_count_workaround (struct acpi_table_header * tbl )
324
- {
325
- int i ;
326
-
327
- for (i = 0 ; i < ARRAY_SIZE (wa_info ); i ++ ) {
328
- if (!memcmp (wa_info [i ].oem_id , tbl -> oem_id , ACPI_OEM_ID_SIZE ) &&
329
- !memcmp (wa_info [i ].oem_table_id , tbl -> oem_table_id , ACPI_OEM_TABLE_ID_SIZE ) &&
330
- wa_info [i ].oem_revision == tbl -> oem_revision ) {
331
- apply_id_count_workaround = true;
332
- pr_warn (FW_BUG "ID count for ID mapping entry is wrong, applying workaround\n" );
333
- break ;
334
- }
335
- }
336
- }
337
-
338
- static inline u32 iort_get_map_max (struct acpi_iort_id_mapping * map )
339
- {
340
- u32 map_max = map -> input_base + map -> id_count ;
341
-
342
- /*
343
- * The IORT specification revision D (Section 3, table 4, page 9) says
344
- * Number of IDs = The number of IDs in the range minus one, but the
345
- * IORT code ignored the "minus one", and some firmware did that too,
346
- * so apply a workaround here to keep compatible with both the spec
347
- * compliant and non-spec compliant firmwares.
348
- */
349
- if (apply_id_count_workaround )
350
- map_max -- ;
351
-
352
- return map_max ;
353
- }
354
-
355
302
static int iort_id_map (struct acpi_iort_id_mapping * map , u8 type , u32 rid_in ,
356
303
u32 * rid_out )
357
304
{
@@ -368,7 +315,8 @@ static int iort_id_map(struct acpi_iort_id_mapping *map, u8 type, u32 rid_in,
368
315
return - ENXIO ;
369
316
}
370
317
371
- if (rid_in < map -> input_base || rid_in > iort_get_map_max (map ))
318
+ if (rid_in < map -> input_base ||
319
+ (rid_in >= map -> input_base + map -> id_count ))
372
320
return - ENXIO ;
373
321
374
322
* rid_out = map -> output_base + (rid_in - map -> input_base );
@@ -1700,6 +1648,5 @@ void __init acpi_iort_init(void)
1700
1648
return ;
1701
1649
}
1702
1650
1703
- iort_check_id_count_workaround (iort_table );
1704
1651
iort_init_platform_devices ();
1705
1652
}
0 commit comments