NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-amd64/58305: nouveau on Lenovo W701 doesn't display



The following reply was made to PR port-amd64/58305; it has been noted by GNATS.

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: is%NetBSD.org@localhost
Cc: gnats-bugs%NetBSD.org@localhost, netbsd-bugs%NetBSD.org@localhost
Subject: Re: port-amd64/58305: nouveau on Lenovo W701 doesn't display
Date: Sun, 8 Dec 2024 20:18:43 +0000

 This is a multi-part message in MIME format.
 --=_Y975VcrVLvtH+JD9ZqImqFEcwqiQxpSV
 
 [resent via correct mail server]
 
 This is a long shot but you could try the attached patch.  There's a
 very slim, but nonzero, probability that it will make a difference.
 Patch should apply cleanly to HEAD and netbsd-10.
 
 (The changes to radeon won't make a difference for your machine but
 there might be analogous bugs in radeon on NetBSD.)
 
 --=_Y975VcrVLvtH+JD9ZqImqFEcwqiQxpSV
 Content-Type: text/plain; charset="ISO-8859-1"; name="pr58305-drmiorwmb"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="pr58305-drmiorwmb.patch"
 
 # HG changeset patch
 # User Taylor R Campbell <riastradh%NetBSD.org@localhost>
 # Date 1733687874 0
 #      Sun Dec 08 19:57:54 2024 +0000
 # Branch trunk
 # Node ID 1540d49ea628daa5a14fd14d9b575f0417e90542
 # Parent  c6804942bc0cd7b4a4f16abba36a9489c9814d80
 # EXP-Topic riastradh-pr58305-nouveaucorenotifiertimeout
 drm: Use rmb/wmb to order potential prefetchable/write-combining I/O.
 
 Don't use membar_consumer/producer, which only order normal memory
 operations in CPU/CPU synchronization, not prefetchable /
 write-combining memory operations or CPU/device synchronization.
 
 Normally this should use either bus_space_barrier (for prefetchable /
 write-combining) or bus_dmamap_sync (for CPU/device), depending on
 how the memory was mapped.  But threading those through the drm,
 nouveau, and radeon abstractions is a lot of work and likely not
 worth the effort.  So we'll use the Linux mmio barrier naming for
 now.
 
 Candidate fix for (among other possible issues):
 
 PR port-amd64/58305: nouveau on Lenovo W701 doesn't display
 
 diff -r c6804942bc0c -r 1540d49ea628 sys/external/bsd/drm2/dist/drm/nouveau=
 /nouveau_bo.c
 --- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c	Sat Dec 07 23:25:=
 19 2024 +0000
 +++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c	Sun Dec 08 19:57:=
 54 2024 +0000
 @@ -634,7 +634,7 @@ ioread16_native(const void __iomem *ptr)
  	uint16_t v;
 =20
  	v =3D *(const uint16_t __iomem *)ptr;
 -	membar_consumer();
 +	rmb();
 =20
  	return v;
  }
 @@ -646,7 +646,7 @@ ioread32_native(const void __iomem *ptr)
  	uint32_t v;
 =20
  	v =3D *(const uint32_t __iomem *)ptr;
 -	membar_consumer();
 +	rmb();
 =20
  	return v;
  }
 @@ -655,7 +655,7 @@ static inline void
  iowrite16_native(uint16_t v, void __iomem *ptr)
  {
 =20
 -	membar_producer();
 +	wmb();
  	*(uint16_t __iomem *)ptr =3D v;
  }
 =20
 @@ -663,7 +663,7 @@ static inline void
  iowrite32_native(uint32_t v, void __iomem *ptr)
  {
 =20
 -	membar_producer();
 +	wmb();
  	*(uint32_t __iomem *)ptr =3D v;
  }
  #endif
 diff -r c6804942bc0c -r 1540d49ea628 sys/external/bsd/drm2/dist/drm/nouveau=
 /nvkm/core/nouveau_nvkm_core_gpuobj.c
 --- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_gp=
 uobj.c	Sat Dec 07 23:25:19 2024 +0000
 +++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_gp=
 uobj.c	Sun Dec 08 19:57:54 2024 +0000
 @@ -51,7 +51,7 @@ ioread32_native(const void __iomem *ptr)
  	uint32_t v;
 =20
  	v =3D *(const uint32_t __iomem *)ptr;
 -	membar_consumer();
 +	rmb();
 =20
  	return v;
  }
 @@ -60,7 +60,7 @@ static inline void
  iowrite32_native(uint32_t v, void __iomem *ptr)
  {
 =20
 -	membar_producer();
 +	wmb();
  	*(uint32_t __iomem *)ptr =3D v;
  }
 =20
 diff -r c6804942bc0c -r 1540d49ea628 sys/external/bsd/drm2/dist/drm/nouveau=
 /nvkm/subdev/devinit/fbmem.h
 --- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h	Sa=
 t Dec 07 23:25:19 2024 +0000
 +++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h	Su=
 n Dec 08 19:57:54 2024 +0000
 @@ -80,7 +80,7 @@ ioread32(const void __iomem *p)
  {
  	const uint32_t v =3D *(const uint32_t __iomem *)p;
 =20
 -	membar_consumer();
 +	rmb();
 =20
  	return v;		/* XXX nouveau byte order */
  }
 @@ -89,7 +89,7 @@ static inline void
  iowrite32(uint32_t v, void __iomem *p)
  {
 =20
 -	membar_producer();
 +	wmb();
  	*(uint32_t __iomem *)p =3D v; /* XXX nouveau byte order */
  }
  #endif
 diff -r c6804942bc0c -r 1540d49ea628 sys/external/bsd/drm2/dist/drm/radeon/=
 radeon_r300.c
 --- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_r300.c	Sat Dec 07 23:25:=
 19 2024 +0000
 +++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_r300.c	Sun Dec 08 19:57:=
 54 2024 +0000
 @@ -136,7 +136,7 @@ static inline void
  fake_writel(uint32_t v, void __iomem *ptr)
  {
 =20
 -	membar_producer();
 +	wmb();
  	*(uint32_t __iomem *)ptr =3D v;
  }
  #endif
 diff -r c6804942bc0c -r 1540d49ea628 sys/external/bsd/drm2/dist/drm/radeon/=
 radeon_r600.c
 --- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_r600.c	Sat Dec 07 23:25:=
 19 2024 +0000
 +++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_r600.c	Sun Dec 08 19:57:=
 54 2024 +0000
 @@ -1091,7 +1091,7 @@ fake_readl(const void __iomem *ptr)
  	uint32_t v;
 =20
  	v =3D *(const uint32_t __iomem *)ptr;
 -	membar_consumer();
 +	rmb();
 =20
  	return v;
  }
 diff -r c6804942bc0c -r 1540d49ea628 sys/external/bsd/drm2/dist/drm/radeon/=
 radeon_rs600.c
 --- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_rs600.c	Sat Dec 07 23:25=
 :19 2024 +0000
 +++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_rs600.c	Sun Dec 08 19:57=
 :54 2024 +0000
 @@ -663,7 +663,7 @@ static inline void
  fake_writeq(uint64_t v, void __iomem *ptr)
  {
 =20
 -	membar_producer();
 +	wmb();
  	*(uint64_t __iomem *)ptr =3D v;
  }
  #endif
 
 --=_Y975VcrVLvtH+JD9ZqImqFEcwqiQxpSV--
 


Home | Main Index | Thread Index | Old Index