Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1056588rwr; Thu, 27 Apr 2023 11:39:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4fIdVNq76Qrtz7VSCiUTDqXa2MwozdbjOpsQ8CYRRPfdwulb0mVSPoB6KfamsNZq/EUHPv X-Received: by 2002:a17:90a:d506:b0:247:3fec:e732 with SMTP id t6-20020a17090ad50600b002473fece732mr2772827pju.13.1682620793664; Thu, 27 Apr 2023 11:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682620793; cv=none; d=google.com; s=arc-20160816; b=dbyxXufyT9ZIat/gFCL9x7WjAKEfFMuIgK4wObXYKI1uAIXnOLoE428cRDbGP93lGC 711DHe/12eMFLR3lf1TsdvZGg7ko2reyxhRFWMG1gMcSqp4Pd3Vv8z/CMqYI8gB0sD8V 1xTm1vOIqvCtVaQ+wvtg3PfG/6TOXTT1D2bE6WoBKVjbce4gvSGmEo8Jrl15hQiaFpDH STbTQvQ/6Enggq1PbwWgnjeFESSbwxXfZreIqNjmBZhwjkeGihHZBvAJALDASnSSjHPv ck/mcAjCjux/XBC6zrM+2+YYzPvSpSXx1chAuSzQ392+8sE5RNzeKCBPLRKRus2DaN7r rQWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=8fkIJQC93kFWSTO7BS8vizVkWp65sEVyElyS6bu13T0=; b=BfS1QRBf+inLcBmrVn8y7WQKla+nPe+fGOLieyHlua9ZGb7MtyEdHoun31k1+hBqVZ ZVMC3IVGRF6GSsti8+dX1xvAJ/0iHnjjqpgFZanNT1BYMjss0ajoWl+UC1NaHg4XQXMz Gly+0AyjlyMjPw0CNFHa7sKHrxcuragJTWxN73c+Y1oqGAwqB/6GSCC83Ac9F6HDLHaN 3xG4rCgjlZCpmZX/HTn3ATpm/xeVR43Jo1zn1n2ylZZVcA8Sp7PT0uMA/AWKMWS+JLsM pkxY/JmWxcG9/03WXoqPwYbK0qQAfmKdeyBXveXpiUDakiacCQx32yFjyO9CAwp8YnEf KSMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jbz73+aI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a17090a658c00b00247b1a05438si260930pjj.16.2023.04.27.11.39.40; Thu, 27 Apr 2023 11:39:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jbz73+aI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244557AbjD0Sii (ORCPT + 99 others); Thu, 27 Apr 2023 14:38:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243558AbjD0Sih (ORCPT ); Thu, 27 Apr 2023 14:38:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0813BE4; Thu, 27 Apr 2023 11:38:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 97BCA63F15; Thu, 27 Apr 2023 18:38:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2D27C433D2; Thu, 27 Apr 2023 18:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682620715; bh=63rZ6oKXHT4RQ6j3QCN/KK6+FdSVlUibkCVfjxxt48o=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=jbz73+aINXhOJZT8oWCJ3Zbs8TSg4d28s+hqlwHSNge1JLHpAoFNQbntGLQ/3l6hV 90Ok6oFO+gyX8mrgFhW9KdHYTayo5OiNlmscRdIg7yFZ8M/dDnKIxptUjBNi9pUTHN 4a4A7zYrv371pDdtOwwfZiVSK2BIwhaUmwRxpZVVutudMGJ56r1KHIfLAzEcT61vJ+ Rrl5QPc/W/GHjDmTiG7GTSahGA2cluxRhPfsSG6riDs35tNLm5ab50E2Wz9xmU8uuF taKfxVTIHljklAmw2k8cVnRJJbo8X2nbDlJS3L8LRlbpNbcnoENKWlvAIduc0D6Qfn eCn1IvcvGSUkg== Date: Thu, 27 Apr 2023 13:38:33 -0500 From: Bjorn Helgaas To: Junyan Ye Cc: christophe.jaillet@wanadoo.fr, Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Wei Yongjun , Linus Walleij , Andrew Murray , hust-os-kernel-patches@googlegroups.com, Dongliang Mu , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] pci: controller: pci-ftpci100: Release the clock resources Message-ID: <20230427183833.GA263506@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230423053208.2348-1-yejunyan@hust.edu.cn> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Sun, Apr 23, 2023 at 01:32:07PM +0800, Junyan Ye wrote: > Smatch reported: > 1. drivers/pci/controller/pci-ftpci100.c:526 faraday_pci_probe() > warn: 'clk' from clk_prepare_enable() not released on lines: > 442,451,462,478,512,517. > 2. drivers/pci/controller/pci-ftpci100.c:526 faraday_pci_probe() > warn: 'p->bus_clk' from clk_prepare_enable() not released on lines: > 451,462,478,512,517. If/when you repost this, please: - Rebase to v6.4-rc1 (when it's available). - Look at subject line history for this file and match it. - Include the smatch warnings exactly above (not wrapped to fit in 75 columns). This is to make it easier to search for the text. - Add "()" after function names below to make it obvious they are functions. You can also omit "function", e.g., "... is obtained by devm_clk_get()." > The clock resource is obtained by the devm_clk_get function. The > clk_prepare_enable function then makes the clock resource ready for use, > notifying the system that the clock resource should be run. After that, > the clock resource should be released when it is no longer needed. The > corresponding function is clk_disable_unprepare. However, while doing > some error handling in the faraday_pci_probe function, the > clk_disable_unprepare function is not called to release the clk and > p->bus_clk resources. I don't know the clk terminology. Does "... clock resource should be run" mean the clock should be "running" or "enabled"? include/linux/clk.h only uses "running" twice but has many instances of "enable", so maybe that would be better. Or maybe it's enough to say: clk_prepare_enable() then makes the clock resource ready for use. and omit the rest of that sentence? Looks like a nice fix, thank you! Bjorn