* [PATCH wq#for-linus] drm: fix a fallout from slow-work -> wq conversion [not found] ` <4C5FCF0C.2000100@gmail.com> @ 2010-08-09 10:00 ` Tejun Heo 2010-08-09 10:14 ` Markus Trippelsdorf 0 siblings, 1 reply; 5+ messages in thread From: Tejun Heo @ 2010-08-09 10:00 UTC (permalink / raw) To: Markus Trippelsdorf Cc: Heiko Carstens, walt, linux-kernel, Suresh Siddha, David Airlie, DRI Commit 991ea75c (drm: use workqueue instead of slow-work), which made drm to use wq instead of slow-work, didn't account for the return value difference between delayed_slow_work_enqueue() and queue_delayed_work(). The former returns 0 on success and -errno on failures while the latter never fails and only uses the return value to indicate whether the work was already pending or not. This misconversion triggered spurious error messages. Remove the now unnecessary return value check and error message. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.freedesktop.org --- Markus, it's almost trivial but it would be great if you can test this one too. David, may I route this wq#for-linus? Thanks. drivers/gpu/drm/drm_crtc_helper.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 4598130..211ed7e 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -839,7 +839,6 @@ static void output_poll_execute(struct work_struct *work) struct drm_connector *connector; enum drm_connector_status old_status, status; bool repoll = false, changed = false; - int ret; mutex_lock(&dev->mode_config.mutex); list_for_each_entry(connector, &dev->mode_config.connector_list, head) { @@ -874,11 +873,8 @@ static void output_poll_execute(struct work_struct *work) dev->mode_config.funcs->output_poll_changed(dev); } - if (repoll) { - ret = queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); - if (ret) - DRM_ERROR("delayed enqueue failed %d\n", ret); - } + if (repoll) + queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); } void drm_kms_helper_poll_disable(struct drm_device *dev) ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH wq#for-linus] drm: fix a fallout from slow-work -> wq conversion 2010-08-09 10:00 ` [PATCH wq#for-linus] drm: fix a fallout from slow-work -> wq conversion Tejun Heo @ 2010-08-09 10:14 ` Markus Trippelsdorf 2010-08-09 10:20 ` [PATCH] drm: fix fallouts " Tejun Heo 0 siblings, 1 reply; 5+ messages in thread From: Markus Trippelsdorf @ 2010-08-09 10:14 UTC (permalink / raw) To: Tejun Heo Cc: Heiko Carstens, walt, linux-kernel, Suresh Siddha, David Airlie, DRI On Mon, Aug 09, 2010 at 12:00:49PM +0200, Tejun Heo wrote: > Commit 991ea75c (drm: use workqueue instead of slow-work), which made > drm to use wq instead of slow-work, didn't account for the return > value difference between delayed_slow_work_enqueue() and > queue_delayed_work(). The former returns 0 on success and -errno on > failures while the latter never fails and only uses the return value > to indicate whether the work was already pending or not. > > This misconversion triggered spurious error messages. Remove the now > unnecessary return value check and error message. > > Signed-off-by: Tejun Heo <tj@kernel.org> > Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de> > Cc: David Airlie <airlied@linux.ie> > Cc: dri-devel@lists.freedesktop.org > --- > Markus, it's almost trivial but it would be great if you can test this > one too. Looks good, but drm_kms_helper_poll_disable needs the same treatment. diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 4598130..b9e4dbf 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -839,7 +839,6 @@ static void output_poll_execute(struct work_struct *work) struct drm_connector *connector; enum drm_connector_status old_status, status; bool repoll = false, changed = false; - int ret; mutex_lock(&dev->mode_config.mutex); list_for_each_entry(connector, &dev->mode_config.connector_list, head) { @@ -874,11 +873,8 @@ static void output_poll_execute(struct work_struct *work) dev->mode_config.funcs->output_poll_changed(dev); } - if (repoll) { - ret = queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); - if (ret) - DRM_ERROR("delayed enqueue failed %d\n", ret); - } + if (repoll) + queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); } void drm_kms_helper_poll_disable(struct drm_device *dev) @@ -893,18 +889,14 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) { bool poll = false; struct drm_connector *connector; - int ret; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { if (connector->polled) poll = true; } - if (poll) { - ret = queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); - if (ret) - DRM_ERROR("delayed enqueue failed %d\n", ret); - } + if (poll) + queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); } EXPORT_SYMBOL(drm_kms_helper_poll_enable); -- »A man who doesn't know he is in prison can never escape.« William S. Burroughs ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] drm: fix fallouts from slow-work -> wq conversion 2010-08-09 10:14 ` Markus Trippelsdorf @ 2010-08-09 10:20 ` Tejun Heo 2010-08-09 14:00 ` walt 2018-06-19 20:32 ` Dave Airlie 0 siblings, 2 replies; 5+ messages in thread From: Tejun Heo @ 2010-08-09 10:20 UTC (permalink / raw) To: Markus Trippelsdorf Cc: Heiko Carstens, walt, linux-kernel, Suresh Siddha, David Airlie, DRI >From 9a919c46dfa48a9c1f465174609b90253eb8ffc1 Mon Sep 17 00:00:00 2001 From: Tejun Heo <tj@kernel.org> Date: Mon, 9 Aug 2010 12:01:27 +0200 Commit 991ea75c (drm: use workqueue instead of slow-work), which made drm to use wq instead of slow-work, didn't account for the return value difference between delayed_slow_work_enqueue() and queue_delayed_work(). The former returns 0 on success and -errno on failures while the latter never fails and only uses the return value to indicate whether the work was already pending or not. This misconversion triggered spurious error messages. Remove the now unnecessary return value check and error message. Markus: caught another incorrect conversion in drm_kms_helper_poll_enable() Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de> Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.freedesktop.org --- Oops, you're right. So, this should do it. Thank you. drivers/gpu/drm/drm_crtc_helper.c | 16 ++++------------ 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 4598130..b9e4dbf 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -839,7 +839,6 @@ static void output_poll_execute(struct work_struct *work) struct drm_connector *connector; enum drm_connector_status old_status, status; bool repoll = false, changed = false; - int ret; mutex_lock(&dev->mode_config.mutex); list_for_each_entry(connector, &dev->mode_config.connector_list, head) { @@ -874,11 +873,8 @@ static void output_poll_execute(struct work_struct *work) dev->mode_config.funcs->output_poll_changed(dev); } - if (repoll) { - ret = queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); - if (ret) - DRM_ERROR("delayed enqueue failed %d\n", ret); - } + if (repoll) + queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); } void drm_kms_helper_poll_disable(struct drm_device *dev) @@ -893,18 +889,14 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) { bool poll = false; struct drm_connector *connector; - int ret; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { if (connector->polled) poll = true; } - if (poll) { - ret = queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); - if (ret) - DRM_ERROR("delayed enqueue failed %d\n", ret); - } + if (poll) + queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); } EXPORT_SYMBOL(drm_kms_helper_poll_enable); -- 1.7.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm: fix fallouts from slow-work -> wq conversion 2010-08-09 10:20 ` [PATCH] drm: fix fallouts " Tejun Heo @ 2010-08-09 14:00 ` walt 2018-06-19 20:32 ` Dave Airlie 1 sibling, 0 replies; 5+ messages in thread From: walt @ 2010-08-09 14:00 UTC (permalink / raw) To: Tejun Heo Cc: Markus Trippelsdorf, Heiko Carstens, linux-kernel, Suresh Siddha, David Airlie, DRI On 08/09/2010 03:20 AM, Tejun Heo wrote: > From 9a919c46dfa48a9c1f465174609b90253eb8ffc1 Mon Sep 17 00:00:00 2001 > From: Tejun Heo<tj@kernel.org> > Date: Mon, 9 Aug 2010 12:01:27 +0200 > > Commit 991ea75c (drm: use workqueue instead of slow-work), which made > drm to use wq instead of slow-work, didn't account for the return > value difference between delayed_slow_work_enqueue() and > queue_delayed_work(). The former returns 0 on success and -errno on > failures while the latter never fails and only uses the return value > to indicate whether the work was already pending or not. > > This misconversion triggered spurious error messages. Remove the now > unnecessary return value check and error message. > diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c > index 4598130..b9e4dbf 100644 > --- a/drivers/gpu/drm/drm_crtc_helper.c > +++ b/drivers/gpu/drm/drm_crtc_helper.c > @@ -839,7 +839,6 @@ static void output_poll_execute(struct work_struct *work) > struct drm_connector *connector; > enum drm_connector_status old_status, status; > bool repoll = false, changed = false; > - int ret; > > mutex_lock(&dev->mode_config.mutex); > list_for_each_entry(connector,&dev->mode_config.connector_list, head) { > @@ -874,11 +873,8 @@ static void output_poll_execute(struct work_struct *work) > dev->mode_config.funcs->output_poll_changed(dev); > } > > - if (repoll) { > - ret = queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); > - if (ret) > - DRM_ERROR("delayed enqueue failed %d\n", ret); > - } > + if (repoll) > + queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); > } > > void drm_kms_helper_poll_disable(struct drm_device *dev) > @@ -893,18 +889,14 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) > { > bool poll = false; > struct drm_connector *connector; > - int ret; > > list_for_each_entry(connector,&dev->mode_config.connector_list, head) { > if (connector->polled) > poll = true; > } > > - if (poll) { > - ret = queue_delayed_work(system_nrt_wq,&dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); > - if (ret) > - DRM_ERROR("delayed enqueue failed %d\n", ret); > - } > + if (poll) > + queue_delayed_work(system_nrt_wq,&dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); > } > EXPORT_SYMBOL(drm_kms_helper_poll_enable); I was getting the same spurious error messages, and this patches fixes it, thanks. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm: fix fallouts from slow-work -> wq conversion 2010-08-09 10:20 ` [PATCH] drm: fix fallouts " Tejun Heo 2010-08-09 14:00 ` walt @ 2018-06-19 20:32 ` Dave Airlie 1 sibling, 0 replies; 5+ messages in thread From: Dave Airlie @ 2018-06-19 20:32 UTC (permalink / raw) To: Tejun Heo Cc: Suresh Siddha, David Airlie, Heiko Carstens, LKML, DRI, walt, Markus Trippelsdorf On 9 August 2010 at 20:20, Tejun Heo <htejun@gmail.com> wrote: > >From 9a919c46dfa48a9c1f465174609b90253eb8ffc1 Mon Sep 17 00:00:00 2001 > From: Tejun Heo <tj@kernel.org> > Date: Mon, 9 Aug 2010 12:01:27 +0200 > > Commit 991ea75c (drm: use workqueue instead of slow-work), which made > drm to use wq instead of slow-work, didn't account for the return > value difference between delayed_slow_work_enqueue() and > queue_delayed_work(). The former returns 0 on success and -errno on > failures while the latter never fails and only uses the return value > to indicate whether the work was already pending or not. > > This misconversion triggered spurious error messages. Remove the now > unnecessary return value check and error message. > > Markus: caught another incorrect conversion in drm_kms_helper_poll_enable() Acked-by: David Airlie <airlied@linux.ie> For queuing via your tree. Thanks, Dave. > > Signed-off-by: Tejun Heo <tj@kernel.org> > Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de> > Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de> > Cc: David Airlie <airlied@linux.ie> > Cc: dri-devel@lists.freedesktop.org > --- > Oops, you're right. So, this should do it. > > Thank you. > > drivers/gpu/drm/drm_crtc_helper.c | 16 ++++------------ > 1 files changed, 4 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c > index 4598130..b9e4dbf 100644 > --- a/drivers/gpu/drm/drm_crtc_helper.c > +++ b/drivers/gpu/drm/drm_crtc_helper.c > @@ -839,7 +839,6 @@ static void output_poll_execute(struct work_struct *work) > struct drm_connector *connector; > enum drm_connector_status old_status, status; > bool repoll = false, changed = false; > - int ret; > > mutex_lock(&dev->mode_config.mutex); > list_for_each_entry(connector, &dev->mode_config.connector_list, head) { > @@ -874,11 +873,8 @@ static void output_poll_execute(struct work_struct *work) > dev->mode_config.funcs->output_poll_changed(dev); > } > > - if (repoll) { > - ret = queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); > - if (ret) > - DRM_ERROR("delayed enqueue failed %d\n", ret); > - } > + if (repoll) > + queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); > } > > void drm_kms_helper_poll_disable(struct drm_device *dev) > @@ -893,18 +889,14 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) > { > bool poll = false; > struct drm_connector *connector; > - int ret; > > list_for_each_entry(connector, &dev->mode_config.connector_list, head) { > if (connector->polled) > poll = true; > } > > - if (poll) { > - ret = queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); > - if (ret) > - DRM_ERROR("delayed enqueue failed %d\n", ret); > - } > + if (poll) > + queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); > } > EXPORT_SYMBOL(drm_kms_helper_poll_enable); > > -- > 1.7.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-06-19 20:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <i3n3dh$t48$1@dough.gmane.org>
[not found] ` <20100809063742.GA1632@arch.tripp.de>
[not found] ` <20100809083053.GB2169@osiris.boeblingen.de.ibm.com>
[not found] ` <20100809083451.GC2169@osiris.boeblingen.de.ibm.com>
[not found] ` <4C5FC49B.9040208@kernel.org>
[not found] ` <4C5FCC14.6030901@gmail.com>
[not found] ` <20100809094630.GA1603@arch.tripp.de>
[not found] ` <4C5FCF0C.2000100@gmail.com>
2010-08-09 10:00 ` [PATCH wq#for-linus] drm: fix a fallout from slow-work -> wq conversion Tejun Heo
2010-08-09 10:14 ` Markus Trippelsdorf
2010-08-09 10:20 ` [PATCH] drm: fix fallouts " Tejun Heo
2010-08-09 14:00 ` walt
2018-06-19 20:32 ` Dave Airlie
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox