summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2017-04-02 07:03:28 +0200
committerBen Skeggs <bskeggs@redhat.com>2017-04-06 14:53:50 +1000
commit99a97a8ba9881fc47901ff36b057e5cd0bf06af0 (patch)
tree2228a0ea6c09c602ee67777385afe3b517f75850 /drivers/gpu/drm/nouveau
parentb2c4ef70790cee37f243af2b303727394edae1d5 (diff)
downloadop-kernel-dev-99a97a8ba9881fc47901ff36b057e5cd0bf06af0.zip
op-kernel-dev-99a97a8ba9881fc47901ff36b057e5cd0bf06af0.tar.gz
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>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c
index 77c64972..4a57def 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c
@@ -164,7 +164,7 @@ static int
nvkm_gpio_fini(struct nvkm_subdev *subdev, bool suspend)
{
struct nvkm_gpio *gpio = nvkm_gpio(subdev);
- u32 mask = (1 << gpio->func->lines) - 1;
+ u32 mask = (1ULL << gpio->func->lines) - 1;
gpio->func->intr_mask(gpio, NVKM_GPIO_TOGGLED, mask, 0);
gpio->func->intr_stat(gpio, &mask, &mask);
OpenPOWER on IntegriCloud