From: poma <pomidorabelisima@gmail.com>
To: Dave Airlie <airlied@gmail.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/udl: make control msg static const.
Date: Tue, 8 Nov 2016 08:41:49 +0100 [thread overview]
Message-ID: <3214de21-b994-8381-2f2b-e7e64cdc2ce0@gmail.com> (raw)
In-Reply-To: <1478587169-20462-1-git-send-email-airlied@gmail.com>
On 08.11.2016 07:39, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> Thou shall not send control msg from the stack,
> does that mean I can send it from the RO memory area?
>
> Reported-by: poma
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
> drivers/gpu/drm/udl/udl_main.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
> index 29f0207..0798bcc 100644
> --- a/drivers/gpu/drm/udl/udl_main.c
> +++ b/drivers/gpu/drm/udl/udl_main.c
> @@ -98,10 +98,10 @@ static int udl_parse_vendor_descriptor(struct drm_device *dev,
> static int udl_select_std_channel(struct udl_device *udl)
> {
> int ret;
> - u8 set_def_chn[] = {0x57, 0xCD, 0xDC, 0xA7,
> - 0x1C, 0x88, 0x5E, 0x15,
> - 0x60, 0xFE, 0xC6, 0x97,
> - 0x16, 0x3D, 0x47, 0xF2};
> + static const u8 set_def_chn[] = {0x57, 0xCD, 0xDC, 0xA7,
> + 0x1C, 0x88, 0x5E, 0x15,
> + 0x60, 0xFE, 0xC6, 0x97,
> + 0x16, 0x3D, 0x47, 0xF2};
>
> ret = usb_control_msg(udl->udev,
> usb_sndctrlpipe(udl->udev, 0),
>
There is a compile time WARN:
$ make drivers/gpu/drm/udl/udl.ko
...
CC [M] drivers/gpu/drm/udl/udl_fb.o
drivers/gpu/drm/udl/udl_main.c: In function ‘udl_select_std_channel’:
drivers/gpu/drm/udl/udl_main.c:110:10: warning: passing argument 7 of ‘usb_control_msg’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
set_def_chn, sizeof(set_def_chn),
^~~~~~~~~~~
In file included from drivers/gpu/drm/udl/udl_drv.h:17:0,
from drivers/gpu/drm/udl/udl_main.c:14:
./include/linux/usb.h:1685:12: note: expected ‘void *’ but argument is of type ‘const u8 * {aka const unsigned char *}’
extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
^~~~~~~~~~~~~~~
CC [M] drivers/gpu/drm/udl/udl_transfer.o
CC [M] drivers/gpu/drm/udl/udl_gem.o
CC [M] drivers/gpu/drm/udl/udl_dmabuf.o
LD [M] drivers/gpu/drm/udl/udl.o
MODPOST 1 modules
CC drivers/gpu/drm/udl/udl.mod.o
LD [M] drivers/gpu/drm/udl/udl.ko
Also there is a flood of waiting for request block:
$ dmesg | grep -P '(?=.*drm)(?=.*urb)'
[ 72.482211] [drm] wait for urb interrupted: ffffffc2 available: 0
[ 75.552227] [drm] wait for urb interrupted: ffffffc2 available: 0
[ 76.576146] [drm] wait for urb interrupted: ffffffc2 available: 0
...
[ 100.192153] [drm] wait for urb interrupted: ffffffc2 available: 0
[ 101.216166] [drm] wait for urb interrupted: ffffffc2 available: 0
[ 102.240141] [drm] wait for urb interrupted: ffffffc2 available: 0
...
[ 200.416146] [drm] wait for urb interrupted: ffffffc2 available: 0
[ 201.440208] [drm] wait for urb interrupted: ffffffc2 available: 0
[ 204.384162] [drm] wait for urb interrupted: ffffffc2 available: 0
...
[ 300.448151] [drm] wait for urb interrupted: ffffffc2 available: 0
[ 301.920166] [drm] wait for urb interrupted: ffffffc2 available: 0
[ 304.416147] [drm] wait for urb interrupted: ffffffc2 available: 0
...
[ 370.016157] [drm] wait for urb interrupted: ffffffc2 available: 0
...
And finally,
Master Chef's special, the machine is KO'd due to trying out a module reload.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2016-11-08 7:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 6:39 [PATCH] drm/udl: make control msg static const Dave Airlie
2016-11-08 7:41 ` poma [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=3214de21-b994-8381-2f2b-e7e64cdc2ce0@gmail.com \
--to=pomidorabelisima@gmail.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.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