From patchwork Mon Sep 30 12:44:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831559 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1928390wrw; Mon, 30 Sep 2024 05:46:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXi+e5v/gYMyzXHN3q5IcwUToIoyOqhnidPOKUf7Urw3tgwS60kV09pVEKl9ZXNnOWCz+7qmw==@linaro.org X-Google-Smtp-Source: AGHT+IGmcocN5/8nbU7BzvnoZXN4quql/xdmb32kFqOpo9uWPRzZ+yIuiRDHQwTTF/7w8Q4PKeM4 X-Received: by 2002:a05:6602:b89:b0:82b:42f:41d5 with SMTP id ca18e2360f4ac-8349328d108mr817550039f.16.1727700416291; Mon, 30 Sep 2024 05:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700416; cv=none; d=google.com; s=arc-20240605; b=O6fwE1dnVoR86Bvka0IW8KcNHH9qK7cNsfv4Gy+7HruFJ1IXekQ9RoBgH1M1XhMUa4 z+pGRUx0TqeiNTJ6wtTZoT4o39lKo0IJBdniSweB9NyfgmAwOsWGQd6mtUmMD+iJ5BpW 0WdARwJQDz9PVHezFuVH7F0U8dZtsL7kLg8E8XZ1MVXO8Kp76KofydUti+Gv7emCLA9t PMgjEHCViRqHUZshn3fwSXD2di20f8Rjw8B7AL7rgKIdhjFDTwUEjtWhGxNtALPhUHqA iHG0rMZc0cNr2o4rCQ3IWYO3byo/cbKw3sq+q1UHdL4WBXxa6EBPOs4GoAxRc1kmtazk R1gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=knvPlmaDX5syLFpUIje8nDrZOHvIoGgtObR1QK+uQcA=; fh=570KpmrNCchtF4yVOVmqo4lT7OPg+S+zPwKJ0YCPPso=; b=fApCAUgw3RzeXDC2CckTH/VCwI+Rn18t70ZF4t5/hFdBVU3n2OpBFLeCz4J0lb1Y4b qgACk9Gr+/TUAbdNXIsivXTfovFel8ghIRBEKhZdcizT/yyBeHpw+lttFtz4+zXpBa6o u4r3UK1XM2ChjksmSRrGDswovVG14yvJVP+0GDQyDpMvdtJm23VYvUpm8Z68oW5ZzIjm RelSF2/YUzODHx2FWwj7BEQDvygmE+d5J3xF0c5pgN7Ehsfvde5fPPz6OPCXNOnB4lYO xayLqd/ZIT8DnJ0/c0iWZg4HRl/AOUClf18buzyi1heLUFP0jyoRz8x2umzFl4VaXlrU +7jA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IV3gKhKC; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d8888e6f76si3710776173.134.2024.09.30.05.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:46:56 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IV3gKhKC; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0053A88F4E; Mon, 30 Sep 2024 14:44:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="IV3gKhKC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B3A8188E2D; Mon, 30 Sep 2024 14:44:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BB76388E24 for ; Mon, 30 Sep 2024 14:44:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42cc43454d5so31428665e9.3 for ; Mon, 30 Sep 2024 05:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700272; x=1728305072; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=knvPlmaDX5syLFpUIje8nDrZOHvIoGgtObR1QK+uQcA=; b=IV3gKhKCRJNtsOnvnwj2b8iG01AgUNPgjEPu4HTt9PkDyhxq78Bk9uks8agJjbUHS0 8bI98ojc6ENIY/EiVoxWnwnI+X0WBSo+d//+HPaKzew2BcV5ePzghL8NvGc0N3tClbnO zxb+HxBt5hxdJriPhzzjrMTN8erY5W7FDCUpgdCVb+rAFkwn/0Widms0gNqyIvhMMUhs RiSZwPKmwnWOIgVMcKQpXIfAu/TIj5Y+NiI1dGLAl6Acw/5crd8mCgvMVbYplZTH/ZDn W3vNDifxP1uM8gZdtZ8tsT3/a+SRUZJ/i8I4aYN8xSYZ2b+gi59tFw3DbIwIfNbNlq1X YubQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700272; x=1728305072; 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=knvPlmaDX5syLFpUIje8nDrZOHvIoGgtObR1QK+uQcA=; b=oOFcgoUjraCYyA6JhNuQSTfbtkBJz9mzuA5gImrOtcSlkMUylsdzILw5rqumELjvOe IocfrmbyTnxkikaf4Nj30Kbz8GZjRpZDe10JjvohcLuh4FSXjDHUcT4dB8PlPtr/P7oM bFV+vSKLJMBHk4no3lMDYohae7Ey5nGI1+KfhS3d+F+gFHiqIn6viNv5IVYFXkE79atp +7FKDjwDI4BsLTak9ueDpeG4PsX4W3WIeO7mdg5JluLAuBexUUziSbmVrhQxyXmg1+qZ MVROsSzhlGamhsQMu/DGMTpLL0Tnxy7k+pHKWRCFlQEQrBncGnplb9GTtxA4cc91wxv0 MvAA== X-Forwarded-Encrypted: i=1; AJvYcCWJm0/nUIVjs1hXVc/rZlSKOlSm1CBj4bTJqdqPkN4jWf3If+Co0YscNr+zltVVxMqA8iLo0Ag=@lists.denx.de X-Gm-Message-State: AOJu0YyrpetYUz6perOnJCutNnRTzhs8xgliC480LFHVEx590pObB+gk P6+kHfP86O31sAhhiizdAsjASOV+xTkxvuZjWwKPQTtOTd7YYSalJA4z1GwutfI= X-Received: by 2002:a05:600c:17d1:b0:426:6158:962d with SMTP id 5b1f17b1804b1-42f5c33d132mr61749115e9.23.1727700272129; Mon, 30 Sep 2024 05:44:32 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:31 -0700 (PDT) From: Neil Armstrong Date: Mon, 30 Sep 2024 14:44:23 +0200 Subject: [PATCH v3 01/13] ufs: allocate descriptors with size aligned with DMA_MINALIGN MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-1-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1468; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=qjQYv0/dis5SePWQOliF/chMW/9j7B57ftSkErHC/tw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0op/wassLlxaqKsPS7KuDnWWTe/m33d8+GBsW+ yGJCikWJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdKAAKCRB33NvayMhJ0Q/LEA CwAO1xkW47eviXrfsW5HddJz2taHdiResVR1msA0m0WR9S87I5imFdH11zJnwy4VJ0vrIYULsa2/HV posiwnkY9Fcpv58np3/x9KcBM4e5QZyF8HaHzZ0fqiTdt0q4qu/jkGYkSPG7MjNf9NzqNhk1SK1Bi5 BfPRJouVF8WpL35An+jaTieoYxSfPxwlKT2fKybyH7YecHgM74X6PtJ8z++n/zgWbuipjCWkg6T9kx RUae74gwdL7pV/sIO7S7EE3K4rFqf7GHsIh4zPwP19Jjrr8Y/F2VBqD7iH5cZiDSaPU4szaqJUJ/U6 sFovRtV/vJYVdarF25XpdYQ1arYH+yJ/n7hS0lh8I6H5WKz72JgSwaZXRZ/1B5Dfw5A7NR11haihtb 0Lq1qsGm/DXEl4X4Cl6Vu4dFNJwwrUDeYxMt0g5JJ69zS0wDlo2+EAn9Bt+Ebri40J8bFqS7/z2+ry Mvj07RUl0n72cj5aA5Oz10UnK99UI//zdtoLG98cwjlANlttljZToDwiQGVS8ZPS8xPIeyCjJqzDGg q1sR4SafbX3hqz+dZ858TuaQIWie3Dm8O6i4YwrTJgCopUxCs65IS8PWzlzGN7QjQ9OQaIDXLQ92v4 Gu2y9mAktGGOff4T0w7QfzXMHPqk46FbOS1lotHAC1WKX2PDCMw9ZY2RcCoQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Align the allocation size with DMA_MINALIGN to make sure we do not flush/invalidate data from following allocations. Reviewed-by: Neha Malcom Francis Tested-by: Venkatesh Yadav Abbarapu Signed-off-by: Neil Armstrong --- drivers/ufs/ufs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index be64bf971f1..e005cc90608 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -633,7 +633,9 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba) /* Allocate one Transfer Request Descriptor * Should be aligned to 1k boundary. */ - hba->utrdl = memalign(1024, sizeof(struct utp_transfer_req_desc)); + hba->utrdl = memalign(1024, + ALIGN(sizeof(struct utp_transfer_req_desc), + ARCH_DMA_MINALIGN)); if (!hba->utrdl) { dev_err(hba->dev, "Transfer Descriptor memory allocation failed\n"); return -ENOMEM; @@ -642,7 +644,9 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba) /* Allocate one Command Descriptor * Should be aligned to 1k boundary. */ - hba->ucdl = memalign(1024, sizeof(struct utp_transfer_cmd_desc)); + hba->ucdl = memalign(1024, + ALIGN(sizeof(struct utp_transfer_cmd_desc), + ARCH_DMA_MINALIGN)); if (!hba->ucdl) { dev_err(hba->dev, "Command descriptor memory allocation failed\n"); return -ENOMEM; From patchwork Mon Sep 30 12:44:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831547 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1927487wrw; Mon, 30 Sep 2024 05:44:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUopvdODwzlmv/BtvI6cmpC0+2bd1pKBpf+Yoy0oVuCN2tWkEKJDoBfLCOXDBCtQDGdvqt3HA==@linaro.org X-Google-Smtp-Source: AGHT+IE2CGAUQuHrCzcH9MNye0bRLM4FMFfewAPjtxAIDTaU9gQn8MYmtqcCpi9MlYXqN0gebZPd X-Received: by 2002:a05:6602:2cc5:b0:82c:ee41:72e9 with SMTP id ca18e2360f4ac-8349318d353mr936309139f.2.1727700287831; Mon, 30 Sep 2024 05:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700287; cv=none; d=google.com; s=arc-20240605; b=itkHFf37LcGq+UXtEJVS1jF30E8DYX/bgAhdeViXvAeffidnWIuJxEuEsb9VdZuUUo UunRjF/hRLQVX0FfHkPg3CgyU3P3VMotZGDF0mWs4oPTkZNhy5nWgjGcmavJyNU7Hz/e rOT8WdnLVUfc6coDzbMoo5Hg9ozJgdd9SCpzbMJd8zuIDLKrw6UM41vVCNhdprM+DuqH Cm+KC6YD6N1Zw57ZD0Gn07nKwA+dyLbgzhrR1kVPfUlYqaNUPdLZ18bYdLF8BWHec8Lg /jkhXepyOigEIqugHWBrXjTIN9kMsmYO7J/S6fG26RGOE629xIzkKUABceoBEFGBzLTN 6TmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=VIDqema31vmCtP5+5Elm3la8qvd99hg1gL/4Bcd9PXU=; fh=ZxTuWDrzY646qi07iyFY/HDQX0taQPnPAx8KHy2dApA=; b=WQ21jgXWAggoG3cV2Ff5xp5XgudBLbQuGtmcuhEBseYi+fYI81bUMG7riYvk29JdUP 6ijykD9NHk+TCA1dTJk31+aR03z7VYATZ6FI+rBndQGpgfZpc8gyCMJUNMvreaEnlKRn QYScOsgFBTRTG0s72YNXsHNH4JG3EM2toLO1yubgbkbynlCm9f+JALoHsOBbyUv40dyK Y8lPFL7Z920Da30mfU8ndT1zzsLiomglvbg40fQddrv74RfkdiBL6ppjYu1IeIzLgm9O 9RyXvJ2SC4i03Reo69YiTnu9+Zl/4LxV4qCqCpV8Fx4Vd0T6Woj4EA24Ecb1AGwRxACo N9xA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RoMmGlAW; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d888863470si3521671173.52.2024.09.30.05.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:47 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RoMmGlAW; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EB70088E6B; Mon, 30 Sep 2024 14:44:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="RoMmGlAW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A729388E68; Mon, 30 Sep 2024 14:44:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AD1A788E39 for ; Mon, 30 Sep 2024 14:44:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-42cb57f8b41so53739385e9.0 for ; Mon, 30 Sep 2024 05:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700273; x=1728305073; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VIDqema31vmCtP5+5Elm3la8qvd99hg1gL/4Bcd9PXU=; b=RoMmGlAWUA6lwHEXWc5cX/TORJ+8Lc7nmiOtWx2Wz7s5sJQHIFFVcx9ST0+7HI9odK Q7GEXepQcXZy/Bf0gmrMQUydeqo35NDHnwZtrpgytqxEH4PUymwD1HeW6QY8PtPV0Uqq wO/BEE6AdqL0bDQu5WI9miTZxxjr3D3kghp+Ot02jXH25/i31Vtkw+JwbJXV0U+laZyj pwuiTPkRPHWi0LZrZP4PTHDMTR+dbsQPG6q2gDcXQnaPh1VkpLide4rM1F55V5lFXF/8 4+DmaNsURmNMGmlG6hWQH6BwWPOOWnj8EulMb+rqMmrtCul+mLIAX9arAQrPALANlXxe MoNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700273; x=1728305073; 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=VIDqema31vmCtP5+5Elm3la8qvd99hg1gL/4Bcd9PXU=; b=pGmhjokzFIUe2v/I0vEdRHP0JRI0r61yOaDYPIj4p6KgOwevwXwlfmNYycVY/79Gh4 ORrmQEIjOKQZCggNxLnyZjxZDcd4Ja2NrEcmHXM0YTdeY971eR1ApmFg8V7jJRyH0gd6 u7Zcsb7M7nOyE2+oAnVXQSX3e/ks5zf3qshS1eeTJILFt0QAj2fBCJLR1ix0fV1kXGm0 v9b1KKr1i37cy/T9iWYDBt3l8sQb3w8UkZEsV1pGaJl5pHsgpTfZwJmqx/q0WUWu34R9 A5kyNwzY7Jy2DQmestZhdYFSX3X8z7wo3arm6OUan42B9F2J8tAF3tYA0SICZYSjH8h+ Eyxw== X-Forwarded-Encrypted: i=1; AJvYcCXiLPTkIlt0svRAPBnhf+OM3rHBHYOEvMlWHsEDJlRvhFAWz5TUZyltltuV/49ddBziF8tEdi0=@lists.denx.de X-Gm-Message-State: AOJu0YzoK5Wp8xeJ545MadWz6ZJ7YJJn2rvLrZJycBKvOnwwG1MbHszH 8X3bHcJ/AnjBdRxYsyTCYR/TlSl7j8oYCnaRr/GGCqssXD3U1UfCqVEojTTNvbw= X-Received: by 2002:a05:600c:1d1e:b0:42b:ac3d:3abc with SMTP id 5b1f17b1804b1-42f584976b0mr121475245e9.24.1727700273047; Mon, 30 Sep 2024 05:44:33 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:32 -0700 (PDT) From: Neil Armstrong Date: Mon, 30 Sep 2024 14:44:24 +0200 Subject: [PATCH v3 02/13] ufs: fix dcache flush and invalidate range calculation MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-2-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1993; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=1UTsvGfPS+P9xfQFHCxXJNZU4eiTF4UOb0MRc89nBcg=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0ofaIm8Xuxt0VG2M0ExY1lkNbsRTrfsjpORxaF Bk5iXpaJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdKAAKCRB33NvayMhJ0f2cD/ 9oVv7RgRkGhvn8c/v1GcgOn/fZd+qi5c8r7bpF2EPdy5CGpD/zO4VdSHZcwEXRixN4AyDpKtSdQvbY xBEcu+rTw3FYFFG1ANvXGLqDnz+MdVNuVtPXZ2+u0vqSVn5h1FekCQTUNfj03w2MW99XJ1bn/cjM8a HX2gkNYDL09au4zlL1ejyvOq+tTNqM2VkxCUuko0zPBQ5v/UVGWEzLgrHskYT+wT6fsWhGMfU4WXDo dBpsafvwMJ/aeRWqmFUZOr7wg48Zhe55lveRpMJ4/tgtEbwyb/3KNu9ZoUM7uQgBb5M4zf8K/s7Sy7 1eNWsRvjEnxv9Q8pazmX2RBQjXaqQeibVGww3f5KLY0giRzxSQIpCDLluzl98lMJsuoPXFNP+K9P+e 0ahaeq3Gtbh5RMKGVLnNYE0PMyerfRjGZUeMKvz7IKlLIqM7vnvqaCe97yvkusyQeMM/AOODvGi7+Q BkAykO1J3B6U6yDTufIN7qwa8xx/5tbLZmFzzOTTH41HP9VOfR73r9Lor2kgOujoYUzDnRC1jROHSz yfJLbxu5BJaI9AYBwzEj/N8L2Wj64uiytkX5j9fpHq3KQ8XwPRY5eIAaOPNo1mWU0LgOeyDhIM4/IV 75wUGBEIXz624axCAVVEuoptRd9QyI5hKeZxbE1ghrpcgKrFmq3ioAqI1zkQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The current calculation will omit doing a flush/invalidate on the last cacheline if the base address is not aligned with DMA_MINALIGN. This causes commands failures and write corruptions on Qualcomm platforms. Reviewed-by: Neha Malcom Francis Tested-by: Venkatesh Yadav Abbarapu Signed-off-by: Neil Armstrong --- drivers/ufs/ufs.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index e005cc90608..3d9a7d7ee12 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -703,11 +703,11 @@ static inline u8 ufshcd_get_upmcrs(struct ufs_hba *hba) */ static void ufshcd_cache_flush_and_invalidate(void *addr, unsigned long size) { - uintptr_t aaddr = (uintptr_t)addr & ~(ARCH_DMA_MINALIGN - 1); - unsigned long asize = ALIGN(size, ARCH_DMA_MINALIGN); + uintptr_t start_addr = (uintptr_t)addr & ~(ARCH_DMA_MINALIGN - 1); + uintptr_t end_addr = ALIGN((uintptr_t)addr + size, ARCH_DMA_MINALIGN); - flush_dcache_range(aaddr, aaddr + asize); - invalidate_dcache_range(aaddr, aaddr + asize); + flush_dcache_range(start_addr, end_addr); + invalidate_dcache_range(start_addr, end_addr); } /** @@ -1466,13 +1466,13 @@ static void prepare_prdt_table(struct ufs_hba *hba, struct scsi_cmd *pccb) } if (pccb->dma_dir == DMA_TO_DEVICE) { /* Write to device */ - flush_dcache_range(aaddr, aaddr + - ALIGN(datalen, ARCH_DMA_MINALIGN)); + flush_dcache_range(aaddr, + ALIGN((uintptr_t)pccb->pdata + datalen, ARCH_DMA_MINALIGN)); } /* In any case, invalidate cache to avoid stale data in it. */ - invalidate_dcache_range(aaddr, aaddr + - ALIGN(datalen, ARCH_DMA_MINALIGN)); + invalidate_dcache_range(aaddr, + ALIGN((uintptr_t)pccb->pdata + datalen, ARCH_DMA_MINALIGN)); table_length = DIV_ROUND_UP(pccb->datalen, MAX_PRDT_ENTRY); buf = pccb->pdata; From patchwork Mon Sep 30 12:44:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831550 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1927728wrw; Mon, 30 Sep 2024 05:45:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVH9kDf4tQdUiHXElki3b7tgZY8IShdE2OpIRSSkZjgeFUqq0kVFQl8nJyqqx6i9CE1LJKlNg==@linaro.org X-Google-Smtp-Source: AGHT+IFL/zfcSUXjTfObcwU2cuJcd45GZCR8kZujFbBrIvBxhhdgP0MOObfIwByNRsHu0n/SgUWw X-Received: by 2002:a05:6e02:1fc4:b0:39f:325f:78e6 with SMTP id e9e14a558f8ab-3a34454670fmr85046905ab.0.1727700320837; Mon, 30 Sep 2024 05:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700320; cv=none; d=google.com; s=arc-20240605; b=Kyb3brka6ugqDYZW4wDTd5v4ykFabggg8EUFVQbIh8UyZWVcUtRUiLrk7i01MQbha7 exzXi/kLaFteqtQgBkW+uJ9ygFZBr6p1I4mxNEBk/ahDGseTk0bEHAuWra4olcCuXkUw AsJ8P30+V3EM8KKf6BKd/rU8UvYc008yE1vPcLzjLfBN5txXGLrUXZ2/f1L5KkxbdcGn VvRNkv37cVhx1uCcH7FMa8z+GhIXqXOSizM8AWWw3x742kl8Om6mZA38+VuRQ5U7F72Q kU95ha//eIZgoD9cOTf5WHwrUdFFd720TKm3vSiyA2fDzDNLdSB5wZy4h3Uk2em6xm6K vayw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Q3f/dQcwAhnGcS9GQKvNZXgCdNcW1/Vm7vzvFXIm/Mo=; fh=z4m1YFcpZdwPUAJxkRUxJ16YGn0nIihiNZvCZ5XLM80=; b=LjoJGZoGRcCEzQYrTFoUzv7XCbD4KrnwhjLAWpra4AgzsK6hC6l2dHlhdXdHH4Y6yj NJoz/PI0+Vmyxc5c2f4CydvLPy3bw4DMy6vOwIPQh5WWDXq/pG4sQRAIFiksZXbKoi9a o1lK/sTK42wE0byZbRjtyR+SK3Na3RIg0XJC4sr2fibgLMiTldbGEc2rNxiBaVF9T08r CDkq+J6jpziJIbO8fzf3OkM6BtAGhX0FAiNMBWXyx9zmiiGlwheNXjDY/T78OUDLiHaG sbiTON+9QbWd+Kqt5CPnYXMfJZA70A0YzZld43EYsFtd/w6ocAK7P/LclQEJiSqfO7+0 ZM3A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pjMIK9fV; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id e9e14a558f8ab-3a344df4b4csi35645845ab.158.2024.09.30.05.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:45:20 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pjMIK9fV; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2299E88EFB; Mon, 30 Sep 2024 14:44:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="pjMIK9fV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4FE3C88D9B; Mon, 30 Sep 2024 14:44:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1EDC988E1A for ; Mon, 30 Sep 2024 14:44:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42cb0f28bfbso33328605e9.1 for ; Mon, 30 Sep 2024 05:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700274; x=1728305074; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Q3f/dQcwAhnGcS9GQKvNZXgCdNcW1/Vm7vzvFXIm/Mo=; b=pjMIK9fVy/B8dCsbB8z/OpA6LIXrGgP9WXzXXrDo4Im3W+3ep/mIoy4WS4vH5oyaL5 XxK/b/JHq70QsuPIvZlNypniMrwBaEacNW52JN4DhmkzfuMI+soSvZcLoFjYAhLqop/C WZ8E0AUMs+XO5zP9d8pnEmhJoVJ/+au6tkyR313JXYY0p4xDMZ/Tsq1X31JV0wm1WEpU ZkomjqVMMnWCcvqj+487+GPLPmhu7OGirg6w4YugGJKnAVpjqfBMRWfgtBRSpTB7O9uR /WmWphevWuZLWoTkPpg7hpjWLdCw8pGSVTJHt8+TdNGUMn4jy483w2cNOqAcxzcH3mkx LkpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700274; x=1728305074; 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=Q3f/dQcwAhnGcS9GQKvNZXgCdNcW1/Vm7vzvFXIm/Mo=; b=qv1V5SREiRKIEgvdb1ZlEXXvdOWlBi8XI1mZGvaDKaRO+d90QH3XyGBH2+PHRcfJnf pg3mxe+c8myD2uM9ChxnTvtIM5Esx/A1VCJqqaNO5GNKkb6H+Cckem4SiMhR/Qd5etJc 4f7xNwYAHH2zjL9Kodab/zI2PVLVgQeI5MS3ZJ9tnBlAq4Gt+fhi/VlC4cL+DQuh64sg UzAwoYUexIsyA3hTHJYE1fZl9opCrnrdagkPbCiZ2YyvoQ9KB7dSJIgQlO0oTeOB8xZt 0KSd94FQ/eK+Ww4aGg9eviJDkYL9XN+AzfzhZzFYq/BV37VHDRMNyinzGZXNA8CTnTH6 2XOQ== X-Forwarded-Encrypted: i=1; AJvYcCV/jxIS+6RDoCO9T/Ihy/TR2CyLPW0K+IxUHL1DM8efHUvUx17Illl+SyKtiprGjw1kW2/hdHI=@lists.denx.de X-Gm-Message-State: AOJu0YxULi3fk8fMWCKegNvpduIXbrVVir7WOxRx7WGFjqjU6rhyMizj pqs5pVCtp1mOURwX5EqmWsOnvUTxnMjH2lc7zHxJK1nWHyP7OsjOSodfYrwqe6M= X-Received: by 2002:a05:600c:3b87:b0:42c:c401:6d67 with SMTP id 5b1f17b1804b1-42f58409e21mr81381425e9.6.1727700274517; Mon, 30 Sep 2024 05:44:34 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:33 -0700 (PDT) From: Neil Armstrong Date: Mon, 30 Sep 2024 14:44:25 +0200 Subject: [PATCH v3 03/13] ufs: split flush and invalidate to only invalidate when required MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-3-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=5705; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=dZauaajcNAzB67hUPDnxtn7pEfA386aQNWWZ4IUJBzg=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0pUT83UK3adW4eI+tCOnkMHx8MJXoW6pWXjOZC paTV/l6JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdKQAKCRB33NvayMhJ0dy2EA C59jBy8emSftY6w4umBDM348IxChQ9qIbJOGnIwXfoOrQjSsfPhl145tMi4B5VwN+QK37TPSBSvg8X WHrY1cuKLF/pU1MSyHHhnBFC+BjuXw/RgtnVLlMrjBh1SfNhNP1q5UcZwZRfWjhcSjDXYqTshhkxeD WRUG3ZJIZgdkduWcZ2hWLkoWmADSnEgKGkTH6qRliAd2bP/X7Scgp/lJPNbLT9tVkMmRAjzUa1uUou NK20KbW8QYlKeDPmDNebWK//BtHTmftMth0TuH/O8GGwDAPucXjpAqFtm/sQmGl7KlQZ9WLr+kV2ey +TVqE07hg/gNf6FxyQOTXou5PF9e39upLmDMxFQKSnfG7s4qZj8MXYzZxR69U5ys8lQNd//7FLCzCZ RxlQ4JX8nRsSaHTXJWl4ZFOF7leHsGtZknEgDajKkJX1UXDub+yUFjaWF4YKg9PofjGIJlYkbKb7wP HU4tyrt1wjnibepbm5aaZ+tqFIefuxl3Zblx1ap48xLK/CEHInSYtKMdiLyU2KPDZexULy7ciwy9Jc rwRg8hH2isccbGR7L91oDT43IUCaEc7Og6Dw5y3/yiqFDqWeuYhFLHpjirJQiZ2ufK5Kc7jfUAZ27P Sf5ZvBH/sPGOFXcAkbrJietQCsge5ArHF3FpgkKBzpqapMj9jOLZu6ugUDcg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean There is no need to flush and invalidate all data updated by the driver, mainly because on ARM platforms flush also invalidates the cachelines. Split the function in two and add the appropriate cacheline invalidates after the UFS DMA operation finishes to make sure we read from memory. Flushing then invalidating cacheline unaligned data causes data corruption issues on Qualcomm platforms, and is largely unnecessary anyway, so let's cleanup the cache operations. Reviewed-by: Neha Malcom Francis Tested-by: Venkatesh Yadav Abbarapu Signed-off-by: Neil Armstrong --- drivers/ufs/ufs.c | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index 3d9a7d7ee12..5845fd694d3 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -696,17 +696,28 @@ static inline u8 ufshcd_get_upmcrs(struct ufs_hba *hba) } /** - * ufshcd_cache_flush_and_invalidate - Flush and invalidate cache + * ufshcd_cache_flush - Flush cache * - * Flush and invalidate cache in aligned address..address+size range. - * The invalidation is in place to avoid stale data in cache. + * Flush cache in aligned address..address+size range. */ -static void ufshcd_cache_flush_and_invalidate(void *addr, unsigned long size) +static void ufshcd_cache_flush(void *addr, unsigned long size) { uintptr_t start_addr = (uintptr_t)addr & ~(ARCH_DMA_MINALIGN - 1); uintptr_t end_addr = ALIGN((uintptr_t)addr + size, ARCH_DMA_MINALIGN); flush_dcache_range(start_addr, end_addr); +} + +/** + * ufshcd_cache_invalidate - Invalidate cache + * + * Invalidate cache in aligned address..address+size range. + */ +static void ufshcd_cache_invalidate(void *addr, unsigned long size) +{ + uintptr_t start_addr = (uintptr_t)addr & ~(ARCH_DMA_MINALIGN - 1); + uintptr_t end_addr = ALIGN((uintptr_t)addr + size, ARCH_DMA_MINALIGN); + invalidate_dcache_range(start_addr, end_addr); } @@ -754,7 +765,7 @@ static void ufshcd_prepare_req_desc_hdr(struct ufs_hba *hba, req_desc->prd_table_length = 0; - ufshcd_cache_flush_and_invalidate(req_desc, sizeof(*req_desc)); + ufshcd_cache_flush(req_desc, sizeof(*req_desc)); } static void ufshcd_prepare_utp_query_req_upiu(struct ufs_hba *hba, @@ -785,13 +796,13 @@ static void ufshcd_prepare_utp_query_req_upiu(struct ufs_hba *hba, /* Copy the Descriptor */ if (query->request.upiu_req.opcode == UPIU_QUERY_OPCODE_WRITE_DESC) { memcpy(ucd_req_ptr + 1, query->descriptor, len); - ufshcd_cache_flush_and_invalidate(ucd_req_ptr, 2 * sizeof(*ucd_req_ptr)); + ufshcd_cache_flush(ucd_req_ptr, 2 * sizeof(*ucd_req_ptr)); } else { - ufshcd_cache_flush_and_invalidate(ucd_req_ptr, sizeof(*ucd_req_ptr)); + ufshcd_cache_flush(ucd_req_ptr, sizeof(*ucd_req_ptr)); } memset(hba->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp)); - ufshcd_cache_flush_and_invalidate(hba->ucd_rsp_ptr, sizeof(*hba->ucd_rsp_ptr)); + ufshcd_cache_flush(hba->ucd_rsp_ptr, sizeof(*hba->ucd_rsp_ptr)); } static inline void ufshcd_prepare_utp_nop_upiu(struct ufs_hba *hba) @@ -809,8 +820,8 @@ static inline void ufshcd_prepare_utp_nop_upiu(struct ufs_hba *hba) memset(hba->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp)); - ufshcd_cache_flush_and_invalidate(ucd_req_ptr, sizeof(*ucd_req_ptr)); - ufshcd_cache_flush_and_invalidate(hba->ucd_rsp_ptr, sizeof(*hba->ucd_rsp_ptr)); + ufshcd_cache_flush(ucd_req_ptr, sizeof(*ucd_req_ptr)); + ufshcd_cache_flush(hba->ucd_rsp_ptr, sizeof(*hba->ucd_rsp_ptr)); } /** @@ -877,6 +888,8 @@ static int ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag) */ static inline int ufshcd_get_req_rsp(struct utp_upiu_rsp *ucd_rsp_ptr) { + ufshcd_cache_invalidate(ucd_rsp_ptr, sizeof(*ucd_rsp_ptr)); + return be32_to_cpu(ucd_rsp_ptr->header.dword_0) >> 24; } @@ -888,6 +901,8 @@ static inline int ufshcd_get_tr_ocs(struct ufs_hba *hba) { struct utp_transfer_req_desc *req_desc = hba->utrdl; + ufshcd_cache_invalidate(req_desc, sizeof(*req_desc)); + return le32_to_cpu(req_desc->header.dword_2) & MASK_OCS; } @@ -1437,8 +1452,8 @@ void ufshcd_prepare_utp_scsi_cmd_upiu(struct ufs_hba *hba, memcpy(ucd_req_ptr->sc.cdb, pccb->cmd, cdb_len); memset(hba->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp)); - ufshcd_cache_flush_and_invalidate(ucd_req_ptr, sizeof(*ucd_req_ptr)); - ufshcd_cache_flush_and_invalidate(hba->ucd_rsp_ptr, sizeof(*hba->ucd_rsp_ptr)); + ufshcd_cache_flush(ucd_req_ptr, sizeof(*ucd_req_ptr)); + ufshcd_cache_flush(hba->ucd_rsp_ptr, sizeof(*hba->ucd_rsp_ptr)); } static inline void prepare_prdt_desc(struct ufshcd_sg_entry *entry, @@ -1461,7 +1476,7 @@ static void prepare_prdt_table(struct ufs_hba *hba, struct scsi_cmd *pccb) if (!datalen) { req_desc->prd_table_length = 0; - ufshcd_cache_flush_and_invalidate(req_desc, sizeof(*req_desc)); + ufshcd_cache_flush(req_desc, sizeof(*req_desc)); return; } @@ -1487,8 +1502,8 @@ static void prepare_prdt_table(struct ufs_hba *hba, struct scsi_cmd *pccb) prepare_prdt_desc(&prd_table[table_length - i - 1], buf, datalen - 1); req_desc->prd_table_length = table_length; - ufshcd_cache_flush_and_invalidate(prd_table, sizeof(*prd_table) * table_length); - ufshcd_cache_flush_and_invalidate(req_desc, sizeof(*req_desc)); + ufshcd_cache_flush(prd_table, sizeof(*prd_table) * table_length); + ufshcd_cache_flush(req_desc, sizeof(*req_desc)); } static int ufs_scsi_exec(struct udevice *scsi_dev, struct scsi_cmd *pccb) From patchwork Mon Sep 30 12:44:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831548 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1927570wrw; Mon, 30 Sep 2024 05:44:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU8dJX/0luZiqPeCnnCmSMhM5fiF9xZjmSLS5hA/ZcNHq33se8sWTeirmOVC46hUXYg6fSTZQ==@linaro.org X-Google-Smtp-Source: AGHT+IEPm1o+dCk3UgSAByQ16bjLemrjFY/XVCHhzm/L6wPrDTst35b7LHID46uk/+Qg9BSs8HoM X-Received: by 2002:a05:6602:1694:b0:82c:ecf5:a75e with SMTP id ca18e2360f4ac-834931ae98bmr1019122839f.3.1727700299085; Mon, 30 Sep 2024 05:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700299; cv=none; d=google.com; s=arc-20240605; b=A54DZgreEpm0FlucTRvY+UAab1/ygjs/QEZZxUBlgpO0mCeh4JDudJQVN1jgSEQNEq YuwhtISFlQ2Hj8RHoh9/9CCbD/jM1XrLLmx0alpYnsj7WULkdO3NfsX3cajk66yurH4c F2DqU6cW/1EbDx+wMqhLmIsrp+QD3VU7SiFc4D9gD1DkESfZR5TinjD8qAp8hxrsaCy0 HeOTGGr2L0A4jJTHE6q6SPln3EwbesGS71NgEwXoBWrv2HPvLGboJzluWxFhyXtWOIAw YFOiG1pKB7UVMjarrfMu3OZr/bDPpLcKHtg/489nKdn7QhBxbbH5rEfuh34eqp+90Tvw TgcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=YpZtPiiI1e1/Vf29ZneRtJ6KxyBl81TQ0/WopswlWtA=; fh=OqRE1GEdq97jrEg56PQ6k0uJrhLfRy6StgmPZm+n+os=; b=ZcS5+xLNC2DbC1uKfYa6Y0vjmLgaJPw7rfgb4oyaRiDRpQ105kqzobc5fiyFcegFKr m5F/Jv5WRMgbQlpXYpclpdGjvkuMekFF94zdMoAVD9v7AsEBB9D0wA93Ij5yZp9MbEtv zPTafxPnRnvomTKRff8RoOo2jOqb8EV8EHKadvBcIf5BcuJDFkWLtYsZdJ1upEe9pN3r UeYlfgX7OCrjbfJVCw2L4onBe/RpDYbjelBElRs1exk09uQef9ZfkB3SBcvo37pnrrZ8 fi7VzDjck4qAyb76RphhPSJ2XkxsuFB4za1T6vLE64sBFCPfjjZMzlGszKL0DxoX/yAQ NuoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TJuazYdy; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d8888edb24si3468856173.155.2024.09.30.05.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:59 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TJuazYdy; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 542A888E1A; Mon, 30 Sep 2024 14:44:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="TJuazYdy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2BF6D88E89; Mon, 30 Sep 2024 14:44:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3069D88E61 for ; Mon, 30 Sep 2024 14:44:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42cae4eb026so41806325e9.0 for ; Mon, 30 Sep 2024 05:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700275; x=1728305075; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YpZtPiiI1e1/Vf29ZneRtJ6KxyBl81TQ0/WopswlWtA=; b=TJuazYdybs7be93MKiALVgIvXe4nXrPjfCKGnl37e1w42VtXA+VKLMsO1SD/hrnVzi jkONDX6DlIb3PL8Trp80MYKVyw37emaHXgZ3caIMVTaw8yKfq7xvnCvmwi7aviFFxcWI mUoExhpCH+YgIjBLcPAeZTKrKohtf7fQ38h8hiKu9cv3YxH5ARky8hwuEzn44wDr2yGe 4vN0pkHemlRx46QQ+KnbcF5VFrT4RCJfKxDcE0UZMD4bI40ryZZkMbIldJMdmCzr6bpc W56yN7vuPhYK7yoWA2Xu/VOVNU8oI49M2VF49+g/jS/Pul6p0h26ghX2+0CvHiuqnvrI 8y+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700275; x=1728305075; 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=YpZtPiiI1e1/Vf29ZneRtJ6KxyBl81TQ0/WopswlWtA=; b=M4a0ke50llMJUiQr1X+gOML+RMRN9MqSE3a1KWncl0EM1l3r2vjRV58iKClO0ctZsW sMk/KuCjeowtzOBFecDyjUywlr2gQ/l1PliXG/OMNGoPXKf0PD5icCBpazz7geubTD0R U3ZuONO7gqMvbgQN6zrQf+2uOn5j8oOKD1gMAcw0pqh+HNPs/rqIj2cfyGka0PL4AK52 ak0iC5j3mQL/VNVrFtfXvSfCkPiicZL6gwyk8zSwfFJszoM16QpfUF7R4VjTJ7bqyplH /S72H4Xtxv/7+WFUPGbDT3/sCbsxMjuyYaGRPqL+z3ZuilPPFmiLLwwaHcHwjv6GKC3z n1UQ== X-Forwarded-Encrypted: i=1; AJvYcCVtNWy9Na05xvQ5583hiYUVNlsg/Bep9CU/3K8MOqaM/3jvABcJSmleqg7klfVOskTqlAwPpf0=@lists.denx.de X-Gm-Message-State: AOJu0YxK9mqJsW34QrQs/SsFKb3TcuTemzbyVE9HFYlM2flBOagSUE/n HM9bIQMCRP3LX2q1JHKOiERFNjfh0ILBnX/gOq2TVXlZgnjGyV1hvQd4uL9F+uM= X-Received: by 2002:a05:600c:5125:b0:42c:cdcf:2fef with SMTP id 5b1f17b1804b1-42f584481aamr94420605e9.15.1727700275624; Mon, 30 Sep 2024 05:44:35 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:35 -0700 (PDT) From: Neil Armstrong Date: Mon, 30 Sep 2024 14:44:26 +0200 Subject: [PATCH v3 04/13] ufs: use dcache helpers for scsi_cmd data and only invalidate if necessary MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-4-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2003; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=nXKi+mna7x+TCnF1EoWcP2ONpBRzk5a7DC+33DXHFa8=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0pffPJm0NKiYNwKcjVELx3FtQ2lZ7sIOZa1JZH i3NXndGJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdKQAKCRB33NvayMhJ0aeCD/ 0V81l2HMQBjK6Ley5nwH10tXbrLUQdilExEb/f0VQBPX7yMqC2yb1H+xKeWdU1+JgkgwfwslWxCiq0 jQwcTKX8/LLMH0WizDEm4hXGsU/O6CfDhi0RsVYZFOaQERVs9wYEgA5Mv+vfVBNXyPKuNFAkVJYhtl N0l8q/0JJXJKXPJaHt2j9SOGpz4xBf8uxBhaRf/1COQ+cPmE3JV8tAj+b47gc4kqLgg+FSFxlU0ti8 fo9Jv80cwSiMWWovViKm3CP9WT9GmtZAj7RBlemNndTyedgVj/Yr2ErSvR8zNSeCbC9eGH7W5ipBT3 OZmZHHf4xP1nrCh8+d/zG3rNsAXuHAMBEBGDmlD94EtdFLomlN79+n56ZMcQ47f46T1YuHb3k+3O3v tRXzg/Sivly4TliVKo5HGtcArF/nSNRs3TBYZ02Psm2JL3ryb4VF4S8mv3Pu8Fj2bT2DbxAdC1M0T/ XJJr/M94EzU5+6ndI50Aet/dD2+Ug/EG4c0TyaimtCDrTvHEsxqM4BZo+0ObDI3uK5c4J+z+/6N0vp cI35ycb6gdTHIq0CqHQ6pcu4jQu7jij4XhzP8qhPMwEnOSLrP9C5s7aPz+UdVBtf67RNMlkReVAdau XWFcfhVc1Q1xT9Ra0E681vkPNZ1du0aMqqMJ0mE1019vEVc8znmEMNG2C99A== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Now we have proper flush and invalidate helpers, we can use them directly to operate on the scsi_cmd data. Likewise, we do not need to flush then invalidate, just flush _or_ invalidate depending on the data direction. Reviewed-by: Neha Malcom Francis Tested-by: Venkatesh Yadav Abbarapu Signed-off-by: Neil Armstrong --- drivers/ufs/ufs.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index 5845fd694d3..d99dcdef7d0 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -1468,7 +1468,6 @@ static void prepare_prdt_table(struct ufs_hba *hba, struct scsi_cmd *pccb) { struct utp_transfer_req_desc *req_desc = hba->utrdl; struct ufshcd_sg_entry *prd_table = hba->ucd_prdt_ptr; - uintptr_t aaddr = (uintptr_t)(pccb->pdata) & ~(ARCH_DMA_MINALIGN - 1); ulong datalen = pccb->datalen; int table_length; u8 *buf; @@ -1480,15 +1479,6 @@ static void prepare_prdt_table(struct ufs_hba *hba, struct scsi_cmd *pccb) return; } - if (pccb->dma_dir == DMA_TO_DEVICE) { /* Write to device */ - flush_dcache_range(aaddr, - ALIGN((uintptr_t)pccb->pdata + datalen, ARCH_DMA_MINALIGN)); - } - - /* In any case, invalidate cache to avoid stale data in it. */ - invalidate_dcache_range(aaddr, - ALIGN((uintptr_t)pccb->pdata + datalen, ARCH_DMA_MINALIGN)); - table_length = DIV_ROUND_UP(pccb->datalen, MAX_PRDT_ENTRY); buf = pccb->pdata; i = table_length; @@ -1517,8 +1507,12 @@ static int ufs_scsi_exec(struct udevice *scsi_dev, struct scsi_cmd *pccb) ufshcd_prepare_utp_scsi_cmd_upiu(hba, pccb, upiu_flags); prepare_prdt_table(hba, pccb); + ufshcd_cache_flush(pccb->pdata, pccb->datalen); + ufshcd_send_command(hba, TASK_TAG); + ufshcd_cache_invalidate(pccb->pdata, pccb->datalen); + ocs = ufshcd_get_tr_ocs(hba); switch (ocs) { case OCS_SUCCESS: From patchwork Mon Sep 30 12:44:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831549 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1927629wrw; Mon, 30 Sep 2024 05:45:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXpjBg1PmNiPZj84UkL6JUG+hicREIdsELl8p2x+M6Y6PNZz2f26ixjrH/QRemaKBtAzp/OJg==@linaro.org X-Google-Smtp-Source: AGHT+IFjaB1HbYBUdGgpJUX0/t4QXMZnipSZp8wvI6b1KGW2eiOnxzo91INdU/jhMiDdaI/LKZaP X-Received: by 2002:a05:6602:2dc2:b0:82a:a454:6306 with SMTP id ca18e2360f4ac-834931b41c7mr1119306139f.1.1727700309271; Mon, 30 Sep 2024 05:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700309; cv=none; d=google.com; s=arc-20240605; b=kFmi3i0ZSxUugExa+yJBHH/HSfZDS5HJJsaJEobH9+mO+mghRTCaaKVfjWKbf4SW3A vdqVpm5fsuzvkqA3askYNZzz6SVkjMR1I7HW4woydm72pO5qRmCosMqP00OA+hm9n60i ZoDSEv2zmBOeMtOGehLblVEWEolc6MHRF8Lrxn+/yrUHk9DaTZnwYdCeflf+Q/bLmV2U cPZGPu6IzjHFUelAgaKvBEiMi7NBAvo9OoUQr3yoRQTOl+jKVJ60fM2P0dTK6asShxSj NW0eWEmeJ/HQvPu7NUZyp2lPzSZW7bl2jQjFFNmOJ35fzPkvDYJ3xyyxrY5zJs39l2dR Sq3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=OD2sToIpO1cfLByUX2QOz6TvfjoafJN0nC5KVlPh1ro=; fh=gZE6LyyWcfEakLfCtakroVun/l4aXI2g/Y2TPW017jg=; b=MZ80ErREFh1MKYLcRUZn8DX86X425uPR2L2fC99M0yCsQZ/HM8KjFJTZfZb+r40jKe 5UUdpRRQ0jD0o2fcbwTs8pV/XophN7FYGkDSwbP6U1HV3PYtfYBiHTQq6a7QeISPyn9n m+6t0CUj/kkewI32ByB77k+SPFX/UnQxvPvSSuLy9FNCCwLCGIFBNnnqRh/K5VJrd7Py lupPgEJjAfAiJXhp/NdLV07/yRA2+bm0zm5nKbgrmiXaX8O0pLUKTsf0NMhwFZk5Wifu BWs0aLU7XrA+laF9eKdU+t4ItdmcrbRfxghjPl7GfaRJSYx6qA7diLjVPhXmQ6VS51ap 6Muw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FaUeJgEc; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d9f0ece92fsi355438173.162.2024.09.30.05.45.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:45:09 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FaUeJgEc; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B695E88ED7; Mon, 30 Sep 2024 14:44:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="FaUeJgEc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3635D88E61; Mon, 30 Sep 2024 14:44:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2D4D188D9B for ; Mon, 30 Sep 2024 14:44:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42cb1e623d1so40167785e9.0 for ; Mon, 30 Sep 2024 05:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700277; x=1728305077; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OD2sToIpO1cfLByUX2QOz6TvfjoafJN0nC5KVlPh1ro=; b=FaUeJgEczZT7RGx+tvbuZbWUGdEkP8j9c8EKQVPWknDBU7gbmjzWn9/H+8ATFqIXJZ u18OogXzsRyySKadRhG25NYvks8pp7R/i9lF9U8lYqCKpMQka+48vaIJ9f8QDyVm5vzW ASN4V8LjQsol4M6DELJQuwd7RT7lzMuWnD7ruE4obyEPHTKPkX9tsTemYaJGjBtVl9np npqQJ2MZc3kKEXV33YNtz53Nnjh02pl9a5HIdi+pZdpRCeKEaRGexPVoBREUwDsN62eP X7p6yiTPX6aT9j+MC6HuDrdvDdEypAWWruwLQjP0GQzDPfoTF0bbnLd3kAykoXUmUgvR g7TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700277; x=1728305077; 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=OD2sToIpO1cfLByUX2QOz6TvfjoafJN0nC5KVlPh1ro=; b=vPhtkE8FoUewFcg6DxdemCqo7k04Xvdcp/1GAqc8ALjGa5VnR1zI743H9Qcg5CGIe0 +vUiy1COdXBn+Oc7xIqwQzu8LDRs7u2knoUf+bLeL6lcw08vYuqJCxGWCCpGU01wUXY3 P6yneCNEochMZzpEaygwUNfRb4z185qxQjjnOJL37451F+of7N3Dr6cfR+69MzYAJHS5 De1E8tlnAe2MeLoFqlQhuYV9NYSmihHmW6uHKWjJkM9te3fP36P/R8xDwBS5Uqp2KqAG fNEu0fABCjvMus8PhaF/vV//QXHRWHg4AWSQRjsnmCs+Fo4Go1qEgX2w/fCTLmeRCOJr jDkw== X-Forwarded-Encrypted: i=1; AJvYcCU7phQc8mzZNsgznJf66F0GekZdna5X3HfYSvT0/vuPL9fqBGK/rChRoNTRynLk7PISP6fdMYY=@lists.denx.de X-Gm-Message-State: AOJu0YxrXs+z7lN1PPl3XarAnHbdJPKhXNNuo+alYl0QOb0GrK85RsuN heaGJsd0aUFBq6z6U78Xj3rq3Mcr+abbfHixiM6oGXsMgBHJ4Uy4jcTc+u84zYU= X-Received: by 2002:a05:600c:314e:b0:42c:b3e5:f688 with SMTP id 5b1f17b1804b1-42f5840ef38mr90677385e9.4.1727700276628; Mon, 30 Sep 2024 05:44:36 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:36 -0700 (PDT) From: neil.armstrong@linaro.org Date: Mon, 30 Sep 2024 14:44:27 +0200 Subject: [PATCH v3 05/13] ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-5-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1038; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=ppGnCnIvQ24RO+CksMocxHg+RzOv3UzcGUUNAD0tfrk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0qxtlQWkHOE5r1fBK6xivUhVKtNJOaKzhTihQk ierv7b+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdKgAKCRB33NvayMhJ0V1aEA CiTzPYWGnvZt7m/1qURhN6+cV1oUrr4O+GVLMOyfuGKDYbXa1E18wI0ffCk44Zr8uQrp5FNX2BYQEd BhtSvNY5z3A8u0CZPvJZ+CQYVs5IkbRnrSyc0HR8ZrbC/INO+Sh+9/Ep8TJBQ43fCC8b2s7S6GnduK eogorPoxaUxKPnaBYwpGE8/HXIwhNTUosXX1F0L64cu0g65cvSzMkHaL7VBbBTC+6f3AZWmHrv3wI9 oblo8IltGdeUTIpmPPkJq4DTfHc5w9kdFxlcFvQGFcBB5PaKjqsjmmaLqpmPC8NDoKngH0V73uLefv VnUYjC6HdC81OBCkBh5e9mPeiOlTjmlI453u2yWWJsjC+Eae5UTYGNRfBHblRGLGVM19S+2NjpbLJU 13qXG/5gPSHXizmxRVO+3Vc/at0CoCfwKbHAgLLntzC+Wti49UN/ZxevkBucf+eCkjwysU6Qts3s75 1w0ze9XAjsPWstZDoq5RSdIFkAxpPrZ8YQX49c7j/iJvbzsw3m9K6jL58nK534Ux19r5uKDFj1F/qn qJOxN16yc4HZdCapGjNeccdLkSSR3eGveRNfrripu/oETwu0rs9QXxKS715X/EbzCqzqJXJplJwg8A Dfj44M/dKAf+RnX5q58xzW76f0qza9GHVQnBHGfnYFoIVccxxeR0qV/cOIyA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Marek Vasut Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS for host controllers which do not support 64-bit addressing. Ported from Linux kernel commit 6554400d6f66 ("scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS") with ufs_scsi_buffer_aligned() based on U-Boot generic bounce buffer. Signed-off-by: Marek Vasut Tested-by: Venkatesh Yadav Abbarapu --- drivers/ufs/ufs.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/ufs/ufs.h b/drivers/ufs/ufs.h index 43042c294bb..c92f47d82b5 100644 --- a/drivers/ufs/ufs.h +++ b/drivers/ufs/ufs.h @@ -732,6 +732,12 @@ struct ufs_hba { */ #define UFSHCD_QUIRK_HIBERN_FASTAUTO BIT(2) +/* + * This quirk needs to be enabled if the host controller has + * 64-bit addressing supported capability but it doesn't work. + */ +#define UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS 0x2 + /* Virtual memory reference */ struct utp_transfer_cmd_desc *ucdl; struct utp_transfer_req_desc *utrdl; From patchwork Mon Sep 30 12:44:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831551 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1927803wrw; Mon, 30 Sep 2024 05:45:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX76KycBems+AZz1r8UUb2kG9v6pq2hHxr7IRInFKFl/WSn8wEhmLP36Wuw7dkKjBaMxaIdPA==@linaro.org X-Google-Smtp-Source: AGHT+IH9/tXKLFVZZTVvq7BuNQuaJU3Fm9eVf0BXnJCAh1cMUF0vfwv8Ir4slWFvSoQ71W4wJ1R2 X-Received: by 2002:a05:6602:640b:b0:82c:d768:aa4d with SMTP id ca18e2360f4ac-83493207e40mr843415539f.9.1727700331238; Mon, 30 Sep 2024 05:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700331; cv=none; d=google.com; s=arc-20240605; b=bIYtAdwfqdmwx0JcyNXR9lYmOzqDyMknSRbJnUN13nzJWfSo8qbpae8pN8pV4xfbBx YTdU/+4YUqjwGNAVtYntWezZNQT+seLCrFn3GJFwAJ/FJzFugFyIkh9vsuHPVS0YrD24 6BZeAXMqy9EdgP0Zi7nHLrz0zHjQIhvxPsb6hGTUP1i4JNya2J2cWIJK103folpGhBKH 3h8s+KPZCgB1AgGBg+6TJMTqEGFwaZRkHSLMzD7lei+iE3gLHPsqY4wSs7i+oQ0sNCnx Vt/O5TM+3Ejj4x8EBGoiNZAq3rJcUdnpA2NdEDvlToKLVI7+QrQO60loCJ3tmrSGHAUf 3TwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ITsepdkflPSwXBnKePx11i3APLsx3e7/kiaw75Qv7/0=; fh=DtnedpImQRL0SOG65lgJ5cFB1htCkdXsAFX4+cx/n4E=; b=QLv3Q9VkVlnhoGhqXkJTSdjYbYi6++Wd0ETIW7NriaUzsyLVUKm47HTKsrRb2CfcoX GDW6ORkCF5MyWU3ot60FXQNqXZePIyBiiMALXTISWEImGfonHlsoAoPx6xqqkRPFoPzc pYF7XyQb2nUT8GjbReoWhTXtoBf6MmKyV+YibPIqo1Zh3IgkMh0WEs3FXEpSSvPPJe+u y5SkaesVoW4aTbfJMZrRYYLcouggkwBc7LXzouSZTV6Y72JbSclxq18b7JVIX8v1Vv16 toGBFKJx4v2k21eSsA4pkCyJ+GEF0Z15zyUiiX0oyj3OWVrsv/gXaR/IB86JFWIPNeWr CSZQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x5Kmf2Wb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d88887e897si3414127173.83.2024.09.30.05.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:45:31 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x5Kmf2Wb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8465988F12; Mon, 30 Sep 2024 14:44:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="x5Kmf2Wb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A991988E89; Mon, 30 Sep 2024 14:44:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AE78588E63 for ; Mon, 30 Sep 2024 14:44:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42ca6ba750eso25909675e9.0 for ; Mon, 30 Sep 2024 05:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700278; x=1728305078; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ITsepdkflPSwXBnKePx11i3APLsx3e7/kiaw75Qv7/0=; b=x5Kmf2WbPio8QwGWr+IXJukCzYGg3KhtpN+fPOjFFYipzpqXr8nYPc7apenB5/NRpN OCCrNDldSkDf8xL9AGMfniXiWUlHvRgpioGzu4eTpWmn8ZbaEeBxXYMuVNHLe9jv8sWB JBokDVF5V6Em59qMiQdFCLDe3KfrvSkEMLh1B09p+Sh3wWDG4T7ngF60VXVq/jnz+yS9 3EyzA63r9dn1GxJct2qcxHkGHKZy6vSaL8EOQwvPSSc0Pt26/hwkWwYjEIxXn09S1G0k oiMiu2ld4NkRkK7xUtmBTl0hpg950wWt/6kEQjIrBF/6nRW+Ip2KtKErqBxYB08ciLHi vl+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700278; x=1728305078; 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=ITsepdkflPSwXBnKePx11i3APLsx3e7/kiaw75Qv7/0=; b=qMVVltCuOLCjGJcSLW2wxGVzxTii9lw5VLDmcDzq6V2gaZ/CNX1y1/PJgcXafEYuuh 6t/giaX86Cp9gHUHJyad9zrZ3aYlTz+O1VLHpOSWi9xtNorIdpFvk1U7t0tqVu/q11nj yADhdXK4lBB25Kun9Ye4d+c+9T6FEGWgviVTRYlITVcsYNRK37JQ1+a3HJBQCGbIeE9u 6dAqSVGTtb6rczsfqTnhGGHzIUWUOMSxiWX/2AibMHZGfTw64ExmARrRmUsc8N5lCNkE NoCYnQ2/7Z3Bikv3mCuFYOn+5Rrl330wVWtGq1piY05nymkEB+EFCUDwJhnYAc7uwpJ2 SfvQ== X-Forwarded-Encrypted: i=1; AJvYcCXczZuIw1upFhOkruKKTog6wWaQFPN9KdQKT0u7UwNRFcGiH0VHF965ivY2BpPw2JZ0bpC+4zg=@lists.denx.de X-Gm-Message-State: AOJu0Yw2uQVAsMYmXuWttM29ujaviDuv4c09ToGWHT+RVbzpZ7v7pcpN WKboM4uuJwrZ5Kc8GM/TBEXbQIhkXslbhoqJ3iIhl6Ax+vBnuiz6mUeuiAkCv6E= X-Received: by 2002:a05:600c:4fd3:b0:42c:bd5a:9471 with SMTP id 5b1f17b1804b1-42f5220856cmr94442955e9.16.1727700278185; Mon, 30 Sep 2024 05:44:38 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:37 -0700 (PDT) From: neil.armstrong@linaro.org Date: Mon, 30 Sep 2024 14:44:28 +0200 Subject: [PATCH v3 06/13] ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-6-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=979; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=U5rWDVmk+KTojaFG4mSUB4p+9RPDWzL77dGyGCosTrE=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0qunYE2KM4f2z8U7+HAEiKAPQhyMM09sJzWI8b RsOZl2GJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdKgAKCRB33NvayMhJ0RK7D/ 4kdjjd+FpukSX+OJr7UtF8LbW5xefgzslChhRHIkT5K1xKAkd4kvtt5Ce+1i0jrSVEl3KOczYpWl4I 5XCOHcF0blBCVOTHJsEj2wzgP/FNMI0Smy8duB2TitnhkYuna9KFpthIKuOP0bjq8ygfjd3hMnff99 bRiNhltBAz7c+UM2MIpR+YlecfOKLVjcUb8bNLB2M90aq9Klideia6fE0/BqtMzo4Aw5xgpT4iA8ay DvEtlvTxB3w/nmvAcYsvgZ9LVZRqEaGfUjDktbvp4ImJZD6EeY60GHvQZ9qTe7oUYU1DpWtY21oUJm 7j4SlbA15nG2PjhXF/a8Obh9PsIw+vwrywbjj8lN4FrHQl7erW7mCsZyPwL3msHVIXqhFGGjoMnIdj Tsh5bGBN+JtOMKd1toRRaiIjxGXqWqdh3bBJ9iCijsm5EIBRTcOz3A86gcuv319GEGLx+3EJKcQPYv VTaSLxkApAR8GNJdcY4J6K6HQlJ5oRn0JmX9L9O+Lw9HVWsEwL5hjGhhjJOaRrx9vmoHgGwXTZmYLf wvjrJld2mhLxhhBhtNInE/gLmbPadZ65DUWeGoZYjVfiZUjL88cXnQdvGyn7karYQuvnscd27OAb0M MQwLg/Tz3X9qAolrsTdvV5+h/e/rSJRvEdwGAXrVzJYGsIQ5exXS4uwSEPuw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Marek Vasut Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports auto-hibernate the capability but only FASTAUTO mode. Ported from Linux kernel commit 2f11bbc2c7f3 ("scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO") Signed-off-by: Marek Vasut Tested-by: Venkatesh Yadav Abbarapu --- drivers/ufs/ufs.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/ufs/ufs.h b/drivers/ufs/ufs.h index c92f47d82b5..b55c4a9e996 100644 --- a/drivers/ufs/ufs.h +++ b/drivers/ufs/ufs.h @@ -738,6 +738,12 @@ struct ufs_hba { */ #define UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS 0x2 +/* + * This quirk needs to be enabled if the host controller has + * auto-hibernate capability but it's FASTAUTO only. + */ +#define UFSHCD_QUIRK_HIBERN_FASTAUTO 0x4 + /* Virtual memory reference */ struct utp_transfer_cmd_desc *ucdl; struct utp_transfer_req_desc *utrdl; From patchwork Mon Sep 30 12:44:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831552 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1927908wrw; Mon, 30 Sep 2024 05:45:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXqp49LZxGlF3/+/sGJaG8upPjE98mrkPVx2uFlToC4h8D2POCrnPeGmNl6vqS/DIZcmoraBQ==@linaro.org X-Google-Smtp-Source: AGHT+IGg60KLaAT8uatuTQYolH4mjYHiLy7CbgkiwetBL/FokOtu4htFTjL9qAQhO+LMXkOX4Wgn X-Received: by 2002:a05:6602:1605:b0:832:3ddd:b376 with SMTP id ca18e2360f4ac-834931cef43mr1050341739f.6.1727700342344; Mon, 30 Sep 2024 05:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700342; cv=none; d=google.com; s=arc-20240605; b=cghs1/mC3mu6cEXgr2wjx9D0I+O+DGSn5GPsKOijILuClEWXsfCkBpVZEo/ApsO/Dv 0Jg7gPAsfLxUfxIBeZHiJKA06dDMT0jiF94TUHNB0Ky75+D/kF6wAd0JpWdqkMA6ZJ3K fXabmXE34Cqr4B7jykwfu5JuGBAFVoA5yabt6JkXB3vGNPSIGXP7Px7ybg4bqZhCginn 5Tzo1ITVQRxJLzB+OOAoQTk8IulUx+OynFFEO7ufgOmIZ30oN95Zc5KkqrJ26pZnoeJV ZFU/Z1gsC0GL7KkTu+CWl7Yrx/RYd+bUqUiEaZI3iEWqtgMO86c/w4I2Xd2XHSZ0A/Pi mgeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ufQB8A7S7HQWqlMl/QZrFootjisZM0DA8sUMyIHcnAc=; fh=XtbbTa8IO2wrslVYKpglMS8Pprvv/d0w5COUMMncjP4=; b=OboqNqkOGUCFeGGnnGuArKeSTo7fPNARnZhIVzP7shRyPFBLwPOmKs5CUeCXY0nqnF GqXxtOYxZovOBjByYkAy1mvfdHmJv3bnSWOqvkRsO2XiDaCHbbl76w5DXZe3WEVqzvFf ubvF4WwbJPuF283GaHlg+teXEKwCCD059Vv4V/fqMnirJoQM+8NQg0GHWuy3HKM3m8SR G8UowGPJ6j7GMA3vL1V0mkZdwytEUDLsz2KI8SIw6cJ5NUshTwz1V/YYzTI4BlvNL5H1 FVY8V81EYmH8H15A/8NDc6WxXSqJYO1ftB2kfo0dVWn2kD+E8ISnY1FK6rZ3tSB1rBwo VqdQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x+pe7wue; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d8888c4e1esi3647811173.117.2024.09.30.05.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:45:42 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x+pe7wue; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E0A9D88E5A; Mon, 30 Sep 2024 14:44:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="x+pe7wue"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 16FD688ED7; Mon, 30 Sep 2024 14:44:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1D25688E39 for ; Mon, 30 Sep 2024 14:44:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42cd74c0d16so40055265e9.1 for ; Mon, 30 Sep 2024 05:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700279; x=1728305079; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ufQB8A7S7HQWqlMl/QZrFootjisZM0DA8sUMyIHcnAc=; b=x+pe7wuePDSXEb1pPjzxIrsdldfI5ZARf4pTaMdqBmoyNAf77BW32A4bT2nH6bdzGz crJqotcjSHCickYrUhsWs2YM08ZtZ1c7hNOf733WqEbsBwnpI+UXBnUvrvL3Cxrflmb8 k4DyrfQjCJw9HYL85MZwcXr7eQfvANDSUsid4Tnmr7g2HFdJzp0UaYeA+f4umGIgDjOW RoEAOkxye7U8WSWnwVjWtoWTkqU9i8ELCfXNRCkBhBS0svgmNkylvW//PvIBoOKSu3aB laj8TmvE1iVVl14m/PKHNsdGMg/1np2/gqYFE1StRb7KDQvvzjBpbDc14JTu9joXlwxG eERQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700279; x=1728305079; 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=ufQB8A7S7HQWqlMl/QZrFootjisZM0DA8sUMyIHcnAc=; b=o5BslF+qRF8yB7dKp7WCRxnYmZGWl4TfbdQxN0cHJsaNfEguhGfJls4y+ww/eDVPpZ 3y/WApiLDBa/ezPIWYuxe2St9y+kP1PFoE6GBrva4b19E7coRPf3/yUSEvFGSHqSbSK4 3fLO6c4iWb4oLcdW3PkUe14xktjKJ5j1lVoc4NMX1KWdpOiZ7u8aPChltYPZh1zD5PSK vGXTmJY2l4AdfStbJ8vs/Ow3rqPBtPIr44Sk15X/cvfejTOXba3rxVQ4Xhe4mJ8F7v1q YfOxSP/18MH9Z9ruucXpZfeMFyeDzcmUM6yE86rn1VZT/Xg0bxzvMtqofPcgVtXpqNMw JOeA== X-Forwarded-Encrypted: i=1; AJvYcCV3/0H0Ew4onTGBFd7utzt/vf94Zb2Em8Zk018u5dGRvQls3tjV2mUsyJd4gienERwxJqLqTyc=@lists.denx.de X-Gm-Message-State: AOJu0YwcSUBg5858YaOj9FekHr8iyHVs/Vl04Ls0vu95ZBwiMuu/mtMG S26jjJGjUuJCXp605gcUJ8g//RBY4qrSiMVaB7m5n93lhhm68HxPJm7nhiLxbcQ= X-Received: by 2002:a05:600c:1d25:b0:426:5416:67e0 with SMTP id 5b1f17b1804b1-42f584a20f0mr94853565e9.31.1727700279503; Mon, 30 Sep 2024 05:44:39 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:39 -0700 (PDT) From: neil.armstrong@linaro.org Date: Mon, 30 Sep 2024 14:44:29 +0200 Subject: [PATCH v3 07/13] ufs/ufs.h: Add definition of 'ufshcd_rmwl()' MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-7-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu , Bhupesh Sharma X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1432; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=bbCuD/dyszp/lXuI6ICL/n9qlyT7Tgye7QKx3MCaunc=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0qCP/QYqlZCQghNejycqFF6JtxvbK/YnUBAX5+ vJHQNmyJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdKgAKCRB33NvayMhJ0U4ND/ 96Ce1FPUlHNo673v6SkuyVusL+0ZtMR6UMxV9fpTp3WyWOYIvd7Nk3VlY8xORJ9ocdMsBdMWU+swfe 6QEyMq9vnaOXlHu8nZZNWijc6tMifOSSWUvt5eOib08zxNx4TjYtlxORdi+2U9l2rPXHAw99MI4PUU lY6xiodZZ1BNVa3Q6pd/qsSOPElb1pBWFbhjgofc61XxWRWpWGUfJDRQuy75/ItI6z7Kaf8aXmk2Im z3zsWM++EMuqicU5I72X0/kHnOtveapJ7s7dvVa5NytKBTWx0NHzp2Wu2CmD5BqZkKbr2kJujNN4aP 4kHQQo8ADt/F95KxtSb57MFGSsuzmdJGxjO1EwKJ1JcgRpfk0345RnDRjkrwaot7t4bAWiTiRg7Nw+ d6HWqyR5FttJKqwV6Ox8luReqzuTd8zS8sy+lUP9tML89Gaj+lbK2d2xMt97DtSdRCumpQRg8T7Hfu f2rrptlPAr3uSnYSsRqtzFimYttXYdnHkQl8WdNoxJ7Z3n4qfCv+v6Tmgnk4pHQG4GK/BMvUin1OBK 8fuyH1mB3QZIzAL4T7fSctEi8OptMYhi4XGtqqPC+uiPafqJwYBNH8UTh6PswpGZos1IcZW2u0a43G 94X/Hl4mFHPF1euuCiXwNj7BoBVaid1f2wnqCU9EKUrwp8iXFIwHg6diEb3A== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Bhupesh Sharma Add definition of 'ufshcd_rmwl()' helper function which would be later used by Qualcomm UFS driver to read-modify-write registers. Ported from Linux kernel commits: e785060ea3a1 ("ufs: definitions for phy interface") cff91daf52d3 ("scsi: ufs: Fix kernel-doc syntax in ufshcd.h") Signed-off-by: Bhupesh Sharma Tested-by: Venkatesh Yadav Abbarapu --- drivers/ufs/ufs.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/ufs/ufs.h b/drivers/ufs/ufs.h index b55c4a9e996..555f8a6857d 100644 --- a/drivers/ufs/ufs.h +++ b/drivers/ufs/ufs.h @@ -3,6 +3,7 @@ #define __UFS_H #include +#include #include "unipro.h" struct udevice; @@ -933,6 +934,23 @@ enum { #define ufshcd_readl(hba, reg) \ readl((hba)->mmio_base + (reg)) +/** + * ufshcd_rmwl - perform read/modify/write for a controller register + * @hba: per adapter instance + * @mask: mask to apply on read value + * @val: actual value to write + * @reg: register address + */ +static inline void ufshcd_rmwl(struct ufs_hba *hba, u32 mask, u32 val, u32 reg) +{ + u32 tmp; + + tmp = ufshcd_readl(hba, reg); + tmp &= ~mask; + tmp |= (val & mask); + ufshcd_writel(hba, tmp, reg); +} + /* UTRLRSR - UTP Transfer Request Run-Stop Register 60h */ #define UTP_TRANSFER_REQ_LIST_RUN_STOP_BIT 0x1 From patchwork Mon Sep 30 12:44:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831553 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1927989wrw; Mon, 30 Sep 2024 05:45:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVEEAEzw7K6HQc6s6nGPLziPA8ZvX6Sc14+14OqJFwIGWoWVHmP1kl6tuWddjdPxQs1rbj5Zg==@linaro.org X-Google-Smtp-Source: AGHT+IGUgMRlet396T2j0SB0hileaYI2g4mAa0p5LFMvTmekzvpNU0LZohzoNrhAPlF5fk6Y1eD8 X-Received: by 2002:a05:6e02:17c7:b0:3a0:90c7:f1b with SMTP id e9e14a558f8ab-3a3451692a1mr104890605ab.12.1727700352691; Mon, 30 Sep 2024 05:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700352; cv=none; d=google.com; s=arc-20240605; b=X3Qp953Be0HVYpuui1sIECV1Cmo4ZV1t1SCp5pCV/s0rs9PtOwA7jVNWiYgQnlDhb4 HkYfbDzsIZ1D3VSgVIOQZR/SktSYxjYBkFekbi4BQJLZ+ZVqoP70aWoW8nnYaLeAgGDz QYudP3JtSYcEM50P3eT6rJwoca1IXPTpshYawfbzaRa5F46RlYGiWKkZ7ryqm+vNy3TY LvnSS8/ApGazWqJKvtvA7PVhcZy6wO74Q/RG9QvXIGCaoTobNvzIZmNXPIlJ5yuSr2Kp snc/IJPjx+T+daX3p/4GGR11q8JJl89ktoVXUQO4AG5wp+ufoTTSFB2o9NQ9JR1Wq1Ez j7Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=oRI+braAFRkLtW1tYqHypYCrr66AgFi3eAXR8xLFtVg=; fh=1eubrHFNEU2kCMeZEMKz+ZkE0OOdeGzdkg/tuZ1YA6k=; b=OpHwSBzFL5OrkISBUYPzJE1IRXXJwN88rhXNE1O55llb7cCCvvKnS6+NvVenVkBujk efjdC1axdIrfQi7C8epL/1vbWWq+R/zvC+LmW5hOL62ga5tlExRkFnDXeJ35gcf5qAHF dn7YX0SjbsEEKGy+ZA1FvQO8PsGPINIOfjX5RjFh3cr1khKz/MqY9hYwPkuVXY7b3LY9 aUczUhYl+8Mlu2cEwVwn/vs6x2qYm5MPcWPAIbFbUgo2jUhFjBoSXth9o0kMbbS4sbev mQE1z4CypWTgXqnGWd7oJQvn1Tc0m1fahth+HV0mavCmoeIj+tOeFE5o/VtuY/leQWHY l/hQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gd0Nfif6; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id e9e14a558f8ab-3a344de9979si35027825ab.108.2024.09.30.05.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:45:52 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gd0Nfif6; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4EAE388E3A; Mon, 30 Sep 2024 14:44:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="gd0Nfif6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E404388EF8; Mon, 30 Sep 2024 14:44:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 01EFA88E63 for ; Mon, 30 Sep 2024 14:44:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42cb1e623d1so40168545e9.0 for ; Mon, 30 Sep 2024 05:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700280; x=1728305080; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=oRI+braAFRkLtW1tYqHypYCrr66AgFi3eAXR8xLFtVg=; b=gd0Nfif6gNx28xwkoXTbSv/eEhaj5nAoISdvrmZaL8xc4heHn2dJgJDcUobCNS0gcs 35OWV+YlSnHRRTgALM24QSI+COd2VQn60aWv4/Bar3WcgYhucliSh6neYFubQ+Ahwajw ZgOQtsQeERgtfKCsvI3KYSYbOoOQHrAYO8TGD8y4Iy8sDzYwcSo81jsIns4bXs/0Vntf gUbLCIYF56zkBCCi3LqGU+8ev3/ZmLBxVijYz35uGACiVSEieuiYapG2sXtJdv1EfjM6 +kDXejBc/0e0QszvIp6d5nVqr7qXp8+P1vBfBZNJb3LVys9OCasRKR49x1uK+CYg7vv4 AAXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700280; x=1728305080; 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=oRI+braAFRkLtW1tYqHypYCrr66AgFi3eAXR8xLFtVg=; b=I8CkAqMUM+c/cgbWvIU08OBKvq+cM8iF9169Xvzi+MAgT+1xrxzR5KREhxyeizj+DE 2qNgYRcE+WpvNhwBX8dTv/qwUVvae/r/9zGXV656AeraUVcUdAUQyshhQy0K8rBkhYnz iVPITbSYWyk9HluPEf4EBP2Ciq+r2xf+wgtQjLR5rR0ot/uNSesIt0xNTLEjGjd9+h5e C3DW5oOxxoU93P3xnYGsPW6BfBEYM0SteDtKVFwBAcF1cShoTdeW6PeNY29SY71NzSMr xUYWEeaq/tXvqSh6K4U2fvTIFufvbj2ignYYlArs4kLCsvksLCBipaWumJiinO1n2Pv0 SMDg== X-Forwarded-Encrypted: i=1; AJvYcCWKxC/QGfGxeXAeTDm0631k0s+PBq4KMqHS/rNd3sevaciW6kDj2RVacg+/lggme8luPkqJue0=@lists.denx.de X-Gm-Message-State: AOJu0YzQPnSOCVpKL/k2dUfMZSMU7BfGAMTTs3LpVDDgx56GeiwEXUQI 5vb67/guW/k8o79wIwFW5QIWAw2ZWDkaYmH8LJfq+Z+pmkLDiVkfUkwwKliDOtg= X-Received: by 2002:a05:600c:3b04:b0:42f:4f6:f8bc with SMTP id 5b1f17b1804b1-42f584339bbmr85225775e9.9.1727700280386; Mon, 30 Sep 2024 05:44:40 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:40 -0700 (PDT) From: neil.armstrong@linaro.org Date: Mon, 30 Sep 2024 14:44:30 +0200 Subject: [PATCH v3 08/13] ufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-8-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu , Bhupesh Sharma X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=901; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=H/JIMlu6LXL5TwiLe2RHNPxjiY85MChmdMxPyHH9Kvk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0r+Lr48jKRU2C6KU0llUr6CxWX+jXBtz4CfaJ4 Xi9P1saJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdKwAKCRB33NvayMhJ0awAD/ 9FlMjmV6ocdZZsgIP9C28mJ9wso7ZjEVqCPq/5107XSirYf4cJVxRqS5mpwGHMM19URdcz7AHYpWl7 OBl9c777F7GFGpw6ZyA3lRe3eu8d69uGmVyE9epTSY3QEB4yfyld0OAyg7ABsu0svlYhBIwMFq/71P kAFIlaldVUxOWecx/a8zqmz8hCYYwYkBzCRrlWLumLXhYPEiUI20UcArVAOrwvmIhUe8eAYtcAJn4o /3dBoEYxnXi9bKqyT3VhhL34tMBRoevqZubkfSnZrDOEII8oGjs60JEAmMXVvuG6VPXCL1YD96jXAS 000lNiQePGSjghJlb9IBhkjmKXCy883lCoc5HAjM/j64lYxO0lhZ8Ni8y2zzD6NKcZOyK3TAqp5R+u RqHjhxYpG7C90AlxPDYsCgKyMeq0XYpiHTZxjp4qSnMNNm+pqcQaHTTHYXk4YOvk+UJJAXBpN5AcqE 6RkYtgYnN3xS1dR+Ma/Euezwhsoec675HQpLGHb3jx8xOtGDPGZHJgzIIKkjssTuGNPtEChNKTxivQ I8HOoPQJD2JMRoH9tPfzKI9+2U4Y8H0rUMEuV/JkiWQrWdPe+5a+d+KkgoNxrIXuxYJLM8B/gkwtQN knvwKKRm8tTzST6zU7CUDt3W6rF9qZrpwJLPZpkZFEkuuV2ObyFOHSwHCO8g== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Bhupesh Sharma Clear UECPA once in u-boot UFS driver due to LINERESET has happened during LINK_STARTUP. This makes the u-boot ufs driver behavior related to UECPA similar to Linux UFS driver. Ported from Linux kernel commit: 2355b66ed20c ("scsi: ufs: Handle LINERESET indication in err handler") Signed-off-by: Bhupesh Sharma Tested-by: Venkatesh Yadav Abbarapu --- drivers/ufs/ufs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index d99dcdef7d0..565a6af1404 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -504,6 +504,8 @@ link_startup: if (ret) goto out; + /* Clear UECPA once due to LINERESET has happened during LINK_STARTUP */ + ufshcd_readl(hba, REG_UIC_ERROR_CODE_PHY_ADAPTER_LAYER); ret = ufshcd_make_hba_operational(hba); out: if (ret) From patchwork Mon Sep 30 12:44:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831554 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1928069wrw; Mon, 30 Sep 2024 05:46:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVbOS+UjGAJpvMQy+6D4hfzoZEpPlGcy2EGm7cb9ThL6rmJZMxI152pyCJc2xNbJ6xmeqUF+w==@linaro.org X-Google-Smtp-Source: AGHT+IHuP1vdPz7meHID+xQm8bQJFQ2247vXB7PS/+2e2KPDPukQ+L0bKlvIvVmlZG4zPLNcZi5S X-Received: by 2002:a05:6602:13cf:b0:82a:2053:e715 with SMTP id ca18e2360f4ac-83493269970mr1132442439f.14.1727700363679; Mon, 30 Sep 2024 05:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700363; cv=none; d=google.com; s=arc-20240605; b=jysn97d7ZzLRTMvowunmQkEWS1TZ0sF1g1Fab5ql3KkwoQWwIwUo4n8ZyyJ+7SAcUo kmWJuHdg9CfKcuIlQJYtRhES02eizOOwwb5kRoPwewXhNYhCNzXdgTisUpFGlEWV2hHJ 7zjhHGaPoIe4iCIMQaI5IuDS3wOJWz15BZsQRtl6/u24qc+KkVFncL7PZqTnRo2bD5jl 511disfEe2SF+euTsbpng8gbRTCQyM/oI39U4MBZe307AaV8xXUftxPG7a98n9l2MtSI 6m9JblSqSQNzDc1IQ3SjMEu1297DpIZIlV6wPKdQZ5+d7HzVYwjm9zaaORoT4u02cATW 23jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=dfwAM8eYFpIw8iKfFTzwL5BidwOo+6kSHQGUrzEEd5I=; fh=ceLbDqjWbWeZLUB2hyZ/k5guRehXVR4D+/RBsuV6l8I=; b=ABcpAertrgEdv5+bI+pFeqinl1ecXHaaeDc1c/ds6VeehklLaPPLRqthXddLOagKaK w3Mej3w2SRZX9UnIFI4rnEcPe++Tk+pjZLVFl8/xH8ICqqu5Bhv59ErRRqY2Ohlp/fuV tL2MUwtnkxAykWJPKM9Nq0svjlszL2emAgz4/qVjno8lc29q3X+PCDcybE2ORcUvRL0U aMArmgv6Ng+moaDEyJ1gyOr8fGMhPPjquyrQxTFhpU4VAxNV+n0AVBBMQP+zr6oJQgwW m4QH8vcl8Z0nA5+NdEJVQqtXxwdjejwGZOVlf1IDhB/L26T9LAJUbLbNeWL9GXvPM7sq 29dA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rt54HqjB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d8888c627fsi3551547173.101.2024.09.30.05.46.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:46:03 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rt54HqjB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BFC1788ED0; Mon, 30 Sep 2024 14:44:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="rt54HqjB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 163BB88E39; Mon, 30 Sep 2024 14:44:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0AAE088ED2 for ; Mon, 30 Sep 2024 14:44:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42e748f78d6so35008575e9.0 for ; Mon, 30 Sep 2024 05:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700281; x=1728305081; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dfwAM8eYFpIw8iKfFTzwL5BidwOo+6kSHQGUrzEEd5I=; b=rt54HqjBpqTXUsIQvHdkf/L2wutQxVarEls+A2ZRe1yjqBs5tXPp81V6wkBGYrfAeH xAafjNtvVrxNoAI7GCgqIjK8K7J1vwxpBP+RuXVCnUomghcOjHh7e737m9daBspOalRk RTbkFgTU0GizNYAfydRnbt7YP/p5dGnCXmbI2Ss8009SWSqbzBuXpBlMMneGZWjIa0as HiB5xU06+1s1SlVZAEIhn7OlZGZgyJOzY178LjEYWpHZVTI+M2yrAZJ5X65j5Di5tHEZ aHrcGEuMS4Y4ZYoefLCCBqxWwsPGIo0rlJCLYQs/T++gvK0NQ4Pxlr/QqMNKqQ2rtBRV zLZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700281; x=1728305081; 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=dfwAM8eYFpIw8iKfFTzwL5BidwOo+6kSHQGUrzEEd5I=; b=UarGe6GIHzOZx6swx7EDtjdNp7a1A7uf8NLT9IOqs3ye1KGvggHrmHv9qy7G9OkR0f D4WAuIfETHvHEVKoWQFwhAwy093/sX05DMExcmsEj0AvCkyyfWq6XjlpFRbsf2jNuEwe jnI3EUDV3kn7X4EUdNILQbrI0ZPrOjQcQPNw3FAt4M5EKsQZbuGQMPjiMIPJNNsGurHI zjcsrWATYPXgEizKAG6UmiGvzYSo3di4vv82xwkPlRHPlNl0jmVPQj8suC0yHjHrhRta aKYVCnpDIDM9Id1rVbhpw3FgJc3xLip6nEkTNzgH1Dhe4cdSHkSLm5f9HtaoeISOD+ZW ohXA== X-Forwarded-Encrypted: i=1; AJvYcCVGILGWnxRBswqb5ro8RM37mc1moiglD5QHWldfI5BIeLgUYYR0KVG/3PMQIEmgjqDEkEt1LY8=@lists.denx.de X-Gm-Message-State: AOJu0YxODk5P3d0SxhMHseqlkVTr0fzBUhZ2S8tMfS/M7U3wkAit4PDz GTI5u6i0AcnfvqHHwcOgpHLfyehITaohY8bweIXfS6y1rJQDRUrVKjLr09+etJI= X-Received: by 2002:a05:600c:3588:b0:42c:a72a:e8f4 with SMTP id 5b1f17b1804b1-42f58434d37mr92980515e9.14.1727700281358; Mon, 30 Sep 2024 05:44:41 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:40 -0700 (PDT) From: neil.armstrong@linaro.org Date: Mon, 30 Sep 2024 14:44:31 +0200 Subject: [PATCH v3 09/13] ufs: Sync possible UFS Quirks with Linux UFS driver MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-9-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu , Bhupesh Sharma X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=7573; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=q8fsmqgenbbQnBeevkHGjjRLOCaFmquIV/UAgOUc4GY=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0rX+Gr+II5YcGNkhqwervTHmK1IEAtK1qlS55g rdCT/kiJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdKwAKCRB33NvayMhJ0d9PD/ 9FFKLpewFsm5rq7p/yphUpNRebqWkgpoLKQ05TlJYcXAd5lAcQnS/pTn8kOLTRLlmdEoLP0FlCKrRK y2nNTOdTl6nbdgRtGzKYMppA84EQwgCAk0cCyXQw5S90jPSwk3xhr+ZSy0cqhbq8tNC93IvdedEtaW r2N28ZiZiVQ2eXnNCdRjj8Okl++tVCQ+NIBEBdJsoUjsrjGBNeaw+SLoKH2IqrXhaM1HpiQFVQjJDo AKNvfIu+6LQvsg0kEbQVK2WyMSqky/zm7fi9FHj1iJ+xgMksqJuwys+M/XCIL4seluGYS9KqQATzI2 9zbyrWpj2h0rrFz76MCoeGbfrpLgMpm3EeqMRgvLNneHrfqPBu62If7TAJ74aMJp1iaXomY2aSozVi k9LSNW9+JO5o4xs9R98qyJTK9/cga0oQ6Y5rpz5sO+CLSWE2yXA10W0zhd1nYncItvQiQZi4wf5PJL SFylCg2FSjvZVDq1Zcx61uJjFLWQChmtTltLlay43jKvYW3g4WwXJ5rS23Ohkzew2DU4tMUOXZKxy0 jyYC+VXpnB+0fB+F19fbXxI0PrpXb+V/hmGcmYIgfhSxfgBjeRnTERzM/PIeolIKaG9MmU3YNFKRbF 2mcmWY55+zJ6jDyTw9oahrB25WU2bfsxVG9qPLhPOtV17RZ4zY3UDN7AYlWw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Bhupesh Sharma Sync u-boot UFS driver to add all possible UFS Quirks as supported by Linux UFS driver as well. Synced with include/ufs/ufshcd.h from Linux v6.11 release Signed-off-by: Bhupesh Sharma Tested-by: Venkatesh Yadav Abbarapu --- drivers/ufs/ufs.h | 197 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 164 insertions(+), 33 deletions(-) diff --git a/drivers/ufs/ufs.h b/drivers/ufs/ufs.h index 555f8a6857d..c1c6d15db4a 100644 --- a/drivers/ufs/ufs.h +++ b/drivers/ufs/ufs.h @@ -703,6 +703,169 @@ struct ufs_hba_ops { int (*phy_initialization)(struct ufs_hba *hba); }; +enum ufshcd_quirks { + /* Interrupt aggregation support is broken */ + UFSHCD_QUIRK_BROKEN_INTR_AGGR = 1 << 0, + + /* + * delay before each dme command is required as the unipro + * layer has shown instabilities + */ + UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS = 1 << 1, + + /* + * If UFS host controller is having issue in processing LCC (Line + * Control Command) coming from device then enable this quirk. + * When this quirk is enabled, host controller driver should disable + * the LCC transmission on UFS device (by clearing TX_LCC_ENABLE + * attribute of device to 0). + */ + UFSHCD_QUIRK_BROKEN_LCC = 1 << 2, + + /* + * The attribute PA_RXHSUNTERMCAP specifies whether or not the + * inbound Link supports unterminated line in HS mode. Setting this + * attribute to 1 fixes moving to HS gear. + */ + UFSHCD_QUIRK_BROKEN_PA_RXHSUNTERMCAP = 1 << 3, + + /* + * This quirk needs to be enabled if the host controller only allows + * accessing the peer dme attributes in AUTO mode (FAST AUTO or + * SLOW AUTO). + */ + UFSHCD_QUIRK_DME_PEER_ACCESS_AUTO_MODE = 1 << 4, + + /* + * This quirk needs to be enabled if the host controller doesn't + * advertise the correct version in UFS_VER register. If this quirk + * is enabled, standard UFS host driver will call the vendor specific + * ops (get_ufs_hci_version) to get the correct version. + */ + UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION = 1 << 5, + + /* + * Clear handling for transfer/task request list is just opposite. + */ + UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR = 1 << 6, + + /* + * This quirk needs to be enabled if host controller doesn't allow + * that the interrupt aggregation timer and counter are reset by s/w. + */ + UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR = 1 << 7, + + /* + * This quirks needs to be enabled if host controller cannot be + * enabled via HCE register. + */ + UFSHCI_QUIRK_BROKEN_HCE = 1 << 8, + + /* + * This quirk needs to be enabled if the host controller regards + * resolution of the values of PRDTO and PRDTL in UTRD as byte. + */ + UFSHCD_QUIRK_PRDT_BYTE_GRAN = 1 << 9, + + /* + * This quirk needs to be enabled if the host controller reports + * OCS FATAL ERROR with device error through sense data + */ + UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR = 1 << 10, + + /* + * This quirk needs to be enabled if the host controller has + * auto-hibernate capability but it doesn't work. + */ + UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8 = 1 << 11, + + /* + * This quirk needs to disable manual flush for write booster + */ + UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL = 1 << 12, + + /* + * This quirk needs to disable unipro timeout values + * before power mode change + */ + UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING = 1 << 13, + + /* + * This quirk needs to be enabled if the host controller does not + * support UIC command + */ + UFSHCD_QUIRK_BROKEN_UIC_CMD = 1 << 15, + + /* + * This quirk needs to be enabled if the host controller cannot + * support physical host configuration. + */ + UFSHCD_QUIRK_SKIP_PH_CONFIGURATION = 1 << 16, + + /* + * This quirk needs to be enabled if the host controller has + * 64-bit addressing supported capability but it doesn't work. + */ + UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS = 1 << 17, + + /* + * This quirk needs to be enabled if the host controller has + * auto-hibernate capability but it's FASTAUTO only. + */ + UFSHCD_QUIRK_HIBERN_FASTAUTO = 1 << 18, + + /* + * This quirk needs to be enabled if the host controller needs + * to reinit the device after switching to maximum gear. + */ + UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH = 1 << 19, + + /* + * Some host raises interrupt (per queue) in addition to + * CQES (traditional) when ESI is disabled. + * Enable this quirk will disable CQES and use per queue interrupt. + */ + UFSHCD_QUIRK_MCQ_BROKEN_INTR = 1 << 20, + + /* + * Some host does not implement SQ Run Time Command (SQRTC) register + * thus need this quirk to skip related flow. + */ + UFSHCD_QUIRK_MCQ_BROKEN_RTC = 1 << 21, + + /* + * This quirk needs to be enabled if the host controller supports inline + * encryption but it needs to initialize the crypto capabilities in a + * nonstandard way and/or needs to override blk_crypto_ll_ops. If + * enabled, the standard code won't initialize the blk_crypto_profile; + * ufs_hba_variant_ops::init() must do it instead. + */ + UFSHCD_QUIRK_CUSTOM_CRYPTO_PROFILE = 1 << 22, + + /* + * This quirk needs to be enabled if the host controller supports inline + * encryption but does not support the CRYPTO_GENERAL_ENABLE bit, i.e. + * host controller initialization fails if that bit is set. + */ + UFSHCD_QUIRK_BROKEN_CRYPTO_ENABLE = 1 << 23, + + /* + * This quirk needs to be enabled if the host controller driver copies + * cryptographic keys into the PRDT in order to send them to hardware, + * and therefore the PRDT should be zeroized after each request (as per + * the standard best practice for managing keys). + */ + UFSHCD_QUIRK_KEYS_IN_PRDT = 1 << 24, + + /* + * This quirk indicates that the controller reports the value 1 (not + * supported) in the Legacy Single DoorBell Support (LSDBS) bit of the + * Controller Capabilities register although it supports the legacy + * single doorbell mode. + */ + UFSHCD_QUIRK_BROKEN_LSDBS_CAP = 1 << 25, +}; + struct ufs_hba { struct udevice *dev; void __iomem *mmio_base; @@ -711,39 +874,7 @@ struct ufs_hba { u32 capabilities; u32 version; u32 intr_mask; - u32 quirks; -/* - * If UFS host controller is having issue in processing LCC (Line - * Control Command) coming from device then enable this quirk. - * When this quirk is enabled, host controller driver should disable - * the LCC transmission on UFS device (by clearing TX_LCC_ENABLE - * attribute of device to 0). - */ -#define UFSHCD_QUIRK_BROKEN_LCC BIT(0) - -/* - * This quirk needs to be enabled if the host controller has - * 64-bit addressing supported capability but it doesn't work. - */ -#define UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS BIT(1) - -/* - * This quirk needs to be enabled if the host controller has - * auto-hibernate capability but it's FASTAUTO only. - */ -#define UFSHCD_QUIRK_HIBERN_FASTAUTO BIT(2) - -/* - * This quirk needs to be enabled if the host controller has - * 64-bit addressing supported capability but it doesn't work. - */ -#define UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS 0x2 - -/* - * This quirk needs to be enabled if the host controller has - * auto-hibernate capability but it's FASTAUTO only. - */ -#define UFSHCD_QUIRK_HIBERN_FASTAUTO 0x4 + enum ufshcd_quirks quirks; /* Virtual memory reference */ struct utp_transfer_cmd_desc *ucdl; From patchwork Mon Sep 30 12:44:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831556 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1928204wrw; Mon, 30 Sep 2024 05:46:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV7bOKxJgb6KkeEvzyXEsJQEeZV8pyr7YkJewUs6ibo8UjBn8OkR4Zij7DXLRgMO1U4Y1JtXQ==@linaro.org X-Google-Smtp-Source: AGHT+IGoA9zQIMdh8Q+boNKO4YsEZdRo5F00W2B1cbs8Z6z2JXKxEdWgnt9211e3zWQFw5VrRCwy X-Received: by 2002:a05:6e02:1c47:b0:3a0:a641:b7c7 with SMTP id e9e14a558f8ab-3a34514af2dmr102794875ab.4.1727700385166; Mon, 30 Sep 2024 05:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700385; cv=none; d=google.com; s=arc-20240605; b=TGmdQE1eRbYRM5Wh8QhbhbW6hsWxEcK9mp2z2aZKSk61TBL6lScNBmwGOMCLfiSwUL Dyp2LIyJSWL33eK9RANmFdwueyO85BXmOR+BDF5xFYiS+PdE0g+MOo/EC0yWYqRvsLnu Loxdt84zv3jDiD++Vb6RPJY/eiO9vwlLhNQoGOF7Ay3movxKVZ8CXlHAo8Ffz+uptFEI mHKQ6IcSQywj3iS3GEgCmIaGsinkqlx4my/4pipl3Gh8vEG9mcva6/egnQntZ5VozXPP Ru75f8yUbHWacJ1GBxpxPJrX4ZLG6QyQfbiqEZcXgw1uoDeceFanmxAw/5jfJbzyrw6T 5uOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=jdNp2b/VeK3hO2gChIybxzHQC/swvtBzI2aD4vEgfYA=; fh=fIouA1n7fjb1FzRbtzAcjGZzwN8MHEtVCbe1gYXKZ34=; b=GVTRT1W1kDguZQE0TkIDXLMYwv++H5q53J5IIL7gZvRyj1soILNDFB1RUkZRais8EW dEhpYkNY7fi19CZmVW4aDiAd/5l1FzJJIHKuAgqv2/AU4SV+rCFAIHfp5ufxwjlW6FPY YsfOqhP6PaAUPheaGDL5OP+1RdzMvtjSpTW0Gh1cmemhjpFJCCD5cH9GpKzahnolwfnG NL/Xy09UzKCcHt/T+oMbShIqGReF4LU0ghjE7W24JBKvIKpfn5m2y1Wq9p4dx0fYLsfY 2OrV5yCHevx5JJcpu1nZxdZxlhR8b5nqie6vpWoH1XgTstvTbpztSOKfDP20KqROJlT6 DzNw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="N6zv1/XG"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id e9e14a558f8ab-3a344de999bsi36603425ab.118.2024.09.30.05.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="N6zv1/XG"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A41B88F2C; Mon, 30 Sep 2024 14:44:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="N6zv1/XG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6128C88E5A; Mon, 30 Sep 2024 14:44:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0680488E2D for ; Mon, 30 Sep 2024 14:44:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso38185215e9.2 for ; Mon, 30 Sep 2024 05:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700282; x=1728305082; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jdNp2b/VeK3hO2gChIybxzHQC/swvtBzI2aD4vEgfYA=; b=N6zv1/XGrVLcdWW9MzS+YvFvRBPTUDPWKByE9TFj8B4NQTf3z0F4WXvoFjw4TW8dRo lVmIYQP6jg3SHNQZ8aDf0CR5q504D9tUSuGXs7hEhBTMxzgBm0oShilbioDfCw5ZKqwB q4WMiOUb587Lg+CQbaoDbriHAcQC32xE3wRNZXt1KTSRhrCsQ9OX//uOg3h+Gdpc3/nl 0HEiDCp4LJ7kCKjrGRcIV3LO35ymGTMxGU/V5rC0UACW+0/Z7YYHlFdHDGhpHgfjn1CQ 5UIuI9xznu3voYjQlBXgpCWOChrfm8BWmmGgL0WjzSGRMxgqmHmJpgOgyysZv0KV8C3E alWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700282; x=1728305082; 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=jdNp2b/VeK3hO2gChIybxzHQC/swvtBzI2aD4vEgfYA=; b=oON5v5DgzLa/5TpwxsFrhif+M5W/VBIXFMnnUu65nVQSx9dGqB39EFTPP06yuO+SIr MPSX9CA0RQ9tCdcA/A6RTEpvMkh2Zdr75VYV9VQSUcWR0M4l6H+YMVGPouXPON5s8ZTR D7rR61jSKInSOnAZQ2P10fdTUXTGj5AR+IavGPJGU+G/12rfksazgaKxgxLkKbvu0Bbd UyrgfRKvfd37Luny6vpDul5d115tzLxX5GDPViRlO/tGsybZRZIrVrbnJHnPL7H7GKnQ wFfNZmj+Xg2V2uRGOz5lGkUZp6OT26s/n3sRJ/s65FVzCIT7+aFe+jHm63uFDvR2yFBe /yJw== X-Forwarded-Encrypted: i=1; AJvYcCXDPnXqQwQpCvjj9aCY8fyVLzCT81zsUlXtnxc9KZ84KvVVqiHxsLGjv9Nn9EMXX5KpGcLxj7o=@lists.denx.de X-Gm-Message-State: AOJu0Ywi2bl6kPksFTkj4LSJGLH5FORErdevD0pQNtW/dbCRrE14/tl+ y6Pr2fimfKRChGnSKHS5+W3uMYR4+m76U1t5uxXV1o/ofjfjwbmnDwe4yscFYnc= X-Received: by 2002:a05:600c:1912:b0:42c:a905:9384 with SMTP id 5b1f17b1804b1-42f58441468mr84840315e9.20.1727700282507; Mon, 30 Sep 2024 05:44:42 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:41 -0700 (PDT) From: neil.armstrong@linaro.org Date: Mon, 30 Sep 2024 14:44:32 +0200 Subject: [PATCH v3 10/13] ufs: Add missing memory barriers MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-10-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu , Bhupesh Sharma X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1907; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=VH31kyx3vGlBvfPTBzFzjs7QQX5ry7nhhEz711qZ8eg=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0s+bbVB8SSkZ6D6MqNywADdolMcXRNP1Jq23XD LeRh1ZuJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdLAAKCRB33NvayMhJ0XcwD/ 9zDVPDy5nuSY0on5API65AxLXKJr2YH4J3V2RFasE7kvtGT6R+67jYbXd78lopGcf1aqr85lsE09Qb LRz5N58/sOrIhEQopJ9AhNtUWlaYL7T5WcFXKcK/y04+NF8Vjo0nx1VqIzoUwEG2kMdZS6pKDYlwgm DRzFmpzXcn+WLsv1NLdG7xccWm4u7djIZn1VRAtyF3HV41WaLK6C06Qh9rgLAQCNRjvZXCZ0CXtBT7 nTbSI9hPoMxVx9bnFzrgPtdRztddteCVF9+M1SX/ogfu7AIqTDuTqD+51jcK7H+lt5N+0e68yCo8zO CBciB2w4vehbSEZBO626yHQBaQGYHlnCnNybCtisYOSVeY/vbg9ErGxMQgJpTdoXMNZ3x8/jmL9ubQ 9y1lTY1j9u8lYcAaHVNyaKhuOJ3cJ/eSzS0oPNs01rAzkCwAfDkHF7UlCgrgCmjJDBtD+5HPS/MbdQ vuJo7wcXyOS2oxe9jmbnEBg5CtLMiM2eRj5/w957vwJVNfrbaqlwR7kFKRFlBCPnEgVU1Upcw5ZPoL d6gQTOBddmKwmSw93Qo/LaUUWC+WPNGs1RHdw9MnQJZApUV3ELW22Z5FhLlomL6D/IQlLLQkwfqHvG h8Mk6ayqWBxKAVwil7gWuTy/K7beBOzZqgcQL6IZ/lDpJqGuVl27SiUjKJFQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Bhupesh Sharma Add missing wmb() and mb() barriers in the u-boot UFS core framework driver to allow registers updates to happen before follow-up read operations. This makes the barrier placement similar to the Linux UFS driver, synced from the Linux v6.9 release. Starting from the v6.10 release, the barriers were replaced with a register read-back in [1], this will ported to u-boot in a second time. [1] https://lore.kernel.org/all/20240329-ufs-reset-ensure-effect-before-delay-v5-0-181252004586@redhat.com/ Signed-off-by: Bhupesh Sharma Tested-by: Venkatesh Yadav Abbarapu --- drivers/ufs/ufs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index 565a6af1404..5d4e5424358 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -432,6 +432,12 @@ static int ufshcd_make_hba_operational(struct ufs_hba *hba) ufshcd_writel(hba, upper_32_bits((dma_addr_t)hba->utmrdl), REG_UTP_TASK_REQ_LIST_BASE_H); + /* + * Make sure base address and interrupt setup are updated before + * enabling the run/stop registers below. + */ + wmb(); + /* * UCRDY, UTMRLDY and UTRLRDY bits must be 1 */ @@ -861,6 +867,9 @@ static int ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag) ufshcd_writel(hba, 1 << task_tag, REG_UTP_TRANSFER_REQ_DOOR_BELL); + /* Make sure doorbell reg is updated before reading interrupt status */ + wmb(); + start = get_timer(0); do { intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS); @@ -1994,6 +2003,8 @@ int ufshcd_probe(struct udevice *ufs_dev, struct ufs_hba_ops *hba_ops) REG_INTERRUPT_STATUS); ufshcd_writel(hba, 0, REG_INTERRUPT_ENABLE); + mb(); + err = ufshcd_hba_enable(hba); if (err) { dev_err(hba->dev, "Host controller enable failed\n"); From patchwork Mon Sep 30 12:44:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831555 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1928130wrw; Mon, 30 Sep 2024 05:46:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW0j9bykM0oChmXO7rSFATp5nrqf84R/fRqTZNgyC+LJciyAUjSa9LbPflx4FzbsQE/oL/6DA==@linaro.org X-Google-Smtp-Source: AGHT+IG2r1UjAGAWb+yxBXZDp9vNCwXYvtJdaKVRkV7lcz4xZzS9leL9TIIjj02RpyR7uOQQR7Pc X-Received: by 2002:a05:6602:6d13:b0:832:13ce:1fad with SMTP id ca18e2360f4ac-834931d1ac0mr1102889339f.8.1727700373800; Mon, 30 Sep 2024 05:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700373; cv=none; d=google.com; s=arc-20240605; b=DnXNQ9rLET/RG46Hv5RGEjyhOMt2AeYmrk6KzFHOoBXeNmv+ogATZ1j/zhjsOtzPbG YWty9mNmkOQHatQxydy3yjubv/BCt93VjrKeFpPTmM2ATTbjnVu8c4XdTyqwYUmItvVV 7HcYeCKAVNnTh8SVbqNuQ0N5vXBADt9ww4yk0WjOBVqAjVp/KHocOYMa0u6kkiDYj0Ib swBYrNxZXvu3gYzhLOhparMeS7GV1fYE7Irb3CoHX099vxwvAgfTR3ne65ZSBfNZzC2a Kso4rguXU1rwOTEpobTKKmdStqFbl9zLIXb3IvynIbmuuSskcZpkd0SXWB2rdzqk+jDl fOZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=P7Qr1NvpSFK4CMfmW1KI1czUdn/vUv6eeDSFFf91Vf0=; fh=JIwzUb2Sy+y+k/RW32A//TyqsGULtbGfGsUMG692wSo=; b=A+TYlXwuU3l6jKQi7aJaJ5zdk32ssB4ts2U6xsafdGpSOLnJbxM1lQYHmGQprPQ/GF URu5r5rYVtWkExXdUkV/hzbDxojrSzvhpoTKtD1/wzZKssMl0Gkgwibd/t3Ah7Zol3tN RvXwW55uC1NCQUZGRuvObaZGDMuOy4QkhAVn5sOZCg4XCL0oUYMrWeVgwaQ/hnjFlMkv 7pSReUr6NsoZg2pVrYS8CRWj5kyLrhNwTnZ3VQleWu3BidXCDBSYGSMsJnE+KICeOWCz TVeCajKc6XInioE9wnsqWezcznfiCG1+1D8OWcFyizOcENZoAZPtRNOJz8TKqU4Ybgaq MGSA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HWGxyRrg; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d8888c5b33si3412876173.99.2024.09.30.05.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:46:13 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HWGxyRrg; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 38D8F88E2D; Mon, 30 Sep 2024 14:44:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HWGxyRrg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 45B4288E5A; Mon, 30 Sep 2024 14:44:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0FF5088F30 for ; Mon, 30 Sep 2024 14:44:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42ca6ba750eso25910345e9.0 for ; Mon, 30 Sep 2024 05:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700283; x=1728305083; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=P7Qr1NvpSFK4CMfmW1KI1czUdn/vUv6eeDSFFf91Vf0=; b=HWGxyRrgcTF9C5fxYddXAH6GBFPfFkDYrj4sGcZ1f2f4950z71pDUaSHNy+H8E1UrD alK7oESOwEgbEi4gyd/NLPQZAjs+WOpUB9Zg6r/9Ki/W8Q8hVpkrhj2BYK3DBiyAi4w2 MNF0z7JoLby4lIaMXvBc80Ons/s8XNOthfSDb0gWzHTAGuC66cofrDbundsgpZNdqpLh AC8KhYkgCsDJQtyTgf7lPFbfbvtNUcjzBmYg/7BF3RgRYfGmrKGbCdnxN3V/bbxWVYkg Zp1E5hf5xh1JoC33VZ2eN0ZSdzPlZO++MqrZpGGbYTabu0YH9xL0g8AxguvMAkqpQh6H 0gkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700283; x=1728305083; 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=P7Qr1NvpSFK4CMfmW1KI1czUdn/vUv6eeDSFFf91Vf0=; b=LevnGx/p1wrZXQqbMLcp5DuPtU1bgluCnOGBrv01D5EfiJvf+O9UE+8nwLXwZNAo9j yExWH/Uxju7pOdoR/qVCByzad2vJt1rxii3MnGqMiNLayC5NBD1O56Ac/2CvNV4NCBwI whUqsyuaBVpTogAeovTMyDnxaEydf13YkjU6WqF0BYcazM/OpFLT5zxN6dcpi1CDLoU5 YrMBy5CA+m2LJt4pNiqFuTP4EWg7s7ffFM0UMxgUdH7K+jgpVVoSlLtbNPGKKMhCfFUn h+OpXgDtVNKBgVyY5WmFGyfYApNJRuuDd915RNBTRuHli7tJYDw7Fzx0H7lUpoG3/h/g x4nw== X-Forwarded-Encrypted: i=1; AJvYcCX/PXFvwl/JCXI7XjnItfQasWaZikdT4AVBHUiijp+WsUZDUNuABDjYqVBn1V0IqDaS6WesElk=@lists.denx.de X-Gm-Message-State: AOJu0YzmIFVuzZwEaix/7GV46H3fnpqzxqZR+ziZFMNJJ3NeHq43GwyB VENuv2gyHYfTJP1TopAD4mukXyhORoRjvKWXuUssGedzeiMHPNscq+M3VSf9hak= X-Received: by 2002:a05:600c:3b87:b0:42c:ae4e:a96c with SMTP id 5b1f17b1804b1-42f57fd275bmr72153005e9.16.1727700283493; Mon, 30 Sep 2024 05:44:43 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:43 -0700 (PDT) From: neil.armstrong@linaro.org Date: Mon, 30 Sep 2024 14:44:33 +0200 Subject: [PATCH v3 11/13] ufs: Fix debug message in 'ufs_start' MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-11-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu , Bhupesh Sharma X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=714; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=/e+BvndSe0yhkT9enKL8SNJ/+EUFBp5cMPXLsBJleUc=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0srZNmpJg8Vyc5K+5r1yyhisseIRqlu90hq1L2 Ah1uXr6JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdLAAKCRB33NvayMhJ0XTfD/ 0QgV11YWu6f0A+r5bJgXwXrBqAM1Wyhe+JphUYf3qFM6N3NjffRLg/ZX2scrOZJuuph0LLXMckQqZc jBb/piMYQpzI8b6GdaSizfkPdRHrKaUOXnlWoLg+uiRLQ4Smx79H4/uWPQj23wb7nFIlpMaFT9SsZ1 yCbw6kBUjtz8zI06lLj/VvhZE0jwO4qJnwZj5TNgUPTQ+VodiBBNlonFlqIn90tlp0ZGomcaE37hWx FwPp6MypGbwdkdwqX/QFUCUBG36o6eyJpBxpgwa3+afT3N2+DQYE7DRGO/0XOqbrJWXTNJAtLT/SSc WHQi8+XEcdODj+CVrBREEzHNBt7WtZLVPA+S1i8Qg7qz4ncGTBDmF5GfeJTF3E7LiR+s5J/CLzDCN/ uhw5g7ekOPd5fOIr1ZnY763PxPnXGZ/MbbJULg8a9HADyjebOuEZSrbfAvJ3wKz8LwVNA2sinoMX8a utu8rsOnBYKpa2JEAnSxGNgBJkb4crnCnjx4QmKOM8jCPlle0dNTufZ0D4MIjyWIGxgKRjUaTvVW0L VNOdzxJG+rHmO5FoI7UIbHbOsw6B90CqMB28ALldkOin5qbWVKKHw395igeihFTbEU1XN9myqQDYEU APEUvvIEaSNT5bIFCH516mVturqsu8lJE+fF2TM0LHXsi3P5ndFrn+zoZC2A== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Bhupesh Sharma Minor typo fix and rewording of printf message inside 'ufs_start' which announces the availability of the UFS device. Signed-off-by: Bhupesh Sharma Tested-by: Venkatesh Yadav Abbarapu --- drivers/ufs/ufs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index 5d4e5424358..d2df5c26f76 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -1925,7 +1925,7 @@ int ufs_start(struct ufs_hba *hba) return ret; } - printf("Device at %s up at:", hba->dev->name); + debug("UFS Device %s is up!\n", hba->dev->name); ufshcd_print_pwr_info(hba); } From patchwork Mon Sep 30 12:44:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831557 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1928270wrw; Mon, 30 Sep 2024 05:46:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWiV8i13wHGmoPua88lDg/kgVtjrqmWae5oxBKAkc/wdRSbfuLbyDUMHdZjHZ9gxFqUtL7VuQ==@linaro.org X-Google-Smtp-Source: AGHT+IF9p8EXX8svlsTwu2Do5u6xGU0K4R6ChvhiQMN5GcNiuZqV6ulHlQW24zeXX0TH9UXgKWaz X-Received: by 2002:a05:6602:1653:b0:82a:2ad1:d622 with SMTP id ca18e2360f4ac-834932868d3mr745099139f.16.1727700395825; Mon, 30 Sep 2024 05:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700395; cv=none; d=google.com; s=arc-20240605; b=VwCfY1e4ZGQ5WevX4tbz9VKVhnQ9ho5Dp3iFbHaphrWdwD7wB4jUwgBygo+tOlTboK a5qCHEVD10EYmIZly6CLpg6HlWL2M9xqelFEhbQIqKKdw4hgaPQPWN1tM1NlybuM9SDp uYKgeA9xpRYIEYUaSJV6nNhjj0qcufWWtrIUjojQaLyGtO13UWvrMqoSbdcenWN+x4d1 rYQGX890Y7PldBLWtoy1lgcA0UUFhw91pXK/DnQI9mshot4zESwfvcsUg4Q5NFCKrAmk VQ45j7Ss7WIEnQVvexvsHBk/Rh22klXn/uhJ3L6HEBCW5DCScrP7OC8kJZ/Jy4d/ATlH 6KPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=rRQw9hErepV7DnPqqgrdzAG1cgOdyL90LsW9f/pFcaU=; fh=l4Z/t64/q2SwUG+yz15behX4dMl+b6BnuJjAbt2jzrc=; b=QF7bKYowp1gMieIK+u3N+1yrGYHEea6Mzzntf0Ax41frrMiNztt/DkfhOWozGv+jA4 PX/tTIDZvz+wzGwWqL6M/H5OqhRQ5mrhMRb0zuPbXeFC5po8hq+SY6iNmDENubUM8/Vn urfXpbSAwI+TZwS9Ik//Ho08yNqfOVnIMYkPc5yuumhQAY5/9iRFeXqE7eSAVr3X5PYi PHGzTwo9y5VEnitAxYLWPFoaKjK8sFgVQt8oWSpCC+O+GXOyN3Z/xreRLGWM7pA8a/+R 0hVWEk6W8n2VMpexq5fvHgV7M4IZeXtGJceUxwCr0HjzkXDDqU4+Q8Matctcz98kkCgC mBQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TclONR23; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d8888c5e33si3654382173.108.2024.09.30.05.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TclONR23; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 055B588F33; Mon, 30 Sep 2024 14:44:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="TclONR23"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42FF288EB6; Mon, 30 Sep 2024 14:44:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4662E88E39 for ; Mon, 30 Sep 2024 14:44:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42cb806623eso33261295e9.2 for ; Mon, 30 Sep 2024 05:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700285; x=1728305085; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rRQw9hErepV7DnPqqgrdzAG1cgOdyL90LsW9f/pFcaU=; b=TclONR23Zs/Y9jCmmznkjl0JPcxZOoIIiBcRnDt4oHTSPbPJCIGdOfgOCtQgR0FOZ9 ZeNq3/OAIVFbOuWV0Ua2aPuSTsT8Wx5W0wINnWq0NyzGIsPAAD32nlPFB6qk44Kh6KVd Tow5b5WV3WdNeVnLnmOXeU0a32RdgG+Vy3gzx2USdi9JwEODUSs+K4rcuoYbsTVgAS8B 8RD8xzKbKg4/sak6Mf/Y/FxamrxI0y2VLmDqVnjLFFhjHlmZwc+XeSLFlLRDxCB8iwfP o05S3qG/UXlecbFmKOTRtNjvsdCdUaV52KAwg9FSxHqfPm8Y8nu/0bHx0+PzPrTNqBUF 1VLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700285; x=1728305085; 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=rRQw9hErepV7DnPqqgrdzAG1cgOdyL90LsW9f/pFcaU=; b=JkLOp4P5X3aKGUAhSfLXNnBFOXynyZWPe4GaxksnUF3Ht6Aho+HfU5xlyj2Mzzpcm3 ngXv7w96fJXPoEy+OkasbVk9S+0LdvzZHuRI1SpWJMuc90MR97L28hC4tuLr1iI8yVBY kLq8FmLKZYe6lysaHpUra9VLB+e3J2C0Ad7amzZBi+qLx0cV85W7Ro3HMerwkWr2TGDt h6UYY/EFrDfwbnO6U6ICw5kXW9bz5UK4fBqCSSL3SY5AnBrn0V32MynLwrDsA4B2lFL8 diqrX8D2tI5aMCwodbIBDsfY3osb+7FlchXk/LFdJvPDz0A/ZWKFshRTDbyG1RFx+xEH qgRg== X-Forwarded-Encrypted: i=1; AJvYcCXAnsC/Ji5dFKryD14VB979oJn/geLpnaUIR1KbsfnWGpNkq/Q8/lZ0AizyzSj+DqwN/KHZnA0=@lists.denx.de X-Gm-Message-State: AOJu0YyT9iQU3odA85l/xwF/urXDM/xgWTa8MEIkE3IqP2oemOIZD/HP Y96vtljf+IkxXLJ/cvl+qN7/FHI46GISEk7kj3lgEcP1cOgDo7tJH9JktjqNBhk= X-Received: by 2002:a05:600c:3ca6:b0:426:6710:223c with SMTP id 5b1f17b1804b1-42f584128f9mr82071355e9.9.1727700284651; Mon, 30 Sep 2024 05:44:44 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:44 -0700 (PDT) From: Neil Armstrong Date: Mon, 30 Sep 2024 14:44:34 +0200 Subject: [PATCH v3 12/13] ufs: core: remove link_startup_again logic MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-12-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1781; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=JhT/11URXvkq7wQRb8O38oqRy3fHS9dhagU2llSpbGo=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0twtymCWmbEwEktWA9wyh8EWwMT/CRcvG7CpOS RQVFwG+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdLQAKCRB33NvayMhJ0e2AD/ wPmwgz3GwoIrQZLthMRcpFZNVlj3CCyNEIsYvAYkhcFShYYjiLKOpQLQhXBM4EDoiX9Hj2cbpVn9Eb pUurEm6ooHZViJnnHFRIC0lQ6VcxWS/26LL7wwINDWX9H+LhtEH121SzLQ8HcuXPj32OvQoAPaQZMe htQxeKJMMqp/lkL9RZA1JrgKyZf6hpcWTUdfXIYJhKK8hWk7TggujOgU9YbqgCaPvj2qBvlRv83Vsq UQEzKX//XsQcwcm9mLfiorx4xODYE0IXg1st3G1VqMPWu4hm4nbEn9kDuSItcoDSpSk0X2eybT+5/z fuKf3E31zEYsWu9txk41c4hrEGmfh4po0UwNLkTlhRnqqN9C+Q9+VeWTXS9O5fykxMuuMFZo27FNvG zHQvmrw85I5omvUEKvtMUWJAOLcJaz7RUEzKajsbm6GVDYtzbSAZRePpv1NLIS9UBKbmNELml7LQZ1 Ta9Y+kzsKNRlPsO1yc8Y6A2DslOKeR1le1LAQcGZkJJpKZEeFNcoEsSoiXiqKMCWvdFjoCcUuzWQUD CthTevpugxF87Pb0ZxV9aLrPW7BkfnbphQT5SesoFdQ0FAJlT+hyUp1njZafLoN/wNDBQXur4lcUPu Wj4dWD8Q2+HiG9Ic5GwyMkTfA8jorPBQI18paDhnCULDW4iasgpsds1TDfGg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The link_startup_again logic was added in Linux to handle device that were set in LinkDown state, which should not be the case since U-boot doesn't set LinkDown state are init, and Linux sets the device active in ufshcd_init() for the first link startup. ufshcd_set_ufs_dev_active(hba) is called at ufshcd_init() right before scheduling an ufshcd_async_scan that will call ufshcd_device_init() then ufshcd_link_startup(). The comment in probe says: /* * We are assuming that device wasn't put in sleep/power-down * state exclusively during the boot stage before kernel. * This assumption helps avoid doing link startup twice during * ufshcd_probe_hba(). */ we can assume the same from U-Boot. While it worked to far, it breaks link startup for Qualcomm Controllers v5, let's just remove the logic. Tested-by: Venkatesh Yadav Abbarapu Signed-off-by: Neil Armstrong --- drivers/ufs/ufs.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index d2df5c26f76..e34e4586224 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -462,9 +462,7 @@ static int ufshcd_link_startup(struct ufs_hba *hba) { int ret; int retries = DME_LINKSTARTUP_RETRIES; - bool link_startup_again = true; -link_startup: do { ufshcd_ops_link_startup_notify(hba, PRE_CHANGE); @@ -490,12 +488,6 @@ link_startup: /* failed to get the link up... retire */ goto out; - if (link_startup_again) { - link_startup_again = false; - retries = DME_LINKSTARTUP_RETRIES; - goto link_startup; - } - /* Mark that link is up in PWM-G1, 1-lane, SLOW-AUTO mode */ ufshcd_init_pwr_info(hba); From patchwork Mon Sep 30 12:44:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 831558 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1928303wrw; Mon, 30 Sep 2024 05:46:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXVhAcyBC2k19oSbimT8xD3Kgv0vUqDdWobVLvMEewvl8xq7c1GX8cvdrcZdz2vldCWOzlw2A==@linaro.org X-Google-Smtp-Source: AGHT+IEI7ZFlf/8J+4UqPPyCQ/KF0Ezr1MMAlQUAFbJshCxrUcmaKTUC4MTtok0CXnpL3U5cyHwS X-Received: by 2002:a05:6602:1493:b0:82a:2791:28e with SMTP id ca18e2360f4ac-834931d11b0mr937164739f.7.1727700405225; Mon, 30 Sep 2024 05:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727700405; cv=none; d=google.com; s=arc-20240605; b=EoeU+/GYCRFAoVHP5xxtKEPobVzHOLdfmcBz5U3f8JheynmgHNd7XsnYvZDYgpbRTp tLWY30WrB8lBU94KGZaRrcd5PXbjlp+V0i0WtZdliCCCIcCpZbF5Ccb4E6NNErPKbNL/ 2vZEDdKAIGdYSXHQzVBwpASUMWKBdmXXG23vzRD+j/elN63prnuHq/QKZ9HV9NWtQTQh 1BHcnLQwd9eoyKUsOJoQO6fWbneO4bWIp6Qs2Se3OK9b75yOtmrDGI1FQGFTqssB0BCw gbN2iZ15SFi2wVlHFlBOxPIycPdMrbg9R6ZRnrtDR6dt2DHk4BthbAbgAuSr8lyWcGPI Iqkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=JeLKja+MavrsLxBtauv98C99CzvsjKPwivvG+QizMjE=; fh=qnRZd/dfbcI7+0+76IbqTew1qkQrteAJkLLiRj0hxHs=; b=M6SiRdyxsG5two1xBp5bPv2jqhJ9uoXXaAfKAa2WvVH2ScuxkESOgUuqoLaqyNH58M CFSOyvMqr5ZGkwXdl8kie4DTZSPwH+HJqNedOZPvO6p+I248F4mUYSdrXTuvt8Nofr8d 7ebLjUCX8pPzCYzad8T5tQdotXU6l1VEk1+PWfEn5JV7Lh3PZ6xLqAkE+LvYe+06/5ZO zzfKB51h9vzybMTjuvRfh/jl7Kaflh1iGsWJM0YGaS63vNPuu3dJq7xi1dj3pKRlpiad BJ9pxUiFOD21o4VX6xPDgVf2957DTUh7JMOX/wX1EG+9jES2fHjg2sgVwV3PupI1FpIo gBIw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="efyRG8/g"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d888900015si4044536173.194.2024.09.30.05.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:46:45 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="efyRG8/g"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6D0BE88F3C; Mon, 30 Sep 2024 14:44:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="efyRG8/g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3083E88E2D; Mon, 30 Sep 2024 14:44:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E90A988E63 for ; Mon, 30 Sep 2024 14:44:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=neil.armstrong@linaro.org Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso38185845e9.2 for ; Mon, 30 Sep 2024 05:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727700286; x=1728305086; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JeLKja+MavrsLxBtauv98C99CzvsjKPwivvG+QizMjE=; b=efyRG8/gTcJzCX+48zhg2Y3cWUoskIk9QosPXJAudNVg3Bkp6Ka9WUL5WgYDRjwWJm YfM0z9m/GdzSEWZdezQQewKfnWNdVOkUHjqV/A4HES+53MmCPkFwUAVcrq0Y/UticcZ8 ApP23NQWcANpRz/Gqb/4Qx6ufMszSje3FouSkFIGps1SAS75Z8xJcRl85exrCg4ZG1Vf nSRy2dCM2k4UmWjveVKAeOm/yBEbqEQUuSGV0alHOS9aZZUPCsER0rkvpsQNbabqxaU2 3m91EAu5yx9C7qUvEPQDA7zAm6zWQdou5+V2AowWexMH8BkzMhou3bceLoapeSR1pb9A TAaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727700286; x=1728305086; 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=JeLKja+MavrsLxBtauv98C99CzvsjKPwivvG+QizMjE=; b=Ifcq99kDNzfNKTdVGWVHmKVjlU3px/VFlnY0geBUoYx1/R06cWusshFH4eK+ZVQFo5 shBt3Zme+N3SiC6r33FSuIW1kzqcQZYJmTHESmOaPbFpMZ+bC7l4e8bwkhUKhu5Sc/8M GpIMAD+0wM5kqte8Ov4IR7/06hCfnAb51WAP7MVOSrIkTGfj9AknxCiJEhjkVO2kvZWW 5qF+s3spP/tEtJMbp7HaL+Zfd8yCx8dEd/E8VALTY0MQE717WtUaZzFfU6P+yU7VNE9c KSqJfOxvmAhi508oO10yqyc6LtcmDDC7V7acc2yYO6tx67d3+Krm5VZ9HnWfT0iiLCjH 0Tng== X-Forwarded-Encrypted: i=1; AJvYcCX9dJdI/PC44Ee83pv2xSS0PSrS2E5rLMIPWEQ1T63+TeyOaNFee6hT0VBR1fhEb2cCwaSiAy0=@lists.denx.de X-Gm-Message-State: AOJu0YyG/OVYF7nx0YzFSTFNl8DyD43NI5Kahwjo8qs0QOgOyGLJBbxC tzuXS4Tgvji4eBdLdhU3KVPjmzriidJmtVQaeCwhtUWg9NfZ5N9BKktZneWE8fc= X-Received: by 2002:a05:600c:224b:b0:42f:5ca3:d784 with SMTP id 5b1f17b1804b1-42f5ca3de33mr81510025e9.14.1727700286362; Mon, 30 Sep 2024 05:44:46 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a36597sm149362745e9.31.2024.09.30.05.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 05:44:45 -0700 (PDT) From: Neil Armstrong Date: Mon, 30 Sep 2024 14:44:35 +0200 Subject: [PATCH v3 13/13] MAINTAINERS: Add myself to the list of UFS maintainers MIME-Version: 1.0 Message-Id: <20240930-topic-ufs-enhancements-v3-13-58234f84ab89@linaro.org> References: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> In-Reply-To: <20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org> To: Tom Rini , Bhupesh Sharma , Neha Malcom Francis Cc: Michal Simek , Marek Vasut , bmeng.cn@gmail.com, u-boot@lists.denx.de, u-boot-qcom@groups.io, Neil Armstrong , Venkatesh Yadav Abbarapu X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=815; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=teMxOUDq733hig/kyMWLnRxRkGZD1mGA8yJ2cdp3EP8=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm+p0tE8kM1kM5SaB8jqKWZSv+gqJmHPdsxYwrCoSi sytRIV2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZvqdLQAKCRB33NvayMhJ0XngEA CBUQBpop4DftgfX7HjtPsQTQvZ7udq9ilQZd9jujFrL8AK9RfiRxPrvpQzyDJUUqnevrj3jCOncgCS RSmeN6vN8KgU7b1N/hSkBSLm5TunRygPRmDuUoOdUVIB16LKMzfD4SvJ3YeXmROi0OwL/CuPe8SEOY SxmsZFWt9WV/e9leahat9B5sIW+M0vm7pLFzSbZYi+ye0l/AROYgYnxhJhv9+dpAMcWTee9fSaEZSM 0ZwPhkGnCRxSo2OXpdMQXU0xh7rYcq7sGQcF7wJu5Rk1xgrfNeIRiMmn+wJoj1/YvGQaFKwDtb0KsZ TvM0Fn6GCyAGYS8KPQcPLQLQS/JAmk6S7JcNawy7Okp2TDhA448F/Fx5ZjZOTwQmwkASJSUtqsXmQ/ UBn7sCwP4UIryfKbtu4MyN7wF2/lKFiR3R0nXWlWty85agRVNWHALTD3Js5Xfd7Lja9dop2VsESlYi 5iEpbbPZmrIDasRu1DZYpakKCUfwxkHqIUFqSFK8FEwmUVCkGKFF3WP2iuaiK3MYD3HuaQIfYFfPCb 4pP8FGXV6Y1P13FVar4Czp+SIGKW14Alri8cxNNhgHAc4+LffN07Ar/8O3tg/6jWAMlMyVv6PRKjy4 4E3Q/asG/B9DrT25LMpJzmwkZjbDfcJyH4JTuJnRKdDgr6Wqcg16WQz72EzQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Adding myself to continue Bhupesh's work to enhance and fix UFS support in U-Boot, especially for Qualcomm SoCs, and help review patches and maintain the UFS subsystem. Reviewed-by: Neha Malcom Francis Tested-by: Venkatesh Yadav Abbarapu Signed-off-by: Neil Armstrong --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7ab39d91a55..14809c057c9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1707,6 +1707,7 @@ T: git https://source.denx.de/u-boot/custodians/u-boot-ubi.git F: drivers/mtd/ubi/ UFS +M: Neil Armstrong M: Bhupesh Sharma M: Neha Malcom Francis S: Maintained