linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Mikko Perttunen <cyndis@kapsi.fi>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	thierry.reding@gmail.com, jonathanh@nvidia.com, airlied@linux.ie,
	daniel@ffwll.ch
Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org,
	talho@nvidia.com, bhuntsman@nvidia.com
Subject: Re: [RFC PATCH v2 10/17] WIP: gpu: host1x: Add no-recovery mode
Date: Sat, 12 Sep 2020 15:53:05 +0300	[thread overview]
Message-ID: <07f933b3-10d9-0318-e2f3-6dfd5b4903ac@gmail.com> (raw)
In-Reply-To: <c2498218-e107-4df4-41ce-c60da65ceaf7@kapsi.fi>

12.09.2020 01:11, Mikko Perttunen пишет:
> On 9/11/20 7:40 PM, Dmitry Osipenko wrote:
>> 05.09.2020 13:34, Mikko Perttunen пишет:
>>> +    } else {
>>> +        struct host1x_job *failed_job = job;
>>> +
>>> +        host1x_job_dump(dev, job);
>>> +
>>> +        host1x_syncpt_set_locked(job->syncpt);
>>> +        failed_job->cancelled = true;
>>> +
>>> +        list_for_each_entry_continue(job, &cdma->sync_queue, list) {
>>> +            unsigned int i;
>>> +
>>> +            if (job->syncpt != failed_job->syncpt)
>>> +                continue;
>>> +
>>> +            for (i = 0; i < job->num_slots; i++) {
>>> +                unsigned int slot = (job->first_get/8 + i) %
>>> +                            HOST1X_PUSHBUFFER_SLOTS;
>>> +                u32 *mapped = cdma->push_buffer.mapped;
>>> +
>>> +                mapped[2*slot+0] = 0x1bad0000;
>>> +                mapped[2*slot+1] = 0x1bad0000;
>>
>> The 0x1bad0000 is a valid memory address on Tegra20.
>>
>> The 0x60000000 is invalid phys address for all hardware generations.
>> It's used by grate-kernel [1] and VDE driver [2]. Note that the 0x6 <<
>> 28 is also invalid Host1x opcode, while 0x1 should break CDMA parser
>> during of PB debug-dumping.
>>
>> [1]
>> https://github.com/grate-driver/linux/blob/master/drivers/gpu/drm/tegra/gem.h#L16
>>
>>
>> [2]
>> https://elixir.bootlin.com/linux/v5.9-rc4/source/drivers/staging/media/tegra-vde/iommu.c#L99
>>
>>
>> The VDE driver reserves the trapping IOVA addresses, I assume the Host1x
>> driver should do the same.
>>
> 
> The 0x1bad0000's are not intended to be memory addresses, they are NOOP
> opcodes (INCR of 0 words to offset 0xbad). I'll fix this to use proper
> functions to construct the opcodes and add some comments. These need to
> be NOOP opcodes so the command parser skips over these "cancelled" jobs
> when the channel is resumed.
> 
> BTW, 0x60000000 is valid on Tegra194 and later.

At a quick glance it looked like a memory address :)

I'm now taking a closer look at this patch and it raises some more
questions, like for example by looking at the "On job timeout, we stop
the channel, NOP all future jobs on the channel using the same syncpoint
..." through the prism of grate-kernel experience, I'm not sure how it
could co-exist with the drm-scheduler and why it's needed at all. But I
think we need a feature-complete version (at least a rough version), so
that we could start the testing, and then it should be easier to review
and discuss such things.

  reply	other threads:[~2020-09-12 12:53 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05 10:34 [RFC PATCH v2 00/17] Host1x/TegraDRM UAPI Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 01/17] gpu: host1x: Use different lock classes for each client Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 02/17] gpu: host1x: Allow syncpoints without associated client Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 03/17] gpu: host1x: Show number of pending waiters in debugfs Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 04/17] gpu: host1x: Remove cancelled waiters immediately Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 05/17] gpu: host1x: Use HW-equivalent syncpoint expiration check Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 06/17] gpu: host1x: Cleanup and refcounting for syncpoints Mikko Perttunen
2020-09-05 14:30   ` Dmitry Osipenko
2020-09-05 14:53     ` Mikko Perttunen
2020-09-09  0:07       ` Dmitry Osipenko
2020-09-09  8:03         ` Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 07/17] gpu: host1x: Introduce UAPI header Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 08/17] gpu: host1x: Implement /dev/host1x device node Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 09/17] gpu: host1x: DMA fences and userspace fence creation Mikko Perttunen
2020-09-10 22:00   ` Dmitry Osipenko
2020-09-11  9:07     ` Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 10/17] WIP: gpu: host1x: Add no-recovery mode Mikko Perttunen
2020-09-11 16:40   ` Dmitry Osipenko
2020-09-11 22:11     ` Mikko Perttunen
2020-09-12 12:53       ` Dmitry Osipenko [this message]
2020-09-12 13:31         ` Mikko Perttunen
2020-09-12 21:51           ` Dmitry Osipenko
2020-09-13  9:51             ` Mikko Perttunen
2020-09-13 18:37               ` Dmitry Osipenko
2020-09-15 10:57                 ` Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 11/17] gpu: host1x: Add job release callback Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 12/17] gpu: host1x: Add support for syncpoint waits in CDMA pushbuffer Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 13/17] gpu: host1x: Reset max value when freeing a syncpoint Mikko Perttunen
2020-09-16 19:44   ` Dmitry Osipenko
2020-09-16 20:43     ` Mikko Perttunen
2020-09-16 21:37       ` Dmitry Osipenko
2020-09-17  7:25         ` Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 14/17] drm/tegra: Add new UAPI to header Mikko Perttunen
2020-09-08 23:45   ` DRM_TEGRA_SUBMIT_BUF_WRITE_RELOC Dmitry Osipenko
2020-09-09  8:10     ` DRM_TEGRA_SUBMIT_BUF_WRITE_RELOC Mikko Perttunen
2020-09-10 22:15       ` DRM_TEGRA_SUBMIT_BUF_WRITE_RELOC Dmitry Osipenko
2020-09-11  9:52         ` DRM_TEGRA_SUBMIT_BUF_WRITE_RELOC Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 15/17] drm/tegra: Add power_on/power_off engine callbacks Mikko Perttunen
2020-09-09  0:16   ` Dmitry Osipenko
2020-09-09  8:11     ` Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 16/17] drm/tegra: Allocate per-engine channel in core code Mikko Perttunen
2020-09-05 10:34 ` [RFC PATCH v2 17/17] WIP: drm/tegra: Implement new UAPI Mikko Perttunen
2020-09-09  0:47   ` Dmitry Osipenko
2020-09-09  8:19     ` Mikko Perttunen
2020-09-10 21:59       ` Dmitry Osipenko
2020-09-09  1:13   ` [RFC PATCH v2 17/17] WIP: drm/tegra: Implement new UAPI (submit_handle_syncpts) Dmitry Osipenko
2020-09-09  1:24     ` Dmitry Osipenko
2020-09-09  8:26       ` Mikko Perttunen
2020-09-10 21:58         ` Dmitry Osipenko
2020-09-09  2:06   ` [RFC PATCH v2 17/17] WIP: drm/tegra: Implement new UAPI Dmitry Osipenko
2020-09-09  8:26     ` Mikko Perttunen
2020-09-09  2:10   ` Dmitry Osipenko
2020-09-09  2:34     ` Dmitry Osipenko
2020-09-09  8:36       ` Mikko Perttunen
2020-09-10 21:57         ` Dmitry Osipenko
2020-09-11  9:59           ` Mikko Perttunen
2020-09-11 16:30             ` Dmitry Osipenko
2020-09-15 11:08               ` Mikko Perttunen
2020-09-08 23:36 ` [RFC PATCH v2 00/17] Host1x/TegraDRM UAPI Dmitry Osipenko
2020-09-09  8:40   ` Mikko Perttunen
2020-09-10 22:09     ` Dmitry Osipenko
2020-09-09  2:20 ` Dmitry Osipenko
2020-09-09  8:44   ` Mikko Perttunen
2020-09-10 21:53     ` Dmitry Osipenko

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=07f933b3-10d9-0318-e2f3-6dfd5b4903ac@gmail.com \
    --to=digetx@gmail.com \
    --cc=airlied@linux.ie \
    --cc=bhuntsman@nvidia.com \
    --cc=cyndis@kapsi.fi \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=talho@nvidia.com \
    --cc=thierry.reding@gmail.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;
as well as URLs for NNTP newsgroup(s).