Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11162031ybi; Thu, 25 Jul 2019 11:04:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1JHOcTRyazQLA73WBGcsOqO37m3trvLC3PEQY2RyujOM6y3YpXUrgP3NzBeiEud/aK8Gz X-Received: by 2002:a17:902:e2:: with SMTP id a89mr92704320pla.210.1564077852462; Thu, 25 Jul 2019 11:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564077852; cv=none; d=google.com; s=arc-20160816; b=ED6mAHFoSExJg6h1AEku4Gr8nfZHIZRCQUIAGLsWLQlbXPJY+uw1bnoSHT3/EcDEja ew69raiMMqdmfoai7h4vGbxZ85WA19yKqVkAGJA61l3Ru8FS3axjwCsvEJF1FbNSDLaF htQ0psDUEiBO7uGy+OTdqSPffsikz+YkWpQWGkcwrUf9AQlPVxhzjSIv9/RMOdfOUhRp 180D0SjeSf/S/EfS0wYR2YDK7/WUzxl1jFQIS4JtNUp0RUHnpQRr2raQxn6L4zeNYFBl AtbuxH5U6/8D/vUmvGDTwPi8IyaTr0aV6Z37hzSK8HUpx/vODrKs/QW+YxwOSHMNd9H3 S6Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=Bc79PPAjDmV30t0TRzcgln/Fq+YJhK1SDm1+0CzcHbc=; b=S31ebuS5Gb+PfZn1T3VD4O3Qnl4wjo4kWBirFNodYRudreMofbTX/kd3d/8pAzPf2n KcJ7gBmVqp/CykjpDcoUXlJGrMfkaB2rHKUKOXXGAGanHyM5OctOoDxwFvhAWRsPp7WJ xvsFSWEl4Obl+MwSR72wVIJkbdDZz+vU+sv+JX4wy8okxpRuKlKPUZs+aUAtzH5OGNZ8 FXqKnHVG3M0ZBrIVkoeVuFww7tzgVW5In3BbhKX9ualZttgUA1tcvtdMT5OabgKZcgD+ yylQCIEk6kokW7ehrAsCkF24rwnOgZTlFy15zs44QJuUClbYpAi4Q4Ui7KfwTQSr+Jqv 5tsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j36si16157984plb.77.2019.07.25.11.03.56; Thu, 25 Jul 2019 11:04:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389318AbfGYPhA (ORCPT + 99 others); Thu, 25 Jul 2019 11:37:00 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:37795 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389301AbfGYPg7 (ORCPT ); Thu, 25 Jul 2019 11:36:59 -0400 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1hqfnQ-0001bw-8U; Thu, 25 Jul 2019 17:36:44 +0200 Message-ID: <1564069001.3006.1.camel@pengutronix.de> Subject: Re: [PATCH v2 1/7] media: hantro: Set DMA max segment size From: Philipp Zabel To: Ezequiel Garcia , linux-media@vger.kernel.org, Hans Verkuil Cc: kernel@collabora.com, Nicolas Dufresne , Tomasz Figa , linux-rockchip@lists.infradead.org, Heiko Stuebner , Jonas Karlman , Boris Brezillon , Paul Kocialkowski , Alexandre Courbot , fbuergisser@chromium.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Date: Thu, 25 Jul 2019 17:36:41 +0200 In-Reply-To: <20190725141756.2518-2-ezequiel@collabora.com> References: <20190725141756.2518-1-ezequiel@collabora.com> <20190725141756.2518-2-ezequiel@collabora.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-07-25 at 11:17 -0300, Ezequiel Garcia wrote: > From: Francois Buergisser > > The Hantro codec is typically used in platforms with an IOMMU, > so we need to set a proper DMA segment size. ... to make sure the DMA-mapping subsystem produces contiguous mappings? > Devices without an > IOMMU will still fallback to default 64KiB segments. I don't understand this comment. The default max_seg_size may be 64 KiB, but if we are always setting it to DMA_BUT_MASK(32), there is no falling back. > Cc: stable@vger.kernel.org > Fixes: 775fec69008d3 ("media: add Rockchip VPU JPEG encoder driver") > Signed-off-by: Francois Buergisser > Signed-off-by: Ezequiel Garcia > --- > drivers/staging/media/hantro/hantro_drv.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c > index b71a06e9159e..4eae1dbb1ac8 100644 > --- a/drivers/staging/media/hantro/hantro_drv.c > +++ b/drivers/staging/media/hantro/hantro_drv.c > @@ -731,6 +731,7 @@ static int hantro_probe(struct platform_device *pdev) > dev_err(vpu->dev, "Could not set DMA coherent mask.\n"); > return ret; > } > + vb2_dma_contig_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); This should be complemented by a call to vb2_dma_contig_clear_max_seg_size() in _remove, to avoid leaking dev->dma_parms. > > for (i = 0; i < vpu->variant->num_irqs; i++) { > const char *irq_name = vpu->variant->irqs[i].name; regards Philipp