* [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
@ 2024-12-02 7:46 Patrice Chotard
2024-12-03 1:02 ` Marek Vasut
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Patrice Chotard @ 2024-12-02 7:46 UTC (permalink / raw)
To: u-boot
Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32, Caleb Connolly,
Lukasz Majewski, Marek Vasut, Mattijs Korpershoek, Neil Armstrong,
Tom Rini
In case "ums" command is used on platforms which don't implement
g_dnl_board_usb_cable_connected() and USB cable is not connected,
we stay inside sleep_thread() forever and watchdog is triggered.
Add schedule() call to avoid this issue.
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
---
Changes in v2:
- move schedule() right before dm_usb_gadget_handle_interrupts()
drivers/usb/gadget/f_mass_storage.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index ffe1ae6eb73..d3fc4acb401 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -682,6 +682,7 @@ static int sleep_thread(struct fsg_common *common)
k = 0;
}
+ schedule();
dm_usb_gadget_handle_interrupts(udcdev);
}
common->thread_wakeup_needed = 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
2024-12-02 7:46 [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread() Patrice Chotard
@ 2024-12-03 1:02 ` Marek Vasut
2024-12-03 8:53 ` Patrice CHOTARD
2024-12-03 9:47 ` Mattijs Korpershoek
2025-02-11 7:59 ` Mattijs Korpershoek
2 siblings, 1 reply; 9+ messages in thread
From: Marek Vasut @ 2024-12-03 1:02 UTC (permalink / raw)
To: Patrice Chotard, u-boot
Cc: Patrick DELAUNAY, U-Boot STM32, Caleb Connolly, Lukasz Majewski,
Mattijs Korpershoek, Neil Armstrong, Tom Rini
On 12/2/24 8:46 AM, Patrice Chotard wrote:
> In case "ums" command is used on platforms which don't implement
> g_dnl_board_usb_cable_connected() and USB cable is not connected,
> we stay inside sleep_thread() forever and watchdog is triggered.
>
> Add schedule() call to avoid this issue.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Is this a bugfix for 2025.01 ?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
2024-12-03 1:02 ` Marek Vasut
@ 2024-12-03 8:53 ` Patrice CHOTARD
0 siblings, 0 replies; 9+ messages in thread
From: Patrice CHOTARD @ 2024-12-03 8:53 UTC (permalink / raw)
To: Marek Vasut, u-boot
Cc: Patrick DELAUNAY, U-Boot STM32, Caleb Connolly, Lukasz Majewski,
Mattijs Korpershoek, Neil Armstrong, Tom Rini
On 12/3/24 02:02, Marek Vasut wrote:
> On 12/2/24 8:46 AM, Patrice Chotard wrote:
>> In case "ums" command is used on platforms which don't implement
>> g_dnl_board_usb_cable_connected() and USB cable is not connected,
>> we stay inside sleep_thread() forever and watchdog is triggered.
>>
>> Add schedule() call to avoid this issue.
>>
>> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Reviewed-by: Marek Vasut <marex@denx.de>
>
> Is this a bugfix for 2025.01 ?
No, it can wait next release v2025.04
Thanks
Patrice
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
2024-12-02 7:46 [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread() Patrice Chotard
2024-12-03 1:02 ` Marek Vasut
@ 2024-12-03 9:47 ` Mattijs Korpershoek
2025-02-10 10:28 ` Patrice CHOTARD
2025-02-11 7:59 ` Mattijs Korpershoek
2 siblings, 1 reply; 9+ messages in thread
From: Mattijs Korpershoek @ 2024-12-03 9:47 UTC (permalink / raw)
To: Patrice Chotard, u-boot
Cc: Patrice CHOTARD, Patrick DELAUNAY, U-Boot STM32, Caleb Connolly,
Lukasz Majewski, Marek Vasut, Neil Armstrong, Tom Rini
Hi Patrice,
Thank you for the patch.
On lun., déc. 02, 2024 at 08:46, Patrice Chotard <patrice.chotard@foss.st.com> wrote:
> In case "ums" command is used on platforms which don't implement
> g_dnl_board_usb_cable_connected() and USB cable is not connected,
> we stay inside sleep_thread() forever and watchdog is triggered.
>
> Add schedule() call to avoid this issue.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
>
> ---
>
> Changes in v2:
> - move schedule() right before dm_usb_gadget_handle_interrupts()
>
> drivers/usb/gadget/f_mass_storage.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
> index ffe1ae6eb73..d3fc4acb401 100644
> --- a/drivers/usb/gadget/f_mass_storage.c
> +++ b/drivers/usb/gadget/f_mass_storage.c
> @@ -682,6 +682,7 @@ static int sleep_thread(struct fsg_common *common)
> k = 0;
> }
>
> + schedule();
> dm_usb_gadget_handle_interrupts(udcdev);
> }
> common->thread_wakeup_needed = 0;
> --
> 2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
2024-12-03 9:47 ` Mattijs Korpershoek
@ 2025-02-10 10:28 ` Patrice CHOTARD
2025-02-10 13:42 ` Marek Vasut
0 siblings, 1 reply; 9+ messages in thread
From: Patrice CHOTARD @ 2025-02-10 10:28 UTC (permalink / raw)
To: Mattijs Korpershoek, u-boot, Marek Vasut
Cc: Patrick DELAUNAY, U-Boot STM32, Caleb Connolly, Lukasz Majewski,
Marek Vasut, Neil Armstrong, Tom Rini
Hi Marek
Any chance to get this patch merged in next U-Boot tag 2025.04-rc2 ?
Thanks
Patrice
On 12/3/24 10:47, Mattijs Korpershoek wrote:
> Hi Patrice,
>
> Thank you for the patch.
>
> On lun., déc. 02, 2024 at 08:46, Patrice Chotard <patrice.chotard@foss.st.com> wrote:
>
>> In case "ums" command is used on platforms which don't implement
>> g_dnl_board_usb_cable_connected() and USB cable is not connected,
>> we stay inside sleep_thread() forever and watchdog is triggered.
>>
>> Add schedule() call to avoid this issue.
>>
>> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
>
> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
>
>>
>> ---
>>
>> Changes in v2:
>> - move schedule() right before dm_usb_gadget_handle_interrupts()
>>
>> drivers/usb/gadget/f_mass_storage.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
>> index ffe1ae6eb73..d3fc4acb401 100644
>> --- a/drivers/usb/gadget/f_mass_storage.c
>> +++ b/drivers/usb/gadget/f_mass_storage.c
>> @@ -682,6 +682,7 @@ static int sleep_thread(struct fsg_common *common)
>> k = 0;
>> }
>>
>> + schedule();
>> dm_usb_gadget_handle_interrupts(udcdev);
>> }
>> common->thread_wakeup_needed = 0;
>> --
>> 2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
2025-02-10 10:28 ` Patrice CHOTARD
@ 2025-02-10 13:42 ` Marek Vasut
2025-02-11 7:54 ` Mattijs Korpershoek
0 siblings, 1 reply; 9+ messages in thread
From: Marek Vasut @ 2025-02-10 13:42 UTC (permalink / raw)
To: Patrice CHOTARD, Mattijs Korpershoek, u-boot
Cc: Patrick DELAUNAY, U-Boot STM32, Caleb Connolly, Lukasz Majewski,
Neil Armstrong, Tom Rini
On 2/10/25 11:28 AM, Patrice CHOTARD wrote:
> Hi Marek
Hi,
> Any chance to get this patch merged in next U-Boot tag 2025.04-rc2 ?
Gadget stuff is on Mattijs desk, please ping me in a few days if he
doesn't pick it up, I'll do so then. Sorry for the delay.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
2025-02-10 13:42 ` Marek Vasut
@ 2025-02-11 7:54 ` Mattijs Korpershoek
2025-02-11 8:24 ` Patrice CHOTARD
0 siblings, 1 reply; 9+ messages in thread
From: Mattijs Korpershoek @ 2025-02-11 7:54 UTC (permalink / raw)
To: Marek Vasut, Patrice CHOTARD, u-boot
Cc: Patrick DELAUNAY, U-Boot STM32, Caleb Connolly, Lukasz Majewski,
Neil Armstrong, Tom Rini
On lun., févr. 10, 2025 at 14:42, Marek Vasut <marex@denx.de> wrote:
> On 2/10/25 11:28 AM, Patrice CHOTARD wrote:
>> Hi Marek
>
> Hi,
>
>> Any chance to get this patch merged in next U-Boot tag 2025.04-rc2 ?
> Gadget stuff is on Mattijs desk, please ping me in a few days if he
> doesn't pick it up, I'll do so then. Sorry for the delay.
Somehow, this was not assigned to me on patchwork, so I missed this.
Sorry about the delay, will pick up today.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
2025-02-11 7:54 ` Mattijs Korpershoek
@ 2025-02-11 8:24 ` Patrice CHOTARD
0 siblings, 0 replies; 9+ messages in thread
From: Patrice CHOTARD @ 2025-02-11 8:24 UTC (permalink / raw)
To: Mattijs Korpershoek, Marek Vasut, u-boot
Cc: Patrick DELAUNAY, U-Boot STM32, Caleb Connolly, Lukasz Majewski,
Neil Armstrong, Tom Rini
On 2/11/25 08:54, Mattijs Korpershoek wrote:
> On lun., févr. 10, 2025 at 14:42, Marek Vasut <marex@denx.de> wrote:
>
>> On 2/10/25 11:28 AM, Patrice CHOTARD wrote:
>>> Hi Marek
>>
>> Hi,
>>
>>> Any chance to get this patch merged in next U-Boot tag 2025.04-rc2 ?
>> Gadget stuff is on Mattijs desk, please ping me in a few days if he
>> doesn't pick it up, I'll do so then. Sorry for the delay.
>
> Somehow, this was not assigned to me on patchwork, so I missed this.
> Sorry about the delay, will pick up today.
Thanks ;-)
Patrice
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
2024-12-02 7:46 [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread() Patrice Chotard
2024-12-03 1:02 ` Marek Vasut
2024-12-03 9:47 ` Mattijs Korpershoek
@ 2025-02-11 7:59 ` Mattijs Korpershoek
2 siblings, 0 replies; 9+ messages in thread
From: Mattijs Korpershoek @ 2025-02-11 7:59 UTC (permalink / raw)
To: u-boot, Patrice Chotard
Cc: Patrick DELAUNAY, U-Boot STM32, Caleb Connolly, Lukasz Majewski,
Marek Vasut, Neil Armstrong, Tom Rini
Hi,
On Mon, 02 Dec 2024 08:46:44 +0100, Patrice Chotard wrote:
> In case "ums" command is used on platforms which don't implement
> g_dnl_board_usb_cable_connected() and USB cable is not connected,
> we stay inside sleep_thread() forever and watchdog is triggered.
>
> Add schedule() call to avoid this issue.
>
>
> [...]
Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)
[1/1] usb: gadget: f_mass_storage: Add schedule() in sleep_thread()
https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/4b6a3e860878de5198f5561a0d8c602a9c296f0a
--
Mattijs
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-02-11 8:40 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 7:46 [PATCH v2] usb: gadget: f_mass_storage: Add schedule() in sleep_thread() Patrice Chotard
2024-12-03 1:02 ` Marek Vasut
2024-12-03 8:53 ` Patrice CHOTARD
2024-12-03 9:47 ` Mattijs Korpershoek
2025-02-10 10:28 ` Patrice CHOTARD
2025-02-10 13:42 ` Marek Vasut
2025-02-11 7:54 ` Mattijs Korpershoek
2025-02-11 8:24 ` Patrice CHOTARD
2025-02-11 7:59 ` Mattijs Korpershoek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.