File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -314,11 +314,13 @@ static void spi_statistics_add_transfer_stats(struct spi_statistics *pcpu_stats,
314
314
struct spi_controller * ctlr )
315
315
{
316
316
int l2len = min (fls (xfer -> len ), SPI_STATISTICS_HISTO_SIZE ) - 1 ;
317
- struct spi_statistics * stats = this_cpu_ptr ( pcpu_stats ) ;
317
+ struct spi_statistics * stats ;
318
318
319
319
if (l2len < 0 )
320
320
l2len = 0 ;
321
321
322
+ get_cpu ();
323
+ stats = this_cpu_ptr (pcpu_stats );
322
324
u64_stats_update_begin (& stats -> syncp );
323
325
324
326
u64_stats_inc (& stats -> transfers );
@@ -333,6 +335,7 @@ static void spi_statistics_add_transfer_stats(struct spi_statistics *pcpu_stats,
333
335
u64_stats_add (& stats -> bytes_rx , xfer -> len );
334
336
335
337
u64_stats_update_end (& stats -> syncp );
338
+ put_cpu ();
336
339
}
337
340
338
341
/*
Original file line number Diff line number Diff line change @@ -83,18 +83,24 @@ struct spi_statistics {
83
83
84
84
#define SPI_STATISTICS_ADD_TO_FIELD (pcpu_stats , field , count ) \
85
85
do { \
86
- struct spi_statistics *__lstats = this_cpu_ptr(pcpu_stats); \
86
+ struct spi_statistics *__lstats; \
87
+ get_cpu(); \
88
+ __lstats = this_cpu_ptr(pcpu_stats); \
87
89
u64_stats_update_begin(&__lstats->syncp); \
88
90
u64_stats_add(&__lstats->field, count); \
89
91
u64_stats_update_end(&__lstats->syncp); \
92
+ put_cpu(); \
90
93
} while (0)
91
94
92
95
#define SPI_STATISTICS_INCREMENT_FIELD (pcpu_stats , field ) \
93
96
do { \
94
- struct spi_statistics *__lstats = this_cpu_ptr(pcpu_stats); \
97
+ struct spi_statistics *__lstats; \
98
+ get_cpu(); \
99
+ __lstats = this_cpu_ptr(pcpu_stats); \
95
100
u64_stats_update_begin(&__lstats->syncp); \
96
101
u64_stats_inc(&__lstats->field); \
97
102
u64_stats_update_end(&__lstats->syncp); \
103
+ put_cpu(); \
98
104
} while (0)
99
105
100
106
/**
You can’t perform that action at this time.
0 commit comments