From patchwork Fri Jun 19 14:32:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 224267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A43B1C433DF for ; Fri, 19 Jun 2020 14:37:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 716EB21556 for ; Fri, 19 Jun 2020 14:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577433; bh=WgAg0khaNIffBS03mIfrXfCWjgE0Tum93tuXxBi0yRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=r7ZRJv4spsr+a/gsBgraXHpcQjvYF4zoPBS1BBAjosjU9pYGryccp88Syr7PxIvul e9Dm+WQ+c/5Dm16tjRN4Vc2qiMRrgYMF/aCSYQH+ANBNFWK6m+avdmTkVnWG/IxUz4 kMTQg9pHYznhoG1pPdG72cn2EPJDDnVONlHcysIM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733305AbgFSOhK (ORCPT ); Fri, 19 Jun 2020 10:37:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:53874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387673AbgFSOhF (ORCPT ); Fri, 19 Jun 2020 10:37:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 72C26208C7; Fri, 19 Jun 2020 14:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577425; bh=WgAg0khaNIffBS03mIfrXfCWjgE0Tum93tuXxBi0yRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KJLxdaXpIFC1hVzQm+/K4/V2HkQKCBCeVj9biDbXg7liLxIeVrAprtEiTKdSsYu5S L4naKOAqbeMMx0tis4w6arGxvoHy1XbeTG+v1fDXhVe7kAEq2Aci0E3XPTRQw4b+8v y3C5l/JAi6Y8/ZZoK2rJwUQjdnsimTdjEAPWLqRo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Feng Tang , Mark Brown , Sasha Levin Subject: [PATCH 4.4 046/101] spi: dw: Zero DMA Tx and Rx configurations on stack Date: Fri, 19 Jun 2020 16:32:35 +0200 Message-Id: <20200619141616.509632756@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141614.001544111@linuxfoundation.org> References: <20200619141614.001544111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 bb1052e748f2..4d6434b244e2 100644 --- a/drivers/spi/spi-dw-mid.c +++ b/drivers/spi/spi-dw-mid.c @@ -155,6 +155,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; @@ -201,6 +202,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;