
In message c166aa9f0505281515495cf1c5@mail.gmail.com you wrote:
I tried this part of this patch out and aggravated some problems in the cfi_flash code.
Several of the timeout parameters in the CFI query structure return units of microseconds. I use an AMD 29LV160 part. In the CFI parser code these microsecond values are converted to milliseconds by integer division. For the 29LV160 this leaves some of the timeout parameters in the info structure at zero.
I see.
I can see a few ways to fix this:
- adjust the info values after the scaling to millisecond values
- force a one tick delay no matter what in flash_status_check()
1) and 2) sound similar to me - if you count in millisecs you will have to round up any non-zero delay in any case.
- modify the code to report everything in microseconds and use udelay
This would probably slow down execution, as you then will delay always instead of actively waitingin a busy loop.
- use set_timer() to make sure there is a full timer tick
This is just another variant of 1) and 2), right?
I recommend to implement correct rounding of the timeouts (i. e. round up to fill lilliseconds); note that his does NOT slow down normal operation.
Best regards,
Wolfgang Denk