netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] net: qcom/emac: extend DMA mask to 46bits
@ 2018-01-23  4:25 Wang Dongsheng
  2018-01-23  4:48 ` Timur Tabi
  2018-01-24 21:32 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Wang Dongsheng @ 2018-01-23  4:25 UTC (permalink / raw)
  To: timur; +Cc: hpuranik, netdev, linux-kernel, Wang Dongsheng

Bit TPD3[31] is used as a timestamp bit if PTP is enabled, but
it's used as an address bit if PTP is disabled.  Since PTP isn't
supported by the driver, we can extend the DMA address to 46 bits.

Signed-off-by: Wang Dongsheng <dongsheng.wang@hxt-semitech.com>
---
v4:
- Changes: PATCH's description.
v3:
- Add: comments for TPD_BUFFER_ADDR_H_SET.
- Remove: "Dynamic fix TPD_BUFFER_ADDR_H_SET size."
v2:
- Add: Dynamic fix TPD_BUFFER_ADDR_H_SET size.
- Add: Comments for DMA MASK.
- Changes: PATCH subject.
- Modify: DMA MASK to 46bits.
---
 drivers/net/ethernet/qualcomm/emac/emac-mac.h | 3 ++-
 drivers/net/ethernet/qualcomm/emac/emac.c     | 7 +++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.h b/drivers/net/ethernet/qualcomm/emac/emac-mac.h
index 5028fb4..4beedb8 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-mac.h
+++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.h
@@ -114,8 +114,9 @@ struct emac_tpd {
 #define TPD_INSTC_SET(tpd, val)		BITS_SET((tpd)->word[3], 17, 17, val)
 /* High-14bit Buffer Address, So, the 64b-bit address is
  * {DESC_CTRL_11_TX_DATA_HIADDR[17:0],(register) BUFFER_ADDR_H, BUFFER_ADDR_L}
+ * Extend TPD_BUFFER_ADDR_H to [31, 18], because we never enable timestamping.
  */
-#define TPD_BUFFER_ADDR_H_SET(tpd, val)	BITS_SET((tpd)->word[3], 18, 30, val)
+#define TPD_BUFFER_ADDR_H_SET(tpd, val)	BITS_SET((tpd)->word[3], 18, 31, val)
 /* Format D. Word offset from the 1st byte of this packet to start to calculate
  * the custom checksum.
  */
diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c
index 38c924bd..13235ba 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac.c
@@ -615,8 +615,11 @@ static int emac_probe(struct platform_device *pdev)
 	u32 reg;
 	int ret;
 
-	/* The TPD buffer address is limited to 45 bits. */
-	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(45));
+	/* The TPD buffer address is limited to:
+	 * 1. PTP:	45bits. (Driver doesn't support yet.)
+	 * 2. NON-PTP:	46bits.
+	 */
+	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(46));
 	if (ret) {
 		dev_err(&pdev->dev, "could not set DMA mask\n");
 		return ret;
-- 
2.7.4

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

* Re: [PATCH v4] net: qcom/emac: extend DMA mask to 46bits
  2018-01-23  4:25 [PATCH v4] net: qcom/emac: extend DMA mask to 46bits Wang Dongsheng
@ 2018-01-23  4:48 ` Timur Tabi
  2018-01-23  5:51   ` Wang, Dongsheng
  2018-01-24 21:32 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Timur Tabi @ 2018-01-23  4:48 UTC (permalink / raw)
  To: Wang Dongsheng; +Cc: hpuranik, netdev, linux-kernel

On 1/22/18 10:25 PM, Wang Dongsheng wrote:
> Bit TPD3[31] is used as a timestamp bit if PTP is enabled, but
> it's used as an address bit if PTP is disabled.  Since PTP isn't
> supported by the driver, we can extend the DMA address to 46 bits.
> 
> Signed-off-by: Wang Dongsheng<dongsheng.wang@hxt-semitech.com>

Acked-by: Timur Tabi <timur@codeaurora.org>

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

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

* Re: Re: [PATCH v4] net: qcom/emac: extend DMA mask to 46bits
  2018-01-23  4:48 ` Timur Tabi
@ 2018-01-23  5:51   ` Wang, Dongsheng
  0 siblings, 0 replies; 4+ messages in thread
From: Wang, Dongsheng @ 2018-01-23  5:51 UTC (permalink / raw)
  To: Timur Tabi; +Cc: hpuranik, netdev, linux-kernel

Thanks.

Cheers,
-Dongsheng

On 2018/1/23 12:48:27, "Timur Tabi" <timur@codeaurora.org> wrote:

>On 1/22/18 10:25 PM, Wang Dongsheng wrote:
>>Bit TPD3[31] is used as a timestamp bit if PTP is enabled, but
>>it's used as an address bit if PTP is disabled.  Since PTP isn't
>>supported by the driver, we can extend the DMA address to 46 bits.
>>
>>Signed-off-by: Wang Dongsheng<dongsheng.wang@hxt-semitech.com>
>
>Acked-by: Timur Tabi <timur@codeaurora.org>
>
>--
>Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
>Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
>Code Aurora Forum, a Linux Foundation Collaborative Project.

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

* Re: [PATCH v4] net: qcom/emac: extend DMA mask to 46bits
  2018-01-23  4:25 [PATCH v4] net: qcom/emac: extend DMA mask to 46bits Wang Dongsheng
  2018-01-23  4:48 ` Timur Tabi
@ 2018-01-24 21:32 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-01-24 21:32 UTC (permalink / raw)
  To: dongsheng.wang; +Cc: timur, hpuranik, netdev, linux-kernel

From: Wang Dongsheng <dongsheng.wang@hxt-semitech.com>
Date: Mon, 22 Jan 2018 20:25:06 -0800

> Bit TPD3[31] is used as a timestamp bit if PTP is enabled, but
> it's used as an address bit if PTP is disabled.  Since PTP isn't
> supported by the driver, we can extend the DMA address to 46 bits.
> 
> Signed-off-by: Wang Dongsheng <dongsheng.wang@hxt-semitech.com>

Applied to net-next, thanks.

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

end of thread, other threads:[~2018-01-24 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23  4:25 [PATCH v4] net: qcom/emac: extend DMA mask to 46bits Wang Dongsheng
2018-01-23  4:48 ` Timur Tabi
2018-01-23  5:51   ` Wang, Dongsheng
2018-01-24 21:32 ` 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).