lkml.org 
[lkml]   [2022]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] PCI: dwc: solve returning success but actually failed
On Fri, Mar 4, 2022 at 6:06 AM Zhangjiantao(Kirin,Nanjing)
<water.zhangjiantao@huawei.com> wrote:
>

For the subject, something like: 'PCI: dwc: Fix setting error return
on MSI DMA mapping failure'

> When dma_mapping_error returns error because of no enough memory available, dw_pcie_host_init will return success, which will mislead the callers.

Wrap lines at 72 char.

>

Add a Fixes tag with whatever commit introduced the problem.

> Signed-off-by: zhangjianrong <zhangjianrong5@huawei.com>
> Signed-off-by: zhangjiantao <water.zhangjiantao@huawei.com>

Author and S-o-b names should match.

>
> ---
> drivers/pci/controller/dwc/pcie-designware-host.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c
> b/drivers/pci/controller/dwc/pcie-designware-host.c
> index f4755f3a03be..ac691d733848 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -393,6 +393,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
> if (dma_mapping_error(pci->dev, pp->msi_data)) {
> dev_err(pci->dev, "Failed to map MSI data\n");
> pp->msi_data = 0;
> + ret = -1;

Use an errno value. ENOMEM seems to be common, but I also see EIO and
EFAULT used.

Rob

\
 
 \ /
  Last update: 2022-03-04 18:12    [W:0.050 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site