Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7738136ybi; Thu, 6 Jun 2019 00:20:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZJ5r2XTqMYkeAclVgYfjXY40WLQ+qz5uHp4ZiGeIN7zg7sD96Rn0gRRTNs+01njnXlyp5 X-Received: by 2002:a17:902:2862:: with SMTP id e89mr49367039plb.258.1559805631548; Thu, 06 Jun 2019 00:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559805631; cv=none; d=google.com; s=arc-20160816; b=HfpB64IhnpkFrbMGdTJ4lE861IsvQwMpit3SOSCCZJoiwj/6Xdi/l4Zknac/xPx3Lu HNJiPS7p6idPRAL2HCoKP+1H6G2E1w5KsyHMjy4SCV4XLLtnrKDsCe33u6YbILEX7rC7 3bXiFwDM7f8eU/rIsQ0Xtq2LE3rNCNI2IMpujDzu0DADG1dc203gBBbdrUxwgZUY8zxh 1Qo/egggDtRz9G90wDgQRHg4WahNVEu/S58bEAt7V6SrT8ooZlhJod+2GcDDx/ZtX2d5 I3QxZx7ePuJmsc21pP+Er5ZBbcVrf8pxT4OUItt5P2qv/jfTOVQZd1jMbPulYHFZRyPe IN7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hcWZk37MluweMWQW5kURRUWLOOrFjT2oPnVPPLPHyMo=; b=MXtifR1coks9nBMV44DKrvpyuRC1ST+JXErBd9EoIRB3VcebCGkTGbynC/mEW/397W PGfShoBxObDPUb33Q3jvCnP344n9KIP4TxsHR/wABtP+q8cwgMW+s7MUKnofva58ZRO7 sAz4v4SKfLlTzTO/FDjkSU7uIbj0l64tnn0Jd2fZHaEcBkIzZFa8wVIqMY1QTrb6lNcx dVsotekDinI53UQHRmmuPl11rbC6uLqvWxCjMwqnCjsf9LZWfSARYWv5B0J1+TQGTyqr JAfacE1E5Fdqc5ytj044s/ocCAiH2BiIlQ6/jTKgENc0S/CtNzWqNl5rrlfGHptihFsO 75uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O3e+gR3Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s138si1129391pfc.148.2019.06.06.00.20.14; Thu, 06 Jun 2019 00:20:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O3e+gR3Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726581AbfFFHRo (ORCPT + 99 others); Thu, 6 Jun 2019 03:17:44 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41713 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbfFFHRn (ORCPT ); Thu, 6 Jun 2019 03:17:43 -0400 Received: by mail-pf1-f195.google.com with SMTP id q17so929463pfq.8 for ; Thu, 06 Jun 2019 00:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hcWZk37MluweMWQW5kURRUWLOOrFjT2oPnVPPLPHyMo=; b=O3e+gR3QjxlY+TukOifhxUhwrU3NQR9N60NyUoUy2uHUzeQ5KzKmm22cgKDvq9AaJa HBGqpO0VEYMp0+DsxlKagVVxBG5mngX5vhbyuBCbFEc64bWcpGSZDbONnglt4HCdyMTT gAHr9JUL56oourAFBSHRUZ9hJubAKsm7DjmHYvMrHhbisgdNMH1KQPc6GjAxwEudVouO pIGF8m/RYSGkUtvnQN1fVj/L+5Vo8t7aUAykze+iK61/eKcNXTCaWI9ACCLz8IPMvXGu RYrFpq+7LQ5/u4AA76LNdgSRPpHxDsxfDMtgnN3FfsGb5M9viJKACY2o0B8cEH2hfUAa rbWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hcWZk37MluweMWQW5kURRUWLOOrFjT2oPnVPPLPHyMo=; b=NwiAnbGLBlOuhTwNUUJ4izX/p4kULQUUIyojaBTSYlSzorWmo+auclaGzM8Qo8gHyG dEi5F0fyBM4eu2pypsQkggylvJenoFFM1g9XRJC4nIift7IJAhcVHWEM+3g6ZxlrDdUT HKWSdEJurt+6svMTTh2QP69NsnACCPSOL8o4qiAnAUoc8iXGSYdFa3wXr0na9NKb32Xy uI/Esaj2MLcsnPzVVhxmUnoDWkXVCDQUvsWTZruOQ9JKvwSzfVRZu4RA/NF0hBrut3Rw PVrFMxG46Ktz+KrIlMNt3Kg8qiDkaiOtaN6f8dQzhFkui5iuQkrBsgxgos+Br1jBdlQr fYhA== X-Gm-Message-State: APjAAAWY7UstHuyU1M6cvLq3oNVDNx4UYr2BfIKAJInXGSFmOe0eF7g7 KEgLQXtv31iR9xo0mJY4VQrxhA== X-Received: by 2002:a17:90a:3ae8:: with SMTP id b95mr13710133pjc.68.1559805462753; Thu, 06 Jun 2019 00:17:42 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id b4sm1058689pfd.120.2019.06.06.00.17.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jun 2019 00:17:42 -0700 (PDT) Date: Thu, 6 Jun 2019 00:18:28 -0700 From: Bjorn Andersson To: Avri Altman Cc: Rob Herring , Mark Rutland , Alim Akhtar , Pedro Sousa , "James E.J. Bottomley" , "Martin K. Petersen" , Andy Gross , Linus Walleij , Evan Green , "linux-arm-msm@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-scsi@vger.kernel.org" Subject: Re: [PATCH v2 2/3] scsi: ufs: Allow resetting the UFS device Message-ID: <20190606071828.GS22737@tuxbook-pro> References: <20190606010249.3538-1-bjorn.andersson@linaro.org> <20190606010249.3538-3-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 05 Jun 23:36 PDT 2019, Avri Altman wrote: > > > static int ufshcd_hba_init(struct ufs_hba *hba) > > { > > int err; > > @@ -7425,9 +7460,15 @@ static int ufshcd_hba_init(struct ufs_hba *hba) > > if (err) > > goto out_disable_vreg; > > > > + err = ufshcd_init_device_reset(hba); > > + if (err) > > + goto out_disable_variant; > > + > > hba->is_powered = true; > > goto out; > > > > +out_disable_variant: > > + ufshcd_vops_setup_regulators(hba, false); > Is this necessary? > ufshcd_vops_setup_regulators() was just called as part of ufshcd_variant_hba_init > Yes, so my attempt here is to reverse the enablement of the vops regulators (hence passing false). But looking at it again I see that we should also do ufshcd_vops_exit(), so the right thing to call here is ufshcd_variant_hba_exit(). PS. This initialization sequence should really be rewritten to first acquire all resources and then turn them on. This mixes init/setup sequence is really hard to reason about. Regards, Bjorn