public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address.
@ 2018-03-01  9:38 Jiaxin Wu
  2018-03-01  9:38 ` [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function Jiaxin Wu
  2018-03-01 10:57 ` [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address Fu, Siyuan
  0 siblings, 2 replies; 7+ messages in thread
From: Jiaxin Wu @ 2018-03-01  9:38 UTC (permalink / raw)
  To: edk2-devel; +Cc: Wang Fan, Fu Siyuan, Ye Ting

The issue was enrolled by the commit of ceec3638. One of the change in the commit
was to return the status from NetMapIterate in Udp6Groups function. But it should
not return EFI_ABORTED directly in case McastIp is not NULL, which means to terminate
the iteration and leave the McastIp successfully.

Cc: Wang Fan <fan.wang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
 NetworkPkg/Udp6Dxe/Udp6Main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/NetworkPkg/Udp6Dxe/Udp6Main.c b/NetworkPkg/Udp6Dxe/Udp6Main.c
index 1d7f0acbc7..e9d94dd00c 100644
--- a/NetworkPkg/Udp6Dxe/Udp6Main.c
+++ b/NetworkPkg/Udp6Dxe/Udp6Main.c
@@ -380,10 +380,13 @@ Udp6Groups (
 
     Status = NetMapInsertTail (&Instance->McastIps, (VOID *) McastIp, NULL);
   } else {
 
     Status = NetMapIterate (&Instance->McastIps, Udp6LeaveGroup, MulticastAddress);
+    if ((MulticastAddress != NULL) && (Status == EFI_ABORTED)) {
+      Status = EFI_SUCCESS;
+    } 
   }
 
 ON_EXIT:
 
   gBS->RestoreTPL (OldTpl);
-- 
2.16.2.windows.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function.
  2018-03-01  9:38 [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address Jiaxin Wu
@ 2018-03-01  9:38 ` Jiaxin Wu
  2018-03-01 11:02   ` Fu, Siyuan
  2018-03-01 10:57 ` [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address Fu, Siyuan
  1 sibling, 1 reply; 7+ messages in thread
From: Jiaxin Wu @ 2018-03-01  9:38 UTC (permalink / raw)
  To: edk2-devel; +Cc: Wang Fan, Fu Siyuan, Ye Ting

This patch is to fix the hang issue, which was enrolled by the commit of 39b0867d.
The TPL should be restored before calling poll function at TPL_CALLBACK.

Cc: Wang Fan <fan.wang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
index f5f9e6d8f7..64e0463dd9 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
@@ -507,24 +507,27 @@ Mtftp4Start (
   if (EFI_ERROR (Status)) {
     Status = EFI_DEVICE_ERROR;
     goto ON_ERROR;
   }
 
+  //
+  // Restore the TPL now, don't call poll function at TPL_CALLBACK.
+  //
+  gBS->RestoreTPL (OldTpl);
+
   if (Token->Event != NULL) {
-    gBS->RestoreTPL (OldTpl);
     return EFI_SUCCESS;
   }
 
   //
   // Return immediately for asynchronous operation or poll the
   // instance for synchronous operation.
   //
   while (Token->Status == EFI_NOT_READY) {
     This->Poll (This);
   }
-
-  gBS->RestoreTPL (OldTpl);
+  
   return Token->Status;
 
 ON_ERROR:
   Mtftp4CleanOperation (Instance, Status);
   gBS->RestoreTPL (OldTpl);
-- 
2.16.2.windows.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address.
  2018-03-01  9:38 [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address Jiaxin Wu
  2018-03-01  9:38 ` [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function Jiaxin Wu
@ 2018-03-01 10:57 ` Fu, Siyuan
  1 sibling, 0 replies; 7+ messages in thread
From: Fu, Siyuan @ 2018-03-01 10:57 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Wang, Fan, Ye, Ting



Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>



> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Thursday, March 1, 2018 5:38 PM
> To: edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.wang@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Ye,
> Ting <ting.ye@intel.com>
> Subject: [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one
> multicast group address.
> 
> The issue was enrolled by the commit of ceec3638. One of the change in the
> commit
> was to return the status from NetMapIterate in Udp6Groups function. But it
> should
> not return EFI_ABORTED directly in case McastIp is not NULL, which means
> to terminate
> the iteration and leave the McastIp successfully.
> 
> Cc: Wang Fan <fan.wang@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
>  NetworkPkg/Udp6Dxe/Udp6Main.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/NetworkPkg/Udp6Dxe/Udp6Main.c b/NetworkPkg/Udp6Dxe/Udp6Main.c
> index 1d7f0acbc7..e9d94dd00c 100644
> --- a/NetworkPkg/Udp6Dxe/Udp6Main.c
> +++ b/NetworkPkg/Udp6Dxe/Udp6Main.c
> @@ -380,10 +380,13 @@ Udp6Groups (
> 
>      Status = NetMapInsertTail (&Instance->McastIps, (VOID *) McastIp,
> NULL);
>    } else {
> 
>      Status = NetMapIterate (&Instance->McastIps, Udp6LeaveGroup,
> MulticastAddress);
> +    if ((MulticastAddress != NULL) && (Status == EFI_ABORTED)) {
> +      Status = EFI_SUCCESS;
> +    }
>    }
> 
>  ON_EXIT:
> 
>    gBS->RestoreTPL (OldTpl);
> --
> 2.16.2.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function.
  2018-03-01  9:38 ` [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function Jiaxin Wu
@ 2018-03-01 11:02   ` Fu, Siyuan
  2018-03-02  1:17     ` Wu, Jiaxin
  0 siblings, 1 reply; 7+ messages in thread
From: Fu, Siyuan @ 2018-03-01 11:02 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Wang, Fan, Ye, Ting

Hi, Jiaxin

Do you mean the code which calls MTFTP4->Poll() at TPL_CALLBACK will cause system hang? This should not happen because all network protocol should be able to run at TPL_CALLBACK.

BestRegards
Fu Siyuan


> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Thursday, March 1, 2018 5:38 PM
> To: edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.wang@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Ye,
> Ting <ting.ye@intel.com>
> Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll
> function.
> 
> This patch is to fix the hang issue, which was enrolled by the commit of
> 39b0867d.
> The TPL should be restored before calling poll function at TPL_CALLBACK.
> 
> Cc: Wang Fan <fan.wang@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> index f5f9e6d8f7..64e0463dd9 100644
> --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> @@ -507,24 +507,27 @@ Mtftp4Start (
>    if (EFI_ERROR (Status)) {
>      Status = EFI_DEVICE_ERROR;
>      goto ON_ERROR;
>    }
> 
> +  //
> +  // Restore the TPL now, don't call poll function at TPL_CALLBACK.
> +  //
> +  gBS->RestoreTPL (OldTpl);
> +
>    if (Token->Event != NULL) {
> -    gBS->RestoreTPL (OldTpl);
>      return EFI_SUCCESS;
>    }
> 
>    //
>    // Return immediately for asynchronous operation or poll the
>    // instance for synchronous operation.
>    //
>    while (Token->Status == EFI_NOT_READY) {
>      This->Poll (This);
>    }
> -
> -  gBS->RestoreTPL (OldTpl);
> +
>    return Token->Status;
> 
>  ON_ERROR:
>    Mtftp4CleanOperation (Instance, Status);
>    gBS->RestoreTPL (OldTpl);
> --
> 2.16.2.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function.
  2018-03-01 11:02   ` Fu, Siyuan
@ 2018-03-02  1:17     ` Wu, Jiaxin
  2018-03-02  1:23       ` Fu, Siyuan
  0 siblings, 1 reply; 7+ messages in thread
From: Wu, Jiaxin @ 2018-03-02  1:17 UTC (permalink / raw)
  To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Wang, Fan, Ye, Ting

It's not actual hang but always running at while-poll function in the TPL call back level , meanwhile, the while condition depends on another time event that running on the same TPL. If so, the time event might have no chance to be triggered. So, the code will never run out of while () {}:

  while (Token->Status == EFI_NOT_READY) {
    This->Poll (This);
  }


Thanks,
Jiaxin

> -----Original Message-----
> From: Fu, Siyuan
> Sent: Thursday, March 1, 2018 7:03 PM
> To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.wang@intel.com>; Ye, Ting <ting.ye@intel.com>
> Subject: RE: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the
> poll function.
> 
> Hi, Jiaxin
> 
> Do you mean the code which calls MTFTP4->Poll() at TPL_CALLBACK will
> cause system hang? This should not happen because all network protocol
> should be able to run at TPL_CALLBACK.
> 
> BestRegards
> Fu Siyuan
> 
> 
> > -----Original Message-----
> > From: Wu, Jiaxin
> > Sent: Thursday, March 1, 2018 5:38 PM
> > To: edk2-devel@lists.01.org
> > Cc: Wang, Fan <fan.wang@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>;
> Ye,
> > Ting <ting.ye@intel.com>
> > Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the
> poll
> > function.
> >
> > This patch is to fix the hang issue, which was enrolled by the commit of
> > 39b0867d.
> > The TPL should be restored before calling poll function at TPL_CALLBACK.
> >
> > Cc: Wang Fan <fan.wang@intel.com>
> > Cc: Fu Siyuan <siyuan.fu@intel.com>
> > Cc: Ye Ting <ting.ye@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> > ---
> >  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 9
> ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > index f5f9e6d8f7..64e0463dd9 100644
> > --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > @@ -507,24 +507,27 @@ Mtftp4Start (
> >    if (EFI_ERROR (Status)) {
> >      Status = EFI_DEVICE_ERROR;
> >      goto ON_ERROR;
> >    }
> >
> > +  //
> > +  // Restore the TPL now, don't call poll function at TPL_CALLBACK.
> > +  //
> > +  gBS->RestoreTPL (OldTpl);
> > +
> >    if (Token->Event != NULL) {
> > -    gBS->RestoreTPL (OldTpl);
> >      return EFI_SUCCESS;
> >    }
> >
> >    //
> >    // Return immediately for asynchronous operation or poll the
> >    // instance for synchronous operation.
> >    //
> >    while (Token->Status == EFI_NOT_READY) {
> >      This->Poll (This);
> >    }
> > -
> > -  gBS->RestoreTPL (OldTpl);
> > +
> >    return Token->Status;
> >
> >  ON_ERROR:
> >    Mtftp4CleanOperation (Instance, Status);
> >    gBS->RestoreTPL (OldTpl);
> > --
> > 2.16.2.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function.
  2018-03-02  1:17     ` Wu, Jiaxin
@ 2018-03-02  1:23       ` Fu, Siyuan
  2018-03-02  1:40         ` Wu, Jiaxin
  0 siblings, 1 reply; 7+ messages in thread
From: Fu, Siyuan @ 2018-03-02  1:23 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Wang, Fan, Ye, Ting

Jiaxin, 

There will be problem if someone calls Mtftp.Start() at TPL Callback to send/receive a file with your patch. In such case the RestoreTpl() won't be able to restore the TPL to application level so it will still while loop in the Poll.

BestRegards
Fu Siyuan

> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Friday, March 2, 2018 9:18 AM
> To: Fu, Siyuan <siyuan.fu@intel.com>; edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.wang@intel.com>; Ye, Ting <ting.ye@intel.com>
> Subject: RE: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the
> poll function.
> 
> It's not actual hang but always running at while-poll function in the TPL
> call back level , meanwhile, the while condition depends on another time
> event that running on the same TPL. If so, the time event might have no
> chance to be triggered. So, the code will never run out of while () {}:
> 
>   while (Token->Status == EFI_NOT_READY) {
>     This->Poll (This);
>   }
> 
> 
> Thanks,
> Jiaxin
> 
> > -----Original Message-----
> > From: Fu, Siyuan
> > Sent: Thursday, March 1, 2018 7:03 PM
> > To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org
> > Cc: Wang, Fan <fan.wang@intel.com>; Ye, Ting <ting.ye@intel.com>
> > Subject: RE: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the
> > poll function.
> >
> > Hi, Jiaxin
> >
> > Do you mean the code which calls MTFTP4->Poll() at TPL_CALLBACK will
> > cause system hang? This should not happen because all network protocol
> > should be able to run at TPL_CALLBACK.
> >
> > BestRegards
> > Fu Siyuan
> >
> >
> > > -----Original Message-----
> > > From: Wu, Jiaxin
> > > Sent: Thursday, March 1, 2018 5:38 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Wang, Fan <fan.wang@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>;
> > Ye,
> > > Ting <ting.ye@intel.com>
> > > Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the
> > poll
> > > function.
> > >
> > > This patch is to fix the hang issue, which was enrolled by the commit
> of
> > > 39b0867d.
> > > The TPL should be restored before calling poll function at
> TPL_CALLBACK.
> > >
> > > Cc: Wang Fan <fan.wang@intel.com>
> > > Cc: Fu Siyuan <siyuan.fu@intel.com>
> > > Cc: Ye Ting <ting.ye@intel.com>
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> > > ---
> > >  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 9
> > ++++++---
> > >  1 file changed, 6 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > index f5f9e6d8f7..64e0463dd9 100644
> > > --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > @@ -507,24 +507,27 @@ Mtftp4Start (
> > >    if (EFI_ERROR (Status)) {
> > >      Status = EFI_DEVICE_ERROR;
> > >      goto ON_ERROR;
> > >    }
> > >
> > > +  //
> > > +  // Restore the TPL now, don't call poll function at TPL_CALLBACK.
> > > +  //
> > > +  gBS->RestoreTPL (OldTpl);
> > > +
> > >    if (Token->Event != NULL) {
> > > -    gBS->RestoreTPL (OldTpl);
> > >      return EFI_SUCCESS;
> > >    }
> > >
> > >    //
> > >    // Return immediately for asynchronous operation or poll the
> > >    // instance for synchronous operation.
> > >    //
> > >    while (Token->Status == EFI_NOT_READY) {
> > >      This->Poll (This);
> > >    }
> > > -
> > > -  gBS->RestoreTPL (OldTpl);
> > > +
> > >    return Token->Status;
> > >
> > >  ON_ERROR:
> > >    Mtftp4CleanOperation (Instance, Status);
> > >    gBS->RestoreTPL (OldTpl);
> > > --
> > > 2.16.2.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function.
  2018-03-02  1:23       ` Fu, Siyuan
@ 2018-03-02  1:40         ` Wu, Jiaxin
  0 siblings, 0 replies; 7+ messages in thread
From: Wu, Jiaxin @ 2018-03-02  1:40 UTC (permalink / raw)
  To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Wang, Fan, Ye, Ting

Yes, I agree with you. But we still can't raise time event to TPL_NOTIFY, because in the notify callback function, Udp protocol will be called to retransmit the packet while it's not allowed to call UDP in the TPL_NOTIFY.



> -----Original Message-----
> From: Fu, Siyuan
> Sent: Friday, March 2, 2018 9:24 AM
> To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.wang@intel.com>; Ye, Ting <ting.ye@intel.com>
> Subject: RE: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the
> poll function.
> 
> Jiaxin,
> 
> There will be problem if someone calls Mtftp.Start() at TPL Callback to
> send/receive a file with your patch. In such case the RestoreTpl() won't be
> able to restore the TPL to application level so it will still while loop in the Poll.
> 
> BestRegards
> Fu Siyuan
> 
> > -----Original Message-----
> > From: Wu, Jiaxin
> > Sent: Friday, March 2, 2018 9:18 AM
> > To: Fu, Siyuan <siyuan.fu@intel.com>; edk2-devel@lists.01.org
> > Cc: Wang, Fan <fan.wang@intel.com>; Ye, Ting <ting.ye@intel.com>
> > Subject: RE: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before
> the
> > poll function.
> >
> > It's not actual hang but always running at while-poll function in the TPL
> > call back level , meanwhile, the while condition depends on another time
> > event that running on the same TPL. If so, the time event might have no
> > chance to be triggered. So, the code will never run out of while () {}:
> >
> >   while (Token->Status == EFI_NOT_READY) {
> >     This->Poll (This);
> >   }
> >
> >
> > Thanks,
> > Jiaxin
> >
> > > -----Original Message-----
> > > From: Fu, Siyuan
> > > Sent: Thursday, March 1, 2018 7:03 PM
> > > To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org
> > > Cc: Wang, Fan <fan.wang@intel.com>; Ye, Ting <ting.ye@intel.com>
> > > Subject: RE: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before
> the
> > > poll function.
> > >
> > > Hi, Jiaxin
> > >
> > > Do you mean the code which calls MTFTP4->Poll() at TPL_CALLBACK will
> > > cause system hang? This should not happen because all network protocol
> > > should be able to run at TPL_CALLBACK.
> > >
> > > BestRegards
> > > Fu Siyuan
> > >
> > >
> > > > -----Original Message-----
> > > > From: Wu, Jiaxin
> > > > Sent: Thursday, March 1, 2018 5:38 PM
> > > > To: edk2-devel@lists.01.org
> > > > Cc: Wang, Fan <fan.wang@intel.com>; Fu, Siyuan
> <siyuan.fu@intel.com>;
> > > Ye,
> > > > Ting <ting.ye@intel.com>
> > > > Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before
> the
> > > poll
> > > > function.
> > > >
> > > > This patch is to fix the hang issue, which was enrolled by the commit
> > of
> > > > 39b0867d.
> > > > The TPL should be restored before calling poll function at
> > TPL_CALLBACK.
> > > >
> > > > Cc: Wang Fan <fan.wang@intel.com>
> > > > Cc: Fu Siyuan <siyuan.fu@intel.com>
> > > > Cc: Ye Ting <ting.ye@intel.com>
> > > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > > Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> > > > ---
> > > >  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 9
> > > ++++++---
> > > >  1 file changed, 6 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git
> a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > > b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > > index f5f9e6d8f7..64e0463dd9 100644
> > > > --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > > +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > > @@ -507,24 +507,27 @@ Mtftp4Start (
> > > >    if (EFI_ERROR (Status)) {
> > > >      Status = EFI_DEVICE_ERROR;
> > > >      goto ON_ERROR;
> > > >    }
> > > >
> > > > +  //
> > > > +  // Restore the TPL now, don't call poll function at TPL_CALLBACK.
> > > > +  //
> > > > +  gBS->RestoreTPL (OldTpl);
> > > > +
> > > >    if (Token->Event != NULL) {
> > > > -    gBS->RestoreTPL (OldTpl);
> > > >      return EFI_SUCCESS;
> > > >    }
> > > >
> > > >    //
> > > >    // Return immediately for asynchronous operation or poll the
> > > >    // instance for synchronous operation.
> > > >    //
> > > >    while (Token->Status == EFI_NOT_READY) {
> > > >      This->Poll (This);
> > > >    }
> > > > -
> > > > -  gBS->RestoreTPL (OldTpl);
> > > > +
> > > >    return Token->Status;
> > > >
> > > >  ON_ERROR:
> > > >    Mtftp4CleanOperation (Instance, Status);
> > > >    gBS->RestoreTPL (OldTpl);
> > > > --
> > > > 2.16.2.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-02  1:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-01  9:38 [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address Jiaxin Wu
2018-03-01  9:38 ` [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function Jiaxin Wu
2018-03-01 11:02   ` Fu, Siyuan
2018-03-02  1:17     ` Wu, Jiaxin
2018-03-02  1:23       ` Fu, Siyuan
2018-03-02  1:40         ` Wu, Jiaxin
2018-03-01 10:57 ` [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address Fu, Siyuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox