Re: [Intel-gfx] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-02-28 Thread Jakob Koschel
> On 28. Feb 2022, at 12:20, Greg KH wrote: > > On Mon, Feb 28, 2022 at 12:08:18PM +0100, Jakob Koschel wrote: >> If the list does not contain the expected element, the value of >> list_for_each_entry() iterator will not point to a valid structure. >> To avoid type confusion in such case, the

Re: [Intel-gfx] [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Jakob Koschel
> On 28. Feb 2022, at 12:24, Dan Carpenter wrote: > > On Mon, Feb 28, 2022 at 12:08:17PM +0100, Jakob Koschel wrote: >> diff --git a/drivers/usb/gadget/udc/at91_udc.c >> b/drivers/usb/gadget/udc/at91_udc.c >> index 9040a0561466..0fd0307bc07b 100644 >> --- a/drivers/usb/gadget/udc/at91_udc.c

[Intel-gfx] [PATCH 5/6] treewide: remove dereference of list iterator after loop body

2022-02-28 Thread Jakob Koschel
The list iterator variable will be a bogus pointer if no break was hit. Dereferencing it could load *any* out-of-bounds/undefined value making it unsafe to use that in the comparision to determine if the specific element was found. This is fixed by using a separate list iterator variable for the

[Intel-gfx] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-02-28 Thread Jakob Koschel
If the list does not contain the expected element, the value of list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to list_for_each_entry() loop. In preparation to limiting scope of a list iterator to

[Intel-gfx] [PATCH] Kbuild: remove -std=gnu89 from compiler arguments

2022-02-28 Thread Arnd Bergmann
From: Arnd Bergmann During a patch discussion, Linus brought up the option of changing the C standard version from gnu89 to gnu99, which allows using variable declaration inside of a for() loop. While the C99, C11 and later standards introduce many other features, most of these are already

Re: [Intel-gfx] [PATCH 6/6] treewide: remove check of list iterator against head past the loop body

2022-02-28 Thread Dominique Martinet
This is a bit more work (and a lot more noise), but I'd prefer if this were split into as many patches as there are components. I'm not going to review the parts of the patches that don't concern me, and if something turns out to be a problem later one (it shouldn't but one never knows) it'll be

Re: [Intel-gfx] [PATCH] [v2] Kbuild: move to -std=gnu11

2022-02-28 Thread Arnd Bergmann
On Mon, Feb 28, 2022 at 1:36 PM Jani Nikula wrote: > > > > One minor issue that remains is an added gcc warning for shifts of > > negative integers when building with -Werror, which happens with the > > 'make W=1' option, as well as for three drivers in the kernel that always > > enable -Werror,

[Intel-gfx] [PATCH 3/6] treewide: fix incorrect use to determine if list is empty

2022-02-28 Thread Jakob Koschel
The list iterator value will *always* be set by list_for_each_entry(). It is incorrect to assume that the iterator value will be NULL if the list is empty. Instead of checking the pointer it should be checked if the list is empty. In acpi_get_pmu_hw_inf() instead of setting the pointer to NULL on

[Intel-gfx] [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Jakob Koschel
If the list representing the request queue does not contain the expected request, the value of list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to list_for_each_entry() loop. In preparation to

Re: [Intel-gfx] [PATCH v12 1/6] drm: Add arch arm64 for drm_clflush_virt_range

2022-02-28 Thread Robin Murphy
[ +arm64 maintainers for their awareness, which would have been a good thing to do from the start ] On 2022-02-25 03:24, Michael Cheng wrote: Add arm64 support for drm_clflush_virt_range. caches_clean_inval_pou performs a flush by first performing a clean, follow by an invalidation operation.

Re: [Intel-gfx] [PATCH] [v2] Kbuild: move to -std=gnu11

2022-02-28 Thread Mark Rutland
Hi Arnd, This is great! On Mon, Feb 28, 2022 at 11:27:43AM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > During a patch discussion, Linus brought up the option of changing > the C standard version from gnu89 to gnu99, which allows using variable > declaration inside of a for() loop.

Re: [Intel-gfx] [greybus-dev] [PATCH] Kbuild: remove -std=gnu89 from compiler arguments

2022-02-28 Thread Arnd Bergmann
On Mon, Feb 28, 2022 at 12:04 AM Alex Elder wrote: > On 2/27/22 3:52 PM, Arnd Bergmann wrote: From: Arnd Bergmann > > I put the suggestion into patch form, based on what we discussed > > in the thread. I only gave it minimal testing, but it would > > be good to have it in linux-next if we want

[Intel-gfx] [PATCH 6/6] treewide: remove check of list iterator against head past the loop body

2022-02-28 Thread Jakob Koschel
When list_for_each_entry() completes the iteration over the whole list without breaking the loop, the iterator value will be a bogus pointer computed based on the head element. While it is safe to use the pointer to determine if it was computed based on the head element, either with

Re: [Intel-gfx] [greybus-dev] [PATCH] Kbuild: remove -std=gnu89 from compiler arguments

2022-02-28 Thread Alex Elder
On 2/27/22 3:52 PM, Arnd Bergmann wrote: From: Arnd Bergmann During a patch discussion, Linus brought up the option of changing the C standard version from gnu89 to gnu99, which allows using variable declaration inside of a for() loop. While the C99, C11 and later standards introduce many

Re: [Intel-gfx] [PATCH 5/6] drm/rcar_du: changes to rcar-du driver resulting from drm_writeback_connector structure changes

2022-02-28 Thread Dmitry Baryshkov
On Mon, 28 Feb 2022 at 11:00, Laurent Pinchart wrote: > > Hi Suraj, > > On Sat, Feb 26, 2022 at 05:10:06AM +, Kandpal, Suraj wrote: > > Hi Abhinav, > > > > > Based on the discussion in this thread [1] , it seems like having > > > drm_encoder > > > as a pointer seems to have merits for both

Re: [Intel-gfx] [PATCH] [v2] Kbuild: move to -std=gnu11

2022-02-28 Thread Alex Shi
On Mon, Feb 28, 2022 at 6:32 PM Arnd Bergmann wrote: > > From: Arnd Bergmann > > During a patch discussion, Linus brought up the option of changing > the C standard version from gnu89 to gnu99, which allows using variable > declaration inside of a for() loop. While the C99, C11 and later

[Intel-gfx] [PATCH 4/6] drivers: remove unnecessary use of list iterator variable

2022-02-28 Thread Jakob Koschel
When list_for_each_entry() completes the iteration over the whole list without breaking the loop, the iterator value will *always* be a bogus pointer computed based on the head element. To avoid type confusion use the actual list head directly instead of last iterator value. Signed-off-by: Jakob

Re: [Intel-gfx] [PATCH] Kbuild: remove -std=gnu89 from compiler arguments

2022-02-28 Thread Arnd Bergmann
On Sun, Feb 27, 2022 at 11:36 PM Linus Torvalds wrote: > > And I don't want somebody with a newer compiler version to not notice > that he or she ended up using a c17 feature, just because _that_ > compiler supported it, and then other people get build errors because > their compilers use gnu11

Re: [Intel-gfx] [PATCH] [v2] Kbuild: move to -std=gnu11

2022-02-28 Thread Arnd Bergmann
On Mon, Feb 28, 2022 at 12:25 PM Mark Rutland wrote: > On Mon, Feb 28, 2022 at 11:27:43AM +0100, Arnd Bergmann wrote: > > > > Nathan Chancellor reported an additional -Wdeclaration-after-statement > > warning that appears in a system header on arm, this still needs a > > workaround. > > FWIW, I

Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Clarify vma lifetime (rev2)

2022-02-28 Thread Thomas Hellström
On Tue, 2022-02-22 at 17:14 +, Patchwork wrote: > Patch Details > Series:drm/i915: Clarify vma lifetime > (rev2)URL:https://patchwork.freedesktop.org/series/99948/State:failur > e > Details:https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22350/index.html > CI Bug Log - changes from

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for Fix prime_mmap to work when using LMEM (rev2)

2022-02-28 Thread Patchwork
== Series Details == Series: Fix prime_mmap to work when using LMEM (rev2) URL : https://patchwork.freedesktop.org/series/100737/ State : warning == Summary == $ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately.

Re: [Intel-gfx] [PATCH 5/6] drm/rcar_du: changes to rcar-du driver resulting from drm_writeback_connector structure changes

2022-02-28 Thread Laurent Pinchart
Hello, On Mon, Feb 28, 2022 at 02:28:27PM +0200, Laurent Pinchart wrote: > On Mon, Feb 28, 2022 at 02:09:15PM +0200, Jani Nikula wrote: > > On Mon, 28 Feb 2022, Laurent Pinchart wrote: > > > On Sat, Feb 26, 2022 at 10:27:59AM -0800, Rob Clark wrote: > > >> On Wed, Feb 2, 2022 at 7:41 AM Jani

Re: [Intel-gfx] [PATCH] [v2] Kbuild: move to -std=gnu11

2022-02-28 Thread David Sterba
On Mon, Feb 28, 2022 at 02:01:06PM +0100, Arnd Bergmann wrote: > On Mon, Feb 28, 2022 at 1:36 PM Jani Nikula > wrote: > > > > > > One minor issue that remains is an added gcc warning for shifts of > > > negative integers when building with -Werror, which happens with the > > > 'make W=1' option,

Re: [Intel-gfx] [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Dan Carpenter
On Mon, Feb 28, 2022 at 01:03:36PM +0100, Jakob Koschel wrote: > >> @@ -954,7 +957,6 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request > >> *_req) > >>dev_dbg(ep->dev->dev, "unlink (%s) pio\n", _ep->name); > >>net2272_done(ep, req, -ECONNRESET); > >>} > >> -

