From patchwork Fri Feb 9 13:45:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 20156 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp860644dyd; Fri, 9 Feb 2024 05:46:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEymG/edn3XE1in9/VIuqPWzee1oPLElcfbYPhrQSbEYqiWdHYeMisNlg8cAcKoQKowBgHa X-Received: by 2002:a05:6214:2b82:b0:68c:c8ce:3228 with SMTP id kr2-20020a0562142b8200b0068cc8ce3228mr1517603qvb.29.1707486414810; Fri, 09 Feb 2024 05:46:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707486414; cv=pass; d=google.com; s=arc-20160816; b=zJ86LfAvc+HfNuYJ7GgbVtK8iOiHQJjnY1GyvC/DkC5Qf0RoLeNsOgYZJB+Jl8MUJ1 F77wKOqlHjwzHNpOqLKp5cw7LHE07nro2enz4yY/2oFbyTv3AnBO+3dinEDc56dv5C1f ImlmMmGnhsCGR/z8ZcitP6nB3PIE6VZLSWQ/xOWRQ7Hai9+3/LvbYtBsM1G0ASOqh4hd Aw2S3xhZz5AetrfuDjLgDCX+PBuLloE+Ow1B751gy5D12w0QIshPhSWRf3zA8mr4CbPA 4VTVj2xHVKiiWfZ9KwMizlnpFQRehv4OVgiaLbBjdW24OFsoJ3+GjTKiWJ+xXVQn9U8C tg5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=EIHjn3zdB4ZhB1RGLWDwTs8+hgBYlE9S5vEUi/JfTDI=; fh=YnNVEFvbepQjsQ0oBzCg0hF7mpfA6nXdlwqhudtQMDI=; b=sbvSTMiBROY+H0JzCbw8mKKF3GN/jELTVzBXKsct+Bi5swMxSWKgjl+uKcXzdtx29h 8cyMtnDmwuHDXdKnKUiEe0T+cCkvedjoSYk+ZXgO4fvVwFAgZOX1iKUy0Baz57g4AUCK rW5PBSjXncSRLcgnbC3VkvJ+Emx1mMzEHLPpPLFVSjLhZL86hm6eTjMn+vS8YoNBRCTm 31nYJULfHn4UUR6FRMnt4oN9yNCfdHM0W00+9JA6aMGhxkDQ2qvP39DsPCIWPERPKdMh wZw6s64jBaiz3MlvkaB+V9T5hZxx83W0AmysJ8xeLxWm+dcAGPQ+m9pZodWbTX5+1g9J TQIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="UXE/0/sG"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-59381-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59381-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com X-Forwarded-Encrypted: i=2; AJvYcCUPSVPrrp4ckDfPmR0O9xU5PJJcAXQ8zrTiE2hZc2CO/XhTXtjHoxyj/aVz0B5nND/s9M7BzssyxH9CEKpmowiShDDcsA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 1-20020a056214202100b0068cbb1b57ccsi2024526qvf.64.2024.02.09.05.46.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 05:46:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59381-ouuuleilei=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=@bootlin.com header.s=gm1 header.b="UXE/0/sG"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-59381-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59381-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 27BA71C21DFB for ; Fri, 9 Feb 2024 13:46:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0846545975; Fri, 9 Feb 2024 13:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="UXE/0/sG" Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (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 7D26B3D0C5; Fri, 9 Feb 2024 13:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707486357; cv=none; b=TI33GyMHkiJdvG3i5NPt40V3RuK4ZYa5yITny/mytOZTTD1sPeUEFrZoZfW1+4+seWMIP/j4M2A9fIm5EPn44kXMqAKcoImE4dCllQzjZBiqeQLPOJMqO2yHNeM9J511O/q6/+pX9M8VxLonRJPhj4oRanU5ZsBnqC56fc96LVg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707486357; c=relaxed/simple; bh=oWetB+WYKsiEYuWZkCPLaYSNXBZo0AsmwsiyUa7og2o=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=aQCoaioRIhAEEzKww1xDlFZUtOrlVKFn8UiyK1IC9HOpe5qBgDg19YAzgnk05pfFqcFrrHwDsLRZA7/jWCPNKg3q4H8dtm4rO/PNMay+PCXnSY6/aczJIKPlX1Uy3HJZjMqFGZXQNyYHNFdpihS/3HV6RPCueeuahLr5rlPHP+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=UXE/0/sG; arc=none smtp.client-ip=217.70.183.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 49ECDE0010; Fri, 9 Feb 2024 13:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1707486352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EIHjn3zdB4ZhB1RGLWDwTs8+hgBYlE9S5vEUi/JfTDI=; b=UXE/0/sGiyOjQ40tvkjBUm7iV0wz3Bdt1jFvjbTmMmimO/ilC1bcceHbJV55r4C4yOgmdK FiwJ8kNeGSIjEhendltZPpNdP1vjzaRiAzPsZrwedJ0ajPk1ehoOTMQXRuKKAhQ/OGiMA7 noKrf613x3X84J+HvA5i0n6QBAk/ZWHb+gGtcu8V+ob44nZePOnzc4pZajW9vMyPoU0N5M qTVddeB7748/OlsaRHl6xc2YTQ3ZI5tR7AQTejQQE3l68STV5qJbgEezCjrNd7hwgEJmOI 4MtSnKjJKrAWgxhhqnwo5x1RHjdZOE4IWNp7TpHO8dI88irt+3rScuufIcx/0A== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: [PATCH 0/4] spi: cadence-quadspi: correct chip-select logic Date: Fri, 09 Feb 2024 14:45:29 +0100 Message-Id: <20240209-cdns-qspi-cs-v1-0-a4f9dfed9ab4@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAHksxmUC/x3MMQqAMAxA0atIZgNtFEWvIg7appql1gZEEO9uc XzD/w8oZ2GFsXog8yUqRyywdQVuX+LGKL4YyFBryAzofFQ8NQk6xY7sGrgPDfUBSpIyB7n/3TS /7wetga23XgAAAA== To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Dhruva Gole , Gregory CLEMENT , Vladimir Kondratiev , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.12.4 X-GND-Sasl: theo.lebrun@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790429274571251984 X-GMAIL-MSGID: 1790429274571251984 Hi, Here are three independent patches that relate to the handling of chip-select and the number of those in the spi-cadence-quadspi.c driver. - First one is about checking each flash node reg (ie CS) against the ->num_chipselect value instead of the hardcoded max constant. That means it checks against the num-cs DT prop if it existed. Previously num-cs==1 with 2 flash nodes would have lead to no error, a ->num_chipselect==1 and 2 flashes. - Second, we lower the max CS constant from 16 to 4. The hardware only supports 4 anyway, and that makes for less memory used. This got discovered on v6.8-rc2 when the SPI subsystem imposed a max CS of 4. The change got reverted later. - Lastly, we adjust the ->num_chipselect value reported to the actual number of chip-selects. Previously, it reported either the num-cs DT prop or the max value (if no num-cs was provided). There is also a small fix to move to modern names and avoid using the legacy compatibility layer (slave, etc). Thanks, Théo Signed-off-by: Théo Lebrun --- Théo Lebrun (4): spi: cadence-qspi: assert each subnode flash CS is valid spi: cadence-qspi: set maximum chip-select to 4 spi: cadence-qspi: report correct number of chip-select spi: cadence-qspi: switch from legacy names to modern ones drivers/spi/spi-cadence-quadspi.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --- base-commit: 19b50f80b3a4865bd477aa5c026dd234d39a50d2 change-id: 20240209-cdns-qspi-cs-621bfe7f327f Best regards,