All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Some minor IPMI fixes
@ 2013-09-04 14:40 minyard
  2013-09-04 14:40 ` [PATCH 1/4] ipmi: info leak in compat_ipmi_ioctl() minyard
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: minyard @ 2013-09-04 14:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel, OpenIPMI Developers

A few things for 3.12 from various people.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] ipmi: info leak in compat_ipmi_ioctl()
  2013-09-04 14:40 [PATCH 0/4] Some minor IPMI fixes minyard
@ 2013-09-04 14:40 ` minyard
  2013-09-04 14:40 ` [PATCH 2/4] ipmi: Initialize locals to avoid warning minyard
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: minyard @ 2013-09-04 14:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel, OpenIPMI Developers, Dan Carpenter

From: Dan Carpenter <dan.carpenter@oracle.com>

On x86_64 there is a 4 byte hole between ->recv_type and ->addr.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/char/ipmi/ipmi_devintf.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index d5a5f02..ec318bf 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -810,6 +810,7 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd,
 		struct ipmi_recv   __user *precv64;
 		struct ipmi_recv   recv64;
 
+		memset(&recv64, 0, sizeof(recv64));
 		if (get_compat_ipmi_recv(&recv64, compat_ptr(arg)))
 			return -EFAULT;
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] ipmi: Initialize locals to avoid warning
  2013-09-04 14:40 [PATCH 0/4] Some minor IPMI fixes minyard
  2013-09-04 14:40 ` [PATCH 1/4] ipmi: info leak in compat_ipmi_ioctl() minyard
@ 2013-09-04 14:40 ` minyard
  2013-09-04 14:40 ` [PATCH 3/4] Add MODULE_ALIAS for autoloading ipmi driver on ACPI systems minyard
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: minyard @ 2013-09-04 14:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel, OpenIPMI Developers, Corey Minyard

From: Corey Minyard <cminyard@mvista.com>

A couple of variables were getting warnings about being uninitialized.
It was a false warning, but initialize them, anyway.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 drivers/char/ipmi/ipmi_msghandler.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 4445fa1..ec4e10f 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -1848,7 +1848,7 @@ int ipmi_request_settime(ipmi_user_t      user,
 			 int              retries,
 			 unsigned int     retry_time_ms)
 {
-	unsigned char saddr, lun;
+	unsigned char saddr = 0, lun = 0;
 	int           rv;
 
 	if (!user)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] Add MODULE_ALIAS for autoloading ipmi driver on ACPI systems
  2013-09-04 14:40 [PATCH 0/4] Some minor IPMI fixes minyard
  2013-09-04 14:40 ` [PATCH 1/4] ipmi: info leak in compat_ipmi_ioctl() minyard
  2013-09-04 14:40 ` [PATCH 2/4] ipmi: Initialize locals to avoid warning minyard
@ 2013-09-04 14:40 ` minyard
  2013-09-04 14:40 ` [PATCH 4/4] BMC support for PARISC machines minyard
  2013-09-04 23:23 ` [PATCH 0/4] Some minor IPMI fixes Linus Torvalds
  4 siblings, 0 replies; 7+ messages in thread
From: minyard @ 2013-09-04 14:40 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux Kernel, OpenIPMI Developers, Jordan_Hargrave,
	Jordan Hargrave, Corey Minyard

From: "Jordan_Hargrave@Dell.com" <Jordan_Hargrave@Dell.com>

I'd submitted this about a year ago but it never made it upstream.

The latest versions of the kernel drivers for ipmi can use ACPI to
determine the type of BMC device used in the system.  The following
patch adds a module alias so that udev will autoload the ipmi_si
driver.

Signed-off-by: Jordan Hargrave <jordan_hargrave@dell.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 drivers/char/ipmi/ipmi_si_intf.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index af4b23f..810372c 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2279,6 +2279,8 @@ static struct pnp_driver ipmi_pnp_driver = {
 	.remove		= ipmi_pnp_remove,
 	.id_table	= pnp_dev_table,
 };
+
+MODULE_DEVICE_TABLE(pnp, pnp_dev_table);
 #endif
 
 #ifdef CONFIG_DMI
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] BMC support for PARISC machines
  2013-09-04 14:40 [PATCH 0/4] Some minor IPMI fixes minyard
                   ` (2 preceding siblings ...)
  2013-09-04 14:40 ` [PATCH 3/4] Add MODULE_ALIAS for autoloading ipmi driver on ACPI systems minyard
@ 2013-09-04 14:40 ` minyard
  2013-09-04 23:23 ` [PATCH 0/4] Some minor IPMI fixes Linus Torvalds
  4 siblings, 0 replies; 7+ messages in thread
From: minyard @ 2013-09-04 14:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel, OpenIPMI Developers, Thomas Bogendoerfer

From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

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>
---
 drivers/char/ipmi/ipmi_si_intf.c |   75 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 810372c..15e4a60 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;
@@ -2699,6 +2707,62 @@ 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 = smi_info_alloc();
+
+	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\n", info->io.addr_data);
+
+	dev_set_drvdata(&dev->dev, info);
+
+	if (add_smi(info)) {
+		kfree(info);
+		return -EBUSY;
+	}
+
+	return 0;
+}
+
+static int ipmi_parisc_remove(struct parisc_device *dev)
+{
+	cleanup_one_si(dev_get_drvdata(&dev->dev));
+	return 0;
+}
+
+static struct parisc_device_id ipmi_parisc_tbl[] = {
+	{ HPHW_MC, HVERSION_REV_ANY_ID, 0x004, 0xC0 },
+	{ 0, }
+};
+
+static struct parisc_driver ipmi_parisc_driver = {
+	.name =		"ipmi",
+	.id_table =	ipmi_parisc_tbl,
+	.probe =	ipmi_parisc_probe,
+	.remove =	ipmi_parisc_remove,
+};
+#endif /* CONFIG_PARISC */
+
 static int wait_for_msg_done(struct smi_info *smi_info)
 {
 	enum si_sm_result     smi_result;
@@ -3464,6 +3528,13 @@ static int init_ipmi_si(void)
 		spmi_find_bmc();
 #endif
 
+#ifdef CONFIG_PARISC
+	register_parisc_driver(&ipmi_parisc_driver);
+	parisc_registered = 1;
+	/* poking PC IO addresses will crash machine, don't do it */
+	si_trydefaults = 0;
+#endif
+
 	/* We prefer devices with interrupts, but in the case of a machine
 	   with multiple BMCs we assume that there will be several instances
 	   of a given type so if we succeed in registering a type then also
@@ -3610,6 +3681,10 @@ static void cleanup_ipmi_si(void)
 	if (pnp_registered)
 		pnp_unregister_driver(&ipmi_pnp_driver);
 #endif
+#ifdef CONFIG_PARISC
+	if (parisc_registered)
+		unregister_parisc_driver(&ipmi_parisc_driver);
+#endif
 
 	platform_driver_unregister(&ipmi_driver);
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] Some minor IPMI fixes
  2013-09-04 14:40 [PATCH 0/4] Some minor IPMI fixes minyard
                   ` (3 preceding siblings ...)
  2013-09-04 14:40 ` [PATCH 4/4] BMC support for PARISC machines minyard
@ 2013-09-04 23:23 ` Linus Torvalds
  4 siblings, 0 replies; 7+ messages in thread
From: Linus Torvalds @ 2013-09-04 23:23 UTC (permalink / raw)
  To: Corey Minyard; +Cc: Linux Kernel, OpenIPMI Developers

On Wed, Sep 4, 2013 at 7:40 AM,  <minyard@acm.org> wrote:
> A few things for 3.12 from various people.

Half of these don't have your sign-offs, so I can't apply them.

               Linus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] ipmi: info leak in compat_ipmi_ioctl()
  2013-09-05 11:36 [PATCH 0/4] Some minor IPMI fixes (with signoffs) minyard
@ 2013-09-05 11:36 ` minyard
  0 siblings, 0 replies; 7+ messages in thread
From: minyard @ 2013-09-05 11:36 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux Kernel, OpenIPMI Developers, Dan Carpenter, Corey Minyard

From: Dan Carpenter <dan.carpenter@oracle.com>

On x86_64 there is a 4 byte hole between ->recv_type and ->addr.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 drivers/char/ipmi/ipmi_devintf.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index d5a5f02..ec318bf 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -810,6 +810,7 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd,
 		struct ipmi_recv   __user *precv64;
 		struct ipmi_recv   recv64;
 
+		memset(&recv64, 0, sizeof(recv64));
 		if (get_compat_ipmi_recv(&recv64, compat_ptr(arg)))
 			return -EFAULT;
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-09-05 11:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-04 14:40 [PATCH 0/4] Some minor IPMI fixes minyard
2013-09-04 14:40 ` [PATCH 1/4] ipmi: info leak in compat_ipmi_ioctl() minyard
2013-09-04 14:40 ` [PATCH 2/4] ipmi: Initialize locals to avoid warning minyard
2013-09-04 14:40 ` [PATCH 3/4] Add MODULE_ALIAS for autoloading ipmi driver on ACPI systems minyard
2013-09-04 14:40 ` [PATCH 4/4] BMC support for PARISC machines minyard
2013-09-04 23:23 ` [PATCH 0/4] Some minor IPMI fixes Linus Torvalds
2013-09-05 11:36 [PATCH 0/4] Some minor IPMI fixes (with signoffs) minyard
2013-09-05 11:36 ` [PATCH 1/4] ipmi: info leak in compat_ipmi_ioctl() minyard

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.