Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Does the Linux MTD Driver Practice Erase Avoidance?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10261
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Oct 25, 2016 2:58 pm    Post subject: Does the Linux MTD Driver Practice Erase Avoidance? Reply with quote

I'm probably going to end up having to research this for myself, but here's a quick, lazy question.

If a partial-sector write to an MTD device would only turn one bits into zero bits in the underlying physical flash device, is the driver smart enough to just write the new data as opposed to performing a full sector read/modify/erase/write?

I can provide background information if necessary but, if you need it, you probably can't answer the question. ;)

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5761

PostPosted: Tue Oct 25, 2016 4:29 pm    Post subject: Reply with quote

Skimmed through the code... the closest thing I could find was inftl_writeblock() in linux/drivers/mtd/inftlcore.c which is just a vanilla discard optimization.

I get what you're describing here, but I think it just isn't done for performance reasons; bitmask checks on every 64/128KB write isn't cheap, and short-circuiting them isn't an option because of the potential for timing attacks (no matter how contrived they seem).

It might be possibly happening down in the MTD firmware, but nobody's going to be able to say for sure.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10261
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Oct 26, 2016 8:32 pm    Post subject: Reply with quote

Thanks. I did a cursory review of the source code as well and didn't see any logic that could be doing that either. The flash I'm using, parallel (and, in some cases, SPI) NOR, has no firmware, per se.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum