public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: torvalds@linux-foundation.org
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	OpenIPMI Developers <openipmi-developer@lists.sourceforge.net>
Subject: [PATCH 4/4] IPMI: Add proper offset for HP PCI interfaces
Date: Wed, 03 Mar 2010 10:17:39 -0600	[thread overview]
Message-ID: <20100303161739.GD17623@minyard.local> (raw)

From: Corey Minyard <cminyard@mvista.com>

On a PCI update, the offset for HP PCI interfaces to the IPMI controller
was left off.  Add the offset back in.  The "dead code" dealing with
first_reg_offset was removed in 2.6.32, so that is re-added.

Signed-off-by: Corey Minyard <cminyard@mvista.com>

Index: linux-2.6.33/drivers/char/ipmi/ipmi_si_intf.c
===================================================================
--- linux-2.6.33.orig/drivers/char/ipmi/ipmi_si_intf.c
+++ linux-2.6.33/drivers/char/ipmi/ipmi_si_intf.c
@@ -2363,6 +2363,7 @@ static int __devinit ipmi_pci_probe(stru
 	int rv;
 	int class_type = pdev->class & PCI_ERMC_CLASSCODE_TYPE_MASK;
 	struct smi_info *info;
+	int first_reg_offset = 0;
 
 	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
@@ -2401,6 +2402,9 @@ static int __devinit ipmi_pci_probe(stru
 	info->addr_source_cleanup = ipmi_pci_cleanup;
 	info->addr_source_data = pdev;
 
+	if (pdev->subsystem_vendor == PCI_HP_VENDOR_ID)
+		first_reg_offset = 1;
+
 	if (pci_resource_flags(pdev, 0) & IORESOURCE_IO) {
 		info->io_setup = port_setup;
 		info->io.addr_type = IPMI_IO_ADDR_SPACE;
@@ -2408,7 +2412,7 @@ static int __devinit ipmi_pci_probe(stru
 		info->io_setup = mem_setup;
 		info->io.addr_type = IPMI_MEM_ADDR_SPACE;
 	}
-	info->io.addr_data = pci_resource_start(pdev, 0);
+	info->io.addr_data = pci_resource_start(pdev, 0) + first_reg_offset;
 
 	info->io.regspacing = DEFAULT_REGSPACING;
 	info->io.regsize = DEFAULT_REGSPACING;

                 reply	other threads:[~2010-03-03 16:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100303161739.GD17623@minyard.local \
    --to=minyard@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    --cc=torvalds@linux-foundation.org \
    /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