Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2564272lkm; Mon, 20 Sep 2021 18:50:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJKTUKnoqKMEvN5lYnBxcUT3p+T2ETJz40MuJRtEB6XTcOoFf6ffXq+LYPGEocuP+4IQNd X-Received: by 2002:a92:ca84:: with SMTP id t4mr19352593ilo.41.1632188901990; Mon, 20 Sep 2021 18:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188901; cv=none; d=google.com; s=arc-20160816; b=0oiHNHq61rkJpbgIZF4esNkpnUVpltMHkd3qWJC9yYoi/3U0JiDLwYbBbps1YGWUeI UR6d8FdqZX7v2gpGKbIFSKI+eAiHYnJz1eoy6pTIl/3UZ2dxX95tAiGrtVV6a79GUPex QDnPEVDNHtKga1XfXGzp/1UGewnCdBFWIaNlP5gHMdchh5yfE5PAH0L8Ll3QBnR2OxHs PQ/tfurXcMBfCamBHJUxkgYpOPBoU8orYKC80YD7uvC9REI7DZ/RdysJfosQ1q7g3Zx3 K/UlOmYB3VreZVd9ujR7DSsSDBNSuzzyRK9UDn9/C8wVpF/JpvqUncj+bDifn2fKm2TI DJdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=etPQHDh2ZvH05ddf4N/7EnxEWvE4HQMOr4IUZfaWBBU=; b=zKhfvg8zasnUZzUAi8PAq4kNcn79ZHWIKD3SZ74o6kffUiDPtZAaIZwtgidFdqUC+1 tP3ja1acT390Sy+sYXwDlWxcIPhSOzeul8yf28f6U3KrcxL7DW88WE2JpkNbKKeL3MK7 zfTFyEhL+6yj3nbmOztOIfy4ZB2BE5L2rGupRU1qgdSeo56I/ofI1AjMAl62Oh8/Mpzw 91OixX4VOL4HM3Uam5nGb4Ep+X8GPJKQhYRCp5FVw1wSbEpdk9RayjkAs1RL7nl1i+U+ ht6Vkn3JdePiootA72a82N7kRSUMUMZHEiae9ipwIyCvZvjt8J65L4l2YTADhxqkkZjt tFwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g0tUGiIZ; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si2929207ilf.127.2021.09.20.18.48.09; Mon, 20 Sep 2021 18:48:21 -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=@linuxfoundation.org header.s=korg header.b=g0tUGiIZ; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352134AbhITRiD (ORCPT + 99 others); Mon, 20 Sep 2021 13:38:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:42456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351113AbhITRfu (ORCPT ); Mon, 20 Sep 2021 13:35:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 86C7361B25; Mon, 20 Sep 2021 17:06:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157579; bh=RbBvp2XwYSSV+3wS9IW4NJuamyao1uPKjNnWkemrGro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0tUGiIZtB3n+wam4F4wX74kHqSg+EMr6SLagxj5yRKqpP/ljeNXBGJmA1CMxVUmI EtgJs9t/zA7akOjHJ69aA9CC4maLTApd4c9QvTD3I8IWxhBqh1lXJ9C9UPyCD73nfk NGjhFPUGWi+JN649qf2l6s6BauvG5XaM0hrVPQj4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sanchayan Maity , Vladimir Oltean , Peter Ujfalusi , Vinod Koul , Tony Lindgren , Mark Brown , Sasha Levin Subject: [PATCH 4.19 055/293] spi: spi-fsl-dspi: Fix issue with uninitialized dma_slave_config Date: Mon, 20 Sep 2021 18:40:17 +0200 Message-Id: <20210920163935.144754740@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Lindgren [ Upstream commit 209ab223ad5b18e437289235e3bde12593b94ac4 ] Depending on the DMA driver being used, the struct dma_slave_config may need to be initialized to zero for the unused data. For example, we have three DMA drivers using src_port_window_size and dst_port_window_size. If these are left uninitialized, it can cause DMA failures. For spi-fsl-dspi, this is probably not currently an issue but is still good to fix though. Fixes: 90ba37033cb9 ("spi: spi-fsl-dspi: Add DMA support for Vybrid") Cc: Sanchayan Maity Cc: Vladimir Oltean Cc: Peter Ujfalusi Cc: Vinod Koul Signed-off-by: Tony Lindgren Acked-by: Vladimir Oltean Link: https://lore.kernel.org/r/20210810081727.19491-1-tony@atomide.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-fsl-dspi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 25486ee8379b..cfbf1ffb61bf 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -430,6 +430,7 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr) goto err_rx_dma_buf; } + memset(&cfg, 0, sizeof(cfg)); cfg.src_addr = phy_addr + SPI_POPR; cfg.dst_addr = phy_addr + SPI_PUSHR; cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; -- 2.30.2