diff mbox series

[v1] drm/i915/gt: convert tasklets to use new tasklet_setup() API

Message ID 20200819115353.59592-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [v1] drm/i915/gt: convert tasklets to use new tasklet_setup() API | expand

Commit Message

Andy Shevchenko Aug. 19, 2020, 11:53 a.m. UTC
In preparation for unconditionally passing the struct tasklet_struct
pointer to all tasklet callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Comments

Chris Wilson Aug. 19, 2020, 11:59 a.m. UTC | #1
Quoting Andy Shevchenko (2020-08-19 12:53:53)
> In preparation for unconditionally passing the struct tasklet_struct
> pointer to all tasklet callbacks, switch to using the new tasklet_setup()
> and from_tasklet() to pass the tasklet pointer explicitly.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-Chris
Jani Nikula Aug. 19, 2020, 12:34 p.m. UTC | #2
On Wed, 19 Aug 2020, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Andy Shevchenko (2020-08-19 12:53:53)
>> In preparation for unconditionally passing the struct tasklet_struct
>> pointer to all tasklet callbacks, switch to using the new tasklet_setup()
>> and from_tasklet() to pass the tasklet pointer explicitly.
>> 
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> -Chris

Uh, what?

BR,
Jani.
Chris Wilson Aug. 19, 2020, 12:46 p.m. UTC | #3
Quoting Jani Nikula (2020-08-19 13:34:41)
> On Wed, 19 Aug 2020, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > Quoting Andy Shevchenko (2020-08-19 12:53:53)
> >> In preparation for unconditionally passing the struct tasklet_struct
> >> pointer to all tasklet callbacks, switch to using the new tasklet_setup()
> >> and from_tasklet() to pass the tasklet pointer explicitly.
> >> 
> >> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> > -Chris
> 
> Uh, what?

Copy-n-paste too far.
-Chris
Andy Shevchenko Aug. 19, 2020, 1:49 p.m. UTC | #4
On Wed, Aug 19, 2020 at 01:46:14PM +0100, Chris Wilson wrote:
> Quoting Jani Nikula (2020-08-19 13:34:41)
> > On Wed, 19 Aug 2020, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > > Quoting Andy Shevchenko (2020-08-19 12:53:53)
> > >> In preparation for unconditionally passing the struct tasklet_struct
> > >> pointer to all tasklet callbacks, switch to using the new tasklet_setup()
> > >> and from_tasklet() to pass the tasklet pointer explicitly.
> > >> 
> > >> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

I sent too early, I will send v2 and thanks for review.
kernel test robot Aug. 19, 2020, 3:04 p.m. UTC | #5
Hi Andy,

I love your patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v5.9-rc1 next-20200819]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Andy-Shevchenko/drm-i915-gt-convert-tasklets-to-use-new-tasklet_setup-API/20200819-195502
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: i386-randconfig-r024-20200818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All error/warnings (new ones prefixed by >>):

   drivers/gpu/drm/i915/gt/intel_lrc.c: In function 'execlists_submission_tasklet':
   drivers/gpu/drm/i915/gt/intel_lrc.c:3135:42: error: implicit declaration of function 'from_tasklet' [-Werror=implicit-function-declaration]
    3135 |  struct intel_engine_cs * const engine = from_tasklet(engine, t, execlists.tasklet);
         |                                          ^~~~~~~~~~~~
   drivers/gpu/drm/i915/gt/intel_lrc.c:3135:66: error: 'execlists' undeclared (first use in this function); did you mean 'execlists_hold'?
    3135 |  struct intel_engine_cs * const engine = from_tasklet(engine, t, execlists.tasklet);
         |                                                                  ^~~~~~~~~
         |                                                                  execlists_hold
   drivers/gpu/drm/i915/gt/intel_lrc.c:3135:66: note: each undeclared identifier is reported only once for each function it appears in
   drivers/gpu/drm/i915/gt/intel_lrc.c: In function 'intel_execlists_set_default_submission':
>> drivers/gpu/drm/i915/gt/intel_lrc.c:4989:33: error: assignment to 'void (*)(long unsigned int)' from incompatible pointer type 'void (*)(struct tasklet_struct *)' [-Werror=incompatible-pointer-types]
    4989 |  engine->execlists.tasklet.func = execlists_submission_tasklet;
         |                                 ^
   drivers/gpu/drm/i915/gt/intel_lrc.c: In function 'intel_execlists_submission_setup':
   drivers/gpu/drm/i915/gt/intel_lrc.c:5116:2: error: implicit declaration of function 'tasklet_setup' [-Werror=implicit-function-declaration]
    5116 |  tasklet_setup(&engine->execlists.tasklet, execlists_submission_tasklet);
         |  ^~~~~~~~~~~~~
   drivers/gpu/drm/i915/gt/intel_lrc.c: In function 'virtual_submission_tasklet':
   drivers/gpu/drm/i915/gt/intel_lrc.c:5513:57: error: 'base' undeclared (first use in this function)
    5513 |  struct virtual_engine * const ve = from_tasklet(ve, t, base.execlists.tasklet);
         |                                                         ^~~~
   drivers/gpu/drm/i915/gt/intel_lrc.c: In function 'intel_execlists_create_virtual':
>> drivers/gpu/drm/i915/gt/intel_lrc.c:5748:39: warning: comparison of distinct pointer types lacks a cast
    5748 |   if (sibling->execlists.tasklet.func !=
         |                                       ^~
   cc1: some warnings being treated as errors

# https://github.com/0day-ci/linux/commit/72a087952fafa97f8e7fa8b42fee8234c2a04fd7
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andy-Shevchenko/drm-i915-gt-convert-tasklets-to-use-new-tasklet_setup-API/20200819-195502
git checkout 72a087952fafa97f8e7fa8b42fee8234c2a04fd7
vim +4989 drivers/gpu/drm/i915/gt/intel_lrc.c

c34c5bca331adc drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-05-03  4984  
209b7955e59e36 drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2018-07-17  4985  void intel_execlists_set_default_submission(struct intel_engine_cs *engine)
ddd66c5154c25d drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2016-08-02  4986  {
f4ea6bddb9988e drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2016-08-02  4987  	engine->submit_request = execlists_submit_request;
e2f3496e93be32 drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2018-10-01  4988  	engine->schedule = i915_schedule;
c6dce8f140bc19 drivers/gpu/drm/i915/intel_lrc.c    Sagar Arun Kamble      2017-11-16 @4989  	engine->execlists.tasklet.func = execlists_submission_tasklet;
aba5e278586b16 drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2017-10-25  4990  
1329115c6c4370 drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2018-05-16  4991  	engine->reset.prepare = execlists_reset_prepare;
e26b6d4341476f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-12-22  4992  	engine->reset.rewind = execlists_reset_rewind;
e26b6d4341476f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-12-22  4993  	engine->reset.cancel = execlists_reset_cancel;
292ad25c22d965 drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2019-04-11  4994  	engine->reset.finish = execlists_reset_finish;
1329115c6c4370 drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2018-05-16  4995  
c34c5bca331adc drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-05-03  4996  	engine->park = execlists_park;
aba5e278586b16 drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2017-10-25  4997  	engine->unpark = NULL;
cf669b4e9fdce4 drivers/gpu/drm/i915/intel_lrc.c    Tvrtko Ursulin         2017-11-29  4998  
cf669b4e9fdce4 drivers/gpu/drm/i915/intel_lrc.c    Tvrtko Ursulin         2017-11-29  4999  	engine->flags |= I915_ENGINE_SUPPORTS_STATS;
09975b861aa0c5 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-07-09  5000  	if (!intel_vgpu_active(engine->i915)) {
a2deb87396b090 drivers/gpu/drm/i915/intel_lrc.c    Zhenyu Wang            2019-03-27  5001  		engine->flags |= I915_ENGINE_HAS_SEMAPHORES;
a211da9c771bf9 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2020-05-01  5002  		if (HAS_LOGICAL_RING_PREEMPTION(engine->i915)) {
2a694feb93556e drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2018-04-03  5003  			engine->flags |= I915_ENGINE_HAS_PREEMPTION;
a211da9c771bf9 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2020-05-01  5004  			if (IS_ACTIVE(CONFIG_DRM_I915_TIMESLICE_DURATION))
a211da9c771bf9 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2020-05-01  5005  				engine->flags |= I915_ENGINE_HAS_TIMESLICES;
a211da9c771bf9 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2020-05-01  5006  		}
20311bd3506043 drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2016-11-14  5007  	}
cdb736fa8b8b65 drivers/gpu/drm/i915/gt/intel_lrc.c Mika Kuoppala          2019-09-06  5008  
ba2c74da52eba3 drivers/gpu/drm/i915/gt/intel_lrc.c Daniele Ceraolo Spurio 2019-10-09  5009  	if (INTEL_GEN(engine->i915) >= 12)
cdb736fa8b8b65 drivers/gpu/drm/i915/gt/intel_lrc.c Mika Kuoppala          2019-09-06  5010  		engine->flags |= I915_ENGINE_HAS_RELATIVE_MMIO;
a5e93b42f462fc drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-12-13  5011  
a5e93b42f462fc drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-12-13  5012  	if (intel_engine_has_preemption(engine))
a5e93b42f462fc drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-12-13  5013  		engine->emit_bb_start = gen8_emit_bb_start;
a5e93b42f462fc drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-12-13  5014  	else
a5e93b42f462fc drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-12-13  5015  		engine->emit_bb_start = gen8_emit_bb_start_noarb;
09975b861aa0c5 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson           2019-07-09  5016  }
ddd66c5154c25d drivers/gpu/drm/i915/intel_lrc.c    Chris Wilson           2016-08-02  5017  

---
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/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 9eeaca957a7e..5854fd2f046c 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -3137,9 +3137,9 @@  static bool preempt_timeout(const struct intel_engine_cs *const engine)
  * Check the unread Context Status Buffers and manage the submission of new
  * contexts to the ELSP accordingly.
  */
-static void execlists_submission_tasklet(unsigned long data)
+static void execlists_submission_tasklet(struct tasklet_struct *t)
 {
-	struct intel_engine_cs * const engine = (struct intel_engine_cs *)data;
+	struct intel_engine_cs * const engine = from_tasklet(engine, t, execlists.tasklet);
 	bool timeout = preempt_timeout(engine);
 
 	process_csb(engine);
@@ -5120,8 +5120,7 @@  int intel_execlists_submission_setup(struct intel_engine_cs *engine)
 	struct intel_uncore *uncore = engine->uncore;
 	u32 base = engine->mmio_base;
 
-	tasklet_init(&engine->execlists.tasklet,
-		     execlists_submission_tasklet, (unsigned long)engine);
+	tasklet_setup(&engine->execlists.tasklet, execlists_submission_tasklet);
 	timer_setup(&engine->execlists.timer, execlists_timeslice, 0);
 	timer_setup(&engine->execlists.preempt, execlists_preempt, 0);
 
@@ -5516,9 +5515,9 @@  static intel_engine_mask_t virtual_submission_mask(struct virtual_engine *ve)
 	return mask;
 }
 
-static void virtual_submission_tasklet(unsigned long data)
+static void virtual_submission_tasklet(struct tasklet_struct *t)
 {
-	struct virtual_engine * const ve = (struct virtual_engine *)data;
+	struct virtual_engine * const ve = from_tasklet(ve, t, base.execlists.tasklet);
 	const int prio = READ_ONCE(ve->base.execlists.queue_priority_hint);
 	intel_engine_mask_t mask;
 	unsigned int n;
@@ -5731,9 +5730,7 @@  intel_execlists_create_virtual(struct intel_engine_cs **siblings,
 
 	INIT_LIST_HEAD(virtual_queue(ve));
 	ve->base.execlists.queue_priority_hint = INT_MIN;
-	tasklet_init(&ve->base.execlists.tasklet,
-		     virtual_submission_tasklet,
-		     (unsigned long)ve);
+	tasklet_setup(&ve->base.execlists.tasklet, virtual_submission_tasklet);
 
 	intel_context_init(&ve->context, &ve->base);