[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YrB1U29QVHcKV3g8@myrica>
Date: Mon, 20 Jun 2022 14:25:39 +0100
From: Jean-Philippe Brucker <jean-philippe@...aro.org>
To: Zhangfei Gao <zhangfei.gao@...aro.org>
Cc: Yang Shen <shenyang39@...wei.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, iommu@...ts.linux-foundation.org,
linux-crypto@...r.kernel.org, linux-accelerators@...ts.ozlabs.org
Subject: Re: [PATCH] uacce: fix concurrency of fops_open and uacce_remove
On Fri, Jun 17, 2022 at 10:23:13PM +0800, Zhangfei Gao wrote:
> @@ -312,12 +345,20 @@ static ssize_t available_instances_show(struct device
> *dev,
> char *buf)
> {
> struct uacce_device *uacce = to_uacce_device(dev);
> + ssize_t ret;
>
> - if (!uacce->ops->get_available_instances)
> - return -ENODEV;
> + mutex_lock(&uacce_mutex);
> + if (!uacce->ops || !uacce->ops->get_available_instances) {
Doesn't the sysfs group go away with uacce_remove()? We shouldn't need
this check
Thanks,
Jean
Powered by blists - more mailing lists