Re: [PATCH] drm: Fix drm.h uapi header for Windows

2020-12-03 Thread James Park
I can avoid modifying drm.h by doing this to drm_fourcc.h:

#ifdef _WIN32
#include 
typedef uint64_t __u64;
#else
#include "drm.h"
#endif

And this to amdgpu_drm.h:

#ifdef _WIN32
#include 
typedef int32_t  __s32;
typedef uint32_t __u32;
typedef uint64_t __u64;
#else
#include "drm.h"
#endif

But now I'm touching two files under drm-uapi instead of one, and weirdly.

If we're trying to cut ties with the drm-uapi folder entirely, the stuff
ac_surface.c need includes the AMD_FMT_MOD stuff in drm_fourcc.h,
and AMDGPU_TILING_* under amdgpu_drm.h. Is there a better spot for these
definitions?

Thanks,
James

On Wed, Dec 2, 2020 at 10:06 AM Michel Dänzer  wrote:

> On 2020-12-02 1:46 p.m., Daniel Vetter wrote:
> > On Wed, Dec 2, 2020 at 12:43 PM Michel Dänzer 
> wrote:
> >>
> >> On 2020-12-01 11:01 a.m., James Park wrote:
> >>> This will allow Mesa to port code to Windows more easily.
> >>
> >> As discussed in
> >>
> https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6162#note_712779
> >> , including drm.h makes no sense when building for Windows.
> >
> > Yeah I think it'd be cleanest if we can avoid this. If not I think the
> > right fix would be to split out the actually needed parts from drm.h
> > into a new header (still included by drm.h for backwards compat
> > reasons) which mesa can use. Since it looks like the problematic parts
> > are the legacy gunk, and not the new ioctl structures. Pulling out
> > drm_render.h for all the render stuff and mabe drm_vblank.h for the
> > vblank stuff (which would fit better in drm_mode.h but mistakes were
> > made, oops).
>
> If anything currently in drm.h is needed while building for Windows, it
> points to a broken abstraction somewhere in userspace. (Specifically,
> the Mesa Gallium/Vulkan winsys is supposed to abstract away platform
> details like these)
>
>
> --
> Earthling Michel Dänzer   |   https://redhat.com
> Libre software enthusiast | Mesa and X developer
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


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

2020-12-03 Thread Ionela Voinescu
Hi Lukasz,

On Wednesday 18 Nov 2020 at 12:03:56 (+), Lukasz Luba wrote:
> + * Register a devfreq cooling device and attempt to register Energy Model. 
> The
> + * available OPPs must be registered for the device.
> + *
> + * If @dfc_power is provided, the cooling device is registered with the
> + * power extensions. If @em_cb is provided it will be called for each OPP to
> + * calculate power value and cost. If @em_cb is not provided then simple 
> Energy
> + * Model is going to be used, which requires "dynamic-power-coefficient" a
> + * devicetree property.
> + */
> +struct thermal_cooling_device *
> +devfreq_cooling_em_register_power(struct devfreq *df,
> +   struct devfreq_cooling_power *dfc_power,
> +   struct em_data_callback *em_cb)
> +{
> + struct thermal_cooling_device *cdev;
> + struct devfreq_cooling_device *dfc;
> + struct device_node *np = NULL;
> + struct device *dev;
> + int nr_opp, ret;
> +
> + if (IS_ERR_OR_NULL(df))
> + return ERR_PTR(-EINVAL);
> +
> + dev = df->dev.parent;
> +
> + if (em_cb) {
> + nr_opp = dev_pm_opp_get_opp_count(dev);
> + if (nr_opp <= 0) {
> + dev_err(dev, "No valid OPPs found\n");
> + return ERR_PTR(-EINVAL);
> + }
> +
> + ret = em_dev_register_perf_domain(dev, nr_opp, em_cb, NULL, 
> false);
> + } else {
> + ret = dev_pm_opp_of_register_em(dev, NULL);
> + }
> +
> + if (ret)
> + dev_warn(dev, "Unable to register EM for devfreq cooling device 
> (%d)\n",
> +  ret);
> +
> + if (dev->of_node)
> + np = of_node_get(dev->of_node);
> +

Should np be checked before use? I'm not sure if it's better to do the
assign first and then the check on np before use. It depends on the
consequences of passing a NULL node pointer later on.

> + cdev = of_devfreq_cooling_register_power(np, df, dfc_power);
> +
> + if (np)
> + of_node_put(np);
> +
> + if (IS_ERR_OR_NULL(cdev)) {
> + if (!ret)
> + em_dev_unregister_perf_domain(dev);
> + } else {
> + dfc = cdev->devdata;
> + dfc->em_registered = !ret;
> + }
> +
> + return cdev;
> +}
> +EXPORT_SYMBOL_GPL(devfreq_cooling_em_register_power);
> +
> +/**
> + * devfreq_cooling_em_register() - Register devfreq cooling device together
> + *   with Energy Model.
> + * @df:  Pointer to devfreq device.
> + * @em_cb:   Callback functions providing the data of the Energy Model
> + *
> + * This function attempts to register Energy Model for devfreq device and 
> then
> + * register the devfreq cooling device.
> + */
> +struct thermal_cooling_device *
> +devfreq_cooling_em_register(struct devfreq *df, struct em_data_callback 
> *em_cb)
> +{
> + return devfreq_cooling_em_register_power(df, NULL, em_cb);
> +}
> +EXPORT_SYMBOL_GPL(devfreq_cooling_em_register);
> +
>  /**
>   * devfreq_cooling_unregister() - Unregister devfreq cooling device.
>   * @cdev: Pointer to devfreq cooling device to unregister.
> + *
> + * Unregisters devfreq cooling device and related Energy Model if it was
> + * present.
>   */
>  void devfreq_cooling_unregister(struct thermal_cooling_device *cdev)
>  {
>   struct devfreq_cooling_device *dfc;
> + struct device *dev;
>  
> - if (!cdev)
> + if (IS_ERR_OR_NULL(cdev))
>   return;
>  
>   dfc = cdev->devdata;
> + dev = dfc->devfreq->dev.parent;
>  
>   thermal_cooling_device_unregister(dfc->cdev);
>   ida_simple_remove(&devfreq_ida, dfc->id);
>   dev_pm_qos_remove_request(&dfc->req_max_freq);
> +
> + if (dfc->em_registered)
> + em_dev_unregister_perf_domain(dev);
> +
>   kfree(dfc->power_table);
>   kfree(dfc->freq_table);
>  
> diff --git a/include/linux/devfreq_cooling.h b/include/linux/devfreq_cooling.h
> index 9df2dfca68dd..19868fb922f1 100644
> --- a/include/linux/devfreq_cooling.h
> +++ b/include/linux/devfreq_cooling.h
> @@ -11,6 +11,7 @@
>  #define __DEVFREQ_COOLING_H__
>  
>  #include 
> +#include 
>  #include 
>  
>  
> @@ -65,6 +66,13 @@ struct thermal_cooling_device *
>  of_devfreq_cooling_register(struct device_node *np, struct devfreq *df);
>  struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df);
>  void devfreq_cooling_unregister(struct thermal_cooling_device *dfc);
> +struct thermal_cooling_device *
> +devfreq_cooling_em_register_power(struct devfreq *df,
> +   struct devfreq_cooling_power *dfc_power,
> +   struct em_data_callback *em_cb);
> +struct thermal_cooling_device *
> +devfreq_cooling_em_register(struct devfreq *df,
> + struct em_data_callback *em_cb);
>  
>  #else /* !CONFIG_DEVFREQ_THERMAL */
>  
> @@ -87,6 +95,20 @@ devfreq_cooling_register(struct devf

[PATCH v2 2/6] dt-bindings: display: imx: Add i.MX8qxp/qm PRG binding

2020-12-03 Thread Liu Ying
This patch adds bindings for i.MX8qxp/qm Display Prefetch Resolve Gasket.

Signed-off-by: Liu Ying 
---
Note that this depends on the 'two cell binding' clock patch set which has
already landed in Shawn's i.MX clk/imx git branch.  Otherwise, imx8-lpcg.h
won't be found.

v1->v2:
* Use new dt binding way to add clocks in the example.

 .../bindings/display/imx/fsl,imx8qxp-prg.yaml  | 60 ++
 1 file changed, 60 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-prg.yaml

diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-prg.yaml 
b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-prg.yaml
new file mode 100644
index ..d59e2db
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/imx/fsl,imx8qxp-prg.yaml
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/imx/fsl,imx8qxp-prg.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX8qm/qxp Display Prefetch Resolve Gasket
+
+maintainers:
+  - Liu Ying 
+
+description: |
+  The i.MX8qm/qxp Prefetch Resolve Gasket (PRG) is a gasket interface between
+  RTRAM controller and Display Controller.  The main function is to convert
+  the AXI interface to the RTRAM interface, which includes re-mapping the
+  ARADDR to a RTRAM address.
+
+properties:
+  compatible:
+oneOf:
+  - const: fsl,imx8qxp-prg
+  - const: fsl,imx8qm-prg
+
+  reg:
+maxItems: 1
+
+  clocks:
+items:
+  - description: rtram clock
+  - description: apb clock
+
+  clock-names:
+items:
+  - const: rtram
+  - const: apb
+
+  power-domains:
+maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - power-domains
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+#include 
+prg@5604 {
+compatible = "fsl,imx8qxp-prg";
+reg = <0x5604 0x1>;
+clocks = <&dc0_prg0_lpcg IMX_LPCG_CLK_0>,
+ <&dc0_prg0_lpcg IMX_LPCG_CLK_4>;
+clock-names = "rtram", "apb";
+power-domains = <&pd IMX_SC_R_DC_0>;
+};
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm: Fix drm.h uapi header for Windows

2020-12-03 Thread James Park
Attempting to submit patch in response to 
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6162#note_712454

This will allow Mesa to port code to Windows more easily.

Hide BSD header and drm_handle_t behind _WIN32 check.

Change __volatile__ to volatile, which is standard.

Signed-off-by: James Park 

James Park (1):
  drm: Fix drm.h uapi header for Windows

 include/uapi/drm/drm.h | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 3/8] dt-bindings: display: simple: Add Kyocera tcg070wvlq panel

2020-12-03 Thread Oleksij Rempel
So far, this panel seems to be compatible with "lg,lb070wv8", on other
hand it is better to set this compatible in the devicetree. So, let's
add it for now only to the dt-binding documentation to fix the
checkpatch warnings.

Signed-off-by: Oleksij Rempel 
---
 .../devicetree/bindings/display/panel/panel-simple.yaml  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml 
b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
index 0bb3e67fb58c..8f7a0e409eee 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
+++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
@@ -172,6 +172,7 @@ properties:
   - koe,tx26d202vm0bwa
 # Kaohsiung Opto-Electronics. TX31D200VM0BAA 12.3" HSXGA LVDS panel
   - koe,tx31d200vm0baa
+  - kyo,tcg070wvlq
 # Kyocera Corporation 12.1" XGA (1024x768) TFT LCD panel
   - kyo,tcg121xglp
 # LeMaker BL035-RGB-002 3.5" QVGA TFT LCD panel
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH drm/hisilicon v2 3/3] drm/hisilicon: Use the new api devm_drm_irq_install

2020-12-03 Thread Tian Tao
Use devm_drm_irq_install to register interrupts so that
drm_irq_uninstall is not called when hibmc is removed.

Signed-off-by: Tian Tao 
Reviewed-by: Thomas Zimmermann 
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c 
b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 13e8a28..8020604 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -247,9 +247,6 @@ static int hibmc_unload(struct drm_device *dev)
 
drm_atomic_helper_shutdown(dev);
 
-   if (dev->irq_enabled)
-   drm_irq_uninstall(dev);
-
pci_disable_msi(dev->pdev);
hibmc_kms_fini(priv);
hibmc_mm_fini(priv);
@@ -284,7 +281,7 @@ static int hibmc_load(struct drm_device *dev)
if (ret) {
drm_warn(dev, "enabling MSI failed: %d\n", ret);
} else {
-   ret = drm_irq_install(dev, dev->pdev->irq);
+   ret = devm_drm_irq_install(dev, dev->pdev->irq);
if (ret)
drm_warn(dev, "install irq failed: %d\n", ret);
}
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 2/8] dt-bindings: display: simple: add EDT compatibles already supported by the driver

2020-12-03 Thread Oleksij Rempel
Some EDT compatibles are already supported by the driver but will fail
on checkpatch script. Fix it by syncing dt-bindings documentation with the
driver.

Signed-off-by: Oleksij Rempel 
---
 .../devicetree/bindings/display/panel/panel-simple.yaml| 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml 
b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
index 428b03342fea..0bb3e67fb58c 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
+++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
@@ -108,10 +108,12 @@ properties:
 # Emerging Display Technology Corp. 480x272 TFT Display with 
capacitive touch
   - edt,et057090dhu
 # Emerging Display Technology Corp. WVGA TFT Display with capacitive 
touch
+  - edt,et070080dh6
   - edt,etm043080dh6gp
 # Emerging Display Technology Corp. 480x272 TFT Display
   - edt,etm0430g0dh6
 # Emerging Display Technology Corp. 5.7" VGA TFT LCD panel
+  - edt,etm0700g0bdh6
   - edt,etm070080bdh6
 # Emerging Display Technology Corp. WVGA TFT Display with capacitive 
touch
 # Same display as the ETM0700G0BDH6, but with changed hardware for the
@@ -124,6 +126,7 @@ properties:
   - edt,etm0700g0dh6
 # Emerging Display Technology Corp. WVGA TFT Display with capacitive 
touch
 # Same as ETM0700G0DH6 but with inverted pixel clock.
+  - edt,etm0700g0edh6
   - evervision,vgg804821
 # Foxlink Group 5" WVGA TFT LCD panel
   - foxlink,fl500wvr00-a0t
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


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

2020-12-03 Thread Ionela Voinescu
On Wednesday 02 Dec 2020 at 11:14:02 (+), Lukasz Luba wrote:
> Hi Ionela,
> 
> On 12/2/20 10:24 AM, Ionela Voinescu wrote:
> > Hi Lukasz,
> > 
> > On Wednesday 18 Nov 2020 at 12:03:56 (+), Lukasz Luba wrote:
> 
> [snip]
> 
> > > + struct device_node *np = NULL;
> 
> [snip]
> 
> > > +
> > > + if (dev->of_node)
> > > + np = of_node_get(dev->of_node);
> > > +
> > 
> > Should np be checked before use? I'm not sure if it's better to do the
> > assign first and then the check on np before use. It depends on the
> > consequences of passing a NULL node pointer later on.
> 
> The np is actually dev->of_node (or left NULL, as set at the begging).
> The only meaning of the line above is to increment the counter and then
> decrement if CONFIG_OF_DYNAMIC was used.
> The devfreq_cooling_register() has np = NULL and the registration can
> handle it, so we should be OK here as well.
> 

Yes, I just wanted to make sure later registration can handle np = NULL,
or whether we need to bail out.

In this case, you can drop both ifs - for (dev->of_node) before get and
for np before put below, as of_node_get/of_node_put can handle NULL
pointers themselves.

Thanks,
Ionela.

> > 
> > > + cdev = of_devfreq_cooling_register_power(np, df, dfc_power);
> > > +
> > > + if (np)
> > > + of_node_put(np);
> > > +
> 
> [snip]
> 
> > > 
> > 
> > Otherwise it looks good to me:
> > 
> > Reviewed-by: Ionela Voinescu 
> 
> Thank you for the review.
> 
> Regards,
> Lukasz
> 
> > 
> > Ionela.
> > 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH RESEND 1/2] dma-fence: allow signaling drivers to set fence timestamp

2020-12-03 Thread veeras

On 2020-11-19 03:58, Daniel Vetter wrote:

On Thu, Nov 12, 2020 at 7:27 PM Veera Sundaram Sankaran
 wrote:


Some drivers have hardware capability to get the precise timestamp of
certain events based on which the fences are triggered. This allows it
to set accurate timestamp factoring out any software and IRQ 
latencies.

Move the timestamp parameter out of union in dma_fence struct to allow
signaling drivers to set it. If the parameter is not set, ktime_get is
used to set the current time to fence timestamp during 
dma_fence_signal.


