Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp8656rdb; Mon, 22 Jan 2024 10:09:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHy5eQiInmsMu4p9YLqq/FIvVjbicvG94wbimBAwTXnslrKXToDSzbYgTvFv3PjuFPj6R3 X-Received: by 2002:a17:90a:4297:b0:290:6b66:620b with SMTP id p23-20020a17090a429700b002906b66620bmr1131094pjg.12.1705946992161; Mon, 22 Jan 2024 10:09:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705946992; cv=pass; d=google.com; s=arc-20160816; b=RSJyiiIuHUPxymHK5iyjLyGu/w3ShnjPJRjBXYzoIe2fz08ulAq/KIrQTwfp2VdsCn 8c1UlGDPlXblMT3E3atJr1I6BXBZKjVF8OOPMpEGUySIANqz1AriChD4UqH1YcNhWXAn qBqJIgk14qjBehDOon8R/pKrVCCOFAOlJO+PA5WNc7ZWefc+lZszOrb0Iu+52J40UZja FO0b4etxLZfga6V5KzDnqzdWvPqxtxRTmS8UzTavOrxjQFR6A69q3GxdlNBZuhlBiQhu eGtWRRXUWs2Mqplt9t5dIlRbucZI2hJbP2ht4a1VEeW2c7DeU0uiUlA8CU1vmuDtDLRB /6Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=R70AogzmSo/CRKtY8ackbX9p9Zw/xQ4/D9I9iZgsmTo=; fh=c5Fs9M7WVDX65WPVRK59sxT+vx/fjIimWGcXj/zERog=; b=cStV3MKsKLJKcmK/uPQCKtX1P4O+rLcbdK5pLXTCE80Ft80zP0rRnzH1qMFnY44yj4 TH9ogP0qGg+vU8QlAvOn1XFAquhQTb0eTIT4f+bWuTLO3mMreAZ0/qhj262iQm1bfoA4 2Hm2xZfkFyXbZz8wGsP04fZ9Ape4NGSakMpzi1t8cNsN6r2KOXbHCvgQc6zjU7tSXzYl nYF/ZJ+M5plagq4vXHUYQbYbiXEpHUgz2NpD0xsmyKJhDFAXoSBOpr/fIPsjY+qO0F/N Z8joR6xSZPfzDUhLKy12TQHHYD0euzSky/SRGaSELER/mjDFmDmpGVW8C2eCznl07Moz tusw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aZcK0mcJ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-33796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 x5-20020a17090a8a8500b0028e80341b6csi8548867pjn.138.2024.01.22.10.09.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 10:09:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33796-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=@redhat.com header.s=mimecast20190719 header.b=aZcK0mcJ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-33796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33796-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A97ED28C463 for ; Mon, 22 Jan 2024 17:59:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52E755101E; Mon, 22 Jan 2024 17:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aZcK0mcJ" 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 8DBDB60DEC for ; Mon, 22 Jan 2024 17:21:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944121; cv=none; b=RkrPYgtLBB7SDiizk6HApHXKtMuRyZI+GaIloaibIgxtN4AfqLoHZvTRCmXuCYw8DmfKBPbgUQP1s255n6NBsWxZQWrzhBrY3SFV095RpsmkJxuVUFMVF1o+ODmzA9aZ3sOOlxmZBa7rROnX4xvPpSSJLKZN9M+mhtaoVaQt3C8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944121; c=relaxed/simple; bh=98P8Ul6Yd7c/3fLfOg78lrSuMF8zpONCYx14LZgSuKM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kSA2DpQ4wXlr7HVNj/+6Sk1JZzAfIWxKBO4L9f9MDZwFvSLRmSOcbihWlW8xR5FCZIHHVlBkOA/g2zv3sDGhou0vKQ/h0tcoMFRvia54YxcCvjBXp4uQW4CF/GgfhIszLwvefLohhKqXK34UYR13HRg6oKuWWw5ZMkgsVcNOMDo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=aZcK0mcJ; arc=none smtp.client-ip=170.10.129.124 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=1705944117; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R70AogzmSo/CRKtY8ackbX9p9Zw/xQ4/D9I9iZgsmTo=; b=aZcK0mcJ/UxbGQVHOIRR5emOiTaFZYQuGDJnDLrXv83ImNE3ladtAkZWEexhG2T7jBRNvM gmHkQRxBTnmB3D3YhGvo6ioMBwW+T0pLPIcv+/pkehoxv5hpGF68jnSohHDKEQH5bK8clb y5fjQOULNRRUTY3P0WzwjVVNgoadc/s= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-613-rcqANBuTMLK5wGN8ZetTNw-1; Mon, 22 Jan 2024 12:21:50 -0500 X-MC-Unique: rcqANBuTMLK5wGN8ZetTNw-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-68694f9e037so9399446d6.2 for ; Mon, 22 Jan 2024 09:21:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705944107; x=1706548907; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R70AogzmSo/CRKtY8ackbX9p9Zw/xQ4/D9I9iZgsmTo=; b=w0/BZ4c8BxTfogUbav7pbghu1noF7Y39A2fV+8JuQnfwh/tJ3rEDTzPeh+zKgxMPh1 tw86+XFJw/l2tJfHDeHdE0dgFtPaZIDmSy3hpz9ukjuEiHZbz9EWdWjbWSp8lEIOnFFr T2xvd0RUG0KEzRLnLhrjzZV0DzhPKZW+giC5aQIkfTctJu5CXnxZ3G5Gg6JXUyQ6bci8 obf0LeZfetWdHDc3oicXetueqXSt+sP8gzCAqqvXZf4Ggp4JfMllGxke0YzxE0RuWClA owXLCRTuJoU0VBMFyKi1NHQKCCssOP5hhj18gUeBt3mSssVGRnAM798ipdQ05ipCAsp/ SE7g== X-Gm-Message-State: AOJu0YyU4PutZp9GzUBe2IVlxYi1ZO1RlO/2uvDSlYcKBHMcifIj4fr6 Vwdxf3zLaH9vI8SzQcc6qI9orTbPC3ctc7NKSTa6rGoimNGnRtP35S7gm5OxtcL33BeyxqIuv3b oUZ2aAQ2Pxqtt6A6eGdqBrLrByZV0n165/vw+JqZ1oYiMcK6pFQ6TZB3ykpI9nw== X-Received: by 2002:ad4:5d45:0:b0:681:888c:b82c with SMTP id jk5-20020ad45d45000000b00681888cb82cmr6893800qvb.125.1705944106734; Mon, 22 Jan 2024 09:21:46 -0800 (PST) X-Received: by 2002:ad4:5d45:0:b0:681:888c:b82c with SMTP id jk5-20020ad45d45000000b00681888cb82cmr6893775qvb.125.1705944106311; Mon, 22 Jan 2024 09:21:46 -0800 (PST) Received: from [192.168.1.163] ([2600:1700:1ff0:d0e0::37]) by smtp.gmail.com with ESMTPSA id lf3-20020a0562142cc300b00680c25f5f06sm2567738qvb.86.2024.01.22.09.21.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 09:21:42 -0800 (PST) From: Andrew Halaney Date: Mon, 22 Jan 2024 11:21:29 -0600 Subject: [PATCH RFC v4 04/11] scsi: ufs: qcom: Perform read back after writing unipro mode 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-Transfer-Encoding: 7bit Message-Id: <20240122-ufs-reset-ensure-effect-before-delay-v4-4-6c48432151cc@redhat.com> References: <20240122-ufs-reset-ensure-effect-before-delay-v4-0-6c48432151cc@redhat.com> In-Reply-To: <20240122-ufs-reset-ensure-effect-before-delay-v4-0-6c48432151cc@redhat.com> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , Hannes Reinecke , Janek Kotas , Alim Akhtar , Avri Altman , Bart Van Assche , Can Guo Cc: Will Deacon , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Halaney X-Mailer: b4 0.12.3 Currently, the QUNIPRO_SEL bit is written to and then an mb() is used to ensure that completes before continuing. mb() ensure that the write completes, but completion doesn't mean that it isn't stored in a buffer somewhere. The recommendation for ensuring this bit has taken effect on the device is to perform a read back to force it to make it all the way to the device. This is documented in device-io.rst and a talk by Will Deacon on this can be seen over here: https://youtu.be/i6DayghhA8Q?si=MiyxB5cKJXSaoc01&t=1678 But, there's really no reason to even ensure completion before continuing. The only requirement here is that this write is ordered to this endpoint (which readl()/writel() guarantees already). For that reason the mb() can be dropped altogether without anything forcing completion. Fixes: f06fcc7155dc ("scsi: ufs-qcom: add QUniPro hardware support and power optimizations") Signed-off-by: Andrew Halaney --- drivers/ufs/host/ufs-qcom.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index a489c8c6f849..decad95bd444 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -278,9 +278,6 @@ static void ufs_qcom_select_unipro_mode(struct ufs_qcom_host *host) if (host->hw_ver.major >= 0x05) ufshcd_rmwl(host->hba, QUNIPRO_G4_SEL, 0, REG_UFS_CFG0); - - /* make sure above configuration is applied before we return */ - mb(); } /* -- 2.43.0