linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask
@ 2023-01-12 19:36 Frank Li
  2023-02-02 17:42 ` Frank Li
  2023-02-14 17:43 ` Sean Anderson
  0 siblings, 2 replies; 5+ messages in thread
From: Frank Li @ 2023-01-12 19:36 UTC (permalink / raw)
  To: Minghuan Lian, Mingkai Hu, Roy Zang, Lorenzo Pieralisi,
	Rob Herring, Krzysztof Wilczyński, Bjorn Helgaas,
	open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	moderated list:PCI DRIVER FOR FREESCALE LAYERSCAPE, open list
  Cc: imx

From: Guanhua Gao <guanhua.gao@nxp.com>

Set DMA mask and coherent DMA mask to enable 64-bit addressing.

Signed-off-by: Guanhua Gao <guanhua.gao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/pci/controller/dwc/pci-layerscape-ep.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pci/controller/dwc/pci-layerscape-ep.c b/drivers/pci/controller/dwc/pci-layerscape-ep.c
index 1b884854c18e..c19e7ec58b05 100644
--- a/drivers/pci/controller/dwc/pci-layerscape-ep.c
+++ b/drivers/pci/controller/dwc/pci-layerscape-ep.c
@@ -261,6 +261,10 @@ static int __init ls_pcie_ep_probe(struct platform_device *pdev)
 	pcie->max_width = (dw_pcie_readw_dbi(pci, PCIE_LINK_CAP) >>
 			  MAX_LINK_W_SHIFT) & MAX_LINK_W_MASK;
 
+	/* set 64-bit DMA mask and coherent DMA mask */
+	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)))
+		dev_warn(dev, "Failed to set 64-bit DMA mask.\n");
+
 	platform_set_drvdata(pdev, pcie);
 
 	ret = dw_pcie_ep_init(&pci->ep);
-- 
2.34.1


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

* RE: [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask
  2023-01-12 19:36 [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask Frank Li
@ 2023-02-02 17:42 ` Frank Li
  2023-02-14 17:32   ` Frank Li
  2023-02-14 17:43 ` Sean Anderson
  1 sibling, 1 reply; 5+ messages in thread
From: Frank Li @ 2023-02-02 17:42 UTC (permalink / raw)
  To: M.H. Lian, Mingkai Hu, Roy Zang, Lorenzo Pieralisi, Rob Herring,
	Krzysztof Wilczyński, Bjorn Helgaas,
	open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	moderated list:PCI DRIVER FOR FREESCALE LAYERSCAPE, open list
  Cc: imx


> Subject: [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask
> 
> From: Guanhua Gao <guanhua.gao@nxp.com>
> 
> Set DMA mask and coherent DMA mask to enable 64-bit addressing.
> 
> Signed-off-by: Guanhua Gao <guanhua.gao@nxp.com>
> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---

Ping

>  drivers/pci/controller/dwc/pci-layerscape-ep.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pci-layerscape-ep.c
> b/drivers/pci/controller/dwc/pci-layerscape-ep.c
> index 1b884854c18e..c19e7ec58b05 100644
> --- a/drivers/pci/controller/dwc/pci-layerscape-ep.c
> +++ b/drivers/pci/controller/dwc/pci-layerscape-ep.c
> @@ -261,6 +261,10 @@ static int __init ls_pcie_ep_probe(struct
> platform_device *pdev)
>  	pcie->max_width = (dw_pcie_readw_dbi(pci, PCIE_LINK_CAP) >>
>  			  MAX_LINK_W_SHIFT) & MAX_LINK_W_MASK;
> 
> +	/* set 64-bit DMA mask and coherent DMA mask */
> +	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)))
> +		dev_warn(dev, "Failed to set 64-bit DMA mask.\n");
> +
>  	platform_set_drvdata(pdev, pcie);
> 
>  	ret = dw_pcie_ep_init(&pci->ep);
> --
> 2.34.1


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

* RE: [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask
  2023-02-02 17:42 ` Frank Li
@ 2023-02-14 17:32   ` Frank Li
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2023-02-14 17:32 UTC (permalink / raw)
  To: M.H. Lian, Mingkai Hu, Roy Zang, Lorenzo Pieralisi, Rob Herring,
	Krzysztof Wilczyński, Bjorn Helgaas,
	open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	moderated list:PCI DRIVER FOR FREESCALE LAYERSCAPE, open list
  Cc: imx

> -----Original Message-----
> From: Frank Li
> Subject: RE: [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask
> 
> 
> > Subject: [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask
> >
> > From: Guanhua Gao <guanhua.gao@nxp.com>
> >
> > Set DMA mask and coherent DMA mask to enable 64-bit addressing.
> >
> > Signed-off-by: Guanhua Gao <guanhua.gao@nxp.com>
> > Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> 
> Ping

Ping again

> 
> >  drivers/pci/controller/dwc/pci-layerscape-ep.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/pci/controller/dwc/pci-layerscape-ep.c

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

* Re: [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask
  2023-01-12 19:36 [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask Frank Li
  2023-02-02 17:42 ` Frank Li
@ 2023-02-14 17:43 ` Sean Anderson
  2023-02-14 21:50   ` [EXT] " Frank Li
  1 sibling, 1 reply; 5+ messages in thread
From: Sean Anderson @ 2023-02-14 17:43 UTC (permalink / raw)
  To: Frank Li, Minghuan Lian, Mingkai Hu, Roy Zang, Lorenzo Pieralisi,
	Rob Herring, Krzysztof Wilczyński, Bjorn Helgaas,
	open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	moderated list:PCI DRIVER FOR FREESCALE LAYERSCAPE, open list
  Cc: imx

On 1/12/23 14:36, Frank Li wrote:
> From: Guanhua Gao <guanhua.gao@nxp.com>
> 
> Set DMA mask and coherent DMA mask to enable 64-bit addressing.
> 
> Signed-off-by: Guanhua Gao <guanhua.gao@nxp.com>
> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  drivers/pci/controller/dwc/pci-layerscape-ep.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pci-layerscape-ep.c b/drivers/pci/controller/dwc/pci-layerscape-ep.c
> index 1b884854c18e..c19e7ec58b05 100644
> --- a/drivers/pci/controller/dwc/pci-layerscape-ep.c
> +++ b/drivers/pci/controller/dwc/pci-layerscape-ep.c
> @@ -261,6 +261,10 @@ static int __init ls_pcie_ep_probe(struct platform_device *pdev)
>  	pcie->max_width = (dw_pcie_readw_dbi(pci, PCIE_LINK_CAP) >>
>  			  MAX_LINK_W_SHIFT) & MAX_LINK_W_MASK;
>  
> +	/* set 64-bit DMA mask and coherent DMA mask */
> +	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)))
> +		dev_warn(dev, "Failed to set 64-bit DMA mask.\n");

Isn't this mandatory? Why not dev_err_probe and return the error?

--Sean

>  	platform_set_drvdata(pdev, pcie);
>  
>  	ret = dw_pcie_ep_init(&pci->ep);


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

* RE: [EXT] Re: [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask
  2023-02-14 17:43 ` Sean Anderson
@ 2023-02-14 21:50   ` Frank Li
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2023-02-14 21:50 UTC (permalink / raw)
  To: Sean Anderson, M.H. Lian, Mingkai Hu, Roy Zang,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyński,
	Bjorn Helgaas, open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	open list:PCI DRIVER FOR FREESCALE LAYERSCAPE,
	moderated list:PCI DRIVER FOR FREESCALE LAYERSCAPE, open list
  Cc: imx

> >
> > +     /* set 64-bit DMA mask and coherent DMA mask */
> > +     if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)))
> > +             dev_warn(dev, "Failed to set 64-bit DMA mask.\n");
> 
> Isn't this mandatory? Why not dev_err_probe and return the error?

I don't think it is mandatory. If failure, dma will use swiotlb. 
Just an additional memcpy involved. 

Frank Li

> 
> --Sean
> 
> >       platform_set_drvdata(pdev, pcie);
> >
> >       ret = dw_pcie_ep_init(&pci->ep);


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

end of thread, other threads:[~2023-02-14 21:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-12 19:36 [PATCH 1/1] PCI: layerscape: Set 64-bit DMA mask Frank Li
2023-02-02 17:42 ` Frank Li
2023-02-14 17:32   ` Frank Li
2023-02-14 17:43 ` Sean Anderson
2023-02-14 21:50   ` [EXT] " Frank Li

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).