Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3071062pxu; Mon, 19 Oct 2020 03:12:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYNmnGQRgF7NCvoQV0nG7rlJvECq1p0vPOn5GvRyYwdVEnjSprOZ/rbkY3gmvNZG/4q0cc X-Received: by 2002:a17:906:1b0d:: with SMTP id o13mr16205465ejg.526.1603102368474; Mon, 19 Oct 2020 03:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603102368; cv=none; d=google.com; s=arc-20160816; b=hyPzLueMhEvY3nkwWbe7QmtTPzTqEzxXnDlgwhQa/CD+vnRRn33WulxuGQntlpJtL2 TUOvV7mXCjPDgrBr8rioEedFVBQUgxbAFo0qq3498cch2apJq3HRdgn81IJebCJjV86j iUQNGMsXuI/iw3CJ7j/eaDgqT6DS6GYH8rln/3VxAxBg+GgjauZGdOnop4l1Eudr0l10 hPIxVUDs3OB5JU315eAaTLw55+6NOji9+MvkZxRu5TY34HwUx93kyaO04a0Nn/SU1sp9 mtJ4IWjkqiSyIen/3v+0AmiuMcmOMw+Twt/Po4saigxp5e7a7GjjAydNPgV/qkk7svEI i+/Q== 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:from:cc:to:subject :dkim-signature:dkim-filter; bh=m+psVG5ydnEfTR+95veMJooA8oISCSXl0ADz2z9f3vc=; b=UINSF74nbEEYyo3f8bLHAyd4yYIMpq3Md52eqPHluXeamkALdOhlC8cMHNcNVSJOGA Ozs+xYNjYdJf1ed8FC8Y3FGZK6Y0QnzvPdtHzbHtUDgxQZJJUNUvSrJbGqV+2WGlONxM rhMa4YJmiSUi6yTEaMhKsEy6uc0623OGnrx6RAcgUfzL8ScUN5nT0ULuT1Um5nxxnkXT ZFmtZ6arudMIs1Olq4EdC+f5ObCh3QicXspzx74QK8rvsChtDcIu1NCcg7p6KfEo6bdz /VM3B81do/QncXfF+T8YCrLjtkxXZqG6rfdUXD2WRkZsUL+dwb43kmpx5HrB4KhfTI3i qC0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=tDDmGefd; 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 p18si7231764ejn.695.2020.10.19.03.12.24; Mon, 19 Oct 2020 03:12:48 -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=tDDmGefd; 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 S1731762AbgJSD6O (ORCPT + 99 others); Sun, 18 Oct 2020 23:58:14 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:54150 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731752AbgJSD6O (ORCPT ); Sun, 18 Oct 2020 23:58:14 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20201019035810epoutp045beb2e1ecd317d7f405d010831dd4edc~-SKrRg8nG0733507335epoutp04g for ; Mon, 19 Oct 2020 03:58:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20201019035810epoutp045beb2e1ecd317d7f405d010831dd4edc~-SKrRg8nG0733507335epoutp04g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1603079890; bh=m+psVG5ydnEfTR+95veMJooA8oISCSXl0ADz2z9f3vc=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=tDDmGefdbi8lV8Y4493ZWzVFk9z9ERA1rj4yVgEidB/kV5Q9/wrIQ//wRF0wqvR+f FTY31B4j0iseor4nej03oWbGqHpQRq1dE5Lf7qDo/EzPKF4yCpqShsAbPlqcexITU5 I1vAajgJWnxpwH/n3bpwDdN0+ZVKaHZRo2PwIPPo= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20201019035810epcas1p3082bbc6b2c88c010f4851f8e07ef3e9e~-SKqgSgrs1980819808epcas1p3K; Mon, 19 Oct 2020 03:58:10 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.154]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4CF2zM3VXrzMqYkg; Mon, 19 Oct 2020 03:58:07 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 82.F1.10463.FCE0D8F5; Mon, 19 Oct 2020 12:58:07 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201019035806epcas1p22dc6646d6f40e36a4797ad00fa46dd42~-SKnh7cv32489824898epcas1p24; Mon, 19 Oct 2020 03:58:06 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201019035806epsmtrp13b638c0179070576732b49b1624337f3~-SKnb2NaH2438224382epsmtrp1B; Mon, 19 Oct 2020 03:58:06 +0000 (GMT) X-AuditID: b6c32a38-efbff700000028df-48-5f8d0ecfbbdd Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id C0.03.08745.ECE0D8F5; Mon, 19 Oct 2020 12:58:06 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201019035806epsmtip1c9effe648e0cf6e3afc88f0fa608f611~-SKnJExgc1389113891epsmtip1E; Mon, 19 Oct 2020 03:58:06 +0000 (GMT) Subject: Re: [PATCH v3 2/2] PM / devfreq: Add governor attribute flag for specifc sysfs nodes 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 From: Chanwoo Choi Organization: Samsung Electronics Message-ID: <1db2fb62-0b82-409d-20a7-c2ef376d4580@samsung.com> Date: Mon, 19 Oct 2020 13:11:31 +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: <4cb8ece7-9399-9ee0-5f93-6c19630308d6@gmail.com> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFJsWRmVeSWpSXmKPExsWy7bCmnu55vt54g5PzJS2WXTrKaLFxxnpW i4k3rrBYrP74mNFize1DjBY/NpxitmiZtYjFYsGnGawWZ5vesFusuPuR1eLyrjlsFp97jzBa dH6ZxWaxsKmF3eJ24wo2i5+75rE4CHismbeG0WPH3SWMHjtn3WX32LSqk82jt/kdm8fGdzuY PP7O2s/i0bdlFaPH501yAZxR2TYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5 ibmptkouPgG6bpk5QH8oKZQl5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S-MailID: 20201019035806epcas1p22dc6646d6f40e36a4797ad00fa46dd42 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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