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: <20150131114806.GD26493@n2100.arm.linux.org.uk>
Date:	Sat, 31 Jan 2015 11:48:06 +0000
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Yakir Yang <ykk@...k-chips.com>
Cc:	David Airlie <airlied@...ux.ie>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Fabio Estevam <fabio.estevam@...escale.com>,
	Shawn Guo <shawn.guo@...aro.org>,
	Rob Clark <robdclark@...il.com>,
	Mark Yao <mark.yao@...k-chips.com>,
	Daniel Vetter <daniel@...ll.ch>,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
	djkurtz@...omium.org, dbehr@...omoum.org, mmind00@...glemail.com,
	dianders@...omium.org, marcheu@...omium.org,
	rockchip-discuss@...omium.org
Subject: Re: [PATCH v2 08/12] drm: bridge/dw_hdmi: add audio config interfaces

On Fri, Jan 30, 2015 at 06:32:23AM -0500, Yakir Yang wrote:
> +static void hdmi_config_audio(struct dw_hdmi *hdmi,
> +			      struct hdmi_audio_fmt *aud_fmt)
> +{
> +	if (aud_fmt)
> +		hdmi->aud_fmt = *aud_fmt;
> +
> +	hdmi_modb(hdmi, AUDIO_CONF0_INTERFACE_II2S,
> +		  AUDIO_CONF0_INTERFACE_MSK, HDMI_AUD_CONF0);
> +
> +	hdmi_modb(hdmi, hdmi->aud_fmt.chan_num, AUDIO_CONF0_I2SINEN_MSK,
> +		  HDMI_AUD_CONF0);
> +
> +	hdmi_modb(hdmi, hdmi->aud_fmt.word_length, AUDIO_CONF1_DATWIDTH_MSK,
> +		  HDMI_AUD_CONF1);
> +
> +	hdmi_modb(hdmi, hdmi->aud_fmt.dai_fmt, AUDIO_CONF1_DATAMODE_MSK,
> +		  HDMI_AUD_CONF1);

These registers are not defined on iMX6 SoCs, so this probably needs to be
conditionalised with the dw-hdmi IP version.

> +void hdmi_audio_clk_enable(struct dw_hdmi *hdmi)
> +{
> +	if (hdmi->audio_enable)
> +		return;
> +
> +	mutex_lock(&hdmi->audio_mutex);
> +	hdmi->audio_enable = true;
> +	hdmi_modb(hdmi, 0, HDMI_MC_CLKDIS_AUDCLK_DISABLE, HDMI_MC_CLKDIS);
> +	mutex_unlock(&hdmi->audio_mutex);

This is racy.  The test needs to be within the mutex-protected region.

> +}
> +
> +void hdmi_audio_clk_disable(struct dw_hdmi *hdmi)
> +{
> +	if (!hdmi->audio_enable)
> +		return;
> +
> +	mutex_lock(&hdmi->audio_mutex);
> +	hdmi_modb(hdmi, HDMI_MC_CLKDIS_AUDCLK_DISABLE,
> +		  HDMI_MC_CLKDIS_AUDCLK_DISABLE, HDMI_MC_CLKDIS);
> +	hdmi->audio_enable = false;
> +	mutex_unlock(&hdmi->audio_mutex);

Ditto.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