Signed-off-by: Veera Sundaram Sankaran 


So with they "why?" question fully resolved, I think this is a bit too
much a hack. I think much better if we pass the timestamp explicitly,
in a new dma_fence_signal_timestamp variant. That means a bit more
work, but I think it will handle this special case cleaner.

Also means we need to wire the timestamp through the entire call stack
on the drm side too. So we need a drm_send_event_locked_timestamp
variant too for send_vblank_event.
-Daniel



@Sumit Semwal, @Gustavo Padovan, @Steven Rostedt
Can you please help in getting review for the v2 patches.
I have addressed the earlier comments from Daniel Vetter.
https://patchwork.kernel.org/project/dri-devel/list/?series=31&archive=both
Thanks,
Veera


---
 drivers/dma-buf/dma-fence.c | 18 ++
 include/linux/dma-fence.h   | 15 +++
 2 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 43624b4..7cef49a 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -4,6 +4,7 @@
  *
  * Copyright (C) 2012 Canonical Ltd
  * Copyright (C) 2012 Texas Instruments
+ * Copyright (c) 2020 The Linux Foundation. All rights reserved.
  *
  * Authors:
  * Rob Clark 
@@ -329,7 +330,6 @@ void __dma_fence_might_wait(void)
 int dma_fence_signal_locked(struct dma_fence *fence)
 {
struct dma_fence_cb *cur, *tmp;
-   struct list_head cb_list;

lockdep_assert_held(fence->lock);

@@ -337,16 +337,18 @@ int dma_fence_signal_locked(struct dma_fence 
*fence)

  &fence->flags)))
return -EINVAL;

-   /* Stash the cb_list before replacing it with the timestamp */
-   list_replace(&fence->cb_list, &cb_list);
-
-   fence->timestamp = ktime_get();
+   /* set current time, if not set by signaling driver */
+   if (!fence->timestamp)
+   fence->timestamp = ktime_get();
set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
trace_dma_fence_signaled(fence);

-   list_for_each_entry_safe(cur, tmp, &cb_list, node) {
-   INIT_LIST_HEAD(&cur->node);
-   cur->func(fence, cur);
+   if (!list_empty(&fence->cb_list)) {
+   list_for_each_entry_safe(cur, tmp, &fence->cb_list, 
node) {

+   INIT_LIST_HEAD(&cur->node);
+   cur->func(fence, cur);
+   }
+   INIT_LIST_HEAD(&fence->cb_list);
}

return 0;
diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 09e23ad..a9eebaf 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -4,6 +4,7 @@
  *
  * Copyright (C) 2012 Canonical Ltd
  * Copyright (C) 2012 Texas Instruments
+ * Copyright (c) 2020 The Linux Foundation. All rights reserved.
  *
  * Authors:
  * Rob Clark 
@@ -70,26 +71,16 @@ struct dma_fence {
 * release the fence it is unused. No one should be adding to 
the

 * cb_list that they don't themselves hold a reference for.
 *
-* The lifetime of the timestamp is similarly tied to both the
-* rcu freelist and the cb_list. The timestamp is only set 
upon
-* signaling while simultaneously notifying the cb_list. Ergo, 
we

-* only use either the cb_list of timestamp. Upon destruction,
-* neither are accessible, and so we can use the rcu. This 
means
-* that the cb_list is *only* valid until the signal bit is 
set,
-* and to read either you *must* hold a reference to the 
fence,

-* and not just the rcu_read_lock.
-*
 * Listed in chronological order.
 */
union {
struct list_head cb_list;
-   /* @cb_list replaced by @timestamp on 
dma_fence_signal() */

-   ktime_t timestamp;
-   /* @timestamp replaced by @rcu on dma_fence_release() 
*/

+   /* @cb_list replaced by @rcu on dma_fence_release() */
struct rcu_head rcu;
};
u64 context;
u64 seqno;
+   ktime_t timestamp;
unsigned long flags;
struct kref refcount;
int error;
--
2.7.4


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/hisilicon: Use managed VRAM-helper initialization

2020-12-03 Thread Tian Tao
updated to use drmm_vram_helper_init()

Signed-off-by: Tian Tao 
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c |  1 -
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h |  1 -
 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 19 +++
 3 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c 
b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 8020604..5aea2e9 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -249,7 +249,6 @@ static int hibmc_unload(struct drm_device *dev)
 
pci_disable_msi(dev->pdev);
hibmc_kms_fini(priv);
-   hibmc_mm_fini(priv);
dev->dev_private = NULL;
return 0;
 }
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h 
b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h
index 7e0c756..2786de5 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h
@@ -64,7 +64,6 @@ int hibmc_de_init(struct hibmc_drm_private *priv);
 int hibmc_vdac_init(struct hibmc_drm_private *priv);
 
 int hibmc_mm_init(struct hibmc_drm_private *hibmc);
-void hibmc_mm_fini(struct hibmc_drm_private *hibmc);
 int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev,
  struct drm_mode_create_dumb *args);
 int hibmc_ddc_create(struct drm_device *drm_dev, struct hibmc_connector 
*connector);
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c 
b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
index e84fb81..892d566 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
@@ -23,15 +23,12 @@
 
 int hibmc_mm_init(struct hibmc_drm_private *hibmc)
 {
-   struct drm_vram_mm *vmm;
int ret;
struct drm_device *dev = &hibmc->dev;
 
-   vmm = drm_vram_helper_alloc_mm(dev,
-  pci_resource_start(dev->pdev, 0),
-  hibmc->fb_size);
-   if (IS_ERR(vmm)) {
-   ret = PTR_ERR(vmm);
+   ret = drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0),
+   hibmc->fb_size);
+   if (ret) {
drm_err(dev, "Error initializing VRAM MM; %d\n", ret);
return ret;
}
@@ -39,16 +36,6 @@ int hibmc_mm_init(struct hibmc_drm_private *hibmc)
return 0;
 }
 
-void hibmc_mm_fini(struct hibmc_drm_private *hibmc)
-{
-   struct drm_device *dev = &hibmc->dev;
-
-   if (!dev->vram_mm)
-   return;
-
-   drm_vram_helper_release_mm(dev);
-}
-
 int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev,
  struct drm_mode_create_dumb *args)
 {
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH drm/hisilicon 1/3] drm/hisilicon: Code refactoring for hibmc_drm_drv

2020-12-03 Thread Tian Tao
Use the devm_drm_dev_alloc provided by the drm framework to alloc
a structure hibmc_drm_private.

Signed-off-by: Tian Tao 
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c   |  2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c  | 46 +++-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h  |  4 +--
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c |  2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c  |  8 +++--
 5 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c 
b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
index ea962ac..096eea9 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
@@ -499,7 +499,7 @@ static const struct drm_crtc_helper_funcs 
hibmc_crtc_helper_funcs = {
 
 int hibmc_de_init(struct hibmc_drm_private *priv)
 {
-   struct drm_device *dev = priv->dev;
+   struct drm_device *dev = &priv->dev;
struct drm_crtc *crtc = &priv->crtc;
struct drm_plane *plane = &priv->primary_plane;
int ret;
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c 
b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index d845657..13e8a28 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -79,31 +79,32 @@ static const struct dev_pm_ops hibmc_pm_ops = {
 
 static int hibmc_kms_init(struct hibmc_drm_private *priv)
 {
+   struct drm_device *dev = &priv->dev;
int ret;
 
-   drm_mode_config_init(priv->dev);
+   drm_mode_config_init(dev);
priv->mode_config_initialized = true;
 
-   priv->dev->mode_config.min_width = 0;
-   priv->dev->mode_config.min_height = 0;
-   priv->dev->mode_config.max_width = 1920;
-   priv->dev->mode_config.max_height = 1200;
+   dev->mode_config.min_width = 0;
+   dev->mode_config.min_height = 0;
+   dev->mode_config.max_width = 1920;
+   dev->mode_config.max_height = 1200;
 
-   priv->dev->mode_config.fb_base = priv->fb_base;
-   priv->dev->mode_config.preferred_depth = 32;
-   priv->dev->mode_config.prefer_shadow = 1;
+   dev->mode_config.fb_base = priv->fb_base;
+   dev->mode_config.preferred_depth = 32;
+   dev->mode_config.prefer_shadow = 1;
 
-   priv->dev->mode_config.funcs = (void *)&hibmc_mode_funcs;
+   dev->mode_config.funcs = (void *)&hibmc_mode_funcs;
 
ret = hibmc_de_init(priv);
if (ret) {
-   drm_err(priv->dev, "failed to init de: %d\n", ret);
+   drm_err(dev, "failed to init de: %d\n", ret);
return ret;
}
 
ret = hibmc_vdac_init(priv);
if (ret) {
-   drm_err(priv->dev, "failed to init vdac: %d\n", ret);
+   drm_err(dev, "failed to init vdac: %d\n", ret);
return ret;
}
 
@@ -113,7 +114,7 @@ static int hibmc_kms_init(struct hibmc_drm_private *priv)
 static void hibmc_kms_fini(struct hibmc_drm_private *priv)
 {
if (priv->mode_config_initialized) {
-   drm_mode_config_cleanup(priv->dev);
+   drm_mode_config_cleanup(&priv->dev);
priv->mode_config_initialized = false;
}
 }
@@ -202,7 +203,7 @@ static void hibmc_hw_config(struct hibmc_drm_private *priv)
 
 static int hibmc_hw_map(struct hibmc_drm_private *priv)
 {
-   struct drm_device *dev = priv->dev;
+   struct drm_device *dev = &priv->dev;
struct pci_dev *pdev = dev->pdev;
resource_size_t addr, size, ioaddr, iosize;
 
@@ -258,17 +259,9 @@ static int hibmc_unload(struct drm_device *dev)
 
 static int hibmc_load(struct drm_device *dev)
 {
-   struct hibmc_drm_private *priv;
+   struct hibmc_drm_private *priv = to_hibmc_drm_private(dev);
int ret;
 
-   priv = drmm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
-   if (!priv) {
-   drm_err(dev, "no memory to allocate for hibmc_drm_private\n");
-   return -ENOMEM;
-   }
-   dev->dev_private = priv;
-   priv->dev = dev;
-
ret = hibmc_hw_init(priv);
if (ret)
goto err;
@@ -310,6 +303,7 @@ static int hibmc_load(struct drm_device *dev)
 static int hibmc_pci_probe(struct pci_dev *pdev,
   const struct pci_device_id *ent)
 {
+   struct hibmc_drm_private *priv;
struct drm_device *dev;
int ret;
 
@@ -318,12 +312,14 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
if (ret)
return ret;
 
-   dev = drm_dev_alloc(&hibmc_driver, &pdev->dev);
-   if (IS_ERR(dev)) {
+   priv = devm_drm_dev_alloc(&pdev->dev, &hibmc_driver,
+ struct hibmc_drm_private, dev);
+   if (IS_ERR(priv)) {
DRM_ERROR("failed to allocate drm_device\n");
-   return PTR_ERR(dev);
+   return PTR_ERR(priv);
}
 
+   dev = &priv->dev;
dev

Re: [PATCH rdma-core v3 2/6] verbs: Support dma-buf based memory region

2020-12-03 Thread Yishai Hadas

On 11/27/2020 10:55 PM, Jianxin Xiong wrote:

Add new API function and new provider method for registering dma-buf
based memory region. Update the man page and bump the API version.

Signed-off-by: Jianxin Xiong 
---
  debian/libibverbs1.symbols   |  2 ++
  libibverbs/CMakeLists.txt|  2 +-
  libibverbs/cmd_mr.c  | 38 ++
  libibverbs/driver.h  |  7 +++
  libibverbs/dummy_ops.c   | 11 +++
  libibverbs/libibverbs.map.in |  6 ++
  libibverbs/man/ibv_reg_mr.3  | 27 +--
  libibverbs/verbs.c   | 18 ++
  libibverbs/verbs.h   | 11 +++
  9 files changed, 119 insertions(+), 3 deletions(-)



This version still didn't handle the fork() note that was given on 
previous one.


Was that missed ?



diff --git a/debian/libibverbs1.symbols b/debian/libibverbs1.symbols
index 9130f41..fcf4d87 100644
--- a/debian/libibverbs1.symbols
+++ b/debian/libibverbs1.symbols
@@ -9,6 +9,7 @@ libibverbs.so.1 libibverbs1 #MINVER#
   IBVERBS_1.9@IBVERBS_1.9 30
   IBVERBS_1.10@IBVERBS_1.10 31
   IBVERBS_1.11@IBVERBS_1.11 32
+ IBVERBS_1.12@IBVERBS_1.12 33
   (symver)IBVERBS_PRIVATE_33 33
   _ibv_query_gid_ex@IBVERBS_1.11 32
   _ibv_query_gid_table@IBVERBS_1.11 32
@@ -99,6 +100,7 @@ libibverbs.so.1 libibverbs1 #MINVER#
   ibv_rate_to_mbps@IBVERBS_1.1 1.1.8
   ibv_rate_to_mult@IBVERBS_1.0 1.1.6
   ibv_read_sysfs_file@IBVERBS_1.0 1.1.6
+ ibv_reg_dmabuf_mr@IBVERBS_1.12 33
   ibv_reg_mr@IBVERBS_1.0 1.1.6
   ibv_reg_mr@IBVERBS_1.1 1.1.6
   ibv_reg_mr_iova@IBVERBS_1.7 25
diff --git a/libibverbs/CMakeLists.txt b/libibverbs/CMakeLists.txt
index 0fe4256..d075225 100644
--- a/libibverbs/CMakeLists.txt
+++ b/libibverbs/CMakeLists.txt
@@ -21,7 +21,7 @@ configure_file("libibverbs.map.in"
  
  rdma_library(ibverbs "${CMAKE_CURRENT_BINARY_DIR}/libibverbs.map"

# See Documentation/versioning.md
-  1 1.11.${PACKAGE_VERSION}
+  1 1.12.${PACKAGE_VERSION}
all_providers.c
cmd.c
cmd_ah.c
diff --git a/libibverbs/cmd_mr.c b/libibverbs/cmd_mr.c
index 42dbe42..95ed2d1 100644
--- a/libibverbs/cmd_mr.c
+++ b/libibverbs/cmd_mr.c
@@ -1,5 +1,6 @@
  /*
   * Copyright (c) 2018 Mellanox Technologies, Ltd.  All rights reserved.
+ * Copyright (c) 2020 Intel Corporation.  All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
@@ -116,3 +117,40 @@ int ibv_cmd_query_mr(struct ibv_pd *pd, struct verbs_mr 
*vmr,
return 0;
  }
  
+int ibv_cmd_reg_dmabuf_mr(struct ibv_pd *pd, uint64_t offset, size_t length,

+ uint64_t iova, int fd, int access,
+ struct verbs_mr *vmr)
+{
+   DECLARE_COMMAND_BUFFER(cmdb, UVERBS_OBJECT_MR,
+  UVERBS_METHOD_REG_DMABUF_MR,
+  9);
+   struct ib_uverbs_attr *handle;
+   uint32_t lkey, rkey;
+   int ret;
+
+   handle = fill_attr_out_obj(cmdb, UVERBS_ATTR_REG_DMABUF_MR_HANDLE);
+   fill_attr_out_ptr(cmdb, UVERBS_ATTR_REG_DMABUF_MR_RESP_LKEY, &lkey);
+   fill_attr_out_ptr(cmdb, UVERBS_ATTR_REG_DMABUF_MR_RESP_RKEY, &rkey);
+
+   fill_attr_in_obj(cmdb, UVERBS_ATTR_REG_DMABUF_MR_PD_HANDLE, pd->handle);
+   fill_attr_in_uint64(cmdb, UVERBS_ATTR_REG_DMABUF_MR_OFFSET, offset);
+   fill_attr_in_uint64(cmdb, UVERBS_ATTR_REG_DMABUF_MR_LENGTH, length);
+   fill_attr_in_uint64(cmdb, UVERBS_ATTR_REG_DMABUF_MR_IOVA, iova);
+   fill_attr_in_uint32(cmdb, UVERBS_ATTR_REG_DMABUF_MR_FD, fd);
+   fill_attr_in_uint32(cmdb, UVERBS_ATTR_REG_DMABUF_MR_ACCESS_FLAGS, 
access);
+
+   ret = execute_ioctl(pd->context, cmdb);
+   if (ret)
+   return errno;
+
+   vmr->ibv_mr.handle = read_attr_obj(UVERBS_ATTR_REG_DMABUF_MR_HANDLE,
+  handle);
+   vmr->ibv_mr.context = pd->context;
+   vmr->ibv_mr.lkey = lkey;
+   vmr->ibv_mr.rkey = rkey;
+   vmr->ibv_mr.pd = pd;
+   vmr->ibv_mr.addr = (void *)offset;
+   vmr->ibv_mr.length = length;
+   vmr->mr_type = IBV_MR_TYPE_MR;
+   return 0;
+}
diff --git a/libibverbs/driver.h b/libibverbs/driver.h
index ab80f4b..d6a9d0a 100644
--- a/libibverbs/driver.h
+++ b/libibverbs/driver.h
@@ -2,6 +2,7 @@
   * Copyright (c) 2004, 2005 Topspin Communications.  All rights reserved.
   * Copyright (c) 2005, 2006 Cisco Systems, Inc.  All rights reserved.
   * Copyright (c) 2005 PathScale, Inc.  All rights reserved.
+ * Copyright (c) 2020 Intel Corporation. All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
@@ -373,6 +374,9 @@ struct verbs_context_ops {
struct ibv_mr *(*reg_dm_mr)(struct ibv_pd *pd, struct ibv_dm *dm,
uint64_t dm_offset, size_t length,
un

Re: [PATCH v2 1/5] thermal: devfreq_cooling: change tracing function and arguments

2020-12-03 Thread Ionela Voinescu
On Wednesday 18 Nov 2020 at 12:03:54 (+), Lukasz Luba wrote:
> Prepare for deleting the static and dynamic power calculation and clean
> the trace function. These two fields are going to be removed in the next
> changes.
> 
> Reviewed-by: Steven Rostedt (VMware)  # for tracing code
> Signed-off-by: Lukasz Luba 
> ---
>  drivers/thermal/devfreq_cooling.c |  3 +--
>  include/trace/events/thermal.h| 19 +--
>  2 files changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/thermal/devfreq_cooling.c 
> b/drivers/thermal/devfreq_cooling.c
> index dfab49a67252..659c0143c9f0 100644
> --- a/drivers/thermal/devfreq_cooling.c
> +++ b/drivers/thermal/devfreq_cooling.c
> @@ -277,8 +277,7 @@ static int devfreq_cooling_get_requested_power(struct 
> thermal_cooling_device *cd
>   *power = dyn_power + static_power;
>   }
>  
> - trace_thermal_power_devfreq_get_power(cdev, status, freq, dyn_power,
> -   static_power, *power);
> + trace_thermal_power_devfreq_get_power(cdev, status, freq, *power);
>  
>   return 0;
>  fail:
> diff --git a/include/trace/events/thermal.h b/include/trace/events/thermal.h
> index 135e5421f003..8a5f04888abd 100644
> --- a/include/trace/events/thermal.h
> +++ b/include/trace/events/thermal.h
> @@ -153,31 +153,30 @@ TRACE_EVENT(thermal_power_cpu_limit,
>  TRACE_EVENT(thermal_power_devfreq_get_power,
>   TP_PROTO(struct thermal_cooling_device *cdev,
>struct devfreq_dev_status *status, unsigned long freq,
> - u32 dynamic_power, u32 static_power, u32 power),
> + u32 power),
>  
> - TP_ARGS(cdev, status,  freq, dynamic_power, static_power, power),
> + TP_ARGS(cdev, status,  freq, power),
>  
>   TP_STRUCT__entry(
>   __string(type, cdev->type)
>   __field(unsigned long, freq  )
> - __field(u32,   load  )
> - __field(u32,   dynamic_power )
> - __field(u32,   static_power  )
> + __field(u32,   busy_time)
> + __field(u32,   total_time)
>   __field(u32,   power)
>   ),
>  
>   TP_fast_assign(
>   __assign_str(type, cdev->type);
>   __entry->freq = freq;
> - __entry->load = (100 * status->busy_time) / status->total_time;
> - __entry->dynamic_power = dynamic_power;
> - __entry->static_power = static_power;
> + __entry->busy_time = status->busy_time;
> + __entry->total_time = status->total_time;
>   __entry->power = power;
>   ),
>  
> - TP_printk("type=%s freq=%lu load=%u dynamic_power=%u static_power=%u 
> power=%u",
> + TP_printk("type=%s freq=%lu load=%u power=%u",
>   __get_str(type), __entry->freq,
> - __entry->load, __entry->dynamic_power, __entry->static_power,
> + __entry->total_time == 0 ? 0 :
> + (100 * __entry->busy_time) / __entry->total_time,
>   __entry->power)
>  );
>  
> -- 
> 2.17.1
> 

Reviewed-by: Ionela Voinescu 

Regards,
Ionela.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 0/8] mainline Plymovent M2M and BAS board

2020-12-03 Thread Oleksij Rempel
changes v5:
- do more panel-simple.yaml related cleanups

changes v5:
- rebase against latest shawngup/for-next
- add patch to fix checkpatch warning on PLYM2M dts

changes v4:
- add PLYBAS board
- PLYM2M: add touchscreen node
- PLYM2M: add rename led nodes to led-x

changes v3:
- use old style copyright text

changes v2:
- fsl.yaml: reorder ply,plym2m
- imx6dl-plym2m.dts: use hyphen instead of underscore in phy-clock

Oleksij Rempel (8):
  dt-bindings: display: simple: fix alphabetical order for EDT
compatibles
  dt-bindings: display: simple: add EDT compatibles already supported by
the driver
  dt-bindings: display: simple: Add Kyocera tcg070wvlq panel
  dt-bindings: vendor-prefixes: Add an entry for Plymovent
  dt-bindings: arm: fsl: add Plymovent M2M board
  ARM: dts: add Plymovent M2M board
  dt-bindings: arm: fsl: add Plymovent BAS board
  ARM: dts: add Plymovent BAS board

 .../devicetree/bindings/arm/fsl.yaml  |   2 +
 .../bindings/display/panel/panel-simple.yaml  |  20 +-
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/arm/boot/dts/Makefile|   2 +
 arch/arm/boot/dts/imx6dl-plybas.dts   | 394 
 arch/arm/boot/dts/imx6dl-plym2m.dts   | 446 ++
 6 files changed, 857 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/boot/dts/imx6dl-plybas.dts
 create mode 100644 arch/arm/boot/dts/imx6dl-plym2m.dts

-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 0/5] Thermal devfreq cooling improvements with Energy Model

2020-12-03 Thread Daniel Lezcano
On 18/11/2020 13:03, Lukasz Luba wrote:
> Hi all,
> 
> This patch set is a continuation of my previous work, which aimed
> to add Energy Model to all devices. This series is a follow up
> for the patches which got merged to v5.9-rc1. It aims to change
> the thermal devfreq cooling and use the Energy Model instead of
> private power table and structures. The new registration interface
> in the patch 3/5 helps to register devfreq cooling and the EM in one
> call. There is also another improvement, patch 2/5 is changing the
> way how thermal gets the device status. Now it's taken on demand
> and stored as a copy. The last patch wouldn't go through thermal tree,
> but it's here for consistency.

The patch 5/5 is reviewed by the maintainers. If they agree, I can apply
the patch with this series.


-- 
 Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH drm/hisilicon v2 0/3] Add the new api to install irq

2020-12-03 Thread Tian Tao
patch #1 is code refactorings to use devm_drm_dev_alloc.
patch #2 add the new api to install irq, patch #3 is hibmc driver uses
the newly added api to register interrupts.

Changes since v1:
The devm_drm_irq_install function returns devm_add_action_or_reset directly
without checking that devm_add_action_or_reset returns the correct value.

Tian Tao (3):
  drm/hisilicon: Code refactoring for hibmc_drm_drv
  drm/irq: Add the new api to install irq
  drm/hisilicon: Use the new api devm_drm_irq_install

 drivers/gpu/drm/drm_irq.c| 32 +++
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c   |  2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c  | 51 ++--
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h  |  4 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c |  2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c  |  8 ++--
 include/drm/drm_irq.h|  2 +-
 7 files changed, 64 insertions(+), 37 deletions(-)

-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


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

2020-12-03 Thread Lukasz Luba




On 12/2/20 11:49 AM, Ionela Voinescu wrote:

On Wednesday 02 Dec 2020 at 11:14:02 (+), Lukasz Luba wrote:

Hi Ionela,

On 12/2/20 10:24 AM, Ionela Voinescu wrote:

Hi Lukasz,

On Wednesday 18 Nov 2020 at 12:03:56 (+), Lukasz Luba wrote:


[snip]


+   struct device_node *np = NULL;


[snip]


+
+   if (dev->of_node)
+   np = of_node_get(dev->of_node);
+


Should np be checked before use? I'm not sure if it's better to do the
assign first and then the check on np before use. It depends on the
consequences of passing a NULL node pointer later on.


The np is actually dev->of_node (or left NULL, as set at the begging).
The only meaning of the line above is to increment the counter and then
decrement if CONFIG_OF_DYNAMIC was used.
The devfreq_cooling_register() has np = NULL and the registration can
handle it, so we should be OK here as well.



Yes, I just wanted to make sure later registration can handle np = NULL,
or whether we need to bail out.

In this case, you can drop both ifs - for (dev->of_node) before get and
for np before put below, as of_node_get/of_node_put can handle NULL
pointers themselves.


Right. I agree, I will resend this patch with that small change.
Thank you for having a look at it.

Lukasz



Thanks,
Ionela.


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 5/8] dt-bindings: arm: fsl: add Plymovent M2M board

2020-12-03 Thread Oleksij Rempel
Add Plymovent Group BV M2M iMX6dl based board

Signed-off-by: Oleksij Rempel 
Acked-by: Rob Herring 
---
 Documentation/devicetree/bindings/arm/fsl.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/fsl.yaml 
b/Documentation/devicetree/bindings/arm/fsl.yaml
index 4772f64c4463..36c5a0c5ace2 100644
--- a/Documentation/devicetree/bindings/arm/fsl.yaml
+++ b/Documentation/devicetree/bindings/arm/fsl.yaml
@@ -364,6 +364,7 @@ properties:
   - fsl,imx6dl-sabresd# i.MX6 DualLite SABRE Smart Device 
Board
   - karo,imx6dl-tx6dl # Ka-Ro electronics TX6U Modules
   - kontron,imx6dl-samx6i # Kontron i.MX6 Solo SMARC Module
+  - ply,plym2m# Plymovent M2M board
   - poslab,imx6dl-savageboard # Poslab SavageBoard Dual
   - prt,prtrvt# Protonic RVT board
   - prt,prtvt7# Protonic VT7 board
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


<    1   2