linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: petkovbb@gmail.com
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] ide-{cd,floppy}: do not map all cmds to an sg
Date: Wed, 11 Mar 2009 17:34:28 +0100	[thread overview]
Message-ID: <200903111734.28956.bzolnier@gmail.com> (raw)
In-Reply-To: <20090310060833.GA7895@liondog.tnic>

On Tuesday 10 March 2009, Borislav Petkov wrote:
> Hi,
> 
> > If the mainline is broken sg fix can wait but to be honest I don't see much
> > point in delaying it (it is an independent problem and the bugfix should be
> > a completely safe one-liner).
> 
> --
> From: Borislav Petkov <petkovbb@gmail.com>
> Date: Tue, 10 Mar 2009 07:04:52 +0100
> Subject: [PATCH] ide-floppy: do not map dataless cmds to an sg
> 
> since it fails the virt_to_page() translation check with DEBUG_VIRTUAL
> enabled.
> 
> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>

I applied it with some changes:

> ---
>  drivers/ide/ide-atapi.c  |   12 ++++++++++++
>  drivers/ide/ide-floppy.c |    6 ++++--
>  2 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
> index a5596a6..11a680c 100644
> --- a/drivers/ide/ide-atapi.c
> +++ b/drivers/ide/ide-atapi.c
> @@ -90,6 +90,12 @@ static void ide_queue_pc_head(ide_drive_t *drive, struct gendisk *disk,
>  	rq->cmd_flags |= REQ_PREEMPT;
>  	rq->buffer = (char *)pc;
>  	rq->rq_disk = disk;
> +
> +	if (pc->req_xfer) {
> +		rq->data = pc->buf;
> +		rq->data_len = pc->req_xfer;
> +	}
> +
>  	memcpy(rq->cmd, pc->c, 12);
>  	if (drive->media == ide_tape)
>  		rq->cmd[13] = REQ_IDETAPE_PC1;
> @@ -112,6 +118,12 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
>  	rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
>  	rq->cmd_type = REQ_TYPE_SPECIAL;
>  	rq->buffer = (char *)pc;
> +
> +	if (pc->req_xfer) {
> +		rq->data = pc->buf;
> +		rq->data_len = pc->req_xfer;
> +	}
> +
>  	memcpy(rq->cmd, pc->c, 12);
>  	if (drive->media == ide_tape)
>  		rq->cmd[13] = REQ_IDETAPE_PC1;

ide-atapi.c part doesn't seem to be needed for fixing the issue
so I removed it (IMO it would fit much better with your sg setup
cleanup patch than this one)

> diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
> index 2f8f453..2b4868d 100644
> --- a/drivers/ide/ide-floppy.c
> +++ b/drivers/ide/ide-floppy.c
> @@ -282,8 +282,10 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
>  
>  	cmd.rq = rq;
>  
> -	ide_init_sg_cmd(&cmd, pc->req_xfer);
> -	ide_map_sg(drive, &cmd);
> +	if (blk_fs_request(rq) || pc->req_xfer) {

ditto for blk_fs_request(rq) check

> +		ide_init_sg_cmd(&cmd, pc->req_xfer);
> +		ide_map_sg(drive, &cmd);
> +	}
>  
>  	pc->rq = rq;

Thanks,
Bart

  reply	other threads:[~2009-03-11 17:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04  9:16 [PATCH 0/3] some ide fixes Borislav Petkov
2009-03-04  9:16 ` [PATCH 1/3] ide-{floppy,tape}: fix padding for PIO transfers Borislav Petkov
2009-03-04  9:16 ` [PATCH 2/3] ide-floppy: use ide_pio_bytes() Borislav Petkov
2009-03-05 12:27   ` Bartlomiej Zolnierkiewicz
2009-03-04  9:16 ` [PATCH 3/3] ide-{cd,floppy}: do not map all cmds to an sg Borislav Petkov
2009-03-05 12:12   ` Bartlomiej Zolnierkiewicz
2009-03-05 13:53     ` Borislav Petkov
2009-03-05 14:49       ` Bartlomiej Zolnierkiewicz
2009-03-05 15:19         ` Borislav Petkov
2009-03-05 16:52           ` Bartlomiej Zolnierkiewicz
2009-03-05 17:58             ` Borislav Petkov
2009-03-08  7:53             ` Borislav Petkov
2009-03-08 17:08               ` Bartlomiej Zolnierkiewicz
2009-03-10  6:08                 ` Borislav Petkov
2009-03-11 16:34                   ` Bartlomiej Zolnierkiewicz [this message]
2009-03-12  7:12                     ` Borislav Petkov
2009-03-12 16:58                       ` Bartlomiej Zolnierkiewicz
2009-03-12 17:10                         ` Borislav Petkov

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=200903111734.28956.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=petkovbb@gmail.com \
    /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).