Jeff Garzik | 1 Mar 01:26 2008

Re: [RFC PATCH] libata: PIO via bounce buffer

Alan Cox wrote:
> First cut at the problem. Given the lack of certainty about worst case
> buffer size (1 page I suspect) this uses kmalloc. We could hang a buffer
> off the device (or I think in fact the port as we never do overlapped PIO)

> +static void ata_bounce_pio_xfer(struct ata_device *dev, struct page *page, 
> +				  unsigned int offset, int count, int do_write)
> +{
> +	struct ata_port *ap = dev->link->ap;
> +	unsigned long flags;
> +	unsigned char *zebedee;
> +	unsigned char *buf;
> +
> +	BUG_ON(offset + count > PAGE_SIZE);
> +
> +	zebedee = kmalloc(count, GFP_ATOMIC);
> +	if (likely(zebedee)) {
> +		if (do_write) {
> +			local_irq_save(flags);
> +			buf = kmap_atomic(page, KM_IRQ0);
> +			memcpy(zebedee, buf + offset, count);
> +			kunmap_atomic(buf, KM_IRQ0);
> +			local_irq_restore(flags);
> +		}
> +		/* do the actual data transfer */
> +		ap->ops->data_xfer(dev, zebedee, count, do_write);
> +		if (!do_write) {
> +			/* Read so bounce  data upwards */
> +			local_irq_save(flags);
> +			buf = kmap_atomic(page, KM_IRQ0);
(Continue reading)

Jeff Garzik | 1 Mar 01:32 2008

[git patches] libata fixes, and release notes


RELEASE NOTES:

There remains an outstanding CD/DVD burning regression, which
is IMO a release blocker.  A fix exists[1], but it is still being
discussed[2].

A data corruptor fix on ATI SB600 (AHCI clone) also exists[3], and is
waiting on confirmation/feedback from AMD, but the existing workaround
(AHCI_HFLAG_32BIT_ONLY) seems to work _most_ of the time, if only by
luck.

[1] http://marc.info/?l=linux-ide&m=120418865825486&w=2
[2] http://marc.info/?t=120418867400002&r=1&w=2
[3] http://marc.info/?l=linux-ide&m=120423157501944&w=2

Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git upstream-linus

to receive the following updates:

 drivers/ata/libata-scsi.c |   10 ++++++
 drivers/ata/sata_svw.c    |   77 ++++++++++++++++++++++++++++++++++++--------
 2 files changed, 73 insertions(+), 14 deletions(-)

Anantha Subramanyam (1):
      sata_svw: Add support for HT1100 SATA controller

Jeff Garzik (1):
      [libata] wrap kmap_atomic(KM_IRQ0) with local_irq_save/restore()
(Continue reading)

Tejun Heo | 1 Mar 07:17 2008
Picon

Re: [PATCH] block: fix residual byte count handling

Hello, Jens, James.

Jens Axboe wrote:
>> With the original patch, I have to run through the whole of libsas and
>> scsi_transport_sas doing
>>
>> s/data_len/raw_data_len/
>>
>> With your update it looks like I have to run through them all doing
>>
>> s/data_len/data_len - extra_len/

blk_rq_raw_data_len() should do.

>> which is even worse.  Can't we put things back to a point where data_len
>> means exactly that and extra_len means how much we have spare on the
>> end, so you know you can DMA up to data_len + extra_len if need be?
>>
>> That way we don't have to sweep through every block driver altering the
>> way it uses data_len.

If SMP is broken because it needs start address alignment but not
padding to align the size, what should be done is to make that exact
requirement visible to the block layer.  Say,
blk_queue_dma_start_alignment() or maybe change
blk_queue_dma_alignment() such that it only indicates start address
alignment and add blk_queue_dma_size_alignment() for drivers which
require size to be aligned too.  I think those are few.

I think the decision which value rq->data_len represents comes down to
(Continue reading)

Borislav Petkov | 1 Mar 09:58 2008

[PATCH 20/24] ide-tape: remove pipelined mode tape control flags

Signed-off-by: Borislav Petkov <petkovbb <at> gmail.com>
---
 drivers/ide/ide-tape.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index a5f29ea..68c9c09 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
 <at>  <at>  -206,19 +206,15  <at>  <at>  enum {
 	/* 0 When the tape position is unknown */
 	IDETAPE_FLAG_ADDRESS_VALID	= (1 <<	1),
 	/* Device already opened */
-	IDETAPE_FLAG_BUSY			= (1 << 2),
-	/* Error detected in a pipeline stage */
-	IDETAPE_FLAG_PIPELINE_ERR	= (1 <<	3),
+	IDETAPE_FLAG_BUSY		= (1 << 2),
 	/* Attempt to auto-detect the current user block size */
-	IDETAPE_FLAG_DETECT_BS		= (1 << 4),
+	IDETAPE_FLAG_DETECT_BS		= (1 << 3),
 	/* Currently on a filemark */
-	IDETAPE_FLAG_FILEMARK		= (1 << 5),
+	IDETAPE_FLAG_FILEMARK		= (1 << 4),
 	/* DRQ interrupt device */
-	IDETAPE_FLAG_DRQ_INTERRUPT	= (1 << 6),
-	/* pipeline active */
-	IDETAPE_FLAG_PIPELINE_ACTIVE	= (1 << 7),
+	IDETAPE_FLAG_DRQ_INTERRUPT	= (1 << 5),
 	/* 0 = no tape is loaded, so we don't rewind after ejecting */
-	IDETAPE_FLAG_MEDIUM_PRESENT	= (1 << 8),
(Continue reading)

Borislav Petkov | 1 Mar 09:58 2008

[PATCH 14/24] ide-tape: remove __idetape_discard_read_pipeline

Signed-off-by: Borislav Petkov <petkovbb <at> gmail.com>
---
 drivers/ide/ide-tape.c |   49 ------------------------------------------------
 1 files changed, 0 insertions(+), 49 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 3cb6e3d..a3a45b5 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
 <at>  <at>  -1973,52 +1973,6  <at>  <at>  static int idetape_create_prevent_cmd(ide_drive_t *drive,
 	return 1;
 }

-static int __idetape_discard_read_pipeline(ide_drive_t *drive)
-{
-	idetape_tape_t *tape = drive->driver_data;
-	unsigned long flags;
-	int cnt;
-
-	if (tape->chrdev_dir != IDETAPE_DIR_READ)
-		return 0;
-
-	/* Remove merge stage. */
-	cnt = tape->merge_stage_size / tape->blk_size;
-	if (test_and_clear_bit(IDETAPE_FLAG_FILEMARK, &tape->flags))
-		++cnt;		/* Filemarks count as 1 sector */
-	tape->merge_stage_size = 0;
-	if (tape->merge_stage != NULL) {
-		__idetape_kfree_stage(tape->merge_stage);
-		tape->merge_stage = NULL;
(Continue reading)

Borislav Petkov | 1 Mar 09:58 2008

[PATCH 02/24] ide-tape: remove pipeline-specific code from idetape_add_chrdev_write_request

Instead of plugging the request into the pipeline, queue it straight on the
device's request queue through idetape_queue_rw_tail().

Signed-off-by: Borislav Petkov <petkovbb <at> gmail.com>
---
 drivers/ide/ide-tape.c |   81 ++---------------------------------------------
 1 files changed, 4 insertions(+), 77 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 792c76e..abf3efa 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
 <at>  <at>  -2123,12 +2123,6  <at>  <at>  static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int blocks,

 	debug_log(DBG_SENSE, "%s: cmd=%d\n", __func__, cmd);

-	if (test_bit(IDETAPE_FLAG_PIPELINE_ACTIVE, &tape->flags)) {
-		printk(KERN_ERR "ide-tape: bug: the pipeline is active in %s\n",
-				__func__);
-		return (0);
-	}
-
 	idetape_init_rq(&rq, cmd);
 	rq.rq_disk = tape->disk;
 	rq.special = (void *)bh;
 <at>  <at>  -2140,10 +2134,9  <at>  <at>  static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int blocks,
 	if ((cmd & (REQ_IDETAPE_READ | REQ_IDETAPE_WRITE)) == 0)
 		return 0;

-	if (tape->merge_stage)
(Continue reading)

Borislav Petkov | 1 Mar 09:58 2008

[PATCH 08/24] ide-tape: remove pipeline-specific code from idetape_space_over_filemarks

Also, remove idetape_wait_first_stage() too since it becomes unused.

Signed-off-by: Borislav Petkov <petkovbb <at> gmail.com>
---
 drivers/ide/ide-tape.c |   65 +-----------------------------------------------
 1 files changed, 1 insertions(+), 64 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 99d6b29..d4a2e73 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
 <at>  <at>  -2143,19 +2143,6  <at>  <at>  static void idetape_create_space_cmd(struct ide_atapi_pc *pc, int count, u8 cmd)
 	pc->idetape_callback = &idetape_pc_callback;
 }

-static void idetape_wait_first_stage(ide_drive_t *drive)
-{
-	idetape_tape_t *tape = drive->driver_data;
-	unsigned long flags;
-
-	if (tape->first_stage == NULL)
-		return;
-	spin_lock_irqsave(&tape->lock, flags);
-	if (tape->active_stage == tape->first_stage)
-		idetape_wait_for_request(drive, tape->active_data_rq);
-	spin_unlock_irqrestore(&tape->lock, flags);
-}
-
 /* Queue up a character device originated write request. */
 static int idetape_add_chrdev_write_request(ide_drive_t *drive, int blocks)
(Continue reading)

Borislav Petkov | 1 Mar 09:58 2008

[PATCH 22/24] ide-tape: remove misc references to pipelined operation in the comments

Signed-off-by: Borislav Petkov <petkovbb <at> gmail.com>
---
 drivers/ide/ide-tape.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 9810253..07e08a3 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
 <at>  <at>  -267,9 +267,7  <at>  <at>  typedef struct ide_tape_obj {
 	 * While polling for DSC we use postponed_rq to postpone the current
 	 * request so that ide.c will be able to service pending requests on the
 	 * other device. Note that at most we will have only one DSC (usually
-	 * data transfer) request in the device request queue. Additional
-	 * requests can be queued in our internal pipeline, but they will be
-	 * visible to ide.c only one at a time.
+	 * data transfer) request in the device request queue.
 	 */
 	struct request *postponed_rq;
 	/* The time in which we started polling for DSC */
 <at>  <at>  -309,10 +307,8  <at>  <at>  typedef struct ide_tape_obj {
 	 * At most, there is only one ide-tape originated data transfer request
 	 * in the device request queue. This allows ide.c to easily service
 	 * requests from the other device when we postpone our active request.
-	 * In the pipelined operation mode, we use our internal pipeline
-	 * structure to hold more data requests. The data buffer size is chosen
-	 * based on the tape's recommendation.
 	 */
+
 	/* ptr to the request which is waiting in the device request queue */
(Continue reading)

Borislav Petkov | 1 Mar 09:58 2008

[PATCH 23/24] ide-tape: remove pipelined mode description from Documentation/ide/ide-tape.txt

Signed-off-by: Borislav Petkov <petkovbb <at> gmail.com>
---
 Documentation/ide/ide-tape.txt |   79 ----------------------------------------
 1 files changed, 0 insertions(+), 79 deletions(-)

diff --git a/Documentation/ide/ide-tape.txt b/Documentation/ide/ide-tape.txt
index 658f271..51f596b 100644
--- a/Documentation/ide/ide-tape.txt
+++ b/Documentation/ide/ide-tape.txt
 <at>  <at>  -8,8 +8,6  <at>  <at> 
  * interface, on the other hand, creates new requests, adds them
  * to the request-list of the block device, and waits for their completion.
  *
- * Pipelined operation mode is now supported on both reads and writes.
- *
  * The block device major and minor numbers are determined from the
  * tape's relative position in the ide interfaces, as explained in ide.c.
  *
 <at>  <at>  -45,83 +43,6  <at>  <at> 
  *
  * | Special care is recommended.  Have Fun!
  *
- *
- * An overview of the pipelined operation mode.
- *
- * In the pipelined write mode, we will usually just add requests to our
- * pipeline and return immediately, before we even start to service them. The
- * user program will then have enough time to prepare the next request while
- * we are still busy servicing previous requests. In the pipelined read mode,
- * the situation is similar - we add read-ahead requests into the pipeline,
(Continue reading)

Borislav Petkov | 1 Mar 09:58 2008

[RFCPATCH 10/24] ide-tape: remove pipeline-specific code from idetape_chrdev_ioctl

The function used to compute the block_offset in order to write it
into mtget.mt_blkno, among others, by going over the stages still
present in the pipeline and adding the sectors left to submit in each
request. This was being done in idetape_pipeline_size() so remove it.
Since we do non-pipelined operation only, compute the offset now
from the sectors left to submit in the currently active request.

Signed-off-by: Borislav Petkov <petkovbb <at> gmail.com>
---
 drivers/ide/ide-tape.c |   39 +++++++++------------------------------
 1 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index dd11c7b..447b7b4 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
 <at>  <at>  -2353,27 +2353,6  <at>  <at>  static void idetape_pad_zeros(ide_drive_t *drive, int bcount)
 	}
 }

-static int idetape_pipeline_size(ide_drive_t *drive)
-{
-	idetape_tape_t *tape = drive->driver_data;
-	idetape_stage_t *stage;
-	struct request *rq;
-	int size = 0;
-
-	idetape_wait_for_pipeline(drive);
-	stage = tape->first_stage;
-	while (stage != NULL) {
(Continue reading)


Gmane