• Daniel Vetter's avatar
    drm: Use EOPNOTSUPP, not ENOTSUPP · c7581a41
    Daniel Vetter authored
    - it's what we recommend in our docs:
    
    https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#recommended-ioctl-return-values
    
    - it's the overwhelmingly used error code for "operation not
      supported", at least in drm core (slightly less so in drivers):
    
    $ git grep EOPNOTSUPP -- drivers/gpu/drm/*c | wc -l
    83
    $ git grep ENOTSUPP -- drivers/gpu/drm/*c | wc -l
    5
    
    - include/linux/errno.h makes it fairly clear that these are for nfsv3
      (plus they also have error codes above 512, which is the block with
      some special behaviour ...)
    
    /* Defined for the NFSv3 protocol */
    
    If the above isn't reflecting current practice, then I guess we should
    at least update the docs.
    
    Noralf commented:
    
    Ben Hutchings made this comment[1] in a thread about use of ENOTSUPP in
    drivers:
    
      glibc's strerror() returns these strings for ENOTSUPP and EOPNOTSUPP
      respectively:
    
      "Unknown error 524"
      "Operation not supported"
    
    So at least for errors returned to userspace EOPNOTSUPP makes sense.
    
    José asked:
    
    > Hopefully this will not break any userspace
    
    None of the functions in drm_edid.c affected by this reach userspace,
    it's all driver internal.
    
    Same for the mipi function, that error code should be handled by
    drivers. Drivers are supposed to remap "the hw is on fire" to EIO when
    reporting up to userspace, but I think if a driver sees this it would
    be a driver bug.
    v2: Augment commit message with comments from Noralf and José
    Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
    Acked-by: default avatarNoralf Trønnes <noralf@tronnes.org>
    Cc: José Roberto de Souza <jose.souza@intel.com>
    Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Cc: Maxime Ripard <mripard@kernel.org>
    Cc: Sean Paul <sean@poorly.run>
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Cc: Andres Rodriguez <andresx7@gmail.com>
    Cc: Noralf Trønnes <noralf@tronnes.org>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190904143942.31756-1-daniel.vetter@ffwll.ch
    c7581a41
drm_edid.c 166 KB