Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jan 2016 11:28:37 +0100
From:      Nikola Pajkovsky <n.pajkovsky@gmail.com>
To:        =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= <jean-sebastien.pedron@dumbbell.fr>
Cc:        Nikola Pajkovsky <n.pajkovsky@gmail.com>,  freebsd-x11@freebsd.org
Subject:   Re: build-able drm-i915-update-38
Message-ID:  <87twmfxhka.fsf@gooddata.com>
In-Reply-To: <5698AB9C.9070005@dumbbell.fr> (=?utf-8?Q?=22Jean-S=C3=A9bast?= =?utf-8?Q?ien_P=C3=A9dron=22's?= message of "Fri, 15 Jan 2016 09:19:40 %2B0100")
References:  <87oacpdguk.fsf@gooddata.com> <5696A19A.2030009@dumbbell.fr> <864mehduk6.fsf@freebsd.lan> <5698AB9C.9070005@dumbbell.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
Jean-S=C3=A9bastien P=C3=A9dron <jean-sebastien.pedron@dumbbell.fr> writes:

> On 13/01/2016 22:43, Nikola Pajkovsky wrote:
>>> I rebuild a full kernel from scratch and it does build fine here. There
>>> is no "unused variable" warning for me. Do you build a non-debug kernel
>>> perhaps? I don't plan to build-test such a kernel now, I'll do it when
>>> the patch is finished.
>>=20
>> Oh, everytime? I have found out, that
>
> I use "make buildkernel -DKERNFAST" so only the modifed files are
> recompiled. I just rebuild the kernel from scratch this time to
> double-check if I missed a warning.

I sill don't know those tricks, because I had installed freebsd couple
weeks ago ;)

>>   $ cd sys/modules/drm2
>>   $ make -j9
>>   $ make DESTDIR=3D/boot/ KMODDIR=3Dkernel.i915 install
>>=20
>> is engough (only after I have fully built and booted kernel)
>
> Yes, this works fine, but this doesn't use many defaults set by GENERIC,
> such as debugging options or 32-bit support on 64-bit archs.
>
> The problem you hit is likely because I build a debug kernel (the
> variable is used) and not you (only the declaration remains).

ok, I will try that.

>>   gen6_ggtt_bind_object()
>>     const int max_entries =3D dev_priv->mm.gtt->gtt_total_entries - firs=
t_entry;
>>     BUG_ON(i > max_entries);
>>=20
>> Seems like BUG_ON is noop, which should not be.
>
> BUG_ON() is a KASSERT() which is defined to nothing on a non-debug
> kernel. The variable should be declared in:
>
> #if defined(INVARIANTS)
> ...
> #endif

BUG_ON() is defined in linux.git/include/asm-generic/bug.h as

   #ifndef HAVE_ARCH_BUG
   #define BUG() do { \
   	printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
   	panic("BUG!"); \
   } while (0)
   #endif

   #ifndef HAVE_ARCH_BUG_ON
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
   #endif

and HAVE_ARCH_BUG is defined for x86, hence, BUG_ON must be *on* always,
even in kernel w/o debugging options.

> If you are still willing to send a pull request, you're welcome to do
> so! I know the change is small, so if you don't feel like cloning an
> entire repository just for that, I understand and I will fix it.
>
> Unlike what I said in my previous email, the pull request should be
> against the drm-i915-update-38 branch.

I will have to look at it bit deeper to get it fix.

--=20
Nikola



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87twmfxhka.fsf>