aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ptp_clock_kernel.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-04-20 08:13:54 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-04-20 09:55:54 -0400
commit3801a7fd8615365a58960561d3bd3479b485ed3e (patch)
tree771884f7defb550ea91291b109e10cc7da4e006f /include/linux/ptp_clock_kernel.h
parent31b14c9fc596a68a2a982d7e3c136922f81a2e25 (diff)
drm/i915/tv: fix open-coded ARRAY_SIZE.
Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/linux/ptp_clock_kernel.h')
0 files changed, 0 insertions, 0 deletions
mada <shimada-yxb@necst.nec.co.jp> 2009-03-16 04:13:39 -0400 committer Jesse Barnes <jbarnes@virtuousgeek.org> 2009-03-20 13:48:15 -0400 PCI: allow assignment of memory resources with a specified alignment' href='/cgit/cgit.cgi/litmus-rt-pandaboard.git/commit/drivers/pci/quirks.c?id=32a9a682bef2f6fce7026bd94d1ce20028b0e52d'>32a9a682bef
bd8481e1646










1da177e4c3f

1597cacbe39
1da177e4c3f








999da9fd489
1da177e4c3f




652c538eb5b

1da177e4c3f






1da177e4c3f




f0fda801daa
1da177e4c3f





652c538eb5b






1da177e4c3f
1da177e4c3f





f0fda801daa
1da177e4c3f


652c538eb5b

236561e5df0






f0fda801daa
236561e5df0


652c538eb5b
1da177e4c3f






f0fda801daa
1da177e4c3f


652c538eb5b



1da177e4c3f










1597cacbe39
1da177e4c3f

1da177e4c3f





1da177e4c3f

2b1afa87e11
1da177e4c3f




1da177e4c3f
2b1afa87e11
1da177e4c3f





















f0fda801daa
1da177e4c3f


652c538eb5b


1597cacbe39
652c538eb5b


1da177e4c3f






f0fda801daa
1da177e4c3f


652c538eb5b
1da177e4c3f



f0fda801daa
1da177e4c3f


652c538eb5b
1da177e4c3f









f0fda801daa
1da177e4c3f


652c538eb5b

1da177e4c3f







f0fda801daa
1da177e4c3f


652c538eb5b





1da177e4c3f








652c538eb5b
1da177e4c3f













652c538eb5b

1da177e4c3f
6693e74a16e

1da177e4c3f


085ae41f666
1da177e4c3f





085ae41f666





1da177e4c3f
f0fda801daa
1da177e4c3f








f0fda801daa
1da177e4c3f



652c538eb5b
1da177e4c3f
















6693e74a16e
1da177e4c3f
6693e74a16e
1da177e4c3f
652c538eb5b
1da177e4c3f
6693e74a16e






















f0fda801daa
6693e74a16e























f0fda801daa
6693e74a16e

1da177e4c3f


08db2a701bd
6693e74a16e
1da177e4c3f


6693e74a16e
1da177e4c3f

6693e74a16e
1da177e4c3f
08db2a701bd
6693e74a16e




















1da177e4c3f
652c538eb5b

1da177e4c3f










6693e74a16e
1da177e4c3f

6693e74a16e
1da177e4c3f
652c538eb5b









1da177e4c3f
894886e5d3d
2cea752f683








894886e5d3d
























































































2cea752f683
1da177e4c3f





1da177e4c3f

651472fbff7
1da177e4c3f

6693e74a16e
1da177e4c3f

652c538eb5b
1da177e4c3f















02f313b2cc5
1da177e4c3f


02f313b2cc5
1da177e4c3f
652c538eb5b
1da177e4c3f
6d85f29bb54










6693e74a16e
6d85f29bb54


6693e74a16e
6d85f29bb54


1da177e4c3f











1597cacbe39
1da177e4c3f







f0fda801daa
1da177e4c3f




652c538eb5b
e1a2a51e684
1da177e4c3f

a1740913cae




1597cacbe39
a1740913cae





f0fda801daa
a1740913cae



e1a2a51e684
a1740913cae

1da177e4c3f




236561e5df0
1da177e4c3f



44c10138fd4
f0fda801daa

1da177e4c3f

652c538eb5b
1da177e4c3f





652c538eb5b
1da177e4c3f

d556ad4bbe7





aa288d4d6bc
f0fda801daa

d556ad4bbe7



1da177e4c3f

1da177e4c3f

















652c538eb5b

1da177e4c3f
09d6029f43e

1597cacbe39
09d6029f43e
1597cacbe39
c06bb5d49d8






cb7468ef4cc




c06bb5d49d8























09d6029f43e
1597cacbe39






c06bb5d49d8



1597cacbe39


25be5e6ccc5


c06bb5d49d8

09d6029f43e







1597cacbe39
c06bb5d49d8

1597cacbe39




25be5e6ccc5

f0fda801daa

25be5e6ccc5



