From: Stephen Rothwell Date: Tue, 13 Dec 2011 06:18:56 +0000 (+1100) Subject: Merge remote-tracking branch 'kmap_atomic/kmap_atomic' X-Git-Tag: next-20111213~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=48d66b199595f44c64c5cf23df76c827e7417fa9;p=karo-tx-linux.git Merge remote-tracking branch 'kmap_atomic/kmap_atomic' Conflicts: Documentation/feature-removal-schedule.txt --- 48d66b199595f44c64c5cf23df76c827e7417fa9 diff --cc Documentation/feature-removal-schedule.txt index cb268d1d7e54,65aef30315ee..a5267798edd5 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@@ -542,12 -554,8 +542,20 @@@ Who: Don Fry ++ ++---------------------------- ++ + What: kmap_atomic(page, km_type) + When: 3.5 + Why: The old kmap_atomic() with two arguments is deprecated, we only + keep it for backward compatibility for few cycles and then drop it. + Who: Cong Wang diff --cc drivers/staging/hv/storvsc_drv.c index eb853f71089a,05b8bdc09bf4..ddbdec8f57fa --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@@ -965,27 -870,9 +964,27 @@@ static unsigned int copy_from_bounce_bu if (bounce_sgl[j].offset == bounce_sgl[j].length) { /* full */ - kunmap_atomic((void *)bounce_addr, KM_IRQ0); + kunmap_atomic((void *)bounce_addr); j++; + /* + * It is possible that the number of elements + * in the bounce buffer may not be equal to + * the number of elements in the original + * scatter list. Handle this correctly. + */ + + if (j == bounce_sgl_count) { + /* + * We are done; cleanup and return. + */ + kunmap_atomic((void *)(dest_addr - + orig_sgl[i].offset), + KM_IRQ0); + local_irq_restore(flags); + return total_copied; + } + /* if we need to use another bounce buffer */ if (destlen || i != orig_sgl_count - 1) bounce_addr =