Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4345764rdb; Mon, 11 Dec 2023 17:10:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRFaTG1CLz199PzhtfSyYWV2CCWndY+FMrxKD4TYVkugoSrM+3vb4GHnhBGECFFeoHabn3 X-Received: by 2002:a92:c54d:0:b0:35d:78de:237e with SMTP id a13-20020a92c54d000000b0035d78de237emr8216233ilj.27.1702343422449; Mon, 11 Dec 2023 17:10:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702343422; cv=none; d=google.com; s=arc-20160816; b=mOOP999g3q3rPBv+tMRFL1X4rNKLPwJuYzImekpJ6oW4OXdd7xTb5fN76eel1tLn7z sey5WHMnN8OQfrx4VbcSLeXYoIX3fNGuEbGhvb2OdDofg4K9bAqkzjQ3qXtYvY0ZAL4T QQWUPdW/gcCSFJssKfzGmvwaonFgmG2l/sqslKigyqWtC9GBeKElN3bdOSc5PtUHvnno 1vazXYdoHDH37mCKk0JCgb4HRi+XW1tNYW1MieI/BtKL6oV1GRWBNrloIiE0ElPu/wmX 949Em1Md/o69LlanmSuOYI+gjSHnzZnSIeyCE+eRV5A+a81HDIieetBgsYV6D7kG73ab 1CwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :date:message-id:cc:to:from:sender:reply-to:subject:mime-version :dkim-signature:dkim-filter; bh=53SGPNwqJDNwkpSp/kpKMKy0RNs23DJQx/RtIVJ1gj4=; fh=L2fSZkLxRE6kvBORiwCroGApJ/Mnty3UbVhqSiYRDfw=; b=NgnViy2YZrluEjKEf3pHaO8sHgiyOv5K9BuSXrW37gt0PdHZPnsQ+H2IbLX2nHQ7hs CYmNscnOCtQ2IPcUipoH/3qfai4cLCA4Puhken3XoyUi48UgaL7M3hXdmFFKqGKcdGGr yRY1hIbsiz3caWfXhPlzZwUvQjCMScbdpsmaIFQUXeiE4BvK+fkJE//x5cpqCPOe8FB7 Y53JsmMvGE3Mf4SPU+EZtL93Wqjng7YTwy50wU22gLcC6cZm2Ny8yWV+AyP4yChDCVZG yC5otcihD72kVGXlO/A5DUZudFBocBK3IjEVwvPrBFlyNTw5L/2G610SGVY3jxJb7ewN 63Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=XKEvYUiK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c31-20020a630d1f000000b00577475ee5f6si6713821pgl.618.2023.12.11.17.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 17:10:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=XKEvYUiK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 315318053632; Mon, 11 Dec 2023 17:10:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345670AbjLLBKB (ORCPT + 99 others); Mon, 11 Dec 2023 20:10:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345638AbjLLBJ7 (ORCPT ); Mon, 11 Dec 2023 20:09:59 -0500 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04ED7C6 for ; Mon, 11 Dec 2023 17:10:04 -0800 (PST) Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231212011002epoutp04d24c5480079bf55fe1fc565e62515f54~f8E47qD7a2877828778epoutp04N for ; Tue, 12 Dec 2023 01:10:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231212011002epoutp04d24c5480079bf55fe1fc565e62515f54~f8E47qD7a2877828778epoutp04N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1702343403; bh=53SGPNwqJDNwkpSp/kpKMKy0RNs23DJQx/RtIVJ1gj4=; h=Subject:Reply-To:From:To:CC:Date:References:From; b=XKEvYUiK348lOYmed/f/ibcOBjhXBwEzEJV/jkERElkSRv9GVjOyAlwRp+724C2/A Y7h3dpVOQLEV1/Iy5XRS77Gz6iekK/3eAxwBWv/gsn19EeFiD5DyDTE5KZseHGrVDi loAWqas1i+L+V5ktaLPU47NRcFtk1zo/ISZRN+rQ= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20231212011002epcas1p22c116deaee3c252421f7c15498cf98e7~f8E4oKQ9R2269922699epcas1p2p; Tue, 12 Dec 2023 01:10:02 +0000 (GMT) Received: from epcpadp3 (unknown [182.195.40.17]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4Sq0s64LH4z4x9Q8; Tue, 12 Dec 2023 01:10:02 +0000 (GMT) Mime-Version: 1.0 Subject: RE: Re: [PATCH v4] PM / devfreq: Synchronize device_monitor_[start/stop] Reply-To: myungjoo.ham@samsung.com Sender: MyungJoo Ham From: MyungJoo Ham To: Mukesh Ojha , Chanwoo Choi CC: Kyungmin Park , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "huangzaiyang@oppo.com" , CPGS X-Priority: 3 X-Content-Kind-Code: NORMAL X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <1296674576.21702343402595.JavaMail.epsvc@epcpadp3> Date: Tue, 12 Dec 2023 09:27:02 +0900 X-CMS-MailID: 20231212002702epcms1p6a18b626aee8f700957dbc2855d1711b4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" CMS-TYPE: 101P X-CPGSPASS: Y X-Hop-Count: 3 X-CMS-RootMailID: 20231206105023epcas1p443ebecc35010d2577b86c3fa23e24e45 References: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 11 Dec 2023 17:10:20 -0800 (PST) On 11/25/2023 2:41 AM, Mukesh Ojha wrote: > There is a chance if a frequent switch of the governor > done in a loop result in timer list corruption where > timer cancel being done from two place one from > cancel_delayed_work_sync() and followed by expire_timers() > can be seen from the traces[1]. > > while true > do >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "simple_ondemand" > /sys/class/dev= freq/1d84000.ufshc/governor >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "performance" > /sys/class/devfreq= /1d84000.ufshc/governor > done > > It looks to be issue with devfreq driver where > device_monitor_[start/stop] need to synchronized so that > delayed work should get corrupted while it is either > being queued or running or being cancelled. > > Let's use polling flag and devfreq lock to synchronize the > queueing the timer instance twice and work data being > corrupted. Would you please identify the resources to be protected by this lock and specify them in the devfreq->lock declaration? (it seems the list of protected resources is growing, and we need to track them.) Acked-by: MyungJoo Ham