1597cacbe39
25be5e6ccc5
1da177e4c3f
1da177e4c3f









652c538eb5b
1da177e4c3f






1597cacbe39
1da177e4c3f





e1a2a51e684
1da177e4c3f







1597cacbe39
1da177e4c3f




f0fda801daa
1da177e4c3f





652c538eb5b
e1a2a51e684
1da177e4c3f













652c538eb5b
1da177e4c3f










652c538eb5b

1da177e4c3f






1597cacbe39
1da177e4c3f




f0fda801daa
1da177e4c3f


652c538eb5b

1da177e4c3f

1da177e4c3f



1597cacbe39
1da177e4c3f

1da177e4c3f
44c10138fd4
1da177e4c3f




f0fda801daa
1da177e4c3f

652c538eb5b
e1a2a51e684
1da177e4c3f
05a7d22b9f0
ab17443a3df
e2dd90b1ad4
05a7d22b9f0
ab17443a3df
05a7d22b9f0

ab17443a3df





c9f89475a5b
05a7d22b9f0
ab17443a3df

05a7d22b9f0
e1a2a51e684
05a7d22b9f0
e1a2a51e684
e2dd90b1ad4

ab17443a3df
1da177e4c3f










368c73d4f68
1da177e4c3f

652c538eb5b
1da177e4c3f










f0fda801daa
1da177e4c3f


1da177e4c3f

368c73d4f68
1da177e4c3f
979b1791e5b











7a661c6f108




979b1791e5b
1da177e4c3f






652c538eb5b
1da177e4c3f
7daa0c4f518

1da177e4c3f







d7698edca8d

9208ee8286e






a99acc832de





1da177e4c3f
9d24a81e84c
1da177e4c3f





a00db371624
1da177e4c3f




2f2d39d2843
1da177e4c3f





2f2d39d2843
1da177e4c3f



2f2d39d2843
1da177e4c3f



2f2d39d2843
321311af25c



2f2d39d2843
1da177e4c3f


4096ed0fc7c
1da177e4c3f

2f2d39d2843
1da177e4c3f




2f2d39d2843
2e45785c529



2f2d39d2843
acc06632e38

2d1e1c754d6
acc06632e38

1da177e4c3f






2f2d39d2843
1da177e4c3f

e3b1bd572f1
74c57428971
1da177e4c3f

677cc6443b2




1da177e4c3f





c87f883edbe





d7698edca8d







8293b0f6290
10260d9ab70


6b5096e4d44
8293b0f6290




10260d9ab70

27e46859731







1da177e4c3f

652c538eb5b



677cc6443b2
652c538eb5b






8293b0f6290
27e46859731
d7698edca8d
1597cacbe39
1da177e4c3f










f0fda801daa
1da177e4c3f
f0fda801daa
1da177e4c3f

652c538eb5b






e1a2a51e684






1597cacbe39
e1a2a51e684


acc06632e38
e1a2a51e684
acc06632e38


e1a2a51e684

acc06632e38
e1a2a51e684






















f0fda801daa
acc06632e38
e1a2a51e684






652c538eb5b
e1a2a51e684


ce007ea5972
1da177e4c3f


1597cacbe39
1da177e4c3f

1da177e4c3f
2f5c33b3180
f0fda801daa
2f5c33b3180

1da177e4c3f
652c538eb5b



e1a2a51e684



1da177e4c3f
1da177e4c3f







1da177e4c3f

1597cacbe39
1da177e4c3f











1da177e4c3f
2f5c33b3180


1da177e4c3f

2f5c33b3180
1da177e4c3f
652c538eb5b
e1a2a51e684
1da177e4c3f
1da177e4c3f
e5548e960f3





1597cacbe39
e5548e960f3
















f0fda801daa
e5548e960f3
f0fda801daa
e5548e960f3

652c538eb5b
e1a2a51e684
1597cacbe39
7796705244d
15e0c694367





5ee2ae7fb20
15e0c694367
e34bb370dec
15e0c694367





5ee2ae7fb20

15e0c694367
5ee2ae7fb20

















3a9e3a51dd4
5ee2ae7fb20





15e0c694367
5ee2ae7fb20







e34bb370dec


15e0c694367
5ee2ae7fb20





e1a2a51e684





15e0c694367


1da177e4c3f




















652c538eb5b
1da177e4c3f

1da177e4c3f

0ba379ec0fb

1da177e4c3f
652c538eb5b


1da177e4c3f
4602b88d974






f5f2b13129a
4602b88d974
f0fda801daa
4602b88d974






ffadcc2ff42






























4602b88d974
426b3b8d535

e1d3a90846b






41b9eb264c8
e1d3a90846b


fdcdaf6c4fe

e1d3a90846b
88d1dce3a74















e1d3a90846b

426b3b8d535





















fdcdaf6c4fe

426b3b8d535
88d1dce3a74

77251188155



























fdcdaf6c4fe

77251188155
88d1dce3a74

