From patchwork Wed Apr 8 17:03:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bresticker X-Patchwork-Id: 6181641 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 43807BF4A6 for ; Wed, 8 Apr 2015 17:03:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5ED0E2038C for ; Wed, 8 Apr 2015 17:03:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 346DB20381 for ; Wed, 8 Apr 2015 17:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754636AbbDHRDU (ORCPT ); Wed, 8 Apr 2015 13:03:20 -0400 Received: from mail-ob0-f201.google.com ([209.85.214.201]:34468 "EHLO mail-ob0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754397AbbDHRDT (ORCPT ); Wed, 8 Apr 2015 13:03:19 -0400 Received: by obbgq1 with SMTP id gq1so4863624obb.1 for ; Wed, 08 Apr 2015 10:03:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bp/0Yck0YJJduOy7A+ipjSiA8AUuj1A6sMIL6wwAH6U=; b=GOUEXcWncvqDxR5NuTTQ7/2Qqg5alz1p7pqVzO/dqOYxDXkvSDTJHN9L9pg2emfGRx trSiISMsxSy1lsmy5LwoasVX8SK+yav3VBguIexsbX6+x/qdgO9RHW6BR5UUHGZfqhjo dDEohPokLyDKSvhRrk9TDkjk+hDrLkMXgphxS5mTEhQYuanNZHa8RP9ePPG97zc71hOR NBWb7Jc5dDQ50YBj51fwaZmPyltjV96Y5v1rBS02a8j3BJ37SUA3HNzLgRfGQ1E1FnQY X9/pikm+z13Ewjmy7mn36Ob/eci+hikvaVJ/q8HBgpNzIdfV1BifVETjhhj1g50SUn5J +hVA== X-Gm-Message-State: ALoCoQnnHEFsubDrP9rZhnKobHWQucOfHCGfJz1F2AvWqMVOH/KEHeeuzsgpVZW9YZbtM2w0j/b6 X-Received: by 10.50.92.67 with SMTP id ck3mr10432574igb.5.1428512598798; Wed, 08 Apr 2015 10:03:18 -0700 (PDT) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id t22si507091yho.2.2015.04.08.10.03.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 10:03:18 -0700 (PDT) Received: from abrestic.mtv.corp.google.com ([172.22.65.70]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id JF4tMsVn.1; Wed, 08 Apr 2015 10:03:18 -0700 Received: by abrestic.mtv.corp.google.com (Postfix, from userid 137652) id 0F905220B5F; Wed, 8 Apr 2015 10:03:18 -0700 (PDT) From: Andrew Bresticker To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Bresticker Subject: [PATCH V2 2/3] spi: img-spfi: Reset controller after each message Date: Wed, 8 Apr 2015 10:03:15 -0700 Message-Id: <1428512596-23766-2-git-send-email-abrestic@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1428512596-23766-1-git-send-email-abrestic@chromium.org> References: <1428512596-23766-1-git-send-email-abrestic@chromium.org> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Imagination has recommended that the SPFI controller be reset after each message, regardless of success or failure. Do this in an unprepare_message() callback. Signed-off-by: Andrew Bresticker --- New for v2. --- drivers/spi/spi-img-spfi.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c index a3cf5be..dedb7d8 100644 --- a/drivers/spi/spi-img-spfi.c +++ b/drivers/spi/spi-img-spfi.c @@ -414,8 +414,6 @@ static void img_spfi_handle_err(struct spi_master *master, dmaengine_terminate_all(spfi->rx_ch); } spin_unlock_irqrestore(&spfi->lock, flags); - - spfi_reset(spfi); } static int img_spfi_prepare(struct spi_master *master, struct spi_message *msg) @@ -437,6 +435,16 @@ static int img_spfi_prepare(struct spi_master *master, struct spi_message *msg) return 0; } +static int img_spfi_unprepare(struct spi_master *master, + struct spi_message *msg) +{ + struct img_spfi *spfi = spi_master_get_devdata(master); + + spfi_reset(spfi); + + return 0; +} + static void img_spfi_config(struct spi_master *master, struct spi_device *spi, struct spi_transfer *xfer) { @@ -610,6 +618,7 @@ static int img_spfi_probe(struct platform_device *pdev) master->set_cs = img_spfi_set_cs; master->transfer_one = img_spfi_transfer_one; master->prepare_message = img_spfi_prepare; + master->unprepare_message = img_spfi_unprepare; master->handle_err = img_spfi_handle_err; spfi->tx_ch = dma_request_slave_channel(spfi->dev, "tx");