All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Tejun Heo <tj@home-tj.org>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.11-rc2 08/09] ide: map ide_cmd_ioctl() to ide_taskfile_ioctl()
Date: Mon, 07 Feb 2005 14:02:49 +0900	[thread overview]
Message-ID: <4206F679.8060309@gmail.com> (raw)
In-Reply-To: <58cb370e050206104674386588@mail.gmail.com>

Bartlomiej Zolnierkiewicz wrote:
> I have not fully reviewed it yet but I've noticed two things...
> 
> 
>>@@ -648,11 +648,11 @@ u8 eighty_ninty_three (ide_drive_t *driv
>>
>> EXPORT_SYMBOL(eighty_ninty_three);
>>
>>-int ide_ata66_check (ide_drive_t *drive, ide_task_t *args)
>>+int ide_ata66_check(ide_drive_t *drive, task_ioreg_t *regs)
>> {
>>-       if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) &&
>>-           (args->tfRegister[IDE_SECTOR_OFFSET] > XFER_UDMA_2) &&
>>-           (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER)) {
>>+       if (regs[IDE_COMMAND_OFFSET] == WIN_SETFEATURES &&
>>+           regs[IDE_SECTOR_OFFSET] > XFER_UDMA_2 &&
>>+           regs[IDE_FEATURE_OFFSET] == SETFEATURES_XFER) {
>> #ifndef CONFIG_IDEDMA_IVB
>>                if ((drive->id->hw_config & 0x6000) == 0) {
>> #else /* !CONFIG_IDEDMA_IVB */
> 
> 
> What is the rationale for this change?
> ide_task_t is available in ide_cmd_ioctl().
> 

  Sorry, it was for the previous map to ide_taskfile_ioctl() 
implementation, where ide_cmd_ioctl() didn't have ide_task_t.  I'll 
restore it.  Also, I've forgot to update the description of this patch. 
  I'll fix that too.

> 
>>@@ -678,11 +678,11 @@ int ide_ata66_check (ide_drive_t *drive,
>>  * 1 : Safe to update drive->id DMA registers.
>>  * 0 : OOPs not allowed.
>>  */
>>-int set_transfer (ide_drive_t *drive, ide_task_t *args)
>>+int set_transfer(ide_drive_t *drive, task_ioreg_t *regs)
>> {
>>-       if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) &&
>>-           (args->tfRegister[IDE_SECTOR_OFFSET] >= XFER_SW_DMA_0) &&
>>-           (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER) &&
>>+       if (regs[IDE_COMMAND_OFFSET] == WIN_SETFEATURES &&
>>+           regs[IDE_SECTOR_OFFSET] >= XFER_SW_DMA_0 &&
>>+           regs[IDE_FEATURE_OFFSET] == SETFEATURES_XFER &&
>>            (drive->id->dma_ultra ||
>>             drive->id->dma_mword ||
>>             drive->id->dma_1word))
> 
> 
> ditto
> 

  ditto. :-)

> 
>>+       io_32bit = drive->io_32bit;
>>+       drive->io_32bit = 0;    /* racy */
>>+       ret = ide_diag_taskfile(drive, &task, in_size, buf);
>>+       drive->io_32bit = io_32bit;
> 
> 
> It wasn't racy before this patch.  I know that it is like that
> in ide_taskfile_ioctl() but it is not an excuse for propagating
> the bug.  It can be easily fixed if you use drive_cmd_intr()
> instead of task_in_intr() as task->handler.

  Fixing the race condition in taskfile ioctl was on my to-do list, so I 
was thinking unifying the problem wouldn't be bad such that it can be 
fixed together later (soon).  I think I can make a patch to fix taskfile 
ioctl first and then submit this patch again without the race.

  Thanks.

-- 
tejun


  reply	other threads:[~2005-02-07  5:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-05  2:15 [PATCH 2.6.11-rc2] ide: driver updates (phase 2) Tejun Heo
2005-02-05  9:53 ` Tejun Heo
2005-02-05 10:14   ` Tejun Heo
     [not found] ` <20050205021555.F3D161326FA@htj.dyndns.org>
2005-02-06 13:20   ` [PATCH 2.6.11-rc2 01/09] ide: kill unused pkt_task_t Bartlomiej Zolnierkiewicz
     [not found] ` <20050205021556.8FC05132701@htj.dyndns.org>
2005-02-06 18:34   ` [PATCH 2.6.11-rc2 04/09] ide: convert REQ_DRIVE_TASK to REQ_DRIVE_TASKFILE Bartlomiej Zolnierkiewicz
2005-02-07  5:13     ` Tejun Heo
     [not found] ` <20050205021556.CFCE41326F9@htj.dyndns.org>
2005-02-06 18:38   ` [PATCH 2.6.11-rc2 05/09] ide: map ide_task_ioctl() to ide_taskfile_ioctl() Bartlomiej Zolnierkiewicz
2005-02-07  5:04     ` Tejun Heo
     [not found] ` <20050205021557.6A692132705@htj.dyndns.org>
2005-02-06 18:46   ` [PATCH 2.6.11-rc2 08/09] ide: map ide_cmd_ioctl() " Bartlomiej Zolnierkiewicz
2005-02-07  5:02     ` Tejun Heo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-02-05 10:25 [PATCH REPOST 2.6.11-rc2] ide: driver updates (phase 2) Tejun Heo
2005-02-05 10:28 ` [PATCH 2.6.11-rc2 08/09] ide: map ide_cmd_ioctl() to ide_taskfile_ioctl() Tejun Heo

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=4206F679.8060309@gmail.com \
    --to=htejun@gmail.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@home-tj.org \
    /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.