public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zeng, Star" <star.zeng@intel.com>
To: Laszlo Ersek <lersek@redhat.com>,
	Amit Kumar <amit.ak@samsung.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Tian, Feng" <feng.tian@intel.com>,
	"Gabriel L. Somlo (GMail)" <gsomlo@gmail.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"Fan, Jeff" <jeff.fan@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH V4] MdeModulePkg/DxeCore: Fixed Interface returned by CoreOpenProtocol
Date: Wed, 28 Jun 2017 13:00:13 +0000	[thread overview]
Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B8EF7F2@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <04a41a83-905e-ba8d-d476-183b7a70e572@redhat.com>

Just added note in https://mantis.uefi.org/mantis/view.php?id=1815, and I will post the patch soon.

Thanks,
Star
-----Original Message-----
From: Laszlo Ersek [mailto:lersek@redhat.com] 
Sent: Wednesday, June 28, 2017 8:39 PM
To: Zeng, Star <star.zeng@intel.com>; Amit Kumar <amit.ak@samsung.com>; edk2-devel@lists.01.org
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Tian, Feng <feng.tian@intel.com>; Gabriel L. Somlo (GMail) <gsomlo@gmail.com>; Gao, Liming <liming.gao@intel.com>; Fan, Jeff <jeff.fan@intel.com>
Subject: Re: [edk2] [PATCH V4] MdeModulePkg/DxeCore: Fixed Interface returned by CoreOpenProtocol

On 06/28/17 11:34, Zeng, Star wrote:
> Laszlo,
> 
> Summary the return status codes for OpenProtocol() as below.
> EFI_SUCCESS
>   Return the protocol interface in *Interface if Attributes is not EFI_OPEN_PROTOCOL_TEST_PROTOCOL.
> EFI_INVALID_PARAMETER
>   Do not update *Interface because one of the parameters has a value that does not allow this API to function correctly.
> EFI_UNSUPPORTED
>   Return NULL in *Interface because UserHandle does not support Protocol if Attributes is not EFI_OPEN_PROTOCOL_TEST_PROTOCOL.
> EFI_ACCESS_DENIED
>   Do not update *Interface because the protocol is already being used exclusively be someone else.  Returning the *Interface just makes it easy for the caller to use an interface they are not allowed to use.
> EFI_ALREADY_STARTED
>   Return the protocol interface in *Interface.  This allows bus drivers to use the interface they are already managing.
> 
> How about we clarify UEFI spec to only return the corresponding protocol interface in *Interface if the return status is EFI_SUCCESS or EFI_ALREADY_STARTED.
> Then it preserves the exiting behavior for EFI_ALREADY_STARTED, but also updates OpenProtocol() to not modify Interface output parameter for all other error conditions except EFI_UNSUPPORTED (NULL will be returned in *Interface if Attributes is not EFI_OPEN_PROTOCOL_TEST_PROTOCOL).
> 
> UEFI Spec (Current language)
> ==========================
> There are a number of reasons that this function call can return an error. If an error is returned, then AgentHandle, ControllerHandle, and Attributes are not added to the list of agents consuming the protocol interface specified by Handle and Protocol, and Interface is returned unmodified. The following is the list of conditions that must be checked before this function can return EFI_SUCCESS.
> 
> UEFI Spec (Proposed new language)
> ==========================
> There are a number of reasons that this function call can return an error. If an error is returned, then AgentHandle, ControllerHandle, and Attributes are not added to the list of agents consuming the protocol interface specified by Handle and Protocol. Interface is returned unmodified for all error conditions except EFI_UNSUPPORTED and EFI_ALREADY_STARTED, NULL will be returned in *Interface when EFI_UNSUPPORTED and Attributes is not EFI_OPEN_PROTOCOL_TEST_PROTOCOL, the protocol interface will be returned in *Interface when EFI_ALREADY_STARTED. The following is the list of conditions that must be checked before this function can return EFI_SUCCESS.

This looks great to me!

(EFI_ALREADY_STARTED is only possible for BY_DRIVER and BY_DRIVER|EXCLUSIVE, so TEST_PROTOCOL need not be considered for EFI_ALREADY_STARTED. Good!)

Can you please add this language to
<https://mantis.uefi.org/mantis/view.php?id=1815>, in a new note?

> Of course, the code still needs to be updated and the revised patch based on this V4 patch is attached.

Please post the patch to the list and let the respective owners / maintainers review it :) If it matches the above specification, then it should be good.

Thanks!
Laszlo

      reply	other threads:[~2017-06-28 12:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170623100913epcas5p3a10353593d6348b5bf3c890e2deaadb7@epcas5p3.samsung.com>
2017-06-23 10:09 ` [PATCH V4] MdeModulePkg/DxeCore: Fixed Interface returned by CoreOpenProtocol Amit Kumar
2017-06-26  1:19   ` Zeng, Star
2017-06-26  2:46     ` Zeng, Star
2017-06-27  0:47   ` Laszlo Ersek
2017-06-27  0:52     ` Zeng, Star
2017-06-27  1:37       ` Zeng, Star
2017-06-27  9:44         ` Laszlo Ersek
2017-06-27  9:59           ` Zeng, Star
2017-06-27 11:15             ` Laszlo Ersek
2017-06-27 13:23               ` Laszlo Ersek
2017-06-27 13:31                 ` Zeng, Star
2017-06-28  9:34                   ` Zeng, Star
2017-06-28 12:39                     ` Laszlo Ersek
2017-06-28 13:00                       ` Zeng, Star [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C09AFA07DD0434D9E2A0C6AEB0483103B8EF7F2@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox