All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Tudor Ambarus <tudor.ambarus@linaro.org>, jassisinghbrar@gmail.com
Cc: alim.akhtar@samsung.com, mst@redhat.com, javierm@redhat.com,
	tzimmermann@suse.de, bartosz.golaszewski@linaro.org,
	luzmaximilian@gmail.com, sudeep.holla@arm.com,
	conor.dooley@microchip.com, bjorn@rivosinc.com,
	ulf.hansson@linaro.org, linux-samsung-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, marcan@marcan.st,
	neal@gompa.dev, alyssa@rosenzweig.io, broonie@kernel.org,
	andre.draszik@linaro.org, willmcvicker@google.com,
	peter.griffin@linaro.org, kernel-team@android.com,
	vincent.guittot@linaro.org, daniel.lezcano@linaro.org
Subject: Re: [PATCH v2 2/2] firmware: add exynos acpm driver
Date: Thu, 24 Oct 2024 11:36:22 +0200	[thread overview]
Message-ID: <855101b0-0102-4c77-b110-bdec12b28f29@kernel.org> (raw)
In-Reply-To: <2941d65e-8fb4-4d5a-be4b-283de2cb3274@linaro.org>

On 23/10/2024 11:53, Tudor Ambarus wrote:
> 
> 
> On 10/23/24 10:00 AM, Krzysztof Kozlowski wrote:
>>>>>> I also cannot find any piece of code setting several of above, e.g. tx_base
>>>>> I'm not writing any SRAM configuration fields, these fields are used to
>>>>> read/retrive the channel parameters from SRAM.
>>>> I meany tx_base is always 0. Where is this property set? Ever?
>>> It's not zero. My assumption is it is set in the acpm firmware, but I
>> Where is any assignment to this member?
> 
> In probe() you'll see that exynos_acpm->shmem is a pointer in SRAM to a
> struct exynos_acpm_shmem __iomem *shmem;
> 
> Then in:
> 
> static int exynos_acpm_chans_init()
> {
> 	struct exynos_acpm_shmem_chan __iomem *shmem_chans, *shmem_chan;
> 	struct exynos_acpm_shmem __iomem *shmem = exynos_acpm->shmem;
> 	...
> 
> 	shmem_chans = exynos_acpm_get_iomem_addr(exynos_acpm->sram_base,
> 						 &shmem->chans);
> 	...
> }
> 
> shmem->chans is not initialized (or tx_base). I'm using its address in
> SRAM (&shmem->chans) which I then read it with readl_relaxed().
> 
> I guess one can do the same using offsetof:
> shmem_chans = readl_realaxed(shmem + offsetof(struct exynos_acpm_shmem,
> 					      chans));
> 

I see, the code and the naming is confusing. Two exynos_acpm_shmem_chan
variables and one exynos_acpm_shmem. shmem_chans is used as an array,
but nowhere pointed or indicated that it is array of some size.

All this could be clearer if exynos_acpm_shmem_chan was packed, because
then it is obvious it points to defined memory, but maybe packed is not
correct here? Probably splitting all this into logical chunks would be
useful. Like not mixing reading offsets with reading values, because I
really have to spend a lot of time to identify which one is which in
exynos_acpm_chans_init().

Best regards,
Krzysztof



  parent reply	other threads:[~2024-10-24  9:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 16:36 [PATCH v2 0/2] mailbox: add async request mechanism w/ a user Tudor Ambarus
2024-10-17 16:36 ` [PATCH v2 1/2] mailbox: add async request mechanism to empower controllers w/ hw queues Tudor Ambarus
2024-10-18  4:17   ` Jassi Brar
2024-10-18  7:49     ` Tudor Ambarus
2024-10-21  6:18       ` Tudor Ambarus
2024-10-21 16:32         ` Jassi Brar
2024-10-22 13:26           ` Tudor Ambarus
2024-10-24  1:27             ` Jassi Brar
2024-10-24 10:45               ` Tudor Ambarus
2024-10-29 15:59                 ` Jassi Brar
2024-11-18 15:22                   ` Tudor Ambarus
2024-10-17 16:36 ` [PATCH v2 2/2] firmware: add exynos acpm driver Tudor Ambarus
2024-10-20 15:45   ` kernel test robot
2024-10-20 15:45   ` kernel test robot
2024-10-21 11:52   ` Krzysztof Kozlowski
2024-10-21 14:12     ` Tudor Ambarus
2024-10-22  4:38       ` Krzysztof Kozlowski
2024-10-22  7:27         ` Vincent Guittot
2024-10-22  7:58         ` Tudor Ambarus
2024-10-23  9:00           ` Krzysztof Kozlowski
2024-10-23  9:53             ` Tudor Ambarus
2024-10-23 10:02               ` Tudor Ambarus
2024-10-24  9:36               ` Krzysztof Kozlowski [this message]
2024-10-25 10:00                 ` Tudor Ambarus
2024-10-21 14:52   ` Tudor Ambarus
2024-10-21 16:47   ` Alim Akhtar
2024-10-25  9:44     ` Tudor Ambarus

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=855101b0-0102-4c77-b110-bdec12b28f29@kernel.org \
    --to=krzk@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=alyssa@rosenzweig.io \
    --cc=andre.draszik@linaro.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=bjorn@rivosinc.com \
    --cc=broonie@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=javierm@redhat.com \
    --cc=kernel-team@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=luzmaximilian@gmail.com \
    --cc=marcan@marcan.st \
    --cc=mst@redhat.com \
    --cc=neal@gompa.dev \
    --cc=peter.griffin@linaro.org \
    --cc=sudeep.holla@arm.com \
    --cc=tudor.ambarus@linaro.org \
    --cc=tzimmermann@suse.de \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.guittot@linaro.org \
    --cc=willmcvicker@google.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 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.