From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02olkn0824.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe44::824]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B626521A08D8C for ; Thu, 1 Jun 2017 10:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AJWe7as3A7k0NFhC+4nmBRBvKE8LSUAkKHU0RSXj3w8=; b=ByJyKch4aB0HdEBpoCcxkJZYkxkPPoFdA5n+d9em+oY5Y194UfJ5GBEILG/MU/9Boumm3/PMpbbbuDiwCAd3E5PETHhSr/terN9wN8Gpzn//bVCJqyej5NhZc1V8hbZYM19Ln+yQK2r1hV95cUmfTXxQpIrnHI3bPVizhKdkHQ/tiwqf9uW7A/5zWCQD5SU3+IztLB1nG3roOc3f4mRUcQC8D5JjxT6pVX1H0LB6enw8R1axEf4eL4iTazXuj7uKib8dzjRFagQIaw4L5Jr7jxRd+G1po5da1NyqDIVYdmLCcoPFiDG1yI5Qz9oofQwH3WJR+MExRXXbL3FelDGzHg== Received: from SN1NAM02FT018.eop-nam02.prod.protection.outlook.com (10.152.72.52) by SN1NAM02HT078.eop-nam02.prod.protection.outlook.com (10.152.72.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1101.12; Thu, 1 Jun 2017 17:13:17 +0000 Received: from MWHPR11MB1822.namprd11.prod.outlook.com (10.152.72.58) by SN1NAM02FT018.mail.protection.outlook.com (10.152.72.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.12 via Frontend Transport; Thu, 1 Jun 2017 17:13:17 +0000 Received: from MWHPR11MB1822.namprd11.prod.outlook.com ([10.175.53.137]) by MWHPR11MB1822.namprd11.prod.outlook.com ([10.175.53.137]) with mapi id 15.01.1143.013; Thu, 1 Jun 2017 17:13:17 +0000 From: Amit kumar To: Andrew Fish CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] Problem in EFI_BOOT_SERVICES.OpenProtocol() Thread-Index: AQHS2vhER+WFD5ZNMEuhera/wmQiXKIQPGzm Date: Thu, 1 Jun 2017 17:13:16 +0000 Message-ID: References: , <6B16DFE0-54D1-4CBF-AC56-F255013B6FA5@apple.com> In-Reply-To: <6B16DFE0-54D1-4CBF-AC56-F255013B6FA5@apple.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: apple.com; dkim=none (message not signed) header.d=none;apple.com; dmarc=none action=none header.from=hotmail.com; x-incomingtopheadermarker: OriginalChecksum:074669EA09407DD1915AC7ACC43A75943B56E9A8182C9AB9FAD02149CE2F70A5; UpperCasedChecksum:0FFBF53F8609239E162C0045448C4C53F5857CBE1482321BC93556542CA2E588; SizeAsReceived:7352; Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [q6f3ti4JmurTgMxC06CLTuE3rtRWP9N5/mK93QP0MA3nEUrVvXzEtg==] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN1NAM02HT078; 24:t2sHq/x2tgrlBIDhK5SrPqabnbk3tK9Hx+33DBu/HbfATTMlHdNihnhgF3xZEbQ8k08006SAjtz0APc/DqBoV3K4N3TRXbBa+3nYe1ZoqnQ=; 7:0jzlH0JDTVKREWFmMj51IX4z44gpFZ1/xFz2YYgRqxDGByOUu4fYGnOr00PysxVUyYa4g2H2zSRZNqkewE+lRNvRYWPi3oGEEQbiDGxjWGvm/3hu6dS3eYsa56uie01d2cuFqufu4VDH4pbypKHB/jZHlZTX963o9zKrrzwW4nvsxIz6CJAZCLqetthZMhWhCEH25xHXJegk637CvbyFrYOsEAzOHPLYyTKgIYAfC1TaHhznnqGke1W4aq/1fjgn/hdQYpspQ0UW23zzHPjn1sFywU2PrkOBbzuiaMSfBZSdvl/TqL/aYHa+g45oDf6N x-incomingheadercount: 46 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:SN1NAM02HT078; H:MWHPR11MB1822.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; x-ms-traffictypediagnostic: SN1NAM02HT078: x-ms-office365-filtering-correlation-id: 8ce84255-8c54-4dd4-3c04-08d4a9117eaa x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322274)(1603101448)(1601125374)(1701031045); SRVR:SN1NAM02HT078; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(444000031); SRVR:SN1NAM02HT078; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1NAM02HT078; x-forefront-prvs: 0325F6C77B spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jun 2017 17:13:16.8534 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM02HT078 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: Problem in EFI_BOOT_SERVICES.OpenProtocol() 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: , X-List-Received-Date: Thu, 01 Jun 2017 17:12:17 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Andrew, As per UEFI Spec EFI_ALREADY_STARTED is treated as error code, thus PciIo (= The Interface 3rd parameter ) should remain NULL. But after OpenProtocol call even though Status =3D EFI_ALREADY_STARTED P= ciIo (The Interface 3rd parameter ) is getting modified and it not NULL any= more. Is this not a problem ? Status =3D gBS->OpenProtocol ( Controller, &gEfiPciIoProtocolGuid, (VOID **) &PciIo, This->DriverBindingHandle, Controller, EFI_OPEN_PROTOCOL_BY_DRIVER ); ________________________________ From: afish@apple.com on behalf of Andrew Fish Sent: Thursday, June 1, 2017 10:28:16 PM To: Amit kumar Cc: edk2-devel@lists.01.org Subject: Re: [edk2] Problem in EFI_BOOT_SERVICES.OpenProtocol() > On Jun 1, 2017, at 9:46 AM, Amit kumar wrote: > > Hi, > I am trying to open PciIoProtocol and facing some issue. > > below is the code > > EFI_PCI_IO_PROTOCOL *PciIo=3DNULL; > EFI_STATUS Status; > > Status =3D gBS->OpenProtocol ( > Controller, > &gEfiPciIoProtocolGuid, > (VOID **) &PciIo, > This->DriverBindingHandle, > Controller, > EFI_OPEN_PROTOCOL_BY_DRIVER > ); > > it returns Status =3D EFI_ALREADY_STARTED, but PciIo is not NULL. > Is it not supposed to return PciIo as NULL ? > As per UEFI 2.6 Spec Section 6.3 page 182. > Amit, Look at the Status Codes Returned section at the end of that section. Attributes is BY_DRIVER and there is an item on the open list with an attri= bute of BY_DRIVER whose agent handle is the same as AgentHandle. Attributes is BY_DRIVER|EXCLUSIVE and there is an item on the open list wit= h an attribute of BY_DRIVER|EXCLUSIVE whose agent handle is the same as Age= ntHandle. Thanks, Andrew Fish > 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 o= f agents > consuming the protocol interface specified by Handle and Protocol, and In= terface is > returned unmodified. > > Thanks And Regards > Amit > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel