Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2506028pxb; Wed, 9 Feb 2022 22:02:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuuetzkqOvlBM9vIthHoQbQl3aQLQwHqXH8UBNmZmRk842Ihmz+Ofb84Do5cG1uRXHbsEw X-Received: by 2002:a05:6402:d0d:: with SMTP id eb13mr6574785edb.6.1644472948354; Wed, 09 Feb 2022 22:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644472948; cv=none; d=google.com; s=arc-20160816; b=Aa/LBtLDbAdHSRpVmVgZWEKXGBdqVi5YG4H7XJtYq+D20Ba3TgMqIVavfdwQYMIFAW Rh8c3q8ZHsLOhO9+HTBykqvdLGl5ciSYM/Zdt/Q4y1yakTD+a6qca6PdFKyQ+2vl7W9Y iE55HZrxzai2m5i8+YtKyL+hkXPPtPgSfZ7rFqGe0bdthsZBiK6+XLzXKy/rQSUjqY7z ES+NyCs/5p1mRhE5ycPA5b5dC95g5hFyuqGn5YUo1mQPodF7MOBgYjjaTbjNix2GQNdQ dH2T9xSRGMjsHUuoKfklnGCuNFZEnrS3wUJXbhbUJosjoi0vWINVtMOWn1YHSLIY69A2 Lf0Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=wl1jodj5fPjhC0yPo2D/vQGD182csag7sbFSOi/fqOg=; b=dlmPan0fLW36ic+qYwilzJKp6KbXsxPsk+CT4LBvnSnivY2dLNLPD5fzxzT+bRUefp H/s6rUEnxSKgiFjCRaRPi5Z+FGsC3LGdSK+n+WMFXYYgXcnk2OQuOL5RzlEwh3cn1i99 7TOGo50mWIldM8HJ4j5b71FcdZQvoLZmGP9AlcZCJWSpHPgE3iyz5Gc8fLhTdB1IrfRG 6TVAc6M6s5z098xPP0eNanVfRvYoq/2DyRG8/0/rTOBbh5MmLYiJa9HcqyD46l2uIDG+ r6uJKXTkmxl12Qg7zNuzCFPDU8GI/HOFa1rHYw1+S6QERTQNS4FE06U7mod9UVP/Lerl n3Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MYybBAeg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q3si11539910edi.269.2022.02.09.22.02.01; Wed, 09 Feb 2022 22:02:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MYybBAeg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233034AbiBJE1f (ORCPT + 99 others); Wed, 9 Feb 2022 23:27:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbiBJE1c (ORCPT ); Wed, 9 Feb 2022 23:27:32 -0500 X-Greylist: delayed 659 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 09 Feb 2022 20:27:33 PST Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7B179A for ; Wed, 9 Feb 2022 20:27:33 -0800 (PST) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 21A4GW6N117624; Wed, 9 Feb 2022 22:16:32 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1644466592; bh=wl1jodj5fPjhC0yPo2D/vQGD182csag7sbFSOi/fqOg=; h=From:To:CC:Subject:Date; b=MYybBAegyUmaZbHatHONTB/CbC8paJhUdZ9k7d791Oiua1fVrQ3/TpsW/i6uG3E1L Cn7bIsuf4Ds/Gy226l3dtQ9p1sbZwLReByt6cN3YpBEvIkDlkWXzU5qsxk4HjtwFUj KAL8Oa12oF9DskFJA4vWmsCwRsihHRrkUGltI/fk= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 21A4GWa1122746 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Feb 2022 22:16:32 -0600 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 9 Feb 2022 22:16:31 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Wed, 9 Feb 2022 22:16:31 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 21A4GV4U104906; Wed, 9 Feb 2022 22:16:31 -0600 From: Dave Gerlach To: Jassi Brar CC: Dave Gerlach , , Suman Anna , Nishanth Menon , Vignesh Raghavendra Subject: [PATCH 0/2] mailbox: ti-msgmgr: Use polled mode of operation during suspend Date: Wed, 9 Feb 2022 22:16:29 -0600 Message-ID: <20220210041631.26767-1-d-gerlach@ti.com> X-Mailer: git-send-email 2.35.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This series switches the ti-msgmgr driver to operate in polled mode during system suspend rather than the current IRQ driven operation. This allows users of this mailbox, such as the ti_sci firmware driver, to communicate with TISCI firmware without the need of interrupts, which is critical during the system suspend path. Currently, the ti_sci_pm_domains genpd driver will send messages to disable devices during the noirq phase, so this must be done using a polled communication layer. It still makes sense to use IRQ mode during normal operation, so continue to support that as well, and only switch to polled mode during low power path. This is accomplished by setting a flag for polled mode in the system suspend handler that then causes the driver to immediately poll a mailbox RX channel in the send_data mailbox op, which will either timeout and return or follow the normal mailbox flow and call mbox_chan_received_data before returning from mbox_send_message. These changes do not affect the normal operation of the ti-msgmgr driver and are transparent outside of the system suspend path. The suspend path already sees timeouts with messages sent during noirq phase today and will continue to until a follow on patch for the ti_sci driver is sent to make communication completely safe during noirq, but this series can be merged without affecting operation. Regards, Dave Dave Gerlach (2): mailbox: ti-msgmgr: Refactor message read during interrupt handler mailbox: ti-msgmgr: Operate mailbox in polled mode during system suspend drivers/mailbox/ti-msgmgr.c | 181 ++++++++++++++++++++++++------- include/linux/soc/ti/ti-msgmgr.h | 8 +- 2 files changed, 147 insertions(+), 42 deletions(-) -- 2.35.0