mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-11 09:50:12 +00:00
All current uses of pci_set_powerstate are bogus, at least in theory.
However, they are presently necessary due to bigger bogusness in the pci bus layer not doing the right thing on suspend/resume or on initial device probe. This is exactly the sort of thing that the BURN_BRIDGES option was invented for. Mark all of them as BURN_BRIDGES. As soon as I have the powerstate stuff properly integrated into the pci bus code, I intend to remove all these workarounds.
This commit is contained in:
parent
f399623004
commit
fa4b32fa80
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117198
@ -403,9 +403,11 @@ fwohci_pci_resume(device_t dev)
|
||||
{
|
||||
fwohci_softc_t *sc = device_get_softc(dev);
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
device_printf(dev, "fwohci_pci_resume: power_state = 0x%08x\n",
|
||||
pci_get_powerstate(dev));
|
||||
pci_set_powerstate(dev, PCI_POWERSTATE_D0);
|
||||
#endif
|
||||
fwohci_pci_init(dev);
|
||||
fwohci_resume(sc, dev);
|
||||
return 0;
|
||||
|
@ -193,7 +193,9 @@ static void fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp,
|
||||
static void fxp_init(void *xsc);
|
||||
static void fxp_init_body(struct fxp_softc *sc);
|
||||
static void fxp_tick(void *xsc);
|
||||
#ifndef BURN_BRIDGES
|
||||
static void fxp_powerstate_d0(device_t dev);
|
||||
#endif
|
||||
static void fxp_start(struct ifnet *ifp);
|
||||
static void fxp_start_body(struct ifnet *ifp);
|
||||
static void fxp_stop(struct fxp_softc *sc);
|
||||
@ -335,6 +337,7 @@ fxp_probe(device_t dev)
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
static void
|
||||
fxp_powerstate_d0(device_t dev)
|
||||
{
|
||||
@ -360,6 +363,7 @@ fxp_powerstate_d0(device_t dev)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
fxp_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error)
|
||||
@ -401,9 +405,9 @@ fxp_attach(device_t dev)
|
||||
*/
|
||||
pci_enable_busmaster(dev);
|
||||
val = pci_read_config(dev, PCIR_COMMAND, 2);
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
fxp_powerstate_d0(dev);
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Figure out which we should try first - memory mapping or i/o mapping?
|
||||
* We default to memory mapping. Then we accept an override from the
|
||||
@ -999,9 +1003,9 @@ fxp_resume(device_t dev)
|
||||
|
||||
FXP_LOCK(sc);
|
||||
s = splimp();
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
fxp_powerstate_d0(dev);
|
||||
|
||||
#endif
|
||||
/* better way to do this? */
|
||||
for (i = 0; i < 5; i++)
|
||||
pci_write_config(dev, PCIR_MAPS + i * 4, sc->saved_maps[i], 4);
|
||||
|
@ -501,7 +501,7 @@ lge_attach(dev)
|
||||
sc = device_get_softc(dev);
|
||||
unit = device_get_unit(dev);
|
||||
bzero(sc, sizeof(struct lge_softc));
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
/*
|
||||
* Handle power management nonsense.
|
||||
*/
|
||||
@ -524,7 +524,7 @@ lge_attach(dev)
|
||||
pci_write_config(dev, LGE_PCI_LOMEM, membase, 4);
|
||||
pci_write_config(dev, LGE_PCI_INTLINE, irq, 4);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Map control/status registers.
|
||||
*/
|
||||
|
@ -835,7 +835,7 @@ nge_attach(dev)
|
||||
|
||||
mtx_init(&sc->nge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
|
||||
MTX_DEF | MTX_RECURSE);
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
/*
|
||||
* Handle power management nonsense.
|
||||
*/
|
||||
@ -858,7 +858,7 @@ nge_attach(dev)
|
||||
pci_write_config(dev, NGE_PCI_LOMEM, membase, 4);
|
||||
pci_write_config(dev, NGE_PCI_INTLINE, irq, 4);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Map control/status registers.
|
||||
*/
|
||||
|
@ -585,6 +585,7 @@ cbb_chipinit(struct cbb_softc *sc)
|
||||
pci_write_config(sc->dev, CBBR_IOLIMIT1, 0, 4);
|
||||
}
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
static void
|
||||
cbb_powerstate_d0(device_t dev)
|
||||
{
|
||||
@ -606,6 +607,7 @@ cbb_powerstate_d0(device_t dev)
|
||||
pci_write_config(dev, PCIR_INTLINE, irq, 4);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Print out the config space
|
||||
@ -640,10 +642,9 @@ cbb_attach(device_t brdev)
|
||||
sc->subbus = pci_read_config(brdev, PCIR_SUBBUS_2, 1);
|
||||
SLIST_INIT(&sc->rl);
|
||||
STAILQ_INIT(&sc->intr_handlers);
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
cbb_powerstate_d0(brdev);
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
/*
|
||||
* The PCI bus code should assign us memory in the absense
|
||||
* of the BIOS doing so. However, 'should' isn't 'is,' so we kludge
|
||||
|
@ -223,7 +223,7 @@ txp_attach(dev)
|
||||
|
||||
mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
|
||||
MTX_DEF | MTX_RECURSE);
|
||||
|
||||
#ifndef BURN_BRIDGES
|
||||
/*
|
||||
* Handle power management nonsense.
|
||||
*/
|
||||
@ -245,7 +245,7 @@ txp_attach(dev)
|
||||
pci_write_config(dev, TXP_PCI_LOMEM, membase, 4);
|
||||
pci_write_config(dev, TXP_PCI_INTLINE, irq, 4);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Map control/status registers.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user