542622da899










bbe194433ba
542622da899






bbe194433ba

542622da899




fdcdaf6c4fe

542622da899
88d1dce3a74

542622da899











fdcdaf6c4fe

542622da899


fdcdaf6c4fe

542622da899
88d1dce3a74

426b3b8d535

33dced2ea5e

















1da177e4c3f















4c9c16867e4




1da177e4c3f

1da177e4c3f



f0fda801daa
1da177e4c3f









16a74744231

e64aeccbeca
16a74744231

e64aeccbeca
16a74744231




























16a74744231
1bef7dc00ca
16a74744231

e64aeccbeca










1bef7dc00ca

16a74744231
f0fda801daa
16a74744231




f0fda801daa

16a74744231




4e68fc97b17
a5312e28c19
649426efcfb























a5312e28c19






f0fda801daa
a5312e28c19




9d265124d05










f0fda801daa
9d265124d05













15a260d53f7
















f0fda801daa
15a260d53f7






cf34a8e07f0



1597cacbe39
cf34a8e07f0




f0fda801daa

cf34a8e07f0




e1a2a51e684
1597cacbe39
cf34a8e07f0
53a9bf4267b














bc043274560






53a9bf4267b

bc043274560

53a9bf4267b
bc043274560

53a9bf4267b

d6505a5236a
bc043274560
53a9bf4267b




99cb233d60c












9d82d8eaec0
35405f256de

9d82d8eaec0
99cb233d60c
35405f256de
99cb233d60c
9d82d8eaec0
99cb233d60c






bffadffd43d

















99cb233d60c
26c56dc0c4f





















3f79e107f72
ebdf7d399e6




3f79e107f72
ebdf7d399e6
3f79e107f72
88187dfa4d8
f0fda801daa
3f79e107f72
ebdf7d399e6


66d715c95a3
184b812f7da
162dedd39dc
3f79e107f72




f0fda801daa

3f79e107f72



6397c75cbc4




7a380507c48








f0fda801daa
7a380507c48
f0fda801daa
7a380507c48
6397c75cbc4
7a380507c48


6397c75cbc4







f0fda801daa

6397c75cbc4




6bae1d96c6d
6397c75cbc4












11f242f04c6
9ac0ce8596b

0c875c28649
f0fda801daa

6397c75cbc4

11f242f04c6
6397c75cbc4


ba698ad4b7e
415b6d0e894

9dc625e7230

















415b6d0e894


9dc625e7230
e0ae4f55032


75e07fc3d87















de7453065d5


























































eeafda70bf2


























1dec6b054dd
9dc625e7230

1dec6b054dd




















eeafda70bf2


de7453065d5

1dec6b054dd



















6a958d5b28e
1dec6b054dd








de7453065d5
1dec6b054dd










9dc625e7230














1dec6b054dd

de7453065d5



1dec6b054dd
9dc625e7230


1dec6b054dd


9dc625e7230
1dec6b054dd

9dc625e7230
de7453065d5











6dab62ee5a3
de7453065d5

6dab62ee5a3
9dc625e7230
ba698ad4b7e



4600c9d74e2
















ba698ad4b7e


















bc38b411fe6
4600c9d74e2
bc38b411fe6
4600c9d74e2
bc38b411fe6
4600c9d74e2
bc38b411fe6
4600c9d74e2
bc38b411fe6
4600c9d74e2
bc38b411fe6







3f79e107f72
3d137310245
7eb93b175d4












































dcb4ea2ea2b

6f1186be4fe
7eb93b175d4


bfb0f330a6c

3d137310245


bfb0f330a6c
c9bbb4abb65
3d137310245







































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578








                                                                            


                                                               




                                                                       




                         
                       
                           
                      
                           
                         
                
 



                                    

                        
  

                                                                                

                                                                     
                 





                                                                   
                    










                                                                      




                                                                               

































                                                                               










                                                                                                         

                                                                         
                                                      








                                                                                             
                                                                               




                                                            

                                                                                                       






                                                                                




                                                              
                                                                             





                                                                        






                                                                                                     
 





                                                         
                                                                            


                                                

                                                                                                






                                                         
                                                                                             


                                                
                                                                                                






                                                             
                                                                           


                                                  



                                                                                              










                                                                                   
                                                 

                          





                                                                              

                                                                                 
                                                             




                                                                                    
                                                    
                                                             





















                                                                               
                                                                     


                       


                                                                                                  
                                            


                                                                                                  






                                                        
                                                                           


                                                   
                                                                                               



                                                     
                                                                           


                                                
                                                                                            









                                                                    
                                                                           


                                                                  

                                                                                                







                                                                        
                                                                           


                                                  





                                                                                              








                                                                         
                                                                                               













                                                                              

                                                                                              
 

                                                                           


                            
                                                 





                                                          





                                                               
                                            
                                                                                                                








                                                                  
                                                                                     



                                                                      
                                                                                                    
















                                                             
                                                                               
                                                 
                                                                                
 
                                                                                                    
 






















                                                                                                         
                                                                                  























                                                                                                          
                                                                                   

 


                                                        
                                        
                                                         


                                                           
                          

                                                  
                                                                             
                                                  
                                                                              




















                                                                      
 

                                                                                                  










                                                                               
                                                                                      

                                                  
                                                                              
 









                                                                                                             
 
                                                             








                                                                                      
























































































                                                                                                               
 





                                                              

                   
                                   

                                                          
                                                                                         

         
                                                                                                     















                                                                  
                                                                                   


                                               
                                                                                
 
                                                                                                     
 










                                                               
                                                                         


                                              
                                                                              


                                                                                           











                                                                    
                                                 







                                                                              
                                                                  




                                                           
                                                                                                  
                                                                                                          

  




                                                                          
                                                                      





                                                        
                                                                                   



                                                                                                                       
                                                                                                                               

  




                                                                          
                                                                               



                                                                  
                                    

                                                                                                                   

         
                                                                                                  





                                                        
                                                                                                  

                               





                                                                       
                                                        

                                                                  



                                                                                                

  

















                                                                

                                                                                                
 

  
                                    
   
 






                                                                




                                                                           























                                                                                                  
 






                                                                       



                                                                         


                                                


                        

                                           







                                                                 
                               

                                                                               




                                                                        

                                                            

                                                                           



                                                                        
                                                                         
 
  









                                                               
                                                                                                   






                                                                    
                                                     





                                                                      
                                                                             







                                                                      
                                                   




                                                
                                                                                                           





                                                                   
                                                                                                    
                                                                                                            













                                                                   
                                                                                              










                                                                   

                                                                                                          






                                                                     
                                                     




                                              
                                                                                                              


                                                      

                                                                                                      

  



                                                                         
                                                   

                   
        
                                                                           




                                                          
                                                                                       

         
                                                                                                   
                                                                                                           
 
                                                              
 
                                                     
               
 

                                                           





                                                         
                                                          
                                                                

         
                                                                                               
                                                                                                     
                                                                                               
                                                                                                     

                                                                                                        
 










                                                                  
                                                       

         
                                                                                                           










                                                                         
                                                                                 


                                                                  

         
                                                                                                 
 











                                                                                




                                                                        
 






                                                                        
                                                                                                   
 

  







                                                                           

                                                                        






                                                                          





                                                                          
   
                            





                                                                       
                                                 




                                                       
                                                                      





                                                       
                                                                     



                                                       
                                                                   



                                                        
                                                                      



                                                        
                                                                       


                                                        
                                                       

                                                     
                                                                       




                                                        
                                                                     



                                                        
                                                                       

                                                        
                                                        

                                                     






                                                                         
                                                                     

                                                        
                                                  
                                                           

                                                     




                                                                     





                                                                             





                                                                             







                                                                                     
                                                                      


                                                              
                                                               




                                                                           

                                                     







                                                                              

         



                                                                                                             
                                                                                                             






                                                                                                             
                                                                                                             
                                                                                                             
 
                                                     










                                                               
                                                                                                                
                    
                                                                           

         






                                                                                                      






                                                                                                              
 


                                                                        
 
                 


                                      

                                
                                                






















                                                                                        
                                                                
 






                                                          
                                                                                                           


                                                                                                                                
 


                                                             
                                                    

                   
                                              
                         
                                                                

                                                              
 



                                                                                                     



                                                                                                             
 







                                                                     

                                
                                              











                                                                        
          


                                                                      

                            
                                 
 
                                                                                               
                                                                                                       
 
 





                                                                        
                                                    
















                                                                     
                                                                                                                       
                    
                                                                                   

         
                                                                                             
                                                                                                     
 
                                                     





                                                                       
                                                   
 
                                





                                  

                                                  
 

















                                                                           
                                                                                   





                                                                          
         







                                                          


                                                                
 





                                                                                                





                                                                                                       


      




















                                                                         
                                                                                                    

      

                                                          

                          
 


                                                                                                
 






                                                              
                         
                        
                                                                              






                                                                                                






























                                                                             
 

                         






                                                                             
                                             


                                                             

                                                                     
 















                                                                                                                        

  





















                                                                            

                                                                               
 

                                                                                                                    



























                                                                             

                                                                               
 

                                                                                                                                       










                                                                            
                                            






                                                                      

                                             




                                                                     

                                                                               
 

                                                                                                                       











                                                                              

                                                                            


                                                                

                                                                               
 

                                                                                                                       

                               

















                                                                        















                                                                          




                                                                                

                                       



                                                                          
                                                                        









                                                                             

                                                               
                           

                        
               




























                                                                    
 
                                                                           

                       










                                                                       

                                                      
                   
                                                                  




                                

                                                                             




                                   
                                                                               
 























                                                                               






                                                                       
                                                                                      




                                                                                         










                                                                    
                                                                             













                                                                                   
















                                                                                 
                                                                                                            






                                                                                            



                                                                          
                                                                    




                                                                    

                                                                    




                                                                               
                                                                                      
                                                             
 














                                                                              






                                                                     

                                                              

                                                                        
                                                              

                                                       

                                                              
                                           
                                                                     




                                                                                        












                                                                      
          

                                                                 
           
                                                      
                                                       
                                                      
                                                       






                                                       

















                                                   
 





















                                                                          
                     




                                                                     
   
                                                             
 
                     
                                                                  
 


                                                                                                             
                                                                                            
                                                                                            
                                                                                            




                                                              

                                                          



                                                                                             




                                                            








                                                                  
                                                                        
                                                             
                                                        
                                                                  
                 


                                                                          







                                                                                

                                                          




                                                                                         
 












                                                                               
                                         

                       
                                                                    

                                                          

                                                                    
                          


                                                                              
 

                                                                

















                                                                           


                                                              
 


                                                                          















                                                                               


























































                                                                          


























                                                                        
                                                                   

                                    




















                                                                            


                                                                         

                         



















                                                                  
                                                                          








                                                                            
                                                                         










                                                                    














                                                                            

                                                                 



                                                              
                 


                       


                                   
 

                                                                             
 











                                                                                    
                                                                                           

                                                                               
                                                                                      
 



                                                                     
















                                                                            


















                                                    
                                                  
                                                        
                                                  
                                                        
                                                  
                                                        
                                                  
                                                        
                                                  
                                                        







                                                    
                           
 












































                                                                                

                                                                          
                                                                          


                            

                                                                   


                                                                                  
                                                                                  
                                                                     







































































                                                                              
/*
 *  This file contains work-arounds for many known PCI hardware
 *  bugs.  Devices present only on certain architectures (host
 *  bridges et cetera) should be handled in arch-specific code.
 *
 *  Note: any quirks for hotpluggable devices must _NOT_ be declared __init.
 *
 *  Copyright (c) 1999 Martin Mares <mj@ucw.cz>
 *
 *  Init/reset quirks for USB host controllers should be in the
 *  USB quirks file, where their drivers can access reuse it.
 *
 *  The bridge optimization stuff has been removed. If you really
 *  have a silly BIOS which is unable to set your host bridge right,
 *  use the PowerTweak utility (see http://powertweak.sourceforge.net).
 */

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/acpi.h>
#include <linux/kallsyms.h>
#include <linux/dmi.h>
#include <linux/pci-aspm.h>
#include <linux/ioport.h>
#include "pci.h"

int isa_dma_bridge_buggy;
EXPORT_SYMBOL(isa_dma_bridge_buggy);
int pci_pci_problems;
EXPORT_SYMBOL(pci_pci_problems);

#ifdef CONFIG_PCI_QUIRKS
/*
 * This quirk function disables memory decoding and releases memory resources
 * of the device specified by kernel's boot parameter 'pci=resource_alignment='.
 * It also rounds up size to specified alignment.
 * Later on, the kernel will assign page-aligned memory resource back
 * to the device.
 */
static void __devinit quirk_resource_alignment(struct pci_dev *dev)
{
	int i;
	struct resource *r;
	resource_size_t align, size;
	u16 command;

	if (!pci_is_reassigndev(dev))
		return;

	if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
	    (dev->class >> 8) == PCI_CLASS_BRIDGE_HOST) {
		dev_warn(&dev->dev,
			"Can't reassign resources to host bridge.\n");
		return;
	}

	dev_info(&dev->dev,
		"Disabling memory decoding and releasing memory resources.\n");
	pci_read_config_word(dev, PCI_COMMAND, &command);
	command &= ~PCI_COMMAND_MEMORY;
	pci_write_config_word(dev, PCI_COMMAND, command);

	align = pci_specified_resource_alignment(dev);
	for (i=0; i < PCI_BRIDGE_RESOURCES; i++) {
		r = &dev->resource[i];
		if (!(r->flags & IORESOURCE_MEM))
			continue;
		size = resource_size(r);
		if (size < align) {
			size = align;
			dev_info(&dev->dev,
				"Rounding up size of resource #%d to %#llx.\n",
				i, (unsigned long long)size);
		}
		r->end = size - 1;
		r->start = 0;
	}
	/* Need to disable bridge's resource window,
	 * to enable the kernel to reassign new resource
	 * window later on.
	 */
	if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
	    (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
		for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) {
			r = &dev->resource[i];
			if (!(r->flags & IORESOURCE_MEM))
				continue;
			r->end = resource_size(r) - 1;
			r->start = 0;
		}
		pci_disable_bridge_window(dev);
	}
}
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, quirk_resource_alignment);

/* The Mellanox Tavor device gives false positive parity errors
 * Mark this device with a broken_parity_status, to allow
 * PCI scanning code to "skip" this now blacklisted device.
 */
static void __devinit quirk_mellanox_tavor(struct pci_dev *dev)
{
	dev->broken_parity_status = 1;	/* This device gives false positives */
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR,quirk_mellanox_tavor);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE,quirk_mellanox_tavor);

/* Deal with broken BIOS'es that neglect to enable passive release,
   which can cause problems in combination with the 82441FX/PPro MTRRs */
static void quirk_passive_release(struct pci_dev *dev)
{
	struct pci_dev *d = NULL;
	unsigned char dlc;

	/* We have to make sure a particular bit is set in the PIIX3
	   ISA bridge, so we have to go out and find it. */
	while ((d = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, d))) {
		pci_read_config_byte(d, 0x82, &dlc);
		if (!(dlc & 1<<1)) {
			dev_info(&d->dev, "PIIX3: Enabling Passive Release\n");
			dlc |= 1<<1;
			pci_write_config_byte(d, 0x82, dlc);
		}
	}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82441,	quirk_passive_release);
DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82441,	quirk_passive_release);

/*  The VIA VP2/VP3/MVP3 seem to have some 'features'. There may be a workaround
    but VIA don't answer queries. If you happen to have good contacts at VIA
    ask them for me please -- Alan 
    
    This appears to be BIOS not version dependent. So presumably there is a 
    chipset level fix */
    
static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev)
{
	if (!isa_dma_bridge_buggy) {
		isa_dma_bridge_buggy=1;
		dev_info(&dev->dev, "Activating ISA DMA hang workarounds\n");
	}
}
	/*
	 * Its not totally clear which chipsets are the problematic ones
	 * We know 82C586 and 82C596 variants are affected.
	 */
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C586_0,	quirk_isa_dma_hangs);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C596,	quirk_isa_dma_hangs);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82371SB_0,  quirk_isa_dma_hangs);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL,	PCI_DEVICE_ID_AL_M1533, 	quirk_isa_dma_hangs);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC,	PCI_DEVICE_ID_NEC_CBUS_1,	quirk_isa_dma_hangs);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC,	PCI_DEVICE_ID_NEC_CBUS_2,	quirk_isa_dma_hangs);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC,	PCI_DEVICE_ID_NEC_CBUS_3,	quirk_isa_dma_hangs);

/*
 *	Chipsets where PCI->PCI transfers vanish or hang
 */
static void __devinit quirk_nopcipci(struct pci_dev *dev)
{
	if ((pci_pci_problems & PCIPCI_FAIL)==0) {
		dev_info(&dev->dev, "Disabling direct PCI/PCI transfers\n");
		pci_pci_problems |= PCIPCI_FAIL;
	}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_5597,		quirk_nopcipci);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_496,		quirk_nopcipci);

static void __devinit quirk_nopciamd(struct pci_dev *dev)
{
	u8 rev;
	pci_read_config_byte(dev, 0x08, &rev);
	if (rev == 0x13) {
		/* Erratum 24 */
		dev_info(&dev->dev, "Chipset erratum: Disabling direct PCI/AGP transfers\n");
		pci_pci_problems |= PCIAGP_FAIL;
	}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,	PCI_DEVICE_ID_AMD_8151_0,	quirk_nopciamd);

/*
 *	Triton requires workarounds to be used by the drivers
 */
static void __devinit quirk_triton(struct pci_dev *dev)
{
	if ((pci_pci_problems&PCIPCI_TRITON)==0) {
		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
		pci_pci_problems |= PCIPCI_TRITON;
	}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82437, 	quirk_triton);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82437VX, 	quirk_triton);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82439, 	quirk_triton);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82439TX, 	quirk_triton);

/*
 *	VIA Apollo KT133 needs PCI latency patch
 *	Made according to a windows driver based patch by George E. Breese
 *	see PCI Latency Adjust on http://www.viahardware.com/download/viatweak.shtm
 *      Also see http://www.au-ja.org/review-kt133a-1-en.phtml for
 *      the info on which Mr Breese based his work.
 *
 *	Updated based on further information from the site and also on
 *	information provided by VIA 
 */
