Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2105103rwo; Thu, 3 Aug 2023 04:58:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlG1/z78xdLezP6PbSDeNlCWx1XCW6lUCtbPgFB1wDVkl4Vd8b6uxHuW8cRhMWxv20taYiGK X-Received: by 2002:a19:5201:0:b0:4fb:9129:705b with SMTP id m1-20020a195201000000b004fb9129705bmr6743335lfb.6.1691063892037; Thu, 03 Aug 2023 04:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691063892; cv=none; d=google.com; s=arc-20160816; b=FACvph1LNyDR+mTR+ptau3XybLM1vesz4FBuNlQSmUEaMcJe507lRKIK8is7BYvMlO u9krzSAxLKEOXTtHPVdBx+AZNrK165p9ZPJNrAYih2hnR2a18jDQfueK5d9DrOP6vkCC qrrvsP8/K4v9AKyyzpD3g7vg+jMPR7JiXiOsxjv/Bu5BfaqOEhsPBxKxxPwVsri869TZ dNL2B1vUWrqQNIIk876dWQcFWYj97UjR37JG072CbqSyAwNMC9pAl8DVgx85DXISCBfV bDrWo1Sc1YrZ6S+aFQOPTEZ4GIMkkQQ/OJ7x+TMDjA3cbMEaOcGr3r+PKQO9yWrUGauk hnDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=CWAbCO1we5B8Sov+saRxkyn+MCI47BcIO2eUN5nHl+E=; fh=1W4kvXfHq00vm460H7yZ2Y1eeZb6q8B3dsLHNYTVQDU=; b=EiMpvoi1gIYdiKQU0MPIDFxcEQs4ELGkxjkY1C0KRRuzTLAw7cmv1ztlMGuwIkw7dP Nu+c4R7e5qInWP1CjyZDmNYvPulfAolaJYdGkR9LvWZRo7nXF24r3w8t+hE1CEOwVNmP nxw9KUpDZ5uzZe+7QskHfcNINLxGq/lmVBD+xCZHsBW1fyXFbPQhnLBHTGYbC/HwT2BT 8roug+JRj8ofzGA1RjtNul3R+/ugG+Xq0il9sPvD1MWjRxtQF04ZkswlWcqASDztZFL6 Dlq64+BH6An3ciLIztjKX2eZjnPnb/29EYIjtPkQErIvfPIIeZKJ+Z48OTvbKuTkNl53 F+yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b="PcRsw/6/"; 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=NONE sp=NONE dis=NONE) header.from=axis.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j9-20020a50ed09000000b0051e16fd4d9asi11142906eds.223.2023.08.03.04.57.48; Thu, 03 Aug 2023 04:58:12 -0700 (PDT) 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 (test mode) header.i=@axis.com header.s=axis-central1 header.b="PcRsw/6/"; 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=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233993AbjHCL2Z (ORCPT + 99 others); Thu, 3 Aug 2023 07:28:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbjHCL2Y (ORCPT ); Thu, 3 Aug 2023 07:28:24 -0400 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92CF2213F; Thu, 3 Aug 2023 04:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1691062073; x=1722598073; h=from:date:subject:mime-version:content-transfer-encoding: message-id:to:cc; bh=CWAbCO1we5B8Sov+saRxkyn+MCI47BcIO2eUN5nHl+E=; b=PcRsw/6/4AOp/otdDHFyvnA2ULhtRpMEPo7HlMrTAuq4VDy9rPPynRiT VYhkklHXVwG1D90XaSkmf+R8MVyDlMApSoUQ9JfRzAR7gW9f22X7j6RMm m90dsGwwxwF7JDLzPZiSrwdhGsBTWIzXPR0jqRAfm7fpzCFEvb+o3Eg5f sEyiDnGfbbQ34N1EasGRfiLWqXsO9zRI4T826Y4sx2pO3EC5MOdXY3bYD Nlvo7PyZD5bTzk9VHQZ1S8diEqQLxyGgxX9bxTFnqYwIOHKM1KLjq/ZaP 6i5dMJBjY722tko9axMEFmjocdJbChhrdO1VQIkvro6iCf+EGuzZgf3jT Q==; From: Anton Eliasson Date: Thu, 3 Aug 2023 13:26:42 +0200 Subject: [PATCH] tty: serial: samsung: Set missing PM ops for hibernation support MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20230803-samsung_tty_pm_ops-v1-1-1ea7be72194d@axis.com> X-B4-Tracking: v=1; b=H4sIAPGOy2QC/x3MQQqAIBBA0avIrBM0g7KrRIjUVLPIxKkoorsnL d/i/wcYEyFDKx5IeBLTFjJ0IWBYfJhR0pgNpSqNqo2W7Fc+wuz2/XZxdVtkWQ+2mYyyvkILOYw JJ7r+ade/7weqG39rZAAAAA== To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby CC: , , , , , Anton Eliasson X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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 At least freeze, restore and thaw need to be set in order for the driver to support system hibernation. The existing suspend/resume functions can be reused since those functions don't touch the device's power state or wakeup capability. Use the helper macros SET_SYSTEM_SLEEP_PM_OPS and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS for symmetry with similar drivers. Signed-off-by: Anton Eliasson --- I have not investigated the impact of adding the additional noirq handler functions. The hardware that I tested on (Axis ARTPEC-8) appears to work both with and without them assigned. Other similar drivers that use noirq handlers assign them to both resume, thaw and restore so I follow that style also. --- drivers/tty/serial/samsung_tty.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index b29e9dfd81a6..e2247c11067d 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2273,9 +2273,8 @@ static int s3c24xx_serial_resume_noirq(struct device *dev) } static const struct dev_pm_ops s3c24xx_serial_pm_ops = { - .suspend = s3c24xx_serial_suspend, - .resume = s3c24xx_serial_resume, - .resume_noirq = s3c24xx_serial_resume_noirq, + SET_SYSTEM_SLEEP_PM_OPS(s3c24xx_serial_suspend, s3c24xx_serial_resume) + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, s3c24xx_serial_resume_noirq) }; #define SERIAL_SAMSUNG_PM_OPS (&s3c24xx_serial_pm_ops) --- base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 change-id: 20230731-samsung_tty_pm_ops-7c98f309a4e9 Best regards, -- Anton Eliasson