linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: linux-ide@vger.kernel.org, tj@kernel.org, aaron.lu@intel.com
Subject: Re: [PATCH] libata-zpodd: must use ata_tf_init()
Date: Wed, 26 Jun 2013 10:05:40 +0800	[thread overview]
Message-ID: <51CA4C74.50400@intel.com> (raw)
In-Reply-To: <201306232325.04732.sergei.shtylyov@cogentembedded.com>

On 06/24/2013 03:25 AM, Sergei Shtylyov wrote:
> There are  some SATA controllers which have both devices 0 and 1 but this module

Do you mean a SATA port can connect to two SATA devices without PMP?
No objections to this patch, it's obviously correct, just want to learn
something more :-)

Thanks,
Aaron

> just zeroes out taskfile and sets then ATA_TFLAG_DEVICE (not sure that's needed)
> which could  lead to a wrong device being selected just before issuing command.
> Thus we should  call ata_tf_init()  which sets  up the device register value
> properly, like  all other users of ata_exec_internal() do...
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---
> The  patch is against the 'for-3.10-fixes' branch of Tejun Heo's 'libata.git'
> repository. 
> 
>  drivers/ata/libata-zpodd.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Index: libata/drivers/ata/libata-zpodd.c
> ===================================================================
> --- libata.orig/drivers/ata/libata-zpodd.c
> +++ libata/drivers/ata/libata-zpodd.c
> @@ -32,13 +32,14 @@ struct zpodd {
>  
>  static int eject_tray(struct ata_device *dev)
>  {
> -	struct ata_taskfile tf = {};
> +	struct ata_taskfile tf;
>  	const char cdb[] = {  GPCMD_START_STOP_UNIT,
>  		0, 0, 0,
>  		0x02,     /* LoEj */
>  		0, 0, 0, 0, 0, 0, 0,
>  	};
>  
> +	ata_tf_init(dev, &tf);
>  	tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
>  	tf.command = ATA_CMD_PACKET;
>  	tf.protocol = ATAPI_PROT_NODATA;
> @@ -52,8 +53,7 @@ static enum odd_mech_type zpodd_get_mech
>  	char buf[16];
>  	unsigned int ret;
>  	struct rm_feature_desc *desc = (void *)(buf + 8);
> -	struct ata_taskfile tf = {};
> -
> +	struct ata_taskfile tf;
>  	char cdb[] = {  GPCMD_GET_CONFIGURATION,
>  			2,      /* only 1 feature descriptor requested */
>  			0, 3,   /* 3, removable medium feature */
> @@ -62,6 +62,7 @@ static enum odd_mech_type zpodd_get_mech
>  			0, 0, 0,
>  	};
>  
> +	ata_tf_init(dev, &tf);
>  	tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
>  	tf.command = ATA_CMD_PACKET;
>  	tf.protocol = ATAPI_PROT_PIO;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ide" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  parent reply	other threads:[~2013-06-26  2:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-23 19:25 [PATCH] libata-zpodd: must use ata_tf_init() Sergei Shtylyov
2013-06-23 19:34 ` Sergei Shtylyov
2013-06-24 22:46 ` Tejun Heo
2013-06-26  2:05 ` Aaron Lu [this message]
2013-06-26 11:10   ` Sergei Shtylyov
2013-06-27  1:15     ` Aaron Lu
2013-06-28 12:49       ` Sergei Shtylyov
2013-06-29 13:04         ` Aaron Lu

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=51CA4C74.50400@intel.com \
    --to=aaron.lu@intel.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=tj@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;
as well as URLs for NNTP newsgroup(s).