linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 4/5] sil24: add ATAPI support
       [not found] <20051116080759.GD22807@htj.dyndns.org>
@ 2005-11-16 12:35 ` Jeff Garzik
  2005-11-16 13:24   ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Garzik @ 2005-11-16 12:35 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide@vger.kernel.org

Tejun Heo wrote:
> +	case ATA_PROT_ATAPI:
> +	case ATA_PROT_ATAPI_DMA:
> +	case ATA_PROT_ATAPI_NODATA:
> +		prb = &cb->atapi.prb;
> +		sge = cb->atapi.sge;
> +		memset(cb->atapi.cdb, 0, 32);
> +		memcpy(cb->atapi.cdb, qc->cdb, ap->cdb_len);
> +
> +		if (unlikely((ap->cdb_len == 16) ^ pp->cdb16)) {
> +			pp->cdb16 = ap->cdb_len == 16;
> +			if (pp->cdb16)
> +				writel(PORT_CS_CDB16, port + PORT_CTRL_STAT);
> +			else
> +				writel(PORT_CS_CDB16, port + PORT_CTRL_CLR);
> +		}

NAK:
* you should set PORT_CS_CDB16 from ->dev_config(), not needlessly test 
inside the fast path
* thus, no need to cache cdb16 flag.  just tell the hardware once, and 
then everybody agrees on the correct value.


> @@ -772,6 +802,9 @@ static int sil24_port_start(struct ata_p
>  
>  	ap->private_data = pp;
>  
> +	/* default to 12byte CDB */
> +	writel(PORT_CS_CDB16, port + PORT_CTRL_CLR);
> +
>  	return 0;

If you set it in ->dev_config(), this should go away.

	Jeff



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 4/5] sil24: add ATAPI support
  2005-11-16 12:35 ` [PATCH 4/5] sil24: add ATAPI support Jeff Garzik
@ 2005-11-16 13:24   ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2005-11-16 13:24 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide@vger.kernel.org

Jeff Garzik wrote:
> Tejun Heo wrote:
> 
>> +    case ATA_PROT_ATAPI:
>> +    case ATA_PROT_ATAPI_DMA:
>> +    case ATA_PROT_ATAPI_NODATA:
>> +        prb = &cb->atapi.prb;
>> +        sge = cb->atapi.sge;
>> +        memset(cb->atapi.cdb, 0, 32);
>> +        memcpy(cb->atapi.cdb, qc->cdb, ap->cdb_len);
>> +
>> +        if (unlikely((ap->cdb_len == 16) ^ pp->cdb16)) {
>> +            pp->cdb16 = ap->cdb_len == 16;
>> +            if (pp->cdb16)
>> +                writel(PORT_CS_CDB16, port + PORT_CTRL_STAT);
>> +            else
>> +                writel(PORT_CS_CDB16, port + PORT_CTRL_CLR);
>> +        }
> 
> 
> NAK:
> * you should set PORT_CS_CDB16 from ->dev_config(), not needlessly test 
> inside the fast path
> * thus, no need to cache cdb16 flag.  just tell the hardware once, and 
> then everybody agrees on the correct value.
> 

Oh.. I didn't know about ->dev_config().  Thanks for pointing out.

> 
>> @@ -772,6 +802,9 @@ static int sil24_port_start(struct ata_p
>>  
>>      ap->private_data = pp;
>>  
>> +    /* default to 12byte CDB */
>> +    writel(PORT_CS_CDB16, port + PORT_CTRL_CLR);
>> +
>>      return 0;
> 
> 
> If you set it in ->dev_config(), this should go away.

Sure.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-16 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20051116080759.GD22807@htj.dyndns.org>
2005-11-16 12:35 ` [PATCH 4/5] sil24: add ATAPI support Jeff Garzik
2005-11-16 13:24   ` Tejun Heo

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