public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: jonghwa3.lee@samsung.com
To: Pavel Machek <pavel@ucw.cz>
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org,
	anton@enomsg.org, myungjoo.ham@samsung.com,
	cw00.choi@samsung.com
Subject: Re: [PATCH V3 11/11] power: charger-manager: Support to change polling rate in runtime.
Date: Mon, 22 Dec 2014 10:57:17 +0900	[thread overview]
Message-ID: <54977A7D.2060301@samsung.com> (raw)
In-Reply-To: <20141220002908.GD1694@amd>

On 2014년 12월 20일 09:29, Pavel Machek wrote:

> 
>> Add 'polling_ms' sysfs node to change charger-manager's monitoring rate
>> in runtime. It can set only bigger than 2 jiffies (for 200 HZ system it
>> is 10 msecs.) as it's allowed for minimum poling rate in previous.
> 
> New sysfs filesneed documentation.
> 
>> It resets poller and re-configure polling rate based on new input if next
> 
> re-configures...", if"
> 
>> polling time is far enough. Otherwise, it just waits expiration of timer
> 
> "waits for"
> 
>> and new polling rate will affects the next scheduling.
> 
> "affect"?
> 


Sorry for so many typos.. including above typos I'll revise all of them.

> 
>> +static ssize_t show_polling_ms(struct device *dev,
>> +				struct device_attribute *attr, char *buf)
>> +{
>> +	struct charger_manager *cm;
>> +	ssize_t len;
>> +
>> +	list_for_each_entry(cm, &cm_list, entry)
>> +		if (cm->charger_psy.dev == dev)
>> +			break;
>> +
>> +	if (cm->charger_psy.dev != dev)
>> +		return -EINVAL;
> 
> Any chance to reorganize data structures so that this kind of list
> walking is not neccessary?
> 


No need to reorganize, I'll fix it to get target data without unnecessary
iteration.

>> +static ssize_t store_polling_ms(struct device *dev,
>> +				struct device_attribute *attr, const char *buf,
>> +				size_t count)
>> +{
>> +	struct charger_manager *cm;
>> +	int polling_ms;
>> +	int ret;
>> +
>> +	ret = sscanf(buf, "%d", &polling_ms);
> 
> "kstrtoul"?
> 


Yes, it would be better. I'll modify it either.

Thanks for reviewing.
Jonghwa

> 									Pavel



      reply	other threads:[~2014-12-22  1:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19  8:55 [PATCH V3 0/11] Improve charger manager driver for optimized operation Jonghwa Lee
2014-12-19  8:55 ` [PATCH V3 01/11] power: charger-manager: Use alarmtimer for battery monitoring in suspend Jonghwa Lee
2014-12-20  0:21   ` Pavel Machek
2015-01-21 20:44   ` Sebastian Reichel
2014-12-19  8:55 ` [PATCH V3 02/11] power: charger-manager: Use thermal subsystem interface only to get temperature Jonghwa Lee
2015-01-21 22:38   ` Sebastian Reichel
2014-12-19  8:55 ` [PATCH V3 03/11] power: charger-manager: Use power_supply_changed() not private uevent Jonghwa Lee
2014-12-19  8:55 ` [PATCH V3 04/11] power: charger-manager: Remove deprecated function, cm_notify_event() Jonghwa Lee
2014-12-19  8:55 ` [PATCH V3 05/11] power: charger-manager: Fix to use CHARGE_NOW/FULL property correctly Jonghwa Lee
2014-12-19  8:55 ` [PATCH V3 06/11] power: charger-manager: Concentrate scattered power_supply_changed() calls Jonghwa Lee
2014-12-19  8:55 ` [PATCH V3 07/11] power: charger-manager: Get external power souce information only from EXTCON Jonghwa Lee
2014-12-19  8:55 ` [PATCH V3 08/11] power: charger-manager: Make chraging decision focusing on battery status Jonghwa Lee
2014-12-20  0:24   ` Pavel Machek
2014-12-22  2:10     ` jonghwa3.lee
2014-12-19  8:55 ` [PATCH V3 09/11] power: charger-manager: Not to start charging directly in cable nofitication Jonghwa Lee
2014-12-19  8:55 ` [PATCH V3 10/11] power: charger-manager: Support different polling mode for sleep state Jonghwa Lee
2014-12-19  8:55 ` [PATCH V3 11/11] power: charger-manager: Support to change polling rate in runtime Jonghwa Lee
2014-12-20  0:29   ` Pavel Machek
2014-12-22  1:57     ` jonghwa3.lee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54977A7D.2060301@samsung.com \
    --to=jonghwa3.lee@samsung.com \
    --cc=anton@enomsg.org \
    --cc=cw00.choi@samsung.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=pavel@ucw.cz \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox