From patchwork Wed Jun 11 05:28:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 4424621 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 04C21BEEAA for ; Wed, 25 Jun 2014 21:35:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4AE832038F for ; Wed, 25 Jun 2014 21:35:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E9B02038C for ; Wed, 25 Jun 2014 21:35:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753932AbaFYVfU (ORCPT ); Wed, 25 Jun 2014 17:35:20 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:65022 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753181AbaFYVfT (ORCPT ); Wed, 25 Jun 2014 17:35:19 -0400 Received: by mail-pa0-f50.google.com with SMTP id bj1so2225020pad.23 for ; Wed, 25 Jun 2014 14:35:18 -0700 (PDT) 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=wIhj8mRQlMOTKijJlums0Wp6sQKou5A5kGsQ4iO2EcM=; b=V25tg6hf8KfCiRLhsOz1tmJr+NinywcqwnRuWzWVBdlv560ARiwJKONmvt6PloUb4i Qm6vCPduG0Cemf0tFcs4a1RtlFmmuCy+g7vPU7Du/lSsbaVjCZFex8NtpIM526p1+F8E hXjxE6PyI4pUJGJ0MIcmfsn+0fvffNe0secVtgpwDL+8X86CGyaP6UTfK8X3nsu+dXsj V8tP8yAGF8RisjARzIqhW8YevbB2dtROPlWl8rB8oS3/5Hcgs+OmjN/3Z5SmGa915I5x H+tBd8x5+n/paPb//OGGEK/Qc4IVeRd6+OrxrXj95puL/EDo3lqjRlaPzWN9F4J+jjUr WX2w== X-Received: by 10.66.139.233 with SMTP id rb9mr15268389pab.5.1403732118889; Wed, 25 Jun 2014 14:35:18 -0700 (PDT) Received: from [192.168.95.129] ([66.129.239.12]) by mx.google.com with ESMTPSA id pl10sm6714982pbb.56.2014.06.25.14.35.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Jun 2014 14:35:18 -0700 (PDT) Message-ID: <5397E8FD.1070905@gmail.com> Date: Tue, 10 Jun 2014 22:28:29 -0700 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: Guenter Roeck , Rajat Jain Subject: [PATCH] pciehp: Remove the field controller->no_cmd_completed Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DATE_IN_PAST_96_XX, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 After following recent cleanups by Bjorn: http://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/hotplug 2cc56f3 PCI: pciehp: Remove assumptions about which commands cause 40b9608 PCI: pciehp: Compute timeout from hotplug command start time 3461a06 PCI: pciehp: Wait for hotplug command completion lazily 4283c70 PCI: pciehp: Make pcie_wait_cmd() self-contained the bitfield no_cmd_complete is not really needed anymore, as there is only a single occurance of its use. Hence remove the unnecessary bit field, and use existing macro NO_CMD_CMPL() instead. Signed-off-by: Rajat Jain Signed-off-by: Rajat Jain Signed-off-by: Guenter Roeck --- (This is rebased on top of Bjorn's pci/hotplug branch mentioned above) drivers/pci/hotplug/pciehp.h | 1 - drivers/pci/hotplug/pciehp_hpc.c | 11 +---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index c496258..9e5a9fb 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h @@ -96,7 +96,6 @@ struct controller { struct timer_list poll_timer; unsigned long cmd_started; /* jiffies */ unsigned int cmd_busy:1; - unsigned int no_cmd_complete:1; unsigned int link_active_reporting:1; unsigned int notification_enabled:1; unsigned int power_fault_detected; diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index a3a5c65..f7c3709 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -140,7 +140,7 @@ static void pcie_wait_cmd(struct controller *ctrl) * If the controller does not generate notifications for command * completions, we never need to wait between writes. */ - if (ctrl->no_cmd_complete) + if (NO_CMD_CMPL(ctrl)) return; if (!ctrl->cmd_busy) @@ -772,15 +772,6 @@ struct controller *pcie_init(struct pcie_device *dev) 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 Capabilities. - * If set, it means the controller can accept hotplug commands - * with no delay between them. - */ - if (NO_CMD_CMPL(ctrl)) - ctrl->no_cmd_complete = 1; - /* 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) {