The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Rajat Jain <rajatxjain@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: rajatjain@juniper.net, groeck@juniper.net,
	Alex Williamson <alex.williamson@redhat.com>,
	Kees Cook <keescook@chromium.org>
Subject: [PATCH] pciehp: Display the link state change reporting capability
Date: Fri, 14 Feb 2014 13:26:23 -0800	[thread overview]
Message-ID: <52FE89FF.4020700@gmail.com> (raw)

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, &reg16);
 	ctrl_info(ctrl, "Slot Status            : 0x%04x\n", reg16);
 	pcie_capability_read_word(pdev, PCI_EXP_SLTCTL, &reg16);
@@ -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


             reply	other threads:[~2014-02-14 21:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14 21:26 Rajat Jain [this message]
2014-02-14 21:35 ` [PATCH] pciehp: Display the link state change reporting capability Bjorn Helgaas
2014-02-14 21:40   ` Rajat Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52FE89FF.4020700@gmail.com \
    --to=rajatxjain@gmail.com \
    --cc=alex.williamson@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=groeck@juniper.net \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rajatjain@juniper.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox