From patchwork Tue Dec 17 20:06:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 3365001 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 87A13C0D4A for ; Tue, 17 Dec 2013 20:06:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 855DD203AC for ; Tue, 17 Dec 2013 20:06:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 636D9203A9 for ; Tue, 17 Dec 2013 20:06:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753793Ab3LQUGj (ORCPT ); Tue, 17 Dec 2013 15:06:39 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:63904 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753782Ab3LQUGh (ORCPT ); Tue, 17 Dec 2013 15:06:37 -0500 Received: by mail-pa0-f41.google.com with SMTP id lf10so4943224pab.14 for ; Tue, 17 Dec 2013 12:06:36 -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=o1a0FxlKFt8rC1aJtbaJZdQ1EyXUAHGfqZRP4Y+SJ0A=; b=NECyllc6GXYU6CDjCMPpEqp9BU0Q9ImEwoXojxaTCB5tZb5Aa6icFS2np95M5h3ngr lIzJ6gpByleoriJGpA8Z3QkuyX1FEmW9gqwkxlLFFE04BtmA9GUQfEl+qRU43+ium7x+ IsBe8StCZae1zdyWkVBGYMY8Ewicmlia+Z7WP6Ykp89+V87xD60R6tg3Qy3V4djpntaN X4mokSTQqjYSwR0l2mKxlWNVEqo9HYmg84gNBtASIhya/2TR04r0RmUZkZk6IB7kKT69 UGEQ48nNHcKeMowjjYJQVK4rlbHMLZcFcquWr04/6pOlxf3Ylrgh/5wlooP9dNOXhqtr SK1A== X-Received: by 10.66.249.134 with SMTP id yu6mr29071888pac.37.1387310796775; Tue, 17 Dec 2013 12:06:36 -0800 (PST) Received: from [192.168.211.137] ([66.129.239.12]) by mx.google.com with ESMTPSA id oj6sm48612341pab.9.2013.12.17.12.06.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 12:06:36 -0800 (PST) Message-ID: <52B0AEC8.4030003@gmail.com> Date: Tue, 17 Dec 2013 12:06:32 -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 5/8] pciehp: Don't check for adapter or latch status while disabling 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=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 It does not make much sense to refuse to disable a slot if an adapter is not present or the latch is open. If an adapter is not present, it provides an even better reason to disable the device slot. This is specially a problem for link state hot-plug, because some ports use in band mechanism for presence detection. Thus when link goes down, presence detect also goes down. We _want_ that the removal should take place in such case. Thus remove the checks for adapter and latch in pciehp_disable_slot() Signed-off-by: Rajat Jain Signed-off-by: Guenter Roeck --- v3: * created by splitting the patch v2 [2/4] * Remove the check for latch as well v2: (non existent) v1: (non existent) drivers/pci/hotplug/pciehp_ctrl.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 7ae7b02..e934618 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c @@ -612,24 +612,6 @@ int pciehp_disable_slot(struct slot *p_slot) if (!p_slot->ctrl) return 1; - if (!HP_SUPR_RM(p_slot->ctrl)) { - ret = pciehp_get_adapter_status(p_slot, &getstatus); - if (ret || !getstatus) { - ctrl_info(ctrl, "No adapter on slot(%s)\n", - slot_name(p_slot)); - return -ENODEV; - } - } - - if (MRL_SENS(p_slot->ctrl)) { - ret = pciehp_get_latch_status(p_slot, &getstatus); - if (ret || getstatus) { - ctrl_info(ctrl, "Latch open on slot(%s)\n", - slot_name(p_slot)); - return -ENODEV; - } - } - if (POWER_CTRL(p_slot->ctrl)) { ret = pciehp_get_power_status(p_slot, &getstatus); if (ret || !getstatus) {