From: Tom St Denis <tom.stdenis-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH v2] drm/amdgpu: expose amdgpu_sensors on pre-powerplay chips
Date: Tue, 14 Feb 2017 13:08:06 -0500 [thread overview]
Message-ID: <987dfdbd-8d65-8339-cdef-10b865997fee@amd.com> (raw)
In-Reply-To: <2338bf9c-ab65-36c6-53ae-a15321189817-5C7GfCeVMHo@public.gmane.org>
On 14/02/17 12:52 PM, Tom St Denis wrote:
> On 14/02/17 12:16 PM, Tom St Denis wrote:
>> On 14/02/17 12:01 PM, Samuel Pitoiset wrote:
>>> No worries. I thought that check was enough. Anyway, writing code
>>> without the hardware should be avoided. :)
>>>
>>> Can you try the thing suggested by Alex? Because I will need to fix up
>>> the DRM ioctl codepath as well.
>>
>> Sure, I'm building a module with a amdgpu_dpm check near the top of the
>> debugfs read function.
>
> It seems returning an error code causes it to do "bad things" on read
>
> [root@kaveri linux]# git diff
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 80821b4..d63c443 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3198,6 +3198,9 @@ static ssize_t amdgpu_debugfs_sensor_read(struct
> file *f, char __user *buf,
> if (size & 3 || *pos & 0x3)
> return -EINVAL;
>
> + if (amdgpu_dpm == 0)
> + return -EINVAL;
> +
> /* convert offset to sensor number */
> idx = *pos >> 2;
>
> That's what I applied on top of Samuel's three patches.
>
> With DPM enabled it works fine obviously, with it disabled the entire
> system hangs. I think probably because the VFS spins trying to read but
> never finishes...
Nevermind, the issue is umr reading UVD registers when dpm=0 on KV.
Without sampling UVD the error works properly.
So add those three lines to your patch (and similar in the ioctl) you
should be fine.
Cheers,
Tom
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-02-14 18:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 0:23 [PATCH] drm/amdgpu: expose amdgpu_sensors on pre-powerplay chips Samuel Pitoiset
[not found] ` <20170214002301.6686-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-14 14:04 ` Tom St Denis
[not found] ` <cc9720c0-653d-f56d-e68e-032454baf324-5C7GfCeVMHo@public.gmane.org>
2017-02-14 14:44 ` Samuel Pitoiset
[not found] ` <34e0230b-2ccb-b2bd-63d9-c2477dd33bfe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-14 16:17 ` Deucher, Alexander
[not found] ` <BN6PR12MB1652DD1BE92DB032AEC64C76F7580-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-02-15 2:51 ` Michel Dänzer
[not found] ` <35369b6f-b008-543a-fc0d-aa51fd0abe85-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-02-15 2:56 ` Deucher, Alexander
[not found] ` <BN6PR12MB1652DB3969E0524B6CFB01EEF75B0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-02-15 15:01 ` Tom St Denis
[not found] ` <1ef8a2b2-9591-64dc-b924-e4b274ab0745-5C7GfCeVMHo@public.gmane.org>
2017-02-15 15:55 ` Samuel Pitoiset
2017-02-14 15:08 ` [PATCH v2] " Samuel Pitoiset
[not found] ` <20170214150828.32314-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-14 16:41 ` Tom St Denis
[not found] ` <b97cf47b-1f0f-a9dc-4aeb-fa11a9a0f4d6-5C7GfCeVMHo@public.gmane.org>
2017-02-14 17:01 ` Samuel Pitoiset
[not found] ` <638559e3-6dab-107c-f483-562f6a298ab3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-14 17:16 ` Tom St Denis
[not found] ` <468a8aea-645c-037f-f78e-0d24a5b84a14-5C7GfCeVMHo@public.gmane.org>
2017-02-14 17:52 ` Tom St Denis
[not found] ` <2338bf9c-ab65-36c6-53ae-a15321189817-5C7GfCeVMHo@public.gmane.org>
2017-02-14 18:07 ` Tom St Denis
2017-02-14 18:08 ` Tom St Denis [this message]
2017-02-14 16:57 ` [PATCH] " Deucher, Alexander
[not found] ` <BN6PR12MB16525D9E10BE446048A8FD5FF7580-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-02-14 16:58 ` Tom St Denis
[not found] ` <b24985ed-1030-deb1-2c80-a5435c383ae4-5C7GfCeVMHo@public.gmane.org>
2017-02-14 17:01 ` Deucher, Alexander
2017-02-14 17:01 ` Deucher, Alexander
[not found] ` <BN6PR12MB16522B9BBE1A9048F35EFCF7F7580-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-02-14 17:04 ` Samuel Pitoiset
[not found] ` <ff5516f0-f675-9874-ca2f-e5c26981568b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-14 17:08 ` Deucher, Alexander
2017-02-15 18:32 ` [PATCH v3] " Samuel Pitoiset
[not found] ` <20170215183229.32590-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-15 18:34 ` Tom St Denis
[not found] ` <fa40c67e-2507-20d1-3c6a-77d253b72865-5C7GfCeVMHo@public.gmane.org>
2017-02-15 18:39 ` Samuel Pitoiset
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=987dfdbd-8d65-8339-cdef-10b865997fee@amd.com \
--to=tom.stdenis-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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