Re: [Intel-gfx] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-02-28 Thread Dan Carpenter
On Mon, Feb 28, 2022 at 12:08:18PM +0100, Jakob Koschel wrote: > diff --git a/drivers/scsi/scsi_transport_sas.c > b/drivers/scsi/scsi_transport_sas.c > index 4ee578b181da..a8cbd90db9d2 100644 > --- a/drivers/scsi/scsi_transport_sas.c > +++ b/drivers/scsi/scsi_transport_sas.c > @@ -1060,26

Re: [Intel-gfx] [PATCH 6/6] treewide: remove check of list iterator against head past the loop body

2022-02-28 Thread Dan Carpenter
On Mon, Feb 28, 2022 at 12:08:22PM +0100, Jakob Koschel wrote: > diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c > b/drivers/infiniband/hw/hfi1/tid_rdma.c > index 2a7abf7a1f7f..a069847b56aa 100644 > --- a/drivers/infiniband/hw/hfi1/tid_rdma.c > +++ b/drivers/infiniband/hw/hfi1/tid_rdma.c > @@

Re: [Intel-gfx] [PATCH] [v2] Kbuild: move to -std=gnu11

2022-02-28 Thread David Sterba
On Mon, Feb 28, 2022 at 11:27:43AM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > > Link: > https://lore.kernel.org/lkml/CAHk-=wiych7xehcmifj-ygxuy2jaj7pnkdkpcovt8fybvfw...@mail.gmail.com/ > Link: https://github.com/ClangBuiltLinux/linux/issues/1603 > Suggested-by: Linus Torvalds > Cc:

Re: [Intel-gfx] [PATCH] [v2] Kbuild: move to -std=gnu11

2022-02-28 Thread Jani Nikula
On Mon, 28 Feb 2022, Arnd Bergmann wrote: > From: Arnd Bergmann > > During a patch discussion, Linus brought up the option of changing > the C standard version from gnu89 to gnu99, which allows using variable > declaration inside of a for() loop. While the C99, C11 and later standards >

[Intel-gfx] [CI 4/4] drm/i915/selftests: exercise mmap migration

2022-02-28 Thread Matthew Auld
Exercise each of the migration scenarios, verifying that the final placement and buffer contents match our expectations. v2(Thomas): Replace for_i915_gem_ww() block with simpler object_lock() v3: - For testing purposes allow forcing the io_size such that we can exercise the allocation +

[Intel-gfx] [CI 3/4] drm/i915/selftests: handle allocation failures

2022-02-28 Thread Matthew Auld
If we have to contend with non-mappable LMEM, then we need to ensure the object fits within the mappable portion, like in the selftests, where we later try to CPU access the pages. However if it can't then we need to gracefully handle this, without throwing an error. Also it looks like TTM will

[Intel-gfx] [CI 2/4] drm/i915/ttm: mappable migration on fault

2022-02-28 Thread Matthew Auld
The end goal is to have userspace tell the kernel what buffers will require CPU access, however if we ever reach the CPU fault handler, and the current resource is not mappable, then we should attempt to migrate the buffer to the mappable portion of LMEM, or even system memory, if the allowable

[Intel-gfx] [CI 1/4] drm/i915/ttm: make eviction mappable aware

2022-02-28 Thread Matthew Auld
If we need to make room for some mappable object, then we should only victimize objects that have one or pages that occupy the visible portion of LMEM. Let's also create a new priority hint for objects that are placed in mappable memory, where we know that CPU access was requested, that way we

Re: [Intel-gfx] [PATCH 5/6] drm/rcar_du: changes to rcar-du driver resulting from drm_writeback_connector structure changes

2022-02-28 Thread Laurent Pinchart
Hi Jani, On Mon, Feb 28, 2022 at 02:09:15PM +0200, Jani Nikula wrote: > On Mon, 28 Feb 2022, Laurent Pinchart wrote: > > On Sat, Feb 26, 2022 at 10:27:59AM -0800, Rob Clark wrote: > >> On Wed, Feb 2, 2022 at 7:41 AM Jani Nikula wrote: > >> > On Wed, 02 Feb 2022, Laurent Pinchart wrote: > >> > > On

Re: [Intel-gfx] [PATCH 5/6] drm/rcar_du: changes to rcar-du driver resulting from drm_writeback_connector structure changes

2022-02-28 Thread Jani Nikula
On Mon, 28 Feb 2022, Laurent Pinchart wrote: > Hi Rob, > > On Sat, Feb 26, 2022 at 10:27:59AM -0800, Rob Clark wrote: >> On Wed, Feb 2, 2022 at 7:41 AM Jani Nikula wrote: >> > On Wed, 02 Feb 2022, Laurent Pinchart wrote: >> > > On Wed, Feb 02, 2022 at 03:15:03PM +0200, Jani Nikula wrote: >> > >>

Re: [Intel-gfx] [PATCH] Kbuild: remove -std=gnu89 from compiler arguments

2022-02-28 Thread Christoph Hellwig
Mark actually has a tree that switches to gnu99 with a lot of the issues already sortd out and keeping sane default for things like the absolutely horrible declarations in the middle of code here:

Re: [Intel-gfx] [PATCH 3/6] treewide: fix incorrect use to determine if list is empty

2022-02-28 Thread Dan Carpenter
On Mon, Feb 28, 2022 at 12:08:19PM +0100, Jakob Koschel wrote: > The list iterator value will *always* be set by list_for_each_entry(). > It is incorrect to assume that the iterator value will be NULL if the > list is empty. > > Instead of checking the pointer it should be checked if > the list

