Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp825104pxb; Tue, 3 Nov 2020 13:36:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0D2O+6F4qjYlkV6idYMNCVYyXAzhQo3FaCw3MveWozzDTPB1VDFWdWKr4aUrxfQdtKLNz X-Received: by 2002:a05:6402:142a:: with SMTP id c10mr24257969edx.261.1604439397080; Tue, 03 Nov 2020 13:36:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439397; cv=none; d=google.com; s=arc-20160816; b=bD8+1WpnbERpWH+98i56fJORqdm28xGR0HgL0sS761Gz9yJiE0TzjSGYXLCy7xYxHg PIqVB0JOyP7Qq+qMknq6jfbVSVpv9FD7FW2Nwsf76d94p9W0Fnx5okGXAL7KDfSOlig9 vqgWjfvf4oRW6rByLr3YmHbqgALla8Rp9vvgkxkwESqiKlu+5GLiNVi9/NRjkiCIoK+j 8JoWshhFvXOLuIFdRQOr+H1lU7xuusOl9rjkAWxFj1GGJHm32Dpa2S7eJZP52leIWgUc k/DAhMjUoFprxp/AHkSb3POfDB3Axfhgg9e9Gy0IMYPZR4uC33olx8lqYd2GaZgulJ0j BmCA== 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=tkBXpwniMlRxzXTXoUt7sh+IoEncI5NL73j7yS7BFhI=; b=bsAzGN2nWe7uaYHrjxmlXqrtA+feL/VgE+yOvSjPnCQwB02Myi3MVG54TG3WRUaqdh YDfR0gEdO/OElJta2dRvAp2d+s5Wo+YGPaq2qWgRjAvWDlQlIDa6nh8hk/Vt4oB9GEpe hyeDl0ciUOaVl4OzQbrjyEwC3/Lj4i4ARoh5Q8MuuIVqJZ5Lm/XR1Gqxja6ny73zDce3 lgfLlOSy+y1mX070W7Nsbs0vfA4YO5FFNCzGyhE73jg0Du0pNMCd7PMm7pEZIppK/ued 8Cr5XnGY9uJY/3J6h63micV5AdbhtfgEDWRWaJgTbDVdX2FrS92z5SdkVcE2EjUHhUSR vYuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BtWTVWis; 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=fail (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 oz31si7089ejb.484.2020.11.03.13.36.13; Tue, 03 Nov 2020 13:36:37 -0800 (PST) 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=BtWTVWis; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387817AbgKCVeA (ORCPT + 99 others); Tue, 3 Nov 2020 16:34:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:58730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729971AbgKCU4p (ORCPT ); Tue, 3 Nov 2020 15:56:45 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 6DC1320732; Tue, 3 Nov 2020 20:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437004; bh=625CS+VVUcH2j+DlX50bWniL4e5cbojM1+nNSZ7KK1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BtWTVWism9dSQ9hxcnhNQHfCn/2RPjBfyz3uL97IA+m8Io5ZB+rOJsy6+x7ir1CRG mUfmhuKZTqCiGSKCBWdBUyUxy4pJyEbBP5Erz9w6IcOqbLLjdNnBbioWgHRgBW7SqQ JbPDIkJ54WMfzpcOU2deYEeZy5suo1SwbSu9KVpM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Chunyan Zhang , Mark Brown Subject: [PATCH 5.4 104/214] spi: sprd: Release DMA channel also on probe deferral Date: Tue, 3 Nov 2020 21:35:52 +0100 Message-Id: <20201103203300.738353279@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@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: Krzysztof Kozlowski commit 687a2e76186dcfa42f22c14b655c3fb159839e79 upstream. If dma_request_chan() for TX channel fails with EPROBE_DEFER, the RX channel would not be released and on next re-probe it would be requested second time. Fixes: 386119bc7be9 ("spi: sprd: spi: sprd: Add DMA mode support") Cc: Signed-off-by: Krzysztof Kozlowski Acked-by: Chunyan Zhang Link: https://lore.kernel.org/r/20200901152713.18629-1-krzk@kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-sprd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/spi/spi-sprd.c +++ b/drivers/spi/spi-sprd.c @@ -563,11 +563,11 @@ static int sprd_spi_dma_request(struct s ss->dma.dma_chan[SPRD_SPI_TX] = dma_request_chan(ss->dev, "tx_chn"); if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_TX])) { + dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]); if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]) == -EPROBE_DEFER) return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]); dev_err(ss->dev, "request TX DMA channel failed!\n"); - dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]); return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]); }