Re: [Nouveau] [PATCH 2/7] PCI: Make pci_wakeup_bus() & pci_bus_set_current_state() public
On Sun, Feb 18, 2018 at 09:38:32AM +0100, Lukas Wunner wrote: > There are PCI devices which are power-manageable by a nonstandard means, > such as a custom ACPI method. One example are discrete GPUs in hybrid > graphics laptops, another are Thunderbolt controllers in Macs. > > Such devices can't be put into D3cold with pci_set_power_state() because > pci_platform_power_transition() fails with -ENODEV. Instead they're put > into D3hot by pci_set_power_state() and subsequently into D3cold by > invoking the nonstandard means. However as a consequence the cached > current_state is incorrectly left at D3hot. > > What we need to do is walk the hierarchy below such a PCI device on > powerdown and update the current_state to D3cold. On powerup the PCI > device itself and the hierarchy below it is in D0uninitialized, so we > need to walk the hierarchy again and wake all devices, causing them to > be put into D0active and then letting them autosuspend as they see fit. > > To this end make pci_wakeup_bus() & pci_bus_set_current_state() public > so PCI drivers don't have to reinvent the wheel. > > Cc: Bjorn Helgaas> Cc: Rafael J. Wysocki > Signed-off-by: Lukas Wunner Acked-by: Bjorn Helgaas > --- > drivers/pci/pci.c | 8 > include/linux/pci.h | 2 ++ > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index f694650235f2..6e6e322a5a7d 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -800,7 +800,7 @@ static int pci_wakeup(struct pci_dev *pci_dev, void *ign) > * pci_wakeup_bus - Walk given bus and wake up devices on it > * @bus: Top bus of the subtree to walk. > */ > -static void pci_wakeup_bus(struct pci_bus *bus) > +void pci_wakeup_bus(struct pci_bus *bus) > { > if (bus) > pci_walk_bus(bus, pci_wakeup, NULL); > @@ -850,11 +850,11 @@ static int __pci_dev_set_current_state(struct pci_dev > *dev, void *data) > } > > /** > - * __pci_bus_set_current_state - Walk given bus and set current state of > devices > + * pci_bus_set_current_state - Walk given bus and set current state of > devices > * @bus: Top bus of the subtree to walk. > * @state: state to be set > */ > -static void __pci_bus_set_current_state(struct pci_bus *bus, pci_power_t > state) > +void pci_bus_set_current_state(struct pci_bus *bus, pci_power_t state) > { > if (bus) > pci_walk_bus(bus, __pci_dev_set_current_state, ); > @@ -876,7 +876,7 @@ int __pci_complete_power_transition(struct pci_dev *dev, > pci_power_t state) > ret = pci_platform_power_transition(dev, state); > /* Power off the bridge may power off the whole hierarchy */ > if (!ret && state == PCI_D3cold) > - __pci_bus_set_current_state(dev->subordinate, PCI_D3cold); > + pci_bus_set_current_state(dev->subordinate, PCI_D3cold); > return ret; > } > EXPORT_SYMBOL_GPL(__pci_complete_power_transition); > diff --git a/include/linux/pci.h b/include/linux/pci.h > index 024a1beda008..ae42289662df 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -1147,6 +1147,8 @@ void pci_pme_wakeup_bus(struct pci_bus *bus); > void pci_d3cold_enable(struct pci_dev *dev); > void pci_d3cold_disable(struct pci_dev *dev); > bool pcie_relaxed_ordering_enabled(struct pci_dev *dev); > +void pci_wakeup_bus(struct pci_bus *bus); > +void pci_bus_set_current_state(struct pci_bus *bus, pci_power_t state); > > /* PCI Virtual Channel */ > int pci_save_vc_state(struct pci_dev *dev); > -- > 2.15.1 > ___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
[Nouveau] [Bug 105174] [GF108][Regression] Unable to handle NULL pointer dereference in nouveau_mem_host since kernel 4.15.3
https://bugs.freedesktop.org/show_bug.cgi?id=105174 Philip Raetschanged: What|Removed |Added See Also||https://bugzilla.opensuse.o ||rg/show_bug.cgi?id=1082308 -- You are receiving this mail because: You are the assignee for the bug.___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
[Nouveau] [Bug 105174] [GF108][Regression] Unable to handle NULL pointer dereference in nouveau_mem_host since kernel 4.15.3
https://bugs.freedesktop.org/show_bug.cgi?id=105174 --- Comment #6 from Philip Raets--- I have the same error in the kernel with the nouveau driver on openSUSE Tumbleweed (kernel 4.15.3 and 4.15.4). This is on a desktop (Dell Optiplex 790 with an NVIDIA GT218 (NVS300) dual display) They seem to happen at random in my system. I can't pinpoint an action when this occurs. Attached the logs from journalctl My bugreport on openSUSE: https://bugzilla.opensuse.org/show_bug.cgi?id=1082308 Greetings, Philip -- You are receiving this mail because: You are the assignee for the bug.___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
[Nouveau] [Bug 105174] [GF108][Regression] Unable to handle NULL pointer dereference in nouveau_mem_host since kernel 4.15.3
https://bugs.freedesktop.org/show_bug.cgi?id=105174 --- Comment #5 from Philip Raets--- Created attachment 137532 --> https://bugs.freedesktop.org/attachment.cgi?id=137532=edit Log from journalctl -- You are receiving this mail because: You are the assignee for the bug.___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
[Nouveau] [Bug 105173] [MCP79][Regression] Unhandled NULL pointer dereference in nvkm_object_unmap since kernel 4.15
https://bugs.freedesktop.org/show_bug.cgi?id=105173 --- Comment #8 from Nick Lee--- Also tried: Vanilla kernel 4.15.4-300.vanilla.knurd.1.fc27.x86_64 mesa-17.3.5 wayland session reproducible Fedora-Workstation-Live-x86_64-Rawhide-20180220.n.0.iso wayland session mesa-18.0.0-0.1.rc4.fc28.x86_64 Got artefacts with dmesg output: [ 1035.437016] nouveau :03:00.0: swiotlb buffer is full (sz: 2097152 bytes) [ 1035.437020] nouveau :03:00.0: swiotlb: coherent allocation failed, size=2097152 [ 1035.437023] CPU: 0 PID: 1842 Comm: gnome-shell Not tainted 4.16.0-0.rc2.git0.1.fc28.x86_64 #1 [ 1035.437024] Hardware name: NVIDIA MCP7A/MCP7A, BIOS 6.00 PG 04/22/2009 [ 1035.437025] Call Trace: [ 1035.437036] dump_stack+0x5c/0x85 [ 1035.437040] swiotlb_alloc_coherent+0x1c3/0x1e0 [ 1035.437052] ttm_dma_pool_get_pages+0x21a/0x620 [ttm] [ 1035.437057] ttm_dma_populate+0xdd/0x390 [ttm] [ 1035.437062] ttm_tt_bind+0x2e/0x60 [ttm] [ 1035.437067] ttm_bo_handle_move_mem+0x4cf/0x550 [ttm] [ 1035.437073] ttm_bo_validate+0x119/0x130 [ttm] [ 1035.437104] ? drm_get_edid_switcheroo+0x16/0x40 [drm] [ 1035.437109] ttm_bo_init_reserved+0x334/0x380 [ttm] [ 1035.437114] ? ttm_bo_init+0x62/0xd0 [ttm] [ 1035.437190] ? nouveau_bo_invalidate_caches+0x10/0x10 [nouveau] [ 1035.437226] ? nouveau_bo_new+0x401/0x580 [nouveau] [ 1035.437262] ? nouveau_bo_invalidate_caches+0x10/0x10 [nouveau] [ 1035.437298] ? nouveau_gem_new+0x120/0x120 [nouveau] [ 1035.437334] ? nouveau_gem_new+0x5d/0x120 [nouveau] [ 1035.437370] ? nouveau_gem_ioctl_new+0x53/0xe0 [nouveau] [ 1035.437381] ? drm_ioctl_kernel+0x5b/0xb0 [drm] [ 1035.437392] ? drm_ioctl+0x1c4/0x380 [drm] [ 1035.437428] ? nouveau_gem_new+0x120/0x120 [nouveau] [ 1035.437431] ? eventfd_write+0x94/0x2a0 [ 1035.437467] ? nouveau_drm_ioctl+0x65/0xc0 [nouveau] [ 1035.437470] ? do_vfs_ioctl+0xa4/0x610 [ 1035.437471] ? SyS_ioctl+0x74/0x80 [ 1035.437475] ? do_syscall_64+0x74/0x180 [ 1035.437478] ? entry_SYSCALL_64_after_hwframe+0x3d/0xa2 -- You are receiving this mail because: You are the assignee for the bug.___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau