From patchwork Fri Sep 20 08:00:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 829852 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp704783wrn; Fri, 20 Sep 2024 01:00:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV0ymXsCry0pd6PqsJdqJ9w3W3Oo1oJrtX+52FtCvcxQ4L51lloKqQL/tQhs+1a0wRhWjtqTw==@linaro.org X-Google-Smtp-Source: AGHT+IFDNg5TTKXY04eHyUuSxuhkL00BtkYzILpPJL+ZW8lxV7qfWKsif/km2KJcLl0xlcdnAslm X-Received: by 2002:a05:6e02:1fcd:b0:398:a9b3:d6b1 with SMTP id e9e14a558f8ab-3a0c8a24203mr15329815ab.12.1726819250403; Fri, 20 Sep 2024 01:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819250; cv=none; d=google.com; s=arc-20240605; b=JRNM8me6lwhnOMxpXdpm9CkjAE1SFQ9ine8IOaHjIbhYaGl1O0nMIfD4OMyZvlCLDQ WL7g2O01Ysn/If6i+RFR+0PpB1qAsy5G5Rv8o7cmbZJST5mTLKEVUJwJujHvTsoiygqi OU1p6jS0ubSkdYIcQMWQkz3RWBhOriQ/Gp0ZfxDlgnsip187GwWz9Ld8kvE+KFC2l/5V ajkeXCT8EHYpOTSMm4MnO8eT01PJ9lWFX3L68n6aFsY1+36G1dglgfhZu63nUvRBdsVq CcUz0UWnAZhJn4WmzWFcpI5eWcAUnZXtbHpWLNK85sUuherpSQgzX91+HWxt52fRGxkn KSYA== 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=KcTusxGqPJQA7dqn/yE1Q1x99w2q9yB2ijvXpv7Lkes=; b=MJRkyh+cpT60T/GvwDSrxJ8d5ErjFtGIGUCSQk7mr7eW8EEH8cU4PG1sXf2oJWL355 RPdiddswe962srdAGwp2U8GI0Zd/xeIReozJ1RyTVxZep69eWFXlaWwH7laZEwxPDmci 12xeogLxU2bG/5uMqosjCXH/lmsaak31l/8HWSJ0rMEXcFABy4PJIbtfOp+GKlyiQblt X7AH00TBhuzp9FMY3dnAmQzdCRf4q83vhAg6iqr88aL50Ji10YGLMCTRiUyAjHlaerCh YwXSF+eF8urIhRFjdgiyW1oyL63fWhUtRrcUPU4z0VZS9yML8mJk6EZAb5MEJUjNT38e 7SAw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UmEbxmOH; 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-3a0c9f33844si5758585ab.7.2024.09.20.01.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:50 -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=UmEbxmOH; 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 75D54893EC; Fri, 20 Sep 2024 10:00:39 +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="UmEbxmOH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 01591893CB; Fri, 20 Sep 2024 10:00: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-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 0DEAD893D2 for ; Fri, 20 Sep 2024 10:00:34 +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-42bb7298bdeso20901985e9.1 for ; Fri, 20 Sep 2024 01:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819233; x=1727424033; 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=UmEbxmOHEM9igitlQUyYNK7Dd3TaIC6ccFmzebx66edn2boICzTWJtiOv2kj2kp2wJ nSJjXeRvXGDtpc7u7tKvhV/aoUxbRxgmAE4x2LV4qd6qCZvaGptpYpkA3L6bNGNK3dWy 9/D26MLxpxmJllHinHuEbRFMPNIAEM6AtkG+I8oxr4YH8YLwksqD7ACpsaAcdMdvFc4t mSSsX2OffGAXdyAlzD0q26OpAMPqbhoaj3xO2VuQ3ablUj0x7OaoY2E7KGzAFUmhBKmz sbHGKJTDDD0mzra4d3sn4v7HwWJBbunuInuqYTZiqjgJzZLcGZ/cTra3dUbGpsaQxHXb CCEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819233; x=1727424033; 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=aMewK3l7wLehiPRdhlmMKyMAe1tBgDsFYypH39gDDvPwSjJnlIsbZmycSv5sH3i7vW msFGeVKvHNKKTxE1baGbq0uBjqLeVC7Lc+AfF4SvrphM75fFprcQAv9sSeA3dUfX0Ybz HHphZcNFfxsi6eaKu3ruFWv5LE12QtTuQhmzp/kVYjmWIS+/S+8Z7rv6ZsUvRg7o4zfI 12rnMehSjozB9dlDMyBMzoa9Uf3VnLyJLJ5guwQQXq0mw7w6llnYkgbOAaapxWH2zg7A ZedeUOxgkymNHTiacGEO7b3BxL92Lsdi8V5ISBoPyYK85hH3BFdqp5SroWgnKCBMe0tM kgSA== X-Forwarded-Encrypted: i=1; AJvYcCUY+aVOgTTYE8T82KgvRUMBXFyzfO2a7OfLtMTVO6DQfwiOOJDVDvsrNfXZJDY8z10xsLlrkXw=@lists.denx.de X-Gm-Message-State: AOJu0YyvGzLNJu0UVr7YsOGEWrblALS2fNE8uYDzLlzQzQrjHAr9QsIN LKB3no37zvs+gGlX3I295cLEtHv08vGUs/BjI3s2PJSWLzwn0/T0aVvSx2h1tGM= X-Received: by 2002:a05:6000:1fa4:b0:378:8b84:4de9 with SMTP id ffacd0b85a97d-37a4225334cmr2129264f8f.12.1726819233353; Fri, 20 Sep 2024 01:00:33 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:32 -0700 (PDT) From: Neil Armstrong Date: Fri, 20 Sep 2024 10:00:22 +0200 Subject: [PATCH v2 01/13] ufs: allocate descriptors with size aligned with DMA_MINALIGN MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-1-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SuZbrNNc2ZVzUdGM8J8fxG8xUbtpb8yvsHbmCIg YwgrbC6JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rmQAKCRB33NvayMhJ0cKBD/ 9qOIjUr0+fNV0653bu/r3w9GxHo8WsQeuTLldUmrvpYDeP4VVT8wSAFFxUwKiNvyv7CqKO2CFZ2cOc VZahI4gzjbGxdbRC9wB5y9iO530KW4Up2Mf5bXNMMSavkquufbhVF0LGtPsEPjlhsdcUMewRGDv9xm OZ8bdckVcleoWXZrYzU9Aq7+RyUbeL7fjL71hayZoAos2Olk1uk5DbkXDUKBmpUF2GXXx/pKO93nJr sLVcmpJ9nBrpWPnrmS575yCDZulNBS425mycOEK63u5t69KhkOPGUwSLqNwJPJLCLHArB2zHmnY/kx 9jAjniG9KYJuGv15i1Xnv5uUlivJgRVevPTXWtP79h30j0x7eJXbkPzpfztVp8U4idy7IvrE7m+cGY H8sUzL3iPaI3N15vEEDItNNx889quTgVYasTZrCVNyIsEueHDG7oN9Msr8sMPrT13cFgq4wFhZKj+V cSiM9cvJClBepRlIDRc55Fb2Y9FIppcyxx6E1v9oobTUhiA8kcxGuU1YubTuo5UCmIBE4nBwzGTjJM RbLSaXz6U0zPc39eNx/EeVqbnOYmvncU1FpjoKo8O3AYh8MR6RHMxB+v/lsflBs1Iqb/rrAaa7M4cH dNY838CYQR0a5GQ/PffDYKOMbRzbcJAIsAJ97HlHyl3+R+rwxaJnv+BR9IPA== 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 Fri Sep 20 08:00: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: 829854 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705015wrn; Fri, 20 Sep 2024 01:01:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVXER1HwQSb8HPTsKgiffP70sbofEzDwxZOp4C0RZOKzHvmO/z0p1u0uH3D8HpA2kCc6G39ow==@linaro.org X-Google-Smtp-Source: AGHT+IH/8Q7+GAd2/fiLU3oX1nTtDm03nV/iIli+m3d6BzOIF9LbGwwLlsT89PXOc14TqZrEtVC8 X-Received: by 2002:a05:6602:2dd1:b0:82a:34da:72f7 with SMTP id ca18e2360f4ac-83209eafe4emr218686539f.16.1726819283896; Fri, 20 Sep 2024 01:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819283; cv=none; d=google.com; s=arc-20240605; b=ZZRESrs9u5/bn+b/RIfBj233x1MAtujWH3NKUNbk4gc628PuyB8jiZlzHRasWOnLgg K3TCiOaEhn2r9FV24C8a6k31sArPMkQlSxyCqH/5qX9+AQKxn41dc6HF+u4DiCR2c4Xz xgTtseCvIf37rVrbnvcX8iZ3XqhnMJeaBq53X2tTknv6mW8oqF0osMFQbS5eNmxKSCYs qMnjz2y0jZnNjyxZRisO1rbCd1Wr/KxY6zXTHPGE2AdClral8RvXHDGFIlvaXMSz7XCN UwjFruVZqfVwrbmZFZHVdk/RAoTRXmQP05KgPD/zq/tmXH5A5kMCcOf4UbJgC4QEkpA6 Tyxw== 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=veZEYC1V+GTD1UOzVnRh3/7JmabKtmcgGOiCxogpoqA=; b=SXnkC7JPjwvZEYjTV0gwrpQD779efG2jjoJ8nxlhI9aF75etQp+v3U+E8SCmJ6I0CG KYEwHd/LNJJ9QeHQnl7f6Ph3vCGAAe61CUdSjpSDGuiPB1XGO/Avef1Nu6LBb7uJn5+O tB7EirRAban56SWQifX4BRymnGGabyJRU2cxAx6Nwz3wtyPFalbeX2v1RDMbNiQ+e3qo SUyLafe+gjDzUFNDpymUStpAzE89g2poAgrf1lFMgUxm3Zxcgq3c4j9JW9HRTC2sFlTM CFTxvz8/6giiQYctjzo41ggYFgaRKQ9/9rk6YiT4yQjzvhz1MqW3acpSFHoC/XTNwB8T j/3A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zEJgR7v2; 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-4d37ed4cce8si6963962173.175.2024.09.20.01.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:01:23 -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=zEJgR7v2; 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 516F08940C; Fri, 20 Sep 2024 10:00: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=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="zEJgR7v2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C0146893D7; Fri, 20 Sep 2024 10:00: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-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 C573B893D7 for ; Fri, 20 Sep 2024 10:00:34 +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-wr1-x431.google.com with SMTP id ffacd0b85a97d-378c16a4d3eso1792431f8f.1 for ; Fri, 20 Sep 2024 01:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819234; x=1727424034; 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=zEJgR7v2msSSDKn8FBPMqZtHFqUpDCteH9F0jmNNwOqIYuu5aFAT3lRqg9qf4PgLSU Q6klSyjWIHEfaAFMr/Rp8R8ueExvBFhTr3zn/FBWDnOtxE2eEmhjF8Gr8Y0CIjIJ4+BL lUCwfLsN8vlKRAtpQzu/SAXtO3Z5yPH7D0r/g8w557zVgyp7Zqjt0H2JG3s6JClxcX+G S4KCPD6/eY2sCNHXjotLbBFv0stNLRMBS/edwHBz62egbkWEuLH4Ax/KxrYlgCzQxuOJ 77rYXBO2MGmtwzZFDQlPjhwZpqCOP5MC2QiNQFPylRLKATWEWuMB9uTAC5Tec0+xjccd KH9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819234; x=1727424034; 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=YFsIxZNdFo+JCQjp9LMMYOCgfr5cBwpi5HuKR4NrIAh+z3zWaCPeE83pOMPkoMwsA6 nei/AnjOua9tGN1wv/d+IphyuSY+hwyqc/AywT20SjGXB08e2kk3Ty5Q85K3iAim4EjD dib2zIaS2+9KdpU3HOy38SPiQC5q5cVYSbLNB5lkUeUHY5fF0qhhs2ifYbeQHmSQeUuF Bc135tWNad22/ZGr1I84ZjS7hAWJp5fWTNeZaphKkklfT6ZVGzDo3QWgSNdjBv4YZKcp gJvdL+oEWjn5NbHPHK/CteYSSUQ2G8FgMUJUCbZUb/RuMopxs5zcNipY3Ltz38r5T8aO c81g== X-Forwarded-Encrypted: i=1; AJvYcCV1ALbHTxMson6Sh1X0K6rsCY4M0GUKOUvdjxk9MJcoGRZpCh3Dnvq9DbWY9NkdNio6y5UuVWM=@lists.denx.de X-Gm-Message-State: AOJu0YxjDznjpKklqqMzks72MEnosyyAs31ZhvaIPLx0WC9gd2OMCfnK aGQiHJ5wiOtga2pt77jlRZHO9B+OSG7x20qO/n7DbKtn4gT1JwpPDXYPj8yPOo4= X-Received: by 2002:adf:e74c:0:b0:374:bde8:66af with SMTP id ffacd0b85a97d-37a4238cb41mr1358621f8f.57.1726819234225; Fri, 20 Sep 2024 01:00:34 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:33 -0700 (PDT) From: Neil Armstrong Date: Fri, 20 Sep 2024 10:00:23 +0200 Subject: [PATCH v2 02/13] ufs: fix dcache flush and invalidate range calculation MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-2-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SuZ8KwTuWc1kckVDvrJL/eSOHEntELey+qcDzCn S0BxEs2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rmQAKCRB33NvayMhJ0XqtD/ 9nm9DbSyPKzQ+rDVj7tAAvVylHnh1V4ihk11yhTbE68w+zbgk8b4ikIDxlR67KqicZFnsBKCSwRdLG wAzBfNKxjc01G0M0ZUHCJhxwgPuIJiiYr7fKfkt7hcJKi1Q7QCOeMqIgohiSfS8d383jufoSmYpFVW YGaD7/vDM6U/76QKsDvJgKyOkHJjM08jjlVRp0j76m3jAIVEMfAtb+Gw6rJ7EiSxIJ+BU4cyCEJSZP tnJqHiEOrbvMDvJMHhECLo7L9DcVPkpzIuk5jxFYzBj+r4u+xxIam0b4/wgkul3hJW8g87XAi9tbNK z59bhzpQNItfLSV6mS/A3ldb2KlXRvMY9euIGBUK2xJ07Q8S48PEh1Oo95xTbsgur5VrQk3ldSkLK3 Kq8ENINxOJ/R2Yq4Pc9D7CWKzQNUi6+A1A39p7FJpUQ5cuG7KFr5fwD3goa6PYk9l+d5KFgk6+kKbj G/K3kxdZsdMhKfXsWp4B1AIx38+1RXoygkqaj2Ruax4YKFffygt96iQAKoHVAUaUbac/LAKLd1nP7A RHYp2+SYpRMDl+m+KVxtK1nQB/Ip8xlzBLWp8DtHZU+cBDZ0pzPLCu/WBBBUgjcPxXTVAjAvjElAO7 oHQUR16CIJS5wExK7nT0FnopHFa86PkFI2BfVb5I0vo44cjvgHR1VOkJOGGw== 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 Fri Sep 20 08:00: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: 829859 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705411wrn; Fri, 20 Sep 2024 01:02:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUh5RKjkifzFNSxbKelv0h6Pemi1CTIFh7fFz1o5C1gRLRVVpDnKne2dlA5RMoeJQZq+wIWgQ==@linaro.org X-Google-Smtp-Source: AGHT+IGzCjMeJIFzLAVaf5//lt4z32ZXG6SLFqD9Psl1zhay1sojUV2cSBmSWF69d0hyUHFHvVkM X-Received: by 2002:a05:6602:2c8a:b0:82a:2053:e715 with SMTP id ca18e2360f4ac-8320b34c8c7mr145126339f.14.1726819336349; Fri, 20 Sep 2024 01:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819336; cv=none; d=google.com; s=arc-20240605; b=ZINIRhXvllo4cqLRZ48ylwZNGbdkxiV6EkPrJ0Gnb5vWZBCVWcLH5YK90h7+QUwHIm 3yMI8R+7gelIflftp2y51EFl2CfpcFgPQVDU/TlTsS98M24LGgBLXcSafVmO4VXUeSM9 B3QX/ekzBIgKvo1b3oe1SkjCuebzSyhAmwmAWHBRo7+sU5JS7B7tHpt4/9TdHS6xRWtL czHVSDKlzOBdGvf+GivAGdZlBvAwzeBOVVDUk2G1zXRwxjXGqWqkfwQkSDbEOPTaHHcp T4XsnLBLPFs5CDzaGE2ucDzJ9HxgtaRGw+E3fs5wgDzvEhK//wBmvPU67ovVdqg0dMgv dGCQ== 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=di6kg9KeRxwWmVYK60g62gWde0UTjjnlOjYcKq3ctGs=; b=JoAtYfEs/ZJ420B/pwK346jQQOq9zYWOl7ZFaucdd3NPwtIOy0p0d/HannqPSgq/L4 4AYkMN9dis2QzhyHD4EhtnbjPnFSKyzfMDv8ahYwaxMqVelh5xFE/ZWRums5rrNIKp/A KrDEIp/DdMQKUS28ZSl4MUY1hzqPiRyxwgOn9iwc1EIa/iXlH4og/SaZR/zaaW8u+LLM Q1HneSwwmN7RBjebIGy4QxSphEmHQp4CQfcqmCdb1/uONG9FI8S8C3LBwnn/hO4dNgM+ hp0/qQiEZRopxF7zU/ZOsrw6VIYCthHa7PvVO/0rEew9C8joiQ7abd4HWSi6bG+KzMPd SQDQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q5fBekqA; 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-4d37ed4b787si6325482173.167.2024.09.20.01.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:02:16 -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=Q5fBekqA; 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 4EE7A8941F; Fri, 20 Sep 2024 10:00: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="Q5fBekqA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 07DD8893FD; Fri, 20 Sep 2024 10:00:44 +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,T_SPF_TEMPERROR autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 C7A5E88DA0 for ; Fri, 20 Sep 2024 10:00: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-wr1-x430.google.com with SMTP id ffacd0b85a97d-374c1e5fe79so1162542f8f.1 for ; Fri, 20 Sep 2024 01:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819235; x=1727424035; 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=Q5fBekqAPxzzJ6JtPCqB/LPjoS7WsCIqGUPCxwgg1WAhIeaWJ8Bn+2LIHy1pwbgEtl kvqUO+H4WVRJ1tzU51Doup+JFpl084t6o7PFX5m0zXTefanqACF8vgtJHQPefe+td2CF rMgQdM9DYCcpkd+kOISqRVuRbpEPivdh1+2jPjPEICHPsEQPiCyT7UvxSuM+NicqWsoQ 42Tj8vooW5BKjUUGfIEvj4mRiOk/PyPoYnpoWwCiCFHsusx9lR7wFo58AshmjzS+shcf nsJKw2rihQr7b7N0X6Hn663VoRH+j0ORyj94TCYzww7RuyI9fkz0CFn4G4dYY38uJLEk INug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819235; x=1727424035; 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=os761h/Z5tJYzFihNedQEldahxfzlUDw2grzMgRDZwLuIDhLX1jAFN8yQBvBSLiEjU ou+PvziPTCVIHp+fGB9nl2D64ztNphHzzngxsAKA/ILUyFyfcaci/75ytTtvNBoHqdpZ JL9BWbnfsvyYKCiA++GKtyHj5e1MRASjeEI9B/3yeQpSdiVrazVKOLscV6c08C/6xobc xdZwu+XCMV+lKWsRlmcQ+5JEDROzg3pFXuUiurfUj5snOh1fk10DByQOQPQS5g3g33jR 3LKfL0emuwaJNtlrtRr8e3Jxt4hgfJ3m0/7ZxFGasVCosnvaYhHI7RtXzPW2+jbTT2Y6 lpEw== X-Forwarded-Encrypted: i=1; AJvYcCW81BvrQyRJzrg+PALKJQRtSCwAXwNWV06C1+C35T3ww9Q605i2sbMIdTvBncDnFV9h54hGIo4=@lists.denx.de X-Gm-Message-State: AOJu0YwC8dpxeZW8GzJk+ZUVLYN+y6V7K/JWS8U9zTmbxOhu76gBy1wn XwtRZDi0+00vuCl6qoL06EQ9d+ZhTpfvpSfd9Ea1c2+QAi26pwBR3sa+9RJ7r5Q= X-Received: by 2002:a5d:4488:0:b0:377:9867:9028 with SMTP id ffacd0b85a97d-37a431ad4dbmr920962f8f.44.1726819235124; Fri, 20 Sep 2024 01:00:35 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:34 -0700 (PDT) From: Neil Armstrong Date: Fri, 20 Sep 2024 10:00:24 +0200 Subject: [PATCH v2 03/13] ufs: split flush and invalidate to only invalidate when required MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-3-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7Sua4JjCflgT+dtqqBgCrTxtB+yKq/3ZGF4x1KBv 3t7/QV6JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rmgAKCRB33NvayMhJ0S8KEA CT+d3si6kY98GQFHfYpP4tOJbFGkPlWg42mO9tAqB1zcDtAWEbCTZkJHReckPabOsR8ajJSgTedppU zt0HBa1+Fcm2p11a8UWz4ZUQoIYIYfqUk2UYEDJ/2zvfRyQH3/dcuZ4jZ23uF3NkEs82ZabARCtcax SVDDTmaEFCq8a3TDy7eW+tBe7h6Mu0SOB5c+66kUJDlCVqscTFuzJmT881W5mpG3lRCcnx7oPcWAcE sFtIQhUj/3fTkw8s2hAALzE396H3E4iqikk8IgNveHmGHT3GrJQw1nlQMNK41S1GU9Gun02bjAD8KY 0JduV0kygJykP8GfPnvX2KwOegsapAb+qmVwpkftnfd2x8lO9JeW+HQ84KiGvGfcVz7GbbBxE0BNHL BTB0wB3Ij8hcb0vvw7naoYBp8L/Y6cxGugQGG9ahyGoqhH6qVb7b2r1uS/2drqADugzCM9OobxLk4F eLePLfA2vlwONwXYPyh88SSNn2jHk5IpdzSZ8I41IxFUC3utNsJazENsV9BZpyWeueY4JjAz/537SI NSd7RnZAAsAdsb0wksaH21lNS6YyTVgp/FE5yd+4iUAE1dCZJ38MaSt1FjDFgo8XSOeL0JfW1Htdeo aeNlknuO4yYOwOSoXc8lroVeSpyM7ltuaO4tmGlX6Jbetio48IvL/ZlQ5cmQ== 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 Fri Sep 20 08:00: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: 829853 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp704856wrn; Fri, 20 Sep 2024 01:01:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXu9SNGmwqZjQbwR/YRk7xk3Vgrur2O4BRSYa2fAOtsue07Qgvx+XkFuzLE5DXPA4rBOMLBdw==@linaro.org X-Google-Smtp-Source: AGHT+IFEwJqi1C9AAXPXeeMscFGAqfKTn7Edyo8DP0NyV+aaVsrKmvugfGaSea8CJw3mKCGIUPoe X-Received: by 2002:a05:6602:6d17:b0:82d:9b0:ecb7 with SMTP id ca18e2360f4ac-8320b25d5afmr157973039f.3.1726819261015; Fri, 20 Sep 2024 01:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819260; cv=none; d=google.com; s=arc-20240605; b=hKwwWQlpapWk70nHUxqoX4Bc2B4r4j2QhS+V+lF1SW3RPDw5Fm0KfJTbglb324L2Nh 94j1TIWyujvEMFhhehpyjyLSICO2fwADx4pncJon5omS+z7Bi0MKuc6/0FKzU2g74F4h WPn5vljBerut5Zm1LcZcHxad3WbjThT2xxXSgtA5hg+1LCgHi1ny3zuI9rBb43mPieec wmBNsMB/NMzqaVyvE5U+UzSLAPieL9wiIzbR9aA/Qg6295zuJwTqI79Z+RWbWPDx+n+V lW339+9WKyRpJyNuiEUAEF39Uwui3lAIGHSCVfZcGqqlyqzoFVkGPBa8rivW8vQwIeRJ hTHQ== 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=k+rN/WVTAbzvx3aFu/FSByYh0LM2KOmZiJXYRuKfISY=; b=Sk37k2ClyO8BNApP9uCAeEuEnrPLqT/I1s6Bzf2Ycv/mJ/QKZg9aEor7klMLIBTxYf yDfluEQvl3vdIU68FZU8An+oIQNEEO9m2wIWp5Kq225xhwTYsEMFsDT8EbvqePCr5rq7 ejUiNiKBPyML9fQyepph0z9XO/3Z2sDscxtC/HA9RtAFen3+3hN9HTuujF8D1nYolSlg owLPKLDhVtQkV9kC7cyJf1EVXhgheVD2fS7hfegZugN+pGcXX2mdBJ+8SzHpdcryZclK fDsa9xon69Y2OMAamMpQpaC8FeVVOvFTfPSkSdf0d0oXqqJdgcHr/JHWmRrc/f7RrVYg i1jw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sVflAtDU; 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 ca18e2360f4ac-82d4927285dsi628324539f.7.2024.09.20.01.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:01:00 -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=sVflAtDU; 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 D198B893FF; Fri, 20 Sep 2024 10:00: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="sVflAtDU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C34E893E5; Fri, 20 Sep 2024 10:00:38 +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 94ACE893E5 for ; Fri, 20 Sep 2024 10:00: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-x334.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso14480725e9.2 for ; Fri, 20 Sep 2024 01:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819236; x=1727424036; 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=sVflAtDUgk1F5rFkubM21Qs2Fwv/Wt0ifsxyoI2pqQXHfepcgWxifKpNVe6qWAv4OW TTeNVb73BPGBGmC3ngVVQNm8kO95cCydrcl1amf0oXcTa4DVg2r3ytNKuiki+hHrjWLo h84y+O9uaL3m/b4M56quWuh71auhkB8Py97TnsXA1o2suZcXnWS78h/Uq00eAGnv3oJD cVhV6sZQNDJccMcgajpkeWVe26tJkt00BAxn1zM2uGWRAi1jGStIdtFCYXACOB+NQoEF 3rrCR43MmVoRaCWGmGj19tYKJseJtevRVj8j3ggsti8vZmamMSaFxNEUgY8ooixyQ0++ yCQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819236; x=1727424036; 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=Th1DqFodpNVMUQrUas13Lq6oN6WRZVt84p9J63/MK9CafcQzreeuWlc1zbGUL8tMCn aFAhK/9K4k/j62GpJ9Py2PDt5HjW8zxnBf35JMkGnyidVEO0Ko7vgPczD2z4yqq3ykfh VlkYz+dX8LzKzb4V/V/GbtoDsXQCcCeqStupnfxu18IQ5+X7wJOBVC56+R2sRIob/4Uo 0pbPipUt2Ny+1Bgx9drkqtyyfq1jMd+EYa3Mvu+XorZolsurpkwj/PkmkujlJM3Om7RR 3+KwQFEcy37W6qweL7LNkBiO5A9UhxbGVe2Ce05Y9CijD2Oh8z6jANKieZzzBeR1cH3b sLhg== X-Forwarded-Encrypted: i=1; AJvYcCXBotkgVWc2oFC8vZiE6R21Eb11OJ4/8a/8otlVKOifLP8BjbK6LBZ+sakdPjRXAZuJ7noek5Y=@lists.denx.de X-Gm-Message-State: AOJu0Ywaxvx5VjBfska5tyc7RPog8mOlW+YsdiTewNxKjNL7xE33d1Eq rkPieyOh9D3URPY6Y/kzZl4t+2Md9StZKInK24F8+k0kWQY0lOatO127uVt+mqQ= X-Received: by 2002:a05:6000:154d:b0:374:c481:3f7 with SMTP id ffacd0b85a97d-37a422521b5mr1301077f8f.6.1726819236009; Fri, 20 Sep 2024 01:00:36 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:35 -0700 (PDT) From: Neil Armstrong Date: Fri, 20 Sep 2024 10:00:25 +0200 Subject: [PATCH v2 04/13] ufs: use dcache helpers for scsi_cmd data and only invalidate if necessary MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-4-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SuaqyP/6l4HWpzKDcS1g+bRhvbnzgNtC1VsNrX6 Q6rnR0WJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rmgAKCRB33NvayMhJ0eEuEA CQ16t5N/4dkudxHcfbaVKBxvyDV9T5tUJXk2bGjcK6omQl5/f9xYabwjsu1btykvcTAppGkewi/BWK Ydku+ALiYuVNIGLuSnMnmYIUd6E3QbtqIpsmIWQmktwTy1ZfqVbhsHtNmFiCCbv3UyPaOfrcZGg+b7 Gf1ZITIUmePar0t+MoTAljfMke4j4jjPUikmw78la6Wijx8XN6LsnI9UsIRjAfBCsRFjGY/hG6qJU/ Nrt9Ogd6/VAE2EiOcXKd9IoZG4pMMT6nERQmQ2/mVQdTnPD89V54OWkbrVjaumz7eViy8a6M8AquWO EtfWg6qH4wTfO4ttl/+pzhRdhC8FH47HjNtlyk+x2R4WYT8OQsirvy1/cy6RC77Nxub5txFhoMMHRV uoGgGcc5WHwJCdqMz2CPtHZ08HuO7//qMQI4ildpgfQjKZwzA/AJm8gYRGyNVREFKf4nnZ8+MX0bRc PBCdSl1Vn9CZEu9Qaf8ZIGvaFoVk4HcQR7nIw4f1FoGoGJwA3sqswlVQdPuBpc4YABXa7w92RhXyjZ /Hl8N6WiR8+O53aL61Po3BUvFfCBxNLeCFJz2RFsHxg/fj2+339oZlKgDi48mGR1xMsHb5/hLSXJKU JJpT/k3i8AkN73s2FrVOuuHjIRkrF9+aV9BBUFwUN7Uitx6PWkv7dn+ZUa2A== 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 Fri Sep 20 08:00: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: 829857 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705213wrn; Fri, 20 Sep 2024 01:01:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVNv7wcDDaFJRGWhn21+uLOzSRfYskC1a215EnhyepbNbODs20km+KyD4Rm2LD4pB2aErufpA==@linaro.org X-Google-Smtp-Source: AGHT+IFylA+zVh4DFA6ijv6V4FIPiwKJyet5kui19ay0PnLuI9fdEqnZd1T6pGrWVYgebYp6bGd0 X-Received: by 2002:a05:6e02:194d:b0:3a0:c820:c5f0 with SMTP id e9e14a558f8ab-3a0c9d90ba0mr17840975ab.24.1726819309478; Fri, 20 Sep 2024 01:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819309; cv=none; d=google.com; s=arc-20240605; b=F9g2QNGoIdxD2dpXZGXAqDF23dndK2zZRcMiE5EmtIREmBkdg53uxj+mtiWXTEnvXG qS8oubNPL7pzpw8RhM+iIGb4hD8A07Z50cro3m+mSy9RRsVDUsYgB2SyVuy5POe4eRYc T8Xq6AmC7NnUuLK6jbcMcpaGJIQqVJaATaN6W/spM+SbmJ9MdKfLMgkTaLu99bxlRw83 Coo0bs9q0oHvxquai/G5snoKQ/7o6tlWUtipgnQTZPnxRkCzjxMAqgQPpPqezlWPO+yf /Pz+U5go9ZN/2h2pJYsv/lIEXSda2TYnM41noAHEfB7/sMsSQOB+0kkDju+jK+FsSyi6 RWhQ== 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=3xW5CrP2skvkpjXly8BCTPMHplzZNt3dxCXupYtYkIs=; b=ayzQ9A9vNaNIx/b4oo68hQkcF1Z8CtgThw+aykltiCJQRkiWNHAHJKAL0xU1B4QI/N Z2k2fS1O1X4DdOOTH1I3qVg9/PrS1BFWWbLwotcpH8RG3dnHdqKZIWBkAy//X4EGXucl b0xdA2L97rVRin6QNBtStmRYL5k6GFLZDahvI8QPw5gxGjgBgIyk3UUVZwVQVGiM7SiC WgEIzHlwBBEFjXRU77W2qb5hmIt37fQx9wHlFKNdrtYZsJ39j4MfvIpeHU/TO/772r3H c1Jqa4GyKicl4FG7z9KrvuqYETpUWgqwwmA+9a4LqILlb2PB1MX4dhN8/QjTSDjz4tbR lJ/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Za3MdIyn; 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-3a0c24881d7si16849065ab.190.2024.09.20.01.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:01:49 -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=Za3MdIyn; 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 8E818893E6; Fri, 20 Sep 2024 10:00: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="Za3MdIyn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A0E82893D6; Fri, 20 Sep 2024 10:00:43 +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-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 8A450893E8 for ; Fri, 20 Sep 2024 10:00: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-wr1-x435.google.com with SMTP id ffacd0b85a97d-3770320574aso1077084f8f.2 for ; Fri, 20 Sep 2024 01:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819237; x=1727424037; 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=Za3MdIynccu6CO8Hj+IWs6AIz/mc5V9fK/WF3TTiTXUIlziSbwFalAfmo/vulls7YG T9AqcSjAEtla09XyejVJWvNwgOwpSnBm2cgm4gF8lVyGV+U6xX+Xg0lVkN2Dx3Ul/CAN pAMbUTnZTYkANp5Ux4WPVyScnCxc7FSa9D9Kn4HjHILPyKIdNiJaQoi58NlI1VLSCw4A tClN70wYnic8501Nrf55odM0ONxy3pI3Nqdjw88fhYVhURvPb0Iqt+jCHVwImD7rKAal CwaQKd9/cThG7DyipldtuGXSyilJrimDpy7fP2veUGuBmQ9sPnmYKVv9ETFJ7b9wwXUl RKLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819237; x=1727424037; 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=qbae3Ck3qa9xHPZrGfzOtM+t0AASFPDGLKKopumZzZnti22rFXxZpeXaPKAQlALuPs i4AbrXbVEBPUjfoLJgDZd7/eUYV8qrSnUhuRUXw72VsNhB6Q9nVQJYyxc5cDganhGDL7 6LDe6n3KXRi02nbu1ywJfjd4hpagxnd8a6mZvrx5jG7+izpD2mhatyPujIuQrvP+YkVo fIxI3Vlm2YUT6yqmK/thzo83KAogF1AY6pdJAbMtP0DVpX0+JrOrsEtzsXGnEqYYQa8D BVnLschJENtz6rtMUCABrE32lHZ+jE45dsLTNay1c8ek1FMGfHBzqKHEIm8epws0R1HC xPwQ== X-Forwarded-Encrypted: i=1; AJvYcCW+AYFeRGYa3pxTFN8/xjELzzBPzMwx9Ba7L+pVfo27vAdNgQ9RYeigZu8Wmiox+Xpodz7Ky7E=@lists.denx.de X-Gm-Message-State: AOJu0Ywg3FnQZw0CzUFJtzrxJ6fJSkSeoaAef3ywRkx6Xj2W9c9mGX7P 2jUUNaiLamnILBxtUvsOXrCH8/DCzjKM3ENxl2p9JzjFbnHQNLnhDis0Op1cr/g= X-Received: by 2002:a05:6000:110a:b0:374:c1c5:859e with SMTP id ffacd0b85a97d-37a431ad406mr1022747f8f.42.1726819236939; Fri, 20 Sep 2024 01:00:36 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:36 -0700 (PDT) From: neil.armstrong@linaro.org Date: Fri, 20 Sep 2024 10:00:26 +0200 Subject: [PATCH v2 05/13] ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-5-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SubXZ9XOG23Xgb3DGSVGPgD0pWc1CyVJQVwG5Yo rZnhgk6JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rmwAKCRB33NvayMhJ0U3TEA Cf92rF4SdWN6lG+l8kR5Ovac2sVgLu4+MYI8vhi5IiVucrNkzFrBkNx11yja+O52DtSpJWYzGFUh6O Fh1p55AlY4B3tdUpeMCmEz0Dd7eNGJkiWdfJ8IrydUyo/0yj8JHaFJunDrh/duho4PkGm9/NvThE7+ 5y9dHgo0trlKqCrUSqlRTMtuGVG/A/RaD9brKQF6zNRr+FpPRwRIWPLIuRGV1AWGn4Ol0DB+PrX0wd 2ggn1fsK1Ulstk1Jhmy2geMUML/USUyQoftV0iV2QPWV3RAJGD4SrQA41yosJcFNWOiUMq5OSRugrA JHHRDNmdt63LyDNYGx554QZbeYqmp61RBJbpF506uSS4UvSkLpcv0CRMFil/ZnRVDqYEekVZ/LI99A SXgCvSbEE6dKAvmlNaYfSI80SepMwP/UjnM5C5d8Tuca0ffBN1Ao9LvJ2kNPMLq1Lpljhahl+rDMhl 7+o8wJUGvaVEtkI0Y25XYKWaFjzs2Qvxl0kWUyzwbC8tfnacbPuX+f+OD2rgblDxtndE72d1cVaRZ3 0bLA5I54zBOjziBP3UL2p5Ti0Z8G3ZHGEK68tGXQowcp36S50YWAnZ4QaDc5ayOmBUbuxEVUIEhDVy lU5S1fpfYaGf0i/55/1bHsDZqCIReVTYtB2wQ/W67AAGHrtfbFS0ojjV3noQ== 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 Fri Sep 20 08:00: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: 829855 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705017wrn; Fri, 20 Sep 2024 01:01:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXyWyLa8zpIX6wWKAEheidMyOxznS40SLFaJjxcoPWTL0osq0rJxapGOrm8CS6G6p2zmzviNA==@linaro.org X-Google-Smtp-Source: AGHT+IGgIZEPclUC4PUTPnAluQY00umeZYLxcFRNYn3wL91KIEwQ80IyiuUTyuhXF/KtO3zBsNPj X-Received: by 2002:a05:6602:641e:b0:82c:ef21:91de with SMTP id ca18e2360f4ac-83209eabbf5mr239099039f.14.1726819284396; Fri, 20 Sep 2024 01:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819284; cv=none; d=google.com; s=arc-20240605; b=NQfAC4fLatpuQtMjKdGGrul67nH/yOEtE6acga34ImsE8YpmONaxS23yFc6XpPVADi 1WayDJ+PIMllkXu/46wKsshT5ZItJmonBfqjUd2p8rCQJjHUW5jeAtUT98V16kbR5Ail VMJVvRilrfgcaFc7MDwg5R5Fh7PReVmVdIfF4Sqt2q6VFZhJ2UlOvP+mnLHNCvvy4wMc o5jzvyPye4UcsQ8u2FyVais8RuY/rOLLUysXObPn1yozMW8wuIJwOc5eHVP8pYR6irbF iXEApY5SeevqGi1LmGiWzDKOCnarIGPs7rdbT5FobVi8Xecor/RJF5pG/GxxjGsdOs4q QYAQ== 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=gr0fIF2feNJMh6u65BKXaaWOXqE/39PTRnPUkuKzQss=; b=jhLYFJX8Y1Yb6CXGO8ihT/daFD2PR4ce4Wk+hrqfYLVx07F50pWVfoi8k1CMib/oo0 k802G/38p0SfQU8H71okRS7gAWndR/bJb0C+wv0DBkDSO863d5J0Xa451F47jJXZDZEK OEJ33keFJFQq36f6fjQcCQERVg4MxlyRQZ4c0LfyjTjb7uXybpZkD2RtkllcpE2/t7yA u699b2JboaLVyB9vcyDOKNCdUo5u+MAbN053g2OoRJcVGUC1mmkHbGueF4NaG9gop0U8 JFyeDhRdtCs8wYAIL0BnnEWqyNolUnkysZV6Nn+YoG0acxtMKbEtBKm8qNyIorhET+JF EYyA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m+lskhUH; 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-4d37ec0b11dsi6463178173.61.2024.09.20.01.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:01:24 -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=m+lskhUH; 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 B4218893E9; Fri, 20 Sep 2024 10:00: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="m+lskhUH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C3E6089415; Fri, 20 Sep 2024 10:00:41 +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-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 C0502893E5 for ; Fri, 20 Sep 2024 10:00: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-wr1-x434.google.com with SMTP id ffacd0b85a97d-374bd0da617so1149872f8f.3 for ; Fri, 20 Sep 2024 01:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819238; x=1727424038; 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=m+lskhUHqvZXw6ILvNEEskoXxzQOWLa1oNJI7MzeQHMEBS0jvaIPA+WgYB9NXaStVO 6dD1kPqxwe8tShmdaDXZBfR0lOY0jQ/Ns6wvEt67sh04uLgfFIOLC0Ee7H9AI/t6twIJ JUZGiJE5R3N/iyqHi+gAkNb0eiS0VHBIkhctSf6vQSxrCo7QH3r7PMPJpt+jwMKosamK Rg8fxlcGzgWZAWZQTNFa4/FUMDPOip9rG7XNGQA9S/qXDNVxZmjnNTeu6IiuZRALbN5d Q18HEzGjH6MhEIrm0B5bJPFFYWHM0qNfcx9DzfY7gUUlvpazW8QrY1ufzu9OE8X7+XJU fHbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819238; x=1727424038; 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=E85KGYsRvMshoD1iQk2+pU13D7tqkEJ83tuCCGuU15oasFYZL1EM8fgXFFQuUxyuFH GlU9wRnerx9+uZcazfExz1XExf5oNMizFuf/4D4BmxvQoHSCNgOiY1FFWe21TuKA2kRQ 0aNE144TjM8rPPX0hsExr3RlCPyUTTcPibVpelPTQTqkxCyoe9ZFNATpeDBXPXCNHpAX B0MNM9nb9plnbeE1GrwpvZ0x1g//LWz2hubwLr949347RDrm8/+LMpiimJmqZmdTLTtC K/Fgo8vT7ZqxSfXfejbG+T0EGhuuXiErX9EFY4AMdO/Q5Qcl07terUvDLO298u0UyEv7 6/2Q== X-Forwarded-Encrypted: i=1; AJvYcCVv0hodW0Gc0yifK3YAEk48Y++JNb3kNJUBkFryAzR0CQJrNrOBSLY/+BdVPiGBQspgncTHbAY=@lists.denx.de X-Gm-Message-State: AOJu0Yw8N2PHSSb6snfwxk0dE8Ts3hLfvSDsxdtexVtl2g/HZCysHXf2 0v2HIt/wwsPbSBA+Ruaq7xeLMzSARGWnKlASk2UV9O9BDqka06PcDXZIKTyOtNw= X-Received: by 2002:a05:6000:151:b0:374:b71f:72c0 with SMTP id ffacd0b85a97d-37a4227805bmr1122397f8f.21.1726819238151; Fri, 20 Sep 2024 01:00:38 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:37 -0700 (PDT) From: neil.armstrong@linaro.org Date: Fri, 20 Sep 2024 10:00:27 +0200 Subject: [PATCH v2 06/13] ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-6-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SubcCG070qhp8vQGZTAAUTcEfUGJCtmpn2j7sTa Cez5C/GJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rmwAKCRB33NvayMhJ0Xl7EA CtutMS+8cwbyPQsXuzXSHMM6CQyttMKtoEi2iFs8klNy417WyaT25bCVZjR8/TVPaIigD+0wFm1ARv HkcoI1y1MJLsoZ4IsrQ4JCQtwS9/MAuH0E0B39yXehHgPl1/9V5yEIy3sVnzMnKWk/4F0AeLEoOUHp lLF5RqbtcU3NfkFPH+gfoDXOYJJkTv6qYO1CTln4iZBxIZEtUjciMLh8hwqkrkv+5qUp9BPoqnfDjJ sLkQnJtaGy5x+we4rMip/DwFYD4cuf6p+M8G2n25lAiNWEaNvV8zaR7Npe2Otbgc2OH1yRMwUSmS6U iMdwKsQxx974dqfqA5lGOOQg3DX9OCVJxT+oeUnAPggjRU4EgJdxwmgAmz7MymO/MVl85S3MHNBlbF hlqX28lMZ9Ppf3M7gGLYHs2+gbLyUky/+EHyMEPsfCVdM+t6+ueFxysDl4qRVTSEPLwVcj2/QUb4mC TFg0JdOHt+ow9O8m6jc5yBFSKyY3uwxgPwyOSMmyKP0AoatatheWI5t/W+xD+6nUalGJ7/PFVI4kZw GIa4faLhzGe0eBMesaqptkEdWfOo1ZU8LChhKIIYap5nZ3uiRnrIG2ODkXqW/WU11fbRETfuRgXgpA WLF//MKq/ub6N2Zq6TzSsyc2uyTSJYEG9l1m8+CLjVWnOHkHFQrHXkldFFcw== 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 Fri Sep 20 08:00: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: 829856 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705140wrn; Fri, 20 Sep 2024 01:01:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVQX0lKr9MEmxAFXFiHK67k39amOtyAgF5AZoXb0zlAFedwsCb/aRRahMMM35ByugnqfnXcMA==@linaro.org X-Google-Smtp-Source: AGHT+IH3OjZmts1zwnKyO8rSNClRbplZOC4a2qJ9lPV6UeqmbxgloJ2zz+PnURYMBAXgRa5cxiu8 X-Received: by 2002:a05:6e02:170e:b0:3a0:926a:8d31 with SMTP id e9e14a558f8ab-3a0c8d091aemr17157025ab.16.1726819296839; Fri, 20 Sep 2024 01:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819296; cv=none; d=google.com; s=arc-20240605; b=doe02NcUnXbB5Amn6CmgruAPYo08ueqVL66Kgner2IQDCXd+YC9yn2gAO6tYK0xSNL HbIkiuFwRS2l7SsyNQaSyrjAWsLARh1RzZ6KW8Us92SzY2k6dz7aNfozxHYIkHbiOp9Z m0M5GW/Dst5qhI8b+jKikXV5yczKued+9FSKM/wlkrNk4HTrURClfdMOkstitE6GiZup RJm/gecnPhAmV0opeSDO9T3UpAUWmOidSA3GuIloe/nhjhbKpLtC/4XVIhJBTu+oh9ND XjgBZ8DI+baGK1EVUKuAE3mLesyqzP5gYvdxMdWfAo22/q8v29Ucwj4cQ5RZcS3+4Uj5 /V1g== 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=2CCT8+ywBC2RNXHp1sSvuExr5sedxtCYL/sSTlEFwGA=; b=PnkmB+DLRcTT5v0DB5et6rWjr3IE0eJzXeKqignjwonmsU7Giuvhkj3lUzlw7h2g7G ufUKPfpDRgFqA3BlE2IoXwR3Tu+EF9XFlT32zktS6j/TG7tgyu++VLpM6cQONzbzzO50 Db5FVknatFObfSFb9HztNe8KXvqnZaNcR5l9pXMMtbTKPRijyjvxxQ99SLPpsLXHLTaW 4y7kF4h6shQN+ph0IaqR8mwtDe9SOj+OpAQCRAInx+DwmJh31qHxzG0zaAUK4vE3ypny yuQoBRMAxNnN4egk79rWLzjWsvCF/SckSjRmYaXJqmDd7sOw4Qgkvn4Bkd2z89/QMfsC YLtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k8mPG6mc; 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-3a0bbb3a786si26663885ab.6.2024.09.20.01.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:01:36 -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=k8mPG6mc; 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 26126893FE; Fri, 20 Sep 2024 10:00: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=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="k8mPG6mc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ADC6B89412; Fri, 20 Sep 2024 10:00:41 +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-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 AF781893F4 for ; Fri, 20 Sep 2024 10:00:39 +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-wr1-x432.google.com with SMTP id ffacd0b85a97d-3787ddbd5a2so1050430f8f.0 for ; Fri, 20 Sep 2024 01:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819239; x=1727424039; 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=k8mPG6mc7M+5HuAdWj5G1S9aydDZENkeegSxfAuK/rnrAS9ncUlE3sEGr0KP/ix9xD FqjbpI6oR827LXevnerVY0XdVtMr138Akh0tKZjXWuoSPcwu3aCC9WLbM3Tm5ekYSm+B phq4AWEy5cRwU/On2lM/WYSQbFL6Eonznz9COfnsNKkMkQ9TIVaYEVg0pXWJ4DU2gF2r yoE52vJhtFlziMPpyyww6smRxZsSy2hmNQv1QnBM8QEmcUXUi1gH1Nor5mkrSW79cTb+ O1i3nX1iXMvUjr5OEr+GRUFMsJP6qFkX8B7d95U9qr5JERKuhHC2jmxXht03anUSqJCK gyYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819239; x=1727424039; 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=ZieDGuumPufaasJrHws8lxmZy03yi7DrhpUYtL4m6GygI21Z2XXbutZtqxzkZvLTNY z7i6qvawH34aiU+VMqiNniTyVQCDpP2Sv46E+mvjWxtzJD1Ekrx87JP6YwNKpXEPYE7S uU4v9xB9hWXHvPZim7HTFW8QNzrsVGMYGybBnoiyDGHBAzinF7awv0AfHDE4Uz3xHIAT cXGKKMVvUXEkLHdqG81biPrggVa915A0U18JSska9QlM4VQi8ngXhSWmi8tEYCo+dygb d6aAaJLQGwK3tKj4RQp2/IQITlL4Jg7GcUdQybQJWflWkwuqGFDYyh2FGhH1ypPWmEKc 8dpw== X-Forwarded-Encrypted: i=1; AJvYcCWuT+G4w3W5J3+OMpD3fWSMKWZBJgIY3py+bOrOviobS4XCwVEY6iut4RL85nX0uOlUYfRhiPQ=@lists.denx.de X-Gm-Message-State: AOJu0YzeByf1XPFMHZNpCSuHLDC4SHLcffGc3enyxW/8JfLOK0AW9V5O F4Q5xft9MN4GPgnAtLSmXjesH7NOjRRv35sGe2XbGSy/fbWgGszvR5t8uIAEri0= X-Received: by 2002:a05:6000:128e:b0:374:ce15:998c with SMTP id ffacd0b85a97d-37a422bec5cmr894376f8f.30.1726819239025; Fri, 20 Sep 2024 01:00:39 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:38 -0700 (PDT) From: neil.armstrong@linaro.org Date: Fri, 20 Sep 2024 10:00:28 +0200 Subject: [PATCH v2 07/13] ufs/ufs.h: Add definition of 'ufshcd_rmwl()' MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-7-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SubwP9LmpTBSNDfznyiSq1d0rsbebhj95DE0RnR u2vkJTCJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rmwAKCRB33NvayMhJ0VsoD/ wIGTUFEwm405Zs26EnSJy+BS3RmhzgVrlsiKc3TVlx+XWPriYbjnxtftjxjCYVtdrKr+IIqzAGnRIT FnoLQ/311GzlrbidrQKqS652xgPllikY022nL45sv8FbS2JrzRQ+2agQBZ+jSiMVs2YgM6o2X9el5o NpRV4Yol/YSlayZoEfwohXzsEvYHXFYeKLnnxxHWHUAatk1o/qP6WapA9vGa8KaTy+1sbj7tGIjLBr Tun4EL9ZvU3bUMUSpseGbcvf4evTTNVT5eCkpGWHz+Gla243y1C7f9llkMHQ6lD/ossP0/E6FgF0w6 1FjbNCq3yC4luDwLYaqvRt9r1N5CrOdkmYuILgIIyPkYJkic8WXGlHxD0ZioctHzh47vcPFFWzs9/8 +iIkLuQUF5OShBwdGxDplZuRdP37b8hn3gRaJrw0rpsn2zYAJqN6vQ8r9GNFThU0bWeLj30nmYiUAC 6o29HCLLM3al8tQ20eFQBJw/l9agKVBOVm0MQE7sx6ViUp14IZfIWOb/jZfbiJkbB/Le0hgYk+Q9Jn 3fGZGRLr9XSkRBUz4qtVHCaKnEQXMxJNTy9CVd6zQb13j8aKZBGEPFWUuRx9pbFIbd43r1oWrkBewd aePEnpyAx2Ihg4H9bm/cdbNhYMo1ajLbJRO6G8hTG5zf8QgAk1oXRosQeqwg== 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 Fri Sep 20 08:00: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: 829858 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705303wrn; Fri, 20 Sep 2024 01:02:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWBD0ymSaqw3rI2nS79DYCauByVvQWirYNWDPXkFRWVa05VCZ7ajDg6wLD5fDGmWGTKosZbOw==@linaro.org X-Google-Smtp-Source: AGHT+IGfb6tRGcXhsvrJvnUwxRROGipwssGNRQuNGQQ2yso8dfQorTlE2iqLWEzptMSGnGynkg++ X-Received: by 2002:a05:6602:3413:b0:82a:221d:51e8 with SMTP id ca18e2360f4ac-83209e8c1cfmr165988439f.13.1726819321701; Fri, 20 Sep 2024 01:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819321; cv=none; d=google.com; s=arc-20240605; b=HzL0r/CNj1Vl5QfYxkaBme+rjO/aLxEBDScgBR/CwFiKAZzjcexQyUqkQsCfWXpny2 Mn6vQmTIZElzOdW2wB4dVGRj286VUOqr/S6dp6q5K1W1nWl3oe9IiHvqtxEwzwG9HT+m AfRMvPOHOdH7ifIogAzcWr9xngfasW30sWSMt6s7Sr0/TN5t17s2C76eNiI+FCjpyYPq qoxI5EiXa2l3q5OC8/DVBukUDtfRGz8UJv3Pt11+JrYr6z+LLkQRQb6Xph8V0nSX+K+t GyEYKgUjbsY9QipZRdAqiGLVFZytio6vH/Ce6UOtFOEfLvkQk956TyAZNPS6+fW6vM0d FH6w== 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=ogZOiPxj9+hs4JbW5hLwfVP4rXoC/5+BSvz82EvuhbU=; b=dB/uA/tHf2MkNG/CwSlke68Un5r5klu1kIWVtSz+V6mSDpmfx+8OKiRJghHMQqIZI4 JhZmTB02Yl61BvrzQrORewWtyIL2sX5eeD7CErykKOM+fcrzjcWhiSpzG62r704K8MJP x48ClQmoX9eQ1uw/Fq3QEuoVxzn79QtzmwyyvvPFoWKJLN5X2CMNFG6RMoTW1oii4/mD pewZlEbNDvtEV0Pyk8mvAZTwWYY/0WCXvURSTet8QETD2QrJia6tYwEinpy4l1ZigRd2 m7eaWrkS8BdR4c1oc7S+aEmWp6/Z01xg1CQHvRZueq19aIt/0k/h1e6dmuCucjKRd8ub mE3g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Glo5s2k1; 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 ca18e2360f4ac-82d49297b83si622616739f.39.2024.09.20.01.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:02:01 -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=Glo5s2k1; 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 E698A89415; Fri, 20 Sep 2024 10:00: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="Glo5s2k1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B4629893FA; Fri, 20 Sep 2024 10:00:43 +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 BDD0C893FD for ; Fri, 20 Sep 2024 10:00: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-x32d.google.com with SMTP id 5b1f17b1804b1-42e7b7bef42so4937165e9.3 for ; Fri, 20 Sep 2024 01:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819240; x=1727424040; 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=Glo5s2k1ySNDILyFyo9MEppvwb3NBanTDHBUnupJygd8dymzv6dTV2l20PhkD7SzI0 qdsgzDxIF0rrnXaAJ0kftp07167sa03VRHeNiE2eoCk6kaTYjRSZhQQvA0ZSTcmPWZjP ZPf0ktGpESDzHV/Vz++7t/uq+7owQP5GKk84S5Q5WWGBbKHxuOs5mMsQ6iejBTJjqNea oWst6eAb3FJNoYh4ZdiMTkEz33L0XfhVSnA7EpVbjHPe3204smquQ1wSUQcWmRD+jR3X J8xHks69q+rsF5osmBBVEDWSV5zg8fHsklTNgqWSOrAcIFfEkZGCLwrJhgLZIbxRCVY/ uhXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819240; x=1727424040; 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=WfNPYlN2AzueX2mkrYrgb+ShsEjUd91noUM8fYtPlutgWZhUCyyNe8VIb77HaKLnX/ MHvluxyoqQSwMdOk4Fdvfokti60ZHwiC+GYxa01oyJm5dt69Uamv0cmxbbnP0kiXywXG HUqXX8ZNwyzCMyAcwBVpdHCvFTBM83tGo//W1+9bwtYOyLzwM//TfruSf7J5XeZQTW3e 7a5qVIVB2m0/oM94KEf5g0/FBhxUmJmN56D/jdadpu7YGSTEZiAn27iVKUdvVs3ercb2 i1f/N5dCuyVrhc9pEn8XEwm15zkGurrSQXTWLm9oX8y8uGsys+RGn5eyZEiVCPU7wSTB 6S+Q== X-Forwarded-Encrypted: i=1; AJvYcCV59jzwCVH0ZsaIuWW8zpR0rPb+YPj/oq/fkzWy10+mz54SK3bdH5DFUc/9flY4x8OU7gfeoeQ=@lists.denx.de X-Gm-Message-State: AOJu0Yw6dIkXX7mzEutCR9KFY132fkXYz5jO0QfX5e0FD4k1occpFuV9 qeN17MnHtSR+rUQUVk5VcYSxwEDKNiZxUSnxghaoVz5ek3RuCex5TkL7eBPlLxk= X-Received: by 2002:a5d:51c3:0:b0:374:cb62:b6f1 with SMTP id ffacd0b85a97d-37a4313ff8cmr928242f8f.15.1726819240110; Fri, 20 Sep 2024 01:00:40 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:39 -0700 (PDT) From: neil.armstrong@linaro.org Date: Fri, 20 Sep 2024 10:00:29 +0200 Subject: [PATCH v2 08/13] ufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-8-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SucShAGH8B/9B31fOWGfpVy5Vh0aldQ5YL2oHPA H+jDoG+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rnAAKCRB33NvayMhJ0ey5EA CqeTt134P4yQ+8EMDR1Rm8WH3zm0Fnlj9NuTt/EWIL5yecHzLT5sCjqN6Q5mpc8FoyoMBtzisGs341 Tbnx4iwAEF8YccNusly7CHJfhdI8ou/XICFLTOZBuruvMGDODbaA8j29QI6c11Fqsn8RAubzCAR5B5 lDZh67h+Cxehgd5o8LdcIe17pRoM/Akle5c6Dq6jE8pOHm1WC6tDDAgGv9XPkQjsnOyyLoukUtqv+m RpzGAHsrlpUE1/gxCiPpjOXf2lEU36u8rCA0b3nyq+CBEYCm+KqiRvGGuDH3NSbifN6emh3GUA+uml scK0vrMTKqszv9BFcNl7xMhvEMfIxJeNocOw1rFnW8GfGfAiWRvcqpMCru0FoPsdoraFYpAon6DFBv 3mrcMLRboNxJnKELVoBXHMMbmK7oU3Pv0bwrYfqKnwCLlVx+MiRetPoVlbSi91iBbsu6jUz+UEjtaC J6GhLLZfX0quDsk/umMCQ8eHY9qxn5C1SuPt4YmPrHBzWo1dWZRlD2IwMMdWgmjWHPZOkjhHvsoOjv GrUCETtGdBPCety6whK1YVZkr3SlDlJQUMSeoERBdI/ynFD28NY878Xy1BWZn4x18YVvr4DjumVqeJ WmwagDSfuAso86eWva9+eyER4g22vdXr/0ayHtLcymW4OUPIhtOpNIu9n0IQ== 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 Fri Sep 20 08:00: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: 829860 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705499wrn; Fri, 20 Sep 2024 01:02:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWf6VJRGD6syZnDAKpEWJxO+ryBOIzDuyeMaDDkoLdNqvZj+FJqOuQKMh861Imn70gMngVi1w==@linaro.org X-Google-Smtp-Source: AGHT+IG2Nckw/BNFE10a/4ok9EhIj76pdd6nB4mu0GciRfq2sHv73Ad7OBz807S3H1l9+dGnu2NK X-Received: by 2002:a05:6602:6d14:b0:82a:9cab:9be1 with SMTP id ca18e2360f4ac-83209d68a7cmr194577239f.12.1726819348948; Fri, 20 Sep 2024 01:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819348; cv=none; d=google.com; s=arc-20240605; b=i/jv9QxBwZZ/XFjXcD4YfH32rbkqgEI83XLSLmI0fL1K74okQinyvTCIRwhcp7JKX1 LcSopicMACUM5HMd5COSezfJTMmc0P9/lWspZmunrppNR3mSHqmyoKrf1sdgz5lTbwwc ywT/whn0ovKsv6wcm1H3wv1k3lcyDP927/eBxJs+DcSivMEzwVeq1y0OJrwfkMHRpHRY M5L7lEEeTHHxZ3voqHSQqKSIYfM9RLKWRv4NT1kv3TEdVa5tOh+imO24goqkAe9KblGF IVWyAAVRPxR8j9Nux4U2rKJRFVAwLycrnp3jd7ecH2Z/lYJZCpuKEsErsX8IoohoxT9r qxwg== 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=R4cGKPJpzNJCSwjAbMhpal1e0iHKKUKG+dEV+7xk5Cs=; fh=my/iMovwBaP37nE7aovW6Wu+mlc3PUHCFCj/ZfbaOb0=; b=A4LvtT9P7GD7dFzd4omPSHGOUC/ezlDCnHRj6vMUbBEn39k2gS1tD4RUJLMsgRtoTs aIu1z9iX1iaHef5Ck5LRzHcseDHeiYsmNMfOnV+Z2HwAWS/+maZ2QFMRerLLdSwpXG7d 44yfPdqBtWxwKnpFPNzgks97Om0qRX+7RcjmO8uxAMUpjL/O8X8NghGKbX4FbszM99xG mBP0jVz6gf41JD2OSgTJTGA+5bTEyBLB6tzlCiBZPMSh0eMTgREuWrvn7FUCIbRhmWTO wGHLkrVHmzqoEVeLqfNVQZ7zSCQED0UOQWlkV74FL/hYDFaJ2Z51ldMp138RAFP+Xuzs oBmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z3miCRhV; 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-4d37ed2c814si6368161173.132.2024.09.20.01.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:02:28 -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=z3miCRhV; 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 AC0A689432; Fri, 20 Sep 2024 10:00: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="z3miCRhV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BA97D8942B; Fri, 20 Sep 2024 10:00: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-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 C449A893D7 for ; Fri, 20 Sep 2024 10:00: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-x331.google.com with SMTP id 5b1f17b1804b1-42cb9a0c300so14730335e9.0 for ; Fri, 20 Sep 2024 01:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819241; x=1727424041; 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=R4cGKPJpzNJCSwjAbMhpal1e0iHKKUKG+dEV+7xk5Cs=; b=z3miCRhVfDxQrsBqmSdvEWbPUWb25WyMVoh05GWpBB8+9mXeny9ZSKaCY11g5W1N+f diquKoPJ+Yhv0jClQQTNHBQrjKNy0CKjP5rgRzdjLQwyjtDhrcWt/0URuBl0cUo/idpc 93vg/e1XnKlFrf8am94LuUQakubhEi4xtkSWxHrCwaa2C7vT64XwkG2W7lhXiLD8inBe 3Dx31z7OBLhBUoUMB7wcMPM9QXZIbgPGKhIES0s0bgYdjf567p55WCkLEEdw5F1DD4/j TyuQZpljxxACSfIitgvIjWczwhGo/To2ggInXP2GdXNRTaqZAhDWk5feymayRcAphv+f eczw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819241; x=1727424041; 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=R4cGKPJpzNJCSwjAbMhpal1e0iHKKUKG+dEV+7xk5Cs=; b=U3dBMTtoHoePo1otnWJHkRN/eHzuvvxQbQxIM8bkdDPhUMHv6M8IAW3L7bi5/vPY8P +DMj6GS4taeSSwby8rIgGbq7oudwbP0i80G12P4W+XXEreqmb2f53vy7MATbU5DH+1PO q3qR+AuDM+rIkvvxEOxgNKl5kcqyYlmDtJEGhH/8uJHRMhMGcILcIQdPBzuwx9BlxQ3C WRTkwh2YjebnO1bbm557DDOiJo9zwBoYTi0dynPcB+1tpcwNBAWrgMEog04vRXMD/eQy 2kWvWHwwknMgl0DJJRkb4RYuHcQExJ6FAEftZEMbb0tNrflnbkM58lzdcOMskNiRbLon W7Aw== X-Forwarded-Encrypted: i=1; AJvYcCUylHorXWKN4TeVa6zokhKHA5aDWSAStrtrKIrutLffke5LS0SE/g219idmCTHtwxsoVEpKZLo=@lists.denx.de X-Gm-Message-State: AOJu0YyD994J0nujGvryFXeEequklF9uSp9FbDdWAbkC6KYVxFVeSLxo +71+w/dlrNV2T6vsHa+B748dqvxmeRC1d9pa9gLH1zovJtkpp/FOH1MaGUy4/tQ= X-Received: by 2002:a5d:6d0b:0:b0:378:c2f3:defd with SMTP id ffacd0b85a97d-37a4226bbd5mr1202927f8f.13.1726819241104; Fri, 20 Sep 2024 01:00:41 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:40 -0700 (PDT) From: neil.armstrong@linaro.org Date: Fri, 20 Sep 2024 10:00:30 +0200 Subject: [PATCH v2 09/13] ufs: Sync possible UFS Quirks with Linux UFS driver MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-9-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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=7342; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=cOAONTj6Y9STDTWMTerHgVAvbi0arJFt6Ki9NcHsPPk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBm7Sucu2vsdBlwUT0eW8BUa9o8BeFMMGt98KUVGY40 40ytzwGJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rnAAKCRB33NvayMhJ0YIFEA CCNLmPzVSCcCn7taZQ5jhK+qnO4LVQwacp7qOe8xssmz6QlF4C54ZdXoOVNOLnNRSlp53p5u4rtVva kK79+Zp2ubAMG5ragNIF0HOtVZAQfMuA/VT5CY/HkG2LN6dO9j6axfiNRWn0TSa9CNUhT9y4dMUooR a+cuZ+BO0r73YQ6ObskdvIi8qXOp9Krz8oz424RCAsQ4iGehcBxSefaygo6cDKHX7EMqLc3th6sCpe eRx9rbxRLu5lYGZUjPmhedi8PM3M6LTKXW8EYARiC8wRI6aeAcfOPKGPKkIOgmSeCoVOeYWd60SvNz obm/djo7TUnF+Y3YCUd9A7v7516U0zUCKtjtHWD68PO8uuS4ZSX1Vkju/oym04AyCIi21m+YTZERD0 37SLOrP7BsZ+2z1+1J/Fs9V42HSI6+MHTxMVaRjYYk1IwwuHUPXWf/pESP7VZw8eTHu3Wts1CXyjbh VSKiTguIVwlS/pSsRgzKobBCfPEVEv+Y6Vykh5O0PoEl6qc/m0O4aiaSva0jZmza9EqluglhAdsz/h sLdO7+5kUGTrm+XZG6Xn/SvRGnjVoeuLq7OTPC/oacccZYAWfF3265sTj0OlmaPfIFnU9R4XmFGxA/ AvOIHKZo/eVcUxbuNLk9Huw8IiyyxfZjgUxKVTaais9/IIjCRfbVkVTKeX9A== 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 | 193 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 162 insertions(+), 31 deletions(-) diff --git a/drivers/ufs/ufs.h b/drivers/ufs/ufs.h index 555f8a6857d..a1006b80e88 100644 --- a/drivers/ufs/ufs.h +++ b/drivers/ufs/ufs.h @@ -712,38 +712,169 @@ struct ufs_hba { 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 { + /* 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, +}; /* Virtual memory reference */ struct utp_transfer_cmd_desc *ucdl; From patchwork Fri Sep 20 08:00: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: 829863 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705746wrn; Fri, 20 Sep 2024 01:03:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUmS9TpuDInp8GrLtuMEHeLPA9zMvpmYgasBn0exgJ8hb15PPVjlGRBR1xUjVKsxnGkwz2GjA==@linaro.org X-Google-Smtp-Source: AGHT+IGz2ZvPhraY0o+7et6Fz6nqYPyXV6s5HbWObkcV+536ThkL9OJCSf+6ie328wdamaQYSiUB X-Received: by 2002:a05:6602:3fc8:b0:82d:16a3:55b3 with SMTP id ca18e2360f4ac-8320b31bf23mr142556839f.10.1726819387873; Fri, 20 Sep 2024 01:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819387; cv=none; d=google.com; s=arc-20240605; b=ckl2SfyhLBRSx8Eu3cHpunZzEFixfoTl28Wza9kth7HY2BT1wInlY3DbMpJvpDtbDf 0J/L9gZLAbXUidXfvDZKbxxZf8rHIRvyfXO34z5zU85e6hpgyfgrVNb7V9CFXjAPqcob STkAKI37/4adqEnC/yB8bhmsvEKOX9MdTbkF7LATdleyb+brT4hKi6kBQ8IYrUcqB2/K QKEXJMC5k2Z/mUUpc7JBIf5i9CfunyO+LlowbIbkfAz4oqILBCvQR4q6/UKL0e/mC1DK DYnOs0dAfh6IfR8xRb5VRDwumkzCG+HSJPTK1/+eihYhHuqE4SyDEmUgKPpeibZcqJ0I w4gA== 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=0ppZigcRgYsvrcpoMpFbuoplFwBoMZF9Mg4SkAyLFG8=; b=CAT8LxJKEQpaDvX3GiHXBTI5zcvJYCatl0WzcOX9PBaz2N4yVC+Hhq3NN2vGPY51mj Rzg4klIt4OZBPnBfpVLeUn1c0eUu07otLfHRfL/obVwfJZBA6ma7CB0CwjrG15qyuKwQ hYjMj6RmTqk533zwV7sgC2yXFsHHrhWoLjej4Se8uqXQic7wFHJd4pCLFbbQmg4JClrC fN4GZrhbQoRltmol/7jEw1m0gTV2q5VfJqVvf0xfWEadvb968dXrUbNdoFTFjGzQjn7o zCcCJltfsLy0/QTFElGBxvqrF5DpVp6NUtv9Or+fMx5Aco8pkBKcDhPniYNIEqeLWVVG mgqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VMbdVQde; 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 ca18e2360f4ac-82d4932f438si629100639f.104.2024.09.20.01.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:03:07 -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=VMbdVQde; 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 D59F08942A; Fri, 20 Sep 2024 10:00: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="VMbdVQde"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 72679893E5; Fri, 20 Sep 2024 10:00:48 +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-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 A0969893F4 for ; Fri, 20 Sep 2024 10:00: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-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3770320574aso1077160f8f.2 for ; Fri, 20 Sep 2024 01:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819242; x=1727424042; 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=VMbdVQdeAne63Hq4xPDWgFlTE5UQEXcizx3XKOOINiwAimr94UTBYXUdTzkmbFM7Mn bXSptTHP5tecmV5fRFK1XHjfWRDfc742Q4c800gmK8yBoCsBysm/nH7W2/i3pJytaO/a +6DTw5azKTGTm7RWxVYpcvtfuvxu9ON0xRJ25d+JSuOkTlcDDgkhXBowtBk31FJUbq9K 5KTmvdJQE6IAIufG6lyUXEZzRvXaPePUC0U3pCTNsImhCxzOAF5Ya+Di0udro5U2LO4p bz1vuMp7Q/dxe9HuUJb30yhX0KvKoLQrjWmIlX75IzqzORxlNwhlimtU4X3u6oriVWbu eQIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819242; x=1727424042; 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=nfQwEA5F1HHCgSQpUBl4rIlmJWXutvOGtkyT35jY2bteYqdubewf/cmdkxjtpi6fcH Kb9c6/SU/9jUQXAASem47eEp4/gwALlCK4LF9DXLcpWrzd+Xnwn8+sM4k4EuEx52jcAp tCUfPE3Qumn9O/tUS+Tp1mh2LsVlQQvDiIYUy9WBgiz+qOk1SbmLsiBIdAUAfFe419tt 9+3IKKblDI53vWSYMODf4K37OKYMlqRdn7zxTCHbn5xi1viYKXNeNad40rV9nPQArwXJ NfAo973mdiI8YlNDIi6EWk5Iev4UR/B4JlgxjoGtAOeBrQZetDDowCr2Snnz5YFmN/Ix RPtg== X-Forwarded-Encrypted: i=1; AJvYcCXP/ScOWrM9kGI8VAaEl2gPtFnBqpD+CKb969keW0lfOdTqpOP9ayRhszuT59/y5iBepwd+7dw=@lists.denx.de X-Gm-Message-State: AOJu0YxJ1F+SYWUjU2wSdMboBAP8kVIro6Ss8TbXQzT8w63Ztevjh0js VYqOgoodCYe32Z56wCGjCEFdGj+IvlubrJUS76QInIu21RHBsuGecPdwUWFvIjo= X-Received: by 2002:adf:f7c9:0:b0:374:c651:4abf with SMTP id ffacd0b85a97d-37a431be88cmr1091138f8f.52.1726819241969; Fri, 20 Sep 2024 01:00:41 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:41 -0700 (PDT) From: neil.armstrong@linaro.org Date: Fri, 20 Sep 2024 10:00:31 +0200 Subject: [PATCH v2 10/13] ufs: Add missing memory barriers MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-10-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SudITlYBYW4VtV7kARszN9PbbU14MjvwAqJZpG/ LqnwuD+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rnQAKCRB33NvayMhJ0cpnEA DMvYZ5wVaJKtU/g7M06PPcGlnYFR2e9m1DBtTHWgeK7hTQuf1C+cTF/30LmCmFDK+tnbviwwtwv2wK 0S7JcQHX+a5gAW9/Njv820rd/6V0eDY6X8nMmkrbVQ7qYNPPcOK7Tx6J1opM4NICHJxZ3EYAzgIUlt 3/CW3mHrhoH+g7nWl0DSqfAxLrcxuSoy62CD/EN+AXQYVwcRPRpimPVNuh5i/fM62TMetwO9ec8JFy Kz8htx/X5yxuDh+fYbzzOD6EDg+OYAfZZ2/+/u8o7RzGYxfR2wrqx07XljpsRwICOUJDusmUiTRFO+ Qj9d0YxRDL8jk2fNS9x6xCzpAw8ViId57W6YUOREeSoX/SGGb0bzKDkJJrvpQU689D8zjDfp8Y6Xpu rMMarj7LMH41DPLF1cPVU3uU7huqrw3sGD8O2uWdxw6n/09TlSDKrz+KKfdyWzzfykjVRP9doKvxvj Gyw1OZqLl+gPU75b3bmnMCc3h357GOXD6js0B8bXjqfiP7pEJ6h8Z3LbuurpuBNjphkN68auSMZSD7 DWzEG/SmbAQtjMsi0Rqd603R1nCoBMfZ3j4OIXoqC2IcvWX8ewoCoeMlit6dJ4Px+/fEdfrEGrk6Fm ikRt6Xw9aPTvpZsnEyk/3HmxQgt9EmKmiflpelt27ZaZFhJf9eu2OMgk8m7w== 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 Fri Sep 20 08:00: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: 829861 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705598wrn; Fri, 20 Sep 2024 01:02:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVrdIF5Wj/14VOd+UA9eEYlZAYR4SGA66wtj5Uk9GjLrpL7a1ZM962ZGKOTMUDMVK2UshTetA==@linaro.org X-Google-Smtp-Source: AGHT+IEKTeS4FjU2NAidxYQytmt4wtt3owWl5JUTIiCyHymTi3PTzIwLXdLtXeS/ZL1JRDq1wWvw X-Received: by 2002:a05:6e02:1a85:b0:3a0:90c7:f0f with SMTP id e9e14a558f8ab-3a0c8cfcc16mr21271955ab.15.1726819361827; Fri, 20 Sep 2024 01:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819361; cv=none; d=google.com; s=arc-20240605; b=Hvpy5iEck3LcVxN4UNuLsfjuVMGJ6ofkGrAa9rK51RGj33RHSlhECgYX7gRVtsOmpD q/CEHMRxOluxD3LSZa7ar66fR7CMkz2gZcsDs5KhpKTU69g0qXiMeG00vgJyNmQOSpSB yA4zei4DtQ2gL8bb+k5s5P8ZXDXTGe3zAitlsi26/SnLPYAFmUFk024rDGGuurqRW1mA mbSYtE/NE27MA1RM8sDVQugUHR0k9dfrRXr4V9sYUW3V/sgiFD59b89t+PMv2uAmw1SX 2sFjqAojoiD75rMCfadWVgtT2mvJeDIA2O4YZBHCaMxImbyTm/tC1gd4mLP4bb5/NQXt GmsA== 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=LGSd7ni7TPs+KxgIgutL2nK3ZuksC/bShxx12GhFYrk=; b=AApR9ImmUKE2aBdjhCOMcNHeqgVHmVUQPlvUDDLadRB4rBoOFUNLKlrFaJVfT2Tk3N KX6NB1vMUiOCJvDUMq0MrDLvrJmSpniDGWZdMqO8eKefZFplLGFr3jOIOoRszW8cPmSA JammaVpbQeKCjFSzyhVparuj5SnFOWEGSXJJarWwN5ZwpHn2Becg/RDEUnlQOkGgKXnm CDRWP1YccEG+cl4oLzlVKzSo7W80nRXOr445Qb8MepUFqtIPX0x12IyEA+Cuku3PcCSQ xHntUTeLwKY89SehknqAosCwhsEHMO3PZMPlPA8w3FyaPE+ACJvh4Mbb91McY2EOv+gk UtZA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R+VhYfrX; 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-3a0ca87f541si4503305ab.24.2024.09.20.01.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:02:41 -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=R+VhYfrX; 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 23AC2893E5; Fri, 20 Sep 2024 10:00: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="R+VhYfrX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C9C989430; Fri, 20 Sep 2024 10:00: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-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 6BC9489420 for ; Fri, 20 Sep 2024 10:00: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-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3780c8d689aso1122141f8f.0 for ; Fri, 20 Sep 2024 01:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819243; x=1727424043; 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=R+VhYfrXT6JGKwI3mRFkYPJIQq2cDkWAaM9OmbKcxNjBA/ZRV/i1KC7uJcsowIz00F VQmNzL7cZVS1n8eoGw0Wh/Sf8InR8IgqvPbGxsUnN1n49mof812fhEJwwGzYdKK8KC0S Rbf115bQMpD8AZb0zYeRkcUiVyxKgoXEY3gBw1O277HlW+Mz9JL5CX4J9tKfIEnV/s7E m9kjFxFMpZrcwohA+ofU/JAp6Chu39kRuypC1I/CZKhyVxYmH1rTXBpGYh+gOUPecQZN 1V7fW6gZcMxL6eMbaSkzTeWvUc7b94dsmtuu/kP/mCHhtQpVcrhOtKewfT7zS3EZUaft P1FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819243; x=1727424043; 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=te4H585VDy4Ky8rxL9NaLikPE+J6J8BI/7V46mmFeO+Qv+rZHBiGsUyVR8RrkJiG/5 BOQcxUPJVpq9QDEz+W0IVNQafLLYhQjsLoh3dlX+0dlXCnb+GUUZ/a6y1pWpmz308S+/ VMWH/Vsm/6/IsEfRZjbqg7Qn393H6cCJqLR5TnBbbMwsDFGrOZ6SeyuhEe9+zfW0qkqb ZeyZNESEsKR86QBD8jA3ibx833+2yJt+8+u9opbAYXuHrSxiRi80iseiEGhjz9KKeEMf lsN4KTelIvceItlZnAXehox1djsfQr8p3CibPuNXcWQErPREOfwoG59JZ4EmFg6dJjob iGaw== X-Forwarded-Encrypted: i=1; AJvYcCWLYHnuemOIunqMSsy83qpys0lsykqKKrH+h5N8zB0TbgW9HNHtq6QrZVbnb/y5Gflb0mQOuMc=@lists.denx.de X-Gm-Message-State: AOJu0Ywh/XG2j2cY/ZURdZnokbRxRVB+OwNNiMFmyEjcPocg08XaP7di h+m/scP/aL+DGT8K1BCTEr/2AEUt66fjqngdjdP3MUVqtQD0ywTw3BF/0UuV6Vw= X-Received: by 2002:a5d:4f11:0:b0:37a:33d5:91a8 with SMTP id ffacd0b85a97d-37a4318a40emr915144f8f.40.1726819242780; Fri, 20 Sep 2024 01:00:42 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:42 -0700 (PDT) From: neil.armstrong@linaro.org Date: Fri, 20 Sep 2024 10:00:32 +0200 Subject: [PATCH v2 11/13] ufs: Fix debug message in 'ufs_start' MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-11-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SudEiqDuF+S2LZ91DOYzQEt7bet9jL7d3eRKYwx JS0HH0CJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rnQAKCRB33NvayMhJ0RHAD/ 0Q0j8vdohh1UthjnYGZS0eVQig4ei3+FCpJ3pUvYUIG59eA9fEPu5XyA+lJx8cEev0WoMU4bqWhfdJ AGTbFcK+3hAhgXbCVhxTCX41wMu+9WYlPA4Apz4fz1GjG6eKahechpfvGvq5eF4+1M5ticvOkmE5zt X76gYmdzOLkQ7VvR2YZ26/B7nvxloB/F2QMBairZFkiuES3/jExVOzKDi4zQvl60qTUWY/C6Nz5quN B/pOYGMPVEBJ7AV7ExBT3iRQ8gv4l0RVwAR4WqxDM8SHeC5PctEHC+LOKbm2tmS7t7yxKOGnHZvpTl WoYd4jqRquksMp/JSmjB5ffqPo6mSUf7tsBMuI9S/3F2mxZXmlPbCixkQiGanieUqplTuAOVjolnaA 6q7ZUM9+U/6G/7hYkOwk91JrQHTy2XlkyVAEhaLD01Lb8oepoodO28Jo95+hp6bZLj6e2uLz0pI6MD 4kTbJxYXde/2J40JZGkDGlVjMxEzN8z3xrqxP8qb6/7Ca0GS3fr9kPBZWV11rhklHxBxiJ1ipTtIQu fQojmuLzZ4moORJg8z0abpqzeQ60MMnB9oQy5kmmYFOFcnRVDPbWnrVAn0A3JFuHs+Qv4Cqz/IVhar ElUEO/Aay22yyms5C7+9ozJabfx6TBGgB/aWS7xaxP3ePLsY5RHOHRvCGkyw== 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 Fri Sep 20 08:00: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: 829862 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705672wrn; Fri, 20 Sep 2024 01:02:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWUQyzi/OVnRSA7Gr63uLIO4fk3Bn0oB5wLhhmUTd3GXvMYmM0nBAMrfCQUDJRdNtvuk/Hi8w==@linaro.org X-Google-Smtp-Source: AGHT+IEJzjz59yPM8iQhJsynfxomwb21bbomP8FmiAUz1RxtO+sl3wx7ERCH7PuG0dWsW3Lg7Gqi X-Received: by 2002:a05:6602:6302:b0:7f3:d85e:476f with SMTP id ca18e2360f4ac-83209b67821mr163920139f.6.1726819374584; Fri, 20 Sep 2024 01:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819374; cv=none; d=google.com; s=arc-20240605; b=PUVV2lLxKW+/BbazPicEE3q5Kxt6KK9W65CE1hBqTAMVFDhdF7OoayDopvkP2qUfcW lUIETLbl5qyCFAh9/Pv/vuoPPfX6q1rhSay2M7kHWNt3aBmq3wJEMr0TynApLHR0KDOL 96uaowTN6b8MGC14RZTwp4UBqXxUU28p15sdnb1L0QpF6+S0OTyq9owC6tKhB9pxYSdP QHK1BbCcR3WpIzYueV3TRNpnuZYFjf7fVmRZQU4cIthV63zYST+U2A6A7lAEYg6PpAqU YkUkCPfFpJU0tDzevWY4b6lLJe6m7dmvcbZ+tRFAMiIKKu1SVqH3bNmtA7qLFwLnYo1W zsoQ== 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=7fRqUp1HPXYrqmS0g1Vf1orLoufG+H4zmgHxaiYsX5s=; b=kX5WPoIBnJnKs+diN7IuQMRo/6l3n754UMb6ItukTlCHp+JXlSia4jsUoQK1q5+7xj RGMAUUYtz5Pt5F6okSapTvFOwoRaysXXvNyAKIjQcF8GtLJsGZls2oZwq8wjGG1tGwIQ 6iCY0GvUm+YuHzwVz8GFqg4iQatxGcW4CKt7T9vIOKVgTy4d5CtFAsMzSfpTCblkmy6s VZa+URYBN660dGma70rccYjLjReNzW3n7jKD2J9Hp4k5B6Lg7KBwgZIKBxyH6rIV5ZWs 2/YGmz1R8lATrywZhK4j6CwidIH+JJ1y685j8vCwgEL4D9bNUTinxmAKqpAdgvLWRZUo IdrA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gFDezDRn; 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 ca18e2360f4ac-82d492bd06asi604615739f.67.2024.09.20.01.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:02:54 -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=gFDezDRn; 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 7DF4D89412; Fri, 20 Sep 2024 10:00: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="gFDezDRn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E7D1C89431; Fri, 20 Sep 2024 10:00: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-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 6278189425 for ; Fri, 20 Sep 2024 10:00: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-wr1-x430.google.com with SMTP id ffacd0b85a97d-378c16a4d3eso1792621f8f.1 for ; Fri, 20 Sep 2024 01:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819244; x=1727424044; 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=gFDezDRnWGY2609P6BmYFZw3srmliwgeh25IsmT1UKAkeHU5dzQwmSHmP4QUJjlwEC /nlr04T2XLsbSxK2cZ7cUJhfvtLVBltvDM7PVRT1844d1NiYEA07soh5lGoExkytXAic zkcKVxZzxKxi/NWQ+YF6xsr+yAyLH55DaUEpXQEiwgnU++opC5UXZ7s0ZO8iNRChsDYr wXd+diAeyObtdT+R+1UYM3r8odsry/g4s0V4nA5Aiz2dPqd7PBor9msAueR97cDKjklo x467k5fG8hIHRpv04f5zIRAsvEJ60j8HOJLWBhrZ5/W5pWGI3Z3lHbH8Nru6KWhltOmO JnEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819244; x=1727424044; 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=dxk99bqOdHx1/scv7jqcD7sUsm1Ew08vSE0eTXD2A0D1GjtmApYq/3/ZEVQmxiDs7E rDhMh/c8FKA8gwMq7ZwfmqBPAelTCb8hSAmAYvG74Sy/bxIf78Ibo1ZU3FFzg5uimiMs f6UL1Q+0utROBVmrkbnZ/wwp4ehBwcGyPJkycnUMFNICHhOL2itvGDvf/EKOVfBWIFB3 Rv4jdx4uF9vAorw3zk8NWBluUqG8O+ZrQgCyD5d8w1UEKyePrpW30XN9hMSeE0TJScxv 2/oIBxBtQEzuMWCiE2cr7SAo/9ldqq02gBLp9IoDn1P8nrRhzPK62LdFa9OJEzB/0Zdf pyOw== X-Forwarded-Encrypted: i=1; AJvYcCUpbs6GuN4IUOMnz55fZnN0CNpAnoo1UNYt8oJ7CFnQYjzUwt+NyS+EROroandg8CcUGk2oIWM=@lists.denx.de X-Gm-Message-State: AOJu0Yx6I/sfV+Qeku99zap82z1dzOAkwWYKaB6/YL+UUgi2VOn1NEf9 lmIFj5LgYQHuUwAEeDSlh4Y9IQEiaFPknQk6+SyLBRkz0te/inp4WGm1bIUNAmI= X-Received: by 2002:a05:6000:1fa4:b0:378:8b84:4de9 with SMTP id ffacd0b85a97d-37a4225334cmr2130157f8f.12.1726819243716; Fri, 20 Sep 2024 01:00:43 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:43 -0700 (PDT) From: Neil Armstrong Date: Fri, 20 Sep 2024 10:00:33 +0200 Subject: [PATCH v2 12/13] ufs: core: remove link_startup_again logic MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-12-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SueZL6EO0YXTUlMm0/5tsgHdFBj+ayWVGVaoBim w87ueRCJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rngAKCRB33NvayMhJ0QAjD/ 0X67FrVLPtmz4FhrbmK/ux622rbQTLSREbUzpk2FZIqA5ZO89UotM4ZVypDPRpvv5+34FF3Rf+a7NX 6psEtWf1H8ReqXRJboIpBTYOhsehQSnvpAZbEnlv7Lkiw1XHQ5+bZcWfw0YFg1VT9X+gttlvbNksmB OIDj4Pd98pTq5JhSinxHSL604SdTBplZaF6RXG3RRrfLNz8QR94mkdjTM65zG7Qq8gVx4sZyDjY/l0 9YuQUqnOWTjM1Wc56d9cSFvybsvK9j2VJon3nwivPXoUYB7Bf6Fu11kM8v9vgkjEDOkqFjO966gSGD bt0ttieeo6i11TSbAfot+037ArGnTJPwH8jK/QYCKiGGuf8DZUwYmc1n+fsI/dPbbE/5r7xzl4JDc6 e0gjPIKsFwgJHk68k+AV8HSuDpDyI16YgYHRr+bedKkzysyASZWwJ0nItFPS/OJEFi15meQNT58ODo jC8rDMpCj8pgmN1x7rFIA0W40yJb50Xl/Zx+iMj88/203s4cC/vy786A5oxQdgRPI4p/xp/c1EjaER 1Q2QLmi8mJv4KnKUbgzS3Tj+UC33OtzRCUEJLJxxispS5BjN+/vq4r3CiHZ27wXtXzMzGy/8nkeWky OdfpGLUxdVJOtvT4LhveUvCmikEw/O0YCl6iGZNUlCISKVm5OWNo17DUnFNg== 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 Fri Sep 20 08:00: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: 829864 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp705822wrn; Fri, 20 Sep 2024 01:03:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUugun9a6lFJOXKZuOwdk8ao8wsFaimPBT/5KMPVdtEPyTUzY4cvF34gprFx1OhAbeQSiHd0w==@linaro.org X-Google-Smtp-Source: AGHT+IF7RYCbs6OGEzXb0E5lPK4GTbZy3yvNHjxfQsCgUZm2rFH9QMcHfVb5FmwWASL52TZ2OGoG X-Received: by 2002:a05:6602:13ce:b0:82c:ee6d:a7ee with SMTP id ca18e2360f4ac-83209cdf027mr219629139f.2.1726819401343; Fri, 20 Sep 2024 01:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726819401; cv=none; d=google.com; s=arc-20240605; b=D23i5+tV+23xhN+Brl/ZuG6jcgnTmJaITeNSfZphKj/Ed6+GC+2N0hY7zvQd/Ksq9P ym/KdanY/ZPH9ma+rNksZbBmiK8htsRZtOZj3I3q22qkefSAk589Q9Hj4IhZXVkaMg2Y rZ8aXVzSiY7+cMi3TI2NDO/WRSv3oMoUT8WMFgsQviYn6VFTk8HWGgssyVDLcMjaXxZG Ou3hHm10gWDxHp3jCbneZ0eHwZ2WJ2IeU59Pe7ky5NM1E1rhyemUXv7Eo6EFl5bVa6Pg qRUZu9XGRLgHs5RZUXa1WW60wwAJuLIA7fyQB85qLPkTlaiPBQ7IKizDJ+uWPTfuAtmn tJTA== 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=ssHDlIDj2U+TZVNnEPV+NnFPRG2DAFF4QGu3t41nmoI=; b=fkO/Se6uOIqTj/90VhyQS4ekTOWmI4+aUaLXTN9Xq9Ui7sDpNC9r2+2KNubJrPVCxW UY5TqsDxXemGCZy/c8foK1Ywn90YaoEGfyCm/gTAcDxlciGDCdTsar2jonvszQ18inEA 1/hRxlFtgayZwJF/pB03V0OkOm6Ke4GCAzly1YN1b9Wuzi7BtdHzOgsM4UrQ02dFsv3A wEZb0ewjF0TudauqlCT/ipoq3X2nvYVouiEJTc25hCgdh06M9ETqD5/1KLicYYZkFq+3 N0HBzhIngCSDKL6iOk+V4vy6VIwEMJb1vkYu5LKKdiq1IaHllUozOXfB2ojHu7XgZwrC gh6g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="M/tqhx/3"; 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 ca18e2360f4ac-82d492be24dsi607311039f.73.2024.09.20.01.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:03:21 -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="M/tqhx/3"; 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 3B419893FB; Fri, 20 Sep 2024 10:00:56 +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="M/tqhx/3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7631389439; Fri, 20 Sep 2024 10:00:54 +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 332B689413 for ; Fri, 20 Sep 2024 10:00: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-x336.google.com with SMTP id 5b1f17b1804b1-42cb1758e41so13744285e9.1 for ; Fri, 20 Sep 2024 01:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726819245; x=1727424045; 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=M/tqhx/3ImytjEeeoXFXWECZhuHplofbHks0JhulVjCBS0jmvQ/BTIKpPG3dkMPRuV gyILL0J6kB8vmULLYIImxZrHi+u34SU8gh7Y67rc80c7wncj+PnF1rEo+7wRcvVVZdTw HE0mMdRFahvQ8Co133mgKaCCTjbvUlTLOnG9U5mbReou0aIjxi5L6p/sawrmgSds5xEN PynV5wZYAysS2Kug863kQYs5O4TQuJhdfW4Vv3gvGEv8WdCpBk9gCgNBUV07uTb8ODat HAywangDmdG05MCd78XZK0Aey/H99hoquWuOnwmxxmPH7buQWVi7lgYZOWq2vXPwmiPe 9+bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726819245; x=1727424045; 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=g8NAK6/qrmz2tZnOC/RyosCpHrZ+iVOvbZ/OMFx/31LTKq+kAWjoCWhiJUQde463jZ K5qjjNGOZa8K2WTV83tvP3lWLq6cow8kyHr1IkVCqbAAHLKSBr5TCn0+u+JZPB5rSzy6 2oUh4Ch/xM3AWioJXVhY1j/H86k/1MHrMKx8sf8+k3MLbOoyt3vckMFTW6ImmRW/Wgbf CxF13Zcz5hFXZ6yNZJ6JxRRoLxrkRWvL2TZwsIm1+NGlGQw096sXHzc2y6oP8cIpeSUp 8EJky0HKemvZNMv+eRi/zqVa/Lqkm1k0D7fFuG8EgfHNrnrg0ToAhp2CVP23biJ1woBN M7kQ== X-Forwarded-Encrypted: i=1; AJvYcCVwqezgXPs8M16iEtrlqXjh+ljFtVspXPL7rQGNQVQqgrVGSVg37N3YGA33DiI956/FsTQHeXg=@lists.denx.de X-Gm-Message-State: AOJu0YzW0Y7gKVilqO8YccOpdM6HzqwCVfBHB8VuqeK07mbKeoC5PyzB b0MZa64unR9U9+wDt2C8FXQGt8C14Nm3eiUFfqBlBXOyiRPcmWCalobshDvz0h4= X-Received: by 2002:a5d:47cb:0:b0:374:c95e:1636 with SMTP id ffacd0b85a97d-37a42265691mr1138817f8f.21.1726819244621; Fri, 20 Sep 2024 01:00:44 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e7800313sm17059497f8f.88.2024.09.20.01.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 01:00:44 -0700 (PDT) From: Neil Armstrong Date: Fri, 20 Sep 2024 10:00:34 +0200 Subject: [PATCH v2 13/13] MAINTAINERS: Add myself to the list of UFS maintainers MIME-Version: 1.0 Message-Id: <20240920-topic-ufs-enhancements-v2-13-65ae61e73eaa@linaro.org> References: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org> In-Reply-To: <20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@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/ZANAwAKAXfc29rIyEnRAcsmYgBm7SuewkcC83t3WpjcsYCkpXPs7vBVzbMxCETZJ3Ef 64I0UqWJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZu0rngAKCRB33NvayMhJ0TNVEA Chv+8JI81NGOUnRbq6d1DXgB1ym2JdBcY2oY1aA7eaVDH3FOPGM+54pOo9ZIWj1T2PH6+5be/lY6hr j0jJDrhW6HpHAVIieKYUDdFPCCX/dggwxPPK/jlrR0DV1GLv8+Rxr7tip/TDr09O/R2maBrBeQPCoL m68Whzby/XT87RnbJnoDOcWSQ+KIql5q5ntrnjidcMcuXZPYUu6uJOXh+ayrhFQyfT76dvqkf9aeyD 05BE3TL2WVwM8FSjlZygXccf3DI/tA1EAn/JwmgdHLcsgRTPlm5jqtCJ2T02iQja7OgbiG4iGW4HTA QDLO3EqErJ5nELiSjIlLnUKQr6FkOil70ObX7Y5P1udzKjhL8NqYrrr//u5AG3VT0KOL2siQjdoCj8 J838FNbb30IxfDTtqGLnIdYuv210zlTKbL4HG3i1i7jDgafBmjsYQsO0x7fwrXUjPP3lSB1NBu6eXN kyD5nBSu6UA3/ceWbEUcEuYzTl49aLnc6nNex4FRxf/ZK7n7uBknfIgsE+sX+/gatApqqYBWk3dOSH 9PBHqrwrNFaAbxQz5e0JQ8RVsvQQ8U3LqpX8WtHit5LPUgWX5bk9LNZjj+jfM12NTSB6VKVi69VPnu lxib0Qcq02cSJyq/c8P1uZubGC7lHiflqUmuK7L3r6/IbTJXq0AC8of3y4Qg== 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