All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] EDAC fixes for 3.14
@ 2014-02-14 10:27 Borislav Petkov
  0 siblings, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2014-02-14 10:27 UTC (permalink / raw)
  To: Linus Torvalds, Greg KH; +Cc: linux-edac, lkml

Hi Linus,

please pull the below tag to receive fixes for setting the EDAC core
polling timeout through sysfs.

You're surely wondering why the patches are not based on an rc. Well,
Andrew sent you 79040cad3f82 ("drivers/edac/edac_mc_sysfs.c: poll
timeout cannot be zero sent you") already (it got in in -rc2) but it is
not enough as a fix because for one, setting too low polling intervals
(< 1sec) don't make any sense and cause unnecessary polling load on the
system.

Then, even if we set some interval, we explode with

[ 4143.094342] WARNING: CPU: 1 PID: 0 at kernel/workqueue.c:1393 __queue_work+0x1d7/0x340()

because the workqueue setup path is used also for the timeout period
resetting and we're doing INIT_DELAYED_WORK() on an already active
workqueue. Which is total bollocks. So this is taken care of by the
second patch, whole diff below.

I've CCed stable for those two.

@Greg: Greg, can you please take 79040cad3f82 before you apply those two
below?

Thanks!


The following changes since commit 4675348e78fab420e70f9144b320d9c063c7cee8:

  Merge tag 'stable/for-linus-3.14-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip (2014-02-12 12:28:05 -0800)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git tags/edac_for_3.14

for you to fetch changes up to cb6ef42e516cb8948f15e4b70dc03af8020050a2:

  EDAC: Correct workqueue setup path (2014-02-14 10:40:47 +0100)

----------------------------------------------------------------
Fix polling timeout setting through sysfs.

----------------------------------------------------------------
Borislav Petkov (2):
      EDAC: Poll timeout cannot be zero, p2
      EDAC: Correct workqueue setup path

 drivers/edac/edac_mc.c       | 13 ++++++++-----
 drivers/edac/edac_mc_sysfs.c | 10 ++++++----
 drivers/edac/edac_module.h   |  2 +-
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index e8c9ef03495b..33edd6766344 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -559,7 +559,8 @@ static void edac_mc_workq_function(struct work_struct *work_req)
  *
  *		called with the mem_ctls_mutex held
  */
-static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec)
+static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec,
+				bool init)
 {
 	edac_dbg(0, "\n");
 
@@ -567,7 +568,9 @@ static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec)
 	if (mci->op_state != OP_RUNNING_POLL)
 		return;
 
-	INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function);
+	if (init)
+		INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function);
+
 	mod_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec));
 }
 
@@ -601,7 +604,7 @@ static void edac_mc_workq_teardown(struct mem_ctl_info *mci)
  *	user space has updated our poll period value, need to
  *	reset our workq delays
  */
-void edac_mc_reset_delay_period(int value)
+void edac_mc_reset_delay_period(unsigned long value)
 {
 	struct mem_ctl_info *mci;
 	struct list_head *item;
@@ -611,7 +614,7 @@ void edac_mc_reset_delay_period(int value)
 	list_for_each(item, &mc_devices) {
 		mci = list_entry(item, struct mem_ctl_info, link);
 
-		edac_mc_workq_setup(mci, (unsigned long) value);
+		edac_mc_workq_setup(mci, value, false);
 	}
 
 	mutex_unlock(&mem_ctls_mutex);
@@ -782,7 +785,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
 		/* This instance is NOW RUNNING */
 		mci->op_state = OP_RUNNING_POLL;
 
-		edac_mc_workq_setup(mci, edac_mc_get_poll_msec());
+		edac_mc_workq_setup(mci, edac_mc_get_poll_msec(), true);
 	} else {
 		mci->op_state = OP_RUNNING_INTERRUPT;
 	}
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 8ec1747b1c39..b335c6ab5efe 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -52,18 +52,20 @@ int edac_mc_get_poll_msec(void)
 
 static int edac_set_poll_msec(const char *val, struct kernel_param *kp)
 {
-	long l;
+	unsigned long l;
 	int ret;
 
 	if (!val)
 		return -EINVAL;
 
-	ret = kstrtol(val, 0, &l);
+	ret = kstrtoul(val, 0, &l);
 	if (ret)
 		return ret;
-	if (!l || ((int)l != l))
+
+	if (l < 1000)
 		return -EINVAL;
-	*((int *)kp->arg) = l;
+
+	*((unsigned long *)kp->arg) = l;
 
 	/* notify edac_mc engine to reset the poll period */
 	edac_mc_reset_delay_period(l);
diff --git a/drivers/edac/edac_module.h b/drivers/edac/edac_module.h
index 3d139c6e7fe3..f2118bfcf8df 100644
--- a/drivers/edac/edac_module.h
+++ b/drivers/edac/edac_module.h
@@ -52,7 +52,7 @@ extern void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
 extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev);
 extern void edac_device_reset_delay_period(struct edac_device_ctl_info
 					   *edac_dev, unsigned long value);
-extern void edac_mc_reset_delay_period(int value);
+extern void edac_mc_reset_delay_period(unsigned long value);
 
 extern void *edac_align_ptr(void **p, unsigned size, int n_elems);
 

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

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

* [GIT PULL] EDAC fixes for 3.14
@ 2014-02-28  9:43 Borislav Petkov
  0 siblings, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2014-02-28  9:43 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-edac, lkml

Hi Linus,

please pull the two fixes below for PCI devices disappearing when a
reference count underflow happens after a couple of insmod/rmmod cycles
in succession.

Thanks.

The following changes since commit cfbf8d4857c26a8a307fb7cd258074c9dcd8c691:

  Linux 3.14-rc4 (2014-02-23 17:40:03 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git tags/edac_fixes_for_3.14

for you to fetch changes up to 75135da0d68419ef8a925f4c1d5f63d8046e314d:

  i7300_edac: Fix device reference count (2014-02-25 09:43:13 +0100)

----------------------------------------------------------------
Two reference counting fixes for two Intel EDAC drivers.

----------------------------------------------------------------
Jean Delvare (2):
      i7core_edac: Fix PCI device reference count
      i7300_edac: Fix device reference count

 drivers/edac/i7300_edac.c  | 38 ++++++++++++++++++++------------------
 drivers/edac/i7core_edac.c |  9 +++++++--
 2 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
index d63f4798f7d0..57e96a3350f0 100644
--- a/drivers/edac/i7300_edac.c
+++ b/drivers/edac/i7300_edac.c
@@ -943,33 +943,35 @@ static int i7300_get_devices(struct mem_ctl_info *mci)
 
 	/* Attempt to 'get' the MCH register we want */
 	pdev = NULL;
-	while (!pvt->pci_dev_16_1_fsb_addr_map ||
-	       !pvt->pci_dev_16_2_fsb_err_regs) {
-		pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
-				      PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev);
-		if (!pdev) {
-			/* End of list, leave */
-			i7300_printk(KERN_ERR,
-				"'system address,Process Bus' "
-				"device not found:"
-				"vendor 0x%x device 0x%x ERR funcs "
-				"(broken BIOS?)\n",
-				PCI_VENDOR_ID_INTEL,
-				PCI_DEVICE_ID_INTEL_I7300_MCH_ERR);
-			goto error;
-		}
-
+	while ((pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
+				      PCI_DEVICE_ID_INTEL_I7300_MCH_ERR,
+				      pdev))) {
 		/* Store device 16 funcs 1 and 2 */
 		switch (PCI_FUNC(pdev->devfn)) {
 		case 1:
-			pvt->pci_dev_16_1_fsb_addr_map = pdev;
+			if (!pvt->pci_dev_16_1_fsb_addr_map)
+				pvt->pci_dev_16_1_fsb_addr_map =
+							pci_dev_get(pdev);
 			break;
 		case 2:
-			pvt->pci_dev_16_2_fsb_err_regs = pdev;
+			if (!pvt->pci_dev_16_2_fsb_err_regs)
+				pvt->pci_dev_16_2_fsb_err_regs =
+							pci_dev_get(pdev);
 			break;
 		}
 	}
 
+	if (!pvt->pci_dev_16_1_fsb_addr_map ||
+	    !pvt->pci_dev_16_2_fsb_err_regs) {
+		/* At least one device was not found */
+		i7300_printk(KERN_ERR,
+			"'system address,Process Bus' device not found:"
+			"vendor 0x%x device 0x%x ERR funcs (broken BIOS?)\n",
+			PCI_VENDOR_ID_INTEL,
+			PCI_DEVICE_ID_INTEL_I7300_MCH_ERR);
+		goto error;
+	}
+
 	edac_dbg(1, "System Address, processor bus- PCI Bus ID: %s  %x:%x\n",
 		 pci_name(pvt->pci_dev_16_0_fsb_ctlr),
 		 pvt->pci_dev_16_0_fsb_ctlr->vendor,
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 87533ca7752e..d871275196f6 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1334,14 +1334,19 @@ static int i7core_get_onedevice(struct pci_dev **prev,
 	 * is at addr 8086:2c40, instead of 8086:2c41. So, we need
 	 * to probe for the alternate address in case of failure
 	 */
-	if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev)
+	if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) {
+		pci_dev_get(*prev);	/* pci_get_device will put it */
 		pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
 				      PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT, *prev);
+	}
 
-	if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && !pdev)
+	if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE &&
+	    !pdev) {
+		pci_dev_get(*prev);	/* pci_get_device will put it */
 		pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
 				      PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT,
 				      *prev);
+	}
 
 	if (!pdev) {
 		if (*prev) {
-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

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

* [GIT PULL] EDAC fixes for 3.14
@ 2014-01-20  9:53 Borislav Petkov
  0 siblings, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2014-01-20  9:53 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-edac, lkml

Hi Linus,

please pull a bunch of enhancements/fixes from all around the world of
EDAC.

Thanks.

--
The following changes since commit 6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae:

  Linux 3.13-rc1 (2013-11-22 11:30:55 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git tags/edac_for_3.14

for you to fetch changes up to 881f0fcef9993992c24f5b649a3fb67fd4208f8f:

  EDAC: Don't try to cancel workqueue when it's never setup (2014-01-10 15:57:36 +0100)

----------------------------------------------------------------
* mpc85xx PCIe error interrupt support
* misc small enhancements/fixes all over the place.

----------------------------------------------------------------
Aravind Gopalakrishnan (1):
      amd64_edac: Fix condition to verify max channels allowed for F15 M30h

Aristeu Rozanski (1):
      e752x_edac: Fix pci_dev usage count

Borislav Petkov (2):
      amd64_edac: Simplify code around decode_bus_error
      amd64_edac: Remove "amd64" prefix from static functions

Chunhe Lan (1):
      edac/85xx: Add PCIe error interrupt edac support

Jingoo Han (1):
      EDAC: Remove DEFINE_PCI_DEVICE_TABLE macro

Rashika Kheria (3):
      amd64_edac: Mark amd64_decode_bus_error as static
      EDAC: Mark edac_create_debug_nodes as static
      sb_edac: Mark get_mci_for_node_id as static

Stephen Boyd (1):
      EDAC: Don't try to cancel workqueue when it's never setup

 drivers/edac/amd64_edac.c      | 135 +++++++++++++++++++----------------------
 drivers/edac/amd76x_edac.c     |   2 +-
 drivers/edac/e752x_edac.c      |   6 +-
 drivers/edac/e7xxx_edac.c      |   2 +-
 drivers/edac/edac_device.c     |   3 +
 drivers/edac/edac_mc_sysfs.c   |   2 +-
 drivers/edac/i3000_edac.c      |   2 +-
 drivers/edac/i3200_edac.c      |   2 +-
 drivers/edac/i5000_edac.c      |   2 +-
 drivers/edac/i5100_edac.c      |   2 +-
 drivers/edac/i5400_edac.c      |   2 +-
 drivers/edac/i7300_edac.c      |   2 +-
 drivers/edac/i7core_edac.c     |   2 +-
 drivers/edac/i82443bxgx_edac.c |   2 +-
 drivers/edac/i82860_edac.c     |   2 +-
 drivers/edac/i82875p_edac.c    |   2 +-
 drivers/edac/i82975x_edac.c    |   2 +-
 drivers/edac/mpc85xx_edac.c    |  98 ++++++++++++++++++++++++++----
 drivers/edac/mpc85xx_edac.h    |   7 +++
 drivers/edac/r82600_edac.c     |   2 +-
 drivers/edac/sb_edac.c         |   4 +-
 drivers/edac/x38_edac.c        |   2 +-
 22 files changed, 181 insertions(+), 104 deletions(-)

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

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

end of thread, other threads:[~2014-02-28  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 10:27 [GIT PULL] EDAC fixes for 3.14 Borislav Petkov
  -- strict thread matches above, loose matches on Subject: below --
2014-02-28  9:43 Borislav Petkov
2014-01-20  9:53 Borislav Petkov

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.