net: qcom/emac: extend DMA mask to 46bits
Subsystems (3)
PATCH v3 1/1 net: qcom/emac: extend DMA mask to 46bits
Since PTP doesn't support yet, so extend the DMA address to 46bits.
---
v3:
- Remove "Dynamic fix TPD_BUFFER_ADDR_H_SET size."
- Add comments for TPD_BUFFER_ADDR_H_SET. v2:
- Changes PATCH subject.
- Dynamic fix TPD_BUFFER_ADDR_H_SET size.
- Modify DMA MASK to 46bits.
- Add Comments for DMA MASK.
--- drivers/net/ethernet/qualcomm/emac/emac-mac.h | 3 ++- drivers/net/ethernet/qualcomm/emac/emac.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/ethernet/qualcomm/emac/emac-mac.h +2 -1
@@ -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. */
drivers/net/ethernet/qualcomm/emac/emac.c +5 -2
@@ -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;
Signature · 1 line
2.7.4
This is much better. Can you give me a few days to test it on some internal platforms?
Also, this is a candidate for 4.16, so you need to wait until net-next is open anyway (http://vger.kernel.org/~davem/net-next.html).
Quoted 1 line · Wang Dongsheng
Since PTP doesn't support yet, so extend the DMA address to 46bits.
This needs to be longer, since it's not clear that TPD3[31] is bot a timestamp bit and an address bit. How about this:
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.
Signature · 3 lines
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.