From: Jani Nikula <jani.nikula@linux.intel.com>
To: Matt Roper <matthew.d.roper@intel.com>,
Gustavo Sousa <gustavo.sousa@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH 2/2] drm/xe: Replace DRM_ERROR() with pr_err()
Date: Mon, 29 May 2023 10:58:21 +0300 [thread overview]
Message-ID: <87edmzin6q.fsf@intel.com> (raw)
In-Reply-To: <20230526214817.GL10045@mdroper-desk1.amr.corp.intel.com>
On Fri, 26 May 2023, Matt Roper <matthew.d.roper@intel.com> wrote:
> On Thu, May 25, 2023 at 09:42:35PM -0300, Gustavo Sousa wrote:
>> The former has been deprecated in favor of the latter.
>
> It has? I thought generally the goal has been to replace DRM_FOO() with
> drm_foo() (i.e., drm_err() in this case) because then you get nicer
> device-specific output.
Yes, drm_foo is preferred over pr_foo.
BR,
Jani.
> Or when we're doing something GT-specific, we
> move to xe_gt_err() so that the useful information about which GT is
> automatically included.
>
> It looks like xe_reg_sr_add() doesn't have a reference to a drm_device
> to use drm_err (I didn't check how hard it would be to plumb down to
> that point), but xe_vm_bind_ioctl() should be able to use drm_err() I
> think?
>
>
> Matt
>
>>
>> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_reg_sr.c | 11 ++++++-----
>> drivers/gpu/drm/xe/xe_vm.c | 3 ++-
>> 2 files changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c
>> index 24d9c73ef279..4266999cdeb6 100644
>> --- a/drivers/gpu/drm/xe/xe_reg_sr.c
>> +++ b/drivers/gpu/drm/xe/xe_reg_sr.c
>> @@ -7,6 +7,7 @@
>>
>> #include <kunit/visibility.h>
>> #include <linux/align.h>
>> +#include <linux/printk.h>
>> #include <linux/string_helpers.h>
>> #include <linux/xarray.h>
>>
>> @@ -123,11 +124,11 @@ int xe_reg_sr_add(struct xe_reg_sr *sr,
>> return 0;
>>
>> fail:
>> - DRM_ERROR("Discarding save-restore reg %04lx (clear: %08x, set: %08x, masked: %s, mcr: %s): ret=%d\n",
>> - idx, e->clr_bits, e->set_bits,
>> - str_yes_no(e->reg.masked),
>> - str_yes_no(e->reg.mcr),
>> - ret);
>> + pr_err("Discarding save-restore reg %04lx (clear: %08x, set: %08x, masked: %s, mcr: %s): ret=%d\n",
>> + idx, e->clr_bits, e->set_bits,
>> + str_yes_no(e->reg.masked),
>> + str_yes_no(e->reg.mcr),
>> + ret);
>> reg_sr_inc_error(sr);
>>
>> return ret;
>> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
>> index 4d9c8de8b348..89d8240ea6aa 100644
>> --- a/drivers/gpu/drm/xe/xe_vm.c
>> +++ b/drivers/gpu/drm/xe/xe_vm.c
>> @@ -13,6 +13,7 @@
>> #include <linux/delay.h>
>> #include <linux/kthread.h>
>> #include <linux/mm.h>
>> +#include <linux/printk.h>
>> #include <linux/swap.h>
>>
>> #include "xe_bo.h"
>> @@ -3019,7 +3020,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
>> }
>>
>> if (XE_IOCTL_ERR(xe, xe_vm_is_closed(vm))) {
>> - DRM_ERROR("VM closed while we began looking up?\n");
>> + pr_err("VM closed while we began looking up?\n");
>> err = -ENOENT;
>> goto put_vm;
>> }
>> --
>> 2.40.1
>>
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-05-29 7:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 0:42 [Intel-xe] [PATCH 0/2] Replace DRM_ERROR() with pr_err() Gustavo Sousa
2023-05-26 0:42 ` [Intel-xe] [PATCH 1/2] fixup! drm/xe/debugfs: Dump register save-restore tables Gustavo Sousa
2023-05-26 16:34 ` Lucas De Marchi
2023-05-29 14:05 ` Gustavo Sousa
2023-05-26 0:42 ` [Intel-xe] [PATCH 2/2] drm/xe: Replace DRM_ERROR() with pr_err() Gustavo Sousa
2023-05-26 9:49 ` Kalvala, Haridhar
2023-05-26 16:33 ` Lucas De Marchi
2023-05-26 21:48 ` Matt Roper
2023-05-29 7:58 ` Jani Nikula [this message]
2023-05-29 13:42 ` Gustavo Sousa
2023-05-29 15:12 ` Gustavo Sousa
2023-05-26 1:10 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-05-26 1:12 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-05-26 1:16 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-05-26 1:44 ` [Intel-xe] ○ CI.BAT: info " Patchwork
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=87edmzin6q.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=gustavo.sousa@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.d.roper@intel.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