Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754174AbdCPO7V (ORCPT ); Thu, 16 Mar 2017 10:59:21 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35246 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752672AbdCPO7K (ORCPT ); Thu, 16 Mar 2017 10:59:10 -0400 Subject: Re: [PATCH V7 5/7] ACPI: Delay the enumeration on the devices whose dependency has not met To: Arnd Bergmann , "zhichang.yuan" References: <1489372963-9000-1-git-send-email-yuanzhichang@hisilicon.com> <1489372963-9000-6-git-send-email-yuanzhichang@hisilicon.com> <4600523.rWNiWKrYZC@aspire.rjw.lan> <58C9F6C6.4090700@hisilicon.com> Cc: "Rafael J. Wysocki" , Catalin Marinas , Will Deacon , Rob Herring , Frank Rowand , Bjorn Helgaas , Rafael Wysocki , Mark Rutland , Linux ARM , ACPI Devel Maling List , Lorenzo Pieralisi , Benjamin Herrenschmidt , Linux Kernel Mailing List , linuxarm@huawei.com, devicetree@vger.kernel.org, linux-pci , linux-serial@vger.kernel.org, Corey Minyard , liviu.dudau@arm.com, Zou Rongrong , John Garry , Gabriele Paoloni , kantyzc@163.com, Wei Xu From: "zhichang.yuan" Message-ID: <592befcb-8b52-3a3a-323f-55566f61c7df@gmail.com> Date: Thu, 16 Mar 2017 22:56:52 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2062 Lines: 53 Hi, Arnd, On 03/16/2017 06:13 PM, Arnd Bergmann wrote: > On Thu, Mar 16, 2017 at 3:21 AM, zhichang.yuan > wrote: >> Hi, Rafael, >> >> Thanks for your review! >> >> On 2017/3/14 5:24, Rafael J. Wysocki wrote: >>> On Monday, March 13, 2017 10:42:41 AM zhichang.yuan wrote: >>>> In commit 40e7fcb1929(ACPI: Add _DEP support to fix battery issue on Asus >>>> T100TA), the '_DEP' was supported to solve the dependency of Asus battery. But >>>> this patch is specific to Asus battery device. >>>> In the real world, there are other devices which need the dependency to play the >>>> role on the enumeration order. For example, all the Hip06 LPC >>>> periperals(IPMI-BT, uart, etc) must be scanned after the LPC host driver >>>> finished the probing. So, it makes sense to add a checking whether the ACPI >>>> device meet all the dependencies during its enumeration slot, if not, the >>>> enumeration will be delayed till all dependency master finish their work. >>>> >>>> This patch adds the dependency checking in ACPI enumeration, also the >>>> corresponding handling to retrigger the Hip06 LPC peripherals' scanning. >>> >>> AFAICS, _DEP is generally abused in the wild and cannot be made generic. Sorry. >>> >> >> From the ACPI specification, _DEP is for operation region accesses. >> You are right... >> >> How about we add a ACPI handler for our LPC bus?? Just like amba. >> In this way, we also can solve the issue about LPC enumeration order. > > As far as I can tell, PCI and LPC have exactly the same requirement here, > so whatever you end up doing for one should be used for the other as well. > Thanks for your remind! To some extend, our LPC is similar to PCI. We also need to setup the host resources before scanning the children. For PCI, there is an ACPI handler of pci_root_handler. Although our LPC is not so complicated and powerful as PCI(for example, LPC can't probe downside devices), I think, we can still make LPC host ready to work in its own ACPI handler callback.... Cheers, Zhichang > Arnd >