From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3509982066 for ; Fri, 16 Dec 2016 01:22:12 -0800 (PST) Received: by mail-wm0-x22a.google.com with SMTP id t79so24915266wmt.0 for ; Fri, 16 Dec 2016 01:22:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mZLKM9Ayc8wk2sbLlWF0O2NNSflDmbSSnDivSasUjO8=; b=M34WWC07+YzWMXb2FlQZjc2ip551XOaDuxQbjrqgyxZTsJfDUBaSm1RDoD3m21mUsK Fna3zYmZyn/gLeAOT3FymyZOzCkTMGtWMaBdZ5cGEp/cOz9wOQR+hwHHXu4w5UVS5Ynw mk+FvRpGC55kFNzcLwnprMtpI3ldn/f+iHKNUfJWbwKbXPgrfCB+jUzfJRsgi1aUcdTh O7xJr44FGX7wt8ns8ZX8enzlRSznZAo5SLcKAQYt8Jcei8ifZ7IQfZxw50xXzDj4weSP ++rjCWpCCzqpO8TRG96gnN7/AaltBT2zvyPQ7u4Quv3EXUkswgf+DioI3F+TTvs+uGsm PPbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mZLKM9Ayc8wk2sbLlWF0O2NNSflDmbSSnDivSasUjO8=; b=WoeADbi0KD6TYJ2jTE5Qxqjjkp08qTH73IAjaP/BTXVa3PbZX88f7FuVX83wmDzTrA TZJ5vDFL7y3dNSpYsuj7TppvGeoF9qYcJDzTabHD3vNVyXyBwbUKtxmhiSdw82euAG1q 42M/UaAnMooSFH9wSmqZ3vtfKou23JIxxLTcYb6S5izAbU/kbHZE7+nSfjZG86GlQt5N bCBVJ38qoBF8R/SfKZDyo4YBQ38fmz/2tOz1EsqeHvxr0mDwmbz3QCYgKqy7fK+M9ZOh F8eV8COSyHq6HzFqZwnW4x5bMbBqKYspfKyMJmQNj0Jh9vHX7qdpli729I+Hc5YQ0hZv GvPQ== X-Gm-Message-State: AKaTC03zhGZn1N+H7c5b4toBTiH8o6FG81/EfzDjYhza8brFEFGIuTFs3xmsLln+CRpziElK01flEGHmdx9BPQ== X-Received: by 10.25.190.86 with SMTP id o83mr580185lff.109.1481880129933; Fri, 16 Dec 2016 01:22:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.196.129 with HTTP; Fri, 16 Dec 2016 01:22:09 -0800 (PST) In-Reply-To: <744508F7-BA9E-4DEA-B065-010B01515EEC@apple.com> References: <744508F7-BA9E-4DEA-B065-010B01515EEC@apple.com> From: Arka Sharma Date: Fri, 16 Dec 2016 14:52:09 +0530 Message-ID: To: Andrew Fish Cc: edk2-devel@lists.01.org Subject: Re: Closing PciIo protocol inside Stop() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 09:22:12 -0000 Content-Type: text/plain; charset=UTF-8 Actually I am thinking if it will be possible to use PciIo from a driver on a ControllerHandle which managed by another driver which has been stopped. So is it possible that driver which wants to access it restarts the ControllerHandle with it's own DriverBindingHandle, or it is that as soon as the driver closes PciIo and DevicePath on the ControllerHandle inside Stop() function, the ControllerHandle is destroyed. On Thu, Dec 15, 2016 at 11:38 PM, Andrew Fish wrote: > > On Dec 15, 2016, at 3:15 AM, Arka Sharma wrote: > > I am wondering if the PciIo protocol instance for a PCI driver, is > opened with _BY_DRIVER | EXCLUSIVE in Start() function, is not closed > in the Stop() will the instance be uninstalled and the > ControllerHandle removed ? > > > Don't do that. The Start() and Stop() need to be symmetric. If you don't > Stop() properly I think your Stop() function could get called again, and > that would be really bad if you your driver was unloaded or something like > that. > > > Also is it possible to Close() the PciIo in Stop() and reopen the > PciIo instance on the same controller handle from some other driver > image with _BY_DRIVER attribute and accessing Pci resources on the > ControllerHandle even after Stop() is called. I know it is not > recommended way but curious about it. Or it could be specific to the > implementation ? > > > Maybe you should just ask what you want to do? > > If you just want to dump out PCI info you can use > gEfiPciRootBridgeIoProtocolGuid ByProtocol. There is an example in the Shell > PCI command: > https://github.com/tianocore/edk2/blob/master/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c#L2537 > > Note: On a large server, or exotic SoC there could be multiple > gEfiPciRootBridgeIoProtocolGuid instances, and the Shell command deals with > that. > > Thanks, > > Andrew Fish > > > Thanks & Regards, > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > >