From nobody Wed Dec 25 14:33:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1509082433466682.651664716871; Thu, 26 Oct 2017 22:33:53 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 48F162034A892; Thu, 26 Oct 2017 22:30:02 -0700 (PDT) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 90B1F2034A88A for ; Thu, 26 Oct 2017 22:29:59 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 786071650; Thu, 26 Oct 2017 22:33:46 -0700 (PDT) Received: from usa.arm.com (dbox2.austin.arm.com [10.118.34.10]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 264EF3F24A; Thu, 26 Oct 2017 22:33:46 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=daniil.egranov@arm.com; receiver=edk2-devel@lists.01.org From: Daniil Egranov To: edk2-devel@lists.01.org Date: Fri, 27 Oct 2017 00:33:25 -0500 Message-Id: <20171027053326.48815-4-daniil.egranov@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171027053326.48815-1-daniil.egranov@arm.com> References: <20171027053326.48815-1-daniil.egranov@arm.com> Subject: [edk2] [PATCH 3/4] Drivers/SataSiI3132Dxe: Enable multi-controller support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 --- 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; } =20 -BOOLEAN mbStarted =3D FALSE; - /** Starting the Pci SATA Driver. =20 @@ -342,9 +340,18 @@ SataSiI3132DriverBindingStart ( =20 SATA_TRACE ("SataSiI3132DriverBindingStart()"); =20 - //TODO: Find a nicer way to do it ! - if (mbStarted) { - return EFI_SUCCESS; // Don't restart me ! + Status =3D 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; } =20 // @@ -426,6 +433,8 @@ SataSiI3132DriverBindingStart ( return Status; } =20 + SataSiI3132Instance->OriginalPciAttributes =3D OriginalPciAttributes; + // Initialize SiI3132 Sata Controller Status =3D SataSiI3132Initialization (SataSiI3132Instance); if (EFI_ERROR (Status)) { @@ -458,8 +467,6 @@ SataSiI3132DriverBindingStart ( goto UNINSTALL_USBHC; }*/ =20 - mbStarted =3D TRUE; - SATA_TRACE ("SataSiI3132DriverBindingStart() Success!"); return EFI_SUCCESS; =20 --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel