linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] uio:uio_pci_generic:Don't clear master bit when the process does not exit
  2023-02-14 13:21 [PATCH] uio:uio_pci_generic:Don't clear master bit when the process does not exit Su Weifeng
@ 2023-02-14 13:17 ` Greg KH
  2023-02-16 14:45   ` Suweifeng (Weifeng, EulerOS)
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2023-02-14 13:17 UTC (permalink / raw)
  To: Su Weifeng
  Cc: mst, linux-kernel, shikemeng, liuzhiqiang26, linfeilong, zhanghongtao22

On Tue, Feb 14, 2023 at 09:21:57PM +0800, Su Weifeng wrote:
> From: Weifeng Su <suweifeng1@huawei.com>
> 
> The /dev/uioX device is used by multiple processes. The current behavior
> is to clear the master bit when a process exits. This affects other
> processes that use the device, resulting in command suspension and
> timeout. This behavior cannot be sensed by the process itself.
> The solution is to add the reference counting. The reference count is
> self-incremented and self-decremented each time when the device open and
> close. The master bit is cleared only when the last process exited.
> 
> Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
> ---
>  drivers/uio/uio_pci_generic.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
> index e03f9b532..d36d3e08e 100644
> --- a/drivers/uio/uio_pci_generic.c
> +++ b/drivers/uio/uio_pci_generic.c
> @@ -31,6 +31,7 @@
>  struct uio_pci_generic_dev {
>  	struct uio_info info;
>  	struct pci_dev *pdev;
> +	refcount_t  dev_refc;
>  };
>  
>  static inline struct uio_pci_generic_dev *
> @@ -39,10 +40,22 @@ to_uio_pci_generic_dev(struct uio_info *info)
>  	return container_of(info, struct uio_pci_generic_dev, info);
>  }
>  
> +static int open(struct uio_info *info, struct inode *inode)
> +{
> +	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
> +
> +	if (gdev)
> +		refcount_inc(&gdev->dev_refc);

This flat out does not work, sorry.

You should never rely on trying to count open/release calls, just let
the vfs layer handle that for us as it currently does so.

Think about what happens if you call dup() in userspace on a
filehandle...

> +	return 0;
> +}
> +
>  static int release(struct uio_info *info, struct inode *inode)
>  {
>  	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
>  
> +	if (gdev && refcount_dec_not_one(&gdev->dev_refc))

I don't think you actually tested this as it is impossible for gdev to
ever be NULL.

sorry, but this patch is not correct.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] uio:uio_pci_generic:Don't clear master bit when the process does not exit
@ 2023-02-14 13:21 Su Weifeng
  2023-02-14 13:17 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Su Weifeng @ 2023-02-14 13:21 UTC (permalink / raw)
  To: gregkh, mst
  Cc: linux-kernel, shikemeng, liuzhiqiang26, linfeilong,
	zhanghongtao22, Weifeng Su

From: Weifeng Su <suweifeng1@huawei.com>

The /dev/uioX device is used by multiple processes. The current behavior
is to clear the master bit when a process exits. This affects other
processes that use the device, resulting in command suspension and
timeout. This behavior cannot be sensed by the process itself.
The solution is to add the reference counting. The reference count is
self-incremented and self-decremented each time when the device open and
close. The master bit is cleared only when the last process exited.

Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
---
 drivers/uio/uio_pci_generic.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
index e03f9b532..d36d3e08e 100644
--- a/drivers/uio/uio_pci_generic.c
+++ b/drivers/uio/uio_pci_generic.c
@@ -31,6 +31,7 @@
 struct uio_pci_generic_dev {
 	struct uio_info info;
 	struct pci_dev *pdev;
+	refcount_t  dev_refc;
 };
 
 static inline struct uio_pci_generic_dev *
@@ -39,10 +40,22 @@ to_uio_pci_generic_dev(struct uio_info *info)
 	return container_of(info, struct uio_pci_generic_dev, info);
 }
 
+static int open(struct uio_info *info, struct inode *inode)
+{
+	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
+
+	if (gdev)
+		refcount_inc(&gdev->dev_refc);
+	return 0;
+}
+
 static int release(struct uio_info *info, struct inode *inode)
 {
 	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
 
+	if (gdev && refcount_dec_not_one(&gdev->dev_refc))
+		return 0;
+
 	/*
 	 * This driver is insecure when used with devices doing DMA, but some
 	 * people (mis)use it with such devices.
@@ -51,7 +64,8 @@ static int release(struct uio_info *info, struct inode *inode)
 	 * Note that there's a non-zero chance doing this will wedge the device
 	 * at least until reset.
 	 */
-	pci_clear_master(gdev->pdev);
+	if (refcount_read(&gdev->dev_refc) == 1)
+		pci_clear_master(gdev->pdev);
 	return 0;
 }
 
@@ -93,7 +107,9 @@ static int probe(struct pci_dev *pdev,
 	gdev->info.name = "uio_pci_generic";
 	gdev->info.version = DRIVER_VERSION;
 	gdev->info.release = release;
+	gdev->info.open = open;
 	gdev->pdev = pdev;
+	refcount_set(&gdev->dev_refc, 1);
 	if (pdev->irq && (pdev->irq != IRQ_NOTCONNECTED)) {
 		gdev->info.irq = pdev->irq;
 		gdev->info.irq_flags = IRQF_SHARED;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] uio:uio_pci_generic:Don't clear master bit when the process does not exit
  2023-02-14 13:17 ` Greg KH
@ 2023-02-16 14:45   ` Suweifeng (Weifeng, EulerOS)
  2023-02-16 15:07     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Suweifeng (Weifeng, EulerOS) @ 2023-02-16 14:45 UTC (permalink / raw)
  To: Greg KH
  Cc: mst, linux-kernel, shikemeng, liuzhiqiang26, linfeilong, zhanghongtao22

On 2023/2/14 21:17, Greg KH wrote:
> On Tue, Feb 14, 2023 at 09:21:57PM +0800, Su Weifeng wrote:
>> From: Weifeng Su <suweifeng1@huawei.com>
>>
>> The /dev/uioX device is used by multiple processes. The current behavior
>> is to clear the master bit when a process exits. This affects other
>> processes that use the device, resulting in command suspension and
>> timeout. This behavior cannot be sensed by the process itself.
>> The solution is to add the reference counting. The reference count is
>> self-incremented and self-decremented each time when the device open and
>> close. The master bit is cleared only when the last process exited.
>>
>> Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
>> ---
>>   drivers/uio/uio_pci_generic.c | 18 +++++++++++++++++-
>>   1 file changed, 17 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
>> index e03f9b532..d36d3e08e 100644
>> --- a/drivers/uio/uio_pci_generic.c
>> +++ b/drivers/uio/uio_pci_generic.c
>> @@ -31,6 +31,7 @@
>>   struct uio_pci_generic_dev {
>>   	struct uio_info info;
>>   	struct pci_dev *pdev;
>> +	refcount_t  dev_refc;
>>   };
>>   
>>   static inline struct uio_pci_generic_dev *
>> @@ -39,10 +40,22 @@ to_uio_pci_generic_dev(struct uio_info *info)
>>   	return container_of(info, struct uio_pci_generic_dev, info);
>>   }
>>   
>> +static int open(struct uio_info *info, struct inode *inode)
>> +{
>> +	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
>> +
>> +	if (gdev)
>> +		refcount_inc(&gdev->dev_refc);
> 
> This flat out does not work, sorry.
> 
> You should never rely on trying to count open/release calls, just let
> the vfs layer handle that for us as it currently does so.
> 
> Think about what happens if you call dup() in userspace on a
> filehandle...
> 
>> +	return 0;
>> +}
>> +
>>   static int release(struct uio_info *info, struct inode *inode)
>>   {
>>   	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
>>   
>> +	if (gdev && refcount_dec_not_one(&gdev->dev_refc))
> 
> I don't think you actually tested this as it is impossible for gdev to
> ever be NULL.
> 
> sorry, but this patch is not correct.
> 
> greg k-h

First of all, thank you for taking the time to read this patch, your 
comments are very enlightening, but I do have a strange problem here, I 
test such programs on kernels 5.10 and 6.2.
fd = open("/dev/uio0". O_RDWR);
while (true)
	sleep(1);
This program only opens the uio device. After starting multiple such 
processes, I close one of them. From the added print, it can be seen 
that the "uio_pci_generic.c:release" function is called and the master 
bit is cleared, instead of being called when the last process exits as 
expected. I think the vfs is not protected as it should be. Such a 
problem cannot be handled in the user-mode program. We have to clear the 
master bit when the last process exits. Otherwise, user-mode programs 
(for example, the DPDK process that uses uio_pci_generic) cannot work 
properly.

Best regards,
Weifeng Su

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] uio:uio_pci_generic:Don't clear master bit when the process does not exit
  2023-02-16 14:45   ` Suweifeng (Weifeng, EulerOS)
@ 2023-02-16 15:07     ` Greg KH
  2023-02-16 15:55       ` Michael S. Tsirkin
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2023-02-16 15:07 UTC (permalink / raw)
  To: Suweifeng (Weifeng, EulerOS)
  Cc: mst, linux-kernel, shikemeng, liuzhiqiang26, linfeilong, zhanghongtao22

On Thu, Feb 16, 2023 at 10:45:02PM +0800, Suweifeng (Weifeng, EulerOS) wrote:
> On 2023/2/14 21:17, Greg KH wrote:
> > On Tue, Feb 14, 2023 at 09:21:57PM +0800, Su Weifeng wrote:
> > > From: Weifeng Su <suweifeng1@huawei.com>
> > > 
> > > The /dev/uioX device is used by multiple processes. The current behavior
> > > is to clear the master bit when a process exits. This affects other
> > > processes that use the device, resulting in command suspension and
> > > timeout. This behavior cannot be sensed by the process itself.
> > > The solution is to add the reference counting. The reference count is
> > > self-incremented and self-decremented each time when the device open and
> > > close. The master bit is cleared only when the last process exited.
> > > 
> > > Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
> > > ---
> > >   drivers/uio/uio_pci_generic.c | 18 +++++++++++++++++-
> > >   1 file changed, 17 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
> > > index e03f9b532..d36d3e08e 100644
> > > --- a/drivers/uio/uio_pci_generic.c
> > > +++ b/drivers/uio/uio_pci_generic.c
> > > @@ -31,6 +31,7 @@
> > >   struct uio_pci_generic_dev {
> > >   	struct uio_info info;
> > >   	struct pci_dev *pdev;
> > > +	refcount_t  dev_refc;
> > >   };
> > >   static inline struct uio_pci_generic_dev *
> > > @@ -39,10 +40,22 @@ to_uio_pci_generic_dev(struct uio_info *info)
> > >   	return container_of(info, struct uio_pci_generic_dev, info);
> > >   }
> > > +static int open(struct uio_info *info, struct inode *inode)
> > > +{
> > > +	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
> > > +
> > > +	if (gdev)
> > > +		refcount_inc(&gdev->dev_refc);
> > 
> > This flat out does not work, sorry.
> > 
> > You should never rely on trying to count open/release calls, just let
> > the vfs layer handle that for us as it currently does so.
> > 
> > Think about what happens if you call dup() in userspace on a
> > filehandle...
> > 
> > > +	return 0;
> > > +}
> > > +
> > >   static int release(struct uio_info *info, struct inode *inode)
> > >   {
> > >   	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
> > > +	if (gdev && refcount_dec_not_one(&gdev->dev_refc))
> > 
> > I don't think you actually tested this as it is impossible for gdev to
> > ever be NULL.
> > 
> > sorry, but this patch is not correct.
> > 
> > greg k-h
> 
> First of all, thank you for taking the time to read this patch, your
> comments are very enlightening, but I do have a strange problem here, I test
> such programs on kernels 5.10 and 6.2.
> fd = open("/dev/uio0". O_RDWR);
> while (true)
> 	sleep(1);
> This program only opens the uio device. After starting multiple such
> processes, I close one of them. From the added print, it can be seen that
> the "uio_pci_generic.c:release" function is called and the master bit is
> cleared, instead of being called when the last process exits as expected. I
> think the vfs is not protected as it should be.

Did your patch change this functionality?

> Such a problem cannot be
> handled in the user-mode program. We have to clear the master bit when the
> last process exits. Otherwise, user-mode programs (for example, the DPDK
> process that uses uio_pci_generic) cannot work properly.

Look at the big comment in the release() function in this file.  Does
that explain the issues here?

Just do not open the device multiple times, you have full control over
this, right?

If not, then perhaps your hardware should not be using the
uio_pci_generic() driver but rather have a real kernel driver for it
instead if it needs to handle this type of functionality?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] uio:uio_pci_generic:Don't clear master bit when the process does not exit
  2023-02-16 15:07     ` Greg KH
