[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210831131607.vsjvmr43eei4dsie@liuwe-devbox-debian-v2>
Date:   Tue, 31 Aug 2021 13:16:07 +0000
From:   Wei Liu <wei.liu@...nel.org>
To:     longli@...uxonhyperv.com
Cc:     linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-hyperv@...r.kernel.org, Long Li <longli@...rosoft.com>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Rob Herring <robh@...nel.org>,
        Krzysztof Wilczyński <kw@...ux.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Michael Kelley <mikelley@...rosoft.com>
Subject: Re: [Patch v2] PCI: hv: Fix sleep while in non-sleep context when
 removing child devices from the bus
On Mon, Aug 30, 2021 at 04:13:27PM -0700, longli@...uxonhyperv.com wrote:
> From: Long Li <longli@...rosoft.com>
> 
> In hv_pci_bus_exit, the code is holding a spinlock while calling
> pci_destroy_slot(), which takes a mutex.
> 
> This is not safe for spinlock. Fix this by moving the children to be
> deleted to a list on the stack, and removing them after spinlock is
> released.
> 
> Fixes: 94d22763207a ("PCI: hv: Fix a race condition when removing the device")
> 
> Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
> Cc: Haiyang Zhang <haiyangz@...rosoft.com>
> Cc: Stephen Hemminger <sthemmin@...rosoft.com>
> Cc: Wei Liu <wei.liu@...nel.org>
> Cc: Dexuan Cui <decui@...rosoft.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
> Cc: Rob Herring <robh@...nel.org>
> Cc: "Krzysztof Wilczyński" <kw@...ux.com>
> Cc: Bjorn Helgaas <bhelgaas@...gle.com>
> Cc: Michael Kelley <mikelley@...rosoft.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> Link: https://lore.kernel.org/linux-hyperv/20210823152130.GA21501@kili/
> Signed-off-by: Long Li <longli@...rosoft.com>
Reviewed-by: Wei Liu <wei.liu@...nel.org>
Powered by blists - more mailing lists
 
