[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OSBPR01MB47733A5CB20E20E48EE84602BA8B9@OSBPR01MB4773.jpnprd01.prod.outlook.com>
Date: Fri, 12 Feb 2021 15:39:03 +0000
From: Min Li <min.li.xe@...esas.com>
To: Greg KH <gregkh@...uxfoundation.org>
CC: "derek.kiernan@...inx.com" <derek.kiernan@...inx.com>,
"dragan.cvetic@...inx.com" <dragan.cvetic@...inx.com>,
"arnd@...db.de" <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next v2] misc: Add Renesas Synchronization Management
Unit (SMU) support
> > +
> > + /* Only one open per device at a time */
> > + if (!atomic_dec_and_test(&rsmu->open_count)) {
> > + atomic_inc(&rsmu->open_count);
> > + return -EBUSY;
>
> This does not do what you think it does, and does not prevent multiple
> applications from talking to your device at the same time.
>
> There is no need for this at all, as it does not work, sorry. If multiple apps
> talk to your device, it's their fault, not the kernel's fault, that things go
> wrong.
>
> And I thought that Arnd already told you to fix this?
>
Hi Greg
Sorry for not replying to the list, I am new so not very familiar with the process.
Can you elaborate why it doesn't work? I kind of borrow the idea from xilinx_sdfec.c and I don't see why it doesn't work.
I mean if an application failed at opening the device, how can it proceed to talk the device without a file descriptor?
Thanks
Min
Powered by blists - more mailing lists