lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171007080625.gotgts2ssgacawpx@latitude>
Date:   Sat, 7 Oct 2017 10:06:25 +0200
From:   Jonathan Neuschäfer <j.neuschaefer@....net>
To:     srinivas.kandagatla@...aro.org
Cc:     gregkh@...uxfoundation.org, broonie@...nel.org,
        alsa-devel@...a-project.org, sdharia@...eaurora.org, bp@...e.de,
        poeschel@...onage.de, treding@...dia.com,
        gong.chen@...ux.intel.com, andreas.noever@...il.com,
        alan@...ux.intel.com, mathieu.poirier@...aro.org, daniel@...ll.ch,
        jkosina@...e.cz, sharon.dvir1@...l.huji.ac.il, joe@...ches.com,
        davem@...emloft.net, james.hogan@...tec.com,
        michael.opdenacker@...e-electrons.com, robh+dt@...nel.org,
        pawel.moll@....com, mark.rutland@....com,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        kheitke@...ience.com, linux-arm-msm@...r.kernel.org, arnd@...db.de
Subject: Re: [Patch v6 4/7] slimbus: Add support for 'clock-pause' feature

Hi, some trivial comments below.

On Fri, Oct 06, 2017 at 05:51:33PM +0200, srinivas.kandagatla@...aro.org wrote:
> From: Sagar Dharia <sdharia@...eaurora.org>
> 
> Per slimbus specification, a reconfiguration sequence known as
> 'clock pause' needs to be broadcast over the bus while entering low-
> power mode. Clock-pause is initiated by the controller driver.
> To exit clock-pause, controller typically wakes up the framer device.
> Since wakeup precedure is controller-specific, framework calls it via
> controller's function pointer to invoke it.
> 
> Signed-off-by: Sagar Dharia <sdharia@...eaurora.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> ---
[...]
> @@ -429,6 +444,14 @@ void slim_return_tx(struct slim_controller *ctrl, int err)
>  		cur.cb(cur.ctx, err);
>  
>  	up(&ctrl->tx_sem);
> +	if (!cur.clk_pause && (!cur.need_tid || err)) {
> +		/**

This isn't really a kerneldoc comment.

> +		 * remove runtime-pm vote if this was TX only, or
> +		 * if there was error during this transaction
> +		 */
> +		pm_runtime_mark_last_busy(ctrl->dev.parent);
> +		pm_runtime_put_autosuspend(ctrl->dev.parent);
> +	}
>  }
>  EXPORT_SYMBOL_GPL(slim_return_tx);
>  
[...]
> +/**
> + * slim_ctrl_clk_pause: Called by slimbus controller to enter/exit 'clock pause'
> + * Slimbus specification needs this sequence to turn-off clocks for the bus.
> + * The sequence involves sending 3 broadcast messages (reconfiguration
> + * sequence) to inform all devices on the bus.
> + * To exit clock-pause, controller typically wakes up active framer device.
> + * @ctrl: controller requesting bus to be paused or woken up
> + * @wakeup: Wakeup this controller from clock pause.
> + * @restart: Restart time value per spec used for clock pause. This value
> + *	isn't used when controller is to be woken up.
> + * This API executes clock pause reconfiguration sequence if wakeup is false.
> + * If wakeup is true, controller's wakeup is called.
> + * For entering clock-pause, -EBUSY is returned if a message txn in pending.
> + */
> +int slim_ctrl_clk_pause(struct slim_controller *ctrl, bool wakeup, u8 restart)
> +{
> +	int i, ret = 0;
> +	unsigned long flags;
> +	struct slim_sched *sched = &ctrl->sched;
> +	struct slim_val_inf msg = {0, 0, NULL, NULL, NULL, NULL};
> +
> +	DEFINE_SLIM_BCAST_TXN(txn, SLIM_MSG_MC_BEGIN_RECONFIGURATION,
> +				3, SLIM_LA_MANAGER, &msg);
> +
> +	if (wakeup == false && restart > SLIM_CLK_UNSPECIFIED)
> +		return -EINVAL;
> +
> +	mutex_lock(&sched->m_reconf);
> +	if (wakeup) {
> +		if (sched->clk_state == SLIM_CLK_ACTIVE) {
> +			mutex_unlock(&sched->m_reconf);
> +			return 0;
> +		}
> +
> +		/**

ditto

> +		 * Fine-tune calculation based on clock gear,
> +		 * message-bandwidth after bandwidth management
> +		 */
> +		ret = wait_for_completion_timeout(&sched->pause_comp,
> +				msecs_to_jiffies(100));
> +		if (!ret) {
> +			mutex_unlock(&sched->m_reconf);
> +			pr_err("Previous clock pause did not finish");
> +			return -ETIMEDOUT;
> +		}
> +		ret = 0;
> +
> +		/**

ditto

> +		 * Slimbus framework will call controller wakeup
> +		 * Controller should make sure that it sets active framer
> +		 * out of clock pause
> +		 */
> +		if (sched->clk_state == SLIM_CLK_PAUSED && ctrl->wakeup)
> +			ret = ctrl->wakeup(ctrl);
> +		if (!ret)
> +			sched->clk_state = SLIM_CLK_ACTIVE;
> +		mutex_unlock(&sched->m_reconf);
> +
> +		return ret;
> +	}
[...]


Thanks,
Jonathan Neuschäfer

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