Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp495171pxa; Wed, 12 Aug 2020 07:14:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRc5MUldH0S1N+skj2OSUjotQ0vWpVoYD/kUQ0LmFiPz48tXnE05kOFpjnhIhGxEzTMTup X-Received: by 2002:a50:e803:: with SMTP id e3mr94397edn.75.1597241654837; Wed, 12 Aug 2020 07:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597241654; cv=none; d=google.com; s=arc-20160816; b=jz2pcFU8fF8bYUHar09egXBYXTPj0xtw//mx/1LWwwY4FB5QeGaDDmiPBO5RvHpW3y G/MTBiajK1H4pXuVNTo70KCfOXD64mEtS1KKWrdR2657fLymcyka0b44m4oI6xr5A0XE wIsqYCwqxNR+XtLjinTpD307Ws+eKsX2rnEPaA0R4wfV5As/Kq1TWauGrIVth6aKkD8F YKuVjWaOKv9CjusN5RmemBl34EVs7weMU4cqa5LxdxIgBskvzKbkHe7nvMp0CW7+IUvv uug22QHZA9f23Jsokl9TyZVUMWKtO2DcXDHPbsOgefKLFO0EknCOJAprELSl9z4qScD4 MZbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BAYgOfe5stUcl69x3S7eimrTDZBSiHB9OvfmPx9Zdrw=; b=YIcBGmKaHlRirKz0TLjukqVbY4MnCCZtBdsT9eHqgChGj0CynTYQTdcoALHmMo9sbX pjQBWiad5UYeA+o9QzaGlOJU48jPsZd3o5/L21aMG36Ih6ln+iZytoVmwj92kMNTsjQE 3n0OuaMEEDsLSI/zZBtRa8asTolBXi5EFEoC4TCSeCYMuquv6NRTQbU7SO/x1vmfhVhG LujHFMN7X8N9T35TLGokfK/lxV81VM9SyizWITIm8YKkXYQphPNMAVdnmjJissOcPnBP LixHlqxtOyrygIEkpoeUGaxsNZRVjOqrNA7fMFghu48gi89YUqunfGitCYX44lgM1QZO dmwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iMx16CFM; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si1306959ejz.445.2020.08.12.07.13.51; Wed, 12 Aug 2020 07:14:14 -0700 (PDT) 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=@linaro.org header.s=google header.b=iMx16CFM; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726632AbgHLONM (ORCPT + 99 others); Wed, 12 Aug 2020 10:13:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726634AbgHLONK (ORCPT ); Wed, 12 Aug 2020 10:13:10 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A672C061384 for ; Wed, 12 Aug 2020 07:13:10 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id a15so2168964wrh.10 for ; Wed, 12 Aug 2020 07:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BAYgOfe5stUcl69x3S7eimrTDZBSiHB9OvfmPx9Zdrw=; b=iMx16CFMmDH2fRRYk1rZbM/ORr/ooYW/ce6+lp1QXcOJO7DkGjJvgbPjnQ9dpqFOcR BQd9bFmrHx259fF4+pnLrDLKzHU8BN60APCkxTzh2CWJUqLCcqsalXd8riNjZXhure06 HoP1PAiNEs/gdPQ2RJCkMX+syFcxq6J2jDdvuRzhAZUZpeK3levdB9KTIGXns2WLSY+7 jeUM2TP2BBlHH7cwC28jej7YkL0SnN61RWDV1CGs+WI+4pNEn0OBcrpVWB4jvF7RazvK FD7XjCicKe1WmhUCAo36zCBymfbB9PK95AKScfv0XaONkZOZKhdAptUin0T8jRh7jV7D fmxA== 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=BAYgOfe5stUcl69x3S7eimrTDZBSiHB9OvfmPx9Zdrw=; b=svvvut8/Y6nXbcngFu6L43BOpTL+iA0Zkr8nLEThBhhMBFLv4Mjm/aPukGdTDwN+l9 aDtzLeNtQXkeA10/u1s3xqzBzpPPVzvaPK0kYZG1XgC/sQGnqaIgW5bC5RMmd9xd+LY3 tPsD3Hvze1mBrhrmUd/9NM1BPjgGnxvS92VE+Qvvi0QcT84DgIjYYZKFxQv6jTBCmN82 Glzdk7UmWFY0sEZaGajXjjTDyPvXkkg+OETOaFJW4n/IOqEMXIY4CQcPhGNJjjeFJIJ6 Q2lp5KftGNkOR1M3CnplDPSYgpFfBw5SOaelFetRgc4FEdPvEfgRxkqOkEmDLpuq7bSU /VUA== X-Gm-Message-State: AOAM531T9/Ka7waiVBa8ASRRCcc9QuuU7nfu18X/q3vv3m6oFk3gMjMg hA06CMNWODPDz2wfk4ly2tH34dp1Ui+dqjby9xjnHA== X-Received: by 2002:adf:f248:: with SMTP id b8mr36015334wrp.247.1597241588772; Wed, 12 Aug 2020 07:13:08 -0700 (PDT) MIME-Version: 1.0 References: <20200811081712.4981-1-geert+renesas@glider.be> In-Reply-To: <20200811081712.4981-1-geert+renesas@glider.be> From: Ulf Hansson Date: Wed, 12 Aug 2020 16:12:32 +0200 Message-ID: Subject: Re: [PATCH v2] ata: sata_rcar: Fix DMA boundary mask To: Geert Uytterhoeven Cc: Jens Axboe , Greg Kroah-Hartman , Christoph Hellwig , Sergei Shtylyov , linux-ide@vger.kernel.org, Linux-Renesas , Linux Kernel Mailing List , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Aug 2020 at 10:17, Geert Uytterhoeven wrote: > > Before commit 9495b7e92f716ab2 ("driver core: platform: Initialize > dma_parms for platform devices"), the R-Car SATA device didn't have DMA > parameters. Hence the DMA boundary mask supplied by its driver was > silently ignored, as __scsi_init_queue() doesn't check the return value > of dma_set_seg_boundary(), and the default value of 0xffffffff was used. > > Now the device has gained DMA parameters, the driver-supplied value is > used, and the following warning is printed on Salvator-XS: > > DMA-API: sata_rcar ee300000.sata: mapping sg segment across boundary [start=0x00000000ffffe000] [end=0x00000000ffffefff] [boundary=0x000000001ffffffe] > WARNING: CPU: 5 PID: 38 at kernel/dma/debug.c:1233 debug_dma_map_sg+0x298/0x300 > > (the range of start/end values depend on whether IOMMU support is > enabled or not) > > The issue here is that SATA_RCAR_DMA_BOUNDARY doesn't have bit 0 set, so > any typical end value, which is odd, will trigger the check. > > Fix this by increasing the DMA boundary value by 1. > > Fixes: 8bfbeed58665dbbf ("sata_rcar: correct 'sata_rcar_sht'") > Fixes: 9495b7e92f716ab2 ("driver core: platform: Initialize dma_parms for platform devices") > Signed-off-by: Geert Uytterhoeven > Reviewed-by: Christoph Hellwig > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Sergei Shtylyov > Tested-by: Lad Prabhakar > Cc: stable Reviewed-by: Ulf Hansson Kind regards Uffe > --- > v2: > - Add Reviewed-by, Tested-by, Cc. > > This is a fix for a regression in v5.7-rc5 that fell through the cracks. > https://lore.kernel.org/linux-ide/20200513110426.22472-1-geert+renesas@glider.be/ > > As by default the DMA debug code prints the first error only, this issue > may be hidden on plain v5.7-rc5, where the FCP driver triggers a similar > warning. Merging commit dd844fb8e50b12e6 ("media: platform: fcp: Set > appropriate DMA parameters", in v5.8-rc1) from the media tree fixes the > FCP issue, and exposes the SATA issue. > > I added the second fixes tag because that commit is already being > backported to stable kernels, and this patch thus needs backporting, > too. > --- > drivers/ata/sata_rcar.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c > index 141ac600b64c87ef..44b0ed8f6bb8a120 100644 > --- a/drivers/ata/sata_rcar.c > +++ b/drivers/ata/sata_rcar.c > @@ -120,7 +120,7 @@ > /* Descriptor table word 0 bit (when DTA32M = 1) */ > #define SATA_RCAR_DTEND BIT(0) > > -#define SATA_RCAR_DMA_BOUNDARY 0x1FFFFFFEUL > +#define SATA_RCAR_DMA_BOUNDARY 0x1FFFFFFFUL > > /* Gen2 Physical Layer Control Registers */ > #define RCAR_GEN2_PHY_CTL1_REG 0x1704 > -- > 2.17.1 >