All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Borislav Petkov <petkovbb@googlemail.com>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	Borislav Petkov <petkovbb@gmail.com>
Subject: Re: [PATCH 0/9] ide-atapi: remove ide_atapi_pc from the irq handler
Date: Tue, 16 Dec 2008 21:35:27 +0100	[thread overview]
Message-ID: <200812162135.27902.bzolnier@gmail.com> (raw)
In-Reply-To: <1229412969-3552-1-git-send-email-petkovbb@gmail.com>


Hi,

On Tuesday 16 December 2008, Borislav Petkov wrote:
> Hi Bart,
> 
> here's a first attempt at removing all references to ide_atapi_pc in the ATAPI
> IRQ handler. I've moved some of the members to the drive struct and will deal
> with them later :). The next step is to add an ide_atapi_queue_pc() routine

Hmm.  I recall discussing this before and having some concerns about struct
ide_atapi_pc removal idea probably being premature...

Looking at the patchset itself -- I'm very sorry but I just cannot apply it
with all these command specific fields going into ide_drive_t:

        unsigned long pc_flags;
        int pc_req_xfer;
        int pc_buf_size;
        int pc_error;

While they may look similar to the existing pc_* fields:

        /* callback for packet commands */
        void (*pc_callback)(struct ide_drive_s *, int);

        void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *);
        int  (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *,
                              unsigned int, int);

they are clearly not.  Existing pc_* callbacks are per-device type (they
should have been probably named drv_*) and new ones are per-command ones.

I also don't see a way for code to differentiate between pc and failed_pc.

Moreover if we would like to ever add support for multiple queued commands
(actually I think that in a very limited way ide-tape does it already with
DSC) we would have to completely revert these changes.

Re-assuming: this is one-step forward / one-step back approach and not
exactly the kind of design that we would like to advocate.

> similar to ide_cd_queue_pc() and then rewrite all functions in the drivers to
> use struct requests and local buffers instead of pc->buf and then, after that
> works reliably, finally get rid of ide_atapi_pc completely.

Why not take care of low hanging fruits first?  There is still plenty...

- ide-cd uses private struct request for REQUEST SENSE (=> ide_drive_t's)

- it should be possible to port ide-cd to use ide_{issue,transfer}_pc()
  _without_ dealing with struct ide_atapi_pc issue at all

- why not investigate the possibility of porting ide-cd to using sg-s for
  PIO transfers first -- this should get rid of ide_cd_restore_request()
  and most of other rq fields manipulations

...and this is from taking not so long look at the current driver.

Why attack the "hard" problem first (struct ide_atapi_pc one) while there
are easier ones to deal with?  It may happen that once these easier ones
are fixed we will be able to view the "hard" one from a completely different
perspective (because code's complexity will decrease a lot in the meantime
it no longer will be a "hard" problem) and apply a better solution.

Besides I'm not fully convinced that struct ide_atapi_pc has to go first in
order to port ide-cd over ide-atapi -- we can just instead port ide-cd to
use struct ide_atapi_pc (however probably only after converting the driver
to use sg-s for PIO transfers -- otherwise it becomes another "hard" problem)
and then deal with struct ide_atapi_pc for all ATAPI code (be using struct
request fields directly or by merging struct ide_atapi_pc into ide_task_t
and always using the latter structure for ATA[PI] commands -- which is the
option that I personally came to prefer lately)...

Thanks,
Bart

  parent reply	other threads:[~2008-12-16 20:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16  7:36 [PATCH 0/9] ide-atapi: remove ide_atapi_pc from the irq handler Borislav Petkov
2008-12-16  7:36 ` Borislav Petkov
2008-12-16  7:36 ` [PATCH 1/9] ide-atapi: remove PC_FLAG_WRITING atapi flag Borislav Petkov
2008-12-16  7:36   ` Borislav Petkov
2008-12-16  7:36 ` [PATCH 2/9] ide-atapi: replace pc->flags with drive->pc_flags Borislav Petkov
2008-12-16  7:36   ` Borislav Petkov
2008-12-16  7:36 ` [PATCH 3/9] ide-atapi: replace pc->buf with rq->data in the irq handler Borislav Petkov
2008-12-16  7:36   ` Borislav Petkov
2008-12-16  7:36 ` [PATCH 4/9] ide-atapi: replace pc->req_xfer with drive->pc_req_xfer Borislav Petkov
2008-12-16  7:36   ` Borislav Petkov
2008-12-16  7:36 ` [PATCH 5/9] ide-atapi: replace pc->buf_size with drive->pc_buf_size Borislav Petkov
2008-12-16  7:36   ` Borislav Petkov
2008-12-16  7:36 ` [PATCH 6/9] ide-atapi: remove pc arg to drive->pc_io_buffers Borislav Petkov
2008-12-16  7:36   ` Borislav Petkov
2008-12-16  7:36 ` [PATCH 7/9] ide-atapi: use rq pointer directly instead of pc->rq deref Borislav Petkov
2008-12-16  7:36   ` Borislav Petkov
2008-12-16  7:36 ` [PATCH 8/9] ide-atapi: replace pc->error with drive->pc_error Borislav Petkov
2008-12-16  7:36   ` Borislav Petkov
2008-12-16  7:36 ` [PATCH 9/9] ide-atapi: remove pc arg to drive->pc_update_buffers Borislav Petkov
2008-12-16  7:36   ` Borislav Petkov
2008-12-16 20:35 ` Bartlomiej Zolnierkiewicz [this message]
2008-12-17  7:25   ` [PATCH 0/9] ide-atapi: remove ide_atapi_pc from the irq handler Borislav Petkov
2008-12-17 16:45     ` Bartlomiej Zolnierkiewicz
2008-12-17 19:29       ` 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=200812162135.27902.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petkovbb@gmail.com \
    --cc=petkovbb@googlemail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.