From nobody Fri Dec 19 17:34:23 2025 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 8AD6119F53F; Sun, 24 Mar 2024 22:42:59 +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=1711320179; cv=none; b=dXlXAWhEjCA5uHmpyz7cCmiU4H615mxKMGBPjoIvyF1qdfWFCPqsVWu6zpQzQVjQ2pvM70tatVxWKrYyC5uiSPoDZYJu6xW/FwyjR2GPZ49QsSvzeELUi8f0EBycv3Ke1MTvDwaZEdgKpNaAETooqZssuRNzLDwSAT/ngvuteww= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320179; c=relaxed/simple; bh=Fh4E4z39r7oA0cEzec0Z79XrPswQA0teNAo3fCt4Zg4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XaJVElvJNWi0IH9Z0619L3TvGcdhxNKrvwj2I/93+1lsBZYLIiTn3se77yJHRnbHDkCfwY6wigAp6sYjIsGKzZoENhRgPx+zLAP1/hmollOE/mA7zcSuHqkwyXJfQPO9ofWwWmn8Y33bNTg74kmuXPGFvx1czXfLWQamtK7o4hE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rSu/i80p; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rSu/i80p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5751C433C7; Sun, 24 Mar 2024 22:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320179; bh=Fh4E4z39r7oA0cEzec0Z79XrPswQA0teNAo3fCt4Zg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rSu/i80pftd9RIFSFKbR5wmGkSfLfY6ep9dBmoKRpualdMZg6Dg0H+i+QF7tflkDj TynEnarb6XNUseQFwIyUiIt1QldSuuRxzZnNkLlEMyOm1SpG5SxDOeeTvZyFtPAfzU lzCZEIyeGNcRixx96dCutCCMOKTU7B3hiak+RGlYCetC4aF2lzasohF4G+TS7SRCSz VgILVUcPlpoZ8sYINbrpwWPW/WFtcGWq1EzDN/w08m1PA3wNN//L6a8YL43utNTNp/ R8JxlVGXrien5ost36XHaAMIopr5eTQGahCd5NjyBwUoUCOqPbNhKm28dY3XtrAf3K SZ4asOYpkVvJA== 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.8 487/715] HID: amd_sfh: Avoid disabling the interrupt Date: Sun, 24 Mar 2024 18:31:06 -0400 Message-ID: <20240324223455.1342824-488-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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=3D218104 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-h= id/amd_sfh_pcie.c index 2530fa98b568b..ce449da08e9ba 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -35,6 +35,8 @@ static int sensor_mask_override =3D -1; module_param_named(sensor_mask, sensor_mask_override, int, 0444); MODULE_PARM_DESC(sensor_mask, "override the detected sensors mask"); =20 +static bool intr_disable =3D true; + static int amd_sfh_wait_response_v2(struct amd_mp2_dev *mp2, u8 sid, u32 s= ensor_sts) { union cmd_response cmd_resp; @@ -55,7 +57,7 @@ static void amd_start_sensor_v2(struct amd_mp2_dev *privd= ata, struct amd_mp2_sen =20 cmd_base.ul =3D 0; cmd_base.cmd_v2.cmd_id =3D ENABLE_SENSOR; - cmd_base.cmd_v2.intr_disable =3D 1; + cmd_base.cmd_v2.intr_disable =3D intr_disable; cmd_base.cmd_v2.period =3D info.period; cmd_base.cmd_v2.sensor_id =3D info.sensor_idx; cmd_base.cmd_v2.length =3D 16; @@ -73,7 +75,7 @@ static void amd_stop_sensor_v2(struct amd_mp2_dev *privda= ta, u16 sensor_idx) =20 cmd_base.ul =3D 0; cmd_base.cmd_v2.cmd_id =3D DISABLE_SENSOR; - cmd_base.cmd_v2.intr_disable =3D 1; + cmd_base.cmd_v2.intr_disable =3D intr_disable; cmd_base.cmd_v2.period =3D 0; cmd_base.cmd_v2.sensor_id =3D sensor_idx; cmd_base.cmd_v2.length =3D 16; @@ -87,7 +89,7 @@ static void amd_stop_all_sensor_v2(struct amd_mp2_dev *pr= ivdata) union sfh_cmd_base cmd_base; =20 cmd_base.cmd_v2.cmd_id =3D STOP_ALL_SENSORS; - cmd_base.cmd_v2.intr_disable =3D 1; + cmd_base.cmd_v2.intr_disable =3D intr_disable; cmd_base.cmd_v2.period =3D 0; cmd_base.cmd_v2.sensor_id =3D 0; =20 @@ -292,6 +294,26 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata) return 0; } =20 +static int mp2_disable_intr(const struct dmi_system_id *id) +{ + intr_disable =3D false; + return 0; +} + +static const struct dmi_system_id dmi_sfh_table[] =3D { + { + /* + * https://bugzilla.kernel.org/show_bug.cgi?id=3D218104 + */ + .callback =3D mp2_disable_intr, + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook x360 435 G7"), + }, + }, + {} +}; + static const struct dmi_system_id dmi_nodevs[] =3D { { /* @@ -315,6 +337,8 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, cons= t struct pci_device_id *i if (dmi_first_match(dmi_nodevs)) return -ENODEV; =20 + dmi_check_system(dmi_sfh_table); + privdata =3D devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL); if (!privdata) return -ENOMEM; --=20 2.43.0