From patchwork Mon Feb 21 05:53:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1595346 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=m5wo7MB8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K2BLn3LFKz9sFh for ; Mon, 21 Feb 2022 16:53:53 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nM1do-0001Cb-6x; Mon, 21 Feb 2022 05:53:44 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nM1dh-0000yU-Oz for kernel-team@lists.ubuntu.com; Mon, 21 Feb 2022 05:53:37 +0000 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id C716B3F1A4 for ; Mon, 21 Feb 2022 05:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645422816; bh=fCbgebj9ReetrtrmlGqfbRMzGDVcMv/0ZxtLsvBT4Mk=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=m5wo7MB836onzsc6557wAuvcMf3o1sKB+9Fv8xQoZPT9BXjCo2pT8fY7Th/NrTJWX xTJORGU6TQsY9OYOf7R8I83PStZIh7NSTdZRBPWnSsq0lzPddkk7FzPYK5zj4P1cfg OPeQiFHglsGjOR5Jqa/JtbtbAa7KdmgCvIEXDVc/QGL7qghd+2JKhPdfns/9xewZcK 9Ae1x8bkjRH8vexzu7iPvzBUHj8RbLdTpc1dFRQoqVP8VfcwjU1BmwwlwCegSax1t+ FXXKS6jafBCStoW3MrPJ2y0BGqn25iYWM1zcY+gLoZ+Am9aGSazG2OdIqFeR63xs0t vJl+jPBTNfM+g== Received: by mail-pj1-f71.google.com with SMTP id ml24-20020a17090b361800b001b8877a4b6eso7629663pjb.5 for ; Sun, 20 Feb 2022 21:53:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=fCbgebj9ReetrtrmlGqfbRMzGDVcMv/0ZxtLsvBT4Mk=; b=Fw7o8NgNlEhLMr8GD1YOC2rLZ3v3ijV1/2dQFpD3Qpo16DhIHAsUf4OBeeglyBpaxy 6IIRBwPEkG+Lg07MgJB1caX1AwkviJ2ylVna6JCgrdv8cZgwpccfvnPT8LND6dVPHAUU HYawHdE9u7rqYQXvz2Indw2XtFHSC+JBUIASn9w9T52VpYjBHO9kAwqu6rdEZe4i5sAP pOPEGnOu2Na1Hs2dj4/mzukYL//5XMOgM9SXxCXgWqVF9tcLtU/IHXAXfJ23r9oRZNQK dV+qCp7RBFZy3bFNyFnRYSUS3Pwel0OslsT7fr1WGrqQnbp4geULoOVClFXKXIvr/Pyq /cnQ== X-Gm-Message-State: AOAM532UhFTVLerMYC7FozCS/KMI0PcS10fsIz+UhqNgyYGtQaPe3/H8 eWp+0vGztS1KKW91vN5sWkBaDhVARfEILiFu/oZ74rhNaq96PRIctpm9FusgHlqJIUrrhtv2uPs FgUluSyxMOODe4mwp3juDJ/d6DeEtNCSVSjt5z1t64w== X-Received: by 2002:a17:902:8644:b0:14f:cf95:648a with SMTP id y4-20020a170902864400b0014fcf95648amr337868plt.138.1645422815211; Sun, 20 Feb 2022 21:53:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyucYPmffYdIDMHKcbnZRaFG7KD2ZLyh8uoCzi3SghoM7HjliG5wwL2AXQNFkekPg9aj+S3A== X-Received: by 2002:a17:902:8644:b0:14f:cf95:648a with SMTP id y4-20020a170902864400b0014fcf95648amr337853plt.138.1645422814907; Sun, 20 Feb 2022 21:53:34 -0800 (PST) Received: from canonical.com (node-1w7jr9yebujeq5th4a1ypmfmg.ipv6.telus.net. [2001:56a:78ed:fb00::998]) by smtp.gmail.com with ESMTPSA id s29sm12212701pfg.146.2022.02.20.21.53.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 21:53:34 -0800 (PST) From: Alex Hung To: kernel-team@lists.ubuntu.com Subject: [PATCH 0/5][SRU][J] Not able to enter s2idle state on AMD platforms Date: Sun, 20 Feb 2022 22:53:28 -0700 Message-Id: <20220221055333.1169827-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1961121 [Impact] AMD Systems don't enter PC6 at runtime and cause failures to enter s2idle. Currently the fix is from kernel driver rather than MP2 firmware, which disable interrupts from kernel driver to fix MP2 firmware blocking CPUOFF. [Fix] The fixes involve 1) cancelling delayed work when entering s0ix and re-scheduling it when resuming from s0ix, and 2) clearing interrupts during the driver initialization and sensor command operations Note: PATCH 1 (173709f50e) & 2 (0873d1afac) are required for actual fixes PATCH 3~7 Note 2: all patches were cherry-picked from mainline [Test] This is requested by AMD and was tested on AMD CRB. [Where problems could occur] Risk is low to medium. Some code flow changes are guarded by reasonable conditions, but the fixes introduced additional suspend and resume operations. Having said that, clearing interrupts before driver initialization and cancelling work before entering sleeping states are standard approaches are usually safe. Basavaraj Natikar (5): HID: amd_sfh: Handle amd_sfh work buffer in PM ops HID: amd_sfh: Correct the structure field name HID: amd_sfh: Disable the interrupt for all command HID: amd_sfh: Add functionality to clear interrupts HID: amd_sfh: Add interrupt handler to process interrupts drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 72 +++++++++++++++++++++++++++++++++- drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 4 +- 2 files changed, 74 insertions(+), 2 deletions(-) Acked-by: Tim Gardner