From: Ilija Hadzic <ihadzic@research.bell-labs.com>
To: Michael Witten <mfwitten@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
Date: Mon, 24 Oct 2011 20:35:26 -0500 (CDT) [thread overview]
Message-ID: <Pine.GSO.4.62.1110242033440.5650@umail> (raw)
In-Reply-To: <CAMOZ1Bv23dm3JqR9F2oxsZQV0e1RTi+O7+uUgyAuCSdHtE5ptw@mail.gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 4270 bytes --]
Maybe you are looking at the wrong branch, but I see it in drm-next (it
has been there since Oct 10)
http://cgit.freedesktop.org/~airlied/linux/commit/?h=drm-next&id=c245cb9e15055ed5dcf7eaf29232badb0059fdc1
On Mon, 24 Oct 2011, Michael Witten wrote:
> On Fri, Oct 7, 2011 at 19:20, Michael Witten <mfwitten@gmail.com> wrote:
> Date: Fri, 16 Sep 2011 20:45:30 +0000
>
> The value of RADEON_DEBUGFS_MAX_NUM_FILES has been used to
> specify the size of an array, each element of which looks
> like this:
>
> struct radeon_debugfs {
> struct drm_info_list *files;
> unsigned num_files;
> };
>
> Consequently, the number of debugfs files may be much greater
> than RADEON_DEBUGFS_MAX_NUM_FILES, something that the current
> code ignores:
>
> if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
> DRM_ERROR("Reached maximum number of debugfs files.\n");
> DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
> return -EINVAL;
> }
>
> This commit fixes this mistake, and accordingly renames:
>
> RADEON_DEBUGFS_MAX_NUM_FILES
>
> to:
>
> RADEON_DEBUGFS_MAX_COMPONENTS
>
> Signed-off-by: Michael Witten <mfwitten@gmail.com>
> ---
> drivers/gpu/drm/radeon/radeon.h | 2 +-
> drivers/gpu/drm/radeon/radeon_device.c | 13 ++++++++-----
> 2 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index c1e056b..dd7bab9 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -102,7 +102,7 @@ extern int radeon_pcie_gen2;
> #define RADEON_FENCE_JIFFIES_TIMEOUT (HZ / 2)
> /* RADEON_IB_POOL_SIZE must be a power of 2 */
> #define RADEON_IB_POOL_SIZE 16
> -#define RADEON_DEBUGFS_MAX_NUM_FILES 32
> +#define RADEON_DEBUGFS_MAX_COMPONENTS 32
> #define RADEONFB_CONN_LIMIT 4
> #define RADEON_BIOS_NUM_SCRATCH 8
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index b51e157..31b1f4b 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -981,7 +981,7 @@ struct radeon_debugfs {
> struct drm_info_list *files;
> unsigned num_files;
> };
> -static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_NUM_FILES];
> +static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_COMPONENTS];
> static unsigned _radeon_debugfs_count = 0;
>
> int radeon_debugfs_add_files(struct radeon_device *rdev,
> @@ -996,14 +996,17 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
> return 0;
> }
> }
> - if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
> - DRM_ERROR("Reached maximum number of debugfs files.\n");
> - DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
> +
> + i = _radeon_debugfs_count + 1;
> + if (i > RADEON_DEBUGFS_MAX_COMPONENTS) {
> + DRM_ERROR("Reached maximum number of debugfs components.\n");
> + DRM_ERROR("Report so we increase "
> + "RADEON_DEBUGFS_MAX_COMPONENTS.\n");
> return -EINVAL;
> }
> _radeon_debugfs[_radeon_debugfs_count].files = files;
> _radeon_debugfs[_radeon_debugfs_count].num_files = nfiles;
> - _radeon_debugfs_count++;
> + _radeon_debugfs_count = i;
> #if defined(CONFIG_DEBUG_FS)
> drm_debugfs_create_files(files, nfiles,
> rdev->ddev->control->debugfs_root,
> --
> 1.7.6.409.ge7a85
>
>
This patch has not yet been applied. What's wrong?
Sincerely,
Michael Witten
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2011-10-25 1:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
2011-09-21 22:49 ` [PATCH 1/7] DRM: comment: drm_crtc{=>_helper}_set_mode Michael Witten
2011-09-21 22:50 ` [PATCH 2/7] DRM: comment: halve -> half Michael Witten
2011-09-21 22:50 ` [PATCH 3/7] DRM: cleanup: Remove unused `gamma_size' Michael Witten
2011-09-21 22:50 ` [PATCH 4/7] DRM: comment: gdm_proc_lists -> drm_proc_lists Michael Witten
2011-09-21 22:50 ` [PATCH 5/7] DRM: cleanup: `size == 0' is never true Michael Witten
2011-09-21 22:50 ` [PATCH 6/7] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS} Michael Witten
2011-09-21 22:50 ` [PATCH 7/7] DRM: cleanup: Remove unsused `tmp' Michael Witten
2011-09-22 9:24 ` Michel Dänzer
2011-09-22 17:16 ` Michael Witten
2015-04-14 13:44 ` [PATCH] trivial: Remove unused variable `tmp' from `radeon_combios_get_lvds_info()' Michael Witten
2015-04-14 15:54 ` Michael Witten
2011-09-26 20:47 ` [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
2011-10-07 19:20 ` [PATCH] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS} Michael Witten
2011-10-24 23:21 ` Michael Witten
2011-10-25 1:35 ` Ilija Hadzic [this message]
2011-10-26 15:07 ` Michael Witten
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=Pine.GSO.4.62.1110242033440.5650@umail \
--to=ihadzic@research.bell-labs.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=mfwitten@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