Re: [PATCH 6/7] drm/tilcdc: clean up ifdef hacks around iowrite64

2017-06-26 Thread Jyri Sarha
On 06/22/17 19:48, Logan Gunthorpe wrote:
> Now that we can expect iowrite64 to always exist the hack is no longer
> necessary so we just call iowrite64 directly.
> 
> Signed-off-by: Logan Gunthorpe <log...@deltatee.com>
> Cc: Jyri Sarha <jsa...@ti.com>
> Cc: Tomi Valkeinen <tomi.valkei...@ti.com>
> Cc: David Airlie <airl...@linux.ie>

Acked-by: Jyri Sarha <jsa...@ti.com>

And thanks!

> ---
>  drivers/gpu/drm/tilcdc/tilcdc_regs.h | 6 --
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_regs.h 
> b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
> index e9ce725698a9..0b901405f30a 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_regs.h
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
> @@ -133,13 +133,7 @@ static inline void tilcdc_write64(struct drm_device 
> *dev, u32 reg, u64 data)
>   struct tilcdc_drm_private *priv = dev->dev_private;
>   void __iomem *addr = priv->mmio + reg;
>  
> -#ifdef iowrite64
>   iowrite64(data, addr);
> -#else
> - __iowmb();
> - /* This compiles to strd (=64-bit write) on ARM7 */
> - *(u64 __force *)addr = __cpu_to_le64(data);
> -#endif
>  }
>  
>  static inline u32 tilcdc_read(struct drm_device *dev, u32 reg)
> 



Re: [PATCH 1/7] drm/tilcdc: don't use volatile with iowrite64

2017-06-26 Thread Jyri Sarha
On 06/22/17 19:48, Logan Gunthorpe wrote:
> This is a prep patch for adding a universal iowrite64.
> 
> The patch is to prevent compiler warnings when we add iowrite64 that
> would occur because there is an unnecessary volatile in this driver.
> 
> Signed-off-by: Logan Gunthorpe <log...@deltatee.com>
> Cc: Jyri Sarha <jsa...@ti.com>
> Cc: Tomi Valkeinen <tomi.valkei...@ti.com>
> Cc: David Airlie <airl...@linux.ie>

Acked-by: Jyri Sarha <jsa...@ti.com>

> ---
>  drivers/gpu/drm/tilcdc/tilcdc_regs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_regs.h 
> b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
> index 9d528c0a67a4..e9ce725698a9 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_regs.h
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
> @@ -131,14 +131,14 @@ static inline void tilcdc_write(struct drm_device *dev, 
> u32 reg, u32 data)
>  static inline void tilcdc_write64(struct drm_device *dev, u32 reg, u64 data)
>  {
>   struct tilcdc_drm_private *priv = dev->dev_private;
> - volatile void __iomem *addr = priv->mmio + reg;
> + void __iomem *addr = priv->mmio + reg;
>  
>  #ifdef iowrite64
>   iowrite64(data, addr);
>  #else
>   __iowmb();
>   /* This compiles to strd (=64-bit write) on ARM7 */
> - *(volatile u64 __force *)addr = __cpu_to_le64(data);
> + *(u64 __force *)addr = __cpu_to_le64(data);
>  #endif
>  }
>  
> 



Re: [PATCH v8 43/45] drivers/of: Specify parent node in of_fdt_unflatten_tree()

2016-02-17 Thread Jyri Sarha

On 02/17/16 05:44, Gavin Shan wrote:

This adds one more argument to of_fdt_unflatten_tree() to specify
the parent node of the FDT blob that is going to be unflattened.
In the result, the function can be used to unflatten FDT blob that
represents device sub-tree in PowerNV PCI hotplug driver.

Cc: Jyri Sarha <jsa...@ti.com>
Signed-off-by: Gavin Shan <gws...@linux.vnet.ibm.com>
---
  drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c |  2 +-


Acked-by: Jyri Sarha <jsa...@ti.com>


  drivers/of/fdt.c | 14 ++
  drivers/of/unittest.c|  2 +-
  include/linux/of_fdt.h   |  1 +
  4 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c 
