From patchwork Fri Aug 18 10:37:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhruva Gole X-Patchwork-Id: 13357742 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61324C05052 for ; Fri, 18 Aug 2023 10:39:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :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=KB2Tfdd2Or8JE3MHxrAadRJCYAzHZDZAMUOv3BqIDiA=; b=p5qCbH8zngs4MJ yqZI/FMxAbJDL4wshmMCX+oxMypQd/HLBgtDINz4Sa07spdfhE+CbwQvUyWEWy5bnA6j0KxwdZnqc FAVjizuaPG7R+MwA2lY6QNBEq+E0QesoUYaj1YZo2snZFc1JNEnyyeO4DXr3WsEpIPB5phRoP836F vRGjHTbvDoMt6Z1aJ5G32bkY8huF0kythbZPYi6AWQpPa9/c1ZUjCsE0sCahTBx16kVqYOK6eLNLF 6fCmY9AefRsboJaDaU8aQscftzzGZpNIIMtX7CLHXDQq67V74dwplfoF7Op9W3alwxnjmJ0gRnv3J dQUur9oPphIBpj3gOuEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qWwsV-008HXo-12; Fri, 18 Aug 2023 10:38:51 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qWwsR-008HUj-0O for linux-arm-kernel@lists.infradead.org; Fri, 18 Aug 2023 10:38:49 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 37IAcdrX001569; Fri, 18 Aug 2023 05:38:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1692355119; bh=cGQuI/kExsbPSiA05+9fEPo0vBVRf8HF1Ve+YmA08m0=; h=From:To:CC:Subject:Date; b=pJwBj1DC6iWF04Yim2ha7sdCEfa8J7HdQLTacrjwWCgorN+Sb9723wZOIOjSCpfJu MQrFM4TGIGHJJt4hVR5eUMzxbPHPrK5Q282MwEyd/IFIvCBtkzTEr1NqMWvyVXdF2a prmB8SB7hvgv0sQkelXTQKQ0M9xtoylVasxd8Qps= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 37IAcdXc020225 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 18 Aug 2023 05:38:39 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 18 Aug 2023 05:38:39 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 18 Aug 2023 05:38:39 -0500 Received: from dhruva.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 37IAcZ5Z001102; Fri, 18 Aug 2023 05:38:36 -0500 From: Dhruva Gole To: Mark Brown , Nishanth Menon , Vignesh Raghavendra , Tero Kristo CC: , , , , Dhruva Gole Subject: [PATCH 0/2] spi-cadence-quadspi: Introduce runtime_pm support Date: Fri, 18 Aug 2023 16:07:48 +0530 Message-ID: <20230818103750.516309-1-d-gole@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230818_033847_261541_4DFAD8B7 X-CRM114-Status: GOOD ( 17.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Abstract ******** This series aims to add runtime_pm [0] functionality to the cadence-qspi driver/IP. Prior to this, the driver had system suspend resume support which comes into picture only during system wide low power states like deep sleep / Suspend-to-RAM. Now, with runtime_pm support we can finally allow this driver/controller to be clock gated/ suspended when it's not in active use. This helps the overall system to reduce it's power consumption without needing to resort to system wide low power modes. As it turns out, the system suspend resume functionality that existed so far can be re-used as is even for runtime suspend resume, hence the actual implementations of those calls need not change. Testing ******* This series has been tested by me on a SK-AM625 [1] EVM by Texas Instruments. I did a basic test to check if IP suspended by trying to access it's registers while suspended (got core dump) and then to check resume I read back data from it. Also used k3conf, a TI tool to check on the device status in K3 Family of SOCs. I highly encourage other platforms and users of this driver to test these changes as it affects all those who use runtime_pm. For this, I have uploaded these changes on my github branch [2] which can be cloned and readily used. For referring to how I tested, please refer to my logs [3] Runtime PM usage **************** The auto-suspend delay can be tweaked from the userspace using the following sysfs entry: root@am62xx-evm:~# cat /sys/bus/platform/devices/fc40000.spi/power/autosuspend_delay_ms 2000 Other useful information can be obtained from the same folder, root@am62xx-evm:~# cat /sys/bus/platform/devices/fc40000.spi/power/runtime_* To disable runtime auto-suspend for this driver one can set autosuspend_delay_ms to -1 Note to maintainers ******************* * Patch 1/2 should probably go via Nishant's / Vignesh's tree * Patch 2/2 (RFT) can go via Mark's tree Reference/Links *************** [0] https://docs.kernel.org/power/runtime_pm.html [1] https://www.ti.com/tool/SK-AM62 [2] https://github.com/DhruvaG2000/v-linux/tree/ospi_runtime_pm [3] https://gist.github.com/DhruvaG2000/6aeeb2196caf8fbbe518c89037cb7548 Dhruva Gole (2): arm64: dts: ti: k3-am62-main: PM fixes in the fss node spi: spi-cadence-quadspi: add runtime pm support arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 3 +- drivers/spi/spi-cadence-quadspi.c | 38 ++++++++++++++++++------ 2 files changed, 31 insertions(+), 10 deletions(-) base-commit: 47762f08697484cf0c2f2904b8c52375ed26c8cb