Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp10511rdb; Thu, 25 Jan 2024 06:57:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9BoOsVMQARXcqfIH62iRDLEH4C+Pdh3FFgkMAt6AqiHo8GLb3Kw4G512bRDPpLvqBWqhV X-Received: by 2002:a05:6214:21ae:b0:681:899d:7169 with SMTP id t14-20020a05621421ae00b00681899d7169mr935416qvc.70.1706194672917; Thu, 25 Jan 2024 06:57:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706194672; cv=pass; d=google.com; s=arc-20160816; b=FeAiXrFzJ8Nh+xQnAN0dTLvBUhUoqLd65TxR9fD6n6Oq241UgjhAFL+u0Fvq++cNp/ kabA33T8eZXwxadTXekw18QEmheu2DXSG19TI6yqM1fgAmzM6LHJYgyIM4wD2Kd4tVaQ 2gj27w+d4MIA405YatmSsVZcBiRoQg5M2YOvKBDIaxkmcIeZwV0Gip6oHgzAr7FrU321 ew+QuAv9JWZwxmmLNSZ2id2CyezMm0u8AEOnI+vuqrARudxUunXW9uTZ7cUiyvA2dx57 bypGFSpL4xfACKbpiZA2o5OEYJDCUDpdE5h2/k4yCejNhW5mrAK4BsC37Wa9dkGvplzc i26Q== 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=ApOZNfBccU6dqvedRX4iUyVPu1nTeSF4guAYCuO4Cl4=; fh=neYYEYDDBiloBUX0offulAnrRZM+Gy1+1fqKS4b9oG8=; b=EweVNJbGD9pI4zG8vsj6VIYSXLrlkKGT6wfZTCs5+9H2WM6lh4f2diEwL6qoB7/FYx ooYQGcDZPAYeOShpj5uBjYRUDbmk48bSZ2VwwHNpZt4m+TyNOUO/kJHFRDu280b4o4b0 RzX492BTcIbPjStlAP/8PEdpfhQHy5FlfSf2A7quns+d/A4M8Gbx3/iLmtZdnxcGrx+w JsSkUjoc6QbgipW7HaobN5uPQnPnSo5Q3Lb4pUue3Z9emA6FHmYvJ4HMhi7/dWnMuiDP or2p27t/H5YzG8OWusIinnTZp/SzxFwUOsYuhlE4ZAe/iqwyb80zSArK3hwW2Ljj9SF1 RY0Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RxgHLeg5; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-38773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38773-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n12-20020a0c8c0c000000b00681944692bcsi13088713qvb.233.2024.01.25.06.57.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:57:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RxgHLeg5; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-38773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38773-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A90601C22C55 for ; Thu, 25 Jan 2024 14:57:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5089812C55D; Thu, 25 Jan 2024 14:50:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RxgHLeg5" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 7A849129A94 for ; Thu, 25 Jan 2024 14:50:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706194238; cv=none; b=D6jLqOUJ0vy2Vvrf+OsqwxJWAFYuSZ2skpFjc7BOznMwAN6hpp+UNfvcFiyLJycURoSHJ3eQiPof1z55DfCZ7LKRZzF5jiOCYaZvNBJ8snsxVzPFIsfKcu1bOzGjkFy93xyEzhYYzMgmQOXMC0ShhvsT1TaV00MI49fiAEwMR5Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706194238; c=relaxed/simple; bh=FwiKR/hTM3KwzQ+LcNwdGXXUdm43g3tAGpf1bERFSaY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q985aIRL811ziHYeFILHSpC/5e5IhI7IqkLobKZP6LKgrw7mwRL5+IHMZ14qGGl/t/Ngk6nHWM4BrK+tELHkIAhRmpc5uBQ6b6aio7/7W5PTUkW5CQkNWYWYH4c4l+S+0Sy5r46TZRPrcuh/9Zwd7M9PYv70FdN/TTa5TNRt3xw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RxgHLeg5; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40e76626170so75554045e9.2 for ; Thu, 25 Jan 2024 06:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194232; x=1706799032; 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=ApOZNfBccU6dqvedRX4iUyVPu1nTeSF4guAYCuO4Cl4=; b=RxgHLeg5iNoo1P2Ld9aBETNG84wqGenK1cU7fDpMRMmSR4Mb9srJLUdx69jr3uOzYb lTrnLsDUv20dsqXqm+bAKhnINaf3zgW2gXPVRrcrPrpJXO7uDrC+78VNDckWRQB7U4kq YxRt8a1JpoqKanV1ZY++ACN38T8RG440qoNRLBmX5D3NVwG0wyk1Tht3UosEuzENCusD eI6ZXR3t2NT8/CUY1qd2kyJW88IUDgzRXaURxdf5SeDO9slEYg2ZhcalBbgXOIXqJItJ vAbZaltfq2LlzcmXY4PXhZSs7d7RM3mHSCgZUQEoKSMB91SOqpriLsMVQfJgQdkPvFOE Z2Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194232; x=1706799032; 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=ApOZNfBccU6dqvedRX4iUyVPu1nTeSF4guAYCuO4Cl4=; b=Z1EU0TVNAUVc8f/UieGv7fqmU0XQUb5EPSnQ7//1+P8s+7QoJOyWeUA9ochMsq6dcX HlpaHTUtLAzG8KVqr6qsfue8P7CYwX6bvVvjAKzZyYAeSZydOdZHYL76oJPg9syhdGPW aXnGmXRAiA3IJuUrF8muYKr6dgR42OC/qvUgtOp9tIyJtz16C7qg3hwnf0Yl3I0yIYdA OohtE79mM6Jfm+bkFufearv0z6IBNF5mynLo1JUVrcuTWF2EU6Gk1GUQwCIzqn4tA22H pOkSNjWCdYgk3mCyyk9pzsFTa0rCOHhI7UKbXKpMQ49u+SuqWYmvDWUm0AFlxOwyB/4H YcHg== X-Gm-Message-State: AOJu0YwXBoUxeY1yvMxkrVOleg/7DJXivoyXmHFmzKQJpV6p58gH0sPM kkL8DC+Wd63Z6pcLwDxkbnwZ41Ixu7cou+rh0E5sTroBCbcCOYAL17La6b30es8= X-Received: by 2002:a05:600c:4515:b0:40e:ccf7:3618 with SMTP id t21-20020a05600c451500b0040eccf73618mr664568wmo.23.1706194232646; Thu, 25 Jan 2024 06:50:32 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id v17-20020a05600c471100b0040d91fa270fsm2875875wmo.36.2024.01.25.06.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:31 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, andi.shyti@kernel.org, arnd@arndb.de Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, semen.protsenko@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH v2 24/28] spi: s3c64xx: mark fifo_lvl_mask as deprecated Date: Thu, 25 Jan 2024 14:50:02 +0000 Message-ID: <20240125145007.748295-25-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240125145007.748295-1-tudor.ambarus@linaro.org> References: <20240125145007.748295-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The SPI of_alias was used as an index into the fifo_lvl_mask to determine the FIFO depth of the SPI node. Changing the alias ID into the device tree would make the driver choose a wrong FIFO size configuration, if not accessing past the fifo_lvl_mask array boundaries. Not specifying an SPI alias would make the driver fail to probe, which is also wrong. We now have the infrastructure to correctly determine the FIFO size. SoCs that use the same FIFO size across all the instances of the SPI IP shall infer the FIFO size from the compatible, thus by setting ``s3c64xx_spi_port_config.fifosize``. SoCs that have instances of the SPI IP with different FIFO sizes shall specify the FIFO size to each SPI device tree node by using the ``samsung,spi-fifosize`` property. Mark fifo_lvl_mask as deprecated. Signed-off-by: Tudor Ambarus --- drivers/spi/spi-s3c64xx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 3e7797d915c5..fa70c6aab7c2 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -127,7 +127,8 @@ struct s3c64xx_spi_dma_data { /** * struct s3c64xx_spi_port_config - SPI Controller hardware info - * @fifo_lvl_mask: Bit-mask for {TX|RX}_FIFO_LVL bits in SPI_STATUS register. + * @fifo_lvl_mask: [DEPRECATED] Bit-mask for {TX|RX}_FIFO_LVL bits in + * SPI_STATUS register. * @rx_lvl_offset: Bit offset of RX_FIFO_LVL bits in SPI_STATUS regiter. * @tx_st_done: Bit offset of TX_DONE bit in SPI_STATUS regiter. * @clk_div: Internal clock divider @@ -1415,6 +1416,7 @@ static const struct s3c64xx_spi_port_config s3c6410_spi_port_config = { }; static const struct s3c64xx_spi_port_config s5pv210_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x7F }, .rx_lvl_offset = 15, .tx_st_done = 25, @@ -1423,6 +1425,7 @@ static const struct s3c64xx_spi_port_config s5pv210_spi_port_config = { }; static const struct s3c64xx_spi_port_config exynos4_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F }, .rx_lvl_offset = 15, .tx_st_done = 25, @@ -1433,6 +1436,7 @@ static const struct s3c64xx_spi_port_config exynos4_spi_port_config = { }; static const struct s3c64xx_spi_port_config exynos7_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F, 0x7F, 0x7F, 0x1ff}, .rx_lvl_offset = 15, .tx_st_done = 25, @@ -1443,6 +1447,7 @@ static const struct s3c64xx_spi_port_config exynos7_spi_port_config = { }; static const struct s3c64xx_spi_port_config exynos5433_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff}, .rx_lvl_offset = 15, .tx_st_done = 25, @@ -1465,6 +1470,7 @@ static const struct s3c64xx_spi_port_config exynos850_spi_port_config = { }; static const struct s3c64xx_spi_port_config exynosautov9_spi_port_config = { + /* fifo_lvl_mask is deprecated. */ .fifo_lvl_mask = { 0x1ff, 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f}, .rx_lvl_offset = 15, -- 2.43.0.429.g432eaa2c6b-goog