Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp339567rdb; Thu, 21 Dec 2023 10:31:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGi5Sc5nH7Z/z9hTLJY6nk7jPk6kHdUAVceU3my2JGP0+jsLvikvTCdOkGqqo4zVVSVlD+K X-Received: by 2002:a05:6102:f82:b0:466:8eba:aa78 with SMTP id e2-20020a0561020f8200b004668ebaaa78mr25882vsv.18.1703183499803; Thu, 21 Dec 2023 10:31:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703183499; cv=none; d=google.com; s=arc-20160816; b=r8EU/XZQCBlnzqi3Zpy5/b/CCC6/UT2X1pOT5fY7HKQEFAXHSJyUt3MhvNhCbIl6Ib RYe2+6QOE00GDXnASTlGTwZs//79WL2X9jS4OCe07OWOV/Ys3nuI01bCFp8eBf7lJVYA /XHZ2sqgWWlrDWEOo/MKlockn29uZDH5RxunEiCFDZ23T2o8Enud/ZdAlNWg+kqxEzXn JMqFx8GE7mlaEZRJYNGPJoeRx3MmeZXP2dBDlgOKV7AN7Sdo/tkhp4Gp8UiBpKbeB5P6 SnRwBL+8aabtuSW+Ny1uknl551PoFfrSzmG7iGFVVQbI4+tEFznAl6NF+PXF1hbv5n2E Yixg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iqzXGFTYPha3MJ2BS1hqMcmIVr1nRxinkoFODqmbVsw=; fh=bds+fLbE0y9RG+s6ULaMZLFZkT/S653k2DAvkS969oA=; b=zBt5s269gKh4fOt8jYk0cthq8BCgyGMuXtei/u9aIT4VYXjIy5Y6lPRXfys5BPou0j 4TsDDqwLY7NqAwdm/yqmSLD+M84Q9PB87k6FTr8lFyjlsEhkzWUU+UiVeVqtsQsDExyY rQpE1J94jFyGS9YEHpowJdtLewHdzHY2wM2K5N5SBSqXx4ll0wUbsYQmLX+auH3/t8Fn ys0n0XeU5PaoOSTyc972U8k1YyKg5ZueaMdEzdYMMDbivVg7OFnCeRrXyG1ME9zxf1nP 5mDiBV2pafmmifCo09EZW1NeN15N3foUGZiOhEXpXSK7g6vCh5GEofqHmzxCeuvQhO6O +Mzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y2Ijq54z; spf=pass (google.com: domain of linux-kernel+bounces-8926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a22-20020a67f2d6000000b004668e72262bsi500234vsn.773.2023.12.21.10.31.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:31:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y2Ijq54z; spf=pass (google.com: domain of linux-kernel+bounces-8926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 7AFE91C24C49 for ; Thu, 21 Dec 2023 18:31:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2248E22076; Thu, 21 Dec 2023 18:31:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y2Ijq54z" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 11775848C for ; Thu, 21 Dec 2023 18:31:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703183488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iqzXGFTYPha3MJ2BS1hqMcmIVr1nRxinkoFODqmbVsw=; b=Y2Ijq54z5fUqQsvplkxgZEYRBo/0qic8x4/O3s2U+orHRpkEYkoMH9NpG0XYgbkGO53Eul 0hgeLTkeAa3medOAV/eeZTQ28hQ1LwbCUyViWbJlLIKzR9YBdzAHGflbDHO2eGDFHqqX2d 0B3dD7vwqSBBz4aP2qZsXDAacIVc2UU= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-527-OqMiN24YP5yuWe--4v_VwA-1; Thu, 21 Dec 2023 13:31:26 -0500 X-MC-Unique: OqMiN24YP5yuWe--4v_VwA-1 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-427a2626825so7214741cf.2 for ; Thu, 21 Dec 2023 10:31:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703183486; x=1703788286; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iqzXGFTYPha3MJ2BS1hqMcmIVr1nRxinkoFODqmbVsw=; b=i9mPILXQABr0AD0ZcYBxnX0n+WOsV2XNkfB4GbwQP2/WEgGtHaLfzWkG09bUNOYUNv cn6ogjH0f5HPxJ0bNkrOB5uYF/23L2CowhrSTlDqJPYB1szzHrRCiF+xEB0zKXDOtV0o cGdZssksE+Tw2XFQshrxUcRbrYfWEt6YggtucPsvaU3bo/vMqPe9IJEyvX+iCYr1d8tL AOdT9Bbv0pjk74N49t6DLQ/uQgw/CHNPwHMmuZUaeJ6MPIrUyau/DApSUoJ90hTEKOjE DoIvrP+NhUOo5ypfdG3+5mrr8XGT0XIxbXBDyyCzuq/fFaQQLD5dJBmNTa5n/hD+XpmF Tnhw== X-Gm-Message-State: AOJu0YwtpwIXYVGrfwCaUL7N5znaFm6Lzl7m8CkpKlvYLQR5njmkc6as 5dl5uLWfPjikG05aXgyslwgjcO1AhzxckQ/jcTwFn66NcyEj6/4dwmf4FZQtB9zan0s+BLtBOyF N3WN1tR7cD876oj16/FCdZlCPjGRGYrMm X-Received: by 2002:ac8:5b89:0:b0:419:a2c6:8207 with SMTP id a9-20020ac85b89000000b00419a2c68207mr203823qta.22.1703183486356; Thu, 21 Dec 2023 10:31:26 -0800 (PST) X-Received: by 2002:ac8:5b89:0:b0:419:a2c6:8207 with SMTP id a9-20020ac85b89000000b00419a2c68207mr203812qta.22.1703183486097; Thu, 21 Dec 2023 10:31:26 -0800 (PST) Received: from fedora ([2600:1700:1ff0:d0e0::37]) by smtp.gmail.com with ESMTPSA id hj10-20020a05622a620a00b00425e8c7d65fsm1036139qtb.23.2023.12.21.10.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:31:25 -0800 (PST) Date: Thu, 21 Dec 2023 12:31:23 -0600 From: Andrew Halaney To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , Yaniv Gardi , Dov Levenglick , Hannes Reinecke , Subhash Jadavani , Gilad Broner , Venkat Gopalakrishnan , Janek Kotas , Alim Akhtar , Avri Altman , Bart Van Assche , Anjana Hari , Dolev Raviv , Can Guo Cc: Will Deacon , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC v2 00/11] scsi: ufs: Remove overzealous memory barriers Message-ID: References: <20231221-ufs-reset-ensure-effect-before-delay-v2-0-75af2a9bae51@redhat.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=us-ascii Content-Disposition: inline In-Reply-To: <20231221-ufs-reset-ensure-effect-before-delay-v2-0-75af2a9bae51@redhat.com> Sorry for the spam, b4 and smtp with google are not playing nice and failed (but worked fine with --reflect). I'll send a v3 the old school way. My apologies, Andrew On Thu, Dec 21, 2023 at 12:25:17PM -0600, Andrew Halaney wrote: > This is an RFC because I'm not all the confident in this topic. UFS has > a lot of mb() variants used, most with comments saying "ensure this > takes effect before continuing". mb()'s aren't really the way to > guarantee that, a read back is the best method. > > Some of these though I think could go a step further and remove the mb() > variant without a read back. As far as I can tell there's no real reason > to ensure it takes effect in most cases (there's no delay() or anything > afterwards, and eventually another readl()/writel() happens which is by > definition ordered). > > In this current series I don't do that as I wasn't totally convinced, > but it should be considered when reviewing. > > Hopefully this series gets enough interest where we can confidently > merge the final result after review helps improve it. > > I'll be travelling a good bit the next 2ish weeks, so expect little > response until my return. > > Thanks in advance for the help, > Andrew > > Signed-off-by: Andrew Halaney > --- > Changes in v2: > - Added review tags for original patch > - Added new patches to address all other memory barriers used > > - Link to v1: https://lore.kernel.org/r/20231208-ufs-reset-ensure-effect-before-delay-v1-1-8a0f82d7a09e@redhat.com > > --- > Andrew Halaney (11): > scsi: ufs: qcom: Perform read back after writing reset bit > scsi: ufs: qcom: Perform read back after writing REG_UFS_SYS1CLK_1US > scsi: ufs: qcom: Perform read back after writing testbus config > scsi: ufs: qcom: Perform read back after writing unipro mode > scsi: ufs: qcom: Perform read back after writing CGC enable > scsi: ufs: cdns-pltfrm: Perform read back after writing HCLKDIV > scsi: ufs: core: Perform read back after writing UTP_TASK_REQ_LIST_BASE_H > scsi: ufs: core: Perform read back after disabling interrupts > scsi: ufs: core: Perform read back after disabling UIC_COMMAND_COMPL > scsi: ufs: core: Perform read back to commit doorbell > scsi: ufs: core: Perform read back before writing run/stop regs > > drivers/ufs/core/ufshcd.c | 10 +++++----- > drivers/ufs/host/cdns-pltfrm.c | 2 +- > drivers/ufs/host/ufs-qcom.c | 14 ++++++-------- > drivers/ufs/host/ufs-qcom.h | 12 ++++++------ > 4 files changed, 18 insertions(+), 20 deletions(-) > --- > base-commit: 20d857259d7d10cd0d5e8b60608455986167cfad > change-id: 20231208-ufs-reset-ensure-effect-before-delay-6e06899d5419 > > Best regards, > -- > Andrew Halaney >