Re: svn commit: r248705 - head/sys/dev/ipmi

2013-04-01 Thread John Baldwin
On Monday, March 25, 2013 10:30:34 am Alexander V. Chernikov wrote:
 Author: melifaro
 Date: Mon Mar 25 14:30:34 2013
 New Revision: 248705
 URL: http://svnweb.freebsd.org/changeset/base/248705
 
 Log:
   Unlock IPMI sc while performing requests via KCS and SMIC interfaces.
   It is already done in SSIF interface code.
   This reduces contention/spinning reported by many users.

Eh, this was on purpose to prevent concurrent access to the hardware.  SSIF 
doesn't do this because the smbus driver itself does locking internally.  
There are no followups in the PR to state how this patch helps (or if it was 
tested).

OTOH, we should probably make KCS and SMIC perform their requests 
synchronously rather than kicking them over to a worker thread and only use a 
worker thread for SSIF.  This has the advantage that you could make it
interruptible so you could Ctrl-C ipmiutil and have it do something useful.

Also, the current KCS/SMIC code has a timeout, it shouldn't spin forever.  The 
fact that it is spinning forever is a different bug (possibly recently fixed 
by making 'ticks' volatile).  That different bug is probably what should be 
fixed instead.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r248705 - head/sys/dev/ipmi

2013-03-25 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon Mar 25 14:30:34 2013
New Revision: 248705
URL: http://svnweb.freebsd.org/changeset/base/248705

Log:
  Unlock IPMI sc while performing requests via KCS and SMIC interfaces.
  It is already done in SSIF interface code.
  This reduces contention/spinning reported by many users.
  
  PR:   kern/172166
  Submitted by: Eric van Gyzen eric at vangyzen.net
  MFC after:2 weeks

Modified:
  head/sys/dev/ipmi/ipmi_kcs.c
  head/sys/dev/ipmi/ipmi_smic.c

Modified: head/sys/dev/ipmi/ipmi_kcs.c
==
--- head/sys/dev/ipmi/ipmi_kcs.cMon Mar 25 13:58:17 2013
(r248704)
+++ head/sys/dev/ipmi/ipmi_kcs.cMon Mar 25 14:30:34 2013
(r248705)
@@ -456,6 +456,7 @@ kcs_loop(void *arg)
 
IPMI_LOCK(sc);
while ((req = ipmi_dequeue_request(sc)) != NULL) {
+   IPMI_UNLOCK(sc);
ok = 0;
for (i = 0; i  3  !ok; i++)
ok = kcs_polled_request(sc, req);
@@ -463,6 +464,7 @@ kcs_loop(void *arg)
req-ir_error = 0;
else
req-ir_error = EIO;
+   IPMI_LOCK(sc);
ipmi_complete_request(sc, req);
}
IPMI_UNLOCK(sc);

Modified: head/sys/dev/ipmi/ipmi_smic.c
==
--- head/sys/dev/ipmi/ipmi_smic.c   Mon Mar 25 13:58:17 2013
(r248704)
+++ head/sys/dev/ipmi/ipmi_smic.c   Mon Mar 25 14:30:34 2013
(r248705)
@@ -362,6 +362,7 @@ smic_loop(void *arg)
 
IPMI_LOCK(sc);
while ((req = ipmi_dequeue_request(sc)) != NULL) {
+   IPMI_UNLOCK(sc);
ok = 0;
for (i = 0; i  3  !ok; i++)
ok = smic_polled_request(sc, req);
@@ -369,6 +370,7 @@ smic_loop(void *arg)
req-ir_error = 0;
else
req-ir_error = EIO;
+   IPMI_LOCK(sc);
ipmi_complete_request(sc, req);
}
IPMI_UNLOCK(sc);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org