[radeon-alex:amd-staging-drm-next-navi14 56/56] drivers/gpu/drm/panfrost/panfrost_job.c:390:31: sparse: error: not enough arguments for function drm_sched_stop

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

 



tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next-navi14
head:   a40514b64b37d96b20c25841227302d4aab28afb
commit: a40514b64b37d96b20c25841227302d4aab28afb [56/56] drm/amdgpu: consolidate navi14 IP init
reproduce:
        # apt-get install sparse
        # sparse version: 
        git checkout a40514b64b37d96b20c25841227302d4aab28afb
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/panfrost/panfrost_job.c:390:31: sparse: error: not enough arguments for function drm_sched_stop

vim +390 drivers/gpu/drm/panfrost/panfrost_job.c

f3ba91228e8e91 Rob Herring  2018-09-10  365  
f3ba91228e8e91 Rob Herring  2018-09-10  366  static void panfrost_job_timedout(struct drm_sched_job *sched_job)
f3ba91228e8e91 Rob Herring  2018-09-10  367  {
f3ba91228e8e91 Rob Herring  2018-09-10  368  	struct panfrost_job *job = to_panfrost_job(sched_job);
f3ba91228e8e91 Rob Herring  2018-09-10  369  	struct panfrost_device *pfdev = job->pfdev;
f3ba91228e8e91 Rob Herring  2018-09-10  370  	int js = panfrost_job_get_slot(job);
f3ba91228e8e91 Rob Herring  2018-09-10  371  	int i;
f3ba91228e8e91 Rob Herring  2018-09-10  372  
f3ba91228e8e91 Rob Herring  2018-09-10  373  	/*
f3ba91228e8e91 Rob Herring  2018-09-10  374  	 * If the GPU managed to complete this jobs fence, the timeout is
f3ba91228e8e91 Rob Herring  2018-09-10  375  	 * spurious. Bail out.
f3ba91228e8e91 Rob Herring  2018-09-10  376  	 */
f3ba91228e8e91 Rob Herring  2018-09-10  377  	if (dma_fence_is_signaled(job->done_fence))
f3ba91228e8e91 Rob Herring  2018-09-10  378  		return;
f3ba91228e8e91 Rob Herring  2018-09-10  379  
f3ba91228e8e91 Rob Herring  2018-09-10  380  	dev_err(pfdev->dev, "gpu sched timeout, js=%d, status=0x%x, head=0x%x, tail=0x%x, sched_job=%p",
f3ba91228e8e91 Rob Herring  2018-09-10  381  		js,
f3ba91228e8e91 Rob Herring  2018-09-10  382  		job_read(pfdev, JS_STATUS(js)),
f3ba91228e8e91 Rob Herring  2018-09-10  383  		job_read(pfdev, JS_HEAD_LO(js)),
f3ba91228e8e91 Rob Herring  2018-09-10  384  		job_read(pfdev, JS_TAIL_LO(js)),
f3ba91228e8e91 Rob Herring  2018-09-10  385  		sched_job);
f3ba91228e8e91 Rob Herring  2018-09-10  386  
aa20236784ab3d Tomeu Vizoso 2019-04-18  387  	mutex_lock(&pfdev->reset_lock);
aa20236784ab3d Tomeu Vizoso 2019-04-18  388  
f3ba91228e8e91 Rob Herring  2018-09-10  389  	for (i = 0; i < NUM_JOB_SLOTS; i++)
f3ba91228e8e91 Rob Herring  2018-09-10 @390  		drm_sched_stop(&pfdev->js->queue[i].sched);
f3ba91228e8e91 Rob Herring  2018-09-10  391  
f3ba91228e8e91 Rob Herring  2018-09-10  392  	if (sched_job)
f3ba91228e8e91 Rob Herring  2018-09-10  393  		drm_sched_increase_karma(sched_job);
f3ba91228e8e91 Rob Herring  2018-09-10  394  
f3ba91228e8e91 Rob Herring  2018-09-10  395  	/* panfrost_core_dump(pfdev); */
f3ba91228e8e91 Rob Herring  2018-09-10  396  
f3ba91228e8e91 Rob Herring  2018-09-10  397  	panfrost_devfreq_record_transition(pfdev, js);
f3ba91228e8e91 Rob Herring  2018-09-10  398  	panfrost_gpu_soft_reset(pfdev);
f3ba91228e8e91 Rob Herring  2018-09-10  399  
f3ba91228e8e91 Rob Herring  2018-09-10  400  	/* TODO: Re-enable all other address spaces */
f3ba91228e8e91 Rob Herring  2018-09-10  401  	panfrost_mmu_enable(pfdev, 0);
f3ba91228e8e91 Rob Herring  2018-09-10  402  	panfrost_gpu_power_on(pfdev);
f3ba91228e8e91 Rob Herring  2018-09-10  403  	panfrost_job_enable_interrupts(pfdev);
f3ba91228e8e91 Rob Herring  2018-09-10  404  
f3ba91228e8e91 Rob Herring  2018-09-10  405  	for (i = 0; i < NUM_JOB_SLOTS; i++)
f3ba91228e8e91 Rob Herring  2018-09-10  406  		drm_sched_resubmit_jobs(&pfdev->js->queue[i].sched);
f3ba91228e8e91 Rob Herring  2018-09-10  407  
f3ba91228e8e91 Rob Herring  2018-09-10  408  	/* restart scheduler after GPU is usable again */
f3ba91228e8e91 Rob Herring  2018-09-10  409  	for (i = 0; i < NUM_JOB_SLOTS; i++)
f3ba91228e8e91 Rob Herring  2018-09-10  410  		drm_sched_start(&pfdev->js->queue[i].sched, true);
aa20236784ab3d Tomeu Vizoso 2019-04-18  411  
aa20236784ab3d Tomeu Vizoso 2019-04-18  412  	mutex_unlock(&pfdev->reset_lock);
f3ba91228e8e91 Rob Herring  2018-09-10  413  }
f3ba91228e8e91 Rob Herring  2018-09-10  414  
f3ba91228e8e91 Rob Herring  2018-09-10  415  static const struct drm_sched_backend_ops panfrost_sched_ops = {
f3ba91228e8e91 Rob Herring  2018-09-10  416  	.dependency = panfrost_job_dependency,
f3ba91228e8e91 Rob Herring  2018-09-10  417  	.run_job = panfrost_job_run,
f3ba91228e8e91 Rob Herring  2018-09-10  418  	.timedout_job = panfrost_job_timedout,
f3ba91228e8e91 Rob Herring  2018-09-10  419  	.free_job = panfrost_job_free
f3ba91228e8e91 Rob Herring  2018-09-10  420  };
f3ba91228e8e91 Rob Herring  2018-09-10  421  
f3ba91228e8e91 Rob Herring  2018-09-10  422  static irqreturn_t panfrost_job_irq_handler(int irq, void *data)
f3ba91228e8e91 Rob Herring  2018-09-10  423  {
f3ba91228e8e91 Rob Herring  2018-09-10  424  	struct panfrost_device *pfdev = data;
f3ba91228e8e91 Rob Herring  2018-09-10  425  	u32 status = job_read(pfdev, JOB_INT_STAT);
f3ba91228e8e91 Rob Herring  2018-09-10  426  	int j;
f3ba91228e8e91 Rob Herring  2018-09-10  427  
f3ba91228e8e91 Rob Herring  2018-09-10  428  	dev_dbg(pfdev->dev, "jobslot irq status=%x\n", status);
f3ba91228e8e91 Rob Herring  2018-09-10  429  
f3ba91228e8e91 Rob Herring  2018-09-10  430  	if (!status)
f3ba91228e8e91 Rob Herring  2018-09-10  431  		return IRQ_NONE;
f3ba91228e8e91 Rob Herring  2018-09-10  432  
f3ba91228e8e91 Rob Herring  2018-09-10  433  	pm_runtime_mark_last_busy(pfdev->dev);
f3ba91228e8e91 Rob Herring  2018-09-10  434  
f3ba91228e8e91 Rob Herring  2018-09-10  435  	for (j = 0; status; j++) {
f3ba91228e8e91 Rob Herring  2018-09-10  436  		u32 mask = MK_JS_MASK(j);
f3ba91228e8e91 Rob Herring  2018-09-10  437  
f3ba91228e8e91 Rob Herring  2018-09-10  438  		if (!(status & mask))
f3ba91228e8e91 Rob Herring  2018-09-10  439  			continue;
f3ba91228e8e91 Rob Herring  2018-09-10  440  
f3ba91228e8e91 Rob Herring  2018-09-10  441  		job_write(pfdev, JOB_INT_CLEAR, mask);
f3ba91228e8e91 Rob Herring  2018-09-10  442  
f3ba91228e8e91 Rob Herring  2018-09-10  443  		if (status & JOB_INT_MASK_ERR(j)) {
f3ba91228e8e91 Rob Herring  2018-09-10  444  			job_write(pfdev, JS_COMMAND_NEXT(j), JS_COMMAND_NOP);
f3ba91228e8e91 Rob Herring  2018-09-10  445  
f3ba91228e8e91 Rob Herring  2018-09-10  446  			dev_err(pfdev->dev, "js fault, js=%d, status=%s, head=0x%x, tail=0x%x",
f3ba91228e8e91 Rob Herring  2018-09-10  447  				j,
f3ba91228e8e91 Rob Herring  2018-09-10  448  				panfrost_exception_name(pfdev, job_read(pfdev, JS_STATUS(j))),
f3ba91228e8e91 Rob Herring  2018-09-10  449  				job_read(pfdev, JS_HEAD_LO(j)),
f3ba91228e8e91 Rob Herring  2018-09-10  450  				job_read(pfdev, JS_TAIL_LO(j)));
f3ba91228e8e91 Rob Herring  2018-09-10  451  
f3ba91228e8e91 Rob Herring  2018-09-10  452  			drm_sched_fault(&pfdev->js->queue[j].sched);
f3ba91228e8e91 Rob Herring  2018-09-10  453  		}
f3ba91228e8e91 Rob Herring  2018-09-10  454  
f3ba91228e8e91 Rob Herring  2018-09-10  455  		if (status & JOB_INT_MASK_DONE(j)) {
f3ba91228e8e91 Rob Herring  2018-09-10  456  			panfrost_devfreq_record_transition(pfdev, j);
f3ba91228e8e91 Rob Herring  2018-09-10  457  			dma_fence_signal(pfdev->jobs[j]->done_fence);
f3ba91228e8e91 Rob Herring  2018-09-10  458  		}
f3ba91228e8e91 Rob Herring  2018-09-10  459  
f3ba91228e8e91 Rob Herring  2018-09-10  460  		status &= ~mask;
f3ba91228e8e91 Rob Herring  2018-09-10  461  	}
f3ba91228e8e91 Rob Herring  2018-09-10  462  
f3ba91228e8e91 Rob Herring  2018-09-10  463  	return IRQ_HANDLED;
f3ba91228e8e91 Rob Herring  2018-09-10  464  }
f3ba91228e8e91 Rob Herring  2018-09-10  465  
f3ba91228e8e91 Rob Herring  2018-09-10  466  int panfrost_job_init(struct panfrost_device *pfdev)
f3ba91228e8e91 Rob Herring  2018-09-10  467  {
f3ba91228e8e91 Rob Herring  2018-09-10  468  	struct panfrost_job_slot *js;
f3ba91228e8e91 Rob Herring  2018-09-10  469  	int ret, j, irq;
f3ba91228e8e91 Rob Herring  2018-09-10  470  
f3ba91228e8e91 Rob Herring  2018-09-10  471  	pfdev->js = js = devm_kzalloc(pfdev->dev, sizeof(*js), GFP_KERNEL);
f3ba91228e8e91 Rob Herring  2018-09-10  472  	if (!js)
f3ba91228e8e91 Rob Herring  2018-09-10  473  		return -ENOMEM;
f3ba91228e8e91 Rob Herring  2018-09-10  474  
f3ba91228e8e91 Rob Herring  2018-09-10  475  	spin_lock_init(&js->job_lock);
f3ba91228e8e91 Rob Herring  2018-09-10  476  
f3ba91228e8e91 Rob Herring  2018-09-10  477  	irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "job");
f3ba91228e8e91 Rob Herring  2018-09-10  478  	if (irq <= 0)
f3ba91228e8e91 Rob Herring  2018-09-10  479  		return -ENODEV;
f3ba91228e8e91 Rob Herring  2018-09-10  480  
f3ba91228e8e91 Rob Herring  2018-09-10  481  	ret = devm_request_irq(pfdev->dev, irq, panfrost_job_irq_handler,
f3ba91228e8e91 Rob Herring  2018-09-10  482  			       IRQF_SHARED, "job", pfdev);
f3ba91228e8e91 Rob Herring  2018-09-10  483  	if (ret) {
f3ba91228e8e91 Rob Herring  2018-09-10  484  		dev_err(pfdev->dev, "failed to request job irq");
f3ba91228e8e91 Rob Herring  2018-09-10  485  		return ret;
f3ba91228e8e91 Rob Herring  2018-09-10  486  	}
f3ba91228e8e91 Rob Herring  2018-09-10  487  
f3ba91228e8e91 Rob Herring  2018-09-10  488  	for (j = 0; j < NUM_JOB_SLOTS; j++) {
f3ba91228e8e91 Rob Herring  2018-09-10  489  		js->queue[j].fence_context = dma_fence_context_alloc(1);
f3ba91228e8e91 Rob Herring  2018-09-10  490  
f3ba91228e8e91 Rob Herring  2018-09-10  491  		ret = drm_sched_init(&js->queue[j].sched,
f3ba91228e8e91 Rob Herring  2018-09-10  492  				     &panfrost_sched_ops,
f3ba91228e8e91 Rob Herring  2018-09-10  493  				     1, 0, msecs_to_jiffies(500),
f3ba91228e8e91 Rob Herring  2018-09-10  494  				     "pan_js");
f3ba91228e8e91 Rob Herring  2018-09-10  495  		if (ret) {
f3ba91228e8e91 Rob Herring  2018-09-10  496  			dev_err(pfdev->dev, "Failed to create scheduler: %d.", ret);
f3ba91228e8e91 Rob Herring  2018-09-10  497  			goto err_sched;
f3ba91228e8e91 Rob Herring  2018-09-10  498  		}
f3ba91228e8e91 Rob Herring  2018-09-10  499  	}
f3ba91228e8e91 Rob Herring  2018-09-10  500  
f3ba91228e8e91 Rob Herring  2018-09-10  501  	panfrost_job_enable_interrupts(pfdev);
f3ba91228e8e91 Rob Herring  2018-09-10  502  
f3ba91228e8e91 Rob Herring  2018-09-10  503  	return 0;
f3ba91228e8e91 Rob Herring  2018-09-10  504  
f3ba91228e8e91 Rob Herring  2018-09-10  505  err_sched:
f3ba91228e8e91 Rob Herring  2018-09-10  506  	for (j--; j >= 0; j--)
f3ba91228e8e91 Rob Herring  2018-09-10  507  		drm_sched_fini(&js->queue[j].sched);
f3ba91228e8e91 Rob Herring  2018-09-10  508  
f3ba91228e8e91 Rob Herring  2018-09-10  509  	return ret;
f3ba91228e8e91 Rob Herring  2018-09-10  510  }
f3ba91228e8e91 Rob Herring  2018-09-10  511  
f3ba91228e8e91 Rob Herring  2018-09-10  512  void panfrost_job_fini(struct panfrost_device *pfdev)
f3ba91228e8e91 Rob Herring  2018-09-10  513  {
f3ba91228e8e91 Rob Herring  2018-09-10  514  	struct panfrost_job_slot *js = pfdev->js;
f3ba91228e8e91 Rob Herring  2018-09-10  515  	int j;
f3ba91228e8e91 Rob Herring  2018-09-10  516  
f3ba91228e8e91 Rob Herring  2018-09-10  517  	job_write(pfdev, JOB_INT_MASK, 0);
f3ba91228e8e91 Rob Herring  2018-09-10  518  
f3ba91228e8e91 Rob Herring  2018-09-10  519  	for (j = 0; j < NUM_JOB_SLOTS; j++)
f3ba91228e8e91 Rob Herring  2018-09-10  520  		drm_sched_fini(&js->queue[j].sched);
f3ba91228e8e91 Rob Herring  2018-09-10  521  
f3ba91228e8e91 Rob Herring  2018-09-10  522  }
f3ba91228e8e91 Rob Herring  2018-09-10  523  
f3ba91228e8e91 Rob Herring  2018-09-10  524  int panfrost_job_open(struct panfrost_file_priv *panfrost_priv)
f3ba91228e8e91 Rob Herring  2018-09-10  525  {
f3ba91228e8e91 Rob Herring  2018-09-10  526  	struct panfrost_device *pfdev = panfrost_priv->pfdev;
f3ba91228e8e91 Rob Herring  2018-09-10  527  	struct panfrost_job_slot *js = pfdev->js;
f3ba91228e8e91 Rob Herring  2018-09-10  528  	struct drm_sched_rq *rq;
f3ba91228e8e91 Rob Herring  2018-09-10  529  	int ret, i;
f3ba91228e8e91 Rob Herring  2018-09-10  530  
f3ba91228e8e91 Rob Herring  2018-09-10  531  	for (i = 0; i < NUM_JOB_SLOTS; i++) {
f3ba91228e8e91 Rob Herring  2018-09-10  532  		rq = &js->queue[i].sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL];
f3ba91228e8e91 Rob Herring  2018-09-10  533  		ret = drm_sched_entity_init(&panfrost_priv->sched_entity[i], &rq, 1, NULL);
f3ba91228e8e91 Rob Herring  2018-09-10  534  		if (WARN_ON(ret))
f3ba91228e8e91 Rob Herring  2018-09-10  535  			return ret;
f3ba91228e8e91 Rob Herring  2018-09-10  536  	}
f3ba91228e8e91 Rob Herring  2018-09-10  537  	return 0;
f3ba91228e8e91 Rob Herring  2018-09-10  538  }
f3ba91228e8e91 Rob Herring  2018-09-10  539  
f3ba91228e8e91 Rob Herring  2018-09-10  540  void panfrost_job_close(struct panfrost_file_priv *panfrost_priv)
f3ba91228e8e91 Rob Herring  2018-09-10  541  {
f3ba91228e8e91 Rob Herring  2018-09-10  542  	int i;
f3ba91228e8e91 Rob Herring  2018-09-10  543  
f3ba91228e8e91 Rob Herring  2018-09-10  544  	for (i = 0; i < NUM_JOB_SLOTS; i++)
f3ba91228e8e91 Rob Herring  2018-09-10  545  		drm_sched_entity_destroy(&panfrost_priv->sched_entity[i]);
f3ba91228e8e91 Rob Herring  2018-09-10  546  }
f3ba91228e8e91 Rob Herring  2018-09-10  547  
f3ba91228e8e91 Rob Herring  2018-09-10  548  int panfrost_job_is_idle(struct panfrost_device *pfdev)
f3ba91228e8e91 Rob Herring  2018-09-10  549  {
f3ba91228e8e91 Rob Herring  2018-09-10  550  	struct panfrost_job_slot *js = pfdev->js;
f3ba91228e8e91 Rob Herring  2018-09-10  551  	int i;
f3ba91228e8e91 Rob Herring  2018-09-10  552  
f3ba91228e8e91 Rob Herring  2018-09-10  553  	for (i = 0; i < NUM_JOB_SLOTS; i++) {
f3ba91228e8e91 Rob Herring  2018-09-10  554  		/* If there are any jobs in the HW queue, we're not idle */
f3ba91228e8e91 Rob Herring  2018-09-10  555  		if (atomic_read(&js->queue[i].sched.hw_rq_count))
f3ba91228e8e91 Rob Herring  2018-09-10  556  			return false;
f3ba91228e8e91 Rob Herring  2018-09-10  557  
f3ba91228e8e91 Rob Herring  2018-09-10  558  		/* Check whether the hardware is idle */
f3ba91228e8e91 Rob Herring  2018-09-10  559  		if (pfdev->devfreq.slot[i].busy)
f3ba91228e8e91 Rob Herring  2018-09-10  560  			return false;
f3ba91228e8e91 Rob Herring  2018-09-10  561  	}
f3ba91228e8e91 Rob Herring  2018-09-10  562  
f3ba91228e8e91 Rob Herring  2018-09-10  563  	return true;
f3ba91228e8e91 Rob Herring  2018-09-10  564  }

:::::: The code at line 390 was first introduced by commit
:::::: f3ba91228e8e917e5bd6c4b72bfe846933d17370 drm/panfrost: Add initial panfrost driver

:::::: TO: Rob Herring <robh@xxxxxxxxxx>
:::::: CC: Rob Herring <robh@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux