From patchwork Tue May 7 07:10:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13656361 X-Patchwork-Delegate: jikos@jikos.cz Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2084.outbound.protection.outlook.com [40.107.100.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9F0B13BC0E for ; Tue, 7 May 2024 07:11:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715065870; cv=fail; b=BrNem83Qul9/6s4Iv0BoXnrWLj24qxhdoFx0HWbp0COCm6m05atTqRPuBWoE+OdkLrVZBJ9C153TMARBksKydvaZRbbRRvvZuWbDUGhviHVXLfABolf2EFiRTy8/51em8NxEOBkgrKh0QchJG5R4eOkhHXqrSNFQPi3V7+3Emiw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715065870; c=relaxed/simple; bh=SUc8kSkXbf6ayBWq+iow635kJ+Blnf8zl/HUgpB7Lmw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Etx6FPdz2rB8gxlonRh+PVnR/2HyPp5vKQVbImTFeCDSUCAuP1bguk4OxQ8EU2WqxTMU9Bjx19IqXs2zUiZSpBXyGlM5XjB8lJBPFtsYogloHArqOA4nVBMA4ZZyuX9PPESAcW9bHzKNEfhxi6QMDA5U9dNuOMTZ22nvCUVwHZU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=GwF2WSHB; arc=fail smtp.client-ip=40.107.100.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="GwF2WSHB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kkAPcctTTeIM6vHr1H1lF/Yj2PjjDPue/TIyLpAjh2hUifa4ySxgAZIR59A3nt58Ht3T2XjtL/BgA8FV0k9S1O1SEDhG2XhSoOic0RrXA91H1aDizsgmyfWoUK1akjkmciUpZSbVtVOkuRn6f20awgkTs/qLovDLtH6h/SO5GRgMZWZdScHSPnSWHhKkNF0+UiFMzplJtFLUWn3Px5nGaxSuT+ifga97Jg9Ood90OEZRj4JbsTs0+DRDg9Lwvzm5ZjDeqtI8e5nTn1Cvi3PbHpc3+4QUHCsT51yafLuMhgibR58la9XC9hOdRdSy1Tb+vW/PUJCraClE5VV1TGC41g== 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=JUlKYkqJXgCUH8QnXxAUo2yG9sx/IG2+XfOCJdgYERc=; b=VhRJEbAc60TWri4HQJLu6CHlPftVw8ekbKUMXzRx2PAj3+IRkXXkzgrAUXG1TxlD5B/ki9FUjD8LK0WHx++VuzzW7Hs9ouQXVIlEoMp8qabKESYeX6bTzouh1XmrceBiJ6NahIp3UeZcZcPw15JjfkATaiVj7+UkpzR8dZ5/KxDud/+ngmqc41aoORRKufn19ay47AICfcJzH9fdmITespnb4hXD1TRnipSeZ1IAiGjjukvUgs4xcfJb/SQsg6cK8gVsLlE7GbZODCixg+z7QRGFUDkEJtV4XWgh37xzuEFjSPnuQ3XDac/avcgwmL4VTH6fqhZCjzeRRpo3ZuA4oQ== 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 (0) 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=JUlKYkqJXgCUH8QnXxAUo2yG9sx/IG2+XfOCJdgYERc=; b=GwF2WSHBhtgYf108SHLai7k+fy7Aiklk3zqo4n1CwyJceOgR/YGORYjr+k6IvaMv9YhMIGZa63kb9jP9JdTTCJDxT0xoE6Zw4xb6AmRueGwg5LA42M2zHYDBbyjnDYmvJpVGQEHhEZ34Y4Z4hk8hYfKNOwRTlRXPyD7S0+E90Dw= Received: from DS7PR07CA0003.namprd07.prod.outlook.com (2603:10b6:5:3af::11) by MW4PR12MB5626.namprd12.prod.outlook.com (2603:10b6:303:169::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Tue, 7 May 2024 07:11:04 +0000 Received: from DS2PEPF00003445.namprd04.prod.outlook.com (2603:10b6:5:3af:cafe::43) by DS7PR07CA0003.outlook.office365.com (2603:10b6:5:3af::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.43 via Frontend Transport; Tue, 7 May 2024 07:11:04 +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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003445.mail.protection.outlook.com (10.167.17.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 7 May 2024 07:11:04 +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.2507.35; Tue, 7 May 2024 02:11:02 -0500 From: Basavaraj Natikar To: , , CC: , Basavaraj Natikar Subject: [PATCH 1/3] HID: amd_sfh: Modify and log error only if case of functionality failures Date: Tue, 7 May 2024 12:40:43 +0530 Message-ID: <20240507071045.295723-2-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240507071045.295723-1-Basavaraj.Natikar@amd.com> References: <20240507071045.295723-1-Basavaraj.Natikar@amd.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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-TrafficTypeDiagnostic: DS2PEPF00003445:EE_|MW4PR12MB5626:EE_ X-MS-Office365-Filtering-Correlation-Id: 48ff3062-314d-4053-3a10-08dc6e64dbcf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|376005|1800799015|36860700004; X-Microsoft-Antispam-Message-Info: y9hHmn9Intqa61PiXRD74XPzHADExix7Qzy2cGUWY7xTixSXHqIRxHJLJMyJ+MoG8+KYgILiB15q2598nLggq3u2A8LX+qJVObdmtNQYBULFo1wG6+Rxr5xLJdmVKsAax4pKsboVFBhWOreC9YKAY+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fLdD5i3eb/QLvhT9+Tok0aeEw2M51OyYjlNRpAzV/9C5ZouMZdUauMSA6WQS5QHEHL9h1JW4Q0dk4BGY1KUwrO7HjviNzGr3dwwsZ3TiqhPNO1Lq5Ri2UebmKmJyYvdZvZkVuMW54owqEfpzvsjrnLgR5mDtCog6dOU2pIAAp7d5NZwPnD2CKL7V 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:(13230031)(82310400017)(376005)(1800799015)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 07:11:04.2562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48ff3062-314d-4053-3a10-08dc6e64dbcf 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: DS2PEPF00003445.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5626 Modify log messages, but only log errors when sensors are missing or a true failure occurs to avoid misleading "failed" messages. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 5 +---- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 7 ++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index 9e97c26c4482..0c28ca349bcd 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -333,14 +333,11 @@ static const struct dmi_system_id dmi_nodevs[] = { static void sfh1_1_init_work(struct work_struct *work) { struct amd_mp2_dev *mp2 = container_of(work, struct amd_mp2_dev, work); - struct pci_dev *pdev = mp2->pdev; int rc; rc = mp2->sfh1_1_ops->init(mp2); - if (rc) { - dev_err(&pdev->dev, "sfh1_1_init failed err %d\n", rc); + if (rc) return; - } amd_sfh_clear_intr(mp2); mp2->init_done = 1; diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c index 5b24d5f63701..f46f9c670c6b 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c @@ -202,7 +202,7 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata) } if (!cl_data->is_any_sensor_enabled) { - dev_warn(dev, "Failed to discover, sensors not enabled is %d\n", + dev_warn(dev, "No sensor registered, sensors not enabled is %d\n", cl_data->is_any_sensor_enabled); rc = -EOPNOTSUPP; goto cleanup; @@ -320,7 +320,7 @@ int amd_sfh1_1_init(struct amd_mp2_dev *mp2) memcpy_fromio(&binfo, mp2->vsbase, sizeof(struct sfh_base_info)); if (binfo.sbase.fw_info.fw_ver == 0 || binfo.sbase.s_list.sl.sensors == 0) { - dev_dbg(dev, "failed to get sensors\n"); + dev_dbg(dev, "No sensor registered\n"); return -EOPNOTSUPP; } dev_dbg(dev, "firmware version 0x%x\n", binfo.sbase.fw_info.fw_ver); @@ -337,7 +337,8 @@ int amd_sfh1_1_init(struct amd_mp2_dev *mp2) rc = amd_sfh1_1_hid_client_init(mp2); if (rc) { sfh_deinit_emp2(); - dev_err(dev, "amd_sfh1_1_hid_client_init failed\n"); + if ((rc != -ENODEV) && (rc != -EOPNOTSUPP)) + dev_err(dev, "amd_sfh1_1_hid_client_init failed\n"); return rc; } From patchwork Tue May 7 07:10:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13656362 X-Patchwork-Delegate: jikos@jikos.cz Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2050.outbound.protection.outlook.com [40.107.237.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1E3913C3DF for ; Tue, 7 May 2024 07:11:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715065872; cv=fail; b=pJuOd29xQ5x5+hgOgV4mZhjY7I1J9QU/FbEdaS8B/f1Y81Cyj/xzLJHeVRcxorQ97YS5Dza7HnO5TMYOT5MWQPCAHoxiLWO+fu5ZKVcNLDXjGTyHA0v3djqFLEPpbT36VeS7H+9h/7oxpJH/+GBKgvLCyEHLSr/TdTL9uu8dQis= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715065872; c=relaxed/simple; bh=21o5a64ZFOzxaSeZoT3uZVs88qVvHPyy+sL2H5mu8Jw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WFmfWrQA+vEA0qQ3ZoJ1c5yXmHFgQplOwolrYhWk64gTj8EDOidFB6m0d6+fPbc3vU0e/t0acE8SeWmNGdtY0ETLu1QOrSxI2JlnzvKrbatHRivQ0Bv8rpcRQV2wnHq8m9T6ZTC1FwLXsRUeAd6X7wEDavYBa50q3PY+zydd7Mo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=TldLZW24; arc=fail smtp.client-ip=40.107.237.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="TldLZW24" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G0A0KyKJFR01QV81Ql8PjrPDB30NkqISjTUOXomjds7wcMTgROmkE1vzDSbEu8KSJ7Rt/YbOhNcuIFZnPpMmKGNIjhrnDzUpP9m7rJRPk6yk4Z0zbKFvNFDxy15xlDN74SDSeAFoU2mg4qwsPZYbM1uaKs0tmcReeC5ds8ICXr4aKusdTLBnqVS6426baCRgsJu4l3nQj8UDPs9SWzTSwlIS27+Q3LY+MSIvIwdb5euEUvIa3ef6txizLQ+LKxfusZBqlVJxyd/yEnc/Oh1l0qBly6t5PTlCGkki7iChjYxjU8GNFfCcfJ0VC7jTZ4X1WGdQTf54ezawt7I0sh6a0Q== 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=KKiua9jO3JHvuHXQyuCs7QMQHoZ382EEpwBox4tuFvM=; b=Pur1FTPOQneHTDDPIoenMnD+kF+nza+ENhdGZisEaRvJG49s4f19/Mwo7ectXzOPbHoyTL0CvfY98+SezZ5AL2/1XpX4gbIU8bJA8CZnNAH8DdKea3zSvkZx90OwCdLC+UW1n4NzCGJlHoSY93+GSeAo7oo29Jc0BGd/Fs4p0sMPZ+he6ndut+JyV7fQ6sYAi+xA+uTxP1RrF22xQK1G0seFQvyJHVwKoL+KgwD+X4pF3mBEtIIgXQuLfM/lBuspKrz+f21lIY+YQBoZNiThGabhpGI6j3IUZ8Zy4fFvx/smpkKYMvH2i52CLiIIJYoM3xeDxSi9aa+25oE8sTekzA== 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 (0) 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=KKiua9jO3JHvuHXQyuCs7QMQHoZ382EEpwBox4tuFvM=; b=TldLZW24ZHoTr/27EJsmtb+zTzEypFaDyzrkyE8VrLLI1g/86wFmmitKT/Gk6+ymkA2YmKB1NCyCrZwoMVqQ9xNEimU8r7JPi7nVYXABPpU3WRobbVmVF6wWXt57eoSHLwKjKDCMz3zvvMff9qeIW15Wn3TUPVIaGp270nR1D0o= Received: from CH2PR14CA0053.namprd14.prod.outlook.com (2603:10b6:610:56::33) by SN7PR12MB6767.namprd12.prod.outlook.com (2603:10b6:806:269::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42; Tue, 7 May 2024 07:11:07 +0000 Received: from DS2PEPF00003446.namprd04.prod.outlook.com (2603:10b6:610:56:cafe::52) by CH2PR14CA0053.outlook.office365.com (2603:10b6:610:56::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42 via Frontend Transport; Tue, 7 May 2024 07:11:06 +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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003446.mail.protection.outlook.com (10.167.17.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 7 May 2024 07:11:06 +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.2507.35; Tue, 7 May 2024 02:11:04 -0500 From: Basavaraj Natikar To: , , CC: , Basavaraj Natikar Subject: [PATCH 2/3] HID: amd_sfh: Handle "no sensors" in PM operations Date: Tue, 7 May 2024 12:40:44 +0530 Message-ID: <20240507071045.295723-3-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240507071045.295723-1-Basavaraj.Natikar@amd.com> References: <20240507071045.295723-1-Basavaraj.Natikar@amd.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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-TrafficTypeDiagnostic: DS2PEPF00003446:EE_|SN7PR12MB6767:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a95d2c3-6299-4865-7f66-08dc6e64dd3e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|376005|36860700004|1800799015; X-Microsoft-Antispam-Message-Info: r5hJgjDyL12SXHNvGqd5EB1Lnm3Ipm7mBZmfbDKkgevaj9xqtFE7fH9jMktmMrNzFMCCQKgpmVi58Wk+f/McR26IXJB185/K9js7FHxtiEidqSMlCbwgv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lho5XsmKklLcTKf9KZP2dRL73A78W0iCSVbRQpfaEfDL4HG7FGQgE5PK27lLfD/Srd6yPDa1l/M9fH6zyE0sTDR5eX7pk6V9RCPyaG/0JfTqEADhOAmCv4sNdZEFIRHxvOuEBy949Rn2FRggjXR8um4idkhacgcQb1luJ0Ty3nNSIdo6WYZ9fUB4/yUzn5z2JZ0Y8xaiqdwiV3yGNOC9QVP4CXj 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:(13230031)(82310400017)(376005)(36860700004)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 07:11:06.6475 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a95d2c3-6299-4865-7f66-08dc6e64dd3e 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: DS2PEPF00003446.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6767 Resume or suspend each sensor device based on the num_hid_devices. Therefore, add a check to handle the special case where no sensors are present. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c index f46f9c670c6b..621793d92464 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c @@ -227,6 +227,11 @@ static void amd_sfh_resume(struct amd_mp2_dev *mp2) struct amd_mp2_sensor_info info; int i, status; + if (!cl_data->is_any_sensor_enabled) { + amd_sfh_clear_intr(mp2); + return; + } + for (i = 0; i < cl_data->num_hid_devices; i++) { if (cl_data->sensor_sts[i] == SENSOR_DISABLED) { info.sensor_idx = cl_data->sensor_idx[i]; @@ -252,6 +257,11 @@ static void amd_sfh_suspend(struct amd_mp2_dev *mp2) struct amdtp_cl_data *cl_data = mp2->cl_data; int i, status; + if (!cl_data->is_any_sensor_enabled) { + amd_sfh_clear_intr(mp2); + return; + } + for (i = 0; i < cl_data->num_hid_devices; i++) { if (cl_data->sensor_idx[i] != HPD_IDX && cl_data->sensor_sts[i] == SENSOR_ENABLED) { From patchwork Tue May 7 07:10:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 13656363 X-Patchwork-Delegate: jikos@jikos.cz Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2072.outbound.protection.outlook.com [40.107.244.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C39AE13BAEF for ; Tue, 7 May 2024 07:11:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715065875; cv=fail; b=tAFxXuG+FCBFPSdHw+vdJWC8IkBMthuqGZDYu9FSrYjvLdQ9tfrbLpQGIpHZAshMchx/AoI5Aax96jZJhFqVQukpEMIZ7GVCYWjiGtvGyT+Z9GieUqDjVgJgfNkagdlzWr5BRYNCVU1L0L2fgynDAOnibbLs51tSMosMTFM9eEM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715065875; c=relaxed/simple; bh=J8DOBozeOIDla/OS6LtszzDeVziJCaGdla3JmUnGY7s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MU7JAqu3IWzLEWaQGSi3bc2d96lb4kNoE7RuqTeBDrxNv42Sg0grN2jcpAc1iF1cf0/09wZcKwu4OKUdlNEwtVX3NKK3c80C6y2DY0tXKnNTTK4MDl15HzTP8d+Ojz5yHG4Ep4FTTqjnvw6T6j+Y7ilnu5VLbmWTvEZA/+W10iE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=49d+2UWv; arc=fail smtp.client-ip=40.107.244.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="49d+2UWv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eES9w0taC1egDGi7cqIT2SNmlSpUHztRhUe29rh57jb8VJOdkbIP0XFhHvBZ9q7CQz0gQhzusm9OqKf+UzLS5k/KwjHtNufrYCCHQZtHUh4BS6FEsBUqiqQzq3woPWr78tyLc9hFrBSm0u6q40N97yhR7uEY3ZVdiVSArb1SDW4fWP52svZQO3Hgk/v2P/v9G3aIK/8IJWKGl7FxPBeafABMCnOqx1HBPCt/YIaBJo6aQcJ1p50/CmwJL8dR5Xceo7q7Dw/kmUCsO77tZwsJptYdT52jRT0w5kKWNXpl/YhjTiM0UU2Y0xMIDRDdiUss5oONDiTJuffFXUT6G0cX7g== 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=TH5NegXW+Vv8nW+d0ZTeHdWDXe8PGrbexfJqr9yNQv4=; b=VfBu5XooQE4fIN6kB5D1UxgXLSnlNep9sBQ0v6AHpcRt+kqpdobgmEWgo9H3t+4XjNF0IIow+cfyh2Xa/gAtQH/Bj/gHjQ2RRXLT0v+8IZ2I6VnRGCLzx+cT6n71Dkj4au4Nl7FAi1rXBxxGv5Y5Tt13Ng/CQyhktHYP4fz6iUdyLhvkw0rKokiTXv0ZdoxVbRd/tYPAWwljYX5MZ26w8op+LNQn8lsRSQiE7enESmLiuoiY+ousqKI0GALROVApMuMXU65C97RvD/8qDUntEHQlOS/U68JOZLydyLMoLJFMsWYEOtVwaHFltTHgos2juV1hHtt8BjHII0L87NIBDw== 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 (0) 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=TH5NegXW+Vv8nW+d0ZTeHdWDXe8PGrbexfJqr9yNQv4=; b=49d+2UWvBSn2zprFPC1XQ77Gg6v5q3BoDDY92BDzK+h1prHCXlGYA9lQMsB456uyxPAVGZinIMrm5/kSc0KTBGzzEPijHMowdBCOTxUrGd6UqJC9jmEQzZ0bGBmyury/CHtFB9jFp9lv5V/6zz+oU/hes9ihjv1zQjdqTomDMXo= Received: from CH5PR03CA0011.namprd03.prod.outlook.com (2603:10b6:610:1f1::23) by IA1PR12MB8190.namprd12.prod.outlook.com (2603:10b6:208:3f2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Tue, 7 May 2024 07:11:09 +0000 Received: from DS2PEPF00003442.namprd04.prod.outlook.com (2603:10b6:610:1f1:cafe::e5) by CH5PR03CA0011.outlook.office365.com (2603:10b6:610:1f1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42 via Frontend Transport; Tue, 7 May 2024 07:11:08 +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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003442.mail.protection.outlook.com (10.167.17.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 7 May 2024 07:11:08 +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.2507.35; Tue, 7 May 2024 02:11:06 -0500 From: Basavaraj Natikar To: , , CC: , Basavaraj Natikar Subject: [PATCH 3/3] HID: amd_sfh: Use amd_get_c2p_val() to read C2P register Date: Tue, 7 May 2024 12:40:45 +0530 Message-ID: <20240507071045.295723-4-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240507071045.295723-1-Basavaraj.Natikar@amd.com> References: <20240507071045.295723-1-Basavaraj.Natikar@amd.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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-TrafficTypeDiagnostic: DS2PEPF00003442:EE_|IA1PR12MB8190:EE_ X-MS-Office365-Filtering-Correlation-Id: 25f2a30b-c3b2-49d1-61c1-08dc6e64de74 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|36860700004|82310400017; X-Microsoft-Antispam-Message-Info: 37zVwLQv8pStzGW0mao4MIesOg0Mz0pn8zVwxmusnVMlfusbGsJsoIMpBQG82jj5p2X8JcYQ5QclX5gqzm43Sw7+KCxGowO/sAeSoh8VfISJ9ZwWLJCmy5Hvk78mZBrO5qLSinIXR+1R5qFFgjNBnFX/eZGdkJKrhir5NKhox7AmJhjBswbES4MDjXUpzfvBL0fVRPoZZXtd1tRXg5cDi6Zc8ZIFbvi7Ln8CbRgeaQ75gQiWcyBtsrz8ZuLYox5sP2VetiG14Xc7/7/NC6uh78bGnADdtvTSXeUu9b0Q/qJQnIACdowmRyEhenW4qYYTAYw8S3xyGLfcfQ8emaHZu0Lscq+ezyxx/MwPjA3eVgKAjkzU6oE9eodmvJ2SVLdBMoshPCyMxyOI0dK/nu2+LkEe2hAX4BgjUU1guiLjw5/GkMRnnMj5dQp9wU2ElDSLP5zrB5Cn5/Y6RbXYik1qpDx+iaBn4JHI4EP/5PWlz7eKaMaRkfteJkOvZMGDwaRITjbYaTDE0UtmIemexxL3O2yl3T2RqZgTh1/Tl28OxpzHhN3ndf/dbApWkyAJhT9Z+B30/BpQZYHRFRJXeZ/T9a0T1/Dxc24o7LZn6G/OAZyW3rGFU6cwe3g+85bSXhZRcoYtmjZKnvzePWDwWSGs4CPUM3aI35IT4W/UTLZjYFiNwhYk4+Ao1hE5l4yUa4oXjmizPTjtFVpqBKuXoVcgkPMkqp0SL5QlsXDYJgJlrX8n7U9AM6KrJRv+PtxM60C+ah0w91RfXKFoyaTjqz0oLveapccccBtiYTCvnUW6oezoVtfUx/OIYl3MFmE26g189LKGnBJKSFqEKiyEga0N4y0FgsZu6MUJViTRHOSMP1tvLmaOKDBwks8CwQjezYSIQ0YUAqaRVtt0j1G5BI6mgiGPunXm7CKo8G5VwKV1MhatXM8WENH3LKUi9zbLxNTOhG3O8FE8QOcWPre6P0acIgI+gu8WEzn6+Lwa9c4cH2MLCEuHYXyPVxNsqFOdWWcLnrFYavKjCECHki+FZFlRn4V0szPQeBaHMhtSTYi4qyr9V2Ww6jJjawyYspQbXerTeSBUHalzyxJSKqHv/Ebh+TexxW113/MzHvM6hxJGJHPiwNV1m8iMuIohPuY76cu1asR9LhMNzJtuDFRD+HLQewTs58JiqX1avhNq1GD16bafVEVvCCmr+NXx+xVOFfRwRbu81olST/DBFAh2BEF4Nssj0TLCvvZAGO/5iOdOAM+KpzC4cLUUYiMajk/V5l3ay1GYvFSXvAsQEMVAVYNmhM7X0ZH7RSHToNFTrTRasooqjGnsWw9pZ6aHPztjD0Um4G2pHvb1y2//Awzp6HtC6zY+2EfGRk8TlmrXkc2Z4QY= 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:(13230031)(1800799015)(376005)(36860700004)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 07:11:08.6940 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25f2a30b-c3b2-49d1-61c1-08dc6e64de74 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: DS2PEPF00003442.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8190 Newer processors support various MP2 register sets. Therefore, to ensure compatibility and obtain C2P data, use the amd_get_c2p_val(). Co-developed-by: Patil Rajesh Reddy Signed-off-by: Patil Rajesh Reddy Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c index 2de2668a0277..4676f060da26 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c @@ -97,7 +97,7 @@ static int amd_sfh_hpd_info(u8 *user_present) if (!emp2 || !emp2->dev_en.is_hpd_present) return -ENODEV; - hpdstatus.val = readl(emp2->mmio + AMD_C2P_MSG(4)); + hpdstatus.val = readl(emp2->mmio + amd_get_c2p_val(emp2, 4)); *user_present = hpdstatus.shpd.presence; return 0;