Skip to contentSkip to conversation

Trigger watchdog before calling usb_gadget_handle_interrupts

U-Boot Vincent Prince 4 participants 6 messages Oct 23, 2017 – Nov 7, 2017 USB

lore
Share & tools
lore
#0 lore raw

This prevents board resets when calling sdp command on boards which have a watchdog.

---
 drivers/usb/gadget/f_sdp.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/gadget/f_sdp.c +4 -0
index 0fae66b..c3eba6d 100644
@@ -32,6 +32,7 @@
 #include <spl.h>
 #include <image.h>
 #include <imximage.h>
+#include <watchdog.h>
 
 #define HID_REPORT_ID_MASK	0x000000ff
 
@@ -602,6 +603,8 @@ int sdp_init(int controller_index)
 			puts("\rCTRL+C - Operation aborted.\n");
 			return 1;
 		}
+
+		WATCHDOG_RESET();
 		usb_gadget_handle_interrupts(controller_index);
 	}
 
@@ -712,6 +715,7 @@ void sdp_handle(int controller_index)
 			return;
 		}
 
+		WATCHDOG_RESET();
 		usb_gadget_handle_interrupts(controller_index);
 
 		sdp_handle_in_ep();
Signature · 1 line
2.7.4
#1 lore raw

This prevents board resets when calling sdp command on boards which have a watchdog.

---
 drivers/usb/gadget/f_sdp.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/gadget/f_sdp.c +4 -0
index 0fae66b..c3eba6d 100644
@@ -32,6 +32,7 @@
 #include <spl.h>
 #include <image.h>
 #include <imximage.h>
+#include <watchdog.h>
 
 #define HID_REPORT_ID_MASK	0x000000ff
 
@@ -602,6 +603,8 @@ int sdp_init(int controller_index)
 			puts("\rCTRL+C - Operation aborted.\n");
 			return 1;
 		}
+
+		WATCHDOG_RESET();
 		usb_gadget_handle_interrupts(controller_index);
 	}
 
@@ -712,6 +715,7 @@ void sdp_handle(int controller_index)
 			return;
 		}
 
+		WATCHDOG_RESET();
 		usb_gadget_handle_interrupts(controller_index);
 
 		sdp_handle_in_ep();
Signature · 1 line
2.7.4
Reviewed-by
#2 lore raw

Hi Vincent,

Quoted 30 lines

This prevents board resets when calling sdp command on boards which have a watchdog.

---
 drivers/usb/gadget/f_sdp.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/gadget/f_sdp.c +3 -0
index 0fae66b..c3eba6d 100644
@@ -32,6 +32,7 @@
 #include <spl.h>
 #include <image.h>
 #include <imximage.h>
+#include <watchdog.h>
 
 #define HID_REPORT_ID_MASK	0x000000ff
 
@@ -602,6 +603,8 @@ int sdp_init(int controller_index)
 			puts("\rCTRL+C - Operation aborted.\n");
 			return 1;
 		}
+
+		WATCHDOG_RESET();
 		usb_gadget_handle_interrupts(controller_index);
 	}
 

drivers/usb/gadget/f_sdp.c void sdp_handle(int controller_index) · line 721

Quoted 7 lines
drivers/usb/gadget/f_sdp.c +1 -0
@@ -712,6 +715,7 @@ void sdp_handle(int controller_index)
 			return;
 		}
 
+		WATCHDOG_RESET();
 		usb_gadget_handle_interrupts(controller_index);
 
 		sdp_handle_in_ep();

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

Reviewed-by
#3 lore raw
Quoted 35 lines · Lukasz Majewski

Hi Vincent,

Quoted 33 lines

This prevents board resets when calling sdp command on boards which have a watchdog.

---
 drivers/usb/gadget/f_sdp.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/gadget/f_sdp.c +3 -0
index 0fae66b..c3eba6d 100644
@@ -32,6 +32,7 @@
 #include <spl.h>
 #include <image.h>
 #include <imximage.h>
+#include <watchdog.h>
 
 #define HID_REPORT_ID_MASK	0x000000ff
 
@@ -602,6 +603,8 @@ int sdp_init(int controller_index)
 			puts("\rCTRL+C - Operation aborted.\n");
 			return 1;
 		}
+
+		WATCHDOG_RESET();
 		usb_gadget_handle_interrupts(controller_index);
 	}
 
@@ -712,6 +715,7 @@ void sdp_handle(int controller_index)
 			return;
 		}
 
Quoted 5 lines

drivers/usb/gadget/f_sdp.c void sdp_handle(int controller_index) · line 721

Quoted 4 lines
drivers/usb/gadget/f_sdp.c +1 -0
+		WATCHDOG_RESET();
 		usb_gadget_handle_interrupts(controller_index);
 
 		sdp_handle_in_ep();

Thanks for the patch! Looks good to me too.

Best regards,
Stefan

Quoted 11 lines

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

#4 lore raw

Hi all,

It's my first patch contribution, do I need to do anything more ?

Best regards,
Vincent

2017-10-26 13:52 GMT+02:00 Stefan Agner <[email protected]>:

Quoted 63 lines · Lukasz Majewski
Quoted 35 lines

Hi Vincent,

Quoted 33 lines

This prevents board resets when calling sdp command on boards which have a watchdog.

---
 drivers/usb/gadget/f_sdp.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/gadget/f_sdp.c +3 -0
index 0fae66b..c3eba6d 100644
@@ -32,6 +32,7 @@
 #include <spl.h>
 #include <image.h>
 #include <imximage.h>
+#include <watchdog.h>
 
 #define HID_REPORT_ID_MASK  0x000000ff
 
@@ -602,6 +603,8 @@ int sdp_init(int controller_index)
                     puts("\rCTRL+C - Operation aborted.\n");
                     return 1;
             }
+
+            WATCHDOG_RESET();
             usb_gadget_handle_interrupts(controller_index);
     }
 
@@ -712,6 +715,7 @@ void sdp_handle(int controller_index)
                     return;
             }
 
Quoted 5 lines

drivers/usb/gadget/f_sdp.c void sdp_handle(int controller_index) · line 721

Quoted 4 lines
drivers/usb/gadget/f_sdp.c +1 -0
+            WATCHDOG_RESET();
             usb_gadget_handle_interrupts(controller_index);
 
             sdp_handle_in_ep();

Thanks for the patch! Looks good to me too.

Best regards,
Stefan

Quoted 11 lines

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

#5 lore raw

Hi Vincent,

Quoted 3 lines · Vincent Prince

Hi all,

It's my first patch contribution, do I need to do anything more ?

Your patch looks good.

Maybe Stefano can apply it for 2017.11.

Thanks