@ 2023-02-16 15:55       ` Michael S. Tsirkin
  2023-02-16 16:57         ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2023-02-16 15:55 UTC (permalink / raw)
  To: Greg KH
  Cc: Suweifeng (Weifeng, EulerOS),
	linux-kernel, shikemeng, liuzhiqiang26, linfeilong,
	zhanghongtao22

On Thu, Feb 16, 2023 at 04:07:24PM +0100, Greg KH wrote:
> On Thu, Feb 16, 2023 at 10:45:02PM +0800, Suweifeng (Weifeng, EulerOS) wrote:
> > On 2023/2/14 21:17, Greg KH wrote:
> > > On Tue, Feb 14, 2023 at 09:21:57PM +0800, Su Weifeng wrote:
> > > > From: Weifeng Su <suweifeng1@huawei.com>
> > > > 
> > > > The /dev/uioX device is used by multiple processes. The current behavior
> > > > is to clear the master bit when a process exits. This affects other
> > > > processes that use the device, resulting in command suspension and
> > > > timeout. This behavior cannot be sensed by the process itself.
> > > > The solution is to add the reference counting. The reference count is
> > > > self-incremented and self-decremented each time when the device open and
> > > > close. The master bit is cleared only when the last process exited.
> > > > 
> > > > Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
> > > > ---
> > > >   drivers/uio/uio_pci_generic.c | 18 +++++++++++++++++-
> > > >   1 file changed, 17 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
> > > > index e03f9b532..d36d3e08e 100644
> > > > --- a/drivers/uio/uio_pci_generic.c
> > > > +++ b/drivers/uio/uio_pci_generic.c
> > > > @@ -31,6 +31,7 @@
> > > >   struct uio_pci_generic_dev {
> > > >   	struct uio_info info;
> > > >   	struct pci_dev *pdev;
> > > > +	refcount_t  dev_refc;
> > > >   };
> > > >   static inline struct uio_pci_generic_dev *
> > > > @@ -39,10 +40,22 @@ to_uio_pci_generic_dev(struct uio_info *info)
> > > >   	return container_of(info, struct uio_pci_generic_dev, info);
> > > >   }
> > > > +static int open(struct uio_info *info, struct inode *inode)
> > > > +{
> > > > +	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
> > > > +
> > > > +	if (gdev)
> > > > +		refcount_inc(&gdev->dev_refc);
> > > 
> > > This flat out does not work, sorry.
> > > 
> > > You should never rely on trying to count open/release calls, just let
> > > the vfs layer handle that for us as it currently does so.
> > > 
> > > Think about what happens if you call dup() in userspace on a
> > > filehandle...
> > > 
> > > > +	return 0;
> > > > +}
> > > > +
> > > >   static int release(struct uio_info *info, struct inode *inode)
> > > >   {
> > > >   	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
> > > > +	if (gdev && refcount_dec_not_one(&gdev->dev_refc))
> > > 
> > > I don't think you actually tested this as it is impossible for gdev to
> > > ever be NULL.
> > > 
> > > sorry, but this patch is not correct.
> > > 
> > > greg k-h
> > 
> > First of all, thank you for taking the time to read this patch, your
> > comments are very enlightening, but I do have a strange problem here, I test
> > such programs on kernels 5.10 and 6.2.
> > fd = open("/dev/uio0". O_RDWR);
> > while (true)
> > 	sleep(1);
> > This program only opens the uio device. After starting multiple such
> > processes, I close one of them. From the added print, it can be seen that
> > the "uio_pci_generic.c:release" function is called and the master bit is
> > cleared, instead of being called when the last process exits as expected. I
> > think the vfs is not protected as it should be.
> 
> Did your patch change this functionality?
> 
> > Such a problem cannot be
> > handled in the user-mode program. We have to clear the master bit when the
> > last process exits. Otherwise, user-mode programs (for example, the DPDK
> > process that uses uio_pci_generic) cannot work properly.
> 
> Look at the big comment in the release() function in this file.  Does
> that explain the issues here?
> 
> Just do not open the device multiple times, you have full control over
> this, right?
> 
> If not, then perhaps your hardware should not be using the
> uio_pci_generic() driver but rather have a real kernel driver for it
> instead if it needs to handle this type of functionality?
> 
> thanks,
> 
> greg k-h


Hmm. this code did however work correctly before
865a11f987ab5f03089 ("uio/uio_pci_generic: Disable bus-mastering on release")


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] uio:uio_pci_generic:Don't clear master bit when the process does not exit
  2023-02-16 15:55       ` Michael S. Tsirkin
@ 2023-02-16 16:57         ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2023-02-16 16:57 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Suweifeng (Weifeng, EulerOS),
	linux-kernel, shikemeng, liuzhiqiang26, linfeilong,
	zhanghongtao22

On Thu, Feb 16, 2023 at 10:55:05AM -0500, Michael S. Tsirkin wrote:
> On Thu, Feb 16, 2023 at 04:07:24PM +0100, Greg KH wrote:
> > On Thu, Feb 16, 2023 at 10:45:02PM +0800, Suweifeng (Weifeng, EulerOS) wrote:
> > > On 2023/2/14 21:17, Greg KH wrote:
> > > > On Tue, Feb 14, 2023 at 09:21:57PM +0800, Su Weifeng wrote:
> > > > > From: Weifeng Su <suweifeng1@huawei.com>
> > > > > 
> > > > > The /dev/uioX device is used by multiple processes. The current behavior
> > > > > is to clear the master bit when a process exits. This affects other
> > > > > processes that use the device, resulting in command suspension and
> > > > > timeout. This behavior cannot be sensed by the process itself.
> > > > > The solution is to add the reference counting. The reference count is
> > > > > self-incremented and self-decremented each time when the device open and
> > > > > close. The master bit is cleared only when the last process exited.
> > > > > 
> > > > > Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
> > > > > ---
> > > > >   drivers/uio/uio_pci_generic.c | 18 +++++++++++++++++-
> > > > >   1 file changed, 17 insertions(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
> > > > > index e03f9b532..d36d3e08e 100644
> > > > > --- a/drivers/uio/uio_pci_generic.c
> > > > > +++ b/drivers/uio/uio_pci_generic.c
> > > > > @@ -31,6 +31,7 @@
> > > > >   struct uio_pci_generic_dev {
> > > > >   	struct uio_info info;
> > > > >   	struct pci_dev *pdev;
> > > > > +	refcount_t  dev_refc;
> > > > >   };
> > > > >   static inline struct uio_pci_generic_dev *
> > > > > @@ -39,10 +40,22 @@ to_uio_pci_generic_dev(struct uio_info *info)
> > > > >   	return container_of(info, struct uio_pci_generic_dev, info);
> > > > >   }
> > > > > +static int open(struct uio_info *info, struct inode *inode)
> > > > > +{
> > > > > +	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
> > > > > +
> > > > > +	if (gdev)
> > > > > +		refcount_inc(&gdev->dev_refc);
> > > > 
> > > > This flat out does not work, sorry.
> > > > 
> > > > You should never rely on trying to count open/release calls, just let
> > > > the vfs layer handle that for us as it currently does so.
> > > > 
> > > > Think about what happens if you call dup() in userspace on a
> > > > filehandle...
> > > > 
> > > > > +	return 0;
> > > > > +}
> > > > > +
> > > > >   static int release(struct uio_info *info, struct inode *inode)
> > > > >   {
> > > > >   	struct uio_pci_generic_dev *gdev = to_uio_pci_generic_dev(info);
> > > > > +	if (gdev && refcount_dec_not_one(&gdev->dev_refc))
> > > > 
> > > > I don't think you actually tested this as it is impossible for gdev to
> > > > ever be NULL.
> > > > 
> > > > sorry, but this patch is not correct.
> > > > 
> > > > greg k-h
> > > 
> > > First of all, thank you for taking the time to read this patch, your
> > > comments are very enlightening, but I do have a strange problem here, I test
> > > such programs on kernels 5.10 and 6.2.
> > > fd = open("/dev/uio0". O_RDWR);
> > > while (true)
> > > 	sleep(1);
> > > This program only opens the uio device. After starting multiple such
> > > processes, I close one of them. From the added print, it can be seen that
> > > the "uio_pci_generic.c:release" function is called and the master bit is
> > > cleared, instead of being called when the last process exits as expected. I
> > > think the vfs is not protected as it should be.
> > 
> > Did your patch change this functionality?
> > 
> > > Such a problem cannot be
> > > handled in the user-mode program. We have to clear the master bit when the
> > > last process exits. Otherwise, user-mode programs (for example, the DPDK
> > > process that uses uio_pci_generic) cannot work properly.
> > 
> > Look at the big comment in the release() function in this file.  Does
> > that explain the issues here?
> > 
> > Just do not open the device multiple times, you have full control over
> > this, right?
> > 
> > If not, then perhaps your hardware should not be using the
> > uio_pci_generic() driver but rather have a real kernel driver for it
> > instead if it needs to handle this type of functionality?
> > 
> > thanks,
> > 
> > greg k-h
> 
> 
> Hmm. this code did however work correctly before
> 865a11f987ab5f03089 ("uio/uio_pci_generic: Disable bus-mastering on release")
> 

It's not really "correct" to leave dma bus mastering enabled, right?

Again, you can't "count" open and close calls, that just does not work
(i.e. the proposed patch will not work), so I don't see a viable
solution at the moment here.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-16 16:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14 13:21 [PATCH] uio:uio_pci_generic:Don't clear master bit when the process does not exit Su Weifeng
2023-02-14 13:17 ` Greg KH
2023-02-16 14:45   ` Suweifeng (Weifeng, EulerOS)
2023-02-16 15:07     ` Greg KH
2023-02-16 15:55       ` Michael S. Tsirkin
2023-02-16 16:57         ` Greg KH

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).