Commit 2f27224
usb: dwc2: use temporary URB buffer for small control transfers
As a result of a hardware bug, small IN packets with length < 4 cause a
4-byte write to memory. Generally, buffers allocated with kmalloc
reserve at least one cacheline of memory, but the UVC driver passes
offsets into a struct as the buffer. This causes trampling of video
control min/max/default/range data.
e.g. on a generic UVC camera, these default values are nonsense:
$ v4l2-ctl -d0 --all
[...]
brightness 0x00980900 (int) : min=0 max=255 step=1 default=-8193 value=128
contrast 0x00980901 (int) : min=0 max=100 step=1 default=57343 value=67
saturation 0x00980902 (int) : min=0 max=100 step=1 default=57343 value=62
hue 0x00980903 (int) : min=-90 max=90 step=2 default=12287 value=0
gamma 0x00980910 (int) : min=1 max=30 step=1 default=57343 value=29
[...]
Update the pre-existing DMA alignment code to catch this case.
Link: raspberrypi#3148
Signed-off-by: Jonathan Bell <[email protected]>1 parent 1f73a67 commit 2f27224
1 file changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2469 | 2469 | | |
2470 | 2470 | | |
2471 | 2471 | | |
| 2472 | + | |
2472 | 2473 | | |
2473 | | - | |
2474 | | - | |
2475 | | - | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
2476 | 2489 | | |
2477 | 2490 | | |
2478 | 2491 | | |
| |||
0 commit comments