Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp956571pxb; Wed, 3 Mar 2021 22:27:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxP3A/TH3dDgPhjLtO968RhVk7w7Y0rSbFvFQmtvZAT1Iwdbvqj/EArDlXcUQSsKV9N9/dc X-Received: by 2002:a17:906:f44:: with SMTP id h4mr2535288ejj.204.1614839264535; Wed, 03 Mar 2021 22:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839264; cv=none; d=google.com; s=arc-20160816; b=LwQ+GzzJgvb/U3Lo6kusrWKZ6CNeF3HrXZCXG5rBLiK+o9mrbNWzC3uAf9CvQINTnh RmAjGh1vsD+rb1p7n14gicE3qz7ujE/skgDnuNjzx0TOFTZVi8wz6qX+U2/AHNTW6OTE tpcChUIy8xlWcALYA0RVsCidluEFq6vNTInKyYCyc1T8dZ2ZV6yBCh/lLKDJ1sZW7l55 KZeAehPsmEnuTDyOdyk5y2k7Fvsbr5eIToiUI36K1QmeC+gKXPa99MDpilnqSUgWw50y x5jsj8WAx4b1ionedfbaXvOWjhuJsUWjoO5GqSHcyV98oLakiFNvjXRBdk6V5xHdHov0 L/ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=OI5tt0sCGttpQoMssZQT9mgbCLmB50Zsl3yw2ts6M60=; b=a4g5uhZv0FpGXOimpIukLfMguEK4VN+QpEQZmHZzLnrQzAWIP6xmCNI+Dl0RjsW8A+ Wm943oqXLsCs10XMqxH5ob+V6cXWwsLolnZZWcOqCpP5iRIiTUda+qxqqyqwTpdj8gM+ jcXGDVx6+Eav8K170nSPLBh4avn2rNPpYPoX57g5wfNJ1WVMaatVC9iBSWVk76bfAD7q S3IavDfyGanVI6zw1Lx1t+e7PH44XWLQv80vSaOfJwPL5E/rct6a3c0n98Q+OKYvCCNw YwNgJKd2EFQfPlqJl9IxZpNJOagJDTfbH1XnKyR59yUWstzpIvDZmqMGdbfTZTcbDj7m lBbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CYAZD6EW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r6si4750198eda.292.2021.03.03.22.27.22; Wed, 03 Mar 2021 22:27:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CYAZD6EW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351021AbhCBPrF (ORCPT + 99 others); Tue, 2 Mar 2021 10:47:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446130AbhCBNQl (ORCPT ); Tue, 2 Mar 2021 08:16:41 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CDE4C061356; Tue, 2 Mar 2021 05:04:40 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id mj10so14994728ejb.5; Tue, 02 Mar 2021 05:04:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=OI5tt0sCGttpQoMssZQT9mgbCLmB50Zsl3yw2ts6M60=; b=CYAZD6EWLrsXDx9AZXRGjCCOSs9xuqFQve4dZPSRucjJLNwGGAb5XVwo45Db2F7i1j 9hyavalHcJu+CWOSo05dVMfSXicLOMWSIVU1WYY0h7i/tO62oc7lItFxg66XX6KBRvPq p6qJgLsjsLJ62XehG6tfld7ASPnWb3bhIP7U+fvm+C/Z9eZYEAT3jyrX5Q6VHw0se2p0 I3Er9LzBmsQZcsRpK/6l5kz7exE3ZHrDukDknStuAV1owa65AdiqjqVX8GxxlGAvQTwx kMe+wF9Q7DUtQk8E13Bh1GV3inZLw8myiAwnTVp9B6HJuK0YgmG3FhsYWubLts0G+Lwj RDIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=OI5tt0sCGttpQoMssZQT9mgbCLmB50Zsl3yw2ts6M60=; b=PhsDtGH4yeezSO9Z3XlbAdohPNt+Wory9KT2NYCV09Q1oKGIcjsLjXNJ51qhRAcKiL dn1JprGBwFMiH1HqEkTBCK28It9xsY09ux98uXBw38V9ltiuLgt/2qivW3qI8NoTW3b4 poR1j6EYtr7htwOAgwA8jCKOnSRwnG6weWCnj0HCSOt5gZ9QDy0drH7ZfBXQJk0YRjL3 2HYorQ4y3ipovdGodBT1Ki/lj0P4Im8EJMhwEWarbX/XxxyS0LteW+EEWUfDBjpoG4qc cTwuFMmG5b28/vfmPwWMvUy/k97neSoc97/q7TYsKMamtPxiUh8T1B8Fs85yhdmmwFJB 0C7g== X-Gm-Message-State: AOAM532nKgPK9UJ4M8Y1jKcgEtFzKflaqsFW6bG3BXpWWIee/lCIpGCM 9NDLkQt5F/zRoRPB9yXIoAs= X-Received: by 2002:a17:906:38d2:: with SMTP id r18mr13415620ejd.104.1614690279372; Tue, 02 Mar 2021 05:04:39 -0800 (PST) Received: from ubuntu-laptop (ip5f5bec5d.dynamic.kabel-deutschland.de. [95.91.236.93]) by smtp.googlemail.com with ESMTPSA id 35sm19304374edp.85.2021.03.02.05.04.38 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Mar 2021 05:04:38 -0800 (PST) Message-ID: <58e8dcea7f3567001c807ca9399f191a4bcaea40.camel@gmail.com> Subject: Re: [PATCH] scsi: ufs: Fix incorrect ufshcd_state after ufshcd_reset_and_restore() From: Bean Huo To: Adrian Hunter , Avri Altman , "Martin K . Petersen" , "James E . J . Bottomley" Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Alim Akhtar , Can Guo , Asutosh Das , Stanley Chu Date: Tue, 02 Mar 2021 14:04:38 +0100 In-Reply-To: <5fe97f16-406c-c279-b108-d27bb2769ed6@intel.com> References: <20210301191940.15247-1-adrian.hunter@intel.com> <5fe97f16-406c-c279-b108-d27bb2769ed6@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-03-02 at 10:14 +0200, Adrian Hunter wrote: > > > That can result in the state being UFSHCD_STATE_ERROR even though > > > ufshcd_reset_and_restore() is successful and returns zero. > > > > > > Fix by initializing the state to UFSHCD_STATE_RESET in the start > > > of each > > > loop in ufshcd_reset_and_restore(). If there is an error, > > > ufshcd_reset_and_restore() will change the state to > > > UFSHCD_STATE_ERROR, > > > otherwise ufshcd_probe_hba() will have set the state > > > appropriately. > > > > > > Fixes: 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler > > > and other > > > error recovery paths") > > > Signed-off-by: Adrian Hunter > > > > I think that CanG recent series addressed that issue as well, can > > you take a look? > > https://lore.kernel.org/lkml/1614145010-36079-2-git-send-email-cang@codeaurora.org/ > > Yes, there it is mixed in with other changes. However it is probably > better > as a separate patch. Can Guo, what do you think? we can firstly take this fixup patch.