<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/clk/berlin, branch master</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>Convert 'alloc_flex' family to use the new default GFP_KERNEL argument</title>
<updated>2026-02-22T01:09:51+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-02-22T01:06:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=323bbfcf1ef8836d0d2ad9e2c1f1c684f0e3b5b3'/>
<id>323bbfcf1ef8836d0d2ad9e2c1f1c684f0e3b5b3</id>
<content type='text'>
This is the exact same thing as the 'alloc_obj()' version, only much
smaller because there are a lot fewer users of the *alloc_flex()
interface.

As with alloc_obj() version, this was done entirely with mindless brute
force, using the same script, except using 'flex' in the pattern rather
than 'objs*'.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the exact same thing as the 'alloc_obj()' version, only much
smaller because there are a lot fewer users of the *alloc_flex()
interface.

As with alloc_obj() version, this was done entirely with mindless brute
force, using the same script, except using 'flex' in the pattern rather
than 'objs*'.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert 'alloc_obj' family to use the new default GFP_KERNEL argument</title>
<updated>2026-02-22T01:09:51+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-02-22T00:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43'/>
<id>bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43</id>
<content type='text'>
This was done entirely with mindless brute force, using

    git grep -l '\&lt;k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was done entirely with mindless brute force, using

    git grep -l '\&lt;k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: Replace kmalloc with kmalloc_obj for non-scalar types</title>
<updated>2026-02-21T09:02:28+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2026-02-21T07:49:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=69050f8d6d075dc01af7a5f2f550a8067510366f'/>
<id>69050f8d6d075dc01af7a5f2f550a8067510366f</id>
<content type='text'>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clk: Fix typos</title>
<updated>2025-07-27T06:49:18+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2025-07-23T20:38:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=264200cc3a87d5c53bfa817227624fa2bae6b2c3'/>
<id>264200cc3a87d5c53bfa817227624fa2bae6b2c3</id>
<content type='text'>
Fix typos, mostly in comments except CLKGATE_SEPERATED_* (definition and
uses updated).

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/r/20250723203819.2910289-1-helgaas@kernel.org
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix typos, mostly in comments except CLKGATE_SEPERATED_* (definition and
uses updated).

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/r/20250723203819.2910289-1-helgaas@kernel.org
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clk: berlin: div: Add a determine_rate hook</title>
<updated>2023-06-09T01:39:26+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2023-05-05T11:25:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=321437f33e6409e0303a4e894bca6fddf66f3a90'/>
<id>321437f33e6409e0303a4e894bca6fddf66f3a90</id>
<content type='text'>
The Berlin2 divider clock implements a mux with a set_parent hook, but
doesn't provide a determine_rate implementation.

This is a bit odd, since set_parent() is there to, as its name implies,
change the parent of a clock. However, the most likely candidates to
trigger that parent change are either the assigned-clock-parents device
tree property or a call to clk_set_rate(), with determine_rate()
figuring out which parent is the best suited for a given rate.

The other trigger would be a call to clk_set_parent(), but it's far less
used, and it doesn't look like there's any obvious user for that clock.

Similarly, it doesn't look like the device tree using that clock driver
uses any of the assigned-clock properties on that clock.

So, the set_parent hook is effectively unused, possibly because of an
oversight. However, it could also be an explicit decision by the
original author to avoid any reparenting but through an explicit call to
clk_set_parent().

The latter case would be equivalent to setting the determine_rate
implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
determine_rate implementation is provided, clk_round_rate() (through
clk_core_round_rate_nolock()) will call itself on the parent if
CLK_SET_RATE_PARENT is set, and will not change the clock rate
otherwise.

And if it was an oversight, then we are at least explicit about our
behavior now and it can be further refined down the line.

Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-11-971d5077e7d2@cerno.tech
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Berlin2 divider clock implements a mux with a set_parent hook, but
doesn't provide a determine_rate implementation.

This is a bit odd, since set_parent() is there to, as its name implies,
change the parent of a clock. However, the most likely candidates to
trigger that parent change are either the assigned-clock-parents device
tree property or a call to clk_set_rate(), with determine_rate()
figuring out which parent is the best suited for a given rate.

The other trigger would be a call to clk_set_parent(), but it's far less
used, and it doesn't look like there's any obvious user for that clock.

Similarly, it doesn't look like the device tree using that clock driver
uses any of the assigned-clock properties on that clock.

So, the set_parent hook is effectively unused, possibly because of an
oversight. However, it could also be an explicit decision by the
original author to avoid any reparenting but through an explicit call to
clk_set_parent().

The latter case would be equivalent to setting the determine_rate
implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
determine_rate implementation is provided, clk_round_rate() (through
clk_core_round_rate_nolock()) will call itself on the parent if
CLK_SET_RATE_PARENT is set, and will not change the clock rate
otherwise.

And if it was an oversight, then we are at least explicit about our
behavior now and it can be further refined down the line.

Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-11-971d5077e7d2@cerno.tech
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clk: berlin: Add of_node_put() for of_get_parent()</title>
<updated>2022-08-19T21:50:24+00:00</updated>
<author>
<name>Liang He</name>
<email>windhl@126.com</email>
</author>
<published>2022-07-08T08:49:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=37c381b812dcbfde9c3f1f3d3e75fdfc1b40d5bc'/>
<id>37c381b812dcbfde9c3f1f3d3e75fdfc1b40d5bc</id>
<content type='text'>
In berlin2_clock_setup() and berlin2q_clock_setup(), we need to
call of_node_put() for the reference returned by of_get_parent()
which has increased the refcount. We should call *_put() in fail
path or when it is not used anymore.

Fixes: 26b3b6b959b2 ("clk: berlin: prepare simple-mfd conversion")
Signed-off-by: Liang He &lt;windhl@126.com&gt;
Link: https://lore.kernel.org/r/20220708084900.311684-1-windhl@126.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In berlin2_clock_setup() and berlin2q_clock_setup(), we need to
call of_node_put() for the reference returned by of_get_parent()
which has increased the refcount. We should call *_put() in fail
path or when it is not used anymore.

Fixes: 26b3b6b959b2 ("clk: berlin: prepare simple-mfd conversion")
Signed-off-by: Liang He &lt;windhl@126.com&gt;
Link: https://lore.kernel.org/r/20220708084900.311684-1-windhl@126.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: Add SPDX license identifier - Makefile/Kconfig</title>
<updated>2019-05-21T08:50:46+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-19T12:07:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ec8f24b7faaf3d4799a7c3f4c1b87f6b02778ad1'/>
<id>ec8f24b7faaf3d4799a7c3f4c1b87f6b02778ad1</id>
<content type='text'>
Add SPDX license identifiers to all Make/Kconfig files which:

 - Have no license information of any form

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add SPDX license identifiers to all Make/Kconfig files which:

 - Have no license information of any form

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clk: Remove io.h from clk-provider.h</title>
<updated>2019-05-15T20:21:37+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>sboyd@kernel.org</email>
</author>
<published>2019-04-18T22:20:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=62e59c4e69b3cdbad67e3c2d49e4df4cfe1679e3'/>
<id>62e59c4e69b3cdbad67e3c2d49e4df4cfe1679e3</id>
<content type='text'>
Now that we've gotten rid of clk_readl() we can remove io.h from the
clk-provider header and push out the io.h include to any code that isn't
already including the io.h header but using things like readl/writel,
etc.

Found with this grep:

  git grep -l clk-provider.h | grep '.c$' | xargs git grep -L 'linux/io.h' | \
  	xargs git grep -l \
	-e '\&lt;__iowrite32_copy\&gt;' --or \
	-e '\&lt;__ioread32_copy\&gt;' --or \
	-e '\&lt;__iowrite64_copy\&gt;' --or \
	-e '\&lt;ioremap_page_range\&gt;' --or \
	-e '\&lt;ioremap_huge_init\&gt;' --or \
	-e '\&lt;arch_ioremap_pud_supported\&gt;' --or \
	-e '\&lt;arch_ioremap_pmd_supported\&gt;' --or \
	-e '\&lt;devm_ioport_map\&gt;' --or \
	-e '\&lt;devm_ioport_unmap\&gt;' --or \
	-e '\&lt;IOMEM_ERR_PTR\&gt;' --or \
	-e '\&lt;devm_ioremap\&gt;' --or \
	-e '\&lt;devm_ioremap_nocache\&gt;' --or \
	-e '\&lt;devm_ioremap_wc\&gt;' --or \
	-e '\&lt;devm_iounmap\&gt;' --or \
	-e '\&lt;devm_ioremap_release\&gt;' --or \
	-e '\&lt;devm_memremap\&gt;' --or \
	-e '\&lt;devm_memunmap\&gt;' --or \
	-e '\&lt;__devm_memremap_pages\&gt;' --or \
	-e '\&lt;pci_remap_cfgspace\&gt;' --or \
	-e '\&lt;arch_has_dev_port\&gt;' --or \
	-e '\&lt;arch_phys_wc_add\&gt;' --or \
	-e '\&lt;arch_phys_wc_del\&gt;' --or \
	-e '\&lt;memremap\&gt;' --or \
	-e '\&lt;memunmap\&gt;' --or \
	-e '\&lt;arch_io_reserve_memtype_wc\&gt;' --or \
	-e '\&lt;arch_io_free_memtype_wc\&gt;' --or \
	-e '\&lt;__io_aw\&gt;' --or \
	-e '\&lt;__io_pbw\&gt;' --or \
	-e '\&lt;__io_paw\&gt;' --or \
	-e '\&lt;__io_pbr\&gt;' --or \
	-e '\&lt;__io_par\&gt;' --or \
	-e '\&lt;__raw_readb\&gt;' --or \
	-e '\&lt;__raw_readw\&gt;' --or \
	-e '\&lt;__raw_readl\&gt;' --or \
	-e '\&lt;__raw_readq\&gt;' --or \
	-e '\&lt;__raw_writeb\&gt;' --or \
	-e '\&lt;__raw_writew\&gt;' --or \
	-e '\&lt;__raw_writel\&gt;' --or \
	-e '\&lt;__raw_writeq\&gt;' --or \
	-e '\&lt;readb\&gt;' --or \
	-e '\&lt;readw\&gt;' --or \
	-e '\&lt;readl\&gt;' --or \
	-e '\&lt;readq\&gt;' --or \
	-e '\&lt;writeb\&gt;' --or \
	-e '\&lt;writew\&gt;' --or \
	-e '\&lt;writel\&gt;' --or \
	-e '\&lt;writeq\&gt;' --or \
	-e '\&lt;readb_relaxed\&gt;' --or \
	-e '\&lt;readw_relaxed\&gt;' --or \
	-e '\&lt;readl_relaxed\&gt;' --or \
	-e '\&lt;readq_relaxed\&gt;' --or \
	-e '\&lt;writeb_relaxed\&gt;' --or \
	-e '\&lt;writew_relaxed\&gt;' --or \
	-e '\&lt;writel_relaxed\&gt;' --or \
	-e '\&lt;writeq_relaxed\&gt;' --or \
	-e '\&lt;readsb\&gt;' --or \
	-e '\&lt;readsw\&gt;' --or \
	-e '\&lt;readsl\&gt;' --or \
	-e '\&lt;readsq\&gt;' --or \
	-e '\&lt;writesb\&gt;' --or \
	-e '\&lt;writesw\&gt;' --or \
	-e '\&lt;writesl\&gt;' --or \
	-e '\&lt;writesq\&gt;' --or \
	-e '\&lt;inb\&gt;' --or \
	-e '\&lt;inw\&gt;' --or \
	-e '\&lt;inl\&gt;' --or \
	-e '\&lt;outb\&gt;' --or \
	-e '\&lt;outw\&gt;' --or \
	-e '\&lt;outl\&gt;' --or \
	-e '\&lt;inb_p\&gt;' --or \
	-e '\&lt;inw_p\&gt;' --or \
	-e '\&lt;inl_p\&gt;' --or \
	-e '\&lt;outb_p\&gt;' --or \
	-e '\&lt;outw_p\&gt;' --or \
	-e '\&lt;outl_p\&gt;' --or \
	-e '\&lt;insb\&gt;' --or \
	-e '\&lt;insw\&gt;' --or \
	-e '\&lt;insl\&gt;' --or \
	-e '\&lt;outsb\&gt;' --or \
	-e '\&lt;outsw\&gt;' --or \
	-e '\&lt;outsl\&gt;' --or \
	-e '\&lt;insb_p\&gt;' --or \
	-e '\&lt;insw_p\&gt;' --or \
	-e '\&lt;insl_p\&gt;' --or \
	-e '\&lt;outsb_p\&gt;' --or \
	-e '\&lt;outsw_p\&gt;' --or \
	-e '\&lt;outsl_p\&gt;' --or \
	-e '\&lt;ioread8\&gt;' --or \
	-e '\&lt;ioread16\&gt;' --or \
	-e '\&lt;ioread32\&gt;' --or \
	-e '\&lt;ioread64\&gt;' --or \
	-e '\&lt;iowrite8\&gt;' --or \
	-e '\&lt;iowrite16\&gt;' --or \
	-e '\&lt;iowrite32\&gt;' --or \
	-e '\&lt;iowrite64\&gt;' --or \
	-e '\&lt;ioread16be\&gt;' --or \
	-e '\&lt;ioread32be\&gt;' --or \
	-e '\&lt;ioread64be\&gt;' --or \
	-e '\&lt;iowrite16be\&gt;' --or \
	-e '\&lt;iowrite32be\&gt;' --or \
	-e '\&lt;iowrite64be\&gt;' --or \
	-e '\&lt;ioread8_rep\&gt;' --or \
	-e '\&lt;ioread16_rep\&gt;' --or \
	-e '\&lt;ioread32_rep\&gt;' --or \
	-e '\&lt;ioread64_rep\&gt;' --or \
	-e '\&lt;iowrite8_rep\&gt;' --or \
	-e '\&lt;iowrite16_rep\&gt;' --or \
	-e '\&lt;iowrite32_rep\&gt;' --or \
	-e '\&lt;iowrite64_rep\&gt;' --or \
	-e '\&lt;__io_virt\&gt;' --or \
	-e '\&lt;pci_iounmap\&gt;' --or \
	-e '\&lt;virt_to_phys\&gt;' --or \
	-e '\&lt;phys_to_virt\&gt;' --or \
	-e '\&lt;ioremap_uc\&gt;' --or \
	-e '\&lt;ioremap\&gt;' --or \
	-e '\&lt;__ioremap\&gt;' --or \
	-e '\&lt;iounmap\&gt;' --or \
	-e '\&lt;ioremap\&gt;' --or \
	-e '\&lt;ioremap_nocache\&gt;' --or \
	-e '\&lt;ioremap_uc\&gt;' --or \
	-e '\&lt;ioremap_wc\&gt;' --or \
	-e '\&lt;ioremap_wc\&gt;' --or \
	-e '\&lt;ioremap_wt\&gt;' --or \
	-e '\&lt;ioport_map\&gt;' --or \
	-e '\&lt;ioport_unmap\&gt;' --or \
	-e '\&lt;ioport_map\&gt;' --or \
	-e '\&lt;ioport_unmap\&gt;' --or \
	-e '\&lt;xlate_dev_kmem_ptr\&gt;' --or \
	-e '\&lt;xlate_dev_mem_ptr\&gt;' --or \
	-e '\&lt;unxlate_dev_mem_ptr\&gt;' --or \
	-e '\&lt;virt_to_bus\&gt;' --or \
	-e '\&lt;bus_to_virt\&gt;' --or \
	-e '\&lt;memset_io\&gt;' --or \
	-e '\&lt;memcpy_fromio\&gt;' --or \
	-e '\&lt;memcpy_toio\&gt;'

I also reordered a couple includes when they weren't alphabetical and
removed clk.h from kona, replacing it with clk-provider.h because
that driver doesn't use clk consumer APIs.

Acked-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Cc: Chen-Yu Tsai &lt;wens@csie.org&gt;
Acked-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Acked-by: Tero Kristo &lt;t-kristo@ti.com&gt;
Acked-by: Sekhar Nori &lt;nsekhar@ti.com&gt;
Cc: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Acked-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Chris Zankel &lt;chris@zankel.net&gt;
Acked-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
Acked-by: John Crispin &lt;john@phrozen.org&gt;
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we've gotten rid of clk_readl() we can remove io.h from the
clk-provider header and push out the io.h include to any code that isn't
already including the io.h header but using things like readl/writel,
etc.

Found with this grep:

  git grep -l clk-provider.h | grep '.c$' | xargs git grep -L 'linux/io.h' | \
  	xargs git grep -l \
	-e '\&lt;__iowrite32_copy\&gt;' --or \
	-e '\&lt;__ioread32_copy\&gt;' --or \
	-e '\&lt;__iowrite64_copy\&gt;' --or \
	-e '\&lt;ioremap_page_range\&gt;' --or \
	-e '\&lt;ioremap_huge_init\&gt;' --or \
	-e '\&lt;arch_ioremap_pud_supported\&gt;' --or \
	-e '\&lt;arch_ioremap_pmd_supported\&gt;' --or \
	-e '\&lt;devm_ioport_map\&gt;' --or \
	-e '\&lt;devm_ioport_unmap\&gt;' --or \
	-e '\&lt;IOMEM_ERR_PTR\&gt;' --or \
	-e '\&lt;devm_ioremap\&gt;' --or \
	-e '\&lt;devm_ioremap_nocache\&gt;' --or \
	-e '\&lt;devm_ioremap_wc\&gt;' --or \
	-e '\&lt;devm_iounmap\&gt;' --or \
	-e '\&lt;devm_ioremap_release\&gt;' --or \
	-e '\&lt;devm_memremap\&gt;' --or \
	-e '\&lt;devm_memunmap\&gt;' --or \
	-e '\&lt;__devm_memremap_pages\&gt;' --or \
	-e '\&lt;pci_remap_cfgspace\&gt;' --or \
	-e '\&lt;arch_has_dev_port\&gt;' --or \
	-e '\&lt;arch_phys_wc_add\&gt;' --or \
	-e '\&lt;arch_phys_wc_del\&gt;' --or \
	-e '\&lt;memremap\&gt;' --or \
	-e '\&lt;memunmap\&gt;' --or \
	-e '\&lt;arch_io_reserve_memtype_wc\&gt;' --or \
	-e '\&lt;arch_io_free_memtype_wc\&gt;' --or \
	-e '\&lt;__io_aw\&gt;' --or \
	-e '\&lt;__io_pbw\&gt;' --or \
	-e '\&lt;__io_paw\&gt;' --or \
	-e '\&lt;__io_pbr\&gt;' --or \
	-e '\&lt;__io_par\&gt;' --or \
	-e '\&lt;__raw_readb\&gt;' --or \
	-e '\&lt;__raw_readw\&gt;' --or \
	-e '\&lt;__raw_readl\&gt;' --or \
	-e '\&lt;__raw_readq\&gt;' --or \
	-e '\&lt;__raw_writeb\&gt;' --or \
	-e '\&lt;__raw_writew\&gt;' --or \
	-e '\&lt;__raw_writel\&gt;' --or \
	-e '\&lt;__raw_writeq\&gt;' --or \
	-e '\&lt;readb\&gt;' --or \
	-e '\&lt;readw\&gt;' --or \
	-e '\&lt;readl\&gt;' --or \
	-e '\&lt;readq\&gt;' --or \
	-e '\&lt;writeb\&gt;' --or \
	-e '\&lt;writew\&gt;' --or \
	-e '\&lt;writel\&gt;' --or \
	-e '\&lt;writeq\&gt;' --or \
	-e '\&lt;readb_relaxed\&gt;' --or \
	-e '\&lt;readw_relaxed\&gt;' --or \
	-e '\&lt;readl_relaxed\&gt;' --or \
	-e '\&lt;readq_relaxed\&gt;' --or \
	-e '\&lt;writeb_relaxed\&gt;' --or \
	-e '\&lt;writew_relaxed\&gt;' --or \
	-e '\&lt;writel_relaxed\&gt;' --or \
	-e '\&lt;writeq_relaxed\&gt;' --or \
	-e '\&lt;readsb\&gt;' --or \
	-e '\&lt;readsw\&gt;' --or \
	-e '\&lt;readsl\&gt;' --or \
	-e '\&lt;readsq\&gt;' --or \
	-e '\&lt;writesb\&gt;' --or \
	-e '\&lt;writesw\&gt;' --or \
	-e '\&lt;writesl\&gt;' --or \
	-e '\&lt;writesq\&gt;' --or \
	-e '\&lt;inb\&gt;' --or \
	-e '\&lt;inw\&gt;' --or \
	-e '\&lt;inl\&gt;' --or \
	-e '\&lt;outb\&gt;' --or \
	-e '\&lt;outw\&gt;' --or \
	-e '\&lt;outl\&gt;' --or \
	-e '\&lt;inb_p\&gt;' --or \
	-e '\&lt;inw_p\&gt;' --or \
	-e '\&lt;inl_p\&gt;' --or \
	-e '\&lt;outb_p\&gt;' --or \
	-e '\&lt;outw_p\&gt;' --or \
	-e '\&lt;outl_p\&gt;' --or \
	-e '\&lt;insb\&gt;' --or \
	-e '\&lt;insw\&gt;' --or \
	-e '\&lt;insl\&gt;' --or \
	-e '\&lt;outsb\&gt;' --or \
	-e '\&lt;outsw\&gt;' --or \
	-e '\&lt;outsl\&gt;' --or \
	-e '\&lt;insb_p\&gt;' --or \
	-e '\&lt;insw_p\&gt;' --or \
	-e '\&lt;insl_p\&gt;' --or \
	-e '\&lt;outsb_p\&gt;' --or \
	-e '\&lt;outsw_p\&gt;' --or \
	-e '\&lt;outsl_p\&gt;' --or \
	-e '\&lt;ioread8\&gt;' --or \
	-e '\&lt;ioread16\&gt;' --or \
	-e '\&lt;ioread32\&gt;' --or \
	-e '\&lt;ioread64\&gt;' --or \
	-e '\&lt;iowrite8\&gt;' --or \
	-e '\&lt;iowrite16\&gt;' --or \
	-e '\&lt;iowrite32\&gt;' --or \
	-e '\&lt;iowrite64\&gt;' --or \
	-e '\&lt;ioread16be\&gt;' --or \
	-e '\&lt;ioread32be\&gt;' --or \
	-e '\&lt;ioread64be\&gt;' --or \
	-e '\&lt;iowrite16be\&gt;' --or \
	-e '\&lt;iowrite32be\&gt;' --or \
	-e '\&lt;iowrite64be\&gt;' --or \
	-e '\&lt;ioread8_rep\&gt;' --or \
	-e '\&lt;ioread16_rep\&gt;' --or \
	-e '\&lt;ioread32_rep\&gt;' --or \
	-e '\&lt;ioread64_rep\&gt;' --or \
	-e '\&lt;iowrite8_rep\&gt;' --or \
	-e '\&lt;iowrite16_rep\&gt;' --or \
	-e '\&lt;iowrite32_rep\&gt;' --or \
	-e '\&lt;iowrite64_rep\&gt;' --or \
	-e '\&lt;__io_virt\&gt;' --or \
	-e '\&lt;pci_iounmap\&gt;' --or \
	-e '\&lt;virt_to_phys\&gt;' --or \
	-e '\&lt;phys_to_virt\&gt;' --or \
	-e '\&lt;ioremap_uc\&gt;' --or \
	-e '\&lt;ioremap\&gt;' --or \
	-e '\&lt;__ioremap\&gt;' --or \
	-e '\&lt;iounmap\&gt;' --or \
	-e '\&lt;ioremap\&gt;' --or \
	-e '\&lt;ioremap_nocache\&gt;' --or \
	-e '\&lt;ioremap_uc\&gt;' --or \
	-e '\&lt;ioremap_wc\&gt;' --or \
	-e '\&lt;ioremap_wc\&gt;' --or \
	-e '\&lt;ioremap_wt\&gt;' --or \
	-e '\&lt;ioport_map\&gt;' --or \
	-e '\&lt;ioport_unmap\&gt;' --or \
	-e '\&lt;ioport_map\&gt;' --or \
	-e '\&lt;ioport_unmap\&gt;' --or \
	-e '\&lt;xlate_dev_kmem_ptr\&gt;' --or \
	-e '\&lt;xlate_dev_mem_ptr\&gt;' --or \
	-e '\&lt;unxlate_dev_mem_ptr\&gt;' --or \
	-e '\&lt;virt_to_bus\&gt;' --or \
	-e '\&lt;bus_to_virt\&gt;' --or \
	-e '\&lt;memset_io\&gt;' --or \
	-e '\&lt;memcpy_fromio\&gt;' --or \
	-e '\&lt;memcpy_toio\&gt;'

I also reordered a couple includes when they weren't alphabetical and
removed clk.h from kona, replacing it with clk-provider.h because
that driver doesn't use clk consumer APIs.

Acked-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Cc: Chen-Yu Tsai &lt;wens@csie.org&gt;
Acked-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Acked-by: Tero Kristo &lt;t-kristo@ti.com&gt;
Acked-by: Sekhar Nori &lt;nsekhar@ti.com&gt;
Cc: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Acked-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Chris Zankel &lt;chris@zankel.net&gt;
Acked-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
Acked-by: John Crispin &lt;john@phrozen.org&gt;
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux</title>
<updated>2018-06-09T19:06:24+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2018-06-09T19:06:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6419945e3313fd894af79caefca6823d4511133f'/>
<id>6419945e3313fd894af79caefca6823d4511133f</id>
<content type='text'>
Pull clk updates from Stephen Boyd:
 "This time we have a good set of changes to the core framework that do
  some general cleanups, but nothing too major. The majority of the diff
  goes to two SoCs, Actions Semi and Qualcomm. A brand new driver is
  introduced for Actions Semi so it takes up some lines to add all the
  different types, and the Qualcomm diff is there because we add support
  for two SoCs and it's quite a bit of data.

  Otherwise the big driver updates are on TI Davinci and Amlogic
  platforms. And then the long tail of driver updates for various fixes
  and stuff follows after that.

  Core:
   - debugfs cleanups removing error checking and an unused provider API
   - Removal of a clk init typedef that isn't used
   - Usage of match_string() to simplify parent string name matching
   - OF clk helpers moved to their own file (linux/of_clk.h)
   - Make clk warnings more readable across kernel versions

  New Drivers:
   - Qualcomm SDM845 GCC and Video clk controllers
   - Qualcomm MSM8998 GCC
   - Actions Semi S900 SoC support
   - Nuvoton npcm750 microcontroller clks
   - Amlogic axg AO clock controller

  Removed Drivers:
   - Deprecated Rockchip clk-gate driver

  Updates:
   - debugfs functions stopped checking return values
   - Support for the MSIOF module clocks on Rensas R-Car M3-N
   - Support for the new Rensas RZ/G1C and R-Car E3 SoCs
   - Qualcomm GDSC, RCG, and PLL updates for clk changes in new SoCs
   - Berlin and Amlogic SPDX tagging
   - Usage of of_clk_get_parent_count() in more places
   - Proper implementation of the CDEV1/2 clocks on Tegra20
   - Allwinner H6 PRCM clock support and R40 EMAC support
   - Add critical flag to meson8b's fdiv2 as temporary fixup for ethernet
   - Round closest support for meson's mpll driver
   - Support for meson8b nand clocks and gxbb video decoder clocks
   - Mediatek mali clks
   - STM32MP1 fixes
   - Uniphier LD11/LD20 stream demux system clock"

* tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (134 commits)
  clk: qcom: Export clk_fabia_pll_configure()
  clk: bcm: Update and add Stingray clock entries
  dt-bindings: clk: Update Stingray binding doc
  clk-si544: Properly round requested frequency to nearest match
  clk: ingenic: jz4770: Add 150us delay after enabling VPU clock
  clk: ingenic: jz4770: Enable power of AHB1 bus after ungating VPU clock
  clk: ingenic: jz4770: Modify C1CLK clock to disable CPU clock stop on idle
  clk: ingenic: jz4770: Change OTG from custom to standard gated clock
  clk: ingenic: Support specifying "wait for clock stable" delay
  clk: ingenic: Add support for clocks whose gate bit is inverted
  clk: use match_string() helper
  clk: bcm2835: use match_string() helper
  clk: Return void from debug_init op
  clk: remove clk_debugfs_add_file()
  clk: tegra: no need to check return value of debugfs_create functions
  clk: davinci: no need to check return value of debugfs_create functions
  clk: bcm2835: no need to check return value of debugfs_create functions
  clk: no need to check return value of debugfs_create functions
  clk: imx6: add EPIT clock support
  clk: mvebu: use correct bit for 98DX3236 NAND
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull clk updates from Stephen Boyd:
 "This time we have a good set of changes to the core framework that do
  some general cleanups, but nothing too major. The majority of the diff
  goes to two SoCs, Actions Semi and Qualcomm. A brand new driver is
  introduced for Actions Semi so it takes up some lines to add all the
  different types, and the Qualcomm diff is there because we add support
  for two SoCs and it's quite a bit of data.

  Otherwise the big driver updates are on TI Davinci and Amlogic
  platforms. And then the long tail of driver updates for various fixes
  and stuff follows after that.

  Core:
   - debugfs cleanups removing error checking and an unused provider API
   - Removal of a clk init typedef that isn't used
   - Usage of match_string() to simplify parent string name matching
   - OF clk helpers moved to their own file (linux/of_clk.h)
   - Make clk warnings more readable across kernel versions

  New Drivers:
   - Qualcomm SDM845 GCC and Video clk controllers
   - Qualcomm MSM8998 GCC
   - Actions Semi S900 SoC support
   - Nuvoton npcm750 microcontroller clks
   - Amlogic axg AO clock controller

  Removed Drivers:
   - Deprecated Rockchip clk-gate driver

  Updates:
   - debugfs functions stopped checking return values
   - Support for the MSIOF module clocks on Rensas R-Car M3-N
   - Support for the new Rensas RZ/G1C and R-Car E3 SoCs
   - Qualcomm GDSC, RCG, and PLL updates for clk changes in new SoCs
   - Berlin and Amlogic SPDX tagging
   - Usage of of_clk_get_parent_count() in more places
   - Proper implementation of the CDEV1/2 clocks on Tegra20
   - Allwinner H6 PRCM clock support and R40 EMAC support
   - Add critical flag to meson8b's fdiv2 as temporary fixup for ethernet
   - Round closest support for meson's mpll driver
   - Support for meson8b nand clocks and gxbb video decoder clocks
   - Mediatek mali clks
   - STM32MP1 fixes
   - Uniphier LD11/LD20 stream demux system clock"

* tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (134 commits)
  clk: qcom: Export clk_fabia_pll_configure()
  clk: bcm: Update and add Stingray clock entries
  dt-bindings: clk: Update Stingray binding doc
  clk-si544: Properly round requested frequency to nearest match
  clk: ingenic: jz4770: Add 150us delay after enabling VPU clock
  clk: ingenic: jz4770: Enable power of AHB1 bus after ungating VPU clock
  clk: ingenic: jz4770: Modify C1CLK clock to disable CPU clock stop on idle
  clk: ingenic: jz4770: Change OTG from custom to standard gated clock
  clk: ingenic: Support specifying "wait for clock stable" delay
  clk: ingenic: Add support for clocks whose gate bit is inverted
  clk: use match_string() helper
  clk: bcm2835: use match_string() helper
  clk: Return void from debug_init op
  clk: remove clk_debugfs_add_file()
  clk: tegra: no need to check return value of debugfs_create functions
  clk: davinci: no need to check return value of debugfs_create functions
  clk: bcm2835: no need to check return value of debugfs_create functions
  clk: no need to check return value of debugfs_create functions
  clk: imx6: add EPIT clock support
  clk: mvebu: use correct bit for 98DX3236 NAND
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: Use struct_size() for kmalloc()-family</title>
<updated>2018-06-06T18:15:43+00:00</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2018-05-08T20:45:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=acafe7e30216166a17e6e226aadc3ecb63993242'/>
<id>acafe7e30216166a17e6e226aadc3ecb63993242</id>
<content type='text'>
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:

struct foo {
    int stuff;
    void *entry[];
};

instance = kmalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:

instance = kmalloc(struct_size(instance, entry, count), GFP_KERNEL);

This patch makes the changes for kmalloc()-family (and kvmalloc()-family)
uses. It was done via automatic conversion with manual review for the
"CHECKME" non-standard cases noted below, using the following Coccinelle
script:

// pkey_cache = kmalloc(sizeof *pkey_cache + tprops-&gt;pkey_tbl_len *
//                      sizeof *pkey_cache-&gt;table, GFP_KERNEL);
@@
identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
expression GFP;
identifier VAR, ELEMENT;
expression COUNT;
@@

- alloc(sizeof(*VAR) + COUNT * sizeof(*VAR-&gt;ELEMENT), GFP)
+ alloc(struct_size(VAR, ELEMENT, COUNT), GFP)

// mr = kzalloc(sizeof(*mr) + m * sizeof(mr-&gt;map[0]), GFP_KERNEL);
@@
identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
expression GFP;
identifier VAR, ELEMENT;
expression COUNT;
@@

- alloc(sizeof(*VAR) + COUNT * sizeof(VAR-&gt;ELEMENT[0]), GFP)
+ alloc(struct_size(VAR, ELEMENT, COUNT), GFP)

// Same pattern, but can't trivially locate the trailing element name,
// or variable name.
@@
identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
expression GFP;
expression SOMETHING, COUNT, ELEMENT;
@@

- alloc(sizeof(SOMETHING) + COUNT * sizeof(ELEMENT), GFP)
+ alloc(CHECKME_struct_size(&amp;SOMETHING, ELEMENT, COUNT), GFP)

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:

struct foo {
    int stuff;
    void *entry[];
};

instance = kmalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:

instance = kmalloc(struct_size(instance, entry, count), GFP_KERNEL);

This patch makes the changes for kmalloc()-family (and kvmalloc()-family)
uses. It was done via automatic conversion with manual review for the
"CHECKME" non-standard cases noted below, using the following Coccinelle
script:

// pkey_cache = kmalloc(sizeof *pkey_cache + tprops-&gt;pkey_tbl_len *
//                      sizeof *pkey_cache-&gt;table, GFP_KERNEL);
@@
identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
expression GFP;
identifier VAR, ELEMENT;
expression COUNT;
@@

- alloc(sizeof(*VAR) + COUNT * sizeof(*VAR-&gt;ELEMENT), GFP)
+ alloc(struct_size(VAR, ELEMENT, COUNT), GFP)

// mr = kzalloc(sizeof(*mr) + m * sizeof(mr-&gt;map[0]), GFP_KERNEL);
@@
identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
expression GFP;
identifier VAR, ELEMENT;
expression COUNT;
@@

- alloc(sizeof(*VAR) + COUNT * sizeof(VAR-&gt;ELEMENT[0]), GFP)
+ alloc(struct_size(VAR, ELEMENT, COUNT), GFP)

// Same pattern, but can't trivially locate the trailing element name,
// or variable name.
@@
identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
expression GFP;
expression SOMETHING, COUNT, ELEMENT;
@@

- alloc(sizeof(SOMETHING) + COUNT * sizeof(ELEMENT), GFP)
+ alloc(CHECKME_struct_size(&amp;SOMETHING, ELEMENT, COUNT), GFP)

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
