Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp167373rdb; Wed, 20 Dec 2023 09:00:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWqSmcgf4NqLJitOA2xJ/R/ZmYAteNbBgnlCctkbjDhmVDLINqD8g9rKQ123aBauY0rVEo X-Received: by 2002:a81:6d0f:0:b0:5d7:17f0:9e53 with SMTP id i15-20020a816d0f000000b005d717f09e53mr37871ywc.0.1703091636999; Wed, 20 Dec 2023 09:00:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703091636; cv=none; d=google.com; s=arc-20160816; b=r2frfERtFA38ZkEigUnGSmgBZ8/I+PPRVNR7O4sygCoSkzLepJ1b3LAy436iNb25ei YxytCGvrRJsxdzbeKrQbNo8Mo+1v0pdFLyE/LkPGOh57WPK4G9EITziW0Yrd5nyh5bZl HETjhNuadThqhs8+l4q9ugGlBCXtaAI020rn059by5kVNqgBg5L+Mz0ZZ95AlGXir3Gd +ut7SuKrTWQ4mqzYmkvxYyCeOG5WIzHtWRO8SgN4ABiJTQ59NVn1odl8shUnyUPfR5lg BjHyiKWY8hd4JOCHnPqCPQu3q7Cvw81G8RDeHB9r0t3NRuod3nkkpmN1WSwGRaZ8DO4n ZvVw== ARC-Message-Signature: i=1; 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=32oCqRWf1U31WonVbIVVCTOgPA2LgnnpjNij004xBaU=; fh=vnQayhUnVAJGQ2igS7mlHRGlx5rk6X9YlYBN9CnBrpw=; b=bNbJLpiVXhQz+2p17bHYuEWAihEJ6EtvPeMh9lyEDnXe03Wz1PhYRJpDZJ1B86cSKI W8oF6iwIfxo2BWKNQYTrr0DftHGomFig03CbAX5W26+vb3/jEpPCoag/WyYqOvcMeXsA OW9SELBpNv/sfWjGe4w2FEiyWdKG/nN94sxYqxwXBbboTS2bMpy+bXpONPiP73h78BTi LkyKc/j021DPyyESZlD0T2ERufdQCB8XHMsGY5J65uJLUTxYhTkHm8JQ9Rf/bO5DSaOQ zJkO3Q6b3mCqIhUWvhl90E2hOJkkKNAK4DsVOHfmq29hEFdCAGGPbX8vuVNeuE61rejD ZfKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HSq/UvqC"; spf=pass (google.com: domain of linux-kernel+bounces-7332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x6-20020a81af46000000b005e26a01da09si65099ywj.224.2023.12.20.09.00.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 09:00:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7332-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=@kernel.org header.s=k20201202 header.b="HSq/UvqC"; spf=pass (google.com: domain of linux-kernel+bounces-7332-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7332-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 B94F31C2217C for ; Wed, 20 Dec 2023 17:00:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9011B4779E; Wed, 20 Dec 2023 17:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HSq/UvqC" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BD80B46B9B; Wed, 20 Dec 2023 17:00:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FDEDC433C8; Wed, 20 Dec 2023 17:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703091617; bh=O/XJ6iMVf5mhzMZzajrKO4sG0osWLp6ZgeTR5QlcSXI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HSq/UvqCvBNPz8ZAFp7iWXIego9AoGZpbvOGN9S7GpdvUlTITrHju9vgCvV52ctZQ cd7ZUcgc1FAAiSqksXNcMsmpxECqdrcpkMeAYEBxyvzBQBVQq8VqXx6JntY54tCkgx oTh/LHdhoXRo8Kka1/CqfWMVPM8mwVZKnZF7Zt4skaDgZQjmijDJp9RP3bURkAGA7O 7Da44Ml2vBhtqpWsBVPARcrlJ3TlNjviJB1tJAvgl01GJnEyxz4SoVtx5zB3KWK1QG UBLPJSzQxDEqQG3JnvSg9FnU3gGNNlsB20Nhf1nnvqX+/4hDYnZmQKL/PKt4tdaWy1 N4MTt7TCtUb3g== Date: Wed, 20 Dec 2023 22:30:01 +0530 From: Manivannan Sadhasivam To: Bart Van Assche Cc: Can Guo , adrian.hunter@intel.com, beanhuo@micron.com, avri.altman@wdc.com, junwoo80.lee@samsung.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org, Alim Akhtar , "James E.J. Bottomley" , Stanley Chu , Asutosh Das , Peter Wang , "Bao D. Nguyen" , Arthur Simchaev , open list Subject: Re: [PATCH] scsi: ufs: core: Let the sq_lock protect sq_tail_slot access Message-ID: <20231220170001.GN3544@thinkpad> References: <1702913550-20631-1-git-send-email-quic_cang@quicinc.com> <20231220145031.GI3544@thinkpad> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Dec 20, 2023 at 08:35:18AM -0800, Bart Van Assche wrote: > On 12/20/23 06:50, Manivannan Sadhasivam wrote: > > On Mon, Dec 18, 2023 at 07:32:17AM -0800, Can Guo wrote: > > > If access sq_tail_slot without the protection from the sq_lock, race > > > condition can have multiple SQEs copied to duplicate SQE slot(s), which can > > > lead to multiple incredible stability issues. Fix it by moving the *dest > > > initialization, in ufshcd_send_command(), back under protection from the > > > sq_lock. > > > > > > Fixes: 3c85f087faec ("scsi: ufs: mcq: Use pointer arithmetic in ufshcd_send_command()") > > > > Cc: stable@vger.kernel.org > > Hmm ... is the "Cc: stable" tag really required if a "Fixes:" tag is present? > Yes it is required as I pointed out in the other thread. - Mani > Bart. > -- மணிவண்ணன் சதாசிவம்