Received: by 2002:ab2:855:0:b0:1ef:b27b:cc29 with SMTP id 21csp1722557lqy; Fri, 29 Mar 2024 06:50:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFvf0p1U+SJbIYacFeZdefkNseGZRTPZIEBV1kT+NbjWSpztBjABAbKRuAldi5yBG8f6/9zSAZCWjAqwZoSJDaIB9UcakKMhi+PKuUrg== X-Google-Smtp-Source: AGHT+IEKpkM3IdpOxwcZphQep3f7jtiQLngZZBetoFjpc/LQUZMG2s0mVkZWNtXJ7nxiwxV8snwe X-Received: by 2002:a05:6358:12a6:b0:17b:f259:3098 with SMTP id e38-20020a05635812a600b0017bf2593098mr2567801rwi.3.1711720252894; Fri, 29 Mar 2024 06:50:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711720252; cv=pass; d=google.com; s=arc-20160816; b=ROxb65iz8q7nQJxdSIxqv3MGRiVowqsrrYkEcfoq36qvx1A18TKCL/BaZtSfqW1TeF eoLzwhvnXtW/U2wcK5vwexjORKJcysQcq2fvCJaIpytXjQaPaIZoTsyRzFYMWrWRJip3 RXoboV0GLd5FUlFV5LKWUShHaxBxc98iPapwXQv+CK7oi/YQYhfOO8cU6NhrE5C2TYDT 7AmJh8lJoAZCwRItii4yQ39L1Xbi2lDja390oHl6sWwgrN6W7tjhP0X9XWPHEeF03cx6 fH7ngVhC1kbiAKvfxHmBAOuNJxh7hzxXdXEg0Po2eYzSV9UZdVa1G6nSwKe3IcVvjJVH GJCw== 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=MKV9hBq6VsmqL+7ozh9qAB7YbrRvkGZtJhHysLAr8IM=; fh=CWCRZGRSBBVoz8Or3PmynNSTL4ZgEAvu3fWL3dQv3vU=; b=rgamkhMwaEqj8PISalSER1y460yVrU0jfvbYjvmZSsMdoCTps/Uc/nhP6fqxZCeMnM FZoj3wPV/DdrCsW3sJTdn9JZWI/cHQZkD0sHabZNdX7qDE7Msf38HLa+7cZnBRv5Ziy2 3aNHu5aCtlxZ8G9CAjmAt24oM0S4q5ve0rloU9oWHaalWUR9Es+NDYo+L6+nGmguwmLU c6BM6eLbUhOT6wDAl2ufSzAnd592CIqDH5mrc/NV6LUEw9dA92nBZ5hdfwBw5KNJRbVL 1zjHmTO5y8Hvxgk6b2otQ5YFCGX7tZbq14M/wc8NLYQXP62W0XC3iVMK/B0f1z8BLkWh Ve0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BxbOmAwj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124768-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g10-20020a63f40a000000b005ce7efd2eb5si3548623pgi.266.2024.03.29.06.50.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 06:50:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BxbOmAwj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124768-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8BC072820A4 for ; Fri, 29 Mar 2024 13:46:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 557C5181BB6; Fri, 29 Mar 2024 12:41:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BxbOmAwj" 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 75C8B181B9B; Fri, 29 Mar 2024 12:41:47 +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=1711716107; cv=none; b=k/nXdxFXsWBrt5HFKsILxrc0I4L6X5vSIHF7iN+VjSodcJv2OM9UGrHOyJUVZyqBZ0jSkphogBHhm4ChGuPXXB2yy7nWK9TzPQszMo+dLbUCGDbi8omeMnWPjOqWC0N79u1HM6GNarqI3rYYcC4ks1nMpoVrEArEvFtgDSWvvyo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716107; c=relaxed/simple; bh=CMbxUBDwWb3gao2egFpqs7ok8qzPCP3w+opAmXspYFY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XGkl809NZr6MG1JWnNDIY8wCWuBgvVnt5QEhHj+IVg4mOrSs0xj8ZH1EgtfDJtEybsLpGalLMmfMwhfGMqF6g/+U0STthLKnh7Og2uUHGxRikoYUSdTrq3xsSQM9Ru+z0BuxPHM2oQ2eSjYxhPfAJ5xgVcCafUH/XEg39hvr/qU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BxbOmAwj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B61FC433C7; Fri, 29 Mar 2024 12:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716107; bh=CMbxUBDwWb3gao2egFpqs7ok8qzPCP3w+opAmXspYFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BxbOmAwj2XOVQw84Wc0bS2jNHz7a92bRCoHPJLOjYsFk9ouYja9rJ7weZznEHrIU6 wj5Q9OqJVMo1NNr1DhmwjlgcMsS6NDzcX72sfXG0orainLgZI1Y69v/GfDtIp8Aevr 5uvhiieNZBW76Sj38nTiV8V8kE2MbP70uyyRnkm96X5u0jm/Wa6Iyb8BvzjPR9bPMq JuGNEW8ezzJTUCeKWsgIWA1dFm5zSLad/PoseFNgokh/xDA8kS1nYJfRWyGu2FwYva TzvECEKyEJflQogtwtnUsMjV/5kShOHaEbdS0da1BHQymLTxUjMSP5qgh2V07qnlEl JaDNutcRLfc0g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aleksandrs Vinarskis , Andy Shevchenko , Lee Jones , Sasha Levin Subject: [PATCH AUTOSEL 6.8 58/98] mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 Date: Fri, 29 Mar 2024 08:37:29 -0400 Message-ID: <20240329123919.3087149-58-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240329123919.3087149-1-sashal@kernel.org> References: <20240329123919.3087149-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 X-stable-base: Linux 6.8.2 Content-Transfer-Encoding: 8bit From: Aleksandrs Vinarskis [ Upstream commit 1d8c51ed2ddcc4161e6496cf14fcd83921c50ec8 ] Some devices (eg. Dell XPS 9530, 2023) due to a firmware bug have a misconfigured clock divider, which should've been 1:1. This introduces quirk which conditionally re-configures the clock divider to 1:1. Signed-off-by: Aleksandrs Vinarskis Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231221185142.9224-3-alex.vinarskis@gmail.com Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/intel-lpss-pci.c | 5 +++++ drivers/mfd/intel-lpss.c | 7 +++++++ drivers/mfd/intel-lpss.h | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index 07713a2f694f3..8c00e0c695c5b 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -34,6 +34,11 @@ static const struct pci_device_id quirk_ids[] = { PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237), .driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS, }, + { + /* Dell XPS 9530 (2023) */ + PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x51fb, 0x1028, 0x0beb), + .driver_data = QUIRK_CLOCK_DIVIDER_UNITY, + }, { } }; diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index aafa0da5f8dbf..2a9018112dfc8 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -300,6 +300,7 @@ static int intel_lpss_register_clock_divider(struct intel_lpss *lpss, { char name[32]; struct clk *tmp = *clk; + int ret; snprintf(name, sizeof(name), "%s-enable", devname); tmp = clk_register_gate(NULL, name, __clk_get_name(tmp), 0, @@ -316,6 +317,12 @@ static int intel_lpss_register_clock_divider(struct intel_lpss *lpss, return PTR_ERR(tmp); *clk = tmp; + if (lpss->info->quirks & QUIRK_CLOCK_DIVIDER_UNITY) { + ret = clk_set_rate(tmp, lpss->info->clk_rate); + if (ret) + return ret; + } + snprintf(name, sizeof(name), "%s-update", devname); tmp = clk_register_gate(NULL, name, __clk_get_name(tmp), CLK_SET_RATE_PARENT, lpss->priv, 31, 0, NULL); diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h index 2fa9ef9162580..6f8f668f4c6f0 100644 --- a/drivers/mfd/intel-lpss.h +++ b/drivers/mfd/intel-lpss.h @@ -19,6 +19,11 @@ * Set to ignore resource conflicts with ACPI declared SystemMemory regions. */ #define QUIRK_IGNORE_RESOURCE_CONFLICTS BIT(0) +/* + * Some devices have misconfigured clock divider due to a firmware bug. + * Set this to force the clock divider to 1:1 ratio. + */ +#define QUIRK_CLOCK_DIVIDER_UNITY BIT(1) struct device; struct resource; -- 2.43.0