From: Howard Yen <howardyen@google.com>
To: gregkh@linuxfoundation.org, rafael@kernel.org,
mathias.nyman@intel.com, hch@lst.de, m.szyprowski@samsung.com,
robin.murphy@arm.com, andriy.shevchenko@linux.intel.com,
petr.tesarik.ext@huawei.com, broonie@kernel.org,
james@equiv.tech, james.clark@arm.com, masahiroy@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
iommu@lists.linux.dev, Howard Yen <howardyen@google.com>
Subject: [PATCH v4 0/2] Add support for multiple coherent memory regions
Date: Fri, 8 Mar 2024 09:53:18 +0000 [thread overview]
Message-ID: <20240308095320.1961469-1-howardyen@google.com> (raw)
In the system I'm working on, there is an always-on subsystem which
includes a small size memory, and several functions need to run and
occupy the memory from the small memory if they need to run on the
always-on subsystem. These functions must allocate the memory from the
small memory region, so that they can get benefit from the always-on
subsystem. So the small memory is split for multiple functions which are
satisfied with their generic use cases. But in specific use cases, like
USB3 devices which support the stream trasnsfer or multiple devices
connect to the host, they required more memory than their pre-allocated
memory region. I tried to implement it in a generic way and propose this
patch to give it the ability to get the memory from the other larger
memory to solve the issue.
Changelog
--------------------------------------------
Changes in v4:
- Add the driver where uses the multiple coherent memory regions
Changes in v3:
- Re-org the members of struct dma_coherent_mem to avoid additional
pointer arithmetics and the holes inside the structure.
- Use consistent naming of return value.
- Re-write the dev checking statement to be more clear.
Changes in v2:
- Replace the pointer(dma_mem) to a list_head(dma_mems) in the device
structure and initialize the list_head in device_initialize().
- Modify the required changes in coherent.c.
Howard Yen (2):
dma-coherent: add support for multi coherent rmems per dev
usb: host: xhci-plat: add support for multi memory regions
drivers/base/core.c | 3 ++
drivers/usb/host/xhci-plat.c | 19 +++++++-
include/linux/device.h | 5 +-
kernel/dma/coherent.c | 92 +++++++++++++++++++++++-------------
4 files changed, 82 insertions(+), 37 deletions(-)
--
2.44.0.278.ge034bb2e1d-goog
next reply other threads:[~2024-03-08 9:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 9:53 Howard Yen [this message]
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
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=20240308095320.1961469-1-howardyen@google.com \
--to=howardyen@google.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--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