All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Elliot Berman <quic_eberman@quicinc.com>
Cc: Caleb Connolly <caleb.connolly@linaro.org>,
	Stephan Gerhold <stephan@gerhold.net>,
	 Konrad Dybcio <konrad.dybcio@linaro.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	 Bjorn Andersson <andersson@kernel.org>,
	 "linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Douglas Anderson <dianders@chromium.org>,
	 Rob Clark <robdclark@gmail.com>
Subject: Re: [PATCH] soc: qcom: cmd-db: map shared memory as WT, not WB
Date: Wed, 10 Apr 2024 21:43:25 -0700	[thread overview]
Message-ID: <CAE-0n51e5wm8haqOJgEmE+pEqqFSZOBXvLi-k_+V-Aa0rCXCWA@mail.gmail.com> (raw)
In-Reply-To: <20240410204337739-0700.eberman@hu-eberman-lv.qualcomm.com>

Quoting Elliot Berman (2024-04-10 20:54:24)
> On Thu, Mar 28, 2024 at 07:40:49PM -0500, Stephen Boyd wrote:
> > Quoting Stephan Gerhold (2024-03-28 02:58:56)
> > >
> > > FWIW: This old patch series from Stephen Boyd is closely related:
> > > https://lore.kernel.org/linux-arm-msm/20190910160903.65694-1-swboyd@chromium.org/
> > >
> > > > The main use case I have is to map the command-db memory region on
> > > > Qualcomm devices with a read-only mapping. It's already a const marked
> > > > pointer and the API returns const pointers as well, so this series
> > > > makes sure that even stray writes can't modify the memory.
> > >
> > > Stephen, what was the end result of that patch series? Mapping the
> > > cmd-db read-only sounds cleaner than trying to be lucky with the right
> > > set of cache flags.
> > >
> >
> > I dropped it because I got busy with other stuff. Feel free to pick it
> > back up. It looks like the part where I left off was where we had to
> > make the API fallback to mapping the memory as writeable if read-only
> > isn't supported on the architecture.
> [...]
> > The other weird thing was that we passed both MEMREMAP_RO and
> > MEMREMAP_WB to indicate what sort of fallback we want. Perhaps that can
> > be encoded in the architecture layer so that you get the closest thing
> > to read-only memory (i.e. any sort of write side caching is removed) and
> > you don't have to pass a fallback mapping type.
>
> Was there any motivation for having the fallback? I suspect driver
> owners that want to use MEMREMAP_RO will know which architectures the
> driver is applicable to and also know whether MEMREMAP_RO would work.

I don't think there was any motivation, but it has been many years so
maybe I forgot. I suspect you're suggesting that we just don't do that
and driver writers can call the memremap API another time if they want
to implement a fallback? Sounds OK to me.

>
> > I also wanted to return a const pointer.
>
> The stash looks mostly complete. Do you think it should be part of the
> series or submitted separately?
>

Make it part of the series so this topic can be finished? For example,
it seems like iounmap() should have always taken a const pointer.

  reply	other threads:[~2024-04-11  4:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 20:09 [PATCH] soc: qcom: cmd-db: map shared memory as WT, not WB Volodymyr Babchuk
2024-03-27 20:45 ` Konrad Dybcio
2024-03-27 21:04   ` Volodymyr Babchuk
2024-03-27 21:06     ` Konrad Dybcio
2024-03-27 23:29       ` Caleb Connolly
2024-03-28  9:58         ` Stephan Gerhold
2024-03-29  0:40           ` Stephen Boyd
2024-04-11  3:54             ` Elliot Berman
2024-04-11  4:43               ` Stephen Boyd [this message]
2024-04-10 22:12           ` Volodymyr Babchuk
2024-04-11  8:02             ` Stephan Gerhold
2024-04-11  8:41               ` Stephen Boyd
2024-03-28 21:29         ` Volodymyr Babchuk
2024-03-28 11:12 ` Nikita Travkin
2024-03-28 14:06   ` Nikita Travkin
2024-03-28 12:01 ` Maulik Shah (mkshah)
2024-03-28 22:19   ` Volodymyr Babchuk
2024-03-29  4:52     ` Maulik Shah (mkshah)

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=CAE-0n51e5wm8haqOJgEmE+pEqqFSZOBXvLi-k_+V-Aa0rCXCWA@mail.gmail.com \
    --to=swboyd@chromium.org \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andersson@kernel.org \
    --cc=caleb.connolly@linaro.org \
    --cc=dianders@chromium.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_eberman@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=stephan@gerhold.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.