<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/drivers/staging/iio/frequency, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>https://git.kobert.dev/pm24.git/atom/drivers/staging/iio/frequency?h=master</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom/drivers/staging/iio/frequency?h=master'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2024-10-24T17:30:47Z</updated>
<entry>
<title>staging: iio: frequency: ad9832: fix division by zero in ad9832_calc_freqreg()</title>
<updated>2024-10-24T17:30:47Z</updated>
<author>
<name>Zicheng Qu</name>
<email>quzicheng@huawei.com</email>
</author>
<published>2024-10-22T13:43:54Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=6bd301819f8f69331a55ae2336c8b111fc933f3d'/>
<id>urn:sha1:6bd301819f8f69331a55ae2336c8b111fc933f3d</id>
<content type='text'>
In the ad9832_write_frequency() function, clk_get_rate() might return 0.
This can lead to a division by zero when calling ad9832_calc_freqreg().
The check if (fout &gt; (clk_get_rate(st-&gt;mclk) / 2)) does not protect
against the case when fout is 0. The ad9832_write_frequency() function
is called from ad9832_write(), and fout is derived from a text buffer,
which can contain any value.

Link: https://lore.kernel.org/all/2024100904-CVE-2024-47663-9bdc@gregkh/
Fixes: ea707584bac1 ("Staging: IIO: DDS: AD9832 / AD9835 driver")
Cc: stable@vger.kernel.org
Signed-off-by: Zicheng Qu &lt;quzicheng@huawei.com&gt;
Reviewed-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Reviewed-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Link: https://patch.msgid.link/20241022134354.574614-1-quzicheng@huawei.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>staging: iio: frequency: ad9834: Validate frequency parameter value</title>
<updated>2024-07-29T19:31:23Z</updated>
<author>
<name>Aleksandr Mishin</name>
<email>amishin@t-argos.ru</email>
</author>
<published>2024-07-03T15:45:06Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=b48aa991758999d4e8f9296c5bbe388f293ef465'/>
<id>urn:sha1:b48aa991758999d4e8f9296c5bbe388f293ef465</id>
<content type='text'>
In ad9834_write_frequency() clk_get_rate() can return 0. In such case
ad9834_calc_freqreg() call will lead to division by zero. Checking
'if (fout &gt; (clk_freq / 2))' doesn't protect in case of 'fout' is 0.
ad9834_write_frequency() is called from ad9834_write(), where fout is
taken from text buffer, which can contain any value.

Modify parameters checking.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 12b9d5bf76bf ("Staging: IIO: DDS: AD9833 / AD9834 driver")
Suggested-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Signed-off-by: Aleksandr Mishin &lt;amishin@t-argos.ru&gt;
Reviewed-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Link: https://patch.msgid.link/20240703154506.25584-1-amishin@t-argos.ru
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>staging: iio: Use devm_clk_get_enabled() helper function</title>
<updated>2023-09-11T19:12:40Z</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-08-25T09:56:12Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=5ff46635e4c51a2aeafb50a06c36bfdd0cda4203'/>
<id>urn:sha1:5ff46635e4c51a2aeafb50a06c36bfdd0cda4203</id>
<content type='text'>
The devm_clk_get_enabled() helper:
    - calls devm_clk_get()
    - calls clk_prepare_enable() and registers what is needed in order to
      call clk_disable_unprepare() when needed, as a managed resource.

This simplifies the code and avoids the need of a dedicated function used
with devm_add_action_or_reset().

Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Link: https://lore.kernel.org/r/20230825095612.2972892-1-ruanjinjie@huawei.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>staging: iio: frequency: ad9834: merge unnecessary split lines</title>
<updated>2022-10-20T15:07:47Z</updated>
<author>
<name>Deepak R Varma</name>
<email>drv@mailo.com</email>
</author>
<published>2022-10-17T06:32:30Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=fd22186003a98daaab1ea08aaa177c041fdaa649'/>
<id>urn:sha1:fd22186003a98daaab1ea08aaa177c041fdaa649</id>
<content type='text'>
Improve code readability by merging unnecessary split lines that are
well within the code-style guidelines post merge.

Signed-off-by: Deepak R Varma &lt;drv@mailo.com&gt;
Acked-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
Link: https://lore.kernel.org/r/Y0z2/qFe3kW96MTs@debian-BULLSEYE-live-builder-AMD64
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: iio: frequency: ad9832: Fix alignment for DMA safety</title>
<updated>2022-08-20T11:54:43Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2022-08-13T16:06:00Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=83856aaab45da0fd34f94aac0371ba80668c1dbc'/>
<id>urn:sha1:83856aaab45da0fd34f94aac0371ba80668c1dbc</id>
<content type='text'>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1.  Switch to the updated
IIO_DMA_MINALIGN definition.  Whilst here, move the marking to cover
the whole union. That has no functional affect, but makes it slightly
easier to see what is going on.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20220813160600.1157169-1-jic23@kernel.org
</content>
</entry>
<entry>
<title>staging: iio: frequency: ad9834: Fix alignment for DMA safety</title>
<updated>2022-08-15T21:30:01Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2022-08-07T15:12:16Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=e48668a38bf420c660b07851985e6922fcf4b194'/>
<id>urn:sha1:e48668a38bf420c660b07851985e6922fcf4b194</id>
<content type='text'>
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1.  Switch to the updated
IIO_DMA_MINALIGN definition.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20220807151218.656881-3-jic23@kernel.org
</content>
</entry>
<entry>
<title>staging: iio: ad9832: convert probe to device-managed</title>
<updated>2021-10-17T10:05:54Z</updated>
<author>
<name>Alexandru Ardelean</name>
<email>aardelean@deviqon.com</email>
</author>
<published>2021-09-13T11:52:09Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=96788444302658c6bf8224a811741b81611972fa'/>
<id>urn:sha1:96788444302658c6bf8224a811741b81611972fa</id>
<content type='text'>
This change does a conversion of the driver to use device-managed init
functions. The 2 regulators and the clock inits are converted to use
devm_add_action_or_reset() callbacks for de-initializing them when the
driver unloads.

And finally the devm_iio_device_register() function can be use to register
the device.

The remove hook can finally be removed and the spi_set_drvdata() call can
also be removed as the private data is no longer used.

Signed-off-by: Alexandru Ardelean &lt;aardelean@deviqon.com&gt;
Link: https://lore.kernel.org/r/20210913115209.300665-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>staging: iio: frequency: ad9834: Provide missing description for 'devid'</title>
<updated>2021-05-10T09:19:24Z</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2021-04-14T18:10:53Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=d57d7ac576394bd60024cc2354201f921cb498dc'/>
<id>urn:sha1:d57d7ac576394bd60024cc2354201f921cb498dc</id>
<content type='text'>
Also demote kernel-doc abuses

Fixes the following W=1 kernel build warning(s):

 drivers/staging/iio/frequency/ad9834.c:87: warning: Function parameter or member 'devid' not described in 'ad9834_state'
 drivers/staging/iio/frequency/ad9834.c:93: warning: cannot understand function prototype: 'enum ad9834_supported_device_ids '
 drivers/staging/iio/frequency/ad9834.c:320: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Cc: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Cc: Michael Hennerich &lt;Michael.Hennerich@analog.com&gt;
Cc: Jonathan Cameron &lt;jic23@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: linux-iio@vger.kernel.org
Cc: linux-staging@lists.linux.dev
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/20210414181129.1628598-22-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: iio: ad9832: kernel-doc fixes</title>
<updated>2021-03-25T19:13:52Z</updated>
<author>
<name>Mugilraj Dhavachelvan</name>
<email>dmugil2000@gmail.com</email>
</author>
<published>2021-03-15T13:37:11Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=e5b64caaad768f78668d0d8563b4f98c0f4d4b6a'/>
<id>urn:sha1:e5b64caaad768f78668d0d8563b4f98c0f4d4b6a</id>
<content type='text'>
Fixes a W=1 warning.
-Added ``:`` to lock parameter in 'ad9832_state' description.
-It's a reference comment so removed /**

Signed-off-by: Mugilraj Dhavachelvan &lt;dmugil2000@gmail.com&gt;
Link: https://lore.kernel.org/r/20210315133711.26860-1-dmugil2000@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>staging: iio: ad9834: convert to device-managed functions in probe</title>
<updated>2021-03-25T19:13:51Z</updated>
<author>
<name>Alexandru Ardelean</name>
<email>aardelean@deviqon.com</email>
</author>
<published>2021-03-10T09:51:31Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=b627e3b5f73b8decc3ebfe46d93b23ecf6f143ab'/>
<id>urn:sha1:b627e3b5f73b8decc3ebfe46d93b23ecf6f143ab</id>
<content type='text'>
This change converts the driver to use device-managed functions in the
probe function. For the clock and regulator disable, some
devm_add_action_or_reset() calls are required, and then
devm_iio_device_register() function can be used register the IIO device.

The final aim here would be for IIO to export only the device-managed
functions of it's API. That's a long way to go and this a small step in
that direction.

Signed-off-by: Alexandru Ardelean &lt;aardelean@deviqon.com&gt;
Link: https://lore.kernel.org/r/20210310095131.47476-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
