From patchwork Tue Dec 17 20:05:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 3364961 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 A7939C0D4A for ; Tue, 17 Dec 2013 20:06:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A61BC203A9 for ; Tue, 17 Dec 2013 20:06:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87346202FE for ; Tue, 17 Dec 2013 20:06:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752817Ab3LQUGA (ORCPT ); Tue, 17 Dec 2013 15:06:00 -0500 Received: from mail-pd0-f172.google.com ([209.85.192.172]:51846 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753657Ab3LQUF6 (ORCPT ); Tue, 17 Dec 2013 15:05:58 -0500 Received: by mail-pd0-f172.google.com with SMTP id g10so7256100pdj.3 for ; Tue, 17 Dec 2013 12:05:58 -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=FTippmsgTjAhRj5V8w1qpt4GcnTOHHNtktxYOcPtmhU=; b=sV8bvCgvHg6Ni/zAh0VGCYpTW97tymEh8IsCy+/tPTSJPdxUMOT1raY2JT7v6CHafP zUvfx8eg9WBjy8ZqyI0qyU1bWZaxETVJRDhnRMC4F/ZpgbR2SEOPjUppCrEnIu0wdcY0 /GbFoy4BSSXEsPRm8eg1OPOLWG7HKzM37hQEhmhu9lckmY5+QrCGztMQA/4ApReTV0H+ Twnf4mtd5+9g2JoLLL6vUYJJdybaQbpp+8rYokjquzkSOQ9y5yhZdjphGRtA/h8sRt0m W5d0FNXNgKG8lQsVt7NKCvH3KUaSwBvAgrCLa0HW2f2in8eyuPqGw1XwI2/ShLZ6+GdF Vr6g== X-Received: by 10.68.230.137 with SMTP id sy9mr29419889pbc.126.1387310758458; Tue, 17 Dec 2013 12:05:58 -0800 (PST) Received: from [192.168.211.137] ([66.129.239.12]) by mx.google.com with ESMTPSA id ic7sm15561789pbc.29.2013.12.17.12.05.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 12:05:57 -0800 (PST) Message-ID: <52B0AEA3.6000608@gmail.com> Date: Tue, 17 Dec 2013 12:05:55 -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 , Kenji Kaneshige , Alex Williamson , Yijing Wang , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu CC: Guenter Roeck , Rajat Jain , Rajat Jain Subject: [PATCH v3 3/8] pciehp: Enable link state change notifications 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.3 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=unavailable 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 Enabled the Link state notifications unconditionaly. Enable the presence detection notification only if attention button is absent. This was discussed at this thread: http://marc.info/?t=138611014300001&r=1&w=2 Signed-off-by: Rajat Jain Signed-off-by: Guenter Roeck --- v3: * created by splitting the patch v2 [2/4] * Disable presence detect notification, when ATTN BTN is present v2: (non existent) v1: (non existent) drivers/pci/hotplug/pciehp_hpc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 1e9f814..b45b568 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -723,9 +723,17 @@ int pcie_enable_notification(struct controller *ctrl) * when it is cleared in the interrupt service routine, and * next power fault detected interrupt was notified again. */ - cmd = PCI_EXP_SLTCTL_PDCE; + + /* + * Always enable link events: thus link-up and link-down shall + * always be treated as hotplug and unplug respectively. Enable + * presence detect only if Attention Button is not present. + */ + cmd = PCI_EXP_SLTCTL_DLLSCE; if (ATTN_BUTTN(ctrl)) cmd |= PCI_EXP_SLTCTL_ABPE; + else + cmd |= PCI_EXP_SLTCTL_PDCE; if (MRL_SENS(ctrl)) cmd |= PCI_EXP_SLTCTL_MRLSCE; if (!pciehp_poll_mode) @@ -733,7 +741,8 @@ int pcie_enable_notification(struct controller *ctrl) mask = (PCI_EXP_SLTCTL_PDCE | PCI_EXP_SLTCTL_ABPE | PCI_EXP_SLTCTL_MRLSCE | PCI_EXP_SLTCTL_PFDE | - PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE); + PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE | + PCI_EXP_SLTCTL_DLLSCE); if (pcie_write_cmd(ctrl, cmd, mask)) { ctrl_err(ctrl, "Cannot enable software notification\n");