linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] get rid of immrbar_virt_to_phys()
@ 2017-02-07  9:05 Christophe Leroy
  2017-02-07  9:05 ` [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode Christophe Leroy
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Christophe Leroy @ 2017-02-07  9:05 UTC (permalink / raw)
  To: Li Yang, Qiang Zhao, Scott Wood, David S. Miller
  Cc: linux-kernel, linuxppc-dev, netdev, linux-arm-kernel

ucc_geth ethernet driver is the only driver using immrbar_virt_to_phys() and it uses it incorrectly.

This patch fixes ucc_geth driver then removes immrbar_virt_to_phys()

Christophe Leroy (2):
  net: ethernet: ucc_geth: fix MEM_PART_MURAM mode
  soc/fsl/qe: get rid of immrbar_virt_to_phys()

 drivers/net/ethernet/freescale/ucc_geth.c |  8 +++-----
 drivers/soc/fsl/qe/qe.c                   |  4 +---
 include/soc/fsl/qe/immap_qe.h             | 19 -------------------
 include/soc/fsl/qe/qe.h                   |  1 +
 4 files changed, 5 insertions(+), 27 deletions(-)

-- 
2.10.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode
  2017-02-07  9:05 [PATCH 0/2] get rid of immrbar_virt_to_phys() Christophe Leroy
@ 2017-02-07  9:05 ` Christophe Leroy
  2017-02-09 10:45   ` Christophe LEROY
  2017-02-09 23:12   ` Li Yang
  2017-02-07  9:05 ` [PATCH 2/2] soc/fsl/qe: get rid of immrbar_virt_to_phys() Christophe Leroy
  2017-02-08 18:17 ` [PATCH 0/2] " David Miller
  2 siblings, 2 replies; 7+ messages in thread
From: Christophe Leroy @ 2017-02-07  9:05 UTC (permalink / raw)
  To: Li Yang, Qiang Zhao, Scott Wood, David S. Miller
  Cc: linux-kernel, linuxppc-dev, netdev, linux-arm-kernel

Since commit 5093bb965a163 ("powerpc/QE: switch to the cpm_muram
implementation"), muram area is not part of immrbar mapping anymore
so immrbar_virt_to_phys() is not usable anymore.

Fixes: 5093bb965a163 ("powerpc/QE: switch to the cpm_muram implementation)
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 drivers/net/ethernet/freescale/ucc_geth.c | 8 +++-----
 include/soc/fsl/qe/qe.h                   | 1 +
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 3f7ae9f..f77ba9f 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -2594,11 +2594,10 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		} else if (ugeth->ug_info->uf_info.bd_mem_part ==
 			   MEM_PART_MURAM) {
 			out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
-				 (u32) immrbar_virt_to_phys(ugeth->
-							    p_tx_bd_ring[i]));
+				 (u32)qe_muram_dma(ugeth->p_tx_bd_ring[i]));
 			out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].
 				 last_bd_completed_address,
-				 (u32) immrbar_virt_to_phys(endOfRing));
+				 (u32)qe_muram_dma(endOfRing));
 		}
 	}
 
@@ -2844,8 +2843,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		} else if (ugeth->ug_info->uf_info.bd_mem_part ==
 			   MEM_PART_MURAM) {
 			out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr,
-				 (u32) immrbar_virt_to_phys(ugeth->
-							    p_rx_bd_ring[i]));
+				 (u32)qe_muram_dma(ugeth->p_rx_bd_ring[i]));
 		}
 		/* rest of fields handled by QE */
 	}
diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h
index 70339d7..0cd4c1147 100644
--- a/include/soc/fsl/qe/qe.h
+++ b/include/soc/fsl/qe/qe.h
@@ -243,6 +243,7 @@ static inline int qe_alive_during_sleep(void)
 #define qe_muram_free cpm_muram_free
 #define qe_muram_addr cpm_muram_addr
 #define qe_muram_offset cpm_muram_offset
+#define qe_muram_dma cpm_muram_dma
 
 #define qe_setbits32(_addr, _v) iowrite32be(ioread32be(_addr) |  (_v), (_addr))
 #define qe_clrbits32(_addr, _v) iowrite32be(ioread32be(_addr) & ~(_v), (_addr))
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] soc/fsl/qe: get rid of immrbar_virt_to_phys()
  2017-02-07  9:05 [PATCH 0/2] get rid of immrbar_virt_to_phys() Christophe Leroy
  2017-02-07  9:05 ` [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode Christophe Leroy
@ 2017-02-07  9:05 ` Christophe Leroy
  2017-02-09 23:17   ` Li Yang
  2017-02-08 18:17 ` [PATCH 0/2] " David Miller
  2 siblings, 1 reply; 7+ messages in thread
From: Christophe Leroy @ 2017-02-07  9:05 UTC (permalink / raw)
  To: Li Yang, Qiang Zhao, Scott Wood, David S. Miller
  Cc: linux-kernel, linuxppc-dev, netdev, linux-arm-kernel

immrbar_virt_to_phys() is not used anymore

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 drivers/soc/fsl/qe/qe.c       |  4 +---
 include/soc/fsl/qe/immap_qe.h | 19 -------------------
 2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c
index ade168f..d9c04f5 100644
--- a/drivers/soc/fsl/qe/qe.c
+++ b/drivers/soc/fsl/qe/qe.c
@@ -66,7 +66,7 @@ static unsigned int qe_num_of_snum;
 
 static phys_addr_t qebase = -1;
 
-phys_addr_t get_qe_base(void)
+static phys_addr_t get_qe_base(void)
 {
 	struct device_node *qe;
 	int ret;
@@ -90,8 +90,6 @@ phys_addr_t get_qe_base(void)
 	return qebase;
 }
 
-EXPORT_SYMBOL(get_qe_base);
-
 void qe_reset(void)
 {
 	if (qe_immr == NULL)
diff --git a/include/soc/fsl/qe/immap_qe.h b/include/soc/fsl/qe/immap_qe.h
index c76ef30..7baaabd 100644
--- a/include/soc/fsl/qe/immap_qe.h
+++ b/include/soc/fsl/qe/immap_qe.h
@@ -464,25 +464,6 @@ struct qe_immap {
 } __attribute__ ((packed));
 
 extern struct qe_immap __iomem *qe_immr;
-extern phys_addr_t get_qe_base(void);
-
-/*
- * Returns the offset within the QE address space of the given pointer.
- *
- * Note that the QE does not support 36-bit physical addresses, so if
- * get_qe_base() returns a number above 4GB, the caller will probably fail.
- */
-static inline phys_addr_t immrbar_virt_to_phys(void *address)
-{
-	void *q = (void *)qe_immr;
-
-	/* Is it a MURAM address? */
-	if ((address >= q) && (address < (q + QE_IMMAP_SIZE)))
-		return get_qe_base() + (address - q);
-
-	/* It's an address returned by kmalloc */
-	return virt_to_phys(address);
-}
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_IMMAP_QE_H */
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] get rid of immrbar_virt_to_phys()
  2017-02-07  9:05 [PATCH 0/2] get rid of immrbar_virt_to_phys() Christophe Leroy
  2017-02-07  9:05 ` [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode Christophe Leroy
  2017-02-07  9:05 ` [PATCH 2/2] soc/fsl/qe: get rid of immrbar_virt_to_phys() Christophe Leroy
