From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
To: Biju Das <biju.das.jz@bp.renesas.com>,
"vkoul@kernel.org" <vkoul@kernel.org>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
"geert+renesas@glider.be" <geert+renesas@glider.be>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: "dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v6 8/8] dmaengine: sh: rz-dmac: Add device_{pause,resume}() callbacks
Date: Wed, 7 Jan 2026 16:56:58 +0200 [thread overview]
Message-ID: <7161814f-5317-49f0-9240-c84d331737c4@tuxon.dev> (raw)
In-Reply-To: <TY3PR01MB11346E51F609DDEC61E13609B8684A@TY3PR01MB11346.jpnprd01.prod.outlook.com>
On 1/7/26 15:48, Biju Das wrote:
> Hi Claudiu,
>
>> -----Original Message-----
>> From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
>> Sent: 07 January 2026 13:18
>> Subject: Re: [PATCH v6 8/8] dmaengine: sh: rz-dmac: Add device_{pause,resume}() callbacks
>>
>> Hi, Biju,
>>
>> On 12/23/25 16:43, Biju Das wrote:
>>> Hi Claudiu,
>>>
>>>> -----Original Message-----
>>>> From: Claudiu <claudiu.beznea@tuxon.dev>
>>>> Sent: 23 December 2025 13:50
>>>> Subject: [PATCH v6 8/8] dmaengine: sh: rz-dmac: Add
>>>> device_{pause,resume}() callbacks
>>>>
>>>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>>
>>>> Add support for device_{pause, resume}() callbacks. These are required by the RZ/G2L SCIFA driver.
>>>>
>>>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>> ---
>>>>
[...]
>>>> +
>>>> +static int rz_dmac_device_resume(struct dma_chan *chan) {
>>>> + struct rz_dmac_chan *channel = to_rz_dmac_chan(chan);
>>>> + u32 val;
>>>> + int ret;
>>>> +
>>>> + scoped_guard(spinlock_irqsave, &channel->vc.lock) {
>>>
>>>
>>>> + rz_dmac_ch_writel(channel, CHCTRL_CLRSUS, CHCTRL, 1);
>>>
>>>
>>> Similarly, first you need to check CHSTAT_SUS bit first and then clear suspend state.
>>>
>>>
>>> Clears the suspend status. Setting this bit to 1 when 1 is set in SUS
>>> of the CHSTAT_n/nS register can clear the suspend status.
>>
>> I'll update this one as follows, to keep the code simple:
>>
>> static int rz_dmac_device_resume(struct dma_chan *chan) {
>> struct rz_dmac_chan *channel = to_rz_dmac_chan(chan);
>> u32 val;
>>
>> guard(spinlock_irqsave)(&channel->vc.lock);
>>
>> /* Do not check CHSTAT_SUS but rely on HW capabilities. */
>> rz_dmac_ch_writel(channel, CHCTRL_CLRSUS, CHCTRL, 1);
>> return read_poll_timeout_atomic(rz_dmac_ch_readl, val,
>> !(val & CHSTAT_SUS), 1, 1024,
>> false, channel, CHSTAT, 1);
>> }
>>
>> With this:
>>
>> 1/ in case the channel is not suspended and the CHCTRL_CLRSUS is set, the read_poll_timeout_atomic()
>> will not timeout, as the default value of the CHSTAT_SUS is zero.
>
> Just a question as we are not following the hardware manual.
>
> At hardware level does it have any implications?
The documentation of CHCTRL_CLRSUS states:
Setting this bit to 1 *when 1 is set in SUS of the CHSTAT_n/nS register*
can clear the suspend status.
So, it takes effect only when CHSTAT.SUS=1
>
> Eg: we set this write only register without the device being suspended
>
>
> The next suspend operation, immediately clears the suspend operation
The next suspend operation will switch the DMA channel to suspend if the
channel is enabled. Nothing should take place if the device is not enabled.
>
> Or
>
> does it work normally.
Yes, it works normally.
I set the CLRSUS bit in a loop for a DMA channel where the audio was
playing, with the following command:
while :; do devmem2 0x118200a8 w 0x200 > /dev/null; done
There were no issues with the audio stream, as expected.
If I set the SETSUS bit for the same audio channel after the CLRSUS was
set in a loop, the audio is stopped as expected.
Thank you,
Claudiu
prev parent reply other threads:[~2026-01-07 14:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 13:49 [PATCH v6 0/8] dmaengine: sh: rz-dmac: Add tx_status and pause/resume support Claudiu
2025-12-23 13:49 ` [PATCH v6 1/8] dmaengine: sh: rz-dmac: Protect the driver specific lists Claudiu
2025-12-23 13:49 ` [PATCH v6 2/8] dmaengine: sh: rz-dmac: Move CHCTRL updates under spinlock Claudiu
2025-12-23 14:24 ` Biju Das
2025-12-23 13:49 ` [PATCH v6 3/8] dmaengine: sh: rz-dmac: Drop read of CHCTRL register Claudiu
2025-12-23 14:25 ` Biju Das
2025-12-23 13:49 ` [PATCH v6 4/8] dmaengine: sh: rz-dmac: Drop goto instruction and label Claudiu
2025-12-23 13:49 ` [PATCH v6 5/8] dmaengine: sh: rz-dmac: Drop unnecessary local_irq_save() call Claudiu
2025-12-23 13:49 ` [PATCH v6 6/8] dmaengine: sh: rz-dmac: Add rz_dmac_invalidate_lmdesc() Claudiu
2025-12-23 13:49 ` [PATCH v6 7/8] dmaengine: sh: rz-dmac: Add device_tx_status() callback Claudiu
2025-12-23 13:49 ` [PATCH v6 8/8] dmaengine: sh: rz-dmac: Add device_{pause,resume}() callbacks Claudiu
2025-12-23 14:43 ` Biju Das
2026-01-07 13:17 ` Claudiu Beznea
2026-01-07 13:48 ` Biju Das
2026-01-07 14:56 ` Claudiu Beznea [this message]
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=7161814f-5317-49f0-9240-c84d331737c4@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=biju.das.jz@bp.renesas.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=dmaengine@vger.kernel.org \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=vkoul@kernel.org \
/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
all inboxes | Powered by JetHome®