Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3591352pxu; Mon, 19 Oct 2020 16:30:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfEcT+gIBqwcEFS+P7TpxT5Pna3OP6150cif6T0JiSqB3IzALTesfqDFVXKllQrwwwAiE+ X-Received: by 2002:a17:906:5806:: with SMTP id m6mr293382ejq.20.1603150241109; Mon, 19 Oct 2020 16:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603150241; cv=none; d=google.com; s=arc-20160816; b=ezXDrJWtkX7KahzQTkSUFTsxWeLOSgEjiZkzpWtuBDGHybHrwK6uCxZFd4B5gvZAS6 WJccQW8Xch0o1hXS7czuTfC/gUpZgXco6Gy60jVbAn1SAXPdDkUi7tuaF8IkPI4bciuD 9MNSWFi8zVme4bF85GsONMJQETs8dTcUAfe0eHscBli5UJ8MEoj6bXGFLoVq9atOGakx PZ5z9klyvoMb5/SNPg4u/zc16c3e6K707to5fZVFrqeqxJdirei2sy0b8cYjSsbg9YMA Mr51LVcMDEnq/2lx/v3mZWJHOZn8c7a7AOue5tIuKRYkSZjs1ujdhidDS6pjYlnCIecJ 1Eqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:cc:to:from:subject :dkim-signature:dkim-filter; bh=yDoDNggOg225OrRqSzF1Bazr7Llyp7wh5Skp9ddw+sE=; b=nvVLTyQ8U/luWBh63oPPpP6T1c6upa1J29HmVuyuJQM1LtzTIfqltoKyoPSmEwXHnA cV8FMICLu4jfMi3OzXKg+JSD/ZW5jWL7d+z2+FEGlk5EEP0v0ep6IXnh74LkoURXFSqv 2MYdt0XmtGYvOaFWZ4SIAn7s88UqsJNx0HEIseqkGaoBON8bMybPT85M+en0hk7YBDGU /dKy58QPo9eJbb1J6ubLFpWknTVGZyyYTbve3L++lAeOG9fqKIU/A3jtmhypmTcnizVW MwZDgHm3euTpSk5G41fIUOPiUoMkYIgHIfTjGrIiHsQrW7wYZMo6C5uB+52a9UYdEb2E opsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=tqtSjjqN; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lh27si22790ejb.698.2020.10.19.16.30.18; Mon, 19 Oct 2020 16:30:41 -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=@samsung.com header.s=mail20170921 header.b=tqtSjjqN; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726706AbgJSK1o (ORCPT + 99 others); Mon, 19 Oct 2020 06:27:44 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:62856 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbgJSK1o (ORCPT ); Mon, 19 Oct 2020 06:27:44 -0400 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20201019102740epoutp01f49bc822239d319a1f1acd0144e3de7c~-XewDEP4S0239402394epoutp01B for ; Mon, 19 Oct 2020 10:27:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20201019102740epoutp01f49bc822239d319a1f1acd0144e3de7c~-XewDEP4S0239402394epoutp01B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1603103260; bh=yDoDNggOg225OrRqSzF1Bazr7Llyp7wh5Skp9ddw+sE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=tqtSjjqN0J/CyHqud8XhIJe2YsS5jLLchn7D+Z/iQbmhafUN9rRsveinPyIho2H8v gibGLwwlcDjawTb9CBJHsBFDH+gHqrLw05R1V7/Cp+gTMGM6P4ymywCyv3xNizYFXz F+plIiExPtscarsXOZA/Y3QjHO6Z/7jPf6gx0T5w= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20201019102739epcas1p42e5bfcd73ff2fa8b98b3cd0e920fd705~-XevXOg6F0830008300epcas1p4u; Mon, 19 Oct 2020 10:27:39 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.152]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4CFCcn42zwzMqYkj; Mon, 19 Oct 2020 10:27:37 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 0C.1B.10463.91A6D8F5; Mon, 19 Oct 2020 19:27:37 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20201019102736epcas1p32f607ce884d698b00f7f3a4c89f7fbbb~-XesqXydC0660906609epcas1p3T; Mon, 19 Oct 2020 10:27:36 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201019102736epsmtrp21ee944d31054f04479a958947c9f1f89~-XespcpP31185611856epsmtrp2z; Mon, 19 Oct 2020 10:27:36 +0000 (GMT) X-AuditID: b6c32a38-efbff700000028df-f5-5f8d6a195582 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id FB.EE.08604.81A6D8F5; Mon, 19 Oct 2020 19:27:36 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201019102736epsmtip27f942c8dd0686286e094a9cede41c278~-XesV_66R0681806818epsmtip2S; Mon, 19 Oct 2020 10:27:36 +0000 (GMT) Subject: Re: [PATCH v3 2/2] PM / devfreq: Add governor attribute flag for specifc sysfs nodes From: Chanwoo Choi To: Dmitry Osipenko , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Cc: leonard.crestez@nxp.com, lukasz.luba@arm.com, enric.balletbo@collabora.com, hl@rock-chips.com, thierry.reding@gmail.com, jonathanh@nvidia.com, abel.vesa@nxp.com, k.konieczny@samsung.com, b.zolnierkie@samsung.com, chanwoo@kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com Organization: Samsung Electronics Message-ID: Date: Mon, 19 Oct 2020 19:41:01 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: <1db2fb62-0b82-409d-20a7-c2ef376d4580@samsung.com> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA01Te0xTVxzO6eP21q1yrIBHNIjXmE0USimFqwNnpm6Nw8GeCWroOnpDEWib e2ERCRsojIdjwxCSrkFExpBHN0YlUKuE0FUXXkOHCIjdXOgmEShQHKtD4/oy47/vd37fd77z /c45OFs4hYXgGeocilYrsghsHafrp12iiM0nK+VRtrtbyaZfbwCyQ9fOJc9P3OGQbUvTgDRM WQDp+nGATRbrGzhkvVPHJYfPzPHIZtsSlxw112LkcqUVkOWP9Rh56Uwxj5wqasbIJ+Y6zgEo M9QZgMxkawSyq3obT2ZsLcdklWcdmKzDYWLJnul7ObKvOluBbNkYmsw/lhmvohRKig6j1Gka ZYY6PY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X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201007045340epcas1p3b4d0f9187f5330a45d20d9d9b79f1767 References: <20201007050703.20759-1-cw00.choi@samsung.com> <20201007050703.20759-3-cw00.choi@samsung.com> <4cb8ece7-9399-9ee0-5f93-6c19630308d6@gmail.com> <1db2fb62-0b82-409d-20a7-c2ef376d4580@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/19/20 1:11 PM, Chanwoo Choi wrote: > On 10/19/20 9:39 AM, Dmitry Osipenko wrote: >> ... >>> @@ -1361,6 +1373,9 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, >>> goto out; >>> } >>> >>> + remove_sysfs_files(df, df->governor); >>> + create_sysfs_files(df, governor); >>> + >>> prev_governor = df->governor; >>> df->governor = governor; >>> strncpy(df->governor_name, governor->name, DEVFREQ_NAME_LEN); >>> @@ -1460,39 +1475,6 @@ static ssize_t target_freq_show(struct device *dev, >>> } >> >> The further code may revert df->governor to the prev_governor or set it > > prev_governor is better. I'll change it. > >> to NULL. The create_sysfs_files(df->governor) should be invoked at the Also, when creating and removing the sysfs files, devfreq instance is needed because of df->dev.kobj. So, *_sysfs_files need the two parameters. >> very end of the governor_store() and only in a case of success. > > OK. I'll add more exception handling code. > > -- Best Regards, Chanwoo Choi Samsung Electronics