Port-i386 archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: ACPI-Problems with NetBSD/i386 and a Compaq DL360 G1
On Thu, Aug 05, 2010 at 09:16:12PM +0200, the_badger%gmx.net@localhost wrote:
> > If you don't mind, try the more conservative patch that I have attached,
> > and let me know if it does not also fix your reboot problem.
>
> Your patch seems to be for -current, whereas I am using the netbsd5 branch.
>
> My version of pci.c is
>
> /* $NetBSD: pci.c,v 1.119.4.1 2008/11/20 02:40:59 snj Exp $ */
Here is a patch for your version.
Dave
--
David Young OJC Technologies
dyoung%ojctech.com@localhost Urbana, IL * (217) 278-3933
Index: sys/dev/pci/pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pci.c,v
retrieving revision 1.119.4.1
diff -u -p -r1.119.4.1 pci.c
--- sys/dev/pci/pci.c 20 Nov 2008 02:40:59 -0000 1.119.4.1
+++ sys/dev/pci/pci.c 5 Aug 2010 21:35:32 -0000
@@ -869,10 +926,11 @@ struct pci_child_power {
int p_pm_offset;
pcireg_t p_pm_cap;
pcireg_t p_class;
+ pcireg_t p_csr;
};
static bool
pci_child_suspend(device_t dv PMF_FN_ARGS)
{
struct pci_child_power *priv = device_pmf_bus_private(dv);
pcireg_t ocsr, csr;
@@ -922,9 +980,10 @@ pci_child_shutdown(device_t dv, int how)
struct pci_child_power *priv = device_pmf_bus_private(dv);
pcireg_t csr;
- /* disable busmastering */
+ /* restore original bus-mastering state */
csr = pci_conf_read(priv->p_pc, priv->p_tag, PCI_COMMAND_STATUS_REG);
csr &= ~PCI_COMMAND_MASTER_ENABLE;
+ csr |= priv->p_csr & PCI_COMMAND_MASTER_ENABLE;
pci_conf_write(priv->p_pc, priv->p_tag, PCI_COMMAND_STATUS_REG, csr);
return true;
}
@@ -955,6 +1014,8 @@ pci_child_register(device_t child)
priv->p_tag = pci_make_tag(priv->p_pc, sc->sc_bus, device,
function);
priv->p_class = pci_conf_read(priv->p_pc, priv->p_tag, PCI_CLASS_REG);
+ priv->p_csr = pci_conf_read(priv->p_pc, priv->p_tag,
+ PCI_COMMAND_STATUS_REG);
if (pci_get_capability(priv->p_pc, priv->p_tag,
PCI_CAP_PWRMGMT, &off, ®)) {
Home |
Main Index |
Thread Index |
Old Index