File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 14
14
#include <linux/init.h>
15
15
#include <linux/interrupt.h>
16
16
#include <linux/io.h>
17
+ #include <linux/iopoll.h>
17
18
#include <linux/io-pgtable.h>
18
19
#include <linux/iommu.h>
19
20
#include <linux/of.h>
@@ -253,17 +254,13 @@ static void ipmmu_imuctr_write(struct ipmmu_vmsa_device *mmu,
253
254
/* Wait for any pending TLB invalidations to complete */
254
255
static void ipmmu_tlb_sync (struct ipmmu_vmsa_domain * domain )
255
256
{
256
- unsigned int count = 0 ;
257
+ u32 val ;
257
258
258
- while ( ipmmu_ctx_read_root ( domain , IMCTR ) & IMCTR_FLUSH ) {
259
- cpu_relax ();
260
- if ( ++ count == TLB_LOOP_TIMEOUT ) {
261
- dev_err_ratelimited (domain -> mmu -> dev ,
259
+ if ( read_poll_timeout_atomic ( ipmmu_ctx_read_root , val ,
260
+ !( val & IMCTR_FLUSH ), 1 , TLB_LOOP_TIMEOUT ,
261
+ false, domain , IMCTR ))
262
+ dev_err_ratelimited (domain -> mmu -> dev ,
262
263
"TLB sync timed out -- MMU may be deadlocked\n" );
263
- return ;
264
- }
265
- udelay (1 );
266
- }
267
264
}
268
265
269
266
static void ipmmu_tlb_invalidate (struct ipmmu_vmsa_domain * domain )
You can’t perform that action at this time.
0 commit comments