public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Howard Yen <howardyen@google.com>
Cc: gregkh@linuxfoundation.org, rafael@kernel.org,
	mathias.nyman@intel.com, hch@lst.de, m.szyprowski@samsung.com,
	robin.murphy@arm.com, petr.tesarik.ext@huawei.com,
	broonie@kernel.org, james@equiv.tech, james.clark@arm.com,
	masahiroy@kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, iommu@lists.linux.dev
Subject: Re: [PATCH v4 1/2] dma-coherent: add support for multi coherent rmems per dev
Date: Fri, 8 Mar 2024 15:41:21 +0200	[thread overview]
Message-ID: <ZesVgXi9xBFvDL4O@smile.fi.intel.com> (raw)
In-Reply-To: <20240308095320.1961469-2-howardyen@google.com>

On Fri, Mar 08, 2024 at 09:53:19AM +0000, Howard Yen wrote:
> Add support for multiple coherent rmems per device. This patch replaces
> original dma_mem with dma_mems list in device structure to store multiple
> rmems.
> 
> These multiple rmems can be assigned to the device one by one by
> of_reserved_mem_device_init_by_idx() with the memory-region
> declaration in device tree as below and store the rmem to the dma_mems
> list.
> 
> 	device1@0 {
> 		...
> 		memory-region = <&reserved_mem0>, <&reserved_mem1>;
> 		...
> 	};
> 
> When driver tries to allocate memory from the rmems, looks for the first
> available rmem and allocates the memory from this rmem.
> 
> Then if driver removed, of_reserved_mem_device_release() needs to be
> invoked to release all the rmems assigned to the device.

...

> +#endif
> +#ifdef CONFIG_DMA_DECLARE_COHERENT
> +	INIT_LIST_HEAD(&dev->dma_mems);
>  #endif

Side note: Have you used --histogram diff algo? If no, use it in the future.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-03-08 13:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08  9:53 [PATCH v4 0/2] Add support for multiple coherent memory regions Howard Yen
2024-03-08  9:53 ` [PATCH v4 1/2] dma-coherent: add support for multi coherent rmems per dev Howard Yen
2024-03-08 13:41   ` Andy Shevchenko [this message]
2024-03-08  9:53 ` [PATCH v4 2/2] usb: host: xhci-plat: add support for multi memory regions Howard Yen
2024-03-08 13:43   ` Andy Shevchenko
2024-03-10  6:16   ` kernel test robot
2024-03-10  6:27   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZesVgXi9xBFvDL4O@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=howardyen@google.com \
    --cc=iommu@lists.linux.dev \
    --cc=james.clark@arm.com \
    --cc=james@equiv.tech \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=masahiroy@kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=petr.tesarik.ext@huawei.com \
    --cc=rafael@kernel.org \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox