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: <5526478A.6060707@cogentembedded.com>
Date:	Thu, 09 Apr 2015 12:34:02 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Brian Norris <computersforpeace@...il.com>,
	Tejun Heo <tj@...nel.org>
CC:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	linux-ide@...r.kernel.org, kernel@...inux.com,
	Srinivas Kandagatla <srinivas.kandagatla@...il.com>,
	Maxime Coquelin <maxime.coquelin@...com>,
	Patrice Chotard <patrice.chotard@...com>
Subject: Re: [PATCH] ata: ahci_st: fixup layering violations / drvdata errors

Hello.

On 4/8/2015 9:59 PM, Brian Norris wrote:

> When working on another SATA driver that uses libahci_platform, I
> noticed an error in this driver; it tries to the the driver data for its
> device, while libata also thinks it can set the driver data. See:

>    ahci_platform_init_host()
>    -> ata_host_alloc_pinfo()
>       -> ata_host_alloc()
>          -> dev_set_drvdata()

> So instead of sticking the IP-specific platform data into drvdata, let's
> use the plat_data variable that is reserved for this use.

> Signed-off-by: Brian Norris <computersforpeace@...il.com>
> Cc: Srinivas Kandagatla <srinivas.kandagatla@...il.com>
> Cc: Maxime Coquelin <maxime.coquelin@...com>
> Cc: Patrice Chotard <patrice.chotard@...com>
> ---
> This is ONLY compile tested; I don't have hardware to run. This looks like it
> could have ramifications on suspend/resume support, and hot device removal
> (e.g., sysfs unbind), so it might qualify as -stable, if someone can test it

>   drivers/ata/ahci_st.c | 25 ++++++++++++++-----------
>   1 file changed, 14 insertions(+), 11 deletions(-)

> diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c
> index bc971af262e7..2bd2375c2ab1 100644
> --- a/drivers/ata/ahci_st.c
> +++ b/drivers/ata/ahci_st.c
[...]
> @@ -107,7 +108,9 @@ static void st_ahci_host_stop(struct ata_host *host)
>
>   static int st_ahci_probe_resets(struct platform_device *pdev)
>   {
> -	struct st_ahci_drv_data *drv_data = platform_get_drvdata(pdev);
> +	struct ata_host *host = dev_get_drvdata(&pdev->dev);

    Why not just platform_get_drvdata()?

[...]

MBR, Sergei

--
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