From patchwork Tue Feb 8 12:21:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 12738715 X-Patchwork-Delegate: jikos@jikos.cz 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51A67C35276 for ; Tue, 8 Feb 2022 13:16:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346518AbiBHNP6 (ORCPT ); Tue, 8 Feb 2022 08:15:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355445AbiBHMVs (ORCPT ); Tue, 8 Feb 2022 07:21:48 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2076.outbound.protection.outlook.com [40.107.92.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF3FC03FEC0 for ; Tue, 8 Feb 2022 04:21:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zv5c2LKygVdcNIZzA4Bwpe0NFy9vy/SRhmljTfF8HYebLUc63iUwJggvcG/MRkG/EvHVkQgVvKCXQtf/inF6pE17hqVTO5Ev79TYorQ0Fqp4Xk2cT6K9YeD/Lrt7OQtl9zrhF6u+jlt33WWmaU+3yC38qnbYB9vpD/KeKBoBnWsaav8+tJLTYU9tn1E/9Hzrc8D0ZtdesUzV9I8gQZYg/XOMKIRRDSV1PVMl6M8SpNre69QsasRG0rwqYAKRm0lFRBKY3ciAdDfskyxu7NgxbqFry+lDBBCgM9QturjTwyhC6D3YwF6QYCvhCFnAa2eUujKf6YTGlZEGOG589NyZYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PvllRpAxBjVeFrEa9pa2NEEleZjoVTd+qLIVLnbqUGw=; b=SiEUKSc8JznVQHGVssqJQF7bZw7JmzDVdwpvb3/hze9q+NZW4kpHB2nYs3ODQmpU2/RTtj6o864Ad+1eCnNgIecmZhLeTDQwjs5aLQZptkWx3ikysOq8FhoTi5f945FwMSuCRNYDxqn5CLqKlWP7lJXpovNVtWs8ac4nM4idCjoQXgXe/RzzYydueuBvUUdRs7pagY+17JdzqDZHsj0syhS80kJbZ28B8bqRTqHwJTkvhQ9+Gb7+t5KNG8LahikcYQ6Q1s2gNKsb0malMym+1rR+PfG0S203f2lZ2xQ4qp18GsCzlKmL0Bv3Rucy34rPb2ajDl/kWjfOlPiV3KLXcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PvllRpAxBjVeFrEa9pa2NEEleZjoVTd+qLIVLnbqUGw=; b=eRxg4+O43B//zgNdzxFDb/4h/1DhL0iarlxCEQlpD8PF6xfPWGy6MdC/o5tQWwMuCpnlnIy38msGO+0O0YEFDycLysGVwxEw6F2FqCZ7EQXwKwZ3s6gDOHBLdaG0yhd2jsNS+MkpKPOsFLHKsPoU1aKPDl7Gzk0YGde4dmvrwNE= Received: from MW4PR03CA0229.namprd03.prod.outlook.com (2603:10b6:303:b9::24) by DM6PR12MB2650.namprd12.prod.outlook.com (2603:10b6:5:4a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Tue, 8 Feb 2022 12:21:44 +0000 Received: from CO1NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b9:cafe::a8) by MW4PR03CA0229.outlook.office365.com (2603:10b6:303:b9::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 12:21:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT025.mail.protection.outlook.com (10.13.175.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4951.14 via Frontend Transport; Tue, 8 Feb 2022 12:21:44 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 8 Feb 2022 06:21:41 -0600 From: Basavaraj Natikar To: , , , CC: Basavaraj Natikar Subject: [PATCH 1/5] HID: amd_sfh: Handle amd_sfh work buffer in PM ops Date: Tue, 8 Feb 2022 17:51:08 +0530 Message-ID: <20220208122112.942471-2-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> References: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 247067b2-09cd-46ec-3db5-08d9eafd91f1 X-MS-TrafficTypeDiagnostic: DM6PR12MB2650:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QsJJLzJku7ViqRyt6dDNYbNVTGcWkXqlpBrk9HXTq/if/FZIuRhx6p8T1oP3b0/5gYxldJ+iA6oXv4ygb/zrS+HELq/qPh1LY6waQbqgHyMy2PYYnvxxUZ0Nwf8M2Mx+rV9tHvnJP3aPxcw/2KGs3Si0v7/uBbqFLGgxvp0Yh/zPJLTRlbEkMjC6t4a7SG+/AM45sYmNQzXJ+I+BwF66l7x3Xudrj4puvjeAIZBQr0m+zv97yrwGMJJdwsyjmo0i44GeSue1u1nlDHohSV0chmpkyRAwN7tk1KtDbJdOlj/E6T9esvOxtAQw3ZgtbgvDt0BRNbEPPkbAl5clP0JN9Ke7HdiDqU222wqDg5PcIrna0jGMRw91Nzv8FFoMRORRPrMFxhtHkU947FWWViqaQDwgOSRil11nl4d0pdnwEsa74+o94nS/mB91/mrpqNMzZ0BCN5KuCAM6qRjsu5MwFZ4uaXHDhzrEB1cPSau19SskuXEzmRa/6nLLcdrbRjqXvdWJr6u1yx6o0fNnqHT9mqeC07An9Z3sKIho18TtiLJVeWEuUip3PuEZgi3BW243aote5jWFlO+sUErm2DZ8aHpHPF7Vqdt8pnpjIoUbjLVA1anGkrSgw79r0gnpLZO77cRXzW8tBSWl10UlUm5S4UMmqvJ1g6bVYvaHt1prONK7ch/DcrVobInWi6I+p4eJr8VnY7mi3wi5XcWl5JqeDQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(36756003)(16526019)(26005)(82310400004)(36860700001)(2616005)(40460700003)(110136005)(316002)(1076003)(508600001)(83380400001)(47076005)(336012)(186003)(426003)(6636002)(70586007)(8936002)(8676002)(356005)(4326008)(81166007)(5660300002)(86362001)(2906002)(4744005)(70206006)(6666004)(7696005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 12:21:44.3892 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 247067b2-09cd-46ec-3db5-08d9eafd91f1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2650 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Since in the current amd_sfh design the sensor data is periodically obtained in the form of poll data, during the suspend/resume cycle, scheduling a delayed work adds no value. So, cancel the work and restart back during the suspend/resume cycle respectively. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index d3f32ffe299a..dacac30a6b27 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -290,6 +290,8 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev) } } + schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); + return 0; } @@ -312,6 +314,8 @@ static int __maybe_unused amd_mp2_pci_suspend(struct device *dev) } } + cancel_delayed_work_sync(&cl_data->work_buffer); + return 0; } From patchwork Tue Feb 8 12:21:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 12738719 X-Patchwork-Delegate: jikos@jikos.cz 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A194CC4167B for ; Tue, 8 Feb 2022 13:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349046AbiBHNQE (ORCPT ); Tue, 8 Feb 2022 08:16:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355452AbiBHMVu (ORCPT ); Tue, 8 Feb 2022 07:21:50 -0500 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2077.outbound.protection.outlook.com [40.107.212.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A14EDC03FEC0 for ; Tue, 8 Feb 2022 04:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KjcCQUeHme7y4iGyl8iMHVvVafHeeZfFgA+CnecLjqplp0AZBDcFvih8lXyIk8NTYpVUj6QadqFtyoL6koK65OYa8AAhBOENZubE7BOLBE4VYjYT7OiDlvNvrADjgpzE/7IOkfF1FGOl25UefIJWQQMCVRc9X3lcokJOW+6DM8kgnW6w4uMWpUnI6JylIX5X4q8pwJVyMdNEvkdxfhomVcb64D2yQz0D5hhhluTiItketebueDyORQVV4bJn/yXkvEpYH4b1/yguWpSssWQg7ANouANNjR+owoBx5dKUM+cm7GlNl/cW6OJNW8o1ppHQRy5o/nHC1/OZqgwaMIQxNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Aoq9wbAhEAXwJtABJIUvg9/sWAz5lDvnnJkLX7Hh+Xs=; b=DIvH/NcxVU5O7nSWBQkEENSdQ96UwxOv+IlTU/CREpjE2gjIxerGRSjQDT16tmQ+kA0H2Cp8mgayXNJEYtpjaYafstMjOSKXMLz+FaTZzdb/p640W+1T3fVxNk5QEAbGz5me3JtKFLFP1dA0cTCqXei1vtSzrJLLaSYvNsxi0A0ttYwkMSmPaaxZvVToKDs/6v2oLQ1I6316hhZxKINDzQFyDYWQBB+abuyv9i/B90gDtPkxB932JPby7KGdF4DndfrncM7ebhKenxstj/6aw1G3YpnzM1oYrHi4mLZcrPQwDm/0qq81FjskfLuA6NXa4FD260YXc/ES/mEm+pTZkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Aoq9wbAhEAXwJtABJIUvg9/sWAz5lDvnnJkLX7Hh+Xs=; b=nLFcyUcNQ/P1W9IT2Pp+jRWVRvd/EmE+/hK2mV9eNFOxdHg8aKAaA/S6kx2ZVYyAGyPHJG7WZVkkazCWzGOILCdM3cawJ7dPZSVUwK7HcAz3RW08PvCT/ne/TxP6gNRpWT0LXRztw0zfUcyjVDouCuztzE/j3mVhFAQKiy+HO8M= Received: from MW4PR04CA0255.namprd04.prod.outlook.com (2603:10b6:303:88::20) by BYAPR12MB3030.namprd12.prod.outlook.com (2603:10b6:a03:ae::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Tue, 8 Feb 2022 12:21:47 +0000 Received: from CO1NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::30) by MW4PR04CA0255.outlook.office365.com (2603:10b6:303:88::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 12:21:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT029.mail.protection.outlook.com (10.13.174.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 12:21:46 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 8 Feb 2022 06:21:43 -0600 From: Basavaraj Natikar To: , , , CC: Basavaraj Natikar Subject: [PATCH 2/5] HID: amd_sfh: Correct the structure field name Date: Tue, 8 Feb 2022 17:51:09 +0530 Message-ID: <20220208122112.942471-3-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> References: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c198c8b7-76d1-4d28-0a71-08d9eafd938b X-MS-TrafficTypeDiagnostic: BYAPR12MB3030:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ckxv6wMher1osFIfVbP9Z2QB/uSpnP5Y1FRb6TIgXPego0qRYWXCk+u7O9VKwq2zp5AIewMLC6B6SJkGnp0Ts06cbkLcSPI3DjVJIPdXcxlrcNDHm3vgM3+vDjqLIwvznfSEZF9N/s2QmWO1Bx2N7ZYpB9MLShQSAnblmH/7OMPLEbuIcebaREUA7aObj03K+f1RoOIUDVNunyMw0MrgGXmXg51A83/Pf8Mm98cECDs5BePlhwi0mcjYhYcmsxitBtuPu91+MPxX4LWWdaN+IvHwd5k0kB0ZyZqWr9wYF0BEicu1hY+RI+hv+KiLH2I8OBsKLotkaxp6dlc/IrWHZdbvy55EvosbKI431FykfRAJ5Du1ME/bS+n0qk6bEh4zVpeqvkrAylVPBY9aFw/PndZ2gcmItok1JH4c6uUhqtUfLRwPZscBw/pfbccCY5WJSNwxtlodGDbbfKpsIWCZja55m4FDY39N5LnAk4o0WOsyRMG/pmmzWpjXsERNgAyjeDKxHIQiHc6HJD+NsN5aIAvKx0kkxtiHLuxqf+xJ8QYvQ36FwFpLajQmwEpuZp73r7Aus/723RpCRldN543utb+6gXAzAtlapnYhDJg/u+K9bl7UPvbWZW5z1jiWjmQCfe59ppb9Gsa9zTDKGgxsHLyajaDQ7qilN6EkLO3Tqjk9zh99HeqrWGgNBLUakYgGesawErwzn2eWmdjyHHxarQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(2616005)(40460700003)(426003)(1076003)(2906002)(5660300002)(47076005)(86362001)(82310400004)(16526019)(36860700001)(336012)(186003)(83380400001)(70586007)(508600001)(356005)(81166007)(70206006)(4326008)(7696005)(6666004)(8676002)(8936002)(6636002)(4744005)(316002)(26005)(110136005)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 12:21:46.8718 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c198c8b7-76d1-4d28-0a71-08d9eafd938b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3030 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Misinterpreted intr_enable field name. Hence correct the structure field name accordingly to reflect the functionality. Fixes: f264481ad614 ("HID: amd_sfh: Extend driver capabilities for multi-generation support") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h index ae30e059f847..8a9c544c27ae 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h @@ -49,7 +49,7 @@ union sfh_cmd_base { } s; struct { u32 cmd_id : 4; - u32 intr_enable : 1; + u32 intr_disable : 1; u32 rsvd1 : 3; u32 length : 7; u32 mem_type : 1; From patchwork Tue Feb 8 12:21:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 12738720 X-Patchwork-Delegate: jikos@jikos.cz 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D424C4167B for ; Tue, 8 Feb 2022 13:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348702AbiBHNQC (ORCPT ); Tue, 8 Feb 2022 08:16:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245731AbiBHMVy (ORCPT ); Tue, 8 Feb 2022 07:21:54 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2043.outbound.protection.outlook.com [40.107.237.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE61C03FEC0 for ; Tue, 8 Feb 2022 04:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oGc6F531yuvCmAF7QUV9qr1gr70Mz6xuLR3yd9OE95ryY/UnG5euIr9CLLGPqg3kvvHxdCrHGQtKzg17wEvkTU6m1D0MQoiS5m+cm2HJLVKWrbPG8DbO8YRsdzL1jVKSrc2WI3QsH5gDCP+kekfD7DJZ6yl5CxtcVLRUaKEkjZIGtdku/1ae/vDW7R/Zf89/j8lFQk/dwHy3T3+qmFjkkuRXvJbUWQU8bNiWDw+yWClzqqzxUh/ZwWceEm2TCV3t3KHeLhy5Psiqvhco0HXwv3pfLKNE/zBH+/NK3HeWni/0tsliOt3jyzkKWWMjWT3ZlmyMSd/5mPfZSM3znv22vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9CtkzZ6E4pbdeQAO82CnsBzjPzHRhSOz83XC8lKQacs=; b=T9OpFpDLsu4x5jK83ZTh7PscF2vIrMIK1w5VWnhUvQVNCznOqA+gNoJIyihSAIFOBlpUb828KDl2TQxXniSkCmS1XalV81TAt0/gyL64gHn4Nji3yrOXWzEhyBEDHJYCOD2TVts0+ApqHp52BdeoPHp/UfQoRwiBps0Na91l64UDN4FqiM1au1q7b54DSC/viSXSzDBlaZfrproO8Li2QRs9IX7t2qMmR37HxivYEcLAurpMlfuDULLuoWWo9fUmht0c8oFDICV/SoHmRfUOapZWDresJOztoASp5rVVSmN35xYLG9gLABf1TwGnjpcmyeKCm/Y5zxsnIfANhaqxEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9CtkzZ6E4pbdeQAO82CnsBzjPzHRhSOz83XC8lKQacs=; b=elvRk2x4bR+hq5703XqYko0dVmBpmp/MKaqr3J4Bikp4c/Z6BbNueJsyZ6XKInjZCdON9iB2XJeJ3HXdRgj4cYTRRmXCrHhHAX46qMu11XbvWSPg0LJjzNJUPfMQ5/T/4O6Miv/2t9I2ooUg/VbF6k9l+xYh7Hzo/bgmKovinSw= Received: from MW4PR04CA0265.namprd04.prod.outlook.com (2603:10b6:303:88::30) by BN8PR12MB3042.namprd12.prod.outlook.com (2603:10b6:408:63::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Tue, 8 Feb 2022 12:21:49 +0000 Received: from CO1NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::a8) by MW4PR04CA0265.outlook.office365.com (2603:10b6:303:88::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 12:21:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT041.mail.protection.outlook.com (10.13.174.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 12:21:48 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 8 Feb 2022 06:21:45 -0600 From: Basavaraj Natikar To: , , , CC: Basavaraj Natikar Subject: [PATCH 3/5] HID: amd_sfh: Disable the interrupt for all command Date: Tue, 8 Feb 2022 17:51:10 +0530 Message-ID: <20220208122112.942471-4-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> References: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41b945b0-3913-47a5-0b11-08d9eafd9490 X-MS-TrafficTypeDiagnostic: BN8PR12MB3042:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nUvr+1PgQN1PMxrhi5COWhMKkGhZUDmJM14w/Wi6Gvsnm4g+C1xNBim5ZvZZvwZKBztTRrzAkokybq6SQF1uMFa6bQ8fR4MsS0L7BK+xTLhcSQKpdhqGwhCl5jJI148FHDXEh1qUYR0hiBesyQp0LOWCCi0RgWHTdu5GO+j18DzuBIZTtnL8LbD4GCf/RoZHS+8l3bXECC3XcOQMLh82vhErjpjZE601QLtdUUnXqvgMZEwqf6VrXCE8qSRpLKaly6cpGN5s65C/phPuYJPGW/uYeFabuqwzCoBw4eH7RtHIY8Kdyke7O6B/meV0hRugEr5oUs12SgrgRIXLLrKa2MJu8NStpKsZbHevMkbi0zxELk260ASSXf+5AXayfHzl5z7+trYl00M4imGte2jtBlX2yNNLyF2uzMp3RhNJNjUPikSgnIcshjVRYKRt566OKAQkiBTjoXCf4dfsxiThNkIwdIgzQr1KwgQcWpFGpB0vBE4VtfAQ44rBvILq72/Awp2+rSzA5vCJ5GwgFJKVU6yPq0oLGCrkTJq2F2iLU6rzoauuxGFW28Zph2eVKtwnqWyfrTafsyVjchJHDxTZ667Zu3U/jPbt8l9Yh8jqhGxlMu+HLu3GlfP+jnrf5bAKMKmmm02w2Ib/SsaHDMR9EsYDmPW6BDv5DsNo2nQKH81cX5Stt8l4aIjQe52b/WKJK7v9VNFDudcywG/R2rjRuQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(8676002)(4326008)(356005)(8936002)(81166007)(2616005)(5660300002)(7696005)(70586007)(26005)(1076003)(16526019)(47076005)(186003)(36860700001)(6666004)(508600001)(70206006)(110136005)(6636002)(36756003)(316002)(40460700003)(336012)(2906002)(426003)(86362001)(82310400004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 12:21:48.7854 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41b945b0-3913-47a5-0b11-08d9eafd9490 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3042 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Sensor data is processed in polling mode. Hence disable the interrupt for all sensor command. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index dacac30a6b27..16670e910014 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -53,6 +53,7 @@ static void amd_start_sensor_v2(struct amd_mp2_dev *privdata, struct amd_mp2_sen cmd_base.ul = 0; cmd_base.cmd_v2.cmd_id = ENABLE_SENSOR; + cmd_base.cmd_v2.intr_disable = 1; cmd_base.cmd_v2.period = info.period; cmd_base.cmd_v2.sensor_id = info.sensor_idx; cmd_base.cmd_v2.length = 16; @@ -70,6 +71,7 @@ static void amd_stop_sensor_v2(struct amd_mp2_dev *privdata, u16 sensor_idx) cmd_base.ul = 0; cmd_base.cmd_v2.cmd_id = DISABLE_SENSOR; + cmd_base.cmd_v2.intr_disable = 1; cmd_base.cmd_v2.period = 0; cmd_base.cmd_v2.sensor_id = sensor_idx; cmd_base.cmd_v2.length = 16; @@ -83,6 +85,7 @@ static void amd_stop_all_sensor_v2(struct amd_mp2_dev *privdata) union sfh_cmd_base cmd_base; cmd_base.cmd_v2.cmd_id = STOP_ALL_SENSORS; + cmd_base.cmd_v2.intr_disable = 1; cmd_base.cmd_v2.period = 0; cmd_base.cmd_v2.sensor_id = 0; From patchwork Tue Feb 8 12:21:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 12738717 X-Patchwork-Delegate: jikos@jikos.cz 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E8AAC4332F for ; Tue, 8 Feb 2022 13:16:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243057AbiBHNQD (ORCPT ); Tue, 8 Feb 2022 08:16:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355703AbiBHMVy (ORCPT ); Tue, 8 Feb 2022 07:21:54 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2047.outbound.protection.outlook.com [40.107.220.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5B2AC03FECA for ; Tue, 8 Feb 2022 04:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N01kt4ScD0Fua9HxFHBYjlc8GZeTnxE1/8JVvvq2glNHebTPa/HY5miA0mV7n7PydTfOa7KNDAk7iAA4tnMpfPYukfw3Y1ARkM8Z7Iytq3VcDoA8cVKMNlw0padJsUudG1LcM2L4f6tXYCWnedqAwlmUqaH2MJyESgiYmDQ8Ev8FMOQ2nVsheQm1gk8wUeHaI6bxvFInyU0+OkbSro84Tt2c+axO0qr/4rRGi2sdsSh6wUyXtkVY1tch5LJoGUyPFBmSwqjk5ZK5yGayI/Cixt5YMx2UHCa/Px0RiyPovf4d79oqus+OSdmdAF1BIkI7Ca98VdRbfHf0hzp4cViYxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e9GP3wa/BO3DMAA2lMoClvvg0oCUDBnFECoqBoZMSmM=; b=n6PoDmzruCvem2PJgosmQd2yaJOM/Qj85EBe93ibFwPqpnydli9PKWqlcTrD3+mMGTPfau4HF0F5ilo835w8MqepuIp3g8Lh/pLgnerjE658hEvI3hxzHWRn0svHVF+mrNJiSUpSUvx3coczSt2OPzbcEjcrXwEVcZCAVQLaa+29hLUPKP35dY7feqSbVMbu8mMCVyPknNTW9cVjraKDG+zpIKyH9RDcwH3b/E/S5TEYRGL4mXVNioU2QQi+0NiK8x0rbN4zebmyb/zF0HT3XhadP+hgH+ar3KC+xrYh1tJ2+e6RfkUlAY2mPIGbBFHc8rZ3J6Fv/eR1aLqgsfBpKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e9GP3wa/BO3DMAA2lMoClvvg0oCUDBnFECoqBoZMSmM=; b=wKqIqxMfRB32l695dqRLNXMr7mhrUQ27Ddkz03JXfraDPMQuMnEVv2Sted1mZIRvQRH6Lmhk2vqTiOmsNGGKPBdoAGsDwgTIWYFOQ+9gCc0KVcwzzWkByZ4v/qNbWICBpgwA6wDB4Ja192cWtpwWJgWZHVaITyp2u/i3u4MLfJY= Received: from MWHPR14CA0022.namprd14.prod.outlook.com (2603:10b6:300:ae::32) by DM5PR12MB1515.namprd12.prod.outlook.com (2603:10b6:4:6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Tue, 8 Feb 2022 12:21:51 +0000 Received: from CO1NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:300:ae:cafe::3f) by MWHPR14CA0022.outlook.office365.com (2603:10b6:300:ae::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 12:21:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT036.mail.protection.outlook.com (10.13.174.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 12:21:50 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 8 Feb 2022 06:21:48 -0600 From: Basavaraj Natikar To: , , , CC: Basavaraj Natikar Subject: [PATCH 4/5] HID: amd_sfh: Add functionality to clear interrupts Date: Tue, 8 Feb 2022 17:51:11 +0530 Message-ID: <20220208122112.942471-5-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> References: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe7ebf5a-f4d7-413e-d24c-08d9eafd95e0 X-MS-TrafficTypeDiagnostic: DM5PR12MB1515:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JXSpxPTnli9yYk5Sif4kTvWntb1XKBh2/UaBls1RauZq2Uee7gjjy0ljDi6+4Ii6Zc7IHQ4A3MeakaTcnWpwDmfA2XrSSWPlp2Obk8DkMAFaYdyr1K2Nx1LiMbQb1cI+o7NqZtpqfwA0PbHJVFD3HcdWGyWfSn70WE8AqzA36GA1Vx4kLbTM4JUDG857qSAQO0N/qU0Oi2Q17kZb+RgGMGdVWHqhdeE/HAtqlf+8Pub9PHMsXfxRuz6n9EMJMJ5YkAP8/mtn7EWgZICoefUU2KgeLvXAeg5QX+ZEb1857S/OB7KJd36uoUYKrlzNMe5CnILrjx0y3XofjZdqX6wuczBl3Tqg39wAkFLkwXDVceppjFDos/yTKeXPTg4Lmq+6beHKFDeDEFDSmfyxbtGnyYL5sYv7CO6KLn5bDf1YFdiYVcygwfw35fZWaUbg5ICSfexYi+Oas6Dd67uGV64ks8SlJ2qPGJ9w3GNFBMrRsDSu1jNGkTpZ+p16dm67iDCwp/70J07PESthMMjOVTlY0li08FexwSx2yMghSkdKivbc6SQ5qOu4n5daiwoZN0EBRjqb4YgObaIRlDIYrejfKrccuQ8seN+8PA3dkTgzPH/J2Cz3BKBEwY1SrzWEYx0uEF1IJycC6JWpyrc+fiWaVM9iPAmJ10RKCkUIzC7Ap1wEw015DbA3isCTyimSjYUiuGKBLm+U/gsdLB/mq3jpBQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(70586007)(36756003)(6666004)(8676002)(5660300002)(4326008)(70206006)(8936002)(508600001)(316002)(40460700003)(2906002)(83380400001)(426003)(356005)(1076003)(110136005)(16526019)(6636002)(26005)(81166007)(86362001)(2616005)(7696005)(336012)(47076005)(36860700001)(82310400004)(186003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 12:21:50.9925 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe7ebf5a-f4d7-413e-d24c-08d9eafd95e0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1515 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Newer AMD platforms with SFH may generate interrupts on some events which are unwarranted. Until this is cleared the actual MP2 data processing maybe stalled in some cases. Add a mechanism to clear the pending interrupts (if any) during the driver initialization and sensor command operations. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 25 ++++++++++++++++++++++++- drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index 16670e910014..7236b223fb68 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -92,6 +92,20 @@ static void amd_stop_all_sensor_v2(struct amd_mp2_dev *privdata) writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); } +static void amd_sfh_clear_intr_v2(struct amd_mp2_dev *privdata) +{ + if (readl(privdata->mmio + AMD_P2C_MSG(4))) { + writel(0, privdata->mmio + AMD_P2C_MSG(4)); + writel(0xf, privdata->mmio + AMD_P2C_MSG(5)); + } +} + +static void amd_sfh_clear_intr(struct amd_mp2_dev *privdata) +{ + if (privdata->mp2_ops->clear_intr) + privdata->mp2_ops->clear_intr(privdata); +} + void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info) { union sfh_cmd_param cmd_param; @@ -196,6 +210,7 @@ static void amd_mp2_pci_remove(void *privdata) struct amd_mp2_dev *mp2 = privdata; amd_sfh_hid_client_deinit(privdata); mp2->mp2_ops->stop_all(mp2); + amd_sfh_clear_intr(mp2); } static const struct amd_mp2_ops amd_sfh_ops_v2 = { @@ -203,6 +218,7 @@ static const struct amd_mp2_ops amd_sfh_ops_v2 = { .stop = amd_stop_sensor_v2, .stop_all = amd_stop_all_sensor_v2, .response = amd_sfh_wait_response_v2, + .clear_intr = amd_sfh_clear_intr_v2, }; static const struct amd_mp2_ops amd_sfh_ops = { @@ -265,8 +281,13 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i mp2_select_ops(privdata); rc = amd_sfh_hid_client_init(privdata); - if (rc) + if (rc) { + amd_sfh_clear_intr(privdata); + dev_err(&pdev->dev, "amd_sfh_hid_client_init failed\n"); return rc; + } + + amd_sfh_clear_intr(privdata); return devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata); } @@ -294,6 +315,7 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev) } schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); + amd_sfh_clear_intr(mp2); return 0; } @@ -318,6 +340,7 @@ static int __maybe_unused amd_mp2_pci_suspend(struct device *dev) } cancel_delayed_work_sync(&cl_data->work_buffer); + amd_sfh_clear_intr(mp2); return 0; } diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h index 8a9c544c27ae..61de09ba5124 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h @@ -141,5 +141,6 @@ struct amd_mp2_ops { void (*stop)(struct amd_mp2_dev *privdata, u16 sensor_idx); void (*stop_all)(struct amd_mp2_dev *privdata); int (*response)(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts); + void (*clear_intr)(struct amd_mp2_dev *privdata); }; #endif From patchwork Tue Feb 8 12:21:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 12738718 X-Patchwork-Delegate: jikos@jikos.cz 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 304F2C433F5 for ; Tue, 8 Feb 2022 13:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347205AbiBHNP7 (ORCPT ); Tue, 8 Feb 2022 08:15:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356057AbiBHMV4 (ORCPT ); Tue, 8 Feb 2022 07:21:56 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2079.outbound.protection.outlook.com [40.107.220.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D494C03FEC0 for ; Tue, 8 Feb 2022 04:21:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wh96nR5nsmlZf/V9xtMfS3xDuN47KT11GxSuAmH1FA395bavMy7KGuCrWedVi3Agf2GJZ4FTYz1ljZre5Guu0y72hIuq+sUBsLt6AbDjN2nfQopPCCaqTDAE7DtRdioqcAAXjoN8TOE6Wm2Iji0Rzp6oQLHN0hQKWahcLPoIHnDZnDNu571olIy+sLo3nOtiYaDsvxtlm8qrWj1W0j0F/FXr2mvFQN3o+fTT75FePp/sRK5TZ8SujrQjrutbbtSIAvhMH5mEAusjW0zA4v/bHLi1Gx0TLelcszMt/hFLh0yjO+5b48quGG7gfI5Jf9aToEQeDVg9NMhYU1qNztvkLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cRArr+WmYcgUvnQ2G9JrB7/0BsFvS2ZpdEHbC41T9iE=; b=d+aPYP1YM5NEGrf90sfm6J3MDKAHZh4PI5u3oMTncS2AOg//sUiN75cyVO9aFn2myKaFupcHWCTLYPIBRPWiHpmMc/CREkQBBJEpsoPj0i0zsMPGC7l/EAplayisdULOR1Hglps379J48q5Owz1Tn6+Ark0eTb6/LgFMQkWHRnoCCStxhfxvSJTlhOCJ+sqx8VDt0ef8qPTDna/wlB83ORjjr5bhE9B97DX+OPGnmRkS2ZkfU590rzqDWoMeCs1eoEWGgN6Zy6sOjswr+MesZ0d9Tipapc5LV5eOhNQHVTAsQ0ZiNlihhqjM13I776aSDmGVx2lbuNIn0eFwQ8PEGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cRArr+WmYcgUvnQ2G9JrB7/0BsFvS2ZpdEHbC41T9iE=; b=FczYVUxUqc3+VCxr82sve1T2b/oFzRQNWnPgBxrcovZoKMgWdsZnRAcHjw70Y0q1dkJ+0XmNFsRc3BXDo9OCX7Qs7119YT/iJoJjDVRIVj7LPpAHrF92xl9LjZmSjyq36mEF2tHSGx2yXO2P3AdGsmkswiFmv0s+j8I1EHBDmXY= Received: from MWHPR20CA0034.namprd20.prod.outlook.com (2603:10b6:300:ed::20) by CH2PR12MB3894.namprd12.prod.outlook.com (2603:10b6:610:2b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Tue, 8 Feb 2022 12:21:53 +0000 Received: from CO1NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:300:ed:cafe::23) by MWHPR20CA0034.outlook.office365.com (2603:10b6:300:ed::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Tue, 8 Feb 2022 12:21:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT019.mail.protection.outlook.com (10.13.175.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 12:21:53 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Tue, 8 Feb 2022 06:21:50 -0600 From: Basavaraj Natikar To: , , , CC: Basavaraj Natikar Subject: [PATCH 5/5] HID: amd_sfh: Add interrupt handler to process interrupts Date: Tue, 8 Feb 2022 17:51:12 +0530 Message-ID: <20220208122112.942471-6-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> References: <20220208122112.942471-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23f25c91-246b-4357-f4c3-08d9eafd9731 X-MS-TrafficTypeDiagnostic: CH2PR12MB3894:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y7s4b9r0RNhytstVV2vtur1r3IX4oymB6Yig+Jt+vknVliLjRm6ODh8QFjfzuBs8NxJv2y2Hyz+L4QkUQlX49Dx2d7HjNMyLP9mceO8egePODgsi56KzzX/i4damZ1IkAvrNgaC9DINUv5lsSuPcdae6InJO07/j6jfDcU8Q/grahE4VJFqK3krHSHTKwi0Fb4E2Rtc/IOrlqgj3RwJPiLc4NXR/rOKtfCu64z45rHjVV+ojkkp6+i+3D/5tfd/zb4ADqDLOGpB4KQVLCKQh8nJsCJ9+LgxyaKA3nHcGY2gq8SuMB39Xg3AScMAca4fyxIMD7XI748jglko8Y2aY/B2yYZXCqSpXN87aGhl61+WMB+uBGSOBOH/6pracy7MlZwu34OSK4wNvYHCGo4+VBhEoUBfZ2U5kNVi0uwT419VMwaJ+f1xNUV3VscUiUK9TmIAm7lIxDicPYcg9k1SPohbLz80xYtgXpTnp5H9+kOhc3afJxd52chF5YuNciJg45End7434q6nvIakUqjurAx6wTr6E68pSisDdbmaO0Chz9kFMq4rWoY9A357b8uqSKn/8BHEspLJgfGuTUTsOgU/kwmEthFCjkh4NQkKhUab9OPulij2S/vDW/doBOl2ELZClvWq/Gydsfg3B9+VZdU24QJPHhG8jxnwHapodwsMzM6zWEBh2cyX3vw1PBK1fnoJiok+pAXzTmYN0xJTkgQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(83380400001)(47076005)(82310400004)(86362001)(186003)(336012)(426003)(40460700003)(356005)(70586007)(81166007)(70206006)(16526019)(1076003)(2616005)(8936002)(26005)(110136005)(36756003)(316002)(6636002)(8676002)(5660300002)(2906002)(4326008)(36860700001)(6666004)(7696005)(508600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 12:21:53.2019 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23f25c91-246b-4357-f4c3-08d9eafd9731 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3894 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On newer AMD platforms with SFH, it is observed that random interrupts get generated on the SFH hardware and until this is cleared the firmware sensor processing is stalled, resulting in no data been received to driver side. Add routines to handle these interrupts, so that firmware operations are not stalled. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 40 ++++++++++++++++++++++++++ drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 1 + 2 files changed, 41 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index 7236b223fb68..19fa734a9a79 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -106,6 +106,30 @@ static void amd_sfh_clear_intr(struct amd_mp2_dev *privdata) privdata->mp2_ops->clear_intr(privdata); } +static irqreturn_t amd_sfh_irq_handler(int irq, void *data) +{ + amd_sfh_clear_intr(data); + + return IRQ_HANDLED; +} + +static int amd_sfh_irq_init_v2(struct amd_mp2_dev *privdata) +{ + int rc; + + pci_intx(privdata->pdev, true); + + rc = devm_request_irq(&privdata->pdev->dev, privdata->pdev->irq, + amd_sfh_irq_handler, 0, DRIVER_NAME, privdata); + if (rc) { + dev_err(&privdata->pdev->dev, "failed to request irq %d err=%d\n", + privdata->pdev->irq, rc); + return rc; + } + + return 0; +} + void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info) { union sfh_cmd_param cmd_param; @@ -210,6 +234,7 @@ static void amd_mp2_pci_remove(void *privdata) struct amd_mp2_dev *mp2 = privdata; amd_sfh_hid_client_deinit(privdata); mp2->mp2_ops->stop_all(mp2); + pci_intx(mp2->pdev, false); amd_sfh_clear_intr(mp2); } @@ -219,6 +244,7 @@ static const struct amd_mp2_ops amd_sfh_ops_v2 = { .stop_all = amd_stop_all_sensor_v2, .response = amd_sfh_wait_response_v2, .clear_intr = amd_sfh_clear_intr_v2, + .init_intr = amd_sfh_irq_init_v2, }; static const struct amd_mp2_ops amd_sfh_ops = { @@ -244,6 +270,14 @@ static void mp2_select_ops(struct amd_mp2_dev *privdata) } } +static int amd_sfh_irq_init(struct amd_mp2_dev *privdata) +{ + if (privdata->mp2_ops->init_intr) + return privdata->mp2_ops->init_intr(privdata); + + return 0; +} + static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct amd_mp2_dev *privdata; @@ -280,6 +314,12 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i mp2_select_ops(privdata); + rc = amd_sfh_irq_init(privdata); + if (rc) { + dev_err(&pdev->dev, "amd_sfh_irq_init failed\n"); + return rc; + } + rc = amd_sfh_hid_client_init(privdata); if (rc) { amd_sfh_clear_intr(privdata); diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h index 61de09ba5124..97b99861fae2 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h @@ -142,5 +142,6 @@ struct amd_mp2_ops { void (*stop_all)(struct amd_mp2_dev *privdata); int (*response)(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts); void (*clear_intr)(struct amd_mp2_dev *privdata); + int (*init_intr)(struct amd_mp2_dev *privdata); }; #endif