All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: openipmi-developer@lists.sourceforge.net,
	linux-parisc@vger.kernel.org, minyard@acm.org
Subject: Re: [PATCH] BMC support for PARISC machines
Date: Tue, 30 Jul 2013 08:32:32 +0200	[thread overview]
Message-ID: <9487813.vZBgAZSMSR@eto> (raw)
In-Reply-To: <20130730000702.4C0D21D232@solo.franken.de>

[-- Attachment #1: Type: text/plain, Size: 2659 bytes --]

Thomas Bogendoerfer wrote:
> The last line of PARISC machines (C8000, RP34x0, etc.) have a BMC for
> controlling temperature, fan speed and other stuff. The BMC is connected
> via a special bus and listed in the firmware device tree. This change
> adds support for these BMCs to the IPMI driver.
> 
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
> 
> This is the second try to get this change integrated. If you see
> any problems with this patch, please give me hints how to improve
> this patch.
> 
> 
>  drivers/char/ipmi/ipmi_si_intf.c |   77
> ++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+)
> 
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c
> b/drivers/char/ipmi/ipmi_si_intf.c index af4b23f..b017b8a 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -71,6 +71,11 @@
>  #include <linux/of_address.h>
>  #include <linux/of_irq.h>
> 
> +#ifdef CONFIG_PARISC
> +#include <asm/hardware.h>	/* for register_parisc_driver() stuff */
> +#include <asm/parisc-device.h>
> +#endif
> +
>  #define PFX "ipmi_si: "
> 
>  /* Measure times between events in the driver. */
> @@ -298,6 +303,9 @@ static int pci_registered;
>  #ifdef CONFIG_ACPI
>  static int pnp_registered;
>  #endif
> +#ifdef CONFIG_PARISC
> +static int parisc_registered;
> +#endif
>  static unsigned int kipmid_max_busy_us[SI_MAX_PARMS];
>  static int num_max_busy_us;

Can be bool

> @@ -2697,6 +2705,64 @@ static struct platform_driver ipmi_driver = {
>  	.remove		= ipmi_remove,
>  };
> 
> +#ifdef CONFIG_PARISC
> +static int ipmi_parisc_probe(struct parisc_device *dev)
> +{
> +	struct smi_info *info;
> +
> +	info = kzalloc(sizeof(*info), GFP_KERNEL);
> +
> +	if (!info) {
> +		dev_err(&dev->dev,
> +			"could not allocate memory for PARISC probe\n");
> +		return -ENOMEM;
> +	}
> +
> +	info->si_type		= SI_KCS;
> +	info->addr_source	= SI_DEVICETREE;
> +	info->io_setup		= mem_setup;
> +	info->io.addr_type	= IPMI_MEM_ADDR_SPACE;
> +	info->io.addr_data	= dev->hpa.start;
> +	info->io.regsize	= 1;
> +	info->io.regspacing	= 1;
> +	info->io.regshift	= 0;
> +	info->irq		= 0; /* no interrupt */
> +	info->irq_setup		= NULL;
> +	info->dev		= &dev->dev;
> +
> +	dev_dbg(&dev->dev, "addr 0x%lx regsize %d spacing %d irq %d\n",
> +		info->io.addr_data, info->io.regsize, info->io.regspacing,
> +		info->irq);

Printing regsize, regspacing, and IRQ here is kind of pointless as they have 
fixed values, no?

> +	dev_set_drvdata(&dev->dev, info);
> +
> +	if (add_smi(info)) {
> +		kfree(info);
> +		return -EBUSY;
> +	}

add_smi() will already return an error code AFAICS. So just forward that.

Regards,

Eike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2013-07-30  6:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30  0:07 [PATCH] BMC support for PARISC machines Thomas Bogendoerfer
2013-07-30  6:32 ` Rolf Eike Beer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-11-30 22:25 Thomas Bogendoerfer

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=9487813.vZBgAZSMSR@eto \
    --to=eike-kernel@sf-tec.de \
    --cc=linux-parisc@vger.kernel.org \
    --cc=minyard@acm.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    --cc=tsbogend@alpha.franken.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.