Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp121334ybg; Mon, 8 Jun 2020 18:12:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqV78IkGSt3CH2a6mh3fNjAe95jurGZCFPHNBnl9oTVbCqgK/dhjBLtyT+7ScNmuZYj5wr X-Received: by 2002:a50:98e3:: with SMTP id j90mr23229759edb.373.1591665136644; Mon, 08 Jun 2020 18:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591665136; cv=none; d=google.com; s=arc-20160816; b=0EyHBbjFV7kMOTSJcnTXrqBw5xCE4XN+/THeiRo7Uy4dPh+PTbk+JLeaZEsAWqdPml A49VEtsLtD04PlwerBE3CI0tnX6dUkaCbgsd16tnHFKhwjtADo2FfdwXPu/whA7M4RJb qX84i9DjbI+bzQJVg/ChLUQH27jIY4aB58b+rPbe+tUgFWJjO9blECHrYa7AixLdsieV dPYf20oPiYbvrAc/uVGzcgitxwopISdmd4Fi1+OxekKT9AjV4+/tOhTtgjZ46vNbCGmS COWpasmGxk4fws6tSIoNdPCAlO7n1jTho3zEkZN9sYNXGcG3kU/q1+PeQ2FbyiKtObi7 uBuA== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=brZlWKgJ8FYvauHopsk6QRer9U+XiecvcAvTJlmyoZw=; b=ihTg4rr7puph8875nc3GoLRfqd0MN4JB44fZYyDzrk70tiIdh/s4zaFOMVfVCPFmJH lMZCt/4Ue/lspN2bH4VNLPb1McqEj4W5ALBVOaLaLrITP5MhxFZcHPRUbvtqp0YP1c0W v7XxyeiysXRjUZLsPlwbAe5oIr3owo2SuDZ7cc6kRKIMtfcAH5nt9zZPNA19Sxef9rDE F7jdSweCkhrcWFVEGLJ6WLsIlQ8AWU/zgbrB+xOeWtpVqI1qp/r98Bdb1r+oHU4N7hDf D80V2sdqiT2f8WOaL2in0wgVXZHfusBzX0p9K6NZ3QYJgyaovyVR0k/2w73vY+UbzFAi /GFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pTRzkAet; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si9870182ejt.236.2020.06.08.18.11.54; Mon, 08 Jun 2020 18:12:16 -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=@kernel.org header.s=default header.b=pTRzkAet; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388201AbgFIBHp (ORCPT + 99 others); Mon, 8 Jun 2020 21:07:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:50252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727091AbgFHXGy (ORCPT ); Mon, 8 Jun 2020 19:06:54 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00DEC20774; Mon, 8 Jun 2020 23:06:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657613; bh=KphcNiZ+eOvakmzLYKXPGmvws0QzDnSkfXg63EaWeFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pTRzkAetQB3kbZx1hUx7uAhbSJ/V8UCzZno2k7BLx99rMBZeG9bXd2bcJrzJcx4v1 2hmDL4OUG/Npyj1PMQhiySR4Ly/77bCEWUncHvR762ACeWTnaU1y/v/GeDqeif5Izs 7yuMFPEmKOh1EQPD7QdlEdiHpWGqX3YXIc6hKygc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andy Shevchenko , Feng Tang , Mark Brown , Sasha Levin , linux-spi@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 036/274] spi: dw: Zero DMA Tx and Rx configurations on stack Date: Mon, 8 Jun 2020 19:02:09 -0400 Message-Id: <20200608230607.3361041-36-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit 3cb97e223d277f84171cc4ccecab31e08b2ee7b5 ] Some DMA controller drivers do not tolerate non-zero values in the DMA configuration structures. Zero them to avoid issues with such DMA controller drivers. Even despite above this is a good practice per se. Fixes: 7063c0d942a1 ("spi/dw_spi: add DMA support") Signed-off-by: Andy Shevchenko Acked-by: Feng Tang Cc: Feng Tang Link: https://lore.kernel.org/r/20200506153025.21441-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-dw-mid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c index 0d86c37e0aeb..1058b8a6c8a0 100644 --- a/drivers/spi/spi-dw-mid.c +++ b/drivers/spi/spi-dw-mid.c @@ -147,6 +147,7 @@ static struct dma_async_tx_descriptor *dw_spi_dma_prepare_tx(struct dw_spi *dws, if (!xfer->tx_buf) return NULL; + memset(&txconf, 0, sizeof(txconf)); txconf.direction = DMA_MEM_TO_DEV; txconf.dst_addr = dws->dma_addr; txconf.dst_maxburst = 16; @@ -193,6 +194,7 @@ static struct dma_async_tx_descriptor *dw_spi_dma_prepare_rx(struct dw_spi *dws, if (!xfer->rx_buf) return NULL; + memset(&rxconf, 0, sizeof(rxconf)); rxconf.direction = DMA_DEV_TO_MEM; rxconf.src_addr = dws->dma_addr; rxconf.src_maxburst = 16; -- 2.25.1