Module Name:    src
Committed By:   msaitoh
Date:           Mon Jan 28 04:09:51 UTC 2019

Modified Files:
        src/sys/dev/pci: ppb.c

Log Message:
 Explicitly enable bus masterling in case BIOS, UEFI or firmware don't enable
it. Might fix PR kern/53811.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/ppb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.65 src/sys/dev/pci/ppb.c:1.66
--- src/sys/dev/pci/ppb.c:1.65	Sun Jan 27 02:08:42 2019
+++ src/sys/dev/pci/ppb.c	Mon Jan 28 04:09:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.65 2019/01/27 02:08:42 pgoyette Exp $	*/
+/*	$NetBSD: ppb.c,v 1.66 2019/01/28 04:09:51 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.65 2019/01/27 02:08:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.66 2019/01/28 04:09:51 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ppb.h"
@@ -358,6 +358,11 @@ ppbattach(device_t parent, device_t self
 	}
 #endif /* PPB_USEINTR */
 
+	/* Enable bus master. */
+	reg = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
+	pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
+	    reg | PCI_COMMAND_MASTER_ENABLE);
+
 	if (!pmf_device_register(self, ppb_suspend, ppb_resume))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 

Reply via email to