b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
index 106679b..f9c79da 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
@@ -157,7 +157,7 @@ struct device_node * __init tilcdc_get_overlay(struct 
kfree_table *kft)
if (!overlay_data || kfree_table_add(kft, overlay_data))
return NULL;

-   of_fdt_unflatten_tree(overlay_data, );
+   of_fdt_unflatten_tree(overlay_data, NULL, );
if (!overlay) {
pr_warn("%s: Unfattening overlay tree failed\n", __func__);
return NULL;
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 3fc9a30..16a1ba5 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -450,11 +450,13 @@ static int unflatten_dt_nodes(const void *blob,
   * pointers of the nodes so the normal device-tree walking functions
   * can be used.
   * @blob: The blob to expand
+ * @dad: Parent device node
   * @mynodes: The device_node tree created by the call
   * @dt_alloc: An allocator that provides a virtual address to memory
   * for the resulting tree
   */
  static void __unflatten_device_tree(const void *blob,
+struct device_node *dad,
 struct device_node **mynodes,
 void * (*dt_alloc)(u64 size, u64 align))
  {
@@ -479,7 +481,7 @@ static void __unflatten_device_tree(const void *blob,
}

/* First pass, scan for size */
-   size = unflatten_dt_nodes(blob, NULL, NULL, NULL);
+   size = unflatten_dt_nodes(blob, NULL, dad, NULL);
if (size < 0)
return;

@@ -495,7 +497,7 @@ static void __unflatten_device_tree(const void *blob,
pr_debug("  unflattening %p...\n", mem);

/* Second pass, do actual unflattening */
-   unflatten_dt_nodes(blob, mem, NULL, mynodes);
+   unflatten_dt_nodes(blob, mem, dad, mynodes);
if (be32_to_cpup(mem + size) != 0xdeadbeef)
pr_warning("End of tree marker overwritten: %08x\n",
   be32_to_cpup(mem + size));
@@ -512,6 +514,9 @@ static DEFINE_MUTEX(of_fdt_unflatten_mutex);

  /**
   * of_fdt_unflatten_tree - create tree of device_nodes from flat blob
+ * @blob: Flat device tree blob
+ * @dad: Parent device node
+ * @mynodes: The device tree created by the call
   *
   * unflattens the device-tree passed by the firmware, creating the
   * tree of struct device_node. It also fills the "name" and "type"
@@ -519,10 +524,11 @@ static DEFINE_MUTEX(of_fdt_unflatten_mutex);
   * can be used.
   */
  void of_fdt_unflatten_tree(const unsigned long *blob,
+   struct device_node *dad,
struct device_node **mynodes)
  {
mutex_lock(_fdt_unflatten_mutex);
-   __unflatten_device_tree(blob, mynodes, _tree_alloc);
+   __unflatten_device_tree(blob, dad, mynodes, _tree_alloc);
mutex_unlock(_fdt_unflatten_mutex);
  }
  EXPORT_SYMBOL_GPL(of_fdt_unflatten_tree);
@@ -1180,7 +1186,7 @@ bool __init early_init_dt_scan(void *params)
   */
  void __init unflatten_device_tree(void)
  {
-   __unflatten_device_tree(initial_boot_params, _root,
+   __unflatten_device_tree(initial_boot_params, NULL, _root,
early_init_dt_alloc_memory_arch);

/* Get pointer to "/chosen" and "/aliases" nodes for use everywhere */
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 979b6e4..ec36f93 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -921,7 +921,7 @@ static int __init unittest_data_add(void)
"not running tests\n", __func__);
return -ENOMEM;
}
-   of_fdt_unflatten_tree(unittest_data, _data_node);
+   of_fdt_unflatten_tree(unittest_data, NULL, _data_node);
if (!unittest_data_node) {
pr_warn("%s: No tree to attach; not running tests\n", __func__);
return -ENODATA;
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index df9ef38..3644960 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_