Received: by 2002:a05:7208:2202:b0:86:316c:7444 with SMTP id s2csp676763rbb; Fri, 31 May 2024 14:34:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWupbwGuF5gnHlGL7gLHgJipEwLHcqN0b3GGOLZS1EM5x0IfbhWbrtHKg6FFlpV+2x0EYp/xIHIPVvhuyZjcSSBV/un5ZBSoFF+ht4UuA== X-Google-Smtp-Source: AGHT+IEd8/UnH4rXXNccUf27b7jTxoCv3ZVQkT4c5JloUSALs7dmNlNsa4M9jTqd3CjvFL98cIFU X-Received: by 2002:a05:6214:3106:b0:6ad:8e56:cb37 with SMTP id 6a1803df08f44-6aecd6ef0c9mr31870396d6.55.1717191293333; Fri, 31 May 2024 14:34:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717191293; cv=pass; d=google.com; s=arc-20160816; b=djNfRziE8Sif5wcvTuVjdjNSnZe8dJNCAm+ZRXWcTpR05EEw35pHvwkMW6GlDzANLO xaIszo5dFoksV4Ecd/tcl8y66wzw4EDB9dlVDFKgmv9yUcF2vnF0YjsS/UF0WMk3LBjw 9uehEbKyyuG5NRfHDykBTwu99bqbM5nQqa5QCpCyopuFZ2vbpG86R/ygPTYsO488+Tpg k9ySexY7vGuzaLqbRfNHkWjsJoi1Qlm8JvojXkYCqauDV38HGURTWQpaBCNySMJ4RQjd mnxkJGf8ormmssvFpvxlob2wXQznMKuplj3junZ5QLxETo6P9SPG+W0ehls5jlIvfUKJ NuGQ== 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=YTBytlr7ecZYCvMxUYhfydMV+Bi6kPS36xosbNeI0cE=; fh=d1Z0/gPqsOB/iNFBH3aWaO73QtKRDfBo2XS9G+3+VTo=; b=gqMGlJgiNmsX4oH2xYZ6bBUOSf/jTZ0DlMgTCWlqVYwzi25GZL7CvcTwAT0pIQVuPy vtQCF0PuOtY4wi4la8zSFS+6D5kmMb7wjrXuTI5ZQerURi0rOXnwA2kmHKF01p3VKmbC VgNRIWx14cMvpI9UuOdbKiuV7jlaTzyfGxAvheixLjBJaNN2fWshuQQIb/R7HnWu/JCH eoea29ecj2WUwqf7emg/sj+oPJOioUUeGYfYLmCkWmzsPvgL8ALdwqXWnfOxEX7/VVK8 imYXMH9GYhhuC3jJV6hLU4znR7E9JCtebr3i8KSak9WmjOUNjp7p1zXWF9KfaGVQXws/ +txg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=rQyAMHzt; 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-197510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197510-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b401f95si31211806d6.260.2024.05.31.14.34.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 14:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=rQyAMHzt; 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-197510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197510-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E34871C24A28 for ; Fri, 31 May 2024 21:34:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07A158002A; Fri, 31 May 2024 21:34:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="rQyAMHzt" Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (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 5EC3277F08 for ; Fri, 31 May 2024 21:34:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717191272; cv=none; b=qHVg0nuFNXTVsFoKiuEDX9P9BV3Hvkc3FWvGSb6z1lxmXxbELTrTb5M63dWl+QjP4QMvebS8uiUIJwwkvviYNmClEMYVlm0x4PvrHjzD6cNbxkyJm+BioynydxMMydLqeCIe8dRfAr5cBqZJuyFY3AsXq7iT0hJ1Q9uA/+C5YAI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717191272; c=relaxed/simple; bh=RS404MaW/RRWkBNJVZPcTnWbwxOOHWs8vCjY74+uM3Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=JDftClL3BC0YtQD9aB9ce6483nM6RYkdAHmgi8ZveNfpNSX4UvsEo7b207FUuwFDWW8IB2EOS1b8mr4tlLPcNqqUuJC0wwruV4E61mzBmmJZgikwJwOm3BAl0yyn6ndG9oNXYr1N3Nl657kLGG3LqynYC7/ziWZG0TNZm1NbK9I= 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=rQyAMHzt; arc=none smtp.client-ip=203.254.224.24 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 epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20240531213427epoutp016f5f61ed85d4af0b488611bd92f3b04e~UsFwKN5C-2372223722epoutp01e for ; Fri, 31 May 2024 21:34:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20240531213427epoutp016f5f61ed85d4af0b488611bd92f3b04e~UsFwKN5C-2372223722epoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1717191267; bh=YTBytlr7ecZYCvMxUYhfydMV+Bi6kPS36xosbNeI0cE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rQyAMHztBoBoy+N/KsuluaMiAr3fQIOcfE3WmIS14oE2Umi1kwDGfOQYHI4e/adPw bKm/c/ePk6zCEL6T7nB4U1ujXxfcImuttmElwDHxWRxvxarwpPeXu3dtxRtNYkvm77 FN45M9NGdrIAXADC5BmdFybiYFN55lHhiNKLhNx4= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20240531213426epcas2p179b6939ef325166973d6f569e1389f10~UsFvcWJg-1103811038epcas2p1W; Fri, 31 May 2024 21:34:26 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.90]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Vrbwx5SH1z4x9Pp; Fri, 31 May 2024 21:34:25 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 8F.35.09479.1624A566; Sat, 1 Jun 2024 06:34:25 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20240531213425epcas2p477d443427f706b999e81432393bfdc8a~UsFuHsr9v2198821988epcas2p49; Fri, 31 May 2024 21:34:25 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240531213425epsmtrp2573c90bc02eb722d9a6b605f38f9efd5~UsFuG7FVd0808808088epsmtrp2x; Fri, 31 May 2024 21:34:25 +0000 (GMT) X-AuditID: b6c32a48-ea7ff70000002507-8d-665a42619b59 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 18.F6.07412.0624A566; Sat, 1 Jun 2024 06:34:24 +0900 (KST) Received: from localhost.dsn.sec.samsung.com (unknown [10.229.54.230]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240531213424epsmtip26f28ca152e1f446c95d844ba27f85083~UsFt4LerI1505315053epsmtip2t; Fri, 31 May 2024 21:34:24 +0000 (GMT) From: Minwoo Im To: "James E . J . Bottomley" , "Martin K . Petersen" , Bart Van Assche Cc: Alim Akhtar , Avri Altman , Minwoo Im , gost.dev@samsung.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Jeuk Kim Subject: [PATCH v2 2/2] ufs: mcq: Prevent no I/O queue case for MCQ Date: Sat, 1 Jun 2024 06:22:44 +0900 Message-Id: <20240531212244.1593535-3-minwoo.im@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531212244.1593535-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+NgFprDJsWRmVeSWpSXmKPExsWy7bCmhW6iU1SawYFfGhYP5m1js3j58yqb xbQPP5ktbh7YyWSxsZ/D4v7Wa4wWl3fNYbPovr6DzWL58X9MFs9OH2B24PK4fMXbY9qkU2we H5/eYvHo27KK0ePzJjmP9gPdTAFsUdk2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6hpYW 5koKeYm5qbZKLj4Bum6ZOUCHKSmUJeaUAoUCEouLlfTtbIryS0tSFTLyi0tslVILUnIKzAv0 ihNzi0vz0vXyUkusDA0MjEyBChOyM6Z3LGUt2MpZcbrrGnsD43X2LkZODgkBE4klZ84B2Vwc QgI7GCV2///MDOF8YpQ43NLDAuF8Y5S4dnENI0zLwe4msHYhgb2MEkfeakEU/WaUeHVlOlgR m4C6RMPUVywgtojAYkaJuav5QIqYBV4wSnxbOI8JJCEs4Cyxa88DsAYWAVWJrk9X2LoYOTh4 BWwkNv+ohlgmL7H/4FlmEJtTwFbi/dbtYDavgKDEyZlPwOYzA9U0b50NdraEQCuHxI9vF1gh ml0kPszdBvWosMSr41ugbCmJz+/2skHY5RI/30yC+qxC4uCs22A3SAjYS1x7ngJiMgtoSqzf pQ8RVZY4cgtqK59Ex+G/7BBhXomONiGIGcoSHw8dYoawJSWWX3oNtcdD4tHB5UyQkJrAKNH5 7zvbBEaFWUiemYXkmVkIixcwMq9iFEstKM5NTy02KjCBx29yfu4mRnAy1fLYwTj77Qe9Q4xM HIyHGCU4mJVEeH+lR6QJ8aYkVlalFuXHF5XmpBYfYjQFhvREZinR5HxgOs8riTc0sTQwMTMz NDcyNTBXEue91zo3RUggPbEkNTs1tSC1CKaPiYNT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oRnNyqKPF6cUlVZ9fT4ky5cy8YK/W7W5tnNCho/Q82Em8tk9qVemiIq21siJ6 Wht42ZkP1J67Pu9o74HiOmPLPO6PbwR3Kv44mJK0bmtOb3y2U7vwb7O/NS+fftLld7b5z7tr inPm/u1GTa+YH4grSd04+dZbKFt5BhcDww5Px7n8n1QWrO86/FhA4+7qyf94ky8qFPP6XnB4 8/fKDU+h82aPY3q4Zy308khPZrpfatu4o+jAM9MDupf1fNfd1NTW4pv1YbHWUdvc+Z+3vv51 Y5oSS3FGoqEWc1FxIgBYj7eW7QIAAA== X-CMS-MailID: 20240531213425epcas2p477d443427f706b999e81432393bfdc8a 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: 20240531213425epcas2p477d443427f706b999e81432393bfdc8a References: <20240531212244.1593535-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 Reviewed-by: Bart Van Assche --- 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