Patchwork PCI: dwc: Print debug error message when MSI-X entry control mask bit is set

login
register
mail settings
Submitter Gustavo Pimentel
Date Nov. 22, 2018, 6:20 p.m.
Message ID <113052d54c1f3fa01f8ea1aa6e5a49e2620b5c64.1542910855.git.gustavo.pimentel@synopsys.com>
Download mbox | patch
Permalink /patch/663079/
State New
Headers show

Comments

Gustavo Pimentel - Nov. 22, 2018, 6:20 p.m.
Add debug error message when MSI-X entry control mask bit is set, to help
depur which reason why a MSI-X interrupt is not being trigger.

Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
---
 drivers/pci/controller/dwc/pcie-designware-ep.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Lorenzo Pieralisi - Nov. 30, 2018, 10:38 a.m.
On Thu, Nov 22, 2018 at 07:20:55PM +0100, Gustavo Pimentel wrote:
> Add debug error message when MSI-X entry control mask bit is set, to help
> depur which reason why a MSI-X interrupt is not being trigger.

s/depur which/debug the

s/trigger/triggered

> Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
> ---
>  drivers/pci/controller/dwc/pcie-designware-ep.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
> index 1e7b022..b52b986 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
> @@ -466,8 +466,10 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,
>  
>  	iounmap(msix_tbl);
>  
> -	if (vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT)
> +	if (vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT) {
> +		dev_err(pci->dev, "MSI-X entry ctrl set\n");

I would make it dev_dbg() given debugging is the reason you are adding
it, can I make this change ?

Lorenzo

>  		return -EPERM;
> +	}
>  
>  	ret = dw_pcie_ep_map_addr(epc, func_no, ep->msi_mem_phys, msg_addr,
>  				  epc->mem->page_size);
> -- 
> 2.7.4
>
Gustavo Pimentel - Dec. 4, 2018, 10:36 a.m.
On 30/11/2018 10:38, Lorenzo Pieralisi wrote:
> On Thu, Nov 22, 2018 at 07:20:55PM +0100, Gustavo Pimentel wrote:
>> Add debug error message when MSI-X entry control mask bit is set, to help
>> depur which reason why a MSI-X interrupt is not being trigger.
> 
> s/depur which/debug the
> 
> s/trigger/triggered

Ok, I'll fix it.

> 
>> Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
>> ---
>>  drivers/pci/controller/dwc/pcie-designware-ep.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
>> index 1e7b022..b52b986 100644
>> --- a/drivers/pci/controller/dwc/pcie-designware-ep.c
>> +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
>> @@ -466,8 +466,10 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,
>>  
>>  	iounmap(msix_tbl);
>>  
>> -	if (vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT)
>> +	if (vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT) {
>> +		dev_err(pci->dev, "MSI-X entry ctrl set\n");
> 
> I would make it dev_dbg() given debugging is the reason you are adding
> it, can I make this change ?

I see your point. Yes, of course, please do it.

Gustavo

> 
> Lorenzo
> 
>>  		return -EPERM;
>> +	}
>>  
>>  	ret = dw_pcie_ep_map_addr(epc, func_no, ep->msi_mem_phys, msg_addr,
>>  				  epc->mem->page_size);
>> -- 
>> 2.7.4
>>

Patch

diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 1e7b022..b52b986 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -466,8 +466,10 @@  int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,
 
 	iounmap(msix_tbl);
 
-	if (vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT)
+	if (vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT) {
+		dev_err(pci->dev, "MSI-X entry ctrl set\n");
 		return -EPERM;
+	}
 
 	ret = dw_pcie_ep_map_addr(epc, func_no, ep->msi_mem_phys, msg_addr,
 				  epc->mem->page_size);