diff mbox series

[3/3] PCI: dwc: Create debugfs files in DWC driver

Message ID 20210518174618.42089-4-shradha.t@samsung.com (mailing list archive)
State Changes Requested
Headers show
Series Add support for RAS DES feature in PCIe DW controller | expand

Commit Message

Shradha Todi May 18, 2021, 5:46 p.m. UTC
Add call to create_debugfs_files() from DWC driver to create the RASDES
debugfs structure for each platform driver. Since it can be used for both
DW HOST controller as well as DW EP controller, let's add it in the common
setup function.

Signed-off-by: Shradha Todi <shradha.t@samsung.com>
---
 drivers/pci/controller/dwc/pcie-designware.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Bjorn Helgaas May 21, 2021, 8:04 p.m. UTC | #1
On Tue, May 18, 2021 at 11:16:18PM +0530, Shradha Todi wrote:
> Add call to create_debugfs_files() from DWC driver to create the RASDES
> debugfs structure for each platform driver. Since it can be used for both
> DW HOST controller as well as DW EP controller, let's add it in the common
> setup function.
> 
> Signed-off-by: Shradha Todi <shradha.t@samsung.com>
> ---
>  drivers/pci/controller/dwc/pcie-designware.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
> index 348f6f696976..c054f8ba1cf4 100644
> --- a/drivers/pci/controller/dwc/pcie-designware.c
> +++ b/drivers/pci/controller/dwc/pcie-designware.c
> @@ -15,6 +15,7 @@
>  
>  #include "../../pci.h"
>  #include "pcie-designware.h"
> +#include "pcie-designware-debugfs.h"
>  
>  /*
>   * These interfaces resemble the pci_find_*capability() interfaces, but these
> @@ -793,4 +794,8 @@ void dw_pcie_setup(struct dw_pcie *pci)
>  		       PCIE_PL_CHK_REG_CHK_REG_START;
>  		dw_pcie_writel_dbi(pci, PCIE_PL_CHK_REG_CONTROL_STATUS, val);
>  	}
> +
> +	ret = create_debugfs_files(pci);
> +	if (ret)
> +		dev_err(pci->dev, "Couldn't create debugfs files\n");

Was there supposed to be a corresponding remove_debugfs_files() call?
On module unload?

>  }
> -- 
> 2.17.1
>
Vidya Sagar May 27, 2021, 11:53 a.m. UTC | #2
On 5/18/2021 11:16 PM, Shradha Todi wrote:
> External email: Use caution opening links or attachments
> 
> 
> Add call to create_debugfs_files() from DWC driver to create the RASDES
> debugfs structure for each platform driver. Since it can be used for both
> DW HOST controller as well as DW EP controller, let's add it in the common
> setup function.
> 
> Signed-off-by: Shradha Todi <shradha.t@samsung.com>
> ---
>   drivers/pci/controller/dwc/pcie-designware.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
> index 348f6f696976..c054f8ba1cf4 100644
> --- a/drivers/pci/controller/dwc/pcie-designware.c
> +++ b/drivers/pci/controller/dwc/pcie-designware.c
> @@ -15,6 +15,7 @@
> 
>   #include "../../pci.h"
>   #include "pcie-designware.h"
> +#include "pcie-designware-debugfs.h"
> 
>   /*
>    * These interfaces resemble the pci_find_*capability() interfaces, but these
> @@ -793,4 +794,8 @@ void dw_pcie_setup(struct dw_pcie *pci)
>                         PCIE_PL_CHK_REG_CHK_REG_START;
>                  dw_pcie_writel_dbi(pci, PCIE_PL_CHK_REG_CONTROL_STATUS, val);
>          }
> +
> +       ret = create_debugfs_files(pci);
> +       if (ret)
> +               dev_err(pci->dev, "Couldn't create debugfs files\n");
'ret' is undeclared in this function . (for reference, I applied this 
patch on top of 'next-20210526')
>   }
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 348f6f696976..c054f8ba1cf4 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -15,6 +15,7 @@ 
 
 #include "../../pci.h"
 #include "pcie-designware.h"
+#include "pcie-designware-debugfs.h"
 
 /*
  * These interfaces resemble the pci_find_*capability() interfaces, but these
@@ -793,4 +794,8 @@  void dw_pcie_setup(struct dw_pcie *pci)
 		       PCIE_PL_CHK_REG_CHK_REG_START;
 		dw_pcie_writel_dbi(pci, PCIE_PL_CHK_REG_CONTROL_STATUS, val);
 	}
+
+	ret = create_debugfs_files(pci);
+	if (ret)
+		dev_err(pci->dev, "Couldn't create debugfs files\n");
 }