Hi Olivier,
kernel test robot noticed the following build warnings:
[auto build test WARNING on d922ed738439e1d5b4701df7f4cdd49a09925624]
url: https://github.com/intel-lab-lkp/linux/commits/Olivier-Moysan/dt-bindings-i…
base: d922ed738439e1d5b4701df7f4cdd49a09925624
patch link: https://lore.kernel.org/r/20261118-upstream_mdf_v2-v2-8-7939d3c3720a%40foss…
patch subject: [PATCH v2 08/11] iio: adc: stm32-mdf: add dma buffered acquisition support
config: csky-allmodconfig (https://download.01.org/0day-ci/archive/20261121/202611210936.q9qVaCjc-lkp@…)
compiler: csky-linux-gcc (GCC) 16.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261121/202611210936.q9qVaCjc-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202611210936.q9qVaCjc-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/iio/adc/stm32-mdf-adc.c:1781:12: warning: 'stm32_mdf_adc_resume' defined but not used [-Wunused-function]
1781 | static int stm32_mdf_adc_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~
>> drivers/iio/adc/stm32-mdf-adc.c:1766:12: warning: 'stm32_mdf_adc_suspend' defined but not used [-Wunused-function]
1766 | static int stm32_mdf_adc_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~
vim +/stm32_mdf_adc_resume +1781 drivers/iio/adc/stm32-mdf-adc.c
1765
> 1766 static int stm32_mdf_adc_suspend(struct device *dev)
1767 {
1768 struct iio_dev *indio_dev = dev_get_drvdata(dev);
1769 struct stm32_mdf_adc *adc = iio_priv(indio_dev);
1770 int ret = 0;
1771
1772 if (iio_buffer_enabled(indio_dev))
1773 ret = stm32_mdf_adc_predisable(indio_dev);
1774
1775 regcache_cache_only(adc->regmap, true);
1776 regcache_mark_dirty(adc->regmap);
1777
1778 return ret;
1779 }
1780
> 1781 static int stm32_mdf_adc_resume(struct device *dev)
1782 {
1783 struct iio_dev *indio_dev = dev_get_drvdata(dev);
1784 struct stm32_mdf_adc *adc = iio_priv(indio_dev);
1785 int ret;
1786
1787 regcache_cache_only(adc->regmap, false);
1788 ret = regcache_sync(adc->regmap);
1789
1790 if (!ret && iio_buffer_enabled(indio_dev))
1791 ret = stm32_mdf_adc_postenable(indio_dev);
1792
1793 return ret;
1794 }
1795
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
On Fri, Nov 13, 2026 at 03:06:13PM +0800, Mengmeng Zhao wrote:
> From: Mengmeng Zhao <zhaomengmeng(a)kylinos.cn>
>
> This series adds dma-buf read/write support for ext4. The dma-buf direct
> I/O infrastructure allows dma-buf to be handed to file I/O as an iov_iter,
> but currently it only supports raw block devices. To better serve the
> GPU-NVMe direct access through normal filesystems, prior work for XFS has
> been discussed at [1]. We are also interested in this field and working on
> it [2].
Can you an Anuj please work together and merge this into a single
series covering both XFS and ext4?
On Mon, Nov 16, 2026 at 03:21:01PM +0100, Andreas Hindborg wrote:
For the fs and pid_namespace bits:
Acked-by: Christian Brauner <brauner(a)kernel.org>
On Fri, Nov 13, 2026 at 03:06:19PM +0800, Mengmeng Zhao wrote:
> From: Mengmeng Zhao <zhaomengmeng(a)kylinos.cn>
>
> Add a file mode bit for files that can be the target of dma-buf I/O and
> require it when a buffer is registered. Block device files set it when
> the backing disk supports dma-buf I/O, and filesystems can set it for
> inodes whose data can be reached without the page cache. The bit is
> coarse: a driver that installs ->init_dma_buf_io_ctx for every
> namespace, like nvme, still decides per device at registration.
>
> dma_buf_io_ctx_create() is the only caller of ->init_dma_buf_io_ctx, so
> the capability and the O_DIRECT requirement are checked there for every
> file type rather than in each helper; O_DIRECT belongs at registration
> because F_SETFL can change it afterwards. Add bdev_can_dmabuf_io() so
> the open-time and registration checks share one predicate.
>
> Signed-off-by: Mengmeng Zhao <zhaomengmeng(a)kylinos.cn>
> Signed-off-by: Li Wang <liwang(a)kylinos.cn>
> ---
> block/bdev.c | 8 ++++----
> block/fops.c | 2 +-
> drivers/dma-buf/dma-buf-io.c | 13 +++++++++----
> include/linux/blkdev.h | 7 ++++++-
> include/linux/fs.h | 8 +++++++-
> 5 files changed, 27 insertions(+), 11 deletions(-)
>
> diff --git a/block/bdev.c b/block/bdev.c
> index 88e3f552f5d4..4e7a7f7e1e8b 100644
> --- a/block/bdev.c
> +++ b/block/bdev.c
> @@ -61,14 +61,12 @@ struct block_device *file_bdev(struct file *bdev_file)
> }
> EXPORT_SYMBOL(file_bdev);
>
> -int bdev_init_dma_buf_io_ctx(struct file *file, struct block_device *bdev,
> +int bdev_init_dma_buf_io_ctx(struct block_device *bdev,
> struct dma_buf_io_ctx *ctx)
> {
> - if (!(file->f_flags & O_DIRECT))
> - return -EINVAL;
> if (ctx->dmabuf->size > UINT_MAX)
> return -EINVAL;
> - if (!bdev->bd_disk->fops->init_dma_buf_io_ctx)
> + if (!bdev_can_dmabuf_io(bdev))
> return -EOPNOTSUPP;
> return bdev->bd_disk->fops->init_dma_buf_io_ctx(bdev, ctx);
> }
> @@ -1041,6 +1039,8 @@ int bdev_open(struct block_device *bdev, blk_mode_t mode, void *holder,
>
> bdev_file->f_flags |= O_LARGEFILE;
> bdev_file->f_mode |= FMODE_CAN_ODIRECT;
> + if (bdev_can_dmabuf_io(bdev))
> + bdev_file->f_mode |= FMODE_CAN_DMABUF_IO;
> if (bdev_nowait(bdev))
> bdev_file->f_mode |= FMODE_NOWAIT;
> if (mode & BLK_OPEN_RESTRICT_WRITES)
> diff --git a/block/fops.c b/block/fops.c
> index 86bf1f298b79..7e5702e047a2 100644
> --- a/block/fops.c
> +++ b/block/fops.c
> @@ -1008,7 +1008,7 @@ static int blkdev_mmap_prepare(struct vm_area_desc *desc)
> static int blkdev_init_dma_buf_io_ctx(struct file *file,
> struct dma_buf_io_ctx *ctx)
> {
> - return bdev_init_dma_buf_io_ctx(file, file_bdev(file), ctx);
> + return bdev_init_dma_buf_io_ctx(file_bdev(file), ctx);
> }
>
> const struct file_operations def_blk_fops = {
> diff --git a/drivers/dma-buf/dma-buf-io.c b/drivers/dma-buf/dma-buf-io.c
> index 8440151de860..9575b7d65ec5 100644
> --- a/drivers/dma-buf/dma-buf-io.c
> +++ b/drivers/dma-buf/dma-buf-io.c
> @@ -152,9 +152,11 @@ static void dma_buf_io_ctx_shutdown(struct dma_buf_io_ctx *ctx)
> * @out_ctx: [out] resulting ctx
> *
> * Create a new I/O context from the given DMA buffer for the given file.
> - * It only works with files implementing ->init_dma_buf_io_ctx and fails
> - * with -EOPNOTSUPP otherwise. Once created, the user can create a map
> - * and use it to issue I/O, such as read/write requests, to @file.
> + * It only works with files implementing ->init_dma_buf_io_ctx,
> + * advertising FMODE_CAN_DMABUF_IO and currently opened for direct I/O,
> + * and fails with -EOPNOTSUPP or -EINVAL otherwise. Once created, the
> + * user can create a map and use it to issue I/O, such as read/write
> + * requests, to @file.
> */
> int dma_buf_io_ctx_create(struct file *file,
> struct dma_buf *dmabuf,
> @@ -164,8 +166,11 @@ int dma_buf_io_ctx_create(struct file *file,
> struct dma_buf_io_ctx *ctx;
> int ret;
>
> - if (!file->f_op->init_dma_buf_io_ctx)
> + if (!file->f_op->init_dma_buf_io_ctx ||
> + !(file->f_mode & FMODE_CAN_DMABUF_IO))
> return -EOPNOTSUPP;
> + if (!(file->f_flags & O_DIRECT))
> + return -EINVAL;
>
> ctx = kzalloc_obj(*ctx);
> if (!ctx)
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index b98f43478cc0..0cfb6fb6b4e2 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1610,9 +1610,14 @@ struct block_device_operations {
> int (*alternative_gpt_sector)(struct gendisk *disk, sector_t *sector);
> };
>
> -int bdev_init_dma_buf_io_ctx(struct file *file, struct block_device *bdev,
> +int bdev_init_dma_buf_io_ctx(struct block_device *bdev,
> struct dma_buf_io_ctx *ctx);
>
> +static inline bool bdev_can_dmabuf_io(struct block_device *bdev)
> +{
> + return !!bdev->bd_disk->fops->init_dma_buf_io_ctx;
> +}
> +
> #ifdef CONFIG_COMPAT
> extern int blkdev_compat_ptr_ioctl(struct block_device *, blk_mode_t,
> unsigned int, unsigned long);
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 99caef43ff3c..f5524fc770d4 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -121,7 +121,13 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
> /* File supports atomic writes */
> #define FMODE_CAN_ATOMIC_WRITE ((__force fmode_t)(1 << 7))
>
> -/* FMODE_* bit 8 */
> +/*
> + * File can be the target of dma-buf I/O. Set it for files whose data can be
> + * reached with direct I/O without the page cache: a dma-buf iterator has no
> + * pages to copy, so a buffered path cannot serve it. The bit is coarse; both
> + * the device behind it and O_DIRECT are checked when a buffer is registered.
> + */
> +#define FMODE_CAN_DMABUF_IO ((__force fmode_t)(1 << 8))
This is stealing yet another FMODE_* bit for special-purpose stuff.
We're really really short of them. Did Christoph suggest this?
On Wed, Nov 18, 2026 at 04:17:45PM +0100, Olivier Moysan wrote:
> This series adds support for the STM32 Multi-function Digital Filter
> (MDF) found on STM32MP2 SoCs. MDF converts bitstreams from external
> sigma-delta modulators and PDM microphones into samples for IIO and
> ASoC consumers.
>
> The drivers support direct IIO conversions, cyclic DMA acquisition,
> CIC configuration and scaling, synchronized and interleaved filters,
> and external timer triggers. An ASoC DAI provides PDM microphone capture.
>
> This revision addresses the v1 review comments listed below and splits
> the driver patch into smaller functional patches for readability.
> It retains the existing IIO backend interface for external sigma-delta
> modulators, pending agreement on the preferred abstraction.
>
> These changes do not resolve all v1 review comments. In particular, the
> frontend/backend architecture, DT child-node model and complete clock
> topology remain open discussion points.
>
> * Open questions: MDF topology (backend/frontend)
>
> In Analog Devices use of the IIO backend framework, the AXI ADC is a
> hardware backend, while the AD9467 is a hardware frontend. The external
> sigma-delta modulator is actually a hardware frontend in the MDF signal
> chain. The difference from the AD9467 use case is which driver owns the
> aggregate IIO device.
My red line here, that I probably made pretty clear on v1, is that what
is done needs to make sense when the ADC is feeding the MDF, it cannot
only work for the data coming in from sd modulators or w/e you connect
to the SITFx inputs.
> Option 1:
> One option would be to generalize the existing backend abstraction to
> represent components contributing to an aggregate IIO device,
> independently of their position in the signal chain.
>
> The existing framework appears to provide the required mechanisms. None
> of these mechanisms inherently requires the provider to be a hardware backend.
> A generic component/provider model would support both topologies without
> duplicating interfaces or requiring reciprocal dependencies. The key
> point here is to preserve the compatibility of APIs and DT bindings.
>
> Option 2:
> Alternatively, if the backend abstraction should retain its hardware
> meaning, we could introduce an explicit frontend-provider abstraction
> sharing the existing infrastructure. Frontend operations would cover
> analog-side control and conversion parameters.
>
> Would generalizing the existing abstraction be acceptable, or would a
> separate frontend interface built on shared infrastructure be preferred?
For either of these options, do you envisage the data being retrieved
from the mdf sysfs files rather than from the modulator?
>
> Option 3:
> An aggregate IIO device based on the component framework, as discussed
> in previous threads, could also be considered. I currently regard this
> as a fallback solution:
> https://lore.kernel.org/all/ec411432-4b77-4410-b0aa-b29f73b82c84@foss.st.co…
You option 2 in the earlier thread had:
| 2 - DFSDM managed as a "hardware accelerator"
|
|
| +-------------+
| | Sysfs |
| | - Scale | +---------------+
| | - Raw data | | IIO char dev |
| +-------------+ +---------------+
| ^ /\
| | ||
| | || Userland
| -----------------------------------------------------------
| | || IIO fw
| | ||
| | ||
| -----------------------------------------------------------
| | ||
| +--|-------------||--+ +----------------+
| | | || | | | Drivers
| | | ======================= |
| | | | | || |
| | +-----------------+-----+--+ || |
| | +---------+-----+--+ || |
| +----------|---------+ +-----------||---+
| | ||
| -----------------------------------------------------------
| | ||
| +----------|---------+ +-----------||---+
| | | | || | Hardware
| | sd modulator | | DFSDM || |
| ============================================= |
| | | | |
| +----------+---------+ +----------------+
| |
| |
| Vref
|
| The DFSDM is a consumer of the SD modulator.
|
| In addition to its complexity, the main drawback of this approach is
| that it is unsuitable for interleaved mode.
Two mails prior I had theorised a way to deal with the interleaved mode
https://lore.kernel.org/all/20261015-attentive-conflict-1a1f538de77d@spud/
but I never saw a response from you as to why something like that cannot
work. That's twice in that thread you said it was unsuitable without
providing the actual explanation for why?
Cheers,
Conor.
>
> * Driver implementation
>
> Serial interfaces (SITF) are shared resources managed directly by the
> MDF core and no longer have separate platform devices. This revision
> retains their DT nodes to describe configuration and clock connections,
> and to allow filters to reference their input bitstreams without
> duplicating shared settings.
>
> This revision also retains a platform device for each MDF filter, as
> each filter manages its own registers, interrupt, DMA channel and IIO
> acquisition state, with a separate suspend/resume lifecycle.
>
> * Clock management
>
> Several clock-management review comments are addressed in this revision:
> - The provider-side clock-frequency property has been removed. Consumers
> request CCK rates through assigned-clocks and assigned-clock-rates.
> - The clock-names property has been removed. The core acquires its single
> input clock by index, and CCK gating uses regmap-based clock operations.
> - Remove the unused clock-ranges property, as the core now explicitly
> shares the kernel clock with the serial interfaces and filters instead
> of relying on parent clock lookup.
>
> Clock topology point remains open, awaiting clarification of the MDF topology.
>
> Changes since v1:
> - Split the large IIO driver patch into smaller functional patches.
> - Replace provider-side clock-frequency with consumer-assigned CCK rates
> through the common clock framework.
> - Remove the platform devices for serial interfaces.
> - Replace the interleave phandle list with a filter count, covering
> consecutive filters starting at filter 0.
> - Simplify clock-output-names, remove clock-names, reset-names and
> filter-level clock properties, and move mdf-dai into an explicit
> property outside the conditional schema.
> - Rename the binding to match the STM32MP25 compatible, sort compatible
> entries, and simplify the binding patch subject.
> - Use unsigned long for match data, improve probe error reporting and
> wrapping, remove a probe-success debug message, and add kernel-doc for
> exported core functions.
> - Use scoped spinlock guards.
> - Remove empty serial-interface runtime-PM callbacks.
> - Remove the redundant ASoC platform module alias.
>
> Additional fixes since v1 (following Sashiko review):
> - Compute the settling-time discard count with 64-bit arithmetic.
> - Size cyclic DMA periods in complete scans and validate buffer and
> period alignment before starting DMA.
> - Fix backend-enable rollback so backend zero is disabled as well.
> - Use managed allocation for the conversion buffer and managed IIO
> triggered-buffer setup.
> - Release temporary synchronization and serial-interface firmware-node
> references. Replacing interleave phandles also removes the associated
> stored node references.
> - Avoid unregistering secondary interleaved filters that were never
> registered as IIO devices.
> - Use managed acquisition of the optional serial clock.
> - Replace the GCD-based CCK divider selection with a search for the
> largest valid divisor, allowing non-power-of-two divider values.
> - Remove the selection of the undefined COMMON_CLK_REGMAP symbol.
>
> Previous discussion:
> https://lore.kernel.org/all/20261001145702.2628429-1-olivier.moysan@foss.st…
>
> Signed-off-by: Olivier Moysan <olivier.moysan(a)foss.st.com>
> ---
> Olivier Moysan (11):
> dt-bindings: iio: adc: add stm32mp2 mdf filter
> iio: adc: stm32-mdf: add core registration
> iio: adc: stm32-mdf: add cck clocks provider
> iio: adc: stm32-mdf: add serial interfaces support
> iio: adc: stm32-mdf: add digital filter device support
> iio: adc: stm32-mdf: configure cic filters and sample rates
> iio: adc: stm32-mdf: add direct iio conversion support
> iio: adc: stm32-mdf: add dma buffered acquisition support
> iio: adc: stm32-mdf: add external timer trigger support
> iio: adc: stm32-mdf: add dmic audio filter support
> ASoC: stm32: add mdf dai support
>
> .../bindings/iio/adc/st,stm32mp25-mdf.yaml | 341 ++++
> drivers/iio/adc/Kconfig | 29 +
> drivers/iio/adc/Makefile | 3 +
> drivers/iio/adc/stm32-mdf-adc.c | 2080 ++++++++++++++++++++
> drivers/iio/adc/stm32-mdf-core.c | 899 +++++++++
> drivers/iio/adc/stm32-mdf-serial.c | 223 +++
> drivers/iio/adc/stm32-mdf.h | 275 +++
> include/linux/iio/adc/stm32-mdf-adc.h | 19 +
> sound/soc/stm/Kconfig | 15 +
> sound/soc/stm/Makefile | 3 +
> sound/soc/stm/stm32_amdf.c | 375 ++++
> 11 files changed, 4262 insertions(+)
> ---
> base-commit: d922ed738439e1d5b4701df7f4cdd49a09925624
> change-id: 20261112-upstream_mdf_v2-76040d99138e
>
> Best regards,
> --
> Olivier Moysan <olivier.moysan(a)foss.st.com>
>
On Tue, Nov 17, 2026 at 11:54 PM Paul Moore <paul(a)paul-moore.com> wrote:
>
> On Nov 17, 2026 Albert Esteve <aesteve(a)redhat.com> wrote:
> >
> > Both DMA_HEAP_IOCTL_ALLOC and the new DMA_BUF_IOCTL_XFER_CHARGE ioctl
> > accept a charge_fd field that, when set, causes the allocation to be
> > charged to an arbitrary process's cgroup rather than the caller's.
> >
> > Charging is currently limited to the caller's own memcg subtree unless
> > the caller holds CAP_SYS_RESOURCE. But the capability is all-or-nothing.
> > A process holding it, along with a dma-heap device node or a dma-buf
> > fd can charge unlimited memory to any other process's cgroup, potentially
> > exhausting that cgroup's limit and triggering OOM kills independent of
> > the victim's own activity or privileges.
> >
> > Add security_memcg_charge_task(), called in get_obj_cgroup_from_fd()
> > when charge_fd refers to another process. The hook receives
> > the credentials of the allocating process (from) and the credentials
> > of the process whose cgroup will be charged (to), giving security
> > modules a controlled enforcement point for cross-cgroup objcg
> > attribution policy.
> >
> > When CONFIG_SECURITY is not set the hook compiles to an inline
> > returning 0, adding no overhead to the fast path.
> >
> > Signed-off-by: Albert Esteve <aesteve(a)redhat.com>
> > ---
> > include/linux/lsm_hook_defs.h | 1 +
> > include/linux/security.h | 7 +++++++
> > mm/memcontrol.c | 11 +++++++++++
> > security/security.c | 15 +++++++++++++++
> > 4 files changed, 34 insertions(+)
>
> ...
>
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 03cd90d5e623..2e6fcbe14d43 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -60,6 +60,7 @@
> > #include <linux/lockdep.h>
> > #include <linux/resume_user_mode.h>
> > #include <linux/psi.h>
> > +#include <linux/security.h>
> > #include <linux/seq_buf.h>
> > #include <linux/sched/isolation.h>
> > #include <linux/kmemleak.h>
> > @@ -3198,10 +3199,12 @@ static bool mem_cgroup_may_charge(struct mem_cgroup *memcg)
> > struct obj_cgroup *get_obj_cgroup_from_fd(int fd)
> > {
> > struct cgroup_subsys_state *css;
> > + const struct cred *tcred;
> > struct obj_cgroup *objcg;
> > struct mem_cgroup *memcg;
> > struct task_struct *task;
> > unsigned int pidfd_flags;
> > + int ret;
> >
> > if (mem_cgroup_disabled())
> > return ERR_PTR(-EOPNOTSUPP);
> > @@ -3226,6 +3229,14 @@ struct obj_cgroup *get_obj_cgroup_from_fd(int fd)
> > if (IS_ERR(task))
> > return ERR_CAST(task);
> >
> > + tcred = get_task_cred(task);
> > + ret = security_memcg_charge_task(current_cred(), tcred);
>
> Do you ever envision this "from" cred being something other than
> current_cred()?
Good point. No, I do not.
> If the answer is "no", we might want to consider changing
> the LSM hook slightly to help prevent misuse in the future:
>
> int security_current_memcg_charge_task(const struct cred *tcred);
Agreed. I'll apply the same to the cgroupfd variant for symmetry (its
"from" is also always current_cred()).
BR,
Albert.
>
> > + put_cred(tcred);
> > + if (ret) {
> > + put_task_struct(task);
> > + return ERR_PTR(ret);
> > + }
> > +
> > rcu_read_lock();
> > css = task_css(task, memory_cgrp_id);
> > put_task_struct(task);
>
> --
> paul-moore.com
>
On Tue, Nov 17, 2026 at 03:54:31PM +0000, Ying Xiao wrote:
> system_heap_allocate() allocates pages via order_flags[] with __GFP_ZERO
> while the direct map still has the memory encryption bit set. For the
> system_cc_shared heap, set_memory_decrypted() subsequently clears the
> encryption bit without re-zeroing, leaving ciphertext in DRAM on
> confidential computing (CoCo) guests instead of plaintext zeros.
>
> Skip __GFP_ZERO during alloc_pages() for cc_shared allocations, and zero
> the pages once in system_heap_set_page_decrypted() after
> set_memory_decrypted() succeeds.
>
> Fixes: 78b30c50a7ac ("dma-buf: heaps: system: add system_cc_shared heap for explicitly shared memory")
> Reviewed-by: Jacob Moroni <jmoroni(a)google.com>
> Signed-off-by: Ying Xiao <eagleshaw(a)google.com>
> ---
> drivers/dma-buf/heaps/system_heap.c | 24 ++++++++++++++++++++----
> 1 file changed, 20 insertions(+), 4 deletions(-)
This seems fine, but Aneesh is fixing this in a more complete way with
this other series.
Reviewed-by: Jason Gunthorpe <jgg(a)nvidia.com>
Jason