]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/gpio: enable interrupts on cards with 32 gpio lines
authorAdam Borowski <kilobyte@angband.pl>
Sun, 2 Apr 2017 05:03:28 +0000 (07:03 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 6 Apr 2017 04:53:50 +0000 (14:53 +1000)
commit514587524dc762ac784bd996c06f1d805e6a31df
tree2228a0ea6c09c602ee67777385afe3b517f75850
parent22a2e2d36da677544f9f7305330dc02a089c14e1
drm/nouveau/gpio: enable interrupts on cards with 32 gpio lines

The code attempts to enable them, but hits an undefined behaviour by
shifting by the entire register's width:

    int lines = 32;
    u32 mask = (1 << lines) - 1;    // 00000000 on x86
    u32 mask = (1 << lines) - 1;    // ffffffff on arm (32)
    u32 mask = (1 << lines) - 1;    // 00000000 on arm64
    u32 mask = (1ULL << lines) - 1; // ffffffff everywhere

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c