All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ibus/gf100: increase wait timeout to avoid read faults
@ 2015-09-23 20:25 Samuel Pitoiset
       [not found] ` <1443039954-9419-1-git-send-email-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Pitoiset @ 2015-09-23 20:25 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Increase clock timeout of some unknown engines in order to avoid failure
at high gpcclk rate.

This fixes IBUS read faults on my GF119 when reclocking is manually
enabled. Note that memory reclocking is completely broken and NvMemExec
has to be disabled to allow core clock reclocking only.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 drm/nouveau/include/nvkm/subdev/ibus.h |  1 +
 drm/nouveau/nvkm/engine/device/base.c  |  4 +--
 drm/nouveau/nvkm/subdev/ibus/Kbuild    |  1 +
 drm/nouveau/nvkm/subdev/ibus/gf100.c   | 17 ++++++++++--
 drm/nouveau/nvkm/subdev/ibus/gf117.c   | 51 ++++++++++++++++++++++++++++++++++
 drm/nouveau/nvkm/subdev/ibus/priv.h    |  7 +++++
 6 files changed, 77 insertions(+), 4 deletions(-)
 create mode 100644 drm/nouveau/nvkm/subdev/ibus/gf117.c
 create mode 100644 drm/nouveau/nvkm/subdev/ibus/priv.h

diff --git a/drm/nouveau/include/nvkm/subdev/ibus.h b/drm/nouveau/include/nvkm/subdev/ibus.h
index 9d512cd..c4dcd26 100644
--- a/drm/nouveau/include/nvkm/subdev/ibus.h
+++ b/drm/nouveau/include/nvkm/subdev/ibus.h
@@ -3,6 +3,7 @@
 #include <core/subdev.h>
 
 int gf100_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
+int gf117_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
 int gk104_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
 int gk20a_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
 #endif
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index 952a508..83383bc 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++ b/drm/nouveau/nvkm/engine/device/base.c
@@ -1595,7 +1595,7 @@ nvd7_chipset = {
 	.fuse = gf100_fuse_new,
 	.gpio = gf119_gpio_new,
 	.i2c = gf117_i2c_new,
-	.ibus = gf100_ibus_new,
+	.ibus = gf117_ibus_new,
 	.imem = nv50_instmem_new,
 	.ltc = gf100_ltc_new,
 	.mc = gf100_mc_new,
@@ -1628,7 +1628,7 @@ nvd9_chipset = {
 	.fuse = gf100_fuse_new,
 	.gpio = gf119_gpio_new,
 	.i2c = gf119_i2c_new,
-	.ibus = gf100_ibus_new,
+	.ibus = gf117_ibus_new,
 	.imem = nv50_instmem_new,
 	.ltc = gf100_ltc_new,
 	.mc = gf100_mc_new,
diff --git a/drm/nouveau/nvkm/subdev/ibus/Kbuild b/drm/nouveau/nvkm/subdev/ibus/Kbuild
index a0b12d2..de888fa 100644
--- a/drm/nouveau/nvkm/subdev/ibus/Kbuild
+++ b/drm/nouveau/nvkm/subdev/ibus/Kbuild
@@ -1,3 +1,4 @@
 nvkm-y += nvkm/subdev/ibus/gf100.o
+nvkm-y += nvkm/subdev/ibus/gf117.o
 nvkm-y += nvkm/subdev/ibus/gk104.o
 nvkm-y += nvkm/subdev/ibus/gk20a.o
diff --git a/drm/nouveau/nvkm/subdev/ibus/gf100.c b/drm/nouveau/nvkm/subdev/ibus/gf100.c
index 37a0496..382720f 100644
--- a/drm/nouveau/nvkm/subdev/ibus/gf100.c
+++ b/drm/nouveau/nvkm/subdev/ibus/gf100.c
@@ -21,7 +21,7 @@
  *
  * Authors: Ben Skeggs
  */
-#include <subdev/ibus.h>
+#include "priv.h"
 
 static void
 gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
@@ -56,7 +56,7 @@ gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i)
 	nvkm_mask(device, 0x128128 + (i * 0x0400), 0x00000200, 0x00000000);
 }
 
-static void
+void
 gf100_ibus_intr(struct nvkm_subdev *ibus)
 {
 	struct nvkm_device *device = ibus->device;
@@ -92,8 +92,21 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
 	}
 }
 
+static int
+gf100_ibus_init(struct nvkm_subdev *ibus)
+{
+	struct nvkm_device *device = ibus->device;
+	nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
+	nvkm_mask(device, 0x12232c, 0x0003ffff, 0x00100064);
+	nvkm_mask(device, 0x122330, 0x0003ffff, 0x00100064);
+	nvkm_mask(device, 0x122334, 0x0003ffff, 0x00100064);
+	nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100);
+	return 0;
+}
+
 static const struct nvkm_subdev_func
 gf100_ibus = {
+	.init = gf100_ibus_init,
 	.intr = gf100_ibus_intr,
 };
 
diff --git a/drm/nouveau/nvkm/subdev/ibus/gf117.c b/drm/nouveau/nvkm/subdev/ibus/gf117.c
new file mode 100644
index 0000000..f69f263
--- /dev/null
+++ b/drm/nouveau/nvkm/subdev/ibus/gf117.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2015 Samuel Pitosiet
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Samuel Pitoiset
+ */
+#include "priv.h"
+
+static int
+gf117_ibus_init(struct nvkm_subdev *ibus)
+{
+	struct nvkm_device *device = ibus->device;
+	nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
+	nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100);
+	nvkm_mask(device, 0x1223b0, 0x0003ffff, 0x00000fff);
+	return 0;
+}
+
+static const struct nvkm_subdev_func
+gf117_ibus = {
+	.init = gf117_ibus_init,
+	.intr = gf100_ibus_intr,
+};
+
+int
+gf117_ibus_new(struct nvkm_device *device, int index,
+	       struct nvkm_subdev **pibus)
+{
+	struct nvkm_subdev *ibus;
+	if (!(ibus = *pibus = kzalloc(sizeof(*ibus), GFP_KERNEL)))
+		return -ENOMEM;
+	nvkm_subdev_ctor(&gf117_ibus, device, index, 0, ibus);
+	return 0;
+}
diff --git a/drm/nouveau/nvkm/subdev/ibus/priv.h b/drm/nouveau/nvkm/subdev/ibus/priv.h
new file mode 100644
index 0000000..48e1b63
--- /dev/null
+++ b/drm/nouveau/nvkm/subdev/ibus/priv.h
@@ -0,0 +1,7 @@
+#ifndef __NVKM_IBUS_PRIV_H__
+#define __NVKM_IBUS_PRIV_H__
+
+#include <subdev/ibus.h>
+
+void gf100_ibus_intr(struct nvkm_subdev *);
+#endif
-- 
2.5.3

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] ibus/gf100: increase wait timeout to avoid read faults
       [not found] ` <1443039954-9419-1-git-send-email-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-09-23 21:01   ` Samuel Pitoiset
       [not found]     ` <1443042080-10683-1-git-send-email-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-09-24 18:26   ` [PATCH v3] " Samuel Pitoiset
  1 sibling, 1 reply; 4+ messages in thread
From: Samuel Pitoiset @ 2015-09-23 21:01 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Increase clock timeout of some unknown engines in order to avoid failure
at high gpcclk rate.

This fixes IBUS read faults on my GF119 when reclocking is manually
enabled. Note that memory reclocking is completely broken and NvMemExec
has to be disabled to allow core clock reclocking only.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
V2: increase mask for the gf100 case

 drm/nouveau/include/nvkm/subdev/ibus.h |  1 +
 drm/nouveau/nvkm/engine/device/base.c  |  4 +--
 drm/nouveau/nvkm/subdev/ibus/Kbuild    |  1 +
 drm/nouveau/nvkm/subdev/ibus/gf100.c   | 17 ++++++++++--
 drm/nouveau/nvkm/subdev/ibus/gf117.c   | 51 ++++++++++++++++++++++++++++++++++
 drm/nouveau/nvkm/subdev/ibus/priv.h    |  7 +++++
 6 files changed, 77 insertions(+), 4 deletions(-)
 create mode 100644 drm/nouveau/nvkm/subdev/ibus/gf117.c
 create mode 100644 drm/nouveau/nvkm/subdev/ibus/priv.h

diff --git a/drm/nouveau/include/nvkm/subdev/ibus.h b/drm/nouveau/include/nvkm/subdev/ibus.h
index 9d512cd..c4dcd26 100644
--- a/drm/nouveau/include/nvkm/subdev/ibus.h
+++ b/drm/nouveau/include/nvkm/subdev/ibus.h
@@ -3,6 +3,7 @@
 #include <core/subdev.h>
 
 int gf100_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
+int gf117_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
 int gk104_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
 int gk20a_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
 #endif
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index 952a508..83383bc 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++ b/drm/nouveau/nvkm/engine/device/base.c
@@ -1595,7 +1595,7 @@ nvd7_chipset = {
 	.fuse = gf100_fuse_new,
 	.gpio = gf119_gpio_new,
 	.i2c = gf117_i2c_new,
-	.ibus = gf100_ibus_new,
+	.ibus = gf117_ibus_new,
 	.imem = nv50_instmem_new,
 	.ltc = gf100_ltc_new,
 	.mc = gf100_mc_new,
@@ -1628,7 +1628,7 @@ nvd9_chipset = {
 	.fuse = gf100_fuse_new,
 	.gpio = gf119_gpio_new,
 	.i2c = gf119_i2c_new,
-	.ibus = gf100_ibus_new,
+	.ibus = gf117_ibus_new,
 	.imem = nv50_instmem_new,
 	.ltc = gf100_ltc_new,
 	.mc = gf100_mc_new,
diff --git a/drm/nouveau/nvkm/subdev/ibus/Kbuild b/drm/nouveau/nvkm/subdev/ibus/Kbuild
index a0b12d2..de888fa 100644
--- a/drm/nouveau/nvkm/subdev/ibus/Kbuild
+++ b/drm/nouveau/nvkm/subdev/ibus/Kbuild
@@ -1,3 +1,4 @@
 nvkm-y += nvkm/subdev/ibus/gf100.o
+nvkm-y += nvkm/subdev/ibus/gf117.o
 nvkm-y += nvkm/subdev/ibus/gk104.o
 nvkm-y += nvkm/subdev/ibus/gk20a.o
diff --git a/drm/nouveau/nvkm/subdev/ibus/gf100.c b/drm/nouveau/nvkm/subdev/ibus/gf100.c
index 37a0496..6c61d54 100644
--- a/drm/nouveau/nvkm/subdev/ibus/gf100.c
+++ b/drm/nouveau/nvkm/subdev/ibus/gf100.c
@@ -21,7 +21,7 @@
  *
  * Authors: Ben Skeggs
  */
-#include <subdev/ibus.h>
+#include "priv.h"
 
 static void
 gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
@@ -56,7 +56,7 @@ gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i)
 	nvkm_mask(device, 0x128128 + (i * 0x0400), 0x00000200, 0x00000000);
 }
 
-static void
+void
 gf100_ibus_intr(struct nvkm_subdev *ibus)
 {
 	struct nvkm_device *device = ibus->device;
@@ -92,8 +92,21 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
 	}
 }
 
+static int
+gf100_ibus_init(struct nvkm_subdev *ibus)
+{
+	struct nvkm_device *device = ibus->device;
+	nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
+	nvkm_mask(device, 0x12232c, 0x0073ffff, 0x00100064);
+	nvkm_mask(device, 0x122330, 0x0073ffff, 0x00100064);
+	nvkm_mask(device, 0x122334, 0x0073ffff, 0x00100064);
+	nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100);
+	return 0;
+}
+
 static const struct nvkm_subdev_func
 gf100_ibus = {
+	.init = gf100_ibus_init,
 	.intr = gf100_ibus_intr,
 };
 
diff --git a/drm/nouveau/nvkm/subdev/ibus/gf117.c b/drm/nouveau/nvkm/subdev/ibus/gf117.c
new file mode 100644
index 0000000..f69f263
--- /dev/null
+++ b/drm/nouveau/nvkm/subdev/ibus/gf117.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2015 Samuel Pitosiet
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Samuel Pitoiset
+ */
+#include "priv.h"
+
+static int
+gf117_ibus_init(struct nvkm_subdev *ibus)
+{
+	struct nvkm_device *device = ibus->device;
+	nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
+	nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100);
+	nvkm_mask(device, 0x1223b0, 0x0003ffff, 0x00000fff);
+	return 0;
+}
+
+static const struct nvkm_subdev_func
+gf117_ibus = {
+	.init = gf117_ibus_init,
+	.intr = gf100_ibus_intr,
+};
+
+int
+gf117_ibus_new(struct nvkm_device *device, int index,
+	       struct nvkm_subdev **pibus)
+{
+	struct nvkm_subdev *ibus;
+	if (!(ibus = *pibus = kzalloc(sizeof(*ibus), GFP_KERNEL)))
+		return -ENOMEM;
+	nvkm_subdev_ctor(&gf117_ibus, device, index, 0, ibus);
+	return 0;
+}
diff --git a/drm/nouveau/nvkm/subdev/ibus/priv.h b/drm/nouveau/nvkm/subdev/ibus/priv.h
new file mode 100644
index 0000000..48e1b63
--- /dev/null
+++ b/drm/nouveau/nvkm/subdev/ibus/priv.h
@@ -0,0 +1,7 @@
+#ifndef __NVKM_IBUS_PRIV_H__
+#define __NVKM_IBUS_PRIV_H__
+
+#include <subdev/ibus.h>
+
+void gf100_ibus_intr(struct nvkm_subdev *);
+#endif
-- 
2.5.3

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ibus/gf100: increase wait timeout to avoid read faults
       [not found]     ` <1443042080-10683-1-git-send-email-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-09-23 21:50       ` Martin Peres
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Peres @ 2015-09-23 21:50 UTC (permalink / raw)
  To: Samuel Pitoiset, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 24/09/15 00:01, Samuel Pitoiset wrote:
> Increase clock timeout of some unknown engines in order to avoid failure
> at high gpcclk rate.
>
> This fixes IBUS read faults on my GF119 when reclocking is manually
> enabled. Note that memory reclocking is completely broken and NvMemExec
> has to be disabled to allow core clock reclocking only.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> ---
> V2: increase mask for the gf100 case
>
>   drm/nouveau/include/nvkm/subdev/ibus.h |  1 +
>   drm/nouveau/nvkm/engine/device/base.c  |  4 +--
>   drm/nouveau/nvkm/subdev/ibus/Kbuild    |  1 +
>   drm/nouveau/nvkm/subdev/ibus/gf100.c   | 17 ++++++++++--
>   drm/nouveau/nvkm/subdev/ibus/gf117.c   | 51 ++++++++++++++++++++++++++++++++++
>   drm/nouveau/nvkm/subdev/ibus/priv.h    |  7 +++++
>   6 files changed, 77 insertions(+), 4 deletions(-)
>   create mode 100644 drm/nouveau/nvkm/subdev/ibus/gf117.c
>   create mode 100644 drm/nouveau/nvkm/subdev/ibus/priv.h
>
> diff --git a/drm/nouveau/include/nvkm/subdev/ibus.h b/drm/nouveau/include/nvkm/subdev/ibus.h
> index 9d512cd..c4dcd26 100644
> --- a/drm/nouveau/include/nvkm/subdev/ibus.h
> +++ b/drm/nouveau/include/nvkm/subdev/ibus.h
> @@ -3,6 +3,7 @@
>   #include <core/subdev.h>
>   
>   int gf100_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
> +int gf117_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
>   int gk104_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
>   int gk20a_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
>   #endif
> diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
> index 952a508..83383bc 100644
> --- a/drm/nouveau/nvkm/engine/device/base.c
> +++ b/drm/nouveau/nvkm/engine/device/base.c
> @@ -1595,7 +1595,7 @@ nvd7_chipset = {
>   	.fuse = gf100_fuse_new,
>   	.gpio = gf119_gpio_new,
>   	.i2c = gf117_i2c_new,
> -	.ibus = gf100_ibus_new,
> +	.ibus = gf117_ibus_new,
>   	.imem = nv50_instmem_new,
>   	.ltc = gf100_ltc_new,
>   	.mc = gf100_mc_new,
> @@ -1628,7 +1628,7 @@ nvd9_chipset = {
>   	.fuse = gf100_fuse_new,
>   	.gpio = gf119_gpio_new,
>   	.i2c = gf119_i2c_new,
> -	.ibus = gf100_ibus_new,
> +	.ibus = gf117_ibus_new,
>   	.imem = nv50_instmem_new,
>   	.ltc = gf100_ltc_new,
>   	.mc = gf100_mc_new,
> diff --git a/drm/nouveau/nvkm/subdev/ibus/Kbuild b/drm/nouveau/nvkm/subdev/ibus/Kbuild
> index a0b12d2..de888fa 100644
> --- a/drm/nouveau/nvkm/subdev/ibus/Kbuild
> +++ b/drm/nouveau/nvkm/subdev/ibus/Kbuild
> @@ -1,3 +1,4 @@
>   nvkm-y += nvkm/subdev/ibus/gf100.o
> +nvkm-y += nvkm/subdev/ibus/gf117.o
>   nvkm-y += nvkm/subdev/ibus/gk104.o
>   nvkm-y += nvkm/subdev/ibus/gk20a.o
> diff --git a/drm/nouveau/nvkm/subdev/ibus/gf100.c b/drm/nouveau/nvkm/subdev/ibus/gf100.c
> index 37a0496..6c61d54 100644
> --- a/drm/nouveau/nvkm/subdev/ibus/gf100.c
> +++ b/drm/nouveau/nvkm/subdev/ibus/gf100.c
> @@ -21,7 +21,7 @@
>    *
>    * Authors: Ben Skeggs
>    */
> -#include <subdev/ibus.h>
> +#include "priv.h"
>   
>   static void
>   gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
> @@ -56,7 +56,7 @@ gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i)
>   	nvkm_mask(device, 0x128128 + (i * 0x0400), 0x00000200, 0x00000000);
>   }
>   
> -static void
> +void
>   gf100_ibus_intr(struct nvkm_subdev *ibus)
>   {
>   	struct nvkm_device *device = ibus->device;
> @@ -92,8 +92,21 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
>   	}
>   }
>   
> +static int
> +gf100_ibus_init(struct nvkm_subdev *ibus)
> +{
> +	struct nvkm_device *device = ibus->device;
> +	nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
> +	nvkm_mask(device, 0x12232c, 0x0073ffff, 0x00100064);
> +	nvkm_mask(device, 0x122330, 0x0073ffff, 0x00100064);
> +	nvkm_mask(device, 0x122334, 0x0073ffff, 0x00100064);
> +	nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100);
> +	return 0;
> +}

# nvapeek -c1 0x122330
00122330: ff73ffff
startx
# nvapeek -c1 0x122330
00122330: 00100064

Seems like the blob is not masking anything. Can you get rid of the 
masks after you check that on all the domains?

> +
>   static const struct nvkm_subdev_func
>   gf100_ibus = {
> +	.init = gf100_ibus_init,
>   	.intr = gf100_ibus_intr,
>   };
>   
> diff --git a/drm/nouveau/nvkm/subdev/ibus/gf117.c b/drm/nouveau/nvkm/subdev/ibus/gf117.c
> new file mode 100644
> index 0000000..f69f263
> --- /dev/null
> +++ b/drm/nouveau/nvkm/subdev/ibus/gf117.c
> @@ -0,0 +1,51 @@
> +/*
> + * Copyright 2015 Samuel Pitosiet
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + *
> + * Authors: Samuel Pitoiset
> + */
> +#include "priv.h"
> +
> +static int
> +gf117_ibus_init(struct nvkm_subdev *ibus)
> +{
> +	struct nvkm_device *device = ibus->device;
> +	nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
> +	nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100);
> +	nvkm_mask(device, 0x1223b0, 0x0003ffff, 0x00000fff);
> +	return 0;
> +}
> +
> +static const struct nvkm_subdev_func
> +gf117_ibus = {
> +	.init = gf117_ibus_init,
> +	.intr = gf100_ibus_intr,
> +};
> +
> +int
> +gf117_ibus_new(struct nvkm_device *device, int index,
> +	       struct nvkm_subdev **pibus)
> +{
> +	struct nvkm_subdev *ibus;
> +	if (!(ibus = *pibus = kzalloc(sizeof(*ibus), GFP_KERNEL)))
> +		return -ENOMEM;
> +	nvkm_subdev_ctor(&gf117_ibus, device, index, 0, ibus);
> +	return 0;
> +}
> diff --git a/drm/nouveau/nvkm/subdev/ibus/priv.h b/drm/nouveau/nvkm/subdev/ibus/priv.h
> new file mode 100644
> index 0000000..48e1b63
> --- /dev/null
> +++ b/drm/nouveau/nvkm/subdev/ibus/priv.h
> @@ -0,0 +1,7 @@
> +#ifndef __NVKM_IBUS_PRIV_H__
> +#define __NVKM_IBUS_PRIV_H__
> +
> +#include <subdev/ibus.h>
> +
> +void gf100_ibus_intr(struct nvkm_subdev *);
> +#endif

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3] ibus/gf100: increase wait timeout to avoid read faults
       [not found] ` <1443039954-9419-1-git-send-email-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-09-23 21:01   ` [PATCH v2] " Samuel Pitoiset
@ 2015-09-24 18:26   ` Samuel Pitoiset
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Pitoiset @ 2015-09-24 18:26 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Increase clock timeout of some unknown engines in order to avoid failure
at high gpcclk rate.

This fixes IBUS read faults on my GF119 when reclocking is manually
enabled. Note that memory reclocking is completely broken and NvMemExec
has to be disabled to allow core clock reclocking only.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
V3: changed some nvkm_mask() to nvkm_wr32() for gf100 (as the blob does)

 drm/nouveau/include/nvkm/subdev/ibus.h |  1 +
 drm/nouveau/nvkm/engine/device/base.c  |  4 +--
 drm/nouveau/nvkm/subdev/ibus/Kbuild    |  1 +
 drm/nouveau/nvkm/subdev/ibus/gf100.c   | 17 ++++++++++--
 drm/nouveau/nvkm/subdev/ibus/gf117.c   | 51 ++++++++++++++++++++++++++++++++++
 drm/nouveau/nvkm/subdev/ibus/priv.h    |  7 +++++
 6 files changed, 77 insertions(+), 4 deletions(-)
 create mode 100644 drm/nouveau/nvkm/subdev/ibus/gf117.c
 create mode 100644 drm/nouveau/nvkm/subdev/ibus/priv.h

diff --git a/drm/nouveau/include/nvkm/subdev/ibus.h b/drm/nouveau/include/nvkm/subdev/ibus.h
index 9d512cd..c4dcd26 100644
--- a/drm/nouveau/include/nvkm/subdev/ibus.h
+++ b/drm/nouveau/include/nvkm/subdev/ibus.h
@@ -3,6 +3,7 @@
 #include <core/subdev.h>
 
 int gf100_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
+int gf117_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
 int gk104_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
 int gk20a_ibus_new(struct nvkm_device *, int, struct nvkm_subdev **);
 #endif
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index 952a508..83383bc 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++ b/drm/nouveau/nvkm/engine/device/base.c
@@ -1595,7 +1595,7 @@ nvd7_chipset = {
 	.fuse = gf100_fuse_new,
 	.gpio = gf119_gpio_new,
 	.i2c = gf117_i2c_new,
-	.ibus = gf100_ibus_new,
+	.ibus = gf117_ibus_new,
 	.imem = nv50_instmem_new,
 	.ltc = gf100_ltc_new,
 	.mc = gf100_mc_new,
@@ -1628,7 +1628,7 @@ nvd9_chipset = {
 	.fuse = gf100_fuse_new,
 	.gpio = gf119_gpio_new,
 	.i2c = gf119_i2c_new,
-	.ibus = gf100_ibus_new,
+	.ibus = gf117_ibus_new,
 	.imem = nv50_instmem_new,
 	.ltc = gf100_ltc_new,
 	.mc = gf100_mc_new,
diff --git a/drm/nouveau/nvkm/subdev/ibus/Kbuild b/drm/nouveau/nvkm/subdev/ibus/Kbuild
index a0b12d2..de888fa 100644
--- a/drm/nouveau/nvkm/subdev/ibus/Kbuild
+++ b/drm/nouveau/nvkm/subdev/ibus/Kbuild
@@ -1,3 +1,4 @@
 nvkm-y += nvkm/subdev/ibus/gf100.o
+nvkm-y += nvkm/subdev/ibus/gf117.o
 nvkm-y += nvkm/subdev/ibus/gk104.o
 nvkm-y += nvkm/subdev/ibus/gk20a.o
diff --git a/drm/nouveau/nvkm/subdev/ibus/gf100.c b/drm/nouveau/nvkm/subdev/ibus/gf100.c
index 37a0496..72d6330 100644
--- a/drm/nouveau/nvkm/subdev/ibus/gf100.c
+++ b/drm/nouveau/nvkm/subdev/ibus/gf100.c
@@ -21,7 +21,7 @@
  *
  * Authors: Ben Skeggs
  */
-#include <subdev/ibus.h>
+#include "priv.h"
 
 static void
 gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
@@ -56,7 +56,7 @@ gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i)
 	nvkm_mask(device, 0x128128 + (i * 0x0400), 0x00000200, 0x00000000);
 }
 
-static void
+void
 gf100_ibus_intr(struct nvkm_subdev *ibus)
 {
 	struct nvkm_device *device = ibus->device;
@@ -92,8 +92,21 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
 	}
 }
 
+static int
+gf100_ibus_init(struct nvkm_subdev *ibus)
+{
+	struct nvkm_device *device = ibus->device;
+	nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
+	nvkm_wr32(device, 0x12232c, 0x00100064);
+	nvkm_wr32(device, 0x122330, 0x00100064);
+	nvkm_wr32(device, 0x122334, 0x00100064);
+	nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100);
+	return 0;
+}
+
 static const struct nvkm_subdev_func
 gf100_ibus = {
+	.init = gf100_ibus_init,
 	.intr = gf100_ibus_intr,
 };
 
diff --git a/drm/nouveau/nvkm/subdev/ibus/gf117.c b/drm/nouveau/nvkm/subdev/ibus/gf117.c
new file mode 100644
index 0000000..f69f263
--- /dev/null
+++ b/drm/nouveau/nvkm/subdev/ibus/gf117.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2015 Samuel Pitosiet
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Samuel Pitoiset
+ */
+#include "priv.h"
+
+static int
+gf117_ibus_init(struct nvkm_subdev *ibus)
+{
+	struct nvkm_device *device = ibus->device;
+	nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
+	nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100);
+	nvkm_mask(device, 0x1223b0, 0x0003ffff, 0x00000fff);
+	return 0;
+}
+
+static const struct nvkm_subdev_func
+gf117_ibus = {
+	.init = gf117_ibus_init,
+	.intr = gf100_ibus_intr,
+};
+
+int
+gf117_ibus_new(struct nvkm_device *device, int index,
+	       struct nvkm_subdev **pibus)
+{
+	struct nvkm_subdev *ibus;
+	if (!(ibus = *pibus = kzalloc(sizeof(*ibus), GFP_KERNEL)))
+		return -ENOMEM;
+	nvkm_subdev_ctor(&gf117_ibus, device, index, 0, ibus);
+	return 0;
+}
diff --git a/drm/nouveau/nvkm/subdev/ibus/priv.h b/drm/nouveau/nvkm/subdev/ibus/priv.h
new file mode 100644
index 0000000..48e1b63
--- /dev/null
+++ b/drm/nouveau/nvkm/subdev/ibus/priv.h
@@ -0,0 +1,7 @@
+#ifndef __NVKM_IBUS_PRIV_H__
+#define __NVKM_IBUS_PRIV_H__
+
+#include <subdev/ibus.h>
+
+void gf100_ibus_intr(struct nvkm_subdev *);
+#endif
-- 
2.5.3

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-24 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-23 20:25 [PATCH] ibus/gf100: increase wait timeout to avoid read faults Samuel Pitoiset
     [not found] ` <1443039954-9419-1-git-send-email-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-23 21:01   ` [PATCH v2] " Samuel Pitoiset
     [not found]     ` <1443042080-10683-1-git-send-email-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-23 21:50       ` Martin Peres
2015-09-24 18:26   ` [PATCH v3] " Samuel Pitoiset

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.