linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ashok Raj <ashok.raj@intel.com>
To: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Cc: Ashok Raj <ashok.raj@intel.com>,
	Keith Busch <keith.busch@intel.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH 2/3] pciehp: Fix led status when enabling already enabled slot.
Date: Sat, 19 Nov 2016 00:32:46 -0800	[thread overview]
Message-ID: <1479544367-7195-3-git-send-email-ashok.raj@intel.com> (raw)
In-Reply-To: <1479544367-7195-1-git-send-email-ashok.raj@intel.com>

If an error occurs enabling a slot on a hot plug event, the presence LED 
is disabled.

It is not an error, though, when the slot was already enabled. This
patch returns success if called to enable an already enabled slot. This
is in the same spirit of the special handling for EEXISTS when
pciehp_configure_device determines the slot devices already exist.

Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org

Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
---
 drivers/pci/hotplug/pciehp_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index efe69e8..ec0b4c1 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -410,7 +410,7 @@ int pciehp_enable_slot(struct slot *p_slot)
 		if (getstatus) {
 			ctrl_info(ctrl, "Slot(%s): Already enabled\n",
 				  slot_name(p_slot));
-			return -EINVAL;
+			return 0;
 		}
 	}
 
-- 
2.7.4

  parent reply	other threads:[~2016-11-19  8:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-19  8:32 [PATCH 0/3] Fix improper handling of pcie hotplug events Ashok Raj
2016-11-19  8:32 ` [PATCH 1/3] pciehp: Prioritize data-link event over presence detect Ashok Raj
2016-11-19  8:32 ` Ashok Raj [this message]
2016-11-19  8:32 ` [PATCH 3/3] pciehp: Fix race condition handling surprise link-down Ashok Raj
2016-12-07 23:40   ` Bjorn Helgaas
2016-12-08  0:04     ` Keith Busch
2016-12-08 15:11       ` Bjorn Helgaas
2016-12-08 17:20         ` Keith Busch
2016-12-08 17:50           ` Bjorn Helgaas
2016-12-09 21:11             ` Raj, Ashok
2016-12-07 23:31 ` [PATCH 0/3] Fix improper handling of pcie hotplug events Bjorn Helgaas
2016-12-08 18:05 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479544367-7195-3-git-send-email-ashok.raj@intel.com \
    --to=ashok.raj@intel.com \
    --cc=bhelgaas@google.com \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).