[PATCH 0/2] mtd: prepare for dynamically removed devices

Alexander Usyskin posted 2 patches 2 years, 7 months ago
drivers/mtd/mtdcore.c   | 86 ++++++++++++++++++++++-------------------
drivers/mtd/mtdcore.h   |  1 +
drivers/mtd/mtdpart.c   | 14 ++++---
include/linux/mtd/mtd.h |  2 +-
4 files changed, 56 insertions(+), 47 deletions(-)
[PATCH 0/2] mtd: prepare for dynamically removed devices
Posted by Alexander Usyskin 2 years, 7 months ago
Prepare mtd subsystem for devices that can be dynamically removed,
like memory on PCIE card.
Use refcount to prevent crashes when underlying device
removed unexpectedly and reshuffle __get and __put functions
to allow underlying device to clean it memory according to refcount.

Alexander Usyskin (1):
  mtd: call external _get and _put in right order

Tomas Winkler (1):
  mtd: use refcount to prevent corruption

 drivers/mtd/mtdcore.c   | 86 ++++++++++++++++++++++-------------------
 drivers/mtd/mtdcore.h   |  1 +
 drivers/mtd/mtdpart.c   | 14 ++++---
 include/linux/mtd/mtd.h |  2 +-
 4 files changed, 56 insertions(+), 47 deletions(-)

-- 
2.34.1
Re: [PATCH 0/2] mtd: prepare for dynamically removed devices
Posted by Miquel Raynal 2 years, 7 months ago
Hi Alexander,

alexander.usyskin@intel.com wrote on Tue, 20 Jun 2023 16:19:03 +0300:

> Prepare mtd subsystem for devices that can be dynamically removed,
> like memory on PCIE card.
> Use refcount to prevent crashes when underlying device
> removed unexpectedly and reshuffle __get and __put functions
> to allow underlying device to clean it memory according to refcount.
> 
> Alexander Usyskin (1):
>   mtd: call external _get and _put in right order
> 
> Tomas Winkler (1):
>   mtd: use refcount to prevent corruption
> 
>  drivers/mtd/mtdcore.c   | 86 ++++++++++++++++++++++-------------------
>  drivers/mtd/mtdcore.h   |  1 +
>  drivers/mtd/mtdpart.c   | 14 ++++---
>  include/linux/mtd/mtd.h |  2 +-
>  4 files changed, 56 insertions(+), 47 deletions(-)
> 

The idea is of course great, the implementation looks fine, but the
risk is too high at -rc7 so I'll take this at -rc1 for the next
release.

Thanks, Miquèl