Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1147430pxb; Thu, 28 Jan 2021 09:04:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHgEvKTO0U+0rbpGtodEDvN+F/GcrD4HteUq67XwIzFH4QDPcMSMi+3sFUsVPQ4Q0dxuHY X-Received: by 2002:a17:907:16a2:: with SMTP id hc34mr315668ejc.9.1611853482369; Thu, 28 Jan 2021 09:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611853482; cv=none; d=google.com; s=arc-20160816; b=AmVq8HeAQ+zAdCLUl/6gSbRIjyfWFzn1/BRNSQtlP/ow3QqGyJ7PP9tblY8BapHt2S /6UqRfQ2IME+3DydoegCXQC+5XAP1U0Yu+oFS30Rdqs/v81pFEAcJWoKsPH6JD0U5fou p/DnS1C3QwOKaOIgN3yZ0QduSLl4XehaN5V1YXsX53yv0WirRdxcbpL7CrY4E+kRe8q3 Grc8a4Pr5xc534aVspfmRKGYat49WftI7fwnBx/zADJ30S2aDgP3mgxZrLhaJ6/pvqGQ VthHLliwzTyREw4QaST4xiJMZuHYuzEefLQ2Q+pFT1a8XolITI0X31IR/03y+HcyUE+t Qm4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gar8fBlSsZFzuxpXobcokllNvMKbpQD2Smckqot5AV0=; b=SAPHrWz1SHtGCcfeYUCpAQBCyV8kGz4gogZYLSxQNr6kNZsnoW7JZXFTI+u8Hzil/Z arZI+JKThzSDkZG0VyQ3i58u5PHHt33Es6Y91F74KpAy99PdFY8oDSjFGPsh1HoGvJ8v EKB70p4JECya8f+UrA8wkAEuPhp93Q00Ofh0svYwGa8UD1GIMkvx5sl9LhdiDLw2AW2N lgfZDHXp9lvE2Ajf41qsQ6SYGFzLlnpBX2Io4N8e1sluFSQJNCLVDuLIvT1It8tRdCgR gYQlxs8F37Fvl3sMTVw6MBbVs1gxCjJJHPiM1kkE005bo02ESRrcF9sYhc8OgfwctC4k pqxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=R3385CED; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b41si3777213edf.593.2021.01.28.09.04.17; Thu, 28 Jan 2021 09:04:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=R3385CED; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232819AbhA1RDQ (ORCPT + 99 others); Thu, 28 Jan 2021 12:03:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232709AbhA1RBw (ORCPT ); Thu, 28 Jan 2021 12:01:52 -0500 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9951C0613D6 for ; Thu, 28 Jan 2021 09:01:11 -0800 (PST) Received: by mail-il1-x12b.google.com with SMTP id e7so5861586ile.7 for ; Thu, 28 Jan 2021 09:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gar8fBlSsZFzuxpXobcokllNvMKbpQD2Smckqot5AV0=; b=R3385CEDtxrszE24UXwkp0ZU2U/OxxdtH7/PIESlm6ZDdnLzURn5PTJpKHAz3HOjFV 4jddEodBYlle4AtEzG4w+16LjwVOb8uZLdLeydFODHiifeRe1u+cD6DkQHyQ70QWZRDh sLAUPg5YB8to0myR+Mth92WbIszUnr71jwtds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gar8fBlSsZFzuxpXobcokllNvMKbpQD2Smckqot5AV0=; b=U98G+LkuljRQUCwor+qT3B2YiPjUtOOSrtWxRNGiAosIqIx66ljdlF5j8KOrDGVaBu cYyeeaOoSMWyHDkhHolQ03Mx8jh9PLFpJIbwrPxDBwYbWiZuQrKlRpduYoN4yG98ASDn E82SbeuEzL9aoTeqTAZqOkWRIs8gwamCgloYwyU3Zj1dKCLRC6fuIEyHbsj6qL6ENQBG JYNJicPiSSUu2Yxmu+P4VX1/xKcwdG0JnUadkR7xiPJmNbAY/BKg5qeJ5HGQ7HV/7LW8 P0UbGZRFI2ooNPBvoToQEy9tp2P3YH8wp7PYds6gapd8y+2F/oDa5H4GEdfOI2v0vmv8 1zOQ== X-Gm-Message-State: AOAM533gyg2LiBopSWp0vNgl2bSiTUUpS8H9LlRq4e4WOUR0idrXJ+pJ /jnPsTE7y9vcwdcfsTOFLA9ZRPnpRXbpWnYB X-Received: by 2002:a92:cd81:: with SMTP id r1mr13594451ilb.252.1611853270656; Thu, 28 Jan 2021 09:01:10 -0800 (PST) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com. [209.85.166.48]) by smtp.gmail.com with ESMTPSA id f13sm2806250iog.18.2021.01.28.09.01.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Jan 2021 09:01:09 -0800 (PST) Received: by mail-io1-f48.google.com with SMTP id q129so6302864iod.0 for ; Thu, 28 Jan 2021 09:01:09 -0800 (PST) X-Received: by 2002:a5d:9717:: with SMTP id h23mr506478iol.4.1611853268632; Thu, 28 Jan 2021 09:01:08 -0800 (PST) MIME-Version: 1.0 References: <20210128145837.2250561-1-hch@lst.de> <20210128145837.2250561-7-hch@lst.de> <20210128150955.GA30563@lst.de> In-Reply-To: <20210128150955.GA30563@lst.de> From: Ricardo Ribalda Date: Thu, 28 Jan 2021 18:00:57 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 6/6] media: uvcvideo: Use dma_alloc_noncontiguos API To: Christoph Hellwig Cc: Mauro Carvalho Chehab , Marek Szyprowski , Tomasz Figa , Sergey Senozhatsky , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Linux Media Mailing List , Robin Murphy , Linux Kernel Mailing List , Linux Doc Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HI Christoph Thanks for your comments On Thu, Jan 28, 2021 at 4:09 PM Christoph Hellwig wrote: > > I just included this patch as-is, but here are a few comments: > > On Thu, Jan 28, 2021 at 03:58:37PM +0100, Christoph Hellwig wrote: > > +static void uvc_urb_dma_sync(struct uvc_urb *uvc_urb, bool for_device) > > +{ > > + struct device *dma_dev = dma_dev = stream_to_dmadev(uvc_urb->stream); > > + > > + if (for_device) > > + dma_sync_sgtable_for_device(dma_dev, uvc_urb->sgt, > > + DMA_FROM_DEVICE); > > + else > > + dma_sync_sgtable_for_cpu(dma_dev, uvc_urb->sgt, > > + DMA_FROM_DEVICE); > > +} > > Given that we vmap the addresses this also needs > flush_kernel_vmap_range / invalidate_kernel_vmap_range calls for > VIVT architectures. We only read from the device to the cpu. Then can we run only invalidate_kernel_vmap_range() ? something like ? else { dma_sync_sgtable_for_cpu(dma_dev, uvc_urb->sgt, DMA_FROM_DEVICE); invalidate_kernel_vmap_range(uvc_urb->buffer, uvc_urb->stream->urb_size ); } Thanks! -- Ricardo Ribalda