linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rajat Jain <rajatxjain@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PCI: pciehp: Always protect pciehp_disable_slot() with hotplug mutex
Date: Wed, 4 Nov 2015 19:01:12 -0800	[thread overview]
Message-ID: <CAA93t1prZP+kjao0i93pCD6Fww_KQqcEjek-q8M8zAkzru+upw@mail.gmail.com> (raw)
In-Reply-To: <1446415120-14867-1-git-send-email-linux@roeck-us.net>

Geez... I wonder how did I miss it. Thanks for fixing this.
Looks good to me.

Reviewed-by: Rajat Jain <rajatxjain@gmail.com>

On Sun, Nov 1, 2015 at 1:58 PM, Guenter Roeck <linux@roeck-us.net> 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>
> ---
>  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
>

  reply	other threads:[~2015-11-05  3:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-01 21:58 [PATCH] PCI: pciehp: Always protect pciehp_disable_slot() with hotplug mutex Guenter Roeck
2015-11-05  3:01 ` Rajat Jain [this message]
     [not found] ` <CAA93t1o1tFvZDiBNfU62q+sfiykVxKCAs_ZWJ-uDjyEWaLEwoQ@mail.gmail.com>
2015-11-05  5:14   ` Guenter Roeck
2015-11-25 17:48 ` 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=CAA93t1prZP+kjao0i93pCD6Fww_KQqcEjek-q8M8zAkzru+upw@mail.gmail.com \
    --to=rajatxjain@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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).