From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Gordeev Subject: Re: [PATCH RFC 07/15] pci: Add pci_probe() and pci_shutdown() Date: Thu, 14 Apr 2016 15:23:28 +0200 Message-ID: <20160414132328.GC26536@agordeev.lab.eng.brq.redhat.com> References: <570F4AB5.9020300@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, Andrew Jones To: Thomas Huth Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53122 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754762AbcDNNYQ (ORCPT ); Thu, 14 Apr 2016 09:24:16 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2040C7AE96 for ; Thu, 14 Apr 2016 13:24:15 +0000 (UTC) Content-Disposition: inline In-Reply-To: <570F4AB5.9020300@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Apr 14, 2016 at 09:45:57AM +0200, Thomas Huth wrote: > On 11.04.2016 13:04, Alexander Gordeev wrote: > > Cc: Thomas Huth > > Cc: Andrew Jones > > Signed-off-by: Alexander Gordeev > > --- > > lib/asm-generic/pci.h | 15 ++++++++++++++- > > lib/pci.c | 1 - > > lib/pci.h | 2 ++ > > 3 files changed, 16 insertions(+), 2 deletions(-) > > > > diff --git a/lib/asm-generic/pci.h b/lib/asm-generic/pci.h > > index 3fa0b2ab1fe6..175b0497ed82 100644 > > --- a/lib/asm-generic/pci.h > > +++ b/lib/asm-generic/pci.h > > @@ -1,4 +1,17 @@ > > #ifndef _ASM_GENERIC_PCI_H_ > > #define _ASM_GENERIC_PCI_H_ > > -#error need architecture specific asm/pci.h > > + > > +#ifndef pci_probe > > +static inline bool pci_probe(void) > > +{ > > + return true; > > +} > > +#endif > > + > > +#ifndef pci_shutdown > > +static inline void pci_shutdown(void) > > +{ > > +} > > +#endif > > + > > #endif > > What are these functions supposed to do exactly? (and why is the default > implementation empty?) ... some comments would be really helpful here. These two are expected to init/scan and shutdown PCI busses - something a firmware or bios do. Only when pci_probe() succeeded all pci_* public functions are expected functional. They are empty, because this is default implementation. Architectures that need initialize PCI bus should override these functions. > Thomas >