From patchwork Fri Feb 14 21:26:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 3654471 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D4A16BF40C for ; Fri, 14 Feb 2014 21:26:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B092201CE for ; Fri, 14 Feb 2014 21:26:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2FC1201C7 for ; Fri, 14 Feb 2014 21:26:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752756AbaBNV03 (ORCPT ); Fri, 14 Feb 2014 16:26:29 -0500 Received: from mail-pb0-f53.google.com ([209.85.160.53]:37161 "EHLO mail-pb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752712AbaBNV0Z (ORCPT ); Fri, 14 Feb 2014 16:26:25 -0500 Received: by mail-pb0-f53.google.com with SMTP id md12so12812614pbc.12 for ; Fri, 14 Feb 2014 13:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=uJ5LnIIsg+9IpAP3Pvcw+KKIgQ+9ULNNpipwNy7e+PU=; b=buVL0HytMOf0Uz7CLQ3C8xpFtyRJstZCyCXJwu5LIgDCF2Wnj2AgZsStx732QwmgV/ Ue/riIUGZuAbpOYb/yEtJm1l7rsZRnvCNRW5to4CcibYRt1DtOsBwKk46ittQrgCBTUd wpdzziqwRSh72QPjM5j8R0v6brURcQ0K/5xx0eyqkKXlJ8eACxn7eWFRQvZenEaZNMEp 5BEKwGT9I40f7bGp+1NFchzr9AjLOl7gTMs1oB1jpqNXMqnkmYEeIJ0HZHDsei8gagoO 1wiWORq8NQjPDeshxSflcVGtzybRYoIcz4bI9JvknLa71eUFYgEJH8lD7iyQBngnrOx+ Fwyw== X-Received: by 10.66.175.4 with SMTP id bw4mr11685670pac.56.1392413185356; Fri, 14 Feb 2014 13:26:25 -0800 (PST) Received: from [192.168.211.137] ([66.129.239.11]) by mx.google.com with ESMTPSA id bz4sm20454824pbb.12.2014.02.14.13.26.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Feb 2014 13:26:24 -0800 (PST) Message-ID: <52FE89FF.4020700@gmail.com> Date: Fri, 14 Feb 2014 13:26:23 -0800 From: Rajat Jain User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org CC: rajatjain@juniper.net, groeck@juniper.net, Alex Williamson , Kees Cook Subject: [PATCH] pciehp: Display the link state change reporting capability Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Rajat Jain Signed-off-by: Guenter Roeck --- 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,