From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F023C43603 for ; Tue, 10 Dec 2019 05:51:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12A2420663 for ; Tue, 10 Dec 2019 05:51:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="jHN/De11" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726986AbfLJFvS (ORCPT ); Tue, 10 Dec 2019 00:51:18 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:12417 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbfLJFvR (ORCPT ); Tue, 10 Dec 2019 00:51:17 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 09 Dec 2019 21:51:10 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 09 Dec 2019 21:51:16 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 09 Dec 2019 21:51:16 -0800 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 10 Dec 2019 05:51:15 +0000 Received: from [10.2.166.216] (10.124.1.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 10 Dec 2019 05:51:14 +0000 Subject: Re: [PATCH v8 17/26] media/v4l2-core: set pages dirty upon releasing DMA buffers To: Andrew Morton CC: Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Christoph Hellwig , Dan Williams , Daniel Vetter , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , Jason Gunthorpe , Jens Axboe , Jonathan Corbet , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Magnus Karlsson , "Mauro Carvalho Chehab" , Michael Ellerman , Michal Hocko , Mike Kravetz , "Paul Mackerras" , Shuah Khan , Vlastimil Babka , , , , , , , , , , , , , LKML , Christoph Hellwig , Hans Verkuil , References: <20191209225344.99740-1-jhubbard@nvidia.com> <20191209225344.99740-18-jhubbard@nvidia.com> <20191209165627.bf657cb8fdf660e8f91e966c@linux-foundation.org> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Mon, 9 Dec 2019 21:48:24 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20191209165627.bf657cb8fdf660e8f91e966c@linux-foundation.org> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1575957070; bh=KRjfdSXWCfXtj0zEL6nFRN1GkUl6vp+XI3HBba/YpY8=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=jHN/De11w2qJ/2Whqsz+5DRlqwutNcV+vDNiSEKXdDcKWt78VSxoGM0nLPdizxgSb M4m/UOUskWnEyCPODO9f1DYcD6hEBbJk74+kHw/LlXQq1xUnySbFRplwJNaq5NrVaz jsqdkry+cVNaNaRw3VxAVr3+cs8cvcJ783ZVBXMfF/rtOeLzgMzsIx2ydS3WZJvth1 OfB3+NCkepaNAqgI1WYky+kXprKnYMmI09kgA9JzYnAnbh34pgq9lGMtxcjGnUZ1yV PAP6rWIOB+cdLSKZhfV+SBX5T+eEKD+BSQbO+Vj2XcjLK4iwQtiCrGuqh1R5ggXhEY xtGKcG+Qp/n6Q== Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On 12/9/19 4:56 PM, Andrew Morton wrote: > On Mon, 9 Dec 2019 14:53:35 -0800 John Hubbard wrote: > >> After DMA is complete, and the device and CPU caches are synchronized, >> it's still required to mark the CPU pages as dirty, if the data was >> coming from the device. However, this driver was just issuing a >> bare put_page() call, without any set_page_dirty*() call. >> >> Fix the problem, by calling set_page_dirty_lock() if the CPU pages >> were potentially receiving data from the device. >> >> Reviewed-by: Christoph Hellwig >> Acked-by: Hans Verkuil >> Cc: Mauro Carvalho Chehab >> Cc: > > What are the user-visible effects of this change? I'll have to defer to Hans or other experts, because I merely spotted this by reading the code. > > As it's cc:stable I'd normally send this to Linus within 1-2 weeks, or > sooner. Please confirm that this is a standalone fix, independent of > the rest of this series. > > Yes, this is a stand-alone fix. Of course, as part of this series, the put_page() gets converted to put_user_pages_dirty() in the next patch, and that in turn gets renamed to unpin_user_pages_dirty() in a later patch. Just so we keep that in mind when moving patches around. thanks, -- John Hubbard NVIDIA