public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Daniil Egranov <daniil.egranov@arm.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [PATCH 3/4] Drivers/SataSiI3132Dxe: Enable multi-controller support
Date: Fri, 27 Oct 2017 13:42:59 +0100	[thread overview]
Message-ID: <CAKv+Gu9EyjAi0NC0K3RC9BXsk60FNMKQDq5dbYmjZs8yX5m+=w@mail.gmail.com> (raw)
In-Reply-To: <20171027053326.48815-4-daniil.egranov@arm.com>

On 27 October 2017 at 06:33, Daniil Egranov <daniil.egranov@arm.com> wrote:
> Saved controller specific data into the driver's information structure.
> Removed global variable indicating the driver's status and added
> check for the driver's status based on the available protocol.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Daniil Egranov <daniil.egranov@arm.com>
> ---
>  EmbeddedPkg/Drivers/SataSiI3132Dxe/SataSiI3132.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/EmbeddedPkg/Drivers/SataSiI3132Dxe/SataSiI3132.c b/EmbeddedPkg/Drivers/SataSiI3132Dxe/SataSiI3132.c
> index c1760fdc1b..50253b9160 100644
> --- a/EmbeddedPkg/Drivers/SataSiI3132Dxe/SataSiI3132.c
> +++ b/EmbeddedPkg/Drivers/SataSiI3132Dxe/SataSiI3132.c
> @@ -309,8 +309,6 @@ ON_EXIT:
>    return Status;
>  }
>
> -BOOLEAN mbStarted = FALSE;
> -
>  /**
>    Starting the Pci SATA Driver.
>
> @@ -342,9 +340,18 @@ SataSiI3132DriverBindingStart (
>
>    SATA_TRACE ("SataSiI3132DriverBindingStart()");
>
> -  //TODO: Find a nicer way to do it !
> -  if (mbStarted) {
> -    return EFI_SUCCESS; // Don't restart me !
> +  Status = gBS->OpenProtocol (
> +        Controller,
> +        &gEfiAtaPassThruProtocolGuid,
> +        NULL,
> +        This->DriverBindingHandle,
> +        Controller,
> +        EFI_OPEN_PROTOCOL_TEST_PROTOCOL
> +        );
> +
> +  if (!EFI_ERROR (Status)) {
> +    SATA_TRACE ("SataSiI3132DriverBindingStart: driver already started");
> +    return Status;

Can you explain what this does? Does it check whether the protocol we
will install is already installed? Is this how other PCI drivers deal
with this?

>    }
>
>    //
> @@ -426,6 +433,8 @@ SataSiI3132DriverBindingStart (
>      return Status;
>    }
>
> +  SataSiI3132Instance->OriginalPciAttributes = OriginalPciAttributes;
> +

Does this belong in the same patch?

>    // Initialize SiI3132 Sata Controller
>    Status = SataSiI3132Initialization (SataSiI3132Instance);
>    if (EFI_ERROR (Status)) {
> @@ -458,8 +467,6 @@ SataSiI3132DriverBindingStart (
>        goto UNINSTALL_USBHC;
>    }*/
>
> -  mbStarted = TRUE;
> -
>    SATA_TRACE ("SataSiI3132DriverBindingStart() Success!");
>    return EFI_SUCCESS;
>
> --
> 2.11.0
>


  reply	other threads:[~2017-10-27 12:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27  5:33 [PATCH 0/4] SataSiI3132Dxe fixes Daniil Egranov
2017-10-27  5:33 ` [PATCH 1/4] Drivers/SataSiI3132Dxe: Fixed PCI IO read and write operations Daniil Egranov
2017-10-27  9:22   ` Ard Biesheuvel
2017-10-27  5:33 ` [PATCH 2/4] Drivers/SataSiI3132Dxe: Allow 64-bit DMA transfer Daniil Egranov
2017-10-27  9:23   ` Ard Biesheuvel
2017-10-27  5:33 ` [PATCH 3/4] Drivers/SataSiI3132Dxe: Enable multi-controller support Daniil Egranov
2017-10-27 12:42   ` Ard Biesheuvel [this message]
2017-10-27  5:33 ` [PATCH 4/4] Drivers/SataSiI3132Dxe: Fixed startup and shutdown procedures Daniil Egranov
2017-10-27 12:47   ` Ard Biesheuvel
2017-10-27 12:48 ` [PATCH 0/4] SataSiI3132Dxe fixes Ard Biesheuvel
2017-10-27 16:57 ` Jeremy Linton
2017-10-27 17:00   ` Ard Biesheuvel

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='CAKv+Gu9EyjAi0NC0K3RC9BXsk60FNMKQDq5dbYmjZs8yX5m+=w@mail.gmail.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