From patchwork Mon Nov 9 08:09:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Qilong X-Patchwork-Id: 323427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD57CC2D0A3 for ; Mon, 9 Nov 2020 08:05:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AD5F21534 for ; Mon, 9 Nov 2020 08:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729729AbgKIIFx (ORCPT ); Mon, 9 Nov 2020 03:05:53 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:7618 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgKIIFx (ORCPT ); Mon, 9 Nov 2020 03:05:53 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CV3TJ3j5BzLtfG; Mon, 9 Nov 2020 16:05:40 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Mon, 9 Nov 2020 16:05:49 +0800 From: Zhang Qilong To: , , , CC: , Subject: [PATCH 0/2] Fix usage counter leak by adding a general sync ops Date: Mon, 9 Nov 2020 16:09:36 +0800 Message-ID: <20201109080938.4174745-1-zhangqilong3@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Many caller forget to decrease the usage counter when call pm_runtime_get_sync. This problem has been discussed in detail, [0][1] and we add gene_pm_runtime_get_sync ops to deal with usage counter for better coding. Then, we replace pm_runtime_get_sync with it in fec_main.c [0]https://lkml.org/lkml/2020/6/14/88 [1]https://patchwork.ozlabs.org/project/linux-tegra/patch/20200520095148.10995-1-dinghao.liu@zju.edu.cn/ Zhang Qilong (2): PM: runtime: Add a general runtime get sync operation to deal with usage counter net: fec: Fix reference count leak in fec series ops drivers/net/ethernet/freescale/fec_main.c | 10 +++---- include/linux/pm_runtime.h | 32 +++++++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-)