Hi Aarya,

 

 

> still felt a bit slow not as slow as before

 

Better than feeling is measuring J . You could insert it into your code (https://review.coreboot.org/c/flashrom/+/47805) or you can just run https://linux.die.net/man/1/time .

 

 

> make it use the erase whole chip function and performed the erase operation for the whole chip.

 

Check comments on https://review.coreboot.org/c/flashrom/+/58467 for some information about run time (see “random data”, this effects much the run time, depending on how many “FF” are present).

 

 

> For the "Optimise erase functions" project how are we supposed to measure the efficiency of the algorithm?

 

Well with a given flash (and it´s erase times), a given state of flash and given data to be written a possible minimum run time can be calculated. However my understanding of this project is not to get the very last 1% in run time saving but the 10-30% for certain use cases. Furthermore it will be a trade-off efficiency vs. good code. So we have to discuss this in detail during the project. I think one hard request will be:: There should be no use case where the new algorithm yields increased run time.   

 

 

> Also are there any other approaches that we can consider to optimize the erase operations?

 

Not discussed yet (but there might be in some people mind). However feel free to think about other ways. But just have in mind that before putting too much effort on a solution discuss it to avoid disappointment. But for more detailed discussion we should wait until project starts (sorry to make you wait – I appreciate your curiosity! - , but this does not make much sense if finally there is no match you and the project).

 

Regards,

 

Simon

 

 

Von: Aarya Chaumal <aarya.chaumal@gmail.com>
Gesendet: Donnerstag, 31. März 2022 23:00
An: Buhrow, Simon <simon.buhrow@sieb-meyer.de>
Cc: Anastasia Klimchuk <aklm@chromium.org>; flashrom@flashrom.org
Betreff: Re: [flashrom] Re: Questions regarding Easy project and GSoC

 

Hi Simon,

 

I tried to change the selection of the erase function to make it use the erase whole chip function and performed the erase operation for the whole chip. It still felt a bit slow not as slow as before (didn't feel a significant reduction in time). Is this normal?

 

For the "Optimise erase functions" project how are we supposed to measure the efficiency of the algorithm?

Also are there any other approaches that we can consider to optimize the erase operations?

 

Aarya.

 

On Tue, Mar 29, 2022 at 11:52 AM Buhrow, Simon <simon.buhrow@sieb-meyer.de> wrote:

Hi Aarya,

 

so you are curious and went on. Very good.

 

To be honest, I do not know how overlapping regions would behave (I have never worked with layout files as this was not necessary for us yet). If you want just give it a try. Operations like this shouldn´t damage anything (if flashrom allows this at all).

 

Sorry, I´m not a native speaker, that´s why I´m not sure if “a look ahead algorithm” is a good choice of word. However you got it very right. What you have proposed is exactly what I wanted to say. J This might sound like an easy task. However the current structure does not give much advantage to implement such thing, why the task results to be harder than it might look now.

 

It´s very good how far you got now. At the moment I do not have much more to say. Nevertheless if you have any further questions or discussions just let us know.

 

Regards,

 

Simon

 

 

Von: Aarya Chaumal <aarya.chaumal@gmail.com>
Gesendet: Samstag, 26.
März 2022 06:45
An: Buhrow, Simon <simon.buhrow@sieb-meyer.de>
Cc: Anastasia Klimchuk <aklm@chromium.org>; flashrom@flashrom.org
Betreff: Re: [flashrom] Re: Questions regarding Easy project and GSoC

 

Hi Simon,

 

I performed (read, write, erase) on specific regions of the flash using the layout file. Do the regions in the layout file have to be exclusive or they can overlap?

 

Also, I'm not sure what a look ahead algorithm means. A brief search tells me it evaluates the effect of the procedure before doing it. Not sure how it is to be implemented.

 

I have the following approach in my mind. Keep using the largest erase function which erases just less than the region to be erased. For example, if we have to erase 200kB and have erase functions for 4kB,32kB,64kB. We would use the 64kB eraser three times first. Then the region left to be erased would be 8kB. Then we would use the 4kB eraser twice. Is this what you mean by look-ahead algorithm?

 

Aarya

 

On Thu, Mar 24, 2022 at 3:36 PM Buhrow, Simon <simon.buhrow@sieb-meyer.de> wrote:

Hi Aarya,

 

sounds great. Very good that you got the programmer. And very good that you already dived into the code.

 

AFAICS you now have a good understanding of the problem to be solved. J The details of how to implement a better solution is part of the project.

 

I think there is not much to do before the project starts (you understand the problem + you have got hardware to test = you are quite ready to start). However if you are curious and want to do some more steps you are very welcome to do the following steps:

 

* Have a look at https://review.coreboot.org/c/flashrom/+/58467 , the comments will give you a deeper understanding of the problem and possible starting points (and by the way will show you that there are people willing to help kindly J ). I think we are running into something like using a look-ahead algorithm to determine which erase-function to use.

 

* Get familiar with writing only certain regions of a flash (i.e. using a layout file) for better understanding of all the use cases

 

Just let us know if you got any further questions or ideas.

 

Regards,

 

Simon

 

 

 

 

Von: Aarya Chaumal <aarya.chaumal@gmail.com>
Gesendet: Montag, 21.
März 2022 22:16
An: Buhrow, Simon <
simon.buhrow@sieb-meyer.de>
Cc: Anastasia Klimchuk <
aklm@chromium.org>; flashrom@flashrom.org
Betreff: Re: [flashrom] Re: Questions regarding Easy project and GSoC

 

Hi Simon,

 

I got my hardware yesterday and I played around with it and flashrom. I also studied the code flow for the erase functions. I saw that flashrom tries different erase functions given in the flashctx->chip->block_erasers[] by iterating through the list. Assuming these functions are in order of the length (number of sectors)  they erase, the first one would get selected most of the time as it erases the smallest length. But this would be inefficient as the function which erases more length would do the job faster although it might not give the required granularity. A better approach could be to use the latter (if necessary) until the remaining length is less than the length that this function can erase.

 

Aarya

 

On Wed, Mar 16, 2022 at 4:45 PM Buhrow, Simon <simon.buhrow@sieb-meyer.de> wrote:

Hi Aarya,

 

nice progress!

 

I´m writing having "optimizing erase-function" in mint. However the following might apply fully or in parts to the other topic(s) as well:

 

As written to Hui Xiang:

As it´s never a good idea to experiment with the workhorse itself, I would recommend to do tests on extra hardware. (There might be some things you can test with software dummies, someone else must tell you about that). A very cheap programmer often mentioned here is the CH341A Programmer, however there are many other affordable programmers with ftdi chips, the raspberry pi and other manufactures as well (https://www.flashrom.org/Supported_programmers).

In addition you would need any supported Flash in a DIP package or a in SO-Package plus DIP-adapter.

There are several examples along the internet using flashrom and a programmer plus flash or target board with a soldered flash. Just pick any and start with that.

 

 

>> Can you suggest some tasks so that I can know more about these projects

> A question from me: have you tried to build and run flashrom from your local repo source code?

 

Building flashrom is a good start. Furthermore possible steps to play a bit around would be this:

* Read a good article (e.g. wikipedia) about flash memory technology and understand why there are “block erase” functions (instead of byte wise erase).

* When you have done so and have any supported programmer plus flash at your hands (see above), take the datasheet of the flash and explore the parts about the different erase functions.

* Then try running erase (parts of or the entire) flash memory. Check (via debugging/print messages/verbose output) which block erase function is used.

* Compare the result with the best theoretical option derived from datasheet values. (“best” = fastest)

 

Hope this helps and you´ve got some dollars for the hardware. If anyone else has some thoughts about making progress without proposing a purchase, just let Aarya know.

 

Regards,

 

Simon

 

 

Von: Anastasia Klimchuk <aklm@chromium.org>
Gesendet: Sonntag, 13.
März 2022 07:45
An:
flashrom@flashrom.org; Aarya Chaumal <aarya.chaumal@gmail.com>
Betreff: [flashrom] Re: Questions regarding Easy project and GSoC

 

Aarya,

 

Thank you so much for your patches, awesome work!

 

Don't worry about merging for now. Merging almost never happens immediately. Reviewers will come back to the patches, check that everything is fine, all the comments are resolved etc. If everything is alright, reviewers will approve and then at some point merge.

It can also happen that you get another iteration of comments: but don't worry this is a normal process!

From your side, you always (for now, and for future) need to understand all the comments, resolve and reply - once this is done, it is the Reviewer's turn :)

 

It is very good that you identified two projects that are interesting for you. You will discuss a project in more detail with someone who plans to be Mentor for the project. Let me check who that will be. 

Also, if someone who plans to be a Mentor for "optimizing erase-function" or "fixing endianness issues" is reading this, you can just reply :) What would be the best next steps for Aarya to prepare?

 

A question from me: have you tried to build and run flashrom from your local repo source code? To begin with you can run

 

flashrom -h

 

which is help information. It tells you all command line operations and arguments. It is served by cli_classic.c file.

So you can read about "erase" operation and then explore the code which implements it.

 

Meanwhile, just to check, have you read official resources from gsoc? These ones:

 

Anastasia.

 

On Sun, Mar 13, 2022 at 1:44 PM Aarya Chaumal <aarya.chaumal@gmail.com> wrote:

As suggested, I have been doing some of the easy projects till now and
I have enjoyed it. I have submitted a few patches till now and some of
them have gotten +2 code-reviews but still, they were not merged. Is
there anything that is required to get the changes to be merged?
Also, I have fixed most of the issues I got by running scan-build,
only 2 classes of issues were remaining which I feel are false
positives (showing underflow error but those cases won't occur or are
handled seprately) created by the tool and can be ignored.
As was going through your proposed projects for GSoC, I found
"optimizing erase-function" and "fixing endianness issues"
interesting and would like to do that in the summer. Can you suggest
some tasks so that I can know more about these projects and get an
idea of how to write my proposal for GSoC for doing this project?
Thanks :)

On Thu, Mar 10, 2022 at 10:45 AM Anastasia Klimchuk <
aklm@chromium.org> wrote:
>
> Hello Aarya,
>
> Nice to meet you! I think I saw your question on the IRC channel, and someone replied, was that your question?
> Do you still need more info? Let us know if yes.
>
> Thanks!
>
> On Wed, Mar 9, 2022 at 2:42 PM Aarya Chaumal <
aarya.chaumal@gmail.com> wrote:
>>
>> Hello there,
>>
>> I hope you are well today when you receive this email. I am Aarya Chaumal, a Computer Engineering student at the College of Engineering Pune, India. While going through organizations for this year's Google's Summer of Code I came across your organization, Flashrom.
>>
>> I am a  part of onboard computers subsystem at my college's satellite initiative. Through this, I have closely worked on Atmel SAM E70 XPLAINED board. Also, I have strong knowledge about C/C++ and assembly language. From your list of GSoC project ideas, I liked the idea of “Remove global state from flashrom” and "Optimize Erase-Function Selection", although I am not quite sure which one is more suitable for me. Can you guide me through this?
>>
>> As mentioned in your Contributor commitments and requirements, I started to do one of the easy projects - Add new flash chip definitions. For this, I read the relevant datasheets, one from the unlisted chips and another of a listed one (for reference) but still, I am not getting the information about some fields for the structure in the datasheet, namely the feature_bits, probe_timing. Also, do I have to write the probe, read, write and erase functions for the chip separately? Also, how do I test if my code is working as I don't have relevant hardware with me? Can you help me with this? Also what resources should I use to learn more about it?
>>
>> Thank you for looking into this for me.
>> Sincerely,
>> Aarya Chaumal
>> _______________________________________________
>> flashrom mailing list --
flashrom@flashrom.org
>> To unsubscribe send an email to
flashrom-leave@flashrom.org
>
>
>
> --
> Anastasia.


 

--

Anastasia.