* [PATCH] pciehp: Display the link state change reporting capability
@ 2014-02-14 21:26 Rajat Jain
2014-02-14 21:35 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Rajat Jain @ 2014-02-14 21:26 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, linux-kernel
Cc: rajatjain, groeck, Alex Williamson, Kees Cook
With recent addition of Link state change based hot-plug, it makes
sense to display this capability in dbg_ctrl() addition to others.
(Also move the call to dbg_ctrl() further down untill after the value
is populated in ctrl->link_active_reporting)
Signed-off-by: Rajat Jain <rajatxjain@gmail.com>
Signed-off-by: Rajat Jain <rajatjain@juniper.net>
Signed-off-by: Guenter Roeck <groeck@juniper.net>
---
drivers/pci/hotplug/pciehp_hpc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index da4b020..cbe8e924 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -747,6 +747,8 @@ static inline void dbg_ctrl(struct controller *ctrl)
EMI(ctrl) ? "yes" : "no");
ctrl_info(ctrl, " Command Completed : %3s\n",
NO_CMD_CMPL(ctrl) ? "no" : "yes");
+ ctrl_info(ctrl, " Link Change Reporting: %3s\n",
+ ctrl->link_active_reporting ? "yes" : "no");
pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, ®16);
ctrl_info(ctrl, "Slot Status : 0x%04x\n", reg16);
pcie_capability_read_word(pdev, PCI_EXP_SLTCTL, ®16);
@@ -771,7 +773,6 @@ struct controller *pcie_init(struct pcie_device *dev)
ctrl->slot_cap = slot_cap;
mutex_init(&ctrl->ctrl_lock);
init_waitqueue_head(&ctrl->queue);
- dbg_ctrl(ctrl);
/*
* Controller doesn't notify of command completion if the "No
* Command Completed Support" bit is set in Slot Capability
@@ -784,10 +785,9 @@ struct controller *pcie_init(struct pcie_device *dev)
/* Check if Data Link Layer Link Active Reporting is implemented */
pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap);
- if (link_cap & PCI_EXP_LNKCAP_DLLLARC) {
- ctrl_dbg(ctrl, "Link Active Reporting supported\n");
+ if (link_cap & PCI_EXP_LNKCAP_DLLLARC)
ctrl->link_active_reporting = 1;
- }
+ dbg_ctrl(ctrl);
/* Clear all remaining event bits in Slot Status register */
pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pciehp: Display the link state change reporting capability
2014-02-14 21:26 [PATCH] pciehp: Display the link state change reporting capability Rajat Jain
@ 2014-02-14 21:35 ` Bjorn Helgaas
2014-02-14 21:40 ` Rajat Jain
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2014-02-14 21:35 UTC (permalink / raw)
To: Rajat Jain
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Rajat Jain, Guenter Roeck, Alex Williamson, Kees Cook
On Fri, Feb 14, 2014 at 2:26 PM, Rajat Jain <rajatxjain@gmail.com> wrote:
> With recent addition of Link state change based hot-plug, it makes
> sense to display this capability in dbg_ctrl() addition to others.
>
> (Also move the call to dbg_ctrl() further down untill after the value
> is populated in ctrl->link_active_reporting)
>
> Signed-off-by: Rajat Jain <rajatxjain@gmail.com>
> Signed-off-by: Rajat Jain <rajatjain@juniper.net>
> Signed-off-by: Guenter Roeck <groeck@juniper.net>
This is fine as it is, but I'd like to get rid of dbg_ctrl()
altogether someday. I made pcie_init() more verbose with afe2478f2e3f
("PCI: pciehp: Announce slot capabilities (slot #, button, LEDs,
etc)"), and it does include the PCI_EXP_LNKCAP_DLLLARC info.
Is there anything important left in dbg_ctrl() that we don't already
print elsewhere? The PCI core prints the vendor/device and BAR info.
Of course, we don't print the entire capabilities/status/control words
anywhere else. Is that important?
> ---
> drivers/pci/hotplug/pciehp_hpc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
> index da4b020..cbe8e924 100644
> --- a/drivers/pci/hotplug/pciehp_hpc.c
> +++ b/drivers/pci/hotplug/pciehp_hpc.c
> @@ -747,6 +747,8 @@ static inline void dbg_ctrl(struct controller *ctrl)
> EMI(ctrl) ? "yes" : "no");
> ctrl_info(ctrl, " Command Completed : %3s\n",
> NO_CMD_CMPL(ctrl) ? "no" : "yes");
> + ctrl_info(ctrl, " Link Change Reporting: %3s\n",
> + ctrl->link_active_reporting ? "yes" : "no");
> pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, ®16);
> ctrl_info(ctrl, "Slot Status : 0x%04x\n", reg16);
> pcie_capability_read_word(pdev, PCI_EXP_SLTCTL, ®16);
> @@ -771,7 +773,6 @@ struct controller *pcie_init(struct pcie_device *dev)
> ctrl->slot_cap = slot_cap;
> mutex_init(&ctrl->ctrl_lock);
> init_waitqueue_head(&ctrl->queue);
> - dbg_ctrl(ctrl);
> /*
> * Controller doesn't notify of command completion if the "No
> * Command Completed Support" bit is set in Slot Capability
> @@ -784,10 +785,9 @@ struct controller *pcie_init(struct pcie_device *dev)
>
> /* Check if Data Link Layer Link Active Reporting is implemented */
> pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap);
> - if (link_cap & PCI_EXP_LNKCAP_DLLLARC) {
> - ctrl_dbg(ctrl, "Link Active Reporting supported\n");
> + if (link_cap & PCI_EXP_LNKCAP_DLLLARC)
> ctrl->link_active_reporting = 1;
> - }
> + dbg_ctrl(ctrl);
>
> /* Clear all remaining event bits in Slot Status register */
> pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pciehp: Display the link state change reporting capability
2014-02-14 21:35 ` Bjorn Helgaas
@ 2014-02-14 21:40 ` Rajat Jain
0 siblings, 0 replies; 3+ messages in thread
From: Rajat Jain @ 2014-02-14 21:40 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Rajat Jain, Guenter Roeck, Alex Williamson, Kees Cook
Hello Bjorn,
On Fri, Feb 14, 2014 at 1:35 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Fri, Feb 14, 2014 at 2:26 PM, Rajat Jain <rajatxjain@gmail.com> wrote:
>> With recent addition of Link state change based hot-plug, it makes
>> sense to display this capability in dbg_ctrl() addition to others.
>>
>> (Also move the call to dbg_ctrl() further down untill after the value
>> is populated in ctrl->link_active_reporting)
>>
>> Signed-off-by: Rajat Jain <rajatxjain@gmail.com>
>> Signed-off-by: Rajat Jain <rajatjain@juniper.net>
>> Signed-off-by: Guenter Roeck <groeck@juniper.net>
>
> This is fine as it is, but I'd like to get rid of dbg_ctrl()
> altogether someday. I made pcie_init() more verbose with afe2478f2e3f
> ("PCI: pciehp: Announce slot capabilities (slot #, button, LEDs,
> etc)"), and it does include the PCI_EXP_LNKCAP_DLLLARC info.
>
> Is there anything important left in dbg_ctrl() that we don't already
> print elsewhere? The PCI core prints the vendor/device and BAR info.
> Of course, we don't print the entire capabilities/status/control words
> anywhere else. Is that important?
No, there doesn't seem a good use for it today. It all changes a short
while after it gets printed anyway.
>
>> ---
>> drivers/pci/hotplug/pciehp_hpc.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
>> index da4b020..cbe8e924 100644
>> --- a/drivers/pci/hotplug/pciehp_hpc.c
>> +++ b/drivers/pci/hotplug/pciehp_hpc.c
>> @@ -747,6 +747,8 @@ static inline void dbg_ctrl(struct controller *ctrl)
>> EMI(ctrl) ? "yes" : "no");
>> ctrl_info(ctrl, " Command Completed : %3s\n",
>> NO_CMD_CMPL(ctrl) ? "no" : "yes");
>> + ctrl_info(ctrl, " Link Change Reporting: %3s\n",
>> + ctrl->link_active_reporting ? "yes" : "no");
>> pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, ®16);
>> ctrl_info(ctrl, "Slot Status : 0x%04x\n", reg16);
>> pcie_capability_read_word(pdev, PCI_EXP_SLTCTL, ®16);
>> @@ -771,7 +773,6 @@ struct controller *pcie_init(struct pcie_device *dev)
>> ctrl->slot_cap = slot_cap;
>> mutex_init(&ctrl->ctrl_lock);
>> init_waitqueue_head(&ctrl->queue);
>> - dbg_ctrl(ctrl);
>> /*
>> * Controller doesn't notify of command completion if the "No
>> * Command Completed Support" bit is set in Slot Capability
>> @@ -784,10 +785,9 @@ struct controller *pcie_init(struct pcie_device *dev)
>>
>> /* Check if Data Link Layer Link Active Reporting is implemented */
>> pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap);
>> - if (link_cap & PCI_EXP_LNKCAP_DLLLARC) {
>> - ctrl_dbg(ctrl, "Link Active Reporting supported\n");
>> + if (link_cap & PCI_EXP_LNKCAP_DLLLARC)
>> ctrl->link_active_reporting = 1;
>> - }
>> + dbg_ctrl(ctrl);
>>
>> /* Clear all remaining event bits in Slot Status register */
>> pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
>> --
>> 1.7.9.5
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-14 21:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14 21:26 [PATCH] pciehp: Display the link state change reporting capability Rajat Jain
2014-02-14 21:35 ` Bjorn Helgaas
2014-02-14 21:40 ` Rajat Jain
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.