diff options
Diffstat (limited to 'drivers/dma/ioat/dma.c')
-rw-r--r-- | drivers/dma/ioat/dma.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index 08417ad4edca..5173ba97ba31 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c | |||
@@ -132,7 +132,14 @@ static int ioat1_enumerate_channels(struct ioatdma_device *device) | |||
132 | 132 | ||
133 | INIT_LIST_HEAD(&dma->channels); | 133 | INIT_LIST_HEAD(&dma->channels); |
134 | dma->chancnt = readb(device->reg_base + IOAT_CHANCNT_OFFSET); | 134 | dma->chancnt = readb(device->reg_base + IOAT_CHANCNT_OFFSET); |
135 | dma->chancnt &= 0x1f; /* bits [4:0] valid */ | ||
136 | if (dma->chancnt > ARRAY_SIZE(device->idx)) { | ||
137 | dev_warn(dev, "(%d) exceeds max supported channels (%zu)\n", | ||
138 | dma->chancnt, ARRAY_SIZE(device->idx)); | ||
139 | dma->chancnt = ARRAY_SIZE(device->idx); | ||
140 | } | ||
135 | xfercap_scale = readb(device->reg_base + IOAT_XFERCAP_OFFSET); | 141 | xfercap_scale = readb(device->reg_base + IOAT_XFERCAP_OFFSET); |
142 | xfercap_scale &= 0x1f; /* bits [4:0] valid */ | ||
136 | xfercap = (xfercap_scale == 0 ? -1 : (1UL << xfercap_scale)); | 143 | xfercap = (xfercap_scale == 0 ? -1 : (1UL << xfercap_scale)); |
137 | dev_dbg(dev, "%s: xfercap = %d\n", __func__, xfercap); | 144 | dev_dbg(dev, "%s: xfercap = %d\n", __func__, xfercap); |
138 | 145 | ||