Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp362317lqh; Fri, 31 May 2024 03:51:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmdpqfrbmqH+12814hJEeQ7z/43YemG1xkQwFPk4hz1/GIa4kFf5QeqyxE7HlBbdlW3BwraCy8H+/VGp9kBv7ksL2xiftZ7PyKrC3RTw== X-Google-Smtp-Source: AGHT+IG4WE8dMjrvQX5f4XEauhPsEmoNKwJZXs1VbSEIn63edgq+SOn54weJVc1tX+8tME7ZuZBH X-Received: by 2002:a05:6358:f18:b0:18f:9dda:502d with SMTP id e5c5f4694b2df-19b48fabc9emr143109255d.22.1717152681216; Fri, 31 May 2024 03:51:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717152681; cv=pass; d=google.com; s=arc-20160816; b=0eYI3SenzxAOMeLCPw87VLsXDDDHQ+fIBTG3/DRQIPCNc4X9UTnpKDakk4Fc+7tO95 jDEXMXs1Nazu6xQIyNbbqYIWxkk9khZOrH6tLuoviPxY308NOsqBOGiTD/VbJoEqk1TJ /bWvw5ie+2vIsrUbexANCAo+HeQL6zKg1MUQalhPvKoHqYmSHVUtvAH3t+LUI9bmEo1T t5ueaBCpTGfHM50pst9Z557DFcF9fxCDQnmc/vtm0XsDdER8Ky/LCnb8qT4me6yFoHqL qusHsRg/y06NXxLcLNusd2exuosSXzvug6fnqnyqBn/Yw7vAiDR2BrahCOntQi/z6b6v oK2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:dlp-filter:cms-type:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=uHe4lHWKM8hrsGb57PeAvfZQzle5G0HXraBJlb7Eicw=; fh=gK7FBjto+diHrgskPY1eNwAmc/UVHBuFUmF57yEsVP4=; b=cN0EoINVTtLWAEnA+hojKa0gdOSIfk6EnuOZAxeC98bClhaeK4Nb1aDjUUZL58AYNZ cXjbPExJSXKmHMx/FQgH8NJQfktYskWvrKF9vNqBJz5alvuUnTIJLCL1RrJ3AEpgE1Vn S5VJPZ0qGDfHUe0nOan4y/2i2/m8U0H4TUB4IEib8/nm/3AABSMiO1pEMpnPMrcjWzun G/XJENMlxjDsMKVyPwO+RKe7MM8I/93vlI053FBBZuK2pV8Ae/Dx7BqsFQV1GWiK5nIr WBFGYoYcsaWi3D8KH4PjS3kL9G7PeDnC7gdGdWGxVZ2vzB63UktAxVhzl0vgFjRUffzo bF2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kizKn1jT; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-196695-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540fb3ecsi1357425a12.161.2024.05.31.03.51.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 03:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196695-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=@samsung.com header.s=mail20170921 header.b=kizKn1jT; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-196695-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 75397281713 for ; Fri, 31 May 2024 10:50:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66A7E1581EE; Fri, 31 May 2024 10:49:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="kizKn1jT" Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 A4422156C7C for ; Fri, 31 May 2024 10:49:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717152595; cv=none; b=aqj/gvO8n7aDfFgOQDEdv5zFZMkpAWzkWj2ogNXL0K0+6tbusuG8nC70yivAA1ivH/senjkKPVgKCwJdRdt2ssjm8pY/XVZpfyevBEvI+m1hwj356vmNAywB6kAwsVfwjgg0E5zAzfNsX7ZGweTeI5tT9pOiqv/ZTB7+XVyCfMk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717152595; c=relaxed/simple; bh=7mStks36RWqI3qkwa9T/IeoxhBPwl6wnLq4xYtaNlVM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=I0IjE15ZmuX2trBiuHculS10isicRBfWpjbZi7zrY2KS3Jw1jFIiCi4zwAga6IYNtAw8KJcS4X53DCNfq933jWhhfta/GiH/w+Qbw1nS+QJkjIDQ/PEdr/iuSYTRuVX2k+AFM06igBLPak5tbq3YnzJFfwKwrDKJyfW37VfiLB0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=kizKn1jT; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240531104949epoutp0304bd8a976c8d986d5365e7dcc7c44e82~UjS7GWTU71957919579epoutp032 for ; Fri, 31 May 2024 10:49:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240531104949epoutp0304bd8a976c8d986d5365e7dcc7c44e82~UjS7GWTU71957919579epoutp032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1717152590; bh=uHe4lHWKM8hrsGb57PeAvfZQzle5G0HXraBJlb7Eicw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kizKn1jThcxeUO0KXrJeA5BCN1ay/4ZBkjQB2fv4m5yjM5iggPmkpUIJLmHneFe5N a/fY/OWCfslBzKjm2yVDg08bqkqzbHn/SzmDe2PQXwFaWdxpY2dtZF0FpoF37FDq/L hlNq8zlfNT9CgZL5KdOVY6I3yEjDUghE7VSoJN5U= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20240531104949epcas2p3dc1dc2bec8419dd1bbce0e5129b5b7a1~UjS6f20Sm1766317663epcas2p3D; Fri, 31 May 2024 10:49:49 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.102]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4VrKd83Sk9z4x9Q0; Fri, 31 May 2024 10:49:48 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 7B.DC.09806.C4BA9566; Fri, 31 May 2024 19:49:48 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20240531104948epcas2p1a70f31cd4a1aa5d36267b4187d75056b~UjS5Wu4tl1681016810epcas2p14; Fri, 31 May 2024 10:49:48 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240531104948epsmtrp22765271c56525eaa6a287314494c588e~UjS5V9eGO3112831128epsmtrp21; Fri, 31 May 2024 10:49:48 +0000 (GMT) X-AuditID: b6c32a47-c6bff7000000264e-23-6659ab4c7e3b Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 45.F1.18846.B4BA9566; Fri, 31 May 2024 19:49:48 +0900 (KST) Received: from localhost.dsn.sec.samsung.com (unknown [10.229.54.230]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240531104947epsmtip1c63e4851994ea32a017f917a98adb709~UjS5JYUt-0934709347epsmtip1M; Fri, 31 May 2024 10:49:47 +0000 (GMT) From: Minwoo Im To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: Alim Akhtar , Avri Altman , Bart Van Assche , Minwoo Im , gost.dev@samsung.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Jeuk Kim Subject: [PATCH 3/3] ufs: mcq: Prevent no I/O queue case for MCQ Date: Fri, 31 May 2024 19:38:21 +0900 Message-Id: <20240531103821.1583934-4-minwoo.im@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531103821.1583934-1-minwoo.im@samsung.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 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHJsWRmVeSWpSXmKPExsWy7bCmma7P6sg0g57J0hYP5m1js3j58yqb xbQPP5ktbh7YyWSxsZ/D4v7Wa4wWl3fNYbPovr6DzWL58X9MFs9OH2B24PK4fMXbY9qkU2we H5/eYvHo27KK0ePzJjmP9gPdTAFsUdk2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6hpYW 5koKeYm5qbZKLj4Bum6ZOUCHKSmUJeaUAoUCEouLlfTtbIryS0tSFTLyi0tslVILUnIKzAv0 ihNzi0vz0vXyUkusDA0MjEyBChOyM25N3sRU0MRZ8ePFLKYGxlXsXYycHBICJhJ9dy+xdjFy cQgJ7GCU6OluZ4FwPjFKHO5pZYJzVk98yAjT8mvTTKiWnYwSG2fPYoRwfjNKXF/6kwmkik1A XaJh6isWEFtEoFpic/tfNpAiZoE+Jon22fNZQRLCAg4Sp94tZwaxWQRUJRbevwTWwCtgIzFt z3kWiHXyEvsPngWr4RSwlWj5f5INokZQ4uTMJ2A1zEA1zVtnM4MskBD4yi6xfe1cqGYXiWct 25ghbGGJV8e3QL0tJfH53V42CLtc4uebSVC/VUgcnHUbKM4BZNtLXHueAmIyC2hKrN+lDxFV ljhyC2orn0TH4b/sEGFeiY42IYgZyhIfDx2C2ikpsfzSa6g9HhIrb06Bhu4ERon5S44wTWBU mIXkmVlInpmFsHgBI/MqRrHUguLc9NRiowJjeAwn5+duYgQnVC33HYwz3n7QO8TIxMF4iFGC g1lJhPdXekSaEG9KYmVValF+fFFpTmrxIUZTYFBPZJYSTc4HpvS8knhDE0sDEzMzQ3MjUwNz JXHee61zU4QE0hNLUrNTUwtSi2D6mDg4pRqYzEScfym+/PpV7HdAVP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dJE0P9lQy9G1OutZw6PMj564F Gayyi2UnheUVTDFnZDWtep9Rn+D7onheT2rb9uX9+1yatO4YRyp/4N4w64LIKalZHLNr4mVX rIuZ6t/qtTDFX2m9d4fMztdxETVb9k80E7jNu+K4mdbzaGH1sr0nJu3p/Oqu4LcmpmNKjpD5 waLNrPePsWUGW3AZnD4ZE20rzX96T5/e9l13Wa/F7Iic6TsxetFTuaYAJ/GJSizFGYmGWsxF xYkArvWw5+kCAAA= X-CMS-MailID: 20240531104948epcas2p1a70f31cd4a1aa5d36267b4187d75056b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240531104948epcas2p1a70f31cd4a1aa5d36267b4187d75056b References: <20240531103821.1583934-1-minwoo.im@samsung.com> If hba_maxq equals poll_queues, which means there are no I/O queues (HCTX_TYPE_DEFAULT, HCTX_TYPE_READ), the very first hw queue will be allocated as HCTX_TYPE_POLL and it will be used as the dev_cmd_queue. In this case, device commands such as QUERY cannot be properly handled. This patch prevents the initialization of MCQ when the number of I/O queues is not set and only the number of POLL queues is set. Signed-off-by: Minwoo Im --- drivers/ufs/core/ufs-mcq.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c index 46faa54aea94..4bcae410c268 100644 --- a/drivers/ufs/core/ufs-mcq.c +++ b/drivers/ufs/core/ufs-mcq.c @@ -179,6 +179,15 @@ static int ufshcd_mcq_config_nr_queues(struct ufs_hba *hba) return -EOPNOTSUPP; } + /* + * Device should support at least one I/O queue to handle device + * commands via hba->dev_cmd_queue. + */ + if (hba_maxq == poll_queues) { + dev_err(hba->dev, "At least one non-poll queue required\n"); + return -EOPNOTSUPP; + } + rem = hba_maxq; if (rw_queues) { -- 2.34.1