From patchwork Tue Dec 1 15:30:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: m-karicheri2@ti.com X-Patchwork-Id: 2225 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Tue, 01 Dec 2009 15:30:28 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Tue, 01 Dec 2009 13:31:02 -0200 (BRST) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NFUgO-0001LT-9x; Tue, 01 Dec 2009 15:30:28 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753148AbZLAPaU (ORCPT + 1 other); Tue, 1 Dec 2009 10:30:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752199AbZLAPaT (ORCPT ); Tue, 1 Dec 2009 10:30:19 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:33345 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751944AbZLAPaT (ORCPT ); Tue, 1 Dec 2009 10:30:19 -0500 Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id nB1FUHZM019084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Dec 2009 09:30:17 -0600 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id nB1FUGtR021399; Tue, 1 Dec 2009 09:30:17 -0600 (CST) Received: from gt516km11.gt.design.ti.com (gt516km11.gt.design.ti.com [158.218.100.179]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id nB1FUGZ12030; Tue, 1 Dec 2009 09:30:16 -0600 (CST) Received: from gt516km11.gt.design.ti.com (localhost.localdomain [127.0.0.1]) by gt516km11.gt.design.ti.com (8.13.1/8.13.1) with ESMTP id nB1FUFn9030273; Tue, 1 Dec 2009 10:30:16 -0500 Received: (from a0868495@localhost) by gt516km11.gt.design.ti.com (8.13.1/8.13.1/Submit) id nB1FUEYp030270; Tue, 1 Dec 2009 10:30:14 -0500 From: m-karicheri2@ti.com To: linux-media@vger.kernel.org, magnus.damm@gmail.com, mchehab@infradead.org Cc: davinci-linux-open-source@linux.davincidsp.com, Muralidharan Karicheri Subject: [PATCH] V4L - Fix videobuf_dma_contig_user_get() getting page aligned physical address Date: Tue, 1 Dec 2009 10:30:14 -0500 Message-Id: <1259681414-30246-1-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.6.0.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Muralidharan Karicheri If a USERPTR address that is not aligned to page boundary is passed to the videobuf_dma_contig_user_get() function, it saves a page aligned address to the dma_handle. This is not correct. This issue is observed when using USERPTR IO machism for buffer exchange. Signed-off-by: Muralidharan Karicheri --- Applies to V4L-DVB linux-next branch drivers/media/video/videobuf-dma-contig.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/videobuf-dma-contig.c b/drivers/media/video/videobuf-dma-contig.c index d25f284..928dfa1 100644 --- a/drivers/media/video/videobuf-dma-contig.c +++ b/drivers/media/video/videobuf-dma-contig.c @@ -166,7 +166,8 @@ static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem, break; if (pages_done == 0) - mem->dma_handle = this_pfn << PAGE_SHIFT; + mem->dma_handle = (this_pfn << PAGE_SHIFT) + + (vb->baddr & ~PAGE_MASK); else if (this_pfn != (prev_pfn + 1)) ret = -EFAULT;