Re: [PATCH 11/14] libata: add qc->dma_nbytes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tejun Heo wrote:
qc->nbytes doesn't include extra buffers setup by libata core layer
and my be odd.  This patch adds qc->dma_nbytes which includes any
extra buffers setup by libata core layer and is guaranteed to be
aligned on 4 byte boundary.

This value is to be used to program the host controller.  As this
represents the actual length of buffer available to the controller and
the controller must be able to deal with short transfers for ATAPI
commands which can transfer variable length, this shouldn't break any
controllers while making problems like rounding-down and controllers
choking up on odd transfer bytes much less likely.

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>
---
 drivers/ata/libata-core.c       |   11 +++++++----
 drivers/ata/pata_pdc202xx_old.c |    2 +-
 drivers/ata/sata_inic162x.c     |    2 +-
 drivers/ata/sata_qstor.c        |    2 +-
 include/linux/libata.h          |    3 ++-
 5 files changed, 12 insertions(+), 8 deletions(-)

I would suggest two values:

qc->nbytes	-> value to program host controllers with
qc->raw_nbytes	-> the precise value, without any padding etc.

IMO this makes it more likely that people will use the "right" value


-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux