<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/i2c, branch v4.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-07-05T15:33:49Z</updated>
<entry>
<title>i2c: mux: reg: wrong condition checked for of_address_to_resource return value</title>
<updated>2016-07-05T15:33:49Z</updated>
<author>
<name>Lukasz Gemborowski</name>
<email>lukasz.gemborowski@nokia.com</email>
</author>
<published>2016-06-27T10:57:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=22ebf00eb56fe77922de8138aa9af9996582c2b3'/>
<id>urn:sha1:22ebf00eb56fe77922de8138aa9af9996582c2b3</id>
<content type='text'>
of_address_to_resource return 0 on successful call but
devm_ioremap_resource is called only if it returns non-zero value

Signed-off-by: Lukasz Gemborowski &lt;lukasz.gemborowski@nokia.com&gt;
Reviewed-by: Alexander Sverdlin &lt;alexander.sverdlin@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>i2c: tegra: Correct error path in probe</title>
<updated>2016-07-05T15:20:37Z</updated>
<author>
<name>Jon Hunter</name>
<email>jonathanh@nvidia.com</email>
</author>
<published>2016-06-14T20:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eab09988e47f2b4322faa5ee1430d05714e59000'/>
<id>urn:sha1:eab09988e47f2b4322faa5ee1430d05714e59000</id>
<content type='text'>
Commit 497fbe24987b ("i2c: tegra: enable multi master mode for tegra210")
enables the Tegra I2C 'div_clk' for adapters using the multi-master mode
during the device probe. Although the probe error path was updated to
disable the clock on probe failure, there is one place after calling
tegra_i2c_init() where the clock will not be disabled on failure. Correct
the error path so that the 'div_clk' is disabled if calling
tegra_i2c_init() fails.

Fixes: 497fbe24987b ("i2c: tegra: enable multi master mode for tegra210")

Signed-off-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Acked-by: Laxman Dewangan &lt;ldewangan@nvidia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: remove __init from i2c_register_board_info()</title>
<updated>2016-06-19T12:13:50Z</updated>
<author>
<name>Luis R. Rodriguez</name>
<email>mcgrof@kernel.org</email>
</author>
<published>2016-06-07T23:52:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5abe9b26847c65a698f38744a52635b287514294'/>
<id>urn:sha1:5abe9b26847c65a698f38744a52635b287514294</id>
<content type='text'>
As of next-20160607 with allyesconfig we get this linker failure:

  MODPOST vmlinux.o
WARNING: vmlinux.o(.text+0x21bc0d): Section mismatch in reference from
the function intel_scu_devices_create() to the function
.init.text:i2c_register_board_info()

This is caused by the fact that intel_scu_devices_create() calls
i2c_register_board_info() and intel_scu_devices_create() is not
annotated with __init. This typically involves manual code
inspection and if one is certain this is correct we would
just peg intel_scu_devices_create() with a __ref annotation.

In this case this would be wrong though as the
intel_scu_devices_create() call is exported, and used in
the ipc_probe() on drivers/platform/x86/intel_scu_ipc.c.
The issue is that even though builtin_pci_driver(ipc_driver)
is used this just exposes the probe routine, which can occur
at any point in time if this bus supports hotplug. A race
can happen between kernel_init_freeable() that calls the init
calls (in this case registeres the intel_scu_ipc.c driver, and
later free_initmem(), which would free the i2c_register_board_info().
If a probe happens later in boot i2c_register_board_info() would
not be present and we should get a page fault.

Signed-off-by: Luis R. Rodriguez &lt;mcgrof@kernel.org&gt;
[wsa: made function declaration a one-liner]
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: qup: Fix wrong value of index variable</title>
<updated>2016-06-18T16:33:13Z</updated>
<author>
<name>Sricharan R</name>
<email>sricharan@codeaurora.org</email>
</author>
<published>2016-06-10T18:08:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4f56c7773483b8829e89cfc739b7a5a071f6da0'/>
<id>urn:sha1:d4f56c7773483b8829e89cfc739b7a5a071f6da0</id>
<content type='text'>
index gets incremented during check to determine if the
messages can be transferred with dma. But not reset after
that, resulting in wrong start value in subsequent loop,
causing failure. Fix it.

Signed-off-by: Sricharan R &lt;sricharan@codeaurora.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>i2c: mux: reg: Provide of_match_table</title>
<updated>2016-06-09T20:38:16Z</updated>
<author>
<name>Lukasz Gemborowski</name>
<email>lukasz.gemborowski@nokia.com</email>
</author>
<published>2016-06-06T13:51:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9f05e6219023116b59f6495e8c4d4ba352dd5fea'/>
<id>urn:sha1:9f05e6219023116b59f6495e8c4d4ba352dd5fea</id>
<content type='text'>
of_match_table was not filled which prevents device to be
instantiated from device tree node.

Signed-off-by: Lukasz Gemborowski &lt;lukasz.gemborowski@nokia.com&gt;
Reviewed-by: Alexander Sverdlin &lt;alexander.sverdlin@nokia.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: octeon: Avoid printk after too long SMBUS message</title>
<updated>2016-06-09T20:07:57Z</updated>
<author>
<name>Jan Glauber</name>
<email>jglauber@cavium.com</email>
</author>
<published>2016-06-08T06:51:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8913f8d2930368f30998e60851259606eeed2c49'/>
<id>urn:sha1:8913f8d2930368f30998e60851259606eeed2c49</id>
<content type='text'>
Remove the warning about a too long SMBUS message because
the ipmi_ssif driver triggers this warning too frequently so it
spams the message log.

Signed-off-by: Jan Glauber &lt;jglauber@cavium.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: octeon: Missing AAK flag in case of I2C_M_RECV_LEN</title>
<updated>2016-06-09T20:05:32Z</updated>
<author>
<name>Jan Glauber</name>
<email>jglauber@cavium.com</email>
</author>
<published>2016-06-08T06:51:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=908cf12bbca0f18a23085a5a35301509e034f0a9'/>
<id>urn:sha1:908cf12bbca0f18a23085a5a35301509e034f0a9</id>
<content type='text'>
During receive the controller requires the AAK flag for all
bytes but the final one. This was wrong in case of I2C_M_RECV_LEN,
where the decision if the final byte is to be transmitted
happened before adding the additional received length byte.

Set the AAK flag if additional bytes are to be received.

Signed-off-by: Jan Glauber &lt;jglauber@cavium.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR</title>
<updated>2016-06-09T19:38:57Z</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2016-06-09T13:56:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a7ae81952cdab56a1277bd2f9ed7284c0f575120'/>
<id>urn:sha1:a7ae81952cdab56a1277bd2f9ed7284c0f575120</id>
<content type='text'>
Many Intel systems the BIOS declares a SystemIO OpRegion below the SMBus
PCI device as can be seen in ACPI DSDT table from Lenovo Yoga 900:

  Device (SBUS)
  {
      OperationRegion (SMBI, SystemIO, (SBAR &lt;&lt; 0x05), 0x10)
      Field (SMBI, ByteAcc, NoLock, Preserve)
      {
          HSTS,   8,
          Offset (0x02),
          HCON,   8,
          HCOM,   8,
          TXSA,   8,
          DAT0,   8,
          DAT1,   8,
          HBDR,   8,
          PECR,   8,
          RXSA,   8,
          SDAT,   16
      }

There are also bunch of AML methods that that the BIOS can use to access
these fields. Most of the systems in question AML methods accessing the
SMBI OpRegion are never used.

Now, because of this SMBI OpRegion many systems fail to load the SMBus
driver with an error looking like one below:

  ACPI Warning: SystemIO range 0x0000000000003040-0x000000000000305F
       conflicts with OpRegion 0x0000000000003040-0x000000000000304F
       (\_SB.PCI0.SBUS.SMBI) (20160108/utaddress-255)
  ACPI: If an ACPI driver is available for this device, you should use
       it instead of the native driver

The reason is that this SMBI OpRegion conflicts with the PCI BAR used by
the SMBus driver.

It turns out that we can install a custom SystemIO address space handler
for the SMBus device to intercept all accesses through that OpRegion. This
allows us to share the PCI BAR with the AML code if it for some reason is
using it. We do not expect that this OpRegion handler will ever be called
but if it is we print a warning and prevent all access from the SMBus
driver itself.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=110041
Reported-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Reported-by: Pali Rohár &lt;pali.rohar@gmail.com&gt;
Suggested-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Tested-by: Pali Rohár &lt;pali.rohar@gmail.com&gt;
Tested-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>i2c: dev: use after free in detach</title>
<updated>2016-05-28T15:37:42Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-05-28T05:01:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e6be18f6d62c1d3b331ae020b76a29c2ccf6b0bf'/>
<id>urn:sha1:e6be18f6d62c1d3b331ae020b76a29c2ccf6b0bf</id>
<content type='text'>
The call to put_i2c_dev() frees "i2c_dev" so there is a use after
free when we call cdev_del(&amp;i2c_dev-&gt;cdev).

Fixes: d6760b14d4a1 ('i2c: dev: switch from register_chrdev to cdev API')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: dev: don't start function name with 'return'</title>
<updated>2016-05-27T11:13:01Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-05-27T11:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=72a71f869c95dc11b73f09fe18c593d4a0618c3f'/>
<id>urn:sha1:72a71f869c95dc11b73f09fe18c593d4a0618c3f</id>
<content type='text'>
I stumbled multiple times over 'return_i2c_dev', especially before the
actual 'return res'. It makes the code hard to read, so reanme the
function to 'put_i2c_dev' which also better matches 'get_free_i2c_dev'.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
</feed>
