public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: ykzhao <yakui.zhao@intel.com>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "lenb@kernel.org" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"minyard@acm.org" <minyard@acm.org>,
	"openipmi-developer@lists.sourceforge.net"
	<openipmi-developer@lists.sourceforge.net>
Subject: Re: [PATCH v4 1/2] IPMI/ACPI: use ACPI detection mechanism firstly to detect IPMI system interface
Date: Thu, 21 Jan 2010 09:20:25 +0800	[thread overview]
Message-ID: <1264036825.15793.14.camel@localhost.localdomain> (raw)
In-Reply-To: <201001200951.49462.bjorn.helgaas@hp.com>

On Wed, 2010-01-20 at 09:51 -0700, Bjorn Helgaas wrote:
> On Monday 28 December 2009 06:44:19 pm yakui.zhao@intel.com wrote:
> > From: Zhao Yakui <yakui.zhao@intel.com>
> > 
> > Sometimes one IPMI system interface will be detected by several methods.
> > For example: ACPI mechanism, SPMI table, DMI or hardcode mechanism.
> > In such case when one IPMI system interface can be detected in two mechanism,
> > the second mechanism will fail in the detection and can't record which IPMI
> > system interface is detected by it.
> > 
> > Use the ACPI detection mechanism firstly to detect the IPMI system interface
> > so that we can know which IPMI system interface is detected in ACPI namespace.
> > 
> > Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
> > ---
> >  drivers/char/ipmi/ipmi_si_intf.c |    8 +++++---
> >  1 files changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> > index 176f175..3f6ca11 100644
> > --- a/drivers/char/ipmi/ipmi_si_intf.c
> > +++ b/drivers/char/ipmi/ipmi_si_intf.c
> > @@ -3195,6 +3195,10 @@ static __devinit int init_ipmi_si(void)
> >  
> >  	printk(KERN_INFO "IPMI System Interface driver.\n");
> >  
> > +#ifdef CONFIG_ACPI
> > +	pnp_register_driver(&ipmi_pnp_driver);
> > +#endif
> > +
> >  	hardcode_find_bmc();
> 
> The usual practice is to handle devices explicitly specified by
> module parameters first.  That way, the driver should work with
> no module parameters in most cases, but the user can specify the
> device location manually if necessary to work around a firmware
> bug.

The reason I change the order of detecting IPMI device is that maybe one
IPMI device can be registered by several different mechanisms. When we
register one IPMI device by using try_smi_init, it will firstly check
whether the IPMI device is already registered by comparing the address.

If the IPMI device is already registered by another mechanism,  we can't
enable ACPI to access the IPMI device as we can't create the user
interface between ACPI and IPMI device.

If we add the module option to use the hardcode mechanism,  maybe we
will fail in detecting IPMI device by using ACPI mechanism. 

Thanks.
	Yakui.
> 
> For that reason, I would use this order instead:
> 
> 	hardcode_find_bmc();
> 	pnp_register_driver();
> 	...
> 
> >  #ifdef CONFIG_DMI
> > @@ -3204,9 +3208,6 @@ static __devinit int init_ipmi_si(void)
> >  #ifdef CONFIG_ACPI
> >  	spmi_find_bmc();
> >  #endif
> > -#ifdef CONFIG_ACPI
> > -	pnp_register_driver(&ipmi_pnp_driver);
> > -#endif
> >  
> >  #ifdef CONFIG_PCI
> >  	rv = pci_register_driver(&ipmi_pci_driver);
> > @@ -3330,6 +3331,7 @@ static __exit void cleanup_ipmi_si(void)
> >  #ifdef CONFIG_PCI
> >  	pci_unregister_driver(&ipmi_pci_driver);
> >  #endif
> > +
> >  #ifdef CONFIG_ACPI
> >  	pnp_unregister_driver(&ipmi_pnp_driver);
> >  #endif
> 
> 


  reply	other threads:[~2010-01-21  1:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-29  1:44 [PATCH v4 0/2] IPMI/ACPI: Install the ACPI IPMI opregion yakui.zhao
2009-12-29  1:44 ` [PATCH v4 1/2] IPMI/ACPI: use ACPI detection mechanism firstly to detect IPMI system interface yakui.zhao
2009-12-29  1:44   ` [PATCH v4 2/2] IPMI/ACPI: Install the IPMI space handler to enable ACPI to access the BMC controller yakui.zhao
2010-01-20 17:47     ` Bjorn Helgaas
2010-01-21  3:32       ` ykzhao
2010-01-20 16:51   ` [PATCH v4 1/2] IPMI/ACPI: use ACPI detection mechanism firstly to detect IPMI system interface Bjorn Helgaas
2010-01-21  1:20     ` ykzhao [this message]
2010-01-21 17:54       ` Bjorn Helgaas
2010-01-22  1:15         ` ykzhao
2010-01-22 16:06           ` Bjorn Helgaas
2010-01-25  6:37             ` ykzhao
  -- strict thread matches above, loose matches on Subject: below --
2009-12-18  7:56 [PATCH v4 0/2] IPMI/ACPI: Install the ACPI IPMI opregion yakui.zhao
2009-12-18  7:57 ` [PATCH v4 1/2] IPMI/ACPI: use ACPI detection mechanism firstly to detect IPMI system interface yakui.zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1264036825.15793.14.camel@localhost.localdomain \
    --to=yakui.zhao@intel.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=minyard@acm.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox