diff mbox series

[v1,4/4] gpu: host1x: debug: Dump push buffer state

Message ID 20200524175100.9334-5-digetx@gmail.com (mailing list archive)
State New, archived
Headers show
Series Minor improvements for Host1x driver | expand

Commit Message

Dmitry Osipenko May 24, 2020, 5:51 p.m. UTC
When job hangs and there is a memory error pointing at channel's push
buffer, it is very handy to know the push buffer's state. This patch
makes the push buffer's state to be dumped into KMSG in addition to the
job's gathers.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/gpu/host1x/hw/debug_hw.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

kernel test robot May 28, 2020, 12:53 a.m. UTC | #1
Hi Dmitry,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tegra-drm/drm/tegra/for-next]
[also build test WARNING on v5.7-rc7 next-20200526]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Osipenko/Minor-improvements-for-Host1x-driver/20200525-152833
base:   git://anongit.freedesktop.org/tegra/linux.git drm/tegra/for-next
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from drivers/gpu/host1x/hw/host1x01.c:17:
drivers/gpu/host1x/hw/debug_hw.c: In function 'show_channel_gathers':
>> drivers/gpu/host1x/hw/debug_hw.c:198:44: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'dma_addr_t' {aka 'long long unsigned int'} [-Wformat=]
198 |  host1x_debug_output(o, "Push Buffer at %08x, %d wordsn",
|                                         ~~~^
|                                            |
|                                            unsigned int
|                                         %08llx
199 |        pb->dma, pb->size / 4);
|        ~~~~~~~
|          |
|          dma_addr_t {aka long long unsigned int}

vim +198 drivers/gpu/host1x/hw/debug_hw.c

   192	
   193	static void show_channel_gathers(struct output *o, struct host1x_cdma *cdma)
   194	{
   195		struct push_buffer *pb = &cdma->push_buffer;
   196		struct host1x_job *job;
   197	
 > 198		host1x_debug_output(o, "Push Buffer at %08x, %d words\n",
   199				    pb->dma, pb->size / 4);
   200	
   201		show_gather(o, pb->dma, pb->size / 4, cdma, pb->dma, pb->mapped);
   202	
   203		list_for_each_entry(job, &cdma->sync_queue, list) {
   204			unsigned int i;
   205	
   206			host1x_debug_output(o, "\n%p: JOB, syncpt_id=%d, syncpt_val=%d, first_get=%08x, timeout=%d num_slots=%d, num_handles=%d\n",
   207					    job, job->syncpt_id, job->syncpt_end,
   208					    job->first_get, job->timeout,
   209					    job->num_slots, job->num_unpins);
   210	
   211			for (i = 0; i < job->num_gathers; i++) {
   212				struct host1x_job_gather *g = &job->gathers[i];
   213				u32 *mapped;
   214	
   215				if (job->gather_copy_mapped)
   216					mapped = (u32 *)job->gather_copy_mapped;
   217				else
   218					mapped = host1x_bo_mmap(g->bo);
   219	
   220				if (!mapped) {
   221					host1x_debug_output(o, "[could not mmap]\n");
   222					continue;
   223				}
   224	
   225				host1x_debug_output(o, "    GATHER at %pad+%#x, %d words\n",
   226						    &g->base, g->offset, g->words);
   227	
   228				show_gather(o, g->base + g->offset, g->words, cdma,
   229					    g->base, mapped);
   230	
   231				if (!job->gather_copy_mapped)
   232					host1x_bo_munmap(g->bo, mapped);
   233			}
   234		}
   235	}
   236	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/gpu/host1x/hw/debug_hw.c b/drivers/gpu/host1x/hw/debug_hw.c
index 02125842071c..c25c3fe0a295 100644
--- a/drivers/gpu/host1x/hw/debug_hw.c
+++ b/drivers/gpu/host1x/hw/debug_hw.c
@@ -192,8 +192,14 @@  static void show_gather(struct output *o, phys_addr_t phys_addr,
 
 static void show_channel_gathers(struct output *o, struct host1x_cdma *cdma)
 {
+	struct push_buffer *pb = &cdma->push_buffer;
 	struct host1x_job *job;
 
+	host1x_debug_output(o, "Push Buffer at %08x, %d words\n",
+			    pb->dma, pb->size / 4);
+
+	show_gather(o, pb->dma, pb->size / 4, cdma, pb->dma, pb->mapped);
+
 	list_for_each_entry(job, &cdma->sync_queue, list) {
 		unsigned int i;