From patchwork Wed Feb 5 02:29: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: 3584141 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 8E833C02DD for ; Wed, 5 Feb 2014 02:30:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BECB4201B6 for ; Wed, 5 Feb 2014 02:30:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE3672018E for ; Wed, 5 Feb 2014 02:30:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754632AbaBEC3a (ORCPT ); Tue, 4 Feb 2014 21:29:30 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:57277 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753808AbaBEC32 (ORCPT ); Tue, 4 Feb 2014 21:29:28 -0500 Received: by mail-pb0-f46.google.com with SMTP id um1so9216474pbc.5 for ; Tue, 04 Feb 2014 18:29:27 -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=KdK9VwFvOvLp3IVyzMDVGjRMAh+IVhOo3Kr8kRNneOI=; b=r0sZ3/s4zdzDHfsxXWFep3EnUgXSdxXGbrhKc/UurmZ25rPMAgsbmYMSPBKfzi37FY u69zQX9IxrnhT+DzebGSC3DHpG19AyyEcSLWwep6g0u/xCnINhUjBNaU23fG0+8OVTtL qCVx2bvWNJunk7Zeg9zXxLyoIVfnv4ihgsUmnquQ0zDnroQ+oU14y8xVA4Y2H4AWiJNH vFLJ1nlVnqnOZSNhUU+C+mV9B8beOtUAmhp/FXF9zmxW9kBzSQL66z43M7s0kQVg6mRN dEa6fwboLkexFfCRJ3TOXFS7SRS3VL+fyMkBQaEpPwEDappD7zZ3FDhz9Kvr6hD89MGX uCDA== X-Received: by 10.66.187.11 with SMTP id fo11mr47880262pac.47.1391567367524; Tue, 04 Feb 2014 18:29:27 -0800 (PST) Received: from [192.168.211.137] ([66.129.239.13]) by mx.google.com with ESMTPSA id q7sm70785714pbc.20.2014.02.04.18.29.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 18:29:26 -0800 (PST) Message-ID: <52F1A203.7060802@gmail.com> Date: Tue, 04 Feb 2014 18:29: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 , "Rafael J. Wysocki" , 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 v4 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.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=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: Rajat Jain Signed-off-by: Guenter Roeck --- 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 b413dce..245a3cb 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -600,9 +600,17 @@ void 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) @@ -610,7 +618,8 @@ void 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); pcie_write_cmd(ctrl, cmd, mask); }