All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-ide@vger.kernel.org,
	Mikhail Cherkashin <mcherkashin@ru.mvista.com>
Subject: Dubious IRQ masking in ide_config_drive_speed()
Date: Thu, 10 Jul 2008 16:11:15 +0400	[thread overview]
Message-ID: <4875FC63.7040309@ru.mvista.com> (raw)
In-Reply-To: <48723A9B.6030309@ru.mvista.com>

Hello, I wrote:

>> Index: b/drivers/ide/ide-iops.c
>> ===================================================================
>> --- a/drivers/ide/ide-iops.c
>> +++ b/drivers/ide/ide-iops.c
[...]

>    What's interesting, ide_config_drive_speed() code looks sane in this 
> respect:

    ... except one thing:

>> @@ -769,13 +768,12 @@ int ide_config_drive_speed(ide_drive_t *
>>      SELECT_DRIVE(drive);
>>      SELECT_MASK(drive, 0);

    We've called disable_irq_nosync() before that, so it's not clear why we're 
calling the driver's maskproc() method with 0 -- which unmasks interrupt in 
the IDE chip.

>>      udelay(1);
>> -    if (IDE_CONTROL_REG)
>> -        hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG);
>> +    ide_set_irq(drive, 0);
>>      hwif->OUTB(speed, IDE_NSECTOR_REG);
>>      hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG);
>>      hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG);
>> -    if ((IDE_CONTROL_REG) && (drive->quirk_list == 2))
>> -        hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
>> +    if (drive->quirk_list == 2)
>> +        ide_set_irq(drive, 1);
>>      error = __ide_wait_stat(drive, drive->ready_stat,
>>                  BUSY_STAT|DRQ_STAT|ERR_STAT,

    Another SELECT_MASK(drive, 0) call follows which just doesn't make any 
sense since the interrupt has been already unmasked by the first call.

MBR, Sergei

  parent reply	other threads:[~2008-07-10 12:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29  0:04 [PATCH 2/8] ide: add ide_set_irq() inline helper Bartlomiej Zolnierkiewicz
2008-07-07 15:47 ` Sergei Shtylyov
2008-07-07 17:00   ` Sergei Shtylyov
2008-07-07 18:05     ` Bartlomiej Zolnierkiewicz
2008-07-08  9:13       ` Sergei Shtylyov
2008-07-07 18:00   ` Bartlomiej Zolnierkiewicz
2008-07-08  9:10     ` Sergei Shtylyov
2008-07-11 21:20       ` Bartlomiej Zolnierkiewicz
2008-07-11  9:28         ` Sergei Shtylyov
2008-07-11 12:57           ` Sergei Shtylyov
2008-07-12 10:30           ` Bartlomiej Zolnierkiewicz
2008-07-10 12:11   ` Sergei Shtylyov [this message]
2008-07-11 19:39     ` Dubious IRQ masking in ide_config_drive_speed() Bartlomiej Zolnierkiewicz
2008-07-10 21:21       ` Sergei Shtylyov
2008-07-11 21:44         ` Bartlomiej Zolnierkiewicz

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=4875FC63.7040309@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=mcherkashin@ru.mvista.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.