Project

General

Profile

Actions

Refactoring #391

open
AG AG

Refactor singleton states into reentrant pattern

Refactoring #391: Refactor singleton states into reentrant pattern

Added by Alexander Goncharov over 3 years ago. Updated over 3 years ago.

Status:
In Progress
Priority:
Normal
Category:
Programmer
Target version:
Start date:
06/17/2022
Due date:
% Done:

80%

Estimated time:
Affected versions:
Needs backport to:
Affected hardware:
Affected OS:

Description

Move global singleton states into a struct and store within the spi_master / opaque_master / par_master data field for the life-time of the driver.

This is one of the steps on the way to move *_master data memory management behind the initialisation API.

List of programmers which need to be refactored:

* - non-trivial case, this programmer requires some tricks

AG Updated by Alexander Goncharov over 3 years ago Actions #1

  • Description updated (diff)
  • Related links updated (diff)

Added a list of programmers and links to patches

AG Updated by Alexander Goncharov over 3 years ago Actions #2

  • % Done changed from 0 to 50

AK Updated by Anastasia Klimchuk over 3 years ago Actions #3

I can add more info on some of those:

dummyflasher: needs to migrate shutdown function into master struct(s), global state has already been removed

ch341a_spi and serprog are non-trivial cases of global state: it is wired into the core of flashrom unfortunately, via programmer_delay function. still possible of course, but this is more work and needs some design & experimenting first. So to me it seems better to go through easier cases first, and then get to harder ones.

internal is also a special one, and probably needs collaboration with other people, which I will try to organise.

AG Updated by Alexander Goncharov over 3 years ago Actions #4

  • Description updated (diff)

drkaiser , gfxnvidia are done.

I've marked non-trivial cases with *.

dummyflasher : depending on supported buses, it can register opaque, par and spi masters at the same time.

atavia : atavia_map function doesn't have access to struct flashctx.

AG Updated by Alexander Goncharov over 3 years ago Actions #5

  • Description updated (diff)

mediatek_i2c_spi, it8212, atapromise, nicintel are done.

AG Updated by Alexander Goncharov over 3 years ago Actions #6

  • Description updated (diff)

nicintel_eeprom, nicnatsemi, satamv, satasii are done.

AG Updated by Alexander Goncharov over 3 years ago Actions #7

  • % Done changed from 50 to 80

FS Updated by Felix Singer over 3 years ago Actions #8

  • Tracker changed from Feature to Refactoring
  • Target version changed from none to main
Actions

Also available in: PDF Atom