New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 786277 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

chromeos-4.14: i915_gem + clang: function 'wait_for_engine' is not needed and will not be emitted

Project Member Reported by bleung@chromium.org, Nov 17 2017

Issue description

Build guenter's latest merge branches on kernel next for an intel target (mine's for Reef) using the options for that board (done by switching chromeos-kernel-4_4 to guenter's chroemos-4.14 test merge branch).

kernel-next/chromeos-4.14-merge-171116

Expected: Builds cleanly.

Result: Fails to build using clang. 

/mnt/host/source/src/third_party/kernel/v4.4/drivers/gpu/drm/i915/i915_gem.c:3388:12: error: function 'wait_for_engine' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
static int wait_for_engine(struct intel_engine_cs *engine, int timeout_ms)
           ^
1 error generated.
make[5]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:314: drivers/gpu/drm/i915/i915_gem.o] Error 1
make[5]: Target '__build' not remade because of errors.
make[4]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:573: drivers/gpu/drm/i915] Error 2
make[4]: Target '__build' not remade because of errors.
make[3]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:573: drivers/gpu/drm] Error 2
make[3]: Target '__build' not remade because of errors.
make[2]: *** [/mnt/host/source/src/third_party/kernel/v4.4/scripts/Makefile.build:573: drivers/gpu] Error 2
make[2]: Target '__build' not remade because of errors.
make[1]: *** [/mnt/host/source/src/third_party/kernel/v4.4/Makefile:1024: drivers] Error 2
make[1]: Target '_all' not remade because of errors.
make[1]: Leaving directory '/build/reef/var/cache/portage/sys-kernel/chromeos-kernel-4_4'
make: *** [Makefile:146: sub-make] Error 2
make: Target '_all' not remade because of errors.


Issue does not occur when I build with -clang:
USE="-clang" FEATURES="noclean" cros_workon_make --board=reef --install chromeos-kernel-4_4

 

Comment 1 by bleung@chromium.org, Nov 17 2017

Components: OS>Kernel>Graphics
Labels: -Pri-3 Kernel-4.14 Pri-1

Comment 2 by bleung@chromium.org, Nov 17 2017

Cc: nathan.d...@intel.com

Comment 3 by mka@chromium.org, Nov 17 2017

This should be fixed by the following patch (just landed upstream):

commit cad9946c2a4375386062131858881cfd30fc1b8f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Aug 26 12:09:33 2017 +0100

    drm/i915: Always sanity check engine state upon idling


Officially we haven't enabled clang for v4.14 yet, but we'll probably do it soon after the rebase is finished.
This upstream patch removes unused wait_for_engine:
cad9946c2a43 - drm/i915: Always sanity check engine state upon idling

I'm backporting it for 4.14 https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/772480 but it should also apply cleanly on kernel-next/chromeos-4.14-merge-171116 if you want to try it.
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 5 2017

Labels: merge-merged-chromeos-4.14
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/038430ca5ec8c1a9dde5221fd44633ca9e658168

commit 038430ca5ec8c1a9dde5221fd44633ca9e658168
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Dec 05 04:03:01 2017

UPSTREAM: drm/i915: Always sanity check engine state upon idling

When we do a locked idle we know that afterwards all requests have been
completed and the engines have been cleared of tasks. For whatever
reason, this doesn't always happen and we may go into a suspend with
ELSP still full, and this causes an issue upon resume as we get very,
very confused.

If the engines refuse to idle, mark the device as wedged. In the process
we get rid of the maybe unused open-coded version of wait_for_engines
reported by Nick Desaulniers and Matthias Kaehlcke.

v2: Suppress the -EIO before suspend, but keep it for seqno wrap.

References: https://bugs.freedesktop.org/show_bug.cgi?id=101891
References: https://bugs.freedesktop.org/show_bug.cgi?id=102456
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Matthias Kaehlcke <mka@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20170826110935.10237-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
(cherry picked from commit  cad9946c2a4375386062131858881cfd30fc1b8f
git://anongit.freedesktop.org/drm-intel drm-intel-next-queued)
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>

BUG=chromium:783394,  chromium:786277 
TEST=CNL boots to graphics
  build v4.14 for x86 w/ clang
    => no warning/error about unused function 'wait_for_engine'

Change-Id: I702e57ffcda7852c42cac9daf7dddbf118a2f53a
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/807360
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/038430ca5ec8c1a9dde5221fd44633ca9e658168/drivers/gpu/drm/i915/i915_gem.c

Status: Fixed (was: Unconfirmed)
See #5.

Sign in to add a comment