Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp161459rdb; Wed, 20 Dec 2023 08:49:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqEoUUsBzbXgMUiNd9S5NibuW6URHLv4Xe3ucySWMmIN5OKXFy8hYblvK7rH9/awPt1ryH X-Received: by 2002:a17:903:947:b0:1d3:f344:6b01 with SMTP id ma7-20020a170903094700b001d3f3446b01mr1532542plb.3.1703090996581; Wed, 20 Dec 2023 08:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703090996; cv=none; d=google.com; s=arc-20160816; b=wrtJ58Kbp0my+imgQBPfqGNsv1+afTx3qEWKyR9aKDikB4FIf/1aF7AcQPstkgXUJM Nm1JNMA/HIwBUEbBGjBD/wWhh28HOM4o/tW1hgh1FwkMLBjLw9MdfeFVRpHBvPxNxha+ gm/aTrnhQXG1PG+fI4xyuAdDej6HsfWCT9cNP5hpKsuX3SxX0wGte20KTGLDGlzS0Rk1 770Lkw3PNt+nTlCaRBQJf7G5hSD7ORvS9D29VCooxS8TwJmT0Ea755aajaKUkMOkYOfD bqOWvrjpdk7WsO11TgyNfegeCqMVvU+xlyCAqTNPsBKrpezDzrlvliXXzAhqG6nynasc V6mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=HD391STeMNLNh1weLgIASJ1OOCqGV6Q0hnzwpCWK4Lk=; fh=1UAFtMLbJKkdselYYb8whvhbaxtMvjJ1xdAvAMoSlZk=; b=k56yaMapWyev51c8ul8mLPvE9bH/n4DyhmcGYH0ZhE5o/KXMKiGCszVFsdv9nxou0+ gi965M0gZ4t5iSFvkgf+ilDX0+AW0Gf1Af6TleUkb6iTadh7OYWUnSkmheBl/Vk2Dubh YudbNN8Lvb36MIT1n9plYpfgSoqIzOdgfF7cZ5AqXBqSJ2r4VpvzMqJuZfUcH2025b8I hk5D/kaM2EJ3yk5NdDfoJ5UmDhSwr/kap6LbYYmP3RdfD3/saavc7glV1PdyC12oCY48 aBxRQQ1u854gul/RC04Pd3mlcZbxJ7WM/qxMVIw/v5MMYhzg1XrJinbVDk3rcGvwEt+d qE7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k10-20020a170902694a00b001cfd622b80dsi21676768plt.541.2023.12.20.08.49.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 08:49:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7304-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; spf=pass (google.com: domain of linux-kernel+bounces-7304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A1993B26879 for ; Wed, 20 Dec 2023 16:35:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48A5145BEF; Wed, 20 Dec 2023 16:35:24 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 981E33E482; Wed, 20 Dec 2023 16:35:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1d3ef33e68dso5726155ad.1; Wed, 20 Dec 2023 08:35:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703090122; x=1703694922; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HD391STeMNLNh1weLgIASJ1OOCqGV6Q0hnzwpCWK4Lk=; b=KYOm6UAKCMScs1hldZfVmW8DAoLwDZnbYg/q8OBZLyZ8Sm4TIz39jotY+xmvPcPgzq D3qAspwJBWdASxg7kCOAhz9cSn8d3JWVSEwb2gV6p6gLBFC067JUUBkOAyP785KQOZcC MHVbHA34VbKEjl+H4wUHePCDaBxSWBE/ViN2iMzXt4/B6IC51biVYvEmpStVF7hmnwu1 pHGJjW2taaR4WapelFDBM/7pb5UNpCJ6WcZiJYzQrLhcVS4bPNYza7MNEPqsYGK1zdMv UFHxDWio5Uu0m1wunvgT3lM4xnRDtiuQ02mHBX2g6vwC9E/8W9/Op9yBzomRfPDoJifg KQGg== X-Gm-Message-State: AOJu0YzBP7eDI1AG6pwVb6AUYtWRrpVYv4hAtXHJBF9k31lWpXgWRCmv 7kd6knda2IVKo5Q26UdBrLI= X-Received: by 2002:a17:903:1249:b0:1d3:35e4:bcd7 with SMTP id u9-20020a170903124900b001d335e4bcd7mr4577791plh.34.1703090121356; Wed, 20 Dec 2023 08:35:21 -0800 (PST) Received: from ?IPV6:2620:0:1000:8411:b2aa:4964:8bfa:71c? ([2620:0:1000:8411:b2aa:4964:8bfa:71c]) by smtp.gmail.com with ESMTPSA id y16-20020a17090322d000b001d09c5424d4sm23163822plg.297.2023.12.20.08.35.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Dec 2023 08:35:20 -0800 (PST) Message-ID: Date: Wed, 20 Dec 2023 08:35:18 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] scsi: ufs: core: Let the sq_lock protect sq_tail_slot access Content-Language: en-US To: Manivannan Sadhasivam , Can Guo Cc: 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 References: <1702913550-20631-1-git-send-email-quic_cang@quicinc.com> <20231220145031.GI3544@thinkpad> From: Bart Van Assche In-Reply-To: <20231220145031.GI3544@thinkpad> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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? Bart.