Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2622069ybk; Tue, 12 May 2020 04:11:35 -0700 (PDT) X-Google-Smtp-Source: APiQypL/tPpiPlpf3ZeHMUwe7UkhLM47UN2/nRtAmms/fhx9513quyXur3cWvyuRn8cGIrhVGQu1 X-Received: by 2002:aa7:df85:: with SMTP id b5mr16909728edy.298.1589281895288; Tue, 12 May 2020 04:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589281895; cv=none; d=google.com; s=arc-20160816; b=ZHFbZpj4fICen9DI9HWTi5pUAbrhT8DtdtWeOyauysVxYO6HD2PSkaQQzgxFmyCAAb vig/T8EE6U479Gl3CyX9Rj2CDF53FMSmPZjlSEcdP++9B0d7C3uE/m0Lq9aJiD6xnXsy cpXZaa74Ym3ERa4XMdks4irHtM7LVqdlL39iaUxMrCreH+ORDoQDfEJxRbtro+Syuegv x2hCwvb/Pk3TZ8r+5V417MXL7hd4i37qwp3wPqjt0G1tV1OuDdOXSbzf05lgJv8xw81K oo0Ryr5b18Wo82dWVSpeKD6lEHWmgF9PAoYXTpfWPxq1/6t02WRw3K32i+4+y+UdMNSS zIZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=CvVb4DH9Z5jN89vU5wcyAcF+KjzyVy7HR7+r/78t3Fk=; b=aqfmipWQtW7ylP0jV0eMltXnACknOuHabbEIr7hUIT6v5TGXdoZ+5QhoqyT4md7S5M BqSSNoRJDu4ALUe0Go1p5fOhUkvb/E1MVe1cFh4XyWGJ8ajgbTvPOuLb4DRIujKWv0VG 4OvHXJj1Ri1qZWtiFfDA05P9UjnO+vs/x1IGVE2LdD0x+/5dZmSpwkWGnac/CidZeFvO GEriP+hlbX/ZIqkVnl1P7qG29Nu7eOdV49g9I1So0nvwVqkUFA8AuhhX4Se4A9MtQwFl gAhOVPdhXHJzdquGvczFZE2HOpcYFBd63wuvytiTY0sSzvPxYxSCFBb4P9Ai0XvXzjiy lqMA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b61si8407122edf.322.2020.05.12.04.11.11; Tue, 12 May 2020 04:11:35 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729436AbgELLIo (ORCPT + 99 others); Tue, 12 May 2020 07:08:44 -0400 Received: from mail-m17613.qiye.163.com ([59.111.176.13]:24008 "EHLO mail-m17613.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbgELLIn (ORCPT ); Tue, 12 May 2020 07:08:43 -0400 Received: from ubuntu.localdomain (unknown [157.0.31.122]) by mail-m17613.qiye.163.com (Hmail) with ESMTPA id 06A8A482D55; Tue, 12 May 2020 19:08:39 +0800 (CST) From: Bernard Zhao To: Lukasz Luba , Kukjin Kim , Krzysztof Kozlowski , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Bernard Zhao Subject: [PATCH v2] memory/samsung: reduce unnecessary mutex lock area Date: Tue, 12 May 2020 04:08:27 -0700 Message-Id: <20200512110827.39475-1-bernard@vivo.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZT1VITEtCQkJDSkhLTEJDSFlXWShZQU hPN1dZLVlBSVdZCQ4XHghZQVk1NCk2OjckKS43PlkG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Nj46LCo*UTg8GTJWFAI1Sk1P OjYKCRNVSlVKTkNCSUNKTElJSUNDVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSUlZV1kIAVlBSUlPTjcG X-HM-Tid: 0a720892839793bakuws06a8a482d55 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Maybe dmc->df->lock seems not needed to protect "if (ret) & dev_warn" branch. Maybe this change speed up the code a bit. Signed-off-by: Bernard Zhao ---- Changes since v1: *change release lock before the if statement. *revert dmc->df->lock mutex lock to protect function exynos5_dmc_perf_events_check Link for V1: *https://lore.kernel.org/patchwork/patch/1238888/ --- drivers/memory/samsung/exynos5422-dmc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c index 22a43d662833..25196d6268e2 100644 --- a/drivers/memory/samsung/exynos5422-dmc.c +++ b/drivers/memory/samsung/exynos5422-dmc.c @@ -1346,15 +1346,13 @@ static irqreturn_t dmc_irq_thread(int irq, void *priv) struct exynos5_dmc *dmc = priv; mutex_lock(&dmc->df->lock); - exynos5_dmc_perf_events_check(dmc); - res = update_devfreq(dmc->df); + mutex_unlock(&dmc->df->lock); + if (res) dev_warn(dmc->dev, "devfreq failed with %d\n", res); - mutex_unlock(&dmc->df->lock); - return IRQ_HANDLED; } -- 2.26.2