static void quirk_vialatency(struct pci_dev *dev)
{
	struct pci_dev *p;
	u8 busarb;
	/* Ok we have a potential problem chipset here. Now see if we have
	   a buggy southbridge */
	   
	p = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, NULL);
	if (p!=NULL) {
		/* 0x40 - 0x4f == 686B, 0x10 - 0x2f == 686A; thanks Dan Hollis */
		/* Check for buggy part revisions */
		if (p->revision < 0x40 || p->revision > 0x42)
			goto exit;
	} else {
		p = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
		if (p==NULL)	/* No problem parts */
			goto exit;
		/* Check for buggy part revisions */
		if (p->revision < 0x10 || p->revision > 0x12)
			goto exit;
	}
	
	/*
	 *	Ok we have the problem. Now set the PCI master grant to 
	 *	occur every master grant. The apparent bug is that under high
	 *	PCI load (quite common in Linux of course) you can get data
	 *	loss when the CPU is held off the bus for 3 bus master requests
	 *	This happens to include the IDE controllers....
	 *
	 *	VIA only apply this fix when an SB Live! is present but under
	 *	both Linux and Windows this isnt enough, and we have seen
	 *	corruption without SB Live! but with things like 3 UDMA IDE
	 *	controllers. So we ignore that bit of the VIA recommendation..
	 */

	pci_read_config_byte(dev, 0x76, &busarb);
	/* Set bit 4 and bi 5 of byte 76 to 0x01 
	   "Master priority rotation on every PCI master grant */
	busarb &= ~(1<<5);
	busarb |= (1<<4);
	pci_write_config_byte(dev, 0x76, busarb);
	dev_info(&dev->dev, "Applying VIA southbridge workaround\n");
exit:
	pci_dev_put(p);
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8363_0,	quirk_vialatency);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8371_1,	quirk_vialatency);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8361,		quirk_vialatency);
/* Must restore this on a resume from RAM */
DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8363_0,	quirk_vialatency);
DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8371_1,	quirk_vialatency);
DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8361,		quirk_vialatency);

/*
 *	VIA Apollo VP3 needs ETBF on BT848/878
 */
static void __devinit quirk_viaetbf(struct pci_dev *dev)
{
	if ((pci_pci_problems&PCIPCI_VIAETBF)==0) {
		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
		pci_pci_problems |= PCIPCI_VIAETBF;
	}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C597_0,	quirk_viaetbf);

static void __devinit quirk_vsfx(struct pci_dev *dev)
{
	if ((pci_pci_problems&PCIPCI_VSFX)==0) {
		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
		pci_pci_problems |= PCIPCI_VSFX;
	}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C576,	quirk_vsfx);

/*
 *	Ali Magik requires workarounds to be used by the drivers
 *	that DMA to AGP space. Latency must be set to 0xA and triton
 *	workaround applied too
 *	[Info kindly provided by ALi]
 */	
static void __init quirk_alimagik(struct pci_dev *dev)
{
	if ((pci_pci_problems&PCIPCI_ALIMAGIK)==0) {
		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
		pci_pci_problems |= PCIPCI_ALIMAGIK|PCIPCI_TRITON;
	}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 	PCI_DEVICE_ID_AL_M1647, 	quirk_alimagik);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 	PCI_DEVICE_ID_AL_M1651, 	quirk_alimagik);

/*
 *	Natoma has some interesting boundary conditions with Zoran stuff
 *	at least
 */
static void __devinit quirk_natoma(struct pci_dev *dev)
{
	if ((pci_pci_problems&PCIPCI_NATOMA)==0) {
		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
		pci_pci_problems |= PCIPCI_NATOMA;
	}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82441, 	quirk_natoma);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82443LX_0, 	quirk_natoma);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82443LX_1, 	quirk_natoma);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82443BX_0, 	quirk_natoma);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82443BX_1, 	quirk_natoma);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82443BX_2, 	quirk_natoma);

/*
 *  This chip can cause PCI parity errors if config register 0xA0 is read
 *  while DMAs are occurring.
 */
static void __devinit quirk_citrine(struct pci_dev *dev)
{
	dev->cfg_size = 0xA0;
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,	PCI_DEVICE_ID_IBM_CITRINE,	quirk_citrine);

/*
 *  S3 868 and 968 chips report region size equal to 32M, but they decode 64M.
 *  If it's needed, re-allocate the region.
 */
static void __devinit quirk_s3_64M(struct pci_dev *dev)
{
	struct resource *r = &dev->resource[0];

	if ((r->start & 0x3ffffff) || r->end != r->start + 0x3ffffff) {
		r->start = 0;
		r->end = 0x3ffffff;
	}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3,	PCI_DEVICE_ID_S3_868,		quirk_s3_64M);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3,	PCI_DEVICE_ID_S3_968,		quirk_s3_64M);

static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region,
	unsigned size, int nr, const char *name)
{
	region &= ~(size-1);
	if (region) {
		struct pci_bus_region bus_region;
		struct resource *res = dev->resource + nr;

		res->name = pci_name(dev);
		res->start = region;
		res->end = region + size - 1;
		res->flags = IORESOURCE_IO;

		/* Convert from PCI bus to resource space.  */
		bus_region.start = res->start;
		bus_region.end = res->end;
		pcibios_bus_to_resource(dev, res, &bus_region);

		pci_claim_resource(dev, nr);
		dev_info(&dev->dev, "quirk: region %04x-%04x claimed by %s\n", region, region + size - 1, name);
	}
}	

/*
 *	ATI Northbridge setups MCE the processor if you even
 *	read somewhere between 0x3b0->0x3bb or read 0x3d3
 */
static void __devinit quirk_ati_exploding_mce(struct pci_dev *dev)
{
	dev_info(&dev->dev, "ATI Northbridge, reserving I/O ports 0x3b0 to 0x3bb\n");
	/* Mae rhaid i ni beidio ag edrych ar y lleoliadiau I/O hyn */
	request_region(0x3b0, 0x0C, "RadeonIGP");
	request_region(0x3d3, 0x01, "RadeonIGP");
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI,	PCI_DEVICE_ID_ATI_RS100,   quirk_ati_exploding_mce);

/*
 * Let's make the southbridge information explicit instead
 * of having to worry about people probing the ACPI areas,
 * for example.. (Yes, it happens, and if you read the wrong
 * ACPI register it will put the machine to sleep with no
 * way of waking it up again. Bummer).
 *
 * ALI M7101: Two IO regions pointed to by words at
 *	0xE0 (64 bytes of ACPI registers)
 *	0xE2 (32 bytes of SMB registers)
 */
static void __devinit quirk_ali7101_acpi(struct pci_dev *dev)
{
	u16 region;

	pci_read_config_word(dev, 0xE0, &region);
	quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES, "ali7101 ACPI");
	pci_read_config_word(dev, 0xE2, &region);
	quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1, "ali7101 SMB");
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL,	PCI_DEVICE_ID_AL_M7101,		quirk_ali7101_acpi);

static void piix4_io_quirk(struct pci_dev *dev, const char *name, unsigned int port, unsigned int enable)
{
	u32 devres;
	u32 mask, size, base;

	pci_read_config_dword(dev, port, &devres);
	if ((devres & enable) != enable)
		return;
	mask = (devres >> 16) & 15;
	base = devres & 0xffff;
	size = 16;
	for (;;) {
		unsigned bit = size >> 1;
		if ((bit & mask) == bit)
			break;
		size = bit;
	}
	/*
	 * For now we only print it out. Eventually we'll want to
	 * reserve it (at least if it's in the 0x1000+ range), but
	 * let's get enough confirmation reports first. 
	 */
	base &= -size;
	dev_info(&dev->dev, "%s PIO at %04x-%04x\n", name, base, base + size - 1);
}

static void piix4_mem_quirk(struct pci_dev *dev, const char *name, unsigned int port, unsigned int enable)
{
	u32 devres;
	u32 mask, size, base;

	pci_read_config_dword(dev, port, &devres);
	if ((devres & enable) != enable)
		return;
	base = devres & 0xffff0000;
	mask = (devres & 0x3f) << 16;
	size = 128 << 16;
	for (;;) {
		unsigned bit = size >> 1;
		if ((bit & mask) == bit)
			break;
		size = bit;
	}
	/*
	 * For now we only print it out. Eventually we'll want to
	 * reserve it, but let's get enough confirmation reports first. 
	 */
	base &= -size;
	dev_info(&dev->dev, "%s MMIO at %04x-%04x\n", name, base, base + size - 1);
}

/*
 * PIIX4 ACPI: Two IO regions pointed to by longwords at
 *	0x40 (64 bytes of ACPI registers)
 *	0x90 (16 bytes of SMB registers)
 * and a few strange programmable PIIX4 device resources.
 */
static void __devinit quirk_piix4_acpi(struct pci_dev *dev)
{
	u32 region, res_a;

	pci_read_config_dword(dev, 0x40, &region);
	quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES, "PIIX4 ACPI");
	pci_read_config_dword(dev, 0x90, &region);
	quirk_io_region(dev, region, 16, PCI_BRIDGE_RESOURCES+1, "PIIX4 SMB");

	/* Device resource A has enables for some of the other ones */
	pci_read_config_dword(dev, 0x5c, &res_a);

	piix4_io_quirk(dev, "PIIX4 devres B", 0x60, 3 << 21);
	piix4_io_quirk(dev, "PIIX4 devres C", 0x64, 3 << 21);

	/* Device resource D is just bitfields for static resources */

	/* Device 12 enabled? */
	if (res_a & (1 << 29)) {
		piix4_io_quirk(dev, "PIIX4 devres E", 0x68, 1 << 20);
		piix4_mem_quirk(dev, "PIIX4 devres F", 0x6c, 1 << 7);
	}
	/* Device 13 enabled? */
	if (res_a & (1 << 30)) {
		piix4_io_quirk(dev, "PIIX4 devres G", 0x70, 1 << 20);
		piix4_mem_quirk(dev, "PIIX4 devres H", 0x74, 1 << 7);
	}
	piix4_io_quirk(dev, "PIIX4 devres I", 0x78, 1 << 20);
	piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20);
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82371AB_3,	quirk_piix4_acpi);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82443MX_3,	quirk_piix4_acpi);

/*
 * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
 *	0x40 (128 bytes of ACPI, GPIO & TCO registers)
 *	0x58 (64 bytes of GPIO I/O space)
 */
static void __devinit quirk_ich4_lpc_acpi(struct pci_dev *dev)