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)