pseries: Clear TCE and signal state when resetting PAPR VIO devices
When we reset the system, the reset method for VIO bus devices resets the state of their request queue (if present) as it should. However it was not resetting the state of their TCE table (DMA translation) if present. It was also not resetting the state of the per-device signal mask set with H_VIO_SIGNAL. This patch corrects both bugs, and also removes some small code duplication in the reset paths. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
7f763a5d99
commit
4dd96f244f
@ -324,9 +324,7 @@ static void spapr_vio_quiesce_one(VIOsPAPRDevice *dev)
|
|||||||
}
|
}
|
||||||
dev->dma = spapr_tce_new_dma_context(liobn, pc->rtce_window_size);
|
dev->dma = spapr_tce_new_dma_context(liobn, pc->rtce_window_size);
|
||||||
|
|
||||||
dev->crq.qladdr = 0;
|
free_crq(dev);
|
||||||
dev->crq.qsize = 0;
|
|
||||||
dev->crq.qnext = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token,
|
static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token,
|
||||||
@ -409,9 +407,10 @@ static void spapr_vio_busdev_reset(DeviceState *qdev)
|
|||||||
VIOsPAPRDevice *dev = DO_UPCAST(VIOsPAPRDevice, qdev, qdev);
|
VIOsPAPRDevice *dev = DO_UPCAST(VIOsPAPRDevice, qdev, qdev);
|
||||||
VIOsPAPRDeviceClass *pc = VIO_SPAPR_DEVICE_GET_CLASS(dev);
|
VIOsPAPRDeviceClass *pc = VIO_SPAPR_DEVICE_GET_CLASS(dev);
|
||||||
|
|
||||||
if (dev->crq.qsize) {
|
/* Shut down the request queue and TCEs if necessary */
|
||||||
free_crq(dev);
|
spapr_vio_quiesce_one(dev);
|
||||||
}
|
|
||||||
|
dev->signal_state = 0;
|
||||||
|
|
||||||
if (pc->reset) {
|
if (pc->reset) {
|
||||||
pc->reset(dev);
|
pc->reset(dev);
|
||||||
|
Loading…
Reference in New Issue
Block a user