shithub: riscv

Download patch

ref: 7347012d42284ca11df09be8c68daa2ebc0583a4
parent: e49d187dff43a823a6c987c5bb595d1fa52cc02f
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jun 6 12:19:25 EDT 2020

pc/pmmc: check pci membar type

--- a/sys/src/9/pc/pmmc.c
+++ b/sys/src/9/pc/pmmc.c
@@ -231,7 +231,7 @@
 		}
 	}
 
-	if(p == nil || p->mem[0].size < 256)
+	if(p == nil || p->mem[0].size < 256 || (p->mem[0].bar & 1) != 0)
 		return -1;
 
 	pmmc->mmio = vmap(p->mem[0].bar & ~0x0F, p->mem[0].size);