All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Benson Leung <bleung@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	linux-pwm@vger.kernel.org, chrome-platform@lists.linux.dev,
	kernel@pengutronix.de
Subject: Re: [PATCH 7/8] pwm: cros-ec: Put per channel data into driver data
Date: Fri, 30 Jun 2023 12:54:37 +0800	[thread overview]
Message-ID: <ZJ5gDWlm38qYguyH@google.com> (raw)
In-Reply-To: <20230629094839.757092-8-u.kleine-koenig@pengutronix.de>

On Thu, Jun 29, 2023 at 11:48:38AM +0200, Uwe Kleine-König wrote:
> Instead of an allocation of a single u16 per channel, allocate them all
> in a single chunk which greatly reduces memory fragmentation and also
> the overhead to track the allocated memory. Also put the channel data in
> driver data where it's cheaper to determine the address (no function
> call involved, just a trivial pointer addition).
> 
> This also allows to get rid of the request and free callbacks.
> 
> The only cost is that the channel data is allocated early, and even for
> unused channels.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

With comments addressed below:
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

> @@ -27,6 +27,7 @@ struct cros_ec_pwm_device {
>  	struct cros_ec_device *ec;
>  	struct pwm_chip chip;
>  	bool use_pwm_type;
> +	struct cros_ec_pwm *channel;

Please update the kernel-doc too.  Otherwise:
$ ./scripts/kernel-doc -none drivers/pwm/pwm-cros-ec.c
drivers/pwm/pwm-cros-ec.c:31: warning: Function parameter or member 'channel'
not described in 'cros_ec_pwm_device'

I have no strong preference: please consider to use `channels` if it makes
sense.

  reply	other threads:[~2023-06-30  4:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29  9:48 [PATCH 0/8] pwm: Get rid of pwm_[sg]et_chip_data() Uwe Kleine-König
2023-06-29  9:48 ` Uwe Kleine-König
2023-06-29  9:48 ` [PATCH 1/8] pwm: berlin: Put channel config into driver data Uwe Kleine-König
2023-06-29  9:48 ` [PATCH 2/8] pwm: samsung: Put channel data " Uwe Kleine-König
2023-06-29  9:48   ` Uwe Kleine-König
2023-06-29  9:48 ` [PATCH 3/8] pwm: jz4740: Put per-channel clk " Uwe Kleine-König
2023-06-30 10:25   ` Philippe Mathieu-Daudé
2023-06-29  9:48 ` [PATCH 4/8] pwm: lp3943: Drop usage of pwm_[gs]et_chip_data() Uwe Kleine-König
2023-06-29  9:48 ` [PATCH 5/8] pwm: renesas: " Uwe Kleine-König
2023-06-29  9:48 ` [PATCH 6/8] pwm: sti: Reduce number of allocations and drop usage of chip_data Uwe Kleine-König
2023-06-29  9:48 ` [PATCH 7/8] pwm: cros-ec: Put per channel data into driver data Uwe Kleine-König
2023-06-30  4:54   ` Tzung-Bi Shih [this message]
2023-06-30  6:50     ` Uwe Kleine-König
2023-06-29  9:48 ` [PATCH 8/8] pwm: Drop pwm_[sg]et_chip_data() Uwe Kleine-König

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=ZJ5gDWlm38qYguyH@google.com \
    --to=tzungbi@kernel.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=groeck@chromium.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.