<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/i2c, branch v2.6.34</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>i2c-core: Use per-adapter userspace device lists</title>
<updated>2010-05-04T09:09:28+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>khali@linux-fr.org</email>
</author>
<published>2010-05-04T09:09:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6629dcff19470a894ce294d0adb9cbab94ee1fb9'/>
<id>6629dcff19470a894ce294d0adb9cbab94ee1fb9</id>
<content type='text'>
Using a single list for all userspace devices leads to a dead lock
on multiplexed buses in some circumstances (mux chip instantiated
from userspace). This is solved by using a separate list for each
bus segment.

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Acked-by: Michael Lawnick &lt;ml.lawnick@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using a single list for all userspace devices leads to a dead lock
on multiplexed buses in some circumstances (mux chip instantiated
from userspace). This is solved by using a separate list for each
bus segment.

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Acked-by: Michael Lawnick &lt;ml.lawnick@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: Fix probing of FSC hardware monitoring chips</title>
<updated>2010-05-04T09:09:28+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>khali@linux-fr.org</email>
</author>
<published>2010-05-04T09:09:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b1d4b390ea4bb480e65974ce522a04022608a8df'/>
<id>b1d4b390ea4bb480e65974ce522a04022608a8df</id>
<content type='text'>
Some FSC hardware monitoring chips (Syleus at least) doesn't like
quick writes we typically use to probe for I2C chips. Use a regular
byte read instead for the address they live at (0x73). These are the
only known chips living at this address on PC systems.

For clarity, this fix should not be needed for kernels 2.6.30 and
later, as we started instantiating the hwmon devices explicitly based
on DMI data. Still, this fix is valuable in the following two cases:
* Support for recent FSC chips on older kernels. The DMI-based device
  instantiation is more difficult to backport than the device support
  itself.
* Case where the DMI-based device instantiation fails, whatever the
  reason. We fall back to probing in that case, so it should work.

This fixes kernel bug #15634:
https://bugzilla.kernel.org/show_bug.cgi?id=15634

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Acked-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: stable@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some FSC hardware monitoring chips (Syleus at least) doesn't like
quick writes we typically use to probe for I2C chips. Use a regular
byte read instead for the address they live at (0x73). These are the
only known chips living at this address on PC systems.

For clarity, this fix should not be needed for kernels 2.6.30 and
later, as we started instantiating the hwmon devices explicitly based
on DMI data. Still, this fix is valuable in the following two cases:
* Support for recent FSC chips on older kernels. The DMI-based device
  instantiation is more difficult to backport than the device support
  itself.
* Case where the DMI-based device instantiation fails, whatever the
  reason. We fall back to probing in that case, so it should work.

This fixes kernel bug #15634:
https://bugzilla.kernel.org/show_bug.cgi?id=15634

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Acked-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: stable@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-core: Erase pointer to clientdata on removal</title>
<updated>2010-05-04T09:09:27+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>w.sang@pengutronix.de</email>
</author>
<published>2010-05-04T09:09:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e4a7b9b04de15f6b63da5ccdd373ffa3057a3681'/>
<id>e4a7b9b04de15f6b63da5ccdd373ffa3057a3681</id>
<content type='text'>
After discovering that a lot of i2c-drivers leave the pointer to their
clientdata dangling, it was decided to let the core handle this issue.
It is assumed that the core may access the private data after remove()
as there are no guarantees for the lifetime of such pointers anyhow (see
thread starting at http://lkml.org/lkml/2010/3/21/68)

Signed-off-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After discovering that a lot of i2c-drivers leave the pointer to their
clientdata dangling, it was decided to let the core handle this issue.
It is assumed that the core may access the private data after remove()
as there are no guarantees for the lifetime of such pointers anyhow (see
thread starting at http://lkml.org/lkml/2010/3/21/68)

Signed-off-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>I2C: Fix section mismatch errors in i2c-octeon.c</title>
<updated>2010-04-30T19:52:52+00:00</updated>
<author>
<name>David Daney</name>
<email>ddaney@caviumnetworks.com</email>
</author>
<published>2010-03-08T19:04:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=20f12160607c09e299a3e93c7bf4d75e8801c9b7'/>
<id>20f12160607c09e299a3e93c7bf4d75e8801c9b7</id>
<content type='text'>
Signed-off-by: David Daney &lt;ddaney@caviumnetworks.com&gt;
To: linux-i2c@vger.kernel.org
To: ben-linux@fluff.org
To: khali@linux-fr.org
Cc: linux-mips@linux-mips.org
Cc: rade.bozic.ext@nsn.com
Patchwork: http://patchwork.linux-mips.org/patch/1037/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: David Daney &lt;ddaney@caviumnetworks.com&gt;
To: linux-i2c@vger.kernel.org
To: ben-linux@fluff.org
To: khali@linux-fr.org
Cc: linux-mips@linux-mips.org
Cc: rade.bozic.ext@nsn.com
Patchwork: http://patchwork.linux-mips.org/patch/1037/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-stu300: off by one issue</title>
<updated>2010-04-20T00:17:13+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2010-04-07T09:22:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=42df64b1f83fa9b786067a0b5a3aca0fbb2d8db8'/>
<id>42df64b1f83fa9b786067a0b5a3aca0fbb2d8db8</id>
<content type='text'>
If we don't find the correct rate, we want to end the loop with "i"
pointing to the last element in the array.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we don't find the correct rate, we want to end the loop with "i"
pointing to the last element in the array.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-pnx: Add stop conditions for end of transfer</title>
<updated>2010-04-20T00:16:57+00:00</updated>
<author>
<name>Kevin Wells</name>
<email>wellsk40@gmail.com</email>
</author>
<published>2010-03-16T22:55:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=28ad3321a1ac732c7fe37d5be85f67fe40ef18a9'/>
<id>28ad3321a1ac732c7fe37d5be85f67fe40ef18a9</id>
<content type='text'>
Add a stop condition bit flag to the last byte in the transfer.
This will generate an extra clock to handle the stop condition
and prevent devices from staying in an ACK'd state.

Signed-off-by: Kevin Wells &lt;wellsk40@gmail.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a stop condition bit flag to the last byte in the transfer.
This will generate an extra clock to handle the stop condition
and prevent devices from staying in an ACK'd state.

Signed-off-by: Kevin Wells &lt;wellsk40@gmail.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-pnx: Limit maximum divider to 1023</title>
<updated>2010-04-20T00:16:57+00:00</updated>
<author>
<name>Kevin Wells</name>
<email>wellsk40@gmail.com</email>
</author>
<published>2010-03-16T22:55:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=be80dbaa3ed64337693be58fb2f3808e78911ba6'/>
<id>be80dbaa3ed64337693be58fb2f3808e78911ba6</id>
<content type='text'>
Limit maximum divider to 0x3ff to divider computations. On high I2C
parent clock rates, the divider can exceed 0x3ff. This will help
prevent some very odd clock rates.

Signed-off-by: Kevin Wells &lt;wellsk40@gmail.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Limit maximum divider to 0x3ff to divider computations. On high I2C
parent clock rates, the divider can exceed 0x3ff. This will help
prevent some very odd clock rates.

Signed-off-by: Kevin Wells &lt;wellsk40@gmail.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-omap: fix OOPS in omap_i2c_unidle() during probe</title>
<updated>2010-04-20T00:16:57+00:00</updated>
<author>
<name>Mika Westerberg</name>
<email>ext-mika.1.westerberg@nokia.com</email>
</author>
<published>2010-03-23T10:12:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7c6bd2010fced38444c9fd658f4c6ce61bd185bf'/>
<id>7c6bd2010fced38444c9fd658f4c6ce61bd185bf</id>
<content type='text'>
Commit d84d3ea317ce0db89ce0903b4037f800c5d4c477 added register shift to allow
also 16-bit register access. However, omap_i2c_unidle() is called before these
are set which causes the following OOPS:

    Unhandled fault: alignment exception (0x801) at 0xfa070009
    Internal error: : 801 [#1]
    last sysfs file:
    Modules linked in:
    CPU: 0    Not tainted  (2.6.34-rc2-00052-gae6be51 #3)
    PC is at omap_i2c_unidle+0x44/0x138
    LR is at trace_hardirqs_on_caller+0x158/0x18c
    pc : [&lt;c01cd2c4&gt;]    lr : [&lt;c00743f8&gt;]    psr: 20000013
    sp : cfc2bf10  ip : 00000009  fp : 00000000
    r10: 00000000  r9 : 00000000  r8 : c0378560
    r7 : c0378b88  r6 : c0378558  r5 : cfcadc00  r4 : cfcadc00
    r3 : 00000009  r2 : fa070000  r1 : 00000000  r0 : 00000000
    Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
    Control: 10c5387f  Table: 80004019  DAC: 00000017
    Process swapper (pid: 1, stack limit = 0xcfc2a2e8)
    Stack: (0xcfc2bf10 to 0xcfc2c000)
    bf00:                                     c0372cf8 c027225c 00000000 c0a69678
    bf20: cfc3e508 c0500898 c0378560 c0378560 c0500898 cfcac8c0 c04fc280 c017d4f4
    bf40: c0378560 c017c63c c0378560 c0378594 c0500898 cfcac8c0 c04fc280 c017c754
    bf60: 00000000 c017c6f4 c0500898 c017beac cfc16a5c cfc3fd94 c0023448 c0500898
    bf80: c0500898 c017b7d4 c032dc7f 00000093 cfc28d40 c0023448 00000000 c0500898
    bfa0: 00000000 00000000 00000000 c017ca48 c0023448 00000000 c001d274 00000000
    bfc0: 00000000 c002b344 00000031 00000000 00000000 00000192 00000000 c0023448
    bfe0: 00000000 00000000 00000000 c0008578 00000000 c002c304 ffdfffff ffffffff
    [&lt;c01cd2c4&gt;] (omap_i2c_unidle+0x44/0x138) from [&lt;c027225c&gt;] (omap_i2c_probe+0x1a4/0x398)
    [&lt;c027225c&gt;] (omap_i2c_probe+0x1a4/0x398) from [&lt;c017d4f4&gt;] (platform_drv_probe+0x18/0x1c)
    [&lt;c017d4f4&gt;] (platform_drv_probe+0x18/0x1c) from [&lt;c017c63c&gt;] (driver_probe_device+0xc0/0x178)
    [&lt;c017c63c&gt;] (driver_probe_device+0xc0/0x178) from [&lt;c017c754&gt;] (__driver_attach+0x60/0x84)
    [&lt;c017c754&gt;] (__driver_attach+0x60/0x84) from [&lt;c017beac&gt;] (bus_for_each_dev+0x44/0x74)
    [&lt;c017beac&gt;] (bus_for_each_dev+0x44/0x74) from [&lt;c017b7d4&gt;] (bus_add_driver+0x9c/0x218)
    [&lt;c017b7d4&gt;] (bus_add_driver+0x9c/0x218) from [&lt;c017ca48&gt;] (driver_register+0xa8/0x130)
    [&lt;c017ca48&gt;] (driver_register+0xa8/0x130) from [&lt;c002b344&gt;] (do_one_initcall+0x5c/0x1b8)
    [&lt;c002b344&gt;] (do_one_initcall+0x5c/0x1b8) from [&lt;c0008578&gt;] (kernel_init+0x90/0x144)
    [&lt;c0008578&gt;] (kernel_init+0x90/0x144) from [&lt;c002c304&gt;] (kernel_thread_exit+0x0/0x8)
    Code: e5942004 e3a0c009 e1a0331c e3a01000 (e18210b3)
    ---[ end trace 1b75b31a2719ed1c ]---

This patch moves register shift setting before any register accesses are done.

Signed-off-by: Mika Westerberg &lt;ext-mika.1.westerberg@nokia.com&gt;
Cc: Cory Maccarrone &lt;darkstar6262@gmail.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit d84d3ea317ce0db89ce0903b4037f800c5d4c477 added register shift to allow
also 16-bit register access. However, omap_i2c_unidle() is called before these
are set which causes the following OOPS:

    Unhandled fault: alignment exception (0x801) at 0xfa070009
    Internal error: : 801 [#1]
    last sysfs file:
    Modules linked in:
    CPU: 0    Not tainted  (2.6.34-rc2-00052-gae6be51 #3)
    PC is at omap_i2c_unidle+0x44/0x138
    LR is at trace_hardirqs_on_caller+0x158/0x18c
    pc : [&lt;c01cd2c4&gt;]    lr : [&lt;c00743f8&gt;]    psr: 20000013
    sp : cfc2bf10  ip : 00000009  fp : 00000000
    r10: 00000000  r9 : 00000000  r8 : c0378560
    r7 : c0378b88  r6 : c0378558  r5 : cfcadc00  r4 : cfcadc00
    r3 : 00000009  r2 : fa070000  r1 : 00000000  r0 : 00000000
    Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
    Control: 10c5387f  Table: 80004019  DAC: 00000017
    Process swapper (pid: 1, stack limit = 0xcfc2a2e8)
    Stack: (0xcfc2bf10 to 0xcfc2c000)
    bf00:                                     c0372cf8 c027225c 00000000 c0a69678
    bf20: cfc3e508 c0500898 c0378560 c0378560 c0500898 cfcac8c0 c04fc280 c017d4f4
    bf40: c0378560 c017c63c c0378560 c0378594 c0500898 cfcac8c0 c04fc280 c017c754
    bf60: 00000000 c017c6f4 c0500898 c017beac cfc16a5c cfc3fd94 c0023448 c0500898
    bf80: c0500898 c017b7d4 c032dc7f 00000093 cfc28d40 c0023448 00000000 c0500898
    bfa0: 00000000 00000000 00000000 c017ca48 c0023448 00000000 c001d274 00000000
    bfc0: 00000000 c002b344 00000031 00000000 00000000 00000192 00000000 c0023448
    bfe0: 00000000 00000000 00000000 c0008578 00000000 c002c304 ffdfffff ffffffff
    [&lt;c01cd2c4&gt;] (omap_i2c_unidle+0x44/0x138) from [&lt;c027225c&gt;] (omap_i2c_probe+0x1a4/0x398)
    [&lt;c027225c&gt;] (omap_i2c_probe+0x1a4/0x398) from [&lt;c017d4f4&gt;] (platform_drv_probe+0x18/0x1c)
    [&lt;c017d4f4&gt;] (platform_drv_probe+0x18/0x1c) from [&lt;c017c63c&gt;] (driver_probe_device+0xc0/0x178)
    [&lt;c017c63c&gt;] (driver_probe_device+0xc0/0x178) from [&lt;c017c754&gt;] (__driver_attach+0x60/0x84)
    [&lt;c017c754&gt;] (__driver_attach+0x60/0x84) from [&lt;c017beac&gt;] (bus_for_each_dev+0x44/0x74)
    [&lt;c017beac&gt;] (bus_for_each_dev+0x44/0x74) from [&lt;c017b7d4&gt;] (bus_add_driver+0x9c/0x218)
    [&lt;c017b7d4&gt;] (bus_add_driver+0x9c/0x218) from [&lt;c017ca48&gt;] (driver_register+0xa8/0x130)
    [&lt;c017ca48&gt;] (driver_register+0xa8/0x130) from [&lt;c002b344&gt;] (do_one_initcall+0x5c/0x1b8)
    [&lt;c002b344&gt;] (do_one_initcall+0x5c/0x1b8) from [&lt;c0008578&gt;] (kernel_init+0x90/0x144)
    [&lt;c0008578&gt;] (kernel_init+0x90/0x144) from [&lt;c002c304&gt;] (kernel_thread_exit+0x0/0x8)
    Code: e5942004 e3a0c009 e1a0331c e3a01000 (e18210b3)
    ---[ end trace 1b75b31a2719ed1c ]---

This patch moves register shift setting before any register accesses are done.

Signed-off-by: Mika Westerberg &lt;ext-mika.1.westerberg@nokia.com&gt;
Cc: Cory Maccarrone &lt;darkstar6262@gmail.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-imx: fix error handling</title>
<updated>2010-04-20T00:16:57+00:00</updated>
<author>
<name>Arnaud Patard</name>
<email>apatard@mandriva.com</email>
</author>
<published>2010-03-23T16:28:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=da9c99fc32e2d84f80672d192a7aaf7239057a2e'/>
<id>da9c99fc32e2d84f80672d192a7aaf7239057a2e</id>
<content type='text'>
- Return -ETIMEDOUT on bus busy error
- Fix timeout test "time_after(jiffies, orig_jiffies + HZ / 1000)" :
  By default, HZ=100 on arm. This means that this test has no chances to
  work and may result in a dead loop. Set timeout to 500ms.
- Don't try to send a new message if we failed to transmit
  previous one. This was preventing to recover from error on my system

Signed-off-by: Arnaud Patard &lt;apatard@mandriva.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Return -ETIMEDOUT on bus busy error
- Fix timeout test "time_after(jiffies, orig_jiffies + HZ / 1000)" :
  By default, HZ=100 on arm. This means that this test has no chances to
  work and may result in a dead loop. Set timeout to 500ms.
- Don't try to send a new message if we failed to transmit
  previous one. This was preventing to recover from error on my system

Signed-off-by: Arnaud Patard &lt;apatard@mandriva.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h</title>
<updated>2010-03-30T13:02:32+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-03-24T08:04:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5a0e3ad6af8660be21ca98a971cd00f331318c05'/>
<id>5a0e3ad6af8660be21ca98a971cd00f331318c05</id>
<content type='text'>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -&gt; slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Guess-its-ok-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Lee Schermerhorn &lt;Lee.Schermerhorn@hp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -&gt; slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Guess-its-ok-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Lee Schermerhorn &lt;Lee.Schermerhorn@hp.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
