svn commit: r283766 - in head: share/man/man4 sys/conf sys/dev/ichiic sys/modules/i2c/controllers sys/modules/i2c/controllers/ichiic

2015-05-30 Thread Michael Gmelin
Author: grembo (ports committer)
Date: Sat May 30 12:17:18 2015
New Revision: 283766
URL: https://svnweb.freebsd.org/changeset/base/283766

Log:
  ig4 - Intel fourth gen integrated I2C SMBus driver.
  
  Differential Revision:https://reviews.freebsd.org/D2372
  Reviewed by:  jhb, wblock, adrian
  Approved by:  jhb, wblock
  Relnotes: yes

Added:
  head/share/man/man4/ig4.4   (contents, props changed)
  head/sys/dev/ichiic/
  head/sys/dev/ichiic/ig4_iic.c   (contents, props changed)
  head/sys/dev/ichiic/ig4_pci.c   (contents, props changed)
  head/sys/dev/ichiic/ig4_reg.h   (contents, props changed)
  head/sys/dev/ichiic/ig4_var.h   (contents, props changed)
  head/sys/modules/i2c/controllers/ichiic/
  head/sys/modules/i2c/controllers/ichiic/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/sys/conf/files
  head/sys/modules/i2c/controllers/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileSat May 30 08:54:42 2015
(r283765)
+++ head/share/man/man4/MakefileSat May 30 12:17:18 2015
(r283766)
@@ -192,6 +192,7 @@ MAN=aac.4 \
icmp6.4 \
ida.4 \
ifmib.4 \
+   ig4.4 \
igb.4 \
igmp.4 \
iic.4 \

Added: head/share/man/man4/ig4.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/ig4.4   Sat May 30 12:17:18 2015(r283766)
@@ -0,0 +1,79 @@
+.\ Copyright (c) 2015 Michael Gmelin free...@grem.de
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\ SUCH DAMAGE.
+.\
+.\ $FreeBSD$
+.\
+.Dd May 30, 2015
+.Dt IG4 4
+.Os
+.Sh NAME
+.Nm ig4
+.Nd Intel(R) fourth generation mobile CPU integrated I2C SMBus driver
+.Sh SYNOPSIS
+To compile this driver into the kernel, place the following lines into
+the kernel configuration file:
+.Bd -ragged -offset indent
+.Cd device ig4
+.Cd device smbus
+.Ed
+.Pp
+Alternatively, to load the driver as a module at boot time, place the 
following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+ig4_load=YES
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides access to peripherals attached to an I2C SMB controller.
+.Nm
+supports the SMBus controller found in fourth generation Intel(R) Core(TM)
+processors based on the mobile U-processor line for intelligent systems.
+This includes the i7-4650U, i5-4300U, i3-4010U, and 2980U.
+.Sh SYSCTL VARIABLES
+These
+.Xr sysctl 8
+variables are available:
+.Bl -tag -width debug.ig4_dump
+.It Va debug.ig4_dump
+Setting this to a non-zero value dumps controller registers to console and
+syslog once.
+The sysctl resets to zero immediately.
+.El
+.Sh SEE ALSO
+.Xr smb 4 ,
+.Xr smbus 4
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written for DragonFly BSD by
+.An Matthew Dillon
+and subsequently ported to
+.Fx
+by
+.An Michael Gmelin Aq Mt free...@grem.de .
+.Pp
+This manual page was written by
+.An Michael Gmelin Aq Mt free...@grem.de .

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat May 30 08:54:42 2015(r283765)
+++ head/sys/conf/files Sat May 30 12:17:18 2015(r283766)
@@ -1427,6 +1427,8 @@ dev/hptiop/hptiop.c   optional hptiop scb
 dev/hwpmc/hwpmc_logging.c  optional hwpmc
 dev/hwpmc/hwpmc_mod.c  optional hwpmc
 dev/hwpmc/hwpmc_soft.c optional hwpmc
+dev/ichiic/ig4_iic.c   optional ichiic
+dev/ichiic/ig4_pci.c   optional ichiic pci
 dev/ichsmb/ichsmb.coptional ichsmb
 

Re: svn commit: r283766 - in head: share/man/man4 sys/conf sys/dev/ichiic sys/modules/i2c/controllers sys/modules/i2c/controllers/ichiic

2015-05-30 Thread Konstantin Belousov
On Sat, May 30, 2015 at 12:17:19PM +, Michael Gmelin wrote:
 + if ((op  SMB_TRANS_NOCMD) == 0) {
 + error = wait_status(sc, IG4_STATUS_TX_NOTFULL);
 + if (error)
 + goto done;
 + last |= (u_char)cmd;
 + if (wcount == 0  rcount == 0  (op  SMB_TRANS_NOSTOP) == 0)
 + last |= IG4_DATA_STOP;
 + reg_write(sc, IG4_REG_DATA_CMD, last);
 + last = 0;
 + }

I asked this question in the review, but it was seemingly ignored.

What is the purpose of the sc-mutex lock ?  What kinds of the parallel
execution does it prevent ?

The mutex is dropped when doing a transfer, in the wait_status().
Is there something external which prevents parallel transfer initiation ?
If yes, why is the sc-mutex needed ?  If not, what prevents the
parallel transfers to stomp on each other ?
___
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