From patchwork Wed Feb 10 13:54:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12080891 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=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 BCDE9C433E6 for ; Wed, 10 Feb 2021 13:55:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7733664E16 for ; Wed, 10 Feb 2021 13:55:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7733664E16 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=KPCkteC4P2epB5phw7r9dDKnx3WZbPQHycCx7FHeehc=; b=zWcbf4fIYcss9UWBffnr3p7xA2 oGNc97xDEBDZhtFlK2TFYmU0rmB7BJ44+R9vRuC71/Lm/oMAuO6iSTw1R32zpx6dy8j28GxNKgjjD O1VIbdM54BpH/UcxEiOy+tpA7JGEBkqCZaSeT9Op3+mKOtkCEMs5Zta+2RwFjbsoCGQSmNhYVoUOh /kAVmGcNG+44WxAOXwDhVqAutGRm34fgRbX985kIlmORomTaoTngNT1moxRCPqcF0iP9FMWa/VkHh +lZq5JPCEPY5TQLoSoVSIA9dYpthulyDR8YkeY6avXIyyj1P/AB3MsE9P5GY7VhjKYDHxguRpn/1e kKJsa4fw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9px1-00057Y-6c; Wed, 10 Feb 2021 13:54:39 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9pwy-00056c-LI for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2021 13:54:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1612965276; x=1644501276; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QoGiBbZ+H0/iM6M5m4nJViWNCG0mv/KdSdvAG9Hr1BM=; b=RXAiwIkBjnnNXX3L4bklU1lRgkmAm03aAT9xWacWV6ljQDkjGjqXZY55 atbS1RBP6E43cnS7yKBhYG1qPszo7IPGVMxdFKR5AeSK9QEY9L7EroS7Y ifrthMn9R/KUtYOFSwsz+GTTJwYm/4EYd0+nGzj1Rkc5RSoKDNE2d5LFN JNJXWfkI39TU+3B6xnRQtNKmfJGUnNrTV4W6816bZOD5sFQ46p8cRco39 DqsWQkTDcAvmKOk10FrnlVgri7ArHbMX+/Eq5mRUaV33n58Y7g2f4/nw9 mulAQbgzs9HqW1oVovZ2Djpq5eFVEJcmQWgL1+kN1r3I9ziVKLDsPwtet w==; IronPort-SDR: W2WbqYcSfJDFqrcArai3glmpA/MwOKEZAx8AGbilpVjLCgxQj/S4O37HC9xhQMHCIlxvtoQlVf 3/oGutRKyuj7J6S9uma28oNzuOgxtNP6v0ten4C4vV7DKEoV8f3dNm5tFkwJj8CNAT3Kr979qw hL5tQjGMzRoxnXJuyFJ/IEtYidEJmHmoBFyjl9mTBIL6cmFOCRwpErzUkxw4siVp+G8mlybG6c 9Zou1Bs9VIQKankkgE7P2q9Z9sbWlLtPytngG7l06jSvBYXdIFeKISN9HRVrHovMfIgYhyJMDl 8Dw= X-IronPort-AV: E=Sophos;i="5.81,168,1610434800"; d="scan'208";a="103297451" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 10 Feb 2021 06:54:34 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 10 Feb 2021 06:54:34 -0700 Received: from atudor-ThinkPad-T470p.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 10 Feb 2021 06:54:32 -0700 From: Tudor Ambarus To: Subject: [PATCH] spi: atmel-quadspi: Disable the QSPI IP at suspend() Date: Wed, 10 Feb 2021 15:54:28 +0200 Message-ID: <20210210135428.204134-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210210_085436_824521_42FAF5D3 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor Ambarus , linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It is safer to disable the QSPI IP at suspend, in order to avoid possible impact of glitches on the internal FSMs. This is a theoretical fix, there were no problems seen as of now. Tested on sama5d2 and sam9x60 versions of the IP. Signed-off-by: Tudor Ambarus --- drivers/spi/atmel-quadspi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 10bc5390ab91..95d4fa32c299 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -657,6 +657,7 @@ static int __maybe_unused atmel_qspi_suspend(struct device *dev) struct spi_controller *ctrl = dev_get_drvdata(dev); struct atmel_qspi *aq = spi_controller_get_devdata(ctrl); + atmel_qspi_write(QSPI_CR_QSPIDIS, aq, QSPI_CR); clk_disable_unprepare(aq->qspick); clk_disable_unprepare(aq->pclk);