@ 2017-02-08 18:17 ` David Miller
  2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2017-02-08 18:17 UTC (permalink / raw)
  To: christophe.leroy
  Cc: leoli, qiang.zhao, oss, linux-kernel, linuxppc-dev, netdev,
	linux-arm-kernel

From: Christophe Leroy <christophe.leroy@c-s.fr>
Date: Tue,  7 Feb 2017 10:05:07 +0100 (CET)

> ucc_geth ethernet driver is the only driver using immrbar_virt_to_phys() and it uses it incorrectly.
> 
> This patch fixes ucc_geth driver then removes immrbar_virt_to_phys()

Feel free to merge this via whatever tree handles that SOC fsl driver.

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode
  2017-02-07  9:05 ` [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode Christophe Leroy
@ 2017-02-09 10:45   ` Christophe LEROY
  2017-02-09 23:12   ` Li Yang
  1 sibling, 0 replies; 7+ messages in thread
From: Christophe LEROY @ 2017-02-09 10:45 UTC (permalink / raw)
  To: Li Yang, Qiang Zhao, Scott Wood, David S. Miller
  Cc: netdev, linuxppc-dev, linux-kernel, linux-arm-kernel

Acked-by: David S. Miller <davem@davemloft.net>

Le 07/02/2017 à 10:05, Christophe Leroy a écrit :
> Since commit 5093bb965a163 ("powerpc/QE: switch to the cpm_muram
> implementation"), muram area is not part of immrbar mapping anymore
> so immrbar_virt_to_phys() is not usable anymore.
>
> Fixes: 5093bb965a163 ("powerpc/QE: switch to the cpm_muram implementation)
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>  drivers/net/ethernet/freescale/ucc_geth.c | 8 +++-----
>  include/soc/fsl/qe/qe.h                   | 1 +
>  2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
> index 3f7ae9f..f77ba9f 100644
> --- a/drivers/net/ethernet/freescale/ucc_geth.c
> +++ b/drivers/net/ethernet/freescale/ucc_geth.c
> @@ -2594,11 +2594,10 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>  		} else if (ugeth->ug_info->uf_info.bd_mem_part ==
>  			   MEM_PART_MURAM) {
>  			out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
> -				 (u32) immrbar_virt_to_phys(ugeth->
> -							    p_tx_bd_ring[i]));
> +				 (u32)qe_muram_dma(ugeth->p_tx_bd_ring[i]));
>  			out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].
>  				 last_bd_completed_address,
> -				 (u32) immrbar_virt_to_phys(endOfRing));
> +				 (u32)qe_muram_dma(endOfRing));
>  		}
>  	}
>
> @@ -2844,8 +2843,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>  		} else if (ugeth->ug_info->uf_info.bd_mem_part ==
>  			   MEM_PART_MURAM) {
>  			out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr,
> -				 (u32) immrbar_virt_to_phys(ugeth->
> -							    p_rx_bd_ring[i]));
> +				 (u32)qe_muram_dma(ugeth->p_rx_bd_ring[i]));
>  		}
>  		/* rest of fields handled by QE */
>  	}
> diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h
> index 70339d7..0cd4c1147 100644
> --- a/include/soc/fsl/qe/qe.h
> +++ b/include/soc/fsl/qe/qe.h
> @@ -243,6 +243,7 @@ static inline int qe_alive_during_sleep(void)
>  #define qe_muram_free cpm_muram_free
>  #define qe_muram_addr cpm_muram_addr
>  #define qe_muram_offset cpm_muram_offset
> +#define qe_muram_dma cpm_muram_dma
>
>  #define qe_setbits32(_addr, _v) iowrite32be(ioread32be(_addr) |  (_v), (_addr))
>  #define qe_clrbits32(_addr, _v) iowrite32be(ioread32be(_addr) & ~(_v), (_addr))
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode
  2017-02-07  9:05 ` [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode Christophe Leroy
  2017-02-09 10:45   ` Christophe LEROY
@ 2017-02-09 23:12   ` Li Yang
  1 sibling, 0 replies; 7+ messages in thread
From: Li Yang @ 2017-02-09 23:12 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Qiang Zhao, Scott Wood, David S. Miller, lkml, linuxppc-dev,
	Netdev, linux-arm-kernel

On Tue, Feb 7, 2017 at 3:05 AM, Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
> Since commit 5093bb965a163 ("powerpc/QE: switch to the cpm_muram
> implementation"), muram area is not part of immrbar mapping anymore
> so immrbar_virt_to_phys() is not usable anymore.
>
> Fixes: 5093bb965a163 ("powerpc/QE: switch to the cpm_muram implementation)
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Acked-by: Li Yang <pku.leo@gmail.com>

Regards,
Leo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] soc/fsl/qe: get rid of immrbar_virt_to_phys()
  2017-02-07  9:05 ` [PATCH 2/2] soc/fsl/qe: get rid of immrbar_virt_to_phys() Christophe Leroy
@ 2017-02-09 23:17   ` Li Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Li Yang @ 2017-02-09 23:17 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Qiang Zhao, Scott Wood, David S. Miller, lkml, linuxppc-dev,
	Netdev, linux-arm-kernel

On Tue, Feb 7, 2017 at 3:05 AM, Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
> immrbar_virt_to_phys() is not used anymore
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Acked-by: Li Yang <pku.leo@gmail.com>

Regards,
Leo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-02-09 23:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07  9:05 [PATCH 0/2] get rid of immrbar_virt_to_phys() Christophe Leroy
2017-02-07  9:05 ` [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode Christophe Leroy
2017-02-09 10:45   ` Christophe LEROY
2017-02-09 23:12   ` Li Yang
2017-02-07  9:05 ` [PATCH 2/2] soc/fsl/qe: get rid of immrbar_virt_to_phys() Christophe Leroy
2017-02-09 23:17   ` Li Yang
2017-02-08 18:17 ` [PATCH 0/2] " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).