From patchwork Fri Feb 21 01:42:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 3693091 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 3573CBF13A for ; Fri, 21 Feb 2014 01:42:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7E7A20179 for ; Fri, 21 Feb 2014 01:42:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C80FD2015A for ; Fri, 21 Feb 2014 01:42:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754631AbaBUBmf (ORCPT ); Thu, 20 Feb 2014 20:42:35 -0500 Received: from mail-pd0-f178.google.com ([209.85.192.178]:47548 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752903AbaBUBme (ORCPT ); Thu, 20 Feb 2014 20:42:34 -0500 Received: by mail-pd0-f178.google.com with SMTP id fp1so2621297pdb.9 for ; Thu, 20 Feb 2014 17:42:34 -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=CVxXtGtprXYAq83uleLXUliWBU0e6Q66I/yGQi20TE0=; b=zdc5B506qku6qSa63CoXkxFTiqoeYkzmc5swEaJ87CS+vVIV8YI0XoBv8wjQhh4dOr gRMYinVlOe4erbDTIH3zbQC/fB/YgKR4eotiN1R/zykUBhQ6dEfTNri30SkJWDNEDR0z zkRjPlFvrEIHDm+CN54JZ1fECmtW59hNBUBRADdc4LF4nFbxCXy91Mn+PVfWOYcHITMd WIrg5BsOXwGW1c99hAIKM/HJZ/jK/2f3yOe6uT3ppfEoXdr1+0U7ERsasAQQTAqYhnKp OubDhSc1fdrXvFNm9n1lu7xBS98o1krg5frzFf9fSFOY+bVe4uF7xvMnlMMmmddO/JkH q8jg== X-Received: by 10.68.108.194 with SMTP id hm2mr6040678pbb.22.1392946953961; Thu, 20 Feb 2014 17:42:33 -0800 (PST) Received: from [192.168.211.137] ([66.129.239.10]) by mx.google.com with ESMTPSA id vx10sm37258901pac.17.2014.02.20.17.42.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 17:42:33 -0800 (PST) Message-ID: <5306AF07.6000601@gmail.com> Date: Thu, 20 Feb 2014 17:42:31 -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, Alex Williamson CC: Rajat Jain , Guenter Roeck Subject: [PATCH] pciehp: Acknowledge the spurious "cmd completed" event. 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 In case of a spurious "cmd completed", pcie_write_cmd() does not clear it, but yet expects more "cmd completed" events to be generated. This does not happen because the previous (spurious) event has not been acknowledged. Fix that. Signed-off-by: Rajat Jain Signed-off-by: Rajat Jain Signed-off-by: Guenter Roeck --- drivers/pci/hotplug/pciehp_hpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index d7d058f..1463412 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -159,6 +159,8 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); if (slot_status & PCI_EXP_SLTSTA_CC) { + pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, + PCI_EXP_SLTSTA_CC); if (!ctrl->no_cmd_complete) { /* * After 1 sec and CMD_COMPLETED still not set, just