Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1722133yba; Thu, 4 Apr 2019 17:17:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsJf7COowz6r5nYWFLR73mppvIQbwfH5EcgbEYUZobyOC8HSHH2qHqqKt9Ffrdm6gcS1H+ X-Received: by 2002:a62:1c13:: with SMTP id c19mr9003190pfc.11.1554423455206; Thu, 04 Apr 2019 17:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554423455; cv=none; d=google.com; s=arc-20160816; b=oYw1OMDtNFbLf3U6QkOrqyyOuyKor9zVoI0CivpQ0P6HcIHL+RnWSDvGAy85bzkYiu bg2RMemfuVDJRpUsCAXo4mksCZg0sf6L3+fefcXuJ6vAryxkkiRlKT9mSwYTcuqxb/Qv tpX0HSvWNHNqjOd6ERdgJ/6rHfUOo8ijumNjY2BJECUxCYy4FncJ50YkVrZYpy1eR70N ykxa4QDOh3gEhSWLoluYs+GUtSp4PskyAlaW+WI0We+YK7P/e/7FqfBEU9vTZSz1t8JX XyYUBrvG8eh7Flo5ekFtDPuIFYoOO+mhhP0aK1AIxPLOkCwdeb/2B7JiI5lZopvxGLo5 ATAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=qObac6JMJVBXTxA9Ra3/+zALzffwl/l3Fv1nnWBF378=; b=RcfsrBrgam/3oeUVepICYcV7s1sw+ae27cD+QPtog7PVQ5fhJTGGafj8igGcpt4jFw +Bw36Aowm/vype8vQGqs8yOHrU9cQYXM/zoXbo6zB0/cCAQ6gv1DhgMefuKHW0pvVXAQ dCRUbfBwSFKEqfLuYCG/ccVZKNXoe2yewtnzJGQGbIb8HtPDf6Zq3GYBR1J6hWX4rcZO 60RF9QKjRCZTWvfadwvimLE8SBsZ6qp8aOlDu/PIP//tRs29yu/5ZtP03kNguCVS/uAS 0sdE5tijS5sEjrMoiKgk8AF9lD3R4+wmoe8qIUARLgdZkCG6VwMj+7qF5WfzWQLCrYhr 4AlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=bwBL01xj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17si16663290pgo.44.2019.04.04.17.17.20; Thu, 04 Apr 2019 17:17:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=bwBL01xj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731251AbfDEAQE (ORCPT + 99 others); Thu, 4 Apr 2019 20:16:04 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:11299 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730412AbfDEAOZ (ORCPT ); Thu, 4 Apr 2019 20:14:25 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 04 Apr 2019 17:14:22 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 04 Apr 2019 17:14:25 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 04 Apr 2019 17:14:25 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 5 Apr 2019 00:14:24 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 5 Apr 2019 00:14:24 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.110.103.48]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Thu, 04 Apr 2019 17:14:24 -0700 From: Sowjanya Komatineni To: , , , , , , , CC: , , , , Subject: [PATCH V2 04/20] spi: tegra114: avoid reset call in atomic context Date: Thu, 4 Apr 2019 17:14:03 -0700 Message-ID: <1554423259-26056-4-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554423259-26056-1-git-send-email-skomatineni@nvidia.com> References: <1554423259-26056-1-git-send-email-skomatineni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1554423262; bh=qObac6JMJVBXTxA9Ra3/+zALzffwl/l3Fv1nnWBF378=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=bwBL01xj97QGyTdOfTAapknkRzpMMLwKmBX4Dz+Aj3yGhpoBBmTdD7cbWfxqdyK9m c/A2UXQQiW4B2pU1MF5fhNEnduOEk0v7SPriV9YmuclD9l3mebXb7B4Z+HqWX8nP9R RUd1M7/d8cmLPm/uMolWAvFyrMdf9z9Srj1D7qB2ejd1HpKSyiL9Nce9P63BlEYgzL 0kYYeahXW/W5xQB9CyoN749ydBg25nMUiA65HMDpAZWB72Rn24i6ukiRfMczvSgAHq CP35jRlDMeYaX2T8w2HflegysVBozzzo4SDjlCtwbX8zNVXu9YtK16G9c7jlmZWv1C /4qbQukARonBA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch moves SPI controller reset out of spin lock. Signed-off-by: Sowjanya Komatineni --- drivers/spi/spi-tegra114.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index c60e40cab0a0..d928a2c92a3d 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -974,11 +974,12 @@ static irqreturn_t handle_cpu_based_xfer(struct tegra_spi_data *tspi) dev_err(tspi->dev, "CpuXfer 0x%08x:0x%08x\n", tspi->command1_reg, tspi->dma_control_reg); tegra_spi_flush_fifos(tspi); + complete(&tspi->xfer_completion); + spin_unlock_irqrestore(&tspi->lock, flags); reset_control_assert(tspi->rst); udelay(2); reset_control_deassert(tspi->rst); - complete(&tspi->xfer_completion); - goto exit; + return IRQ_HANDLED; } if (tspi->cur_direction & DATA_DIR_RX) @@ -1047,11 +1048,11 @@ static irqreturn_t handle_dma_based_xfer(struct tegra_spi_data *tspi) dev_err(tspi->dev, "DmaXfer 0x%08x:0x%08x\n", tspi->command1_reg, tspi->dma_control_reg); tegra_spi_flush_fifos(tspi); + complete(&tspi->xfer_completion); + spin_unlock_irqrestore(&tspi->lock, flags); reset_control_assert(tspi->rst); udelay(2); reset_control_deassert(tspi->rst); - complete(&tspi->xfer_completion); - spin_unlock_irqrestore(&tspi->lock, flags); return IRQ_HANDLED; } -- 2.7.4