Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1277653 > unrolled thread

Re: [PATCH] PCI: pciehp: Always protect pciehp_disable_slot() with hotplug mutex

Started byBjorn Helgaas <helgaas@kernel.org>
First post2015-11-25 18:50 +0100
Last post2015-11-25 18:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] PCI: pciehp: Always protect pciehp_disable_slot() with  hotplug mutex Bjorn Helgaas <helgaas@kernel.org> - 2015-11-25 18:50 +0100

#1277653 — Re: [PATCH] PCI: pciehp: Always protect pciehp_disable_slot() with hotplug mutex

FromBjorn Helgaas <helgaas@kernel.org>
Date2015-11-25 18:50 +0100
SubjectRe: [PATCH] PCI: pciehp: Always protect pciehp_disable_slot() with hotplug mutex
Message-ID<qyMmD-YX-19@gated-at.bofh.it>
On Sun, Nov 01, 2015 at 01:58:40PM -0800, Guenter Roeck wrote:
> When called from pciehp_sysfs_disable_slot(), the call to
> pciehp_disable_slot() was not protected by the hotplug mutex.
> 
> Cc: Rajat Jain <rajatxjain@gmail.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied with Rajat's Reviewed-by to pci/hotplug for v4.5, thanks!

> ---
>  drivers/pci/hotplug/pciehp_ctrl.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
> index 4c8f4cde6854..880978b6d534 100644
> --- a/drivers/pci/hotplug/pciehp_ctrl.c
> +++ b/drivers/pci/hotplug/pciehp_ctrl.c
> @@ -511,7 +511,9 @@ int pciehp_sysfs_disable_slot(struct slot *p_slot)
>  	case STATIC_STATE:
>  		p_slot->state = POWEROFF_STATE;
>  		mutex_unlock(&p_slot->lock);
> +		mutex_lock(&p_slot->hotplug_lock);
>  		retval = pciehp_disable_slot(p_slot);
> +		mutex_unlock(&p_slot->hotplug_lock);
>  		mutex_lock(&p_slot->lock);
>  		p_slot->state = STATIC_STATE;
>  		break;
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web