File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 9
9
#define dev_fmt (fmt ) "DPC: " fmt
10
10
11
11
#include <linux/aer.h>
12
+ #include <linux/bitfield.h>
12
13
#include <linux/delay.h>
13
14
#include <linux/interrupt.h>
14
15
#include <linux/init.h>
@@ -202,7 +203,7 @@ static void dpc_process_rp_pio_error(struct pci_dev *pdev)
202
203
203
204
/* Get First Error Pointer */
204
205
pci_read_config_word (pdev , cap + PCI_EXP_DPC_STATUS , & dpc_status );
205
- first_error = ( dpc_status & 0x1f00 ) >> 8 ;
206
+ first_error = FIELD_GET ( PCI_EXP_DPC_RP_PIO_FEP , dpc_status ) ;
206
207
207
208
for (i = 0 ; i < ARRAY_SIZE (rp_pio_error_string ); i ++ ) {
208
209
if ((status & ~mask ) & (1 << i ))
@@ -338,7 +339,7 @@ void pci_dpc_init(struct pci_dev *pdev)
338
339
/* Quirks may set dpc_rp_log_size if device or firmware is buggy */
339
340
if (!pdev -> dpc_rp_log_size ) {
340
341
pdev -> dpc_rp_log_size =
341
- ( cap & PCI_EXP_DPC_RP_PIO_LOG_SIZE ) >> 8 ;
342
+ FIELD_GET ( PCI_EXP_DPC_RP_PIO_LOG_SIZE , cap ) ;
342
343
if (pdev -> dpc_rp_log_size < 4 || pdev -> dpc_rp_log_size > 9 ) {
343
344
pci_err (pdev , "RP PIO log size %u is invalid\n" ,
344
345
pdev -> dpc_rp_log_size );
Original file line number Diff line number Diff line change @@ -6154,7 +6154,7 @@ static void dpc_log_size(struct pci_dev *dev)
6154
6154
if (!(val & PCI_EXP_DPC_CAP_RP_EXT ))
6155
6155
return ;
6156
6156
6157
- if (!(( val & PCI_EXP_DPC_RP_PIO_LOG_SIZE ) >> 8 ) ) {
6157
+ if (FIELD_GET ( PCI_EXP_DPC_RP_PIO_LOG_SIZE , val ) == 0 ) {
6158
6158
pci_info (dev , "Overriding RP PIO Log Size to 4\n" );
6159
6159
dev -> dpc_rp_log_size = 4 ;
6160
6160
}
Original file line number Diff line number Diff line change 1047
1047
#define PCI_EXP_DPC_STATUS_INTERRUPT 0x0008 /* Interrupt Status */
1048
1048
#define PCI_EXP_DPC_RP_BUSY 0x0010 /* Root Port Busy */
1049
1049
#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT 0x0060 /* Trig Reason Extension */
1050
+ #define PCI_EXP_DPC_RP_PIO_FEP 0x1f00 /* RP PIO First Err Ptr */
1050
1051
1051
1052
#define PCI_EXP_DPC_SOURCE_ID 0x0A /* DPC Source Identifier */
1052
1053
You can’t perform that action at this time.
0 commit comments