[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/6] pci: implement power state
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH v2 1/6] pci: implement power state |
Date: |
Tue, 16 Nov 2021 08:16:01 +0100 |
Hi,
> > new_addr = pci_bar_address(d, i, r->type, r->size);
> > + if (!d->has_power) {
> > + new_addr = PCI_BAR_UNMAPPED;
> > + }
> >
> > /* This bar isn't changed */
> > if (new_addr == r->addr)
>
> I am a bit confused about why this is necessary.
> When power is removed device is reset, does not
> this disable device memory automatically?
Hmm. While it clearly doesn't hurt it might not be needed indeed. The
reset-on-poweroff should make sure both bars and dma are off, and due to
config space access being blocked the guest shouldn't be able to turn
them on while device power is off.
So, yes, in theory we should be able to drop this. Assuming nothing in
qemu ever touches the bar mappings (host access to config space is not
blocked).
I'll have a look.
take care,
Gerd
- [PATCH v2 0/6] try improve native hotplug for pcie root ports, Gerd Hoffmann, 2021/11/11
- [PATCH v2 2/6] pcie: implement slot power control for pcie root ports, Gerd Hoffmann, 2021/11/11
- [PATCH v2 3/6] pcie: add power indicator blink check, Gerd Hoffmann, 2021/11/11
- [PATCH v2 6/6] pcie: expire pending delete, Gerd Hoffmann, 2021/11/11
- [PATCH v2 4/6] pcie: factor out pcie_cap_slot_unplug(), Gerd Hoffmann, 2021/11/11
- [PATCH v2 5/6] pcie: fast unplug when slot power is off, Gerd Hoffmann, 2021/11/11
- [PATCH v2 1/6] pci: implement power state, Gerd Hoffmann, 2021/11/11