All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: fix writing to /sys/class/drm/*/status
Date: Fri, 5 Jun 2015 20:24:00 +0100	[thread overview]
Message-ID: <20150605192400.GP7557@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20150605185638.GX27056@nuc-i3427.alporthouse.com>

On Fri, Jun 05, 2015 at 07:56:38PM +0100, Chris Wilson wrote:
> On Fri, Jun 05, 2015 at 07:47:22PM +0100, Russell King wrote:
> > Writing to a file is supposed to return the number of bytes written.
> > Returning zero unfortunately causes bash to constantly spin trying
> > to write to the sysfs file, to such an extent that even ^c and ^z
> > have no effect.  The only way out of that is to kill the shell and
> > log back in.  This isn't nice behaviour.
> > 
> > Fix it by returning the number of characters written to sysfs files.
> > 
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> Oops.
> 
> Fixes: c484f02d0f02fbbfc6decc945a69aae011041a27
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Dave, we need this for 4.1...

Viro suggests an alternative, simpler fix:

diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index ffc305fc2076..eb7e61078a5b 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -217,7 +217,7 @@ static ssize_t status_store(struct device *device,
 
 	mutex_unlock(&dev->mode_config.mutex);
 
-	return ret;
+	return ret ? ret : count;
 }
 
 static ssize_t status_show(struct device *device,

Would you prefer this one?

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2015-06-05 19:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 18:47 [PATCH] drm: fix writing to /sys/class/drm/*/status Russell King
2015-06-05 18:56 ` Chris Wilson
2015-06-05 19:24   ` Russell King - ARM Linux [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=20150605192400.GP7557@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=chris@chris-wilson.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.