<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/drivers/hwspinlock, branch v4.18</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.kobert.dev/pm24.git/atom?h=v4.18</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom?h=v4.18'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2018-06-11T19:09:19Z</updated>
<entry>
<title>Merge tag 'hwlock-v4.18' of git://github.com/andersson/remoteproc</title>
<updated>2018-06-11T19:09:19Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2018-06-11T19:09:19Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=6f75edeadd0dd3d58017bc3bcdc2b80879a7cfd3'/>
<id>urn:sha1:6f75edeadd0dd3d58017bc3bcdc2b80879a7cfd3</id>
<content type='text'>
Pull hwspinlock updates from Bjorn Andersson:
 "In addition to migrating the files to use SPDX license headers this
  introduces the ability for clients to operate a hwlock without the
  framework taking any additional locks"

* tag 'hwlock-v4.18' of git://github.com/andersson/remoteproc:
  hwspinlock/u8500: Switch to SPDX license identifier
  hwspinlock: sprd: Switch to SPDX license identifier
  hwspinlock/sirf: Switch to SPDX license identifier
  hwspinlock: qcom: Switch to SPDX license identifier
  hwspinlock/omap: Switch to SPDX license identifier
  hwspinlock/core: Switch to SPDX license identifier
  hwspinlock: Introduce one new mode for hwspinlock
  hwspinlock: Convert to use 'switch' statement
</content>
</entry>
<entry>
<title>treewide: Use struct_size() for devm_kmalloc() and friends</title>
<updated>2018-06-06T18:15:43Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2018-05-08T23:08:53Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=0ed2dd03b94b7b7f66e23f25073b5385d0416589'/>
<id>urn:sha1:0ed2dd03b94b7b7f66e23f25073b5385d0416589</id>
<content type='text'>
Replaces open-coded struct size calculations with struct_size() for
devm_*, f2fs_*, and sock_* allocations. Automatically generated (and
manually adjusted) from the following Coccinelle script:

// Direct reference to struct field.
@@
identifier alloc =~ "devm_kmalloc|devm_kzalloc|sock_kmalloc|f2fs_kmalloc|f2fs_kzalloc";
expression HANDLE;
expression GFP;
identifier VAR, ELEMENT;
expression COUNT;
@@

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

// mr = kzalloc(sizeof(*mr) + m * sizeof(mr-&gt;map[0]), GFP_KERNEL);
@@
identifier alloc =~ "devm_kmalloc|devm_kzalloc|sock_kmalloc|f2fs_kmalloc|f2fs_kzalloc";
expression HANDLE;
expression GFP;
identifier VAR, ELEMENT;
expression COUNT;
@@

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

// Same pattern, but can't trivially locate the trailing element name,
// or variable name.
@@
identifier alloc =~ "devm_kmalloc|devm_kzalloc|sock_kmalloc|f2fs_kmalloc|f2fs_kzalloc";
expression HANDLE;
expression GFP;
expression SOMETHING, COUNT, ELEMENT;
@@

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

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>treewide: Use struct_size() for kmalloc()-family</title>
<updated>2018-06-06T18:15:43Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2018-05-08T20:45:50Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=acafe7e30216166a17e6e226aadc3ecb63993242'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>hwspinlock/u8500: Switch to SPDX license identifier</title>
<updated>2018-05-24T19:05:11Z</updated>
<author>
<name>Suman Anna</name>
<email>s-anna@ti.com</email>
</author>
<published>2018-05-11T17:03:20Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=e759176c7f6b6d84a31276e11d687f232f6e4ecf'/>
<id>urn:sha1:e759176c7f6b6d84a31276e11d687f232f6e4ecf</id>
<content type='text'>
Use the appropriate SPDX license identifier in the U8500 HWSEM
driver source file and drop the previous boilerplate license text.

Cc: Mathieu J. Poirier &lt;mathieu.poirier@linaro.org&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Suman Anna &lt;s-anna@ti.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
</content>
</entry>
<entry>
<title>hwspinlock: sprd: Switch to SPDX license identifier</title>
<updated>2018-05-24T19:04:48Z</updated>
<author>
<name>Suman Anna</name>
<email>s-anna@ti.com</email>
</author>
<published>2018-05-11T17:03:21Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=0c3e890b1ef31e0de2a6b35493c7f32d18588ab4'/>
<id>urn:sha1:0c3e890b1ef31e0de2a6b35493c7f32d18588ab4</id>
<content type='text'>
Use the appropriate SPDX license identifiers in the Spreadtrum hardware
spinlock driver source file and drop the previous boilerplate license text.

Cc: Baolin Wang &lt;baolin.wang@spreadtrum.com&gt;
Signed-off-by: Suman Anna &lt;s-anna@ti.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
</content>
</entry>
<entry>
<title>hwspinlock/sirf: Switch to SPDX license identifier</title>
<updated>2018-05-24T19:04:47Z</updated>
<author>
<name>Suman Anna</name>
<email>s-anna@ti.com</email>
</author>
<published>2018-05-11T17:03:19Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=50a522805ef00dbca3f84373dca9ca0d1e4b9752'/>
<id>urn:sha1:50a522805ef00dbca3f84373dca9ca0d1e4b9752</id>
<content type='text'>
Use the appropriate SPDX license identifier in the CSR's SIRF hardware
spinlock driver source file and drop the previous boilerplate license text.

Cc: Wei Chen &lt;wei.chen@csr.com&gt;
Cc: Barry Song &lt;baohua@kernel.org&gt;
Signed-off-by: Suman Anna &lt;s-anna@ti.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
</content>
</entry>
<entry>
<title>hwspinlock: qcom: Switch to SPDX license identifier</title>
<updated>2018-05-24T19:04:46Z</updated>
<author>
<name>Suman Anna</name>
<email>s-anna@ti.com</email>
</author>
<published>2018-05-11T17:03:18Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=8ba01caeec59a2f379aa94fcd133b417a3431bcb'/>
<id>urn:sha1:8ba01caeec59a2f379aa94fcd133b417a3431bcb</id>
<content type='text'>
Use the appropriate SPDX license identifier in the Qualcomm Hwspinlock
driver source file and drop the previous boilerplate license text.

Signed-off-by: Suman Anna &lt;s-anna@ti.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
</content>
</entry>
<entry>
<title>hwspinlock/omap: Switch to SPDX license identifier</title>
<updated>2018-05-24T19:04:43Z</updated>
<author>
<name>Suman Anna</name>
<email>s-anna@ti.com</email>
</author>
<published>2018-05-11T17:03:17Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=357ace03f0abceabd5fa7ec9fe7bcc1482c87e51'/>
<id>urn:sha1:357ace03f0abceabd5fa7ec9fe7bcc1482c87e51</id>
<content type='text'>
Use the appropriate SPDX license identifier in the OMAP hwspinlock
driver source file and drop the previous boilerplate license text.

Signed-off-by: Suman Anna &lt;s-anna@ti.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
</content>
</entry>
<entry>
<title>hwspinlock/core: Switch to SPDX license identifier</title>
<updated>2018-05-24T19:04:32Z</updated>
<author>
<name>Suman Anna</name>
<email>s-anna@ti.com</email>
</author>
<published>2018-05-11T17:03:16Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=eebba71e1cb4f3464645c4b106f8ccc31bc5cd11'/>
<id>urn:sha1:eebba71e1cb4f3464645c4b106f8ccc31bc5cd11</id>
<content type='text'>
Use the appropriate SPDX license identifier in the Hwspinlock core
driver source files and drop the previous boilerplate license text.

Signed-off-by: Suman Anna &lt;s-anna@ti.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
</content>
</entry>
<entry>
<title>hwspinlock: Introduce one new mode for hwspinlock</title>
<updated>2018-04-17T21:49:21Z</updated>
<author>
<name>Baolin Wang</name>
<email>baolin.wang@linaro.org</email>
</author>
<published>2018-04-08T03:06:57Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=1e6c06a7e88c251d8a30271ad5206fbd967a4576'/>
<id>urn:sha1:1e6c06a7e88c251d8a30271ad5206fbd967a4576</id>
<content type='text'>
In some scenarios, user need do some time-consuming or sleepable
operations under the hardware spinlock protection for synchronization
between the multiple subsystems.

For example, there is one PMIC efuse on Spreadtrum platform, which
need to be accessed under one hardware lock. But during the hardware
lock protection, the efuse operation is time-consuming to almost 5 ms,
so we can not disable the interrupts or preemption so long in this case.

Thus we can introduce one new mode to indicate that we just acquire the
hardware lock and do not disable interrupts or preemption, meanwhile we
should force user to protect the hardware lock with mutex or spinlock to
avoid dead-lock.

Signed-off-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
</content>
</entry>
</feed>
