Received: by 2002:a05:7412:a986:b0:f9:90c9:de9f with SMTP id o6csp15356rdh; Wed, 20 Dec 2023 12:57:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYvmyISZ9jUff5X9I0RkJsqbmtf+GRyd+HPqSulJyjCUWkqYJDhxDjszfUr8vjoHJ9K35U X-Received: by 2002:a17:903:260c:b0:1d3:b85c:53c6 with SMTP id jd12-20020a170903260c00b001d3b85c53c6mr4013930plb.57.1703105844527; Wed, 20 Dec 2023 12:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703105844; cv=none; d=google.com; s=arc-20160816; b=QzMubWuFKLVSpwXnt5dGVj4RpaqwaErzNQfuq8UhTWaHKAwLFH+ateO9elyXJKcAeZ Bt+4LdSpM0gHSnBMbzuZXq4yuqhcYYybKZeF2NbxTrrnnDmWI4gnZIg3uKjeqaekbiiw Ts/91h3W+balTZ2Flj80iXZD4p4wJHdGlAVHhdk716qjezCDuuCTmM7gi5Yu8ySiOmIH iHaCdQn6WTbPwEaxQnLLb0CnB9A+tfhDvC86ubtGEizBJNKNLQYx8FYAo2M+r3ReVvI8 aqa2CmZrb8VvIpxcNFe6RroygYepGzGS12xXyuaH00rJNFRnx5t3u0AovkaPLHnBmjvV 6U+g== ARC-Message-Signature: i=1; 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=8I8zO43Yl4bfGhZzZqKg/Gg6wP9iJHOVMkeKuIcZamA=; fh=V6D+wUlmSg/wMmlnQM5seR3kYsmFkDc9G15eAfNXTEg=; b=jw9VTcLnTtdUYmuivj8vIYYUofpBcl1GTiz7hj0AU4NpcCqAEHMTHt4Op03oS81AxZ F+nDdv8VNfidHQg9D9TtNflW5EXNwelc3Z9v/BI0hC3YUj1p1AnbJkloCoqcB9+bXKNf a3C4otSj9UOC9GBCCclWXCSklH18Uh6jLsLmLtYN7T6HhWUF4lL608R0lXdj4s9KgUnL q6X84hEj+BoCiHhnDwXUqsHZFL5IasVwK4cavZepHUBYU+pfSLMhGk6yDDwIfC88yvhn CULedqSusjnQehZU0kMCcw8E28p4RIRZz5CuoJC1BXK2HvuYADMTfVj59YPn91/P03s0 lkiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=O1HI8gZH; spf=pass (google.com: domain of linux-kernel+bounces-7429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v10-20020a63610a000000b005c67e7f7917si307549pgb.409.2023.12.20.12.57.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 12:57:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=O1HI8gZH; spf=pass (google.com: domain of linux-kernel+bounces-7429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3FBB2B2218C for ; Wed, 20 Dec 2023 20:57:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50036495EB; Wed, 20 Dec 2023 20:56:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O1HI8gZH" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 090D048CD0 for ; Wed, 20 Dec 2023 20:56:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a2698eae0a9so7558866b.3 for ; Wed, 20 Dec 2023 12:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703105782; x=1703710582; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8I8zO43Yl4bfGhZzZqKg/Gg6wP9iJHOVMkeKuIcZamA=; b=O1HI8gZHj4ZxwvGujRO0xnZKb+jOoqwp3DS5r3dCvcENscsAodv2uUkCmiAI5jxuxu CFKfx57ECx/I5dClkv0z4tmutnEVD5S8QzprUk6/EeMnAnqQPzv1vT7LqOZKF9nRB3Bt X+IDC7w9EZRM/qqaZMj3pegK/DFXVDb6y7fEp6GvkvRdZOKqAIBriWDv/O65xmQiAb4p kWrL4RTlKe7ewMgeVW8HKlMGD3Ot6baIGiZGDs2rUqhYG993YgXyqN7X2RpQ0P18aTO7 mK/dXN8Vp9VPAGjfiUyFGIjEFBUKT1VzB5xoN/0oB8q1g60ulCK72gW5cGJsSDwTx0C7 uhIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703105782; x=1703710582; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8I8zO43Yl4bfGhZzZqKg/Gg6wP9iJHOVMkeKuIcZamA=; b=Dx+hky+sA/Dt9w+iKUgl3vqmDaMAQW/YvmHbRPvsUVk8l4xWuvRlLfHiD17B4gTIql U5X5LsIdNrx4ErIeGenO5rtaCADxzxOHKVNGjSfDvDaMK+Kbc7leY3u4omfX39h8PaCY mZo39unTcQPD+wo6sekh+rP68v8+gUyEDhr/VjOljwlqaCtZWadIN59kd8GpPQxioB8y X4t1297wlHqdGXeaLq5uludupEFg8fbsESsNSsNC41jjCGejW0rEIzHo1qK3znJ8vPqd SOb6VIWD05HFDm4wn7dSaAmaP9p+KPBjDSfcYMRbBNqBn3QnLOtD80U+IJ5c9GHpCVYy agMA== X-Gm-Message-State: AOJu0YzrElc36MHXgJKQeU0tpRg6aguGlRj2YLP8Wx5ppwrx5Oi9fnok ig0Zd51CP5Bt18eg3yvSftXnETnMo/jY X-Received: by 2002:a17:906:5190:b0:a23:6058:5925 with SMTP id y16-20020a170906519000b00a2360585925mr2880394ejk.34.1703105782143; Wed, 20 Dec 2023 12:56:22 -0800 (PST) Received: from alex-pc-ubuntu.lan (31-10-153-16.cgn.dynamic.upc.ch. [31.10.153.16]) by smtp.gmail.com with ESMTPSA id w10-20020a170906d20a00b00a1d9c81418esm204377ejz.170.2023.12.20.12.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 12:56:21 -0800 (PST) From: Aleksandrs Vinarskis To: alex.vinarskis@gmail.com Cc: andriy.shevchenko@linux.intel.com, hdegoede@redhat.com, lee@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] Fix LPSS clock divider for XPS 9530 Date: Wed, 20 Dec 2023 21:56:19 +0100 Message-Id: <20231220205621.8575-1-alex.vinarskis@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231220073148.19402-1-alex.vinarskis@gmail.com> References: <20231220073148.19402-1-alex.vinarskis@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Thanks to Andy Shevchenko for the review and suggestions. Fixed accordingly. --- Dell XPS 9530 (2023) uses spi-pxa2xx with clock-divider enabled from intel-lpss with the ratio of 1:32767 (Dell's firmware bug). This caps SPI controller's speed at very low value of 3051Hz, which makes the interface practically unusable. Since either spi-pxa2xx or intel-lpss should have clock divider enabled, not both, and SPI controller can have higher speed than requested by the device, it is preffered to disable intel-lpss clock-divider, and let SPI controller handle it. Fixing this issue directly in Dell firmware by setting lpss divider to 1:1 would've been the ideal solution, but is unlikely to ever happen. Particular driver already implements customized solution for handling buggy ACPI tables for select Microsoft devices. This patch series converts it to a more generic quirk table, and adds a new quirk QUIRK_CLOCK_DIVIDER_UNITY which forces clock divider to be set to 1:1. In the future, devices with similar bug (if any) can be easily added to the same pci id lookup table. Aleksandrs Vinarskis (2): mfd: intel-lpss: Switch to generalized quirk table mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 drivers/mfd/intel-lpss-pci.c | 25 ++++++++++++++++--------- drivers/mfd/intel-lpss.c | 9 ++++++++- drivers/mfd/intel-lpss.h | 14 +++++++++++++- 3 files changed, 37 insertions(+), 11 deletions(-) -- 2.40.1