Re: [PATCH] mtd: use refcount to prevent corruption

2021-02-15 Thread Richard Weinberger
On Sat, Feb 13, 2021 at 6:12 PM Winkler, Tomas wrote: > > Well, the trick in glubi (and other MTDs with "hotplug" support) is not to > > reject removal of the sub-device. ->_put_device() is of return type void. > > The key is grabbing a reference on the sub-device in ->_get_device() such > > that

RE: [PATCH] mtd: use refcount to prevent corruption

2021-02-13 Thread Winkler, Tomas
> > Tomas, > > - Ursprüngliche Mail - > >> As Richard was saying, we are really open to enhance MTD refcounting. > >> > >> However, the issue you are facing is, IMHO, not related to MTD but to > MFD. > >> There should be a way to avoid MFD to vanish by taking a reference of > >> it

Re: [PATCH] mtd: use refcount to prevent corruption

2021-01-28 Thread Richard Weinberger
Tomas, - Ursprüngliche Mail - >> As Richard was saying, we are really open to enhance MTD refcounting. >> >> However, the issue you are facing is, IMHO, not related to MTD but to MFD. >> There should be a way to avoid MFD to vanish by taking a reference of it >> through

RE: [PATCH] mtd: use refcount to prevent corruption

2021-01-28 Thread Winkler, Tomas
> Hi Tomas, > > "Winkler, Tomas" wrote on Thu, 28 Jan 2021 > 08:53:43 +: > > > > Tomas, > > > > > > - Ursprüngliche Mail - > > > >> >> Can you please explain a little more what devices are involved? > > > >> >> Does it implement _get_device() and _put_device()? > > > >> > No this is

Re: [PATCH] mtd: use refcount to prevent corruption

2021-01-28 Thread Miquel Raynal
Hi Tomas, "Winkler, Tomas" wrote on Thu, 28 Jan 2021 08:53:43 +: > > Tomas, > > > > - Ursprüngliche Mail - > > >> >> Can you please explain a little more what devices are involved? > > >> >> Does it implement _get_device() and _put_device()? > > >> > No this is not connected to

RE: [PATCH] mtd: use refcount to prevent corruption

2021-01-28 Thread Winkler, Tomas
> Tomas, > > - Ursprüngliche Mail - > >> >> Can you please explain a little more what devices are involved? > >> >> Does it implement _get_device() and _put_device()? > >> > No this is not connected to those handlers of the underlying device > >> > and those won't help. > >> > I have a

Re: [PATCH] mtd: use refcount to prevent corruption

2021-01-27 Thread Richard Weinberger
Tomas, - Ursprüngliche Mail - >> >> Can you please explain a little more what devices are involved? >> >> Does it implement _get_device() and _put_device()? >> > No this is not connected to those handlers of the underlying device >> > and those won't help. >> > I have a spi device

RE: [PATCH] mtd: use refcount to prevent corruption

2021-01-27 Thread Winkler, Tomas
> > - Ursprüngliche Mail - > >> > When underlying device is removed mtd core will crash in case user > >> > space is still holding an open handle to a mtd device node. > >> > A proper refcounting is needed so device is release only when a > >> > partition has no active users. The current

Re: [PATCH] mtd: use refcount to prevent corruption

2021-01-27 Thread Richard Weinberger
- Ursprüngliche Mail - >> > When underlying device is removed mtd core will crash in case user >> > space is still holding an open handle to a mtd device node. >> > A proper refcounting is needed so device is release only when a >> > partition has no active users. The current simple

RE: [PATCH] mtd: use refcount to prevent corruption

2021-01-27 Thread Winkler, Tomas
> Subject: Re: [PATCH] mtd: use refcount to prevent corruption > > Tomas, > > - Ursprüngliche Mail - > > Von: "Tomas Winkler" > > An: "Miquel Raynal" , "richard" > > , "Vignesh Raghavendra" , "linux-mtd&

Re: [PATCH] mtd: use refcount to prevent corruption

2021-01-27 Thread Richard Weinberger
Tomas, - Ursprüngliche Mail - > Von: "Tomas Winkler" > An: "Miquel Raynal" , "richard" , > "Vignesh Raghavendra" , > "linux-mtd" , "linux-kernel" > > CC: "Tomas Winkler" > Gesendet: Mittwoch, 27. Januar 2021 21:03:19 > Betreff: [PATCH] mtd: use refcount to prevent corruption > When