Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2527230lqp; Mon, 25 Mar 2024 01:11:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNZ7T4lvioUAyZfoDSxlJyXJeIEc6e0MUb2IYvIZ+0twOUql4o1s1cDbqqKsw7FScLlLKgNEhD8QooQxTGxDrZngKVsO7+LbOsR9ns5Q== X-Google-Smtp-Source: AGHT+IHsEyvMxkAceDIeUpH9nFX5wCm02r+TLTk2mA8GBgD9NXaRrXPe7QpD5YNGmbpRAHb7y1g6 X-Received: by 2002:ac2:5224:0:b0:513:e223:1959 with SMTP id i4-20020ac25224000000b00513e2231959mr5011314lfl.23.1711354318965; Mon, 25 Mar 2024 01:11:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711354318; cv=pass; d=google.com; s=arc-20160816; b=RaotLSXO67NQwGfN4cdGTxq9pHJc/F67GQg7aSHPVPFb+dpQMotFnXUeXt/roBs3sP 45fuLjLDioWGtYWihUVECNFC7lAsyxmAqv+AY2d6DYQWeKJixb6+F/WEhZXNCrMLaCKw +gmZBHuCf3J5nXiucdcWJ3kuFAe1SJ+J5A2qRg6FH5BoP2XlUeTKW4OntyCJqPlRn8Vi VLT9rDNdZ95AUQUB7CtTdagqE1lmITjz35bFhIitevypIOVkO/X2Vbc5zt2v+nQBPPLY fhm5iEAgy7NvIhU+1CDE9I6Cuhngi8uQT2vVhEs1aGEAa7UbKsvEf9Dg1zCZn1txKNDi 62vQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=t3Tc6QEK5CatG7Wz5tPih4x7e+XIy0C3kzxrpB6A2+E=; fh=TdgFr+E4K5W1ImXBLbK4+yZwf8t+wTxRFlr8d/Ll6gE=; b=lL6cINWFNvDlS3YEE+nPlafuiGauhIg++alfBgXV63mxbyc3znk5wP529C926g1WyD IN3C4bJnrouITXQA7V9e7LOdzbbnWXsP0rnCItXgzB9t8QOtJVM6/PbhHlEU2cEuZL+i ESLdu7jc4I+vnafnGhQmeQ75+we89c5/rh0PPNKypJwiyHXTp3GtH3c+QMo0bjan015R V/D0j0ctTGHdk/ZTWd+0EI5paDmHWCa8/j6j0bwTLgvrkDsqqfsSSP7nZ3b4wx4Elc5U czAZCd/sWMfiDCeW3Qc1cI8nKcax8NftGeTITAcwJ25uJmv2INyUrHdOulQLP7JpqzQP 0Isg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kRnjTNRJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115965-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b6-20020a17090630c600b00a46930c8271si2277677ejb.564.2024.03.25.01.11.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 01:11:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kRnjTNRJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115965-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7E94F1F2AF57 for ; Mon, 25 Mar 2024 08:11:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F2603941C0; Mon, 25 Mar 2024 03:04:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kRnjTNRJ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DE23E2310F3; Sun, 24 Mar 2024 23:17:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322242; cv=none; b=s7MOJ+36XM1+lgFiy3MUOvN0gNvXq6nbzDa5MroAg+eTPjIqaEutzhr86s+ogo7Bch4l9+NwRzpfRp4WFKdKHIJoMfT1jOP3TtZq1IkpHRxVODJYXgvAhwp6OdAGAnN50QBQmQY03AUrNI82F+qw2syJBqDi6ko18u7mpMLX668= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322242; c=relaxed/simple; bh=Y7pSJCIFy5hLzie/88qVNlRFb+4wqmhmG+ookRDJzGA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LIrjDpJdYO8VRbTD2NNpTPloInneZRmFtB/3gk15XtdznwcQ8AP4oLWK2WubHlEgBn5r5T/AYyjJS0yZHdMq6ST+ud6Y60qy5ROQ0eMnzxemuqmRttv/DWiEcy2AhAqLEx2QGP0bHWmD0XOCLRIZ6uxZy5wEoL8+0+NfvSMNhh0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kRnjTNRJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FE93C433F1; Sun, 24 Mar 2024 23:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322240; bh=Y7pSJCIFy5hLzie/88qVNlRFb+4wqmhmG+ookRDJzGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kRnjTNRJdQqqkYIHp/B7FEEMONkDIlcWANsvmO4MaIO080Vy5pjqYpOT2ZtySSskO hK2t6Uh3UEzdEsytk5bi57wAh07vCS7Ja/qEkrdzgmSTKu1KX9It7oT5e87VXCL8J+ cMUl4NyPH/uV4mFKAjzoe8z/LVN3PxEuxGHkDJEDhafjRoIlOUMwYDdzhVwMMz2G2r WFOMajJysIBeDoZCjiJfwE272BdOaiKZeSBgodiD5FUsAgum+90tyEgN+K3YiboiQ/ 1USpRbqxsFq/N1TAZJTiN9Td+W5ybdIxrdcJaJ8xd46oDWXv4AIekX2hhX8+TDYTME XzPEpZZbawjUA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Basavaraj Natikar , Akshata MukundShetty , Jiri Kosina , Sasha Levin Subject: [PATCH 6.1 322/451] HID: amd_sfh: Avoid disabling the interrupt Date: Sun, 24 Mar 2024 19:09:58 -0400 Message-ID: <20240324231207.1351418-323-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Basavaraj Natikar [ Upstream commit c1db0073212ef39d5a46c2aea5e49bf884375ce4 ] HP ProBook x360 435 G7 using older version of firmware which doesn't support disabling the interrupt for all commands. Hence avoid disabling the interrupt for that particular model. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218104 Fixes: b300667b33b2 ("HID: amd_sfh: Disable the interrupt for all command") Co-developed-by: Akshata MukundShetty Signed-off-by: Akshata MukundShetty Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 30 +++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index c936d6a51c0cd..9c963ad27f9d1 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -34,6 +34,8 @@ static int sensor_mask_override = -1; module_param_named(sensor_mask, sensor_mask_override, int, 0444); MODULE_PARM_DESC(sensor_mask, "override the detected sensors mask"); +static bool intr_disable = true; + static int amd_sfh_wait_response_v2(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts) { union cmd_response cmd_resp; @@ -54,7 +56,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.intr_disable = intr_disable; cmd_base.cmd_v2.period = info.period; cmd_base.cmd_v2.sensor_id = info.sensor_idx; cmd_base.cmd_v2.length = 16; @@ -72,7 +74,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.intr_disable = intr_disable; cmd_base.cmd_v2.period = 0; cmd_base.cmd_v2.sensor_id = sensor_idx; cmd_base.cmd_v2.length = 16; @@ -86,7 +88,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.intr_disable = intr_disable; cmd_base.cmd_v2.period = 0; cmd_base.cmd_v2.sensor_id = 0; @@ -288,6 +290,26 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata) return 0; } +static int mp2_disable_intr(const struct dmi_system_id *id) +{ + intr_disable = false; + return 0; +} + +static const struct dmi_system_id dmi_sfh_table[] = { + { + /* + * https://bugzilla.kernel.org/show_bug.cgi?id=218104 + */ + .callback = mp2_disable_intr, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook x360 435 G7"), + }, + }, + {} +}; + static const struct dmi_system_id dmi_nodevs[] = { { /* @@ -311,6 +333,8 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i if (dmi_first_match(dmi_nodevs)) return -ENODEV; + dmi_check_system(dmi_sfh_table); + privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL); if (!privdata) return -ENOMEM; -- 2.43.0