Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2349066pxt; Sun, 8 Aug 2021 20:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwydKbtBhODM0/Ud3WFn4NE4F5m/UVKNS497sR7CjcCzfNHSFFvhJ4WGJMI7XMNH1i5TuRa X-Received: by 2002:a05:6e02:54c:: with SMTP id i12mr568709ils.103.1628481053089; Sun, 08 Aug 2021 20:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628481053; cv=none; d=google.com; s=arc-20160816; b=LqlotuWRT9GdwjYpQ6k4Nx02gTwk5OzOgYofhTAdULcSXFcEYqAMqRIG8m9ENHIydA j8VtBiDuOguo7a1ElfaUl3MpavxlKrADlOEKYVF6veEJG6/5nYqZVS88Hq3p/JITOk6Q t37L0EZsPj+kUDn9N2xjY7vLC5FZdo34G01v8X0K9TWE+pvIfEtdLNP14qV6WUIxu2bG GUSVLbRbNzFgtZWMQDhNqdnivITsTJo0BanC0OU1gu0NVVE3R4O5GDnDA89+O1AYJvzf 1UjWLhcF8++GJE8B9XEXYXka0ssozzEZ0B98/nUJXV7mpgg6OuHai/CGU6mdJF8R7MT3 IYFw== 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=Mxoe8ehx2Vi2y4afm7gLthqvb5ao6MbjaelzeHBMKik=; b=ByK5F1T7Nu4A5hBvgR/9viMZ1/SPj+0EN+f22yf9n/swsOgzM7wBmpzCjTeQgOSrgK hqhy23px5ASZmg7fJB848oLGE6MAEoDz8CzTG58A0gKnEZAdsck+YNCVslPsN6m80glR /ukdLZ3Owsv3WKiuTEu+A6aPkTepi32v7JTlMjIanVOSf26uYnnsOkJ6qdkEveAYYA5n bohnmlTSnTs40lsBwAredyx0yTPCrcNEhcAoeGnIfoB+sqHZyBCDQXxlsg6MlwzlendL MGff11kcYaV9w0BTXVemOdfSVGuflnUcJvQo3bIS6zkSkZOBAlwRxglB3Lxf+O9MgWpZ aEBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="q/Zl/iRS"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w22si12948364iol.66.2021.08.08.20.50.41; Sun, 08 Aug 2021 20:50:53 -0700 (PDT) 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=@google.com header.s=20161025 header.b="q/Zl/iRS"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231675AbhHIDXo (ORCPT + 99 others); Sun, 8 Aug 2021 23:23:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229942AbhHIDXn (ORCPT ); Sun, 8 Aug 2021 23:23:43 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F17AC061757 for ; Sun, 8 Aug 2021 20:23:23 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id c16so31047015lfc.2 for ; Sun, 08 Aug 2021 20:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mxoe8ehx2Vi2y4afm7gLthqvb5ao6MbjaelzeHBMKik=; b=q/Zl/iRSG6c/YsgaY48vbGEN4c/w8jgzqDkmTLGeAD/ceUoxEHEV0of9v0CfFN4sYp /jQhut2BLnjKmy6ddXsA10qPQDJMcrQJY5PKNPChLVZCH29Tm4tiUWCL3CbHW6VDKbwg xuzKN73tQPqLuA4lHVClUCcueQyvJgX6YYcEagQ63LxV1LUdQOzEuBUCMGRlSYHpmDGl zoCFc844we/Ko56ys3bmodpP5EkXbX2fSFtBKeu9B2ABgwQTCEf6zseqC0SpawMLt3pM 6fwaiLb700kqRIoywGMqEzWt1X6MxF5u3zxXTHJzIpGVNpbYHrztTQIv9904UDgLAj8E 8JTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mxoe8ehx2Vi2y4afm7gLthqvb5ao6MbjaelzeHBMKik=; b=mcQa2rDIaTe75gWksTe+d+GC5oQaIYI+Sf5qwuuJwyocn3w3hGHy98DXwGsfT8eXm/ vAs3H6ldHGUuSVlh9Ms39IXIUseivKMbsz/QtSRDCxKGwRLP52GrwGT3TMjPXCjw/dS0 aoJ5zFCKlV+8UXmV4V7QArXT7qjGzFtxsWrEbv6FsbOOhBx69acBuRya7iA1p0d26aII SUCSd65iE/9JF0bDg0nJ34+rtl838QpsC/7QkP5KdjC3vfIOja/P6g0qnEJqu8ti65WQ O+7bsUNr+hq5EyM3gzq/z30OEwZqKaOLrCsNWztUDJ/mMw3PVKvX5hWVMxJAEAZTDkJd FEiA== X-Gm-Message-State: AOAM530ySiRQfUO4GC9mWA9Fso8KQ1pNxF8gmxayeqwiEt6WXBE3UoqK jvuOuK+mgkhF8HLm1+xtNGJywaTKbx3KEaJqSD9Sig== X-Received: by 2002:a19:da01:: with SMTP id r1mr6694335lfg.437.1628479401416; Sun, 08 Aug 2021 20:23:21 -0700 (PDT) MIME-Version: 1.0 References: <20210802121215.703023-1-eizan@chromium.org> <20210802220943.v6.1.I9db0d408ef79d300672ec0311a6bee9556801631@changeid> <8fe5ac46-a9db-710e-a6d1-856805ab2773@collabora.com> In-Reply-To: <8fe5ac46-a9db-710e-a6d1-856805ab2773@collabora.com> From: Eizan Miyamoto Date: Mon, 9 Aug 2021 13:23:04 +1000 Message-ID: Subject: Re: [PATCH v6 1/9] mtk-mdp: propagate errors from clock_on To: Dafna Hirschfeld Cc: linux-kernel@vger.kernel.org, wenst@chromium.org, houlong.wei@mediatek.com, yong.wu@mediatek.com, enric.balletbo@collabora.com, devicetree@vger.kernel.org, chunkuang.hu@kernel.org, Andrew-CT Chen , Matthias Brugger , Mauro Carvalho Chehab , Minghsiu Tsai , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dafna, thank you very much for spending time to review the patch, your time spent is very much appreciated. On Thu, Aug 5, 2021 at 4:06 PM Dafna Hirschfeld wrote: > > +err_clk_prepare_enable: > > + for (--i; i >= 0; i--) { > > + if (IS_ERR(comp->clk[i])) > > + continue; > > + clk_disable_unprepare(comp->clk[i]); > > } > > + > > + return status; > > There is an API function clk_bulk_prepare_enable to prepare and enable an array of clks > so you can just use it. As per Enric's suggestion earlier in this email thread, are you OK with me making this change in a follow-up patch, particularly since the logic as it is was preserved from previous functionality? > > -static void mtk_mdp_clock_on(struct mtk_mdp_dev *mdp) > > +static int mtk_mdp_clock_on(struct mtk_mdp_dev *mdp) > > { > > - struct device *dev = &mdp->pdev->dev; > > struct mtk_mdp_comp *comp_node; > > + int status; > > + struct device *dev = &mdp->pdev->dev; > > + int err; > > > > - list_for_each_entry(comp_node, &mdp->comp_list, node) > > - mtk_mdp_comp_clock_on(dev, comp_node); > > + list_for_each_entry(comp_node, &mdp->comp_list, node) { > > + err = mtk_mdp_comp_clock_on(dev, comp_node); > > + if (err) { > > + status = err; > > You can get rid of the new var 'status' and just return ret in case of error This seems like a nit (please let me know if you disagree), and it's also cleaned up in a follow-on patch in the series ("don't pm_run_time_get/put for master comp in clock_on"). Is making the change you are suggesting here something that should require uploading a new series version? Eizan