mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Chris Metcalf <cmetcalf@tilera.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 04/14] arch/tile: change lower bound on syscall error return to -4095
Date: Fri, 15 Oct 2010 22:03:54 +0200	[thread overview]
Message-ID: <201010152203.54665.arnd@arndb.de> (raw)
In-Reply-To: <4CB88C9F.7040109@tilera.com>

On Friday 15 October 2010 19:17:19 Chris Metcalf wrote:
>  On 10/14/2010 5:22 PM, Arnd Bergmann wrote:
> > On Thursday 14 October 2010 21:14:29 Chris Metcalf wrote:
> >> Previously we were using -1023, which is fine for normal syscall
> >> error returns, but the common value in use for other platforms
> >> is -4095, and one Tilera-specific driver does use values in the
> >> -1100 range, so tickled this bug.
> > The patch is ok, but note that any value above starting at 512 is meant
> > as kernel internal, so funny things may happen if a driver goes
> > beyond that for errors returned to the user.
> >
> > Better use just the predefined error codes if possible.
> 
> Thanks, good point.  In practice we've found that for the syscalls we use
> (e.g. pwrite) that are intended to return errors codes from our drivers the
> errors are in fact properly returned.  But I've filed a bug internally that
> we should review our usage of error codes and determine if there are more
> standard ways to handle this, e.g. return a Linux errno but allow passing a
> pointer to store a more specific hypervisor or driver error code in.

I think in general I'd do something like return -EIO with a hardware or
hypervisor result code written to memory if that happens. In specific
drivers there may of course be a better way.

	Arnd

  reply	other threads:[~2010-10-15 20:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 21:04 [PATCH 00/14] initial batch of changes for arch/tile for 2.6.37 Chris Metcalf
2010-10-14 18:54 ` [PATCH 01/14] kmemleak: add TILE to the list of supported architectures Chris Metcalf
2010-10-14 19:09 ` [PATCH 02/14] arch/tile: provide a definition of MAP_STACK Chris Metcalf
2010-10-14 19:12 ` [PATCH 03/14] arch/tile: properly export __mb_incoherent for modules Chris Metcalf
2010-10-14 19:14 ` [PATCH 04/14] arch/tile: change lower bound on syscall error return to -4095 Chris Metcalf
2010-10-14 21:22   ` Arnd Bergmann
2010-10-15 17:17     ` Chris Metcalf
2010-10-15 20:03       ` Arnd Bergmann [this message]
2010-10-14 19:16 ` [PATCH 05/14] arch/tile: various top-level Makefile cleanups Chris Metcalf
2010-10-14 19:19 ` [PATCH 06/14] arch/tile: prevent corrupt top frame from causing backtracer runaway Chris Metcalf
2010-10-14 19:57 ` [PATCH 07/14] arch/tile: Bomb C99 comments to C89 comments in tile's <arch/sim_def.h> Chris Metcalf
2010-10-14 20:00 ` [PATCH 08/14] arch/tile: add Tilera's <arch/sim.h> header as an open-source header Chris Metcalf
2010-10-14 20:23 ` [PATCH 09/14] arch/tile: parameterize system PLs to support KVM port Chris Metcalf
2010-10-14 20:32 ` [PATCH 10/14] arch/tile: enable single-step support for TILE-Gx Chris Metcalf
2010-10-14 20:39 ` [PATCH 11/14] arch/tile: minor whitespace/naming changes for string support files Chris Metcalf
2010-10-14 20:46 ` [PATCH 12/14] arch/tile: support new info op generated by compiler Chris Metcalf
2010-10-14 20:48 ` [PATCH 13/14] arch/tile: make ptrace() work properly for TILE-Gx COMPAT mode Chris Metcalf
2010-10-14 20:50 ` [PATCH 14/14] arch/tile: convert a BUG_ON to BUILD_BUG_ON Chris Metcalf

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=201010152203.54665.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=cmetcalf@tilera.com \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome