Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2272355rdb; Sun, 11 Feb 2024 21:27:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXjQgTMXGYOR/o1KCwb7f7vNGd6n8FjRIaDjtnwgI+vNLrMi6ET/ZI1qKamRZ94/T0JRPCsE07T6yBK4JX16wm6Xw2aVEbwQ0STIO9QIA== X-Google-Smtp-Source: AGHT+IF6S06LUAnJbZbt/2xskdusMGc5wNKpZRGPNpoKgb+g5O2ucbz5bUD/jMelkwoEY4S2hmMe X-Received: by 2002:a05:6a21:1518:b0:19e:9a65:75eb with SMTP id nq24-20020a056a21151800b0019e9a6575ebmr5453314pzb.40.1707715651915; Sun, 11 Feb 2024 21:27:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707715651; cv=pass; d=google.com; s=arc-20160816; b=HzEWxftHGMBM/4JGsOehHy6C/32uzhF14YX5UvtVXgW1L9+5+PPC0gRl5Y8GjKQzeN mzV7ifd960O2KO30eeaRDQ9/J4SzcIWpT0es2a4kgMR3epdCr0BcyfY69J0+wVmqlc88 Q/K6kS8qMhTPP0SsFBgR/Gc/y87tiU4irt7XwdrRiup3nLjzgx/D608ppj4TP1HVbP7P W6EDVI8Ihgq1nl6TvtWusV4f0F5XBlQlBDjs6MwV93Q0Bh8N9+pRPuIiVYyhl1i7E82G tCtmFBcT5ZqppdToFpQdLIQ0gt1VyccopT2jDPaaq+zuwajQj9ovvYjcXDuXJ5YZnhck SR1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7Hp6G/GdYyjOnzbjiVH1nN7uo7IlLichcM9tg8rvZtg=; fh=/QCRqSUpom2CnOe3HEUzBK3+3CT28pxbFaOzPcJquN8=; b=JOKf5BkJFQ7rkrDqG3cIzbc3g2mxmHiDyex8/inuQsXkJg3xthmB3iChLVq2XKPOJ1 QYjrpA2sRBklVoBlX1Iy257D0rDtZKnIQIPZ3BzuIERxoJbKIhSh7GgJmB65mHljdkEI hSM//WPhYVV3zjewf0B9PQ2XgbQX8wPUVYiXrayNAuv4x/1B+AhSZCuCbL7f0ftMv+Nf 1H/8V7JMw+HYYokMBniBD9HPmxhEeN8WJQjJjbKSeBUgHp5DUfB6MUqRkWG6m9OQj5YF F8+599nij8JyzK7jlSCx07ZCJUxT/tqwLOVi8xRqqxzOfl/O3yEkKWVnAPgkqtP1XqWh Xw0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Uq8BAV6z; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-61106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCVyNKZaZ7UkgLLObThp3zMHn/G8HC5suDgsghsmuI/A9RH04rlKbkMfllinEcWsPMoLK2yaLI5A2xXR6zMCjp84O9ZCPbXfXv2rtXltRw== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ob13-20020a17090b390d00b002972cc7a6acsi1310168pjb.12.2024.02.11.21.27.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 21:27:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Uq8BAV6z; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-61106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.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 4025FB2143D for ; Mon, 12 Feb 2024 05:24:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED56A63CB; Mon, 12 Feb 2024 05:24:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="Uq8BAV6z" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 4CC15C12A; Mon, 12 Feb 2024 05:24:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707715488; cv=none; b=k6eLeuM48snCgYa69wX5y+V251XYj2jIKqVeqpYgb0zHesr3t9yvSQgNW1tjWjLD78zt2DPB+OrP6QkjXflo2iY4INEY/7AMe9E/K8D/fko0Y8VuXEd8YWtkU+FO/rqc0mQk9fkcg+xqydfxoXTp5bR7n/xdW4igwblteLAqut4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707715488; c=relaxed/simple; bh=nA6bRx9p8484xsE1w5FmfW4ys5rFwxKUV/WD7VpBGn8=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=opOyS2avm6hOl4u7KacVO+CbhwmxWaxNrrJqyvFmhtkSL/AV8+QxD30ppSYGZxr/NIOwCw7CPzPIdzneW1eLyIwWD0t+gM3jHmQjdpSqn7u99B0SsZd4QCKFXX2f9VxOv76IEGJVPQIRIHgnqX8/VXEiMDTLOc/bnaymWQCUu74= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=Uq8BAV6z; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41C5ObuT050823; Sun, 11 Feb 2024 23:24:37 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707715477; bh=7Hp6G/GdYyjOnzbjiVH1nN7uo7IlLichcM9tg8rvZtg=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=Uq8BAV6zjyfy6pN0eYb6wfpqDHIeK6qEuAsm7eeG8UVygg5bjRAaVTfRYch6i1IRV +2Efb4JHVwiTgFPP6wHcMfgp3sCH5fXYTA6NdDi9BZkYs8D1LNhS55Q6axYr6bkHmU axHiIo1eDJ5k47ERfMMAbtdXAq02zkQ6mDTWrayo= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41C5ObZl129248 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 11 Feb 2024 23:24:37 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Sun, 11 Feb 2024 23:24:37 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Sun, 11 Feb 2024 23:24:37 -0600 Received: from localhost (dhruva.dhcp.ti.com [172.24.227.68]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 41C5OaGO067453; Sun, 11 Feb 2024 23:24:37 -0600 Date: Mon, 12 Feb 2024 10:54:35 +0530 From: Dhruva Gole To: =?utf-8?B?VGjDqW8=?= Lebrun CC: Mark Brown , , , Gregory CLEMENT , Vladimir Kondratiev , Thomas Petazzoni , Tawfik Bayouk Subject: Re: [PATCH 1/4] spi: cadence-qspi: assert each subnode flash CS is valid Message-ID: <20240212052435.vpisjmqxoe4aff2f@dhruva> References: <20240209-cdns-qspi-cs-v1-0-a4f9dfed9ab4@bootlin.com> <20240209-cdns-qspi-cs-v1-1-a4f9dfed9ab4@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240209-cdns-qspi-cs-v1-1-a4f9dfed9ab4@bootlin.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hi, On Feb 09, 2024 at 14:45:30 +0100, Th?o Lebrun wrote: > Check each flash CS against the num-cs property from devicetree. > Fallback to the driver max supported value (CQSPI_MAX_CHIPSELECT) if > num-cs isn't present. > > cqspi->num_chipselect is set in cqspi_of_get_pdata() to the num-cs > devicetree property, or to CQSPI_MAX_CHIPSELECT if num-cs is not set. Makes sense, > > Signed-off-by: Th?o Lebrun > --- > drivers/spi/spi-cadence-quadspi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c > index d44a0c501879..7ba4d5d16fd2 100644 > --- a/drivers/spi/spi-cadence-quadspi.c > +++ b/drivers/spi/spi-cadence-quadspi.c > @@ -1635,7 +1635,7 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi) > return ret; > } > > - if (cs >= CQSPI_MAX_CHIPSELECT) { > + if (cs >= cqspi->num_chipselect) { Reviewed-by: Dhruva Gole -- Best regards, Dhruva Gole