From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Pieralisi Subject: Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. Date: Wed, 27 Jan 2016 17:42:22 +0000 Message-ID: <20160127174222.GA9982@red-moon> References: <1452691267-32240-1-git-send-email-tn@semihalf.com> <1452691267-32240-12-git-send-email-tn@semihalf.com> <20160119160224.GD5276@red-moon> <569F6D67.5000000@semihalf.com> <20160120123849.GA13437@red-moon> <569F8E38.5030101@semihalf.com> <20160120142243.GB13437@red-moon> <569F9CB4.2010905@semihalf.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <569F9CB4.2010905@semihalf.com> Sender: linux-pci-owner@vger.kernel.org To: Tomasz Nowicki Cc: rjw@rjwysocki.net, bhelgaas@google.com, arnd@arndb.de, will.deacon@arm.com, catalin.marinas@arm.com, hanjun.guo@linaro.org, okaya@codeaurora.org, jiang.liu@linux.intel.com, Stefano.Stabellini@eu.citrix.com, robert.richter@caviumnetworks.com, mw@semihalf.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, tglx@linutronix.de, wangyijing@huawei.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, jchandra@broadcom.com, jcm@redhat.com List-Id: linux-acpi@vger.kernel.org On Wed, Jan 20, 2016 at 03:41:56PM +0100, Tomasz Nowicki wrote: > On 20.01.2016 15:22, Lorenzo Pieralisi wrote: > >On Wed, Jan 20, 2016 at 02:40:08PM +0100, Tomasz Nowicki wrote: > > > >[...] > > > >>>>>>+ /* Root bridge device needs to be sure of parent ACPI type */ > >>>>>>+ ACPI_COMPANION_SET(&device->dev, device); > >>>>> > >>>>>I do not understand why the code above is needed, can you elaborate > >>>>>please ? > >>>>> > >>>> > >>>>This makes sure that device->dev can be identified as ACPI device, > >>>>so we can use to_acpi_device_node() and assign companion safely > >>>>below. > >>> > >>>I do not follow. If you refer to the fwnode handle type, that is > >>>already set by ACPI core code (before acpi_pci_root_add() is called, > >>>in acpi_init_device_object()). > >> > >>acpi_init_device_object() sets ACPI fwnode handle type only for > >>"device", but not for "device->dev" which is what is passed as an > >>argument to pci_create_root_bus(). > >> > >>Without ACPI_COMPANION_SET(&device->dev, device) here, no one can be > >>sure if we have ACPI device in pci_create_root_bus(). > > > >Ok, got it. The question is whether this should be done in ACPI > >core instead (is there a reason why it should *not* be done ?), but I > >now understand your point. > > > > I am not able to answer that question, but I see lots of changes in > this area made by Rafael. I had a further look and I am not sure why the fwnode_handle* in the dev member of the acpi_device is not made to point at the fwnode member of the acpi_device by *default* (acpi_init_device_object() ?), probably because it is never used as such but certainly Rafael knows, so I would ask him to clarify please it is unclear to me. I do not see anything wrong in what you are doing in this patch. Rafael, any comments ? Thanks, Lorenzo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933924AbcA0Rkj (ORCPT ); Wed, 27 Jan 2016 12:40:39 -0500 Received: from foss.arm.com ([217.140.101.70]:54318 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752511AbcA0Rki (ORCPT ); Wed, 27 Jan 2016 12:40:38 -0500 Date: Wed, 27 Jan 2016 17:42:22 +0000 From: Lorenzo Pieralisi To: Tomasz Nowicki , rjw@rjwysocki.net Cc: rjw@rjwysocki.net, bhelgaas@google.com, arnd@arndb.de, will.deacon@arm.com, catalin.marinas@arm.com, hanjun.guo@linaro.org, okaya@codeaurora.org, jiang.liu@linux.intel.com, Stefano.Stabellini@eu.citrix.com, robert.richter@caviumnetworks.com, mw@semihalf.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, tglx@linutronix.de, wangyijing@huawei.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, jchandra@broadcom.com, jcm@redhat.com Subject: Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. Message-ID: <20160127174222.GA9982@red-moon> References: <1452691267-32240-1-git-send-email-tn@semihalf.com> <1452691267-32240-12-git-send-email-tn@semihalf.com> <20160119160224.GD5276@red-moon> <569F6D67.5000000@semihalf.com> <20160120123849.GA13437@red-moon> <569F8E38.5030101@semihalf.com> <20160120142243.GB13437@red-moon> <569F9CB4.2010905@semihalf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <569F9CB4.2010905@semihalf.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2016 at 03:41:56PM +0100, Tomasz Nowicki wrote: > On 20.01.2016 15:22, Lorenzo Pieralisi wrote: > >On Wed, Jan 20, 2016 at 02:40:08PM +0100, Tomasz Nowicki wrote: > > > >[...] > > > >>>>>>+ /* Root bridge device needs to be sure of parent ACPI type */ > >>>>>>+ ACPI_COMPANION_SET(&device->dev, device); > >>>>> > >>>>>I do not understand why the code above is needed, can you elaborate > >>>>>please ? > >>>>> > >>>> > >>>>This makes sure that device->dev can be identified as ACPI device, > >>>>so we can use to_acpi_device_node() and assign companion safely > >>>>below. > >>> > >>>I do not follow. If you refer to the fwnode handle type, that is > >>>already set by ACPI core code (before acpi_pci_root_add() is called, > >>>in acpi_init_device_object()). > >> > >>acpi_init_device_object() sets ACPI fwnode handle type only for > >>"device", but not for "device->dev" which is what is passed as an > >>argument to pci_create_root_bus(). > >> > >>Without ACPI_COMPANION_SET(&device->dev, device) here, no one can be > >>sure if we have ACPI device in pci_create_root_bus(). > > > >Ok, got it. The question is whether this should be done in ACPI > >core instead (is there a reason why it should *not* be done ?), but I > >now understand your point. > > > > I am not able to answer that question, but I see lots of changes in > this area made by Rafael. I had a further look and I am not sure why the fwnode_handle* in the dev member of the acpi_device is not made to point at the fwnode member of the acpi_device by *default* (acpi_init_device_object() ?), probably because it is never used as such but certainly Rafael knows, so I would ask him to clarify please it is unclear to me. I do not see anything wrong in what you are doing in this patch. Rafael, any comments ? Thanks, Lorenzo From mboxrd@z Thu Jan 1 00:00:00 1970 From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi) Date: Wed, 27 Jan 2016 17:42:22 +0000 Subject: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. In-Reply-To: <569F9CB4.2010905@semihalf.com> References: <1452691267-32240-1-git-send-email-tn@semihalf.com> <1452691267-32240-12-git-send-email-tn@semihalf.com> <20160119160224.GD5276@red-moon> <569F6D67.5000000@semihalf.com> <20160120123849.GA13437@red-moon> <569F8E38.5030101@semihalf.com> <20160120142243.GB13437@red-moon> <569F9CB4.2010905@semihalf.com> Message-ID: <20160127174222.GA9982@red-moon> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Jan 20, 2016 at 03:41:56PM +0100, Tomasz Nowicki wrote: > On 20.01.2016 15:22, Lorenzo Pieralisi wrote: > >On Wed, Jan 20, 2016 at 02:40:08PM +0100, Tomasz Nowicki wrote: > > > >[...] > > > >>>>>>+ /* Root bridge device needs to be sure of parent ACPI type */ > >>>>>>+ ACPI_COMPANION_SET(&device->dev, device); > >>>>> > >>>>>I do not understand why the code above is needed, can you elaborate > >>>>>please ? > >>>>> > >>>> > >>>>This makes sure that device->dev can be identified as ACPI device, > >>>>so we can use to_acpi_device_node() and assign companion safely > >>>>below. > >>> > >>>I do not follow. If you refer to the fwnode handle type, that is > >>>already set by ACPI core code (before acpi_pci_root_add() is called, > >>>in acpi_init_device_object()). > >> > >>acpi_init_device_object() sets ACPI fwnode handle type only for > >>"device", but not for "device->dev" which is what is passed as an > >>argument to pci_create_root_bus(). > >> > >>Without ACPI_COMPANION_SET(&device->dev, device) here, no one can be > >>sure if we have ACPI device in pci_create_root_bus(). > > > >Ok, got it. The question is whether this should be done in ACPI > >core instead (is there a reason why it should *not* be done ?), but I > >now understand your point. > > > > I am not able to answer that question, but I see lots of changes in > this area made by Rafael. I had a further look and I am not sure why the fwnode_handle* in the dev member of the acpi_device is not made to point at the fwnode member of the acpi_device by *default* (acpi_init_device_object() ?), probably because it is never used as such but certainly Rafael knows, so I would ask him to clarify please it is unclear to me. I do not see anything wrong in what you are doing in this patch. Rafael, any comments ? Thanks, Lorenzo