On 9/16/26 03:55, Marek Vasut wrote:
> On 9/15/26 9:12 AM, Patrice CHOTARD wrote:
>>
>>
>> On 9/14/26 22:34, Marek Vasut wrote:
>>> On 9/14/26 8:45 AM, Patrice CHOTARD wrote:
>>>
>>> Hello Patrice,
>>>
>>>>>> schedule() execution doesn't takes 70ms.
>>>>>> Moving schedule() from main loop to same level that ctrlc(), it allows 
>>>>>> to call ctrlc() every ~70ms.
>>>>> In the current state, the ctrlc() is called every ... how many ... ms ?
>>>>
>>>> Currently ctrlc() is called every 700ms
>>>>
>>>>>
>>>>> How come this trips the watchdog timeout ? What is the watchdog timeout 
>>>>> delay set to in your case ?
>>>>
>>>> In our case, watchdog is set to 32 seconds on STM32MP157c-DK2.
>>>>
>>>> For information, this patch is superseeded by
>>>>
>>>> https://patchwork.ozlabs.org/project/uboot/patch/20260817-move_schedule_inside_sleep_thread-v1-2-0023194e8...@foss.st.com/
>>> Let me ask a different question -- is the problem that this is trying to 
>>> solve the responsiveness of ctrl-c , or is the problem that this trips the 
>>> WDT ?
>>>
>>> If the later, how come 700ms cycle trips 32 second timeout WDT ?
>>>
>>> (I'm sorry, I feel like I must be missing something obvious here?)
>>
>> Hi Marek
>>
>> The goal of this patch is only to solve the responsiveness of CTRL-C.
> In that case, I still don't get it. Moving the schedule() into if (k == 10) 
> won't improve responsiveness of ctrl-c unless schedule takes a long time, 
> which as far as I understand it, it doesn't.
> 
> I would understand this patch which would I believe improve the ctrl-c 
> responsiveness, without having severe impact on performance:
> 
> diff --git a/drivers/usb/gadget/f_mass_storage.c 
> b/drivers/usb/gadget/f_mass_storage.c
> index 7eb667c130d..96581792031 100644
> --- a/drivers/usb/gadget/f_mass_storage.c
> +++ b/drivers/usb/gadget/f_mass_storage.c
> @@ -651,7 +651,7 @@ static void busy_indicator(void)
>  static int sleep_thread(struct fsg_common *common)
>  {
>         int     rc = 0;
> -       int i = 0, k = 0;
> +       int i = 0;
> 
>         /* Wait until a signal arrives or we are woken up */
>         for (;;) {
> @@ -661,10 +661,7 @@ static int sleep_thread(struct fsg_common *common)
>                 if (++i == 20000) {
>                         busy_indicator();
>                         i = 0;
> -                       k++;
> -               }
> 
> -               if (k == 10) {
>                         /* Handle START-STOP UNIT */
>                         if (common->eject)
>                                 return -EPIPE;
> @@ -676,8 +673,6 @@ static int sleep_thread(struct fsg_common *common)
>                         /* Check cable connection */
>                         if (!g_dnl_board_usb_cable_connected())
>                                 return -EIO;
> -
> -                       k = 0;
>                 }
> 
>                 schedule();

Hi Marek

Agree with your proposal, it has even better impact on CTRL-C response.
I will superseed this patch.

Thanks
Patrice

Reply via email to