Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Tomasz Figa
On Sat, Oct 3, 2020 at 1:31 AM Jason Gunthorpe wrote: > > On Fri, Oct 02, 2020 at 08:16:48PM +0200, Daniel Vetter wrote: > > On Fri, Oct 2, 2020 at 8:06 PM Jason Gunthorpe wrote: > > > On Fri, Oct 02, 2020 at 07:53:03PM +0200, Daniel Vetter wrote: > > > > For $reasons I've stumbled over this code

Re: [PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion

2020-10-07 Thread Daniel Vetter
On Wed, Oct 7, 2020 at 2:57 PM Thomas Zimmermann wrote: > > Hi > > Am 02.10.20 um 11:58 schrieb Daniel Vetter: > > On Wed, Sep 30, 2020 at 02:51:46PM +0200, Daniel Vetter wrote: > >> On Wed, Sep 30, 2020 at 2:34 PM Christian König > >> wrote: > >>> > >>> Am 30.09.20 um 11:47 schrieb Daniel Vetter

Re: [PATCH v2] drm/vkms: update todo

2020-10-07 Thread Rodrigo Siqueira
On 10/06, Melissa Wen wrote: > Drop issues already resolved in vkms: > > - CRC API Improvements to [1] add igt test to check extreme alpha values > and [2] alpha blending; > - [3] prime buffer sharing; > - [4] writeback support; > > On the other hand, we also found or thought about other improv

Re: [PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion

2020-10-07 Thread Thomas Zimmermann
Hi Am 07.10.20 um 15:10 schrieb Daniel Vetter: > On Wed, Oct 7, 2020 at 2:57 PM Thomas Zimmermann wrote: >> >> Hi >> >> Am 02.10.20 um 11:58 schrieb Daniel Vetter: >>> On Wed, Sep 30, 2020 at 02:51:46PM +0200, Daniel Vetter wrote: On Wed, Sep 30, 2020 at 2:34 PM Christian König wrote:

Re: [PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion

2020-10-07 Thread Christian König
Am 07.10.20 um 15:20 schrieb Thomas Zimmermann: Hi Am 07.10.20 um 15:10 schrieb Daniel Vetter: On Wed, Oct 7, 2020 at 2:57 PM Thomas Zimmermann wrote: Hi Am 02.10.20 um 11:58 schrieb Daniel Vetter: On Wed, Sep 30, 2020 at 02:51:46PM +0200, Daniel Vetter wrote: On Wed, Sep 30, 2020 at 2:34

[PATCH] drm/fb-helper: Add locking to sysrq handling

2020-10-07 Thread Daniel Vetter
We didn't take the kernel_fb_helper_lock mutex, which protects that code. While at it, simplify the code - inline the function (originally shared with kgdb I think) - drop the error tracking and all the complications - drop the pointless early out, it served nothing Signed-off-by: Daniel Vetter C

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Tomasz Figa
On Wed, Oct 7, 2020 at 3:06 PM Jason Gunthorpe wrote: > > On Wed, Oct 07, 2020 at 02:58:33PM +0200, Daniel Vetter wrote: > > On Wed, Oct 7, 2020 at 2:48 PM Tomasz Figa wrote: > > > > > > On Wed, Oct 7, 2020 at 2:44 PM Jason Gunthorpe wrote: > > > > > > > > On Wed, Oct 07, 2020 at 02:33:56PM +020

Re: [PATCH v2 1/7] dt-bindings: display: mxsfb: Convert binding to YAML

2020-10-07 Thread Laurent Pinchart
Hi Marek, On Wed, Oct 07, 2020 at 10:55:24AM +0200, Marek Vasut wrote: > On 10/7/20 10:43 AM, Lucas Stach wrote: > > On Mi, 2020-10-07 at 10:32 +0200, Marek Vasut wrote: > >> On 10/7/20 3:24 AM, Laurent Pinchart wrote: > >> [...] > >>> +properties: > >>> + compatible: > >>> +enum: > >>> +

Re: [PATCH v1] dt-bindings: display: Add support for Intel KeemBay Display

2020-10-07 Thread Rob Herring
On Tue, Oct 6, 2020 at 8:00 PM Chrisanthus, Anitha wrote: > > Hi Rob, > Thanks for the your prompt review. Please see my comments/questions inline. > For everything else, I can incorporate the changes in v2. > Anitha > > > -Original Message- > > From: Rob Herring > > Sent: Tuesday, Octobe

Re: [PATCH v7 0/4] Add support for KeemBay DRM driver

2020-10-07 Thread Rob Herring
On Mon, Aug 31, 2020 at 3:03 PM Anitha Chrisanthus wrote: > > This is a new DRM driver for Intel's KeemBay SOC. > The SoC couples an ARM Cortex A53 CPU with an Intel > Movidius VPU. > > This driver is tested with the KMB EVM board which is the refernce baord > for Keem Bay SOC. The SOC's display p

Re: [PATCH v8 1/4] drm/kmb: Keem Bay driver register definition

2020-10-07 Thread Rob Herring
On Fri, Oct 2, 2020 at 9:17 PM Anitha Chrisanthus wrote: > > Register definitions for Keem Bay display driver > > v2: removed license text (Sam) > v3: Squashed all 59 commits to one > v4: review changes from Sam Ravnborg > renamed dev_p to kmb > v5: corrected spellings > v6: corrected chec

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Daniel Vetter
On Wed, Oct 7, 2020 at 3:34 PM Tomasz Figa wrote: > > On Wed, Oct 7, 2020 at 3:06 PM Jason Gunthorpe wrote: > > > > On Wed, Oct 07, 2020 at 02:58:33PM +0200, Daniel Vetter wrote: > > > On Wed, Oct 7, 2020 at 2:48 PM Tomasz Figa wrote: > > > > > > > > On Wed, Oct 7, 2020 at 2:44 PM Jason Gunthorp

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Tomasz Figa
On Wed, Oct 7, 2020 at 4:09 PM Daniel Vetter wrote: > > On Wed, Oct 7, 2020 at 3:34 PM Tomasz Figa wrote: > > > > On Wed, Oct 7, 2020 at 3:06 PM Jason Gunthorpe wrote: > > > > > > On Wed, Oct 07, 2020 at 02:58:33PM +0200, Daniel Vetter wrote: > > > > On Wed, Oct 7, 2020 at 2:48 PM Tomasz Figa w

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Daniel Vetter
On Wed, Oct 7, 2020 at 4:12 PM Tomasz Figa wrote: > > On Wed, Oct 7, 2020 at 4:09 PM Daniel Vetter wrote: > > > > On Wed, Oct 7, 2020 at 3:34 PM Tomasz Figa wrote: > > > > > > On Wed, Oct 7, 2020 at 3:06 PM Jason Gunthorpe wrote: > > > > > > > > On Wed, Oct 07, 2020 at 02:58:33PM +0200, Daniel

Re: [PATCH v3 2/7] drm/ttm: Add ttm_kmap_obj_to_dma_buf_map() for type conversion

2020-10-07 Thread Daniel Vetter
On Wed, Oct 7, 2020 at 3:25 PM Christian König wrote: > > Am 07.10.20 um 15:20 schrieb Thomas Zimmermann: > > Hi > > > > Am 07.10.20 um 15:10 schrieb Daniel Vetter: > >> On Wed, Oct 7, 2020 at 2:57 PM Thomas Zimmermann > >> wrote: > >>> Hi > >>> > >>> Am 02.10.20 um 11:58 schrieb Daniel Vetter:

RE: [PATCH v8 1/4] drm/kmb: Keem Bay driver register definition

2020-10-07 Thread Chrisanthus, Anitha
> -Original Message- > From: Rob Herring > Sent: Wednesday, October 7, 2020 6:45 AM > To: Chrisanthus, Anitha > Cc: dri-devel ; Paauwe, Bob J > ; Dea, Edmund J ; > Vetter, Daniel ; Sam Ravnborg > > Subject: Re: [PATCH v8 1/4] drm/kmb: Keem Bay driver register definition > > On Fri, Oc

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Tomasz Figa
On Wed, Oct 7, 2020 at 4:23 PM Daniel Vetter wrote: > > On Wed, Oct 7, 2020 at 4:12 PM Tomasz Figa wrote: > > > > On Wed, Oct 7, 2020 at 4:09 PM Daniel Vetter wrote: > > > > > > On Wed, Oct 7, 2020 at 3:34 PM Tomasz Figa wrote: > > > > > > > > On Wed, Oct 7, 2020 at 3:06 PM Jason Gunthorpe wro

Re: [PATCH 4/5] thermal: devfreq_cooling: remove old power model and use EM

2020-10-07 Thread Ionela Voinescu
Hi Lukasz, On Monday 21 Sep 2020 at 13:20:06 (+0100), Lukasz Luba wrote: [..] > /** > - * freq_get_state() - get the cooling state corresponding to a frequency > + * freq_get_state() - get the performance index corresponding to a frequency If we change the meaning of the return value, I think th

Re: [PATCH 3/5] thermal: devfreq_cooling: add new registration functions with Energy Model

2020-10-07 Thread Ionela Voinescu
Hi Lukasz, On Monday 21 Sep 2020 at 13:20:05 (+0100), Lukasz Luba wrote: > The Energy Model (EM) framework supports devices such as Devfreq. Create > new registration functions which automatically register EM for the thermal > devfreq_cooling devices. This patch prepares the code for coming change

Re: [PATCH v2 2/7] dt-bindings: display: mxsfb: Add and fix compatible strings

2020-10-07 Thread Marek Vasut
On 10/7/20 3:24 AM, Laurent Pinchart wrote: [...] > properties: >compatible: > -enum: > - - fsl,imx23-lcdif > - - fsl,imx28-lcdif > - - fsl,imx6sx-lcdif > - - fsl,imx8mq-lcdif > +oneOf: > + - enum: > + - fsl,imx23-lcdif > + - fsl,imx28-lcdif

Re: [PATCH v2 0/3] drm: commit_work scheduling

2020-10-07 Thread Qais Yousef
On 10/06/20 13:04, Rob Clark wrote: > On Tue, Oct 6, 2020 at 3:59 AM Qais Yousef wrote: > > > > On 10/05/20 16:24, Rob Clark wrote: > > > > [...] > > > > > > RT planning and partitioning is not easy task for sure. You might want > > > > to > > > > consider using affinities too to get stronger gua

Re: [PATCH v2 1/7] dt-bindings: display: mxsfb: Convert binding to YAML

2020-10-07 Thread Marek Vasut
On 10/7/20 10:43 AM, Lucas Stach wrote: > On Mi, 2020-10-07 at 10:32 +0200, Marek Vasut wrote: >> On 10/7/20 3:24 AM, Laurent Pinchart wrote: >> [...] >>> +properties: >>> + compatible: >>> +enum: >>> + - fsl,imx23-lcdif >>> + - fsl,imx28-lcdif >>> + - fsl,imx6sx-lcdif >>> +

Re: [PATCH v2 1/7] dt-bindings: display: mxsfb: Convert binding to YAML

2020-10-07 Thread Marek Vasut
On 10/7/20 3:33 PM, Laurent Pinchart wrote: > Hi Marek, > > On Wed, Oct 07, 2020 at 10:55:24AM +0200, Marek Vasut wrote: >> On 10/7/20 10:43 AM, Lucas Stach wrote: >>> On Mi, 2020-10-07 at 10:32 +0200, Marek Vasut wrote: On 10/7/20 3:24 AM, Laurent Pinchart wrote: [...] > +properties

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Jason Gunthorpe
On Wed, Oct 07, 2020 at 02:33:56PM +0200, Marek Szyprowski wrote: > Well, it was in vb2_get_vma() function, but now I see that it has been > lost in fb639eb39154 and 6690c8c78c74 some time ago... There is no guarentee that holding a get on the file says anthing about the VMA. This needed to check

Re: [PATCH v2 3/7] dt-bindings: display: mxsfb: Add a bus-width endpoint property

2020-10-07 Thread Marek Vasut
On 10/7/20 3:24 AM, Laurent Pinchart wrote: [...] > + bus-width: > +enum: [16, 18, 24] > +description: | > + The output bus width. This value overrides the configuration > + derived from the connected device (encoder or panel). It should

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Jason Gunthorpe
On Wed, Oct 07, 2020 at 04:11:59PM +0200, Tomasz Figa wrote: > We also need to bring back the vma_open() that somehow disappeared > around 4.2, as Marek found. No Jason ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedeskto

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Jason Gunthorpe
On Wed, Oct 07, 2020 at 03:06:17PM +0200, Tomasz Figa wrote: > Note that vb2_vmalloc is only used for in-kernel CPU usage, e.g. the > contents being copied by the driver between vb2 buffers and some > hardware FIFO or other dedicated buffers. The memory does not go to > any hardware DMA. That is

Re: [PATCH v2 1/7] dt-bindings: display: mxsfb: Convert binding to YAML

2020-10-07 Thread Marek Vasut
On 10/7/20 3:24 AM, Laurent Pinchart wrote: [...] > +properties: > + compatible: > +enum: > + - fsl,imx23-lcdif > + - fsl,imx28-lcdif > + - fsl,imx6sx-lcdif > + - fsl,imx8mq-lcdif There is no fsl,imx8mq-lcdif in drivers/gpu/drm/mxsfb/mxsfb_drv.c, so the DT must specify com

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Jason Gunthorpe
On Wed, Oct 07, 2020 at 02:58:33PM +0200, Daniel Vetter wrote: > On Wed, Oct 7, 2020 at 2:48 PM Tomasz Figa wrote: > > > > On Wed, Oct 7, 2020 at 2:44 PM Jason Gunthorpe wrote: > > > > > > On Wed, Oct 07, 2020 at 02:33:56PM +0200, Marek Szyprowski wrote: > > > > Well, it was in vb2_get_vma() func

Re: KASAN: vmalloc-out-of-bounds Write in sys_imageblit

2020-10-07 Thread syzbot
syzbot has found a reproducer for the following issue on: HEAD commit:c85fb28b Merge tag 'arm64-fixes' of git://git.kernel.org/p.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=17406d7050 kernel config: https://syzkaller.appspot.com/x/.config?x=140446a

Re: [PATCH] dt-bindings: mxsfb: Add compatible for i.MX8MM

2020-10-07 Thread Marek Vasut
On 10/7/20 2:42 AM, Laurent Pinchart wrote: > Hi Marek, > > On Wed, Oct 07, 2020 at 12:38:50AM +0200, Marek Vasut wrote: >> On 10/6/20 11:15 PM, Rob Herring wrote: >>> On Sun, 04 Oct 2020 00:48:01 +0200, Marek Vasut wrote: NXP's i.MX8MM has an LCDIF as well. Signed-off-by: Marek Vas

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-07 Thread Jason Gunthorpe
On Wed, Oct 07, 2020 at 03:34:01PM +0200, Tomasz Figa wrote: > I think the userptr zero-copy hack should be able to go away indeed, > given that we now have CMA that allows having carveouts backed by > struct pages and having the memory represented as DMA-buf normally. This also needs to figure o

Re: [PATCH RESEND v3 2/6] dt-bindings: display: sun4i: Add LVDS Dual-Link property

2020-10-07 Thread Rob Herring
On Mon, Oct 05, 2020 at 05:15:40PM +0200, Maxime Ripard wrote: > The Allwinner SoCs with two TCONs and LVDS output can use both to drive an > LVDS dual-link. Add a new property to express that link between these two > TCONs. > > Signed-off-by: Maxime Ripard > --- > Documentation/devicetree/bindi

[PATCH 00/14] drm/amd/pm: Replace one-element arrays with flexible-array members

2020-10-07 Thread Gustavo A. R. Silva
Hi all, This series aims to replace one-element arrays with flexible-array members. There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The

[PATCH 01/14] drm/amd/pm: Replace one-element array with flexible-array member

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

[PATCH 02/14] drm/amd/pm: Replace one-element array with flexible-array member in struct vi_dpm_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Use a f

Re: [PATCH v2 0/3] drm: commit_work scheduling

2020-10-07 Thread Rob Clark
On Wed, Oct 7, 2020 at 3:36 AM Qais Yousef wrote: > > On 10/06/20 13:04, Rob Clark wrote: > > On Tue, Oct 6, 2020 at 3:59 AM Qais Yousef wrote: > > > > > > On 10/05/20 16:24, Rob Clark wrote: > > > > > > [...] > > > > > > > > RT planning and partitioning is not easy task for sure. You might > >

[PATCH 03/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_clock_array

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

[PATCH 04/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_uvd_clock_voltage_dependency_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

[PATCH 05/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_acp_clock_voltage_dependency_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

[PATCH 06/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_phase_shedding_limits_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

[PATCH 07/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_vce_clock_voltage_dependency_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

Re: [PATCH v2 1/7] dt-bindings: display: mxsfb: Convert binding to YAML

2020-10-07 Thread Rob Herring
On Wed, Oct 07, 2020 at 04:24:32AM +0300, Laurent Pinchart wrote: > Convert the mxsfb binding to YAML. The deprecated binding is dropped, as > neither the DT sources nor the driver support it anymore. The converted > binding is named fsl,lcdif.yaml to match the usual bindings naming > scheme. > >

[PATCH 08/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_cac_leakage_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

[PATCH 09/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_samu_clock_voltage_dependency_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

Re: [PATCH v2 2/7] dt-bindings: display: mxsfb: Add and fix compatible strings

2020-10-07 Thread Rob Herring
On Wed, 07 Oct 2020 04:24:33 +0300, Laurent Pinchart wrote: > Additional compatible strings have been added in DT source for the > i.MX6SL, i.MX6SLL, i.MX6UL and i.MX7D without updating the bindings. > Most of the upstream DT sources use the fsl,imx28-lcdif compatible > string, which mostly predate

[PATCH 10/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_ppt_v1_clock_voltage_dependency_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

Re: [PATCH v2 1/7] dt-bindings: display: mxsfb: Convert binding to YAML

2020-10-07 Thread Rob Herring
On Wed, Oct 07, 2020 at 11:00:20AM -0500, Rob Herring wrote: > On Wed, Oct 07, 2020 at 04:24:32AM +0300, Laurent Pinchart wrote: > > Convert the mxsfb binding to YAML. The deprecated binding is dropped, as > > neither the DT sources nor the driver support it anymore. The converted > > binding is na

[PATCH 12/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_ppt_v1_voltage_lookup_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

Re: [PATCH v2 3/7] dt-bindings: display: mxsfb: Add a bus-width endpoint property

2020-10-07 Thread Rob Herring
On Wed, 07 Oct 2020 04:24:34 +0300, Laurent Pinchart wrote: > When the PCB routes the display data signals in an unconventional way, > the output bus width may differ from the bus width of the connected > panel or encoder. For instance, when a 18-bit RGB panel has its R[5:0], > G[5:0] and B[5:0] si

[PATCH 11/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_ppt_v1_mm_clock_voltage_dependency_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

[PATCH 13/14] drm/amd/pm: Replace one-element array with flexible-array in struct phm_ppt_v1_pcie_table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refacto

[PATCH 14/14] drm/amd/pm: Replace one-element array with flexible-array in struct ATOM_Vega10_GFXCLK_Dependency_Table

2020-10-07 Thread Gustavo A. R. Silva
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Use a f

[PATCH 10/13] PCI: revoke mappings like devmem

2020-10-07 Thread Daniel Vetter
Since 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims the region") /dev/kmem zaps ptes when the kernel requests exclusive acccess to an iomem region. And with CONFIG_IO_STRICT_DEVMEM, this is the default for all driver uses. Except there's two more ways to access pci bars: sysfs and

[PATCH 06/13] media: videobuf2: Move frame_vector into media subsystem

2020-10-07 Thread Daniel Vetter
It's the only user. This also garbage collects the CONFIG_FRAME_VECTOR symbol from all over the tree (well just one place, somehow omap media driver still had this in its Kconfig, despite not using it). Signed-off-by: Daniel Vetter Cc: Jason Gunthorpe Cc: Pawel Osciak Cc: Marek Szyprowski Cc:

[PATCH 04/13] misc/habana: Use FOLL_LONGTERM for userptr

2020-10-07 Thread Daniel Vetter
These are persistent, not just for the duration of a dma operation. Signed-off-by: Daniel Vetter Cc: Jason Gunthorpe Cc: Andrew Morton Cc: John Hubbard Cc: Jérôme Glisse Cc: Jan Kara Cc: Dan Williams Cc: linux...@kvack.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-samsung-...@vger.

[PATCH 01/13] drm/exynos: Stop using frame_vector helpers

2020-10-07 Thread Daniel Vetter
All we need are a pages array, pin_user_pages_fast can give us that directly. Plus this avoids the entire raw pfn side of get_vaddr_frames. Signed-off-by: Daniel Vetter Cc: Jason Gunthorpe Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Kukjin Kim Cc: Krzysztof Kozlo

[PATCH 11/13] mm: add unsafe_follow_pfn

2020-10-07 Thread Daniel Vetter
Way back it was a reasonable assumptions that iomem mappings never change the pfn range they point at. But this has changed: - gpu drivers dynamically manage their memory nowadays, invalidating ptes with unmap_mapping_range when buffers get moved - contiguous dma allocations have moved from dedic

[PATCH 05/13] mm/frame-vector: Use FOLL_LONGTERM

2020-10-07 Thread Daniel Vetter
This is used by media/videbuf2 for persistent dma mappings, not just for a single dma operation and then freed again, so needs FOLL_LONGTERM. Unfortunately current pup_locked doesn't support FOLL_LONGTERM due to locking issues. Rework the code to pull the pup path out from the mmap_sem critical se

[PATCH 07/13] mm: close race in generic_access_phys

2020-10-07 Thread Daniel Vetter
Way back it was a reasonable assumptions that iomem mappings never change the pfn range they point at. But this has changed: - gpu drivers dynamically manage their memory nowadays, invalidating ptes with unmap_mapping_range when buffers get moved - contiguous dma allocations have moved from ded

[PATCH 03/13] misc/habana: Stop using frame_vector helpers

2020-10-07 Thread Daniel Vetter
All we need are a pages array, pin_user_pages_fast can give us that directly. Plus this avoids the entire raw pfn side of get_vaddr_frames. Signed-off-by: Daniel Vetter Cc: Jason Gunthorpe Cc: Andrew Morton Cc: John Hubbard Cc: Jérôme Glisse Cc: Jan Kara Cc: Dan Williams Cc: linux...@kvack.

[PATCH 00/13] follow_pfn and other iomap races

2020-10-07 Thread Daniel Vetter
Hi all, This developed from a discussion with Jason, starting with some patches touching get_vaddr_frame that I typed up. The problem is that way back VM_IO | VM_PFNMAP mappings were pretty static, and so just following the ptes to derive a pfn and then use that somewhere else was ok. But we're

[PATCH 08/13] s390/pci: Remove races against pte updates

2020-10-07 Thread Daniel Vetter
Way back it was a reasonable assumptions that iomem mappings never change the pfn range they point at. But this has changed: - gpu drivers dynamically manage their memory nowadays, invalidating ptes with unmap_mapping_range when buffers get moved - contiguous dma allocations have moved from dedic

[PATCH 09/13] PCI: obey iomem restrictions for procfs mmap

2020-10-07 Thread Daniel Vetter
There's three ways to access pci bars from userspace: /dev/mem, sysfs files, and the old proc interface. Two check against iomem_is_exclusive, proc never did. And with CONFIG_IO_STRICT_DEVMEM, this starts to matter, since we don't want random userspace having access to pci bars while a driver is lo

[PATCH 02/13] drm/exynos: Use FOLL_LONGTERM for g2d cmdlists

2020-10-07 Thread Daniel Vetter
The exynos g2d interface is very unusual, but it looks like the userptr objects are persistent. Hence they need FOLL_LONGTERM. Signed-off-by: Daniel Vetter Cc: Jason Gunthorpe Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: And

[PATCH 12/13] media/videbuf1|2: Mark follow_pfn usage as unsafe

2020-10-07 Thread Daniel Vetter
The media model assumes that buffers are all preallocated, so that when a media pipeline is running we never miss a deadline because the buffers aren't allocated or available. This means we cannot fix the v4l follow_pfn usage through mmu_notifier, without breaking how this all works. The only real

[PATCH 13/13] vfio/type1: Mark follow_pfn as unsafe

2020-10-07 Thread Daniel Vetter
The code seems to stuff these pfns into iommu pts (or something like that, I didn't follow), but there's no mmu_notifier to ensure that access is synchronized with pte updates. Hence mark these as unsafe. This means that with CONFIG_STRICT_FOLLOW_PFN, these will be rejected. Real fix is to wire u

Re: [PATCH v2 0/3] drm: commit_work scheduling

2020-10-07 Thread Rob Clark
On Mon, Oct 5, 2020 at 5:15 AM Ville Syrjälä wrote: > > On Fri, Oct 02, 2020 at 10:55:52AM -0700, Rob Clark wrote: > > On Fri, Oct 2, 2020 at 4:05 AM Ville Syrjälä > > wrote: > > > > > > On Fri, Oct 02, 2020 at 01:52:56PM +0300, Ville Syrjälä wrote: > > > > On Thu, Oct 01, 2020 at 05:25:55PM +020

Re: [PATCH 2/5] thermal: devfreq_cooling: get a copy of device status

2020-10-07 Thread Ionela Voinescu
On Monday 21 Sep 2020 at 13:20:04 (+0100), Lukasz Luba wrote: > Devfreq cooling needs to now the correct status of the device in order > to operate. Do not rely on Devfreq last_status which might be a stale data > and get more up-to-date values of the load. > > Devfreq framework can change the dev

Re: [PATCH v2 0/3] drm: commit_work scheduling

2020-10-07 Thread Qais Yousef
On 10/07/20 08:57, Rob Clark wrote: > Yeah, I think we will end up making some use of uclamp.. there is > someone else working on that angle > > But without it, this is a case that exposes legit prioritization > problems with commit_work which we should fix ;-) I wasn't suggesting this as an alte

[PATCH v3 4/6] drm/dp: Add LTTPR helpers

2020-10-07 Thread Imre Deak
Add the helpers and register definitions needed to read out the common and per-PHY LTTPR capabilities and perform link training in the LTTPR non-transparent mode. v2: - Add drm_dp_dpcd_read_phy_link_status() and DP_PHY_LTTPR() here instead of adding these to i915. (Ville) v3: - Use memmove() to

Re: [PATCH 05/13] mm/frame-vector: Use FOLL_LONGTERM

2020-10-07 Thread Daniel Vetter
On Wed, Oct 7, 2020 at 6:53 PM Jason Gunthorpe wrote: > > On Wed, Oct 07, 2020 at 06:44:18PM +0200, Daniel Vetter wrote: > > > > - /* > > - * While get_vaddr_frames() could be used for transient (kernel > > - * controlled lifetime) pinning of memory pages all current > > - * use

[PATCH v3 08/20] gpu: host1x: Implement /dev/host1x device node

2020-10-07 Thread Mikko Perttunen
Add the /dev/host1x device node, implementing the following functionality: - Reading syncpoint values - Allocating syncpoints (providing syncpoint FDs) - Incrementing syncpoints (based on syncpoint FD) Signed-off-by: Mikko Perttunen --- v3: * Pass process name as syncpoint name when allocating

[PATCH v3 13/20] gpu: host1x: Reset max value when freeing a syncpoint

2020-10-07 Thread Mikko Perttunen
With job recovery becoming optional, syncpoints may have a mismatch between their value and max value when freed. As such, when freeing, set the max value to the current value of the syncpoint so that it is in a sane state for the next user. Signed-off-by: Mikko Perttunen --- v3: * Use host1x_syn

[PATCH v3 20/20] drm/tegra: Add job firewall

2020-10-07 Thread Mikko Perttunen
Add a firewall that validates jobs before submission to ensure they don't do anything they aren't allowed to do, like accessing memory they should not access. The firewall is functionality-wise a copy of the firewall already implemented in gpu/host1x. It is copied here as it makes more sense for i

[PATCH v3 12/20] gpu: host1x: Add support for syncpoint waits in CDMA pushbuffer

2020-10-07 Thread Mikko Perttunen
Add support for inserting syncpoint waits in the CDMA pushbuffer. These waits need to be done in HOST1X class, while gather submitted by the application execute in engine class. Support is added by converting the gather list of job into a command list that can include both gathers and waits. When

[PATCH v3 16/20] drm/tegra: Boot VIC during runtime PM resume

2020-10-07 Thread Mikko Perttunen
With the new UAPI implementation, engines are powered on and off when there are active jobs, and the core code handles channel allocation. To accommodate that, boot the engine as part of runtime PM instead of using the open_channel callback, which is not used by the new submit path. Signed-off-by:

[PATCH v3 00/20] Host1x/TegraDRM UAPI

2020-10-07 Thread Mikko Perttunen
Hi all, here's the third revision of the Host1x/TegraDRM UAPI proposal. The open issues from RFCv2 should be resolved now, so I'm dropping the RFC tag. The series is still only tested with Tegra186 so I'm hoping for people with devices with other chips to test this out. The test suite[1] has been

[PATCH v3 05/20] gpu: host1x: Use HW-equivalent syncpoint expiration check

2020-10-07 Thread Mikko Perttunen
Make syncpoint expiration checks always use the same logic used by the hardware. This ensures that there are no race conditions that could occur because of the hardware triggering a syncpoint interrupt and then the driver disagreeing. One situation where this could occur is if a job incremented a

[PATCH v3 06/20] gpu: host1x: Cleanup and refcounting for syncpoints

2020-10-07 Thread Mikko Perttunen
Add reference counting for allocated syncpoints to allow keeping them allocated while jobs are referencing them. Additionally, clean up various places using syncpoint IDs to use host1x_syncpt pointers instead. Signed-off-by: Mikko Perttunen --- drivers/gpu/drm/tegra/dc.c | 4 +- drivers

[PATCH v3 02/20] gpu: host1x: Allow syncpoints without associated client

2020-10-07 Thread Mikko Perttunen
Syncpoints don't need to be associated with any client, so remove the property, and expose host1x_syncpt_alloc. This will allow allocating syncpoints without prior knowledge of the engine that it will be used with. Signed-off-by: Mikko Perttunen --- v3: * Clean up host1x_syncpt_alloc signature to

[PATCH v3 17/20] drm/tegra: Set resv fields when importing/exporting GEMs

2020-10-07 Thread Mikko Perttunen
To allow sharing of implicit fences when exporting/importing dma_buf objects, set the 'resv' fields when importing or exporting GEM objects. Signed-off-by: Mikko Perttunen --- drivers/gpu/drm/tegra/gem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/

[PATCH v3 10/20] gpu: host1x: Add no-recovery mode

2020-10-07 Thread Mikko Perttunen
Add a new property for jobs to enable or disable recovery i.e. CPU increments of syncpoints to max value on job timeout. This allows for a more solid model for hanged jobs, where userspace doesn't need to guess if a syncpoint increment happened because the job completed, or because job timeout was

[PATCH v3 01/20] gpu: host1x: Use different lock classes for each client

2020-10-07 Thread Mikko Perttunen
To avoid false lockdep warnings, give each client lock a different lock class, passed from the initialization site by macro. Signed-off-by: Mikko Perttunen --- drivers/gpu/host1x/bus.c | 7 --- include/linux/host1x.h | 9 - 2 files changed, 12 insertions(+), 4 deletions(-) diff --

[PATCH v3 11/20] gpu: host1x: Add job release callback

2020-10-07 Thread Mikko Perttunen
Add a callback field to the job structure, to be called just before the job is to be freed. This allows the job's submitter to clean up any of its own state, like decrement runtime PM refcounts. Signed-off-by: Mikko Perttunen --- drivers/gpu/host1x/job.c | 3 +++ include/linux/host1x.h | 4 +++

[PATCH v3 15/20] drm/tegra: Add new UAPI to header

2020-10-07 Thread Mikko Perttunen
Update the tegra_drm.h UAPI header, adding the new proposed UAPI. The old staging UAPI is left in for now, with minor modification to avoid name collisions. Signed-off-by: Mikko Perttunen --- v3: * Remove timeout field * Inline the syncpt_incrs array to the submit structure * Remove WRITE_RELOC (

[PATCH v3 18/20] drm/tegra: Allocate per-engine channel in core code

2020-10-07 Thread Mikko Perttunen
To avoid duplication, allocate the per-engine shared channel in the core code instead. Once MLOCKs are implemented on Host1x side, we can also update this to avoid allocating a shared channel when MLOCKs are enabled. Signed-off-by: Mikko Perttunen --- drivers/gpu/drm/tegra/drm.c | 11 +++

[PATCH v3 19/20] drm/tegra: Implement new UAPI

2020-10-07 Thread Mikko Perttunen
Implement the new UAPI, and bump the TegraDRM major version. Signed-off-by: Mikko Perttunen --- v3: * Remove WRITE_RELOC. Relocations are now patched implicitly when patching is needed. * Directly call PM runtime APIs on devices instead of using power_on/power_off callbacks. * Remove incorrec

[PATCH v3 09/20] gpu: host1x: DMA fences and userspace fence creation

2020-10-07 Thread Mikko Perttunen
Add an implementation of dma_fences based on syncpoints. Syncpoint interrupts are used to signal fences. Additionally, after software signaling has been enabled, a 30 second timeout is started. If the syncpoint threshold is not reached within this period, the fence is signalled with an -ETIMEDOUT e

[PATCH v3 14/20] gpu: host1x: Reserve VBLANK syncpoints at initialization

2020-10-07 Thread Mikko Perttunen
On T20-T148 chips, the bootloader can set up a boot splash screen with DC configured to increment syncpoint 26/27 at VBLANK. Because of this we shouldn't allow these syncpoints to be allocated until DC has been reset and will no longer increment them in the background. As such, on these chips, res

[PATCH v3 04/20] gpu: host1x: Remove cancelled waiters immediately

2020-10-07 Thread Mikko Perttunen
Before this patch, cancelled waiters would only be cleaned up once their threshold value was reached. Make host1x_intr_put_ref process the cancellation immediately to fix this. Signed-off-by: Mikko Perttunen --- drivers/gpu/host1x/intr.c | 14 +- 1 file changed, 9 insertions(+), 5 de

[PATCH v3 03/20] gpu: host1x: Show number of pending waiters in debugfs

2020-10-07 Thread Mikko Perttunen
Show the number of pending waiters in the debugfs status file. This is useful for testing to verify that waiters do not leak or accumulate incorrectly. Signed-off-by: Mikko Perttunen --- drivers/gpu/host1x/debug.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git

[PATCH v3 07/20] gpu: host1x: Introduce UAPI header

2020-10-07 Thread Mikko Perttunen
Add the userspace interface header, specifying interfaces for allocating and accessing syncpoints from userspace, and for creating sync_file based fences based on syncpoint thresholds. Signed-off-by: Mikko Perttunen --- include/uapi/linux/host1x.h | 134 1 fi

Re: [PATCH 07/13] mm: close race in generic_access_phys

2020-10-07 Thread Daniel Vetter
On Wed, Oct 7, 2020 at 7:27 PM Jason Gunthorpe wrote: > > On Wed, Oct 07, 2020 at 06:44:20PM +0200, Daniel Vetter wrote: > > Way back it was a reasonable assumptions that iomem mappings never > > change the pfn range they point at. But this has changed: > > > > - gpu drivers dynamically manage the

Re: [PATCH 11/13] mm: add unsafe_follow_pfn

2020-10-07 Thread Daniel Vetter
On Wed, Oct 7, 2020 at 7:36 PM Jason Gunthorpe wrote: > > On Wed, Oct 07, 2020 at 06:44:24PM +0200, Daniel Vetter wrote: > > Way back it was a reasonable assumptions that iomem mappings never > > change the pfn range they point at. But this has changed: > > > > - gpu drivers dynamically manage the

Re: [PATCH 13/13] vfio/type1: Mark follow_pfn as unsafe

2020-10-07 Thread Daniel Vetter
On Wed, Oct 7, 2020 at 7:39 PM Jason Gunthorpe wrote: > > On Wed, Oct 07, 2020 at 06:44:26PM +0200, Daniel Vetter wrote: > > The code seems to stuff these pfns into iommu pts (or something like > > that, I didn't follow), but there's no mmu_notifier to ensure that > > access is synchronized with p

Re: [PATCH 10/13] PCI: revoke mappings like devmem

2020-10-07 Thread Bjorn Helgaas
Capitalize subject, like other patches in this series and previous drivers/pci history. On Wed, Oct 07, 2020 at 06:44:23PM +0200, Daniel Vetter wrote: > Since 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims > the region") /dev/kmem zaps ptes when the kernel requests exclusive > accce

Re: [PATCH 09/13] PCI: obey iomem restrictions for procfs mmap

2020-10-07 Thread Bjorn Helgaas
On Wed, Oct 07, 2020 at 06:44:22PM +0200, Daniel Vetter wrote: > There's three ways to access pci bars from userspace: /dev/mem, sysfs > files, and the old proc interface. Two check against > iomem_is_exclusive, proc never did. And with CONFIG_IO_STRICT_DEVMEM, > this starts to matter, since we don

Re: [PATCH 10/13] PCI: revoke mappings like devmem

2020-10-07 Thread Daniel Vetter
On Wed, Oct 7, 2020 at 8:41 PM Bjorn Helgaas wrote: > > Capitalize subject, like other patches in this series and previous > drivers/pci history. > > On Wed, Oct 07, 2020 at 06:44:23PM +0200, Daniel Vetter wrote: > > Since 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims > > the regio

Re: [PATCH 10/13] PCI: revoke mappings like devmem

2020-10-07 Thread Dan Williams
On Wed, Oct 7, 2020 at 11:11 AM Daniel Vetter wrote: > > Since 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims > the region") /dev/kmem zaps ptes when the kernel requests exclusive > acccess to an iomem region. And with CONFIG_IO_STRICT_DEVMEM, this is > the default for all driver us

  1   2   >