Re: [Intel-gfx] [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Dan Carpenter
On Mon, Feb 28, 2022 at 12:08:17PM +0100, Jakob Koschel wrote: > diff --git a/drivers/usb/gadget/udc/at91_udc.c > b/drivers/usb/gadget/udc/at91_udc.c > index 9040a0561466..0fd0307bc07b 100644 > --- a/drivers/usb/gadget/udc/at91_udc.c > +++ b/drivers/usb/gadget/udc/at91_udc.c > @@ -150,13 +150,14

Re: [Intel-gfx] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-02-28 Thread Greg KH
On Mon, Feb 28, 2022 at 12:08:18PM +0100, Jakob Koschel wrote: > If the list does not contain the expected element, the value of > list_for_each_entry() iterator will not point to a valid structure. > To avoid type confusion in such case, the list iterator > scope will be limited to

Re: [Intel-gfx] [PATCH] [v2] Kbuild: move to -std=gnu11

2022-02-28 Thread Greg KH
On Mon, Feb 28, 2022 at 11:27:43AM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > During a patch discussion, Linus brought up the option of changing > the C standard version from gnu89 to gnu99, which allows using variable > declaration inside of a for() loop. While the C99, C11 and later

Re: [Intel-gfx] [PATCH] drm/i915: Depend on !PREEMPT_RT.

2022-02-28 Thread Sebastian Andrzej Siewior
On 2022-02-28 10:10:48 [+], Tvrtko Ursulin wrote: > Hi, Hi, > Could you paste a link to the queue of i915 patches pending for a quick > overview of how much work there is and in what areas? Last post to the list:

Re: [Intel-gfx] [CI 1/2] drm/mm: Add an iterator to optimally walk over holes for an allocation (v4)

2022-02-28 Thread Tvrtko Ursulin
Hi Vivek, On 27/02/2022 17:29, Vivek Kasireddy wrote: This iterator relies on drm_mm_first_hole() and drm_mm_next_hole() functions to identify suitable holes for an allocation of a given size by efficiently traversing the rbtree associated with the given allocator. It replaces the for loop

Re: [Intel-gfx] [PATCH 1/2] drm/i915: Fix assert in i915_ggtt_pin

2022-02-28 Thread Tvrtko Ursulin
On 25/02/2022 17:58, Ville Syrjälä wrote: On Fri, Feb 25, 2022 at 05:41:17PM +, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Use lockdep_assert_not_held to simplify and correct the code. Otherwise false positive are hit if lock state is uknown like after a previous taint. Signed-off-by:

Re: [Intel-gfx] [PATCH] drm/i915: Depend on !PREEMPT_RT.

2022-02-28 Thread Tvrtko Ursulin
Hi, On 25/02/2022 23:03, Sebastian Andrzej Siewior wrote: On 2022-02-14 19:59:08 [+0100], To intel-gfx@lists.freedesktop.org wrote: There are a few sections in the driver which are not compatible with PREEMPT_RT. They trigger warnings and can lead to deadlocks at runtime. Disable the i915

Re: [Intel-gfx] [PATCH v2] drm/i915/display: Allow users to disable PSR2

2022-02-28 Thread Hogander, Jouni
Psr_debug has already similar functionality you are introducing here. Values we used there are different. Maybe we should consider dropping that setting? Still for this patch: Reviewed-by: Jouni Högander On Thu, 2022-02-24 at 12:25 -0800, José Roberto de Souza wrote: > Some users are suffering

Re: [Intel-gfx] [PATCH 5/6] drm/rcar_du: changes to rcar-du driver resulting from drm_writeback_connector structure changes

2022-02-28 Thread Laurent Pinchart
Hi Dmitry, On Mon, Feb 28, 2022 at 11:07:41AM +0300, Dmitry Baryshkov wrote: > On Mon, 28 Feb 2022 at 11:00, Laurent Pinchart wrote: > > On Sat, Feb 26, 2022 at 05:10:06AM +, Kandpal, Suraj wrote: > > > Hi Abhinav, > > > > > > > Based on the discussion in this thread [1] , it seems like

Re: [Intel-gfx] [PATCH 5/6] drm/rcar_du: changes to rcar-du driver resulting from drm_writeback_connector structure changes

2022-02-28 Thread Laurent Pinchart
Hi Rob, On Sat, Feb 26, 2022 at 10:27:59AM -0800, Rob Clark wrote: > On Wed, Feb 2, 2022 at 7:41 AM Jani Nikula wrote: > > On Wed, 02 Feb 2022, Laurent Pinchart wrote: > > > On Wed, Feb 02, 2022 at 03:15:03PM +0200, Jani Nikula wrote: > > >> On Wed, 02 Feb 2022, Laurent Pinchart wrote: > > >> >

Re: [Intel-gfx] [PATCH 5/6] drm/rcar_du: changes to rcar-du driver resulting from drm_writeback_connector structure changes

2022-02-28 Thread Laurent Pinchart
Hi Suraj, On Sat, Feb 26, 2022 at 05:10:06AM +, Kandpal, Suraj wrote: > Hi Abhinav, > > > Based on the discussion in this thread [1] , it seems like having > > drm_encoder > > as a pointer seems to have merits for both of us and also in agreement with > > the folks on this thread and has a

<    1   2