Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp113443lfu; Mon, 4 Apr 2022 21:26:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuq31YY4w0Csmhawxualo99OVTmsp0oq/oOW8CfXQfWi7PstObwlri7t2EwpF5BspK7rmy X-Received: by 2002:a63:c45:0:b0:399:2629:7743 with SMTP id 5-20020a630c45000000b0039926297743mr1287166pgm.24.1649132804844; Mon, 04 Apr 2022 21:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649132804; cv=none; d=google.com; s=arc-20160816; b=iZIZ3hGveZqgjMDGV62F6G3FtEccrbHhnu5fHv1RXK1V+T7gcuixyWwbq8/q1M1CCx 77UlEwZq9yNOb6OYn/NBO/3J1wrHup2KHFPAHymFQrK61CvWpTMrOojcc8G+y97NLgmN Lw3LBwf46g84I7FUetoSysJj0HKPctmEkiz54UP4T4vj9J8Cf+ES9e5rD9ns9FEKzt2a cQVkp/i6Zc9n2J8R+YN6Sd+YmslAeVneqnY8ekSNxBpD4CuDiqEojBGRS51g7RuJ2aVX iy5G+kVle01uBDrUPACyKw+neNR7G1+lqJ8pVndg71vt5JWqSak0FeFxTw9y6FhjCeWK RLjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JawIlW32rh9zjc4U68o5uxVUC0MZ6MDx0kaSrO8k3MM=; b=wGptvV3bHKU8353vhhvrYfVAn4nipfzWZzQtd+6tlSkSHdLTt6tdpXX9mD+nADmWy2 7PfrLwazByZLkTtvjQNR6gx4Mki7defHKGTFkK62/lDoLlxltA6x1h1+v6emis+gIkME 2Ka0EgtokJjRpiCkO9XtiSEOBfezgJq5xbJAIfcQ+mfcHPCD2XAmMvt4x3u4sz3jOPN/ hJIjePpRQfC5u3rxWyFWRzo0eYFbzgXqVGMPP8HTXqTopdYzTQOydjMutT1p0Xg43MR8 jgIegucuTfYVZXwg3XhoOZTqxz0y7DL5pjcoEguMT6/SILHFuJcHjud4i6Fyl+FxtmiG fJsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HhA+4iHn; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o3-20020a170903210300b00153b2d165c7si3827165ple.463.2022.04.04.21.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 21:26:44 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HhA+4iHn; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6772A6D854; Mon, 4 Apr 2022 20:53:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230403AbiDEDzH (ORCPT + 99 others); Mon, 4 Apr 2022 23:55:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbiDEDyt (ORCPT ); Mon, 4 Apr 2022 23:54:49 -0400 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 970F65C36C; Mon, 4 Apr 2022 20:52:08 -0700 (PDT) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-2eb46d33db9so69146137b3.12; Mon, 04 Apr 2022 20:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JawIlW32rh9zjc4U68o5uxVUC0MZ6MDx0kaSrO8k3MM=; b=HhA+4iHnu8iKgFhO4qSBoqmbVuEe60odV3/yG7URgqR8EzL/mBS+G6zi6ZL/ascG+O rxA6jjxZF5w0JmC3JtK6lmEhDF67laOTmZITuaunjgqJktWe6VoMzFEt8IlNrBsD+jMh mof8YKia5bTMMT30eiBvSUjMjDqxD7hTG4NoZncz2edKVD2/1OpTc67KlFCTRfR3VyIA gM8ISYor3jlO412SPovMCVMGFAK4SJggLpyEhTwS9wXhwUtmPRfduZrMMToGxsbdTteO kqhidbt4kaUnzc9AEAbnGnt74GCopJzc/tKPUSpasVh82cl1CBjizAjlnzAyumZePWBL F9fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JawIlW32rh9zjc4U68o5uxVUC0MZ6MDx0kaSrO8k3MM=; b=1nFlhy/AP3gibrADl+r7d0DvTsbth1wfqHyCvrWhAmgd+OnhAZ6hV5kUQCplU0+2Hl mLLXvLMzpJ1e21d0ZvLGL11JAX7gRthkPY9A8zL0Bwvhve8WjRDCOVHSN/unZgL7xcUN Gw7fyBulCTaTxvfHZeLHsGt8xloT94vh4DkQFzMB9peOb5J/f3cKU0ffCBNdItH73453 MBbyANABhgHNeT/UeTh9Tk7W/sTMunzMzd4/pcOioA3Ty85O2xDrbg0b7fzKr3r7IcvH HhAL9cOYFr11M6keBgf2kPP55EIVr5MYze8aNrFrAr13uaacyMGEIV0HMzxU7glzu0Z0 x4Fg== X-Gm-Message-State: AOAM531mnUNw9qzvLdfn+N6xZKXzkGaJcomgwdP9n3XWMDqSciMqdCRI C8mHmRHOOSNhCtwjGYEIxXSR09+D5lVK2wYBkSQ= X-Received: by 2002:a81:345:0:b0:2ea:a8fa:f323 with SMTP id 66-20020a810345000000b002eaa8faf323mr1139433ywd.292.1649130727820; Mon, 04 Apr 2022 20:52:07 -0700 (PDT) MIME-Version: 1.0 References: <20220404172322.32578-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20220404172322.32578-2-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: "Lad, Prabhakar" Date: Tue, 5 Apr 2022 04:51:41 +0100 Message-ID: Subject: Re: [PATCH 1/2] mmc: renesas_sdhi: Jump to error path instead of returning directly To: Biju Das Cc: Wolfram Sang , Prabhakar Mahadev Lad , Ulf Hansson , Philipp Zabel , Yoshihiro Shimoda , "linux-mmc@vger.kernel.org" , Pavel Machek , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Biju, On Mon, Apr 4, 2022 at 7:12 PM Biju Das wrote: > > Hi Prabhkar, > > > Subject: Re: [PATCH 1/2] mmc: renesas_sdhi: Jump to error path instead of > > returning directly > > > > Hi Biju, > > > > Thank you for the review. > > > > On Mon, Apr 4, 2022 at 7:02 PM Biju Das > > wrote: > > > > > > Hi Prabhakar and Pavel, > > > > > > Thanks for the patch. > > > > > > > Subject: [PATCH 1/2] mmc: renesas_sdhi: Jump to error path instead > > > > of returning directly > > > > > > > > Jump to error path "edisclk" instead of returning directly in case > > > > of > > > > devm_reset_control_get_optional_exclusive() failure. > > > > > > > > Fixes: b4d86f37eacb7 ("mmc: renesas_sdhi: do hard reset if > > > > possible") > > > > Reported-by: Pavel Machek > > > > Signed-off-by: Lad Prabhakar > > > > > > > > --- > > > > drivers/mmc/host/renesas_sdhi_core.c | 6 ++++-- > > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/mmc/host/renesas_sdhi_core.c > > > > b/drivers/mmc/host/renesas_sdhi_core.c > > > > index 2797a9c0f17d..cddb0185f5fb 100644 > > > > --- a/drivers/mmc/host/renesas_sdhi_core.c > > > > +++ b/drivers/mmc/host/renesas_sdhi_core.c > > > > @@ -1033,8 +1033,10 @@ int renesas_sdhi_probe(struct platform_device > > > > *pdev, > > > > goto efree; > > > > > > > > priv->rstc = > > > > devm_reset_control_get_optional_exclusive(&pdev->dev, > > > > NULL); > > > > - if (IS_ERR(priv->rstc)) > > > > - return PTR_ERR(priv->rstc); > > > > + if (IS_ERR(priv->rstc)) { > > > > + ret = PTR_ERR(priv->rstc); > > > > + goto edisclk; > > > > + } > > > > > > Why can't devm_reset_control_get_optional_exclusive to be moved up > > before devm_clk_get? > > > > > In that case we will have to jump to the "efree" label Or if you don't > > want goto at all this can be moved to the very beginning of the probe. > > I guess it has to move up, first get reset handle and clock handle and return error > directly in case of error, Then do clk/reset ops. > Fine by me. Cheers, Prabhakar > > > > Wolfram, what is your preference on the above? > > > > Cheers, > > Prabhakar