From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org,
Mikhail Cherkashin <mcherkashin@ru.mvista.com>
Subject: Re: [PATCH 2/8] ide: add ide_set_irq() inline helper
Date: Fri, 11 Jul 2008 16:57:22 +0400 [thread overview]
Message-ID: <487758B2.8060909@ru.mvista.com> (raw)
In-Reply-To: <487727C6.7040008@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
>>>>>> @@ -688,8 +688,7 @@ int ide_driveid_update(ide_drive_t *driv
>>>>>> */
>>>>>>
>>>>>> SELECT_MASK(drive, 1);
>>>>>> - if (IDE_CONTROL_REG)
>>>>>> - hwif->OUTB(drive->ctl,IDE_CONTROL_REG);
>>>>>> + ide_set_irq(drive, 1);
>>>>> If we're going to execute the command using polling, isn't it
>>>>> logical to *disable* drive's interrupt instead of enabling it which
>>>>> this code is currently doing? This looks like it might work only
>>>>> for the drivers having the maskproc() method (of which hpt366.c is
>>>>> the only one that I've ever dealt with).
>>>> Yes, this needs fixing.
>>> But should we honor drive->quirk_list here? What its different
>>> values mean? I'm seeing either 1 or 2 is used to decide whether to
>>> set nIEN or not...
>> I did some research on ->quirk_list in the past but I couldn't exactly
>> figure it out. I also wasn't able to trace this code to its author
>> (not that I tried very hard)...
>> Anyway my current findings/theories are the following:
>> - we should make sure that all SELECT_MASK() users also call ide_set_irq()
>> (then sgiioc4's ->maskproc can be removed since it is a copy of ->set_irq)
> I've kind of made sure about that already,
After another look, I've indeed correctly described this as "kind of" --
since ide_set_irq() is called only before issuing a command, while
SELECT_MASK() is called both before (but it seems to be always skipped due to
IDE_TFLAG_NO_SELECT_MASK being set for the commands executed in a normal way,
i.e. using interrupts) and after that (the latter is done if we are using the
polling mode). So, those maskproc() methods in hpt366 and sgiioc4 in fact
inadvertently clear nIEN after the polled command execution -- not that it's
wrong but why the hell? And those maskproc() methods duplicate nIEN setup
before the command execution -- except in ide_config_drive_speed() where
there's an obvious error...
> hence I've already created a patch doing that...
As I have no idea why sgiioc4 needs to manipulate nIEN, I guess I'll just
CC the SGI people on that patch...
>> Thanks,
>> Bart
MBR, Sergei
next prev parent reply other threads:[~2008-07-11 12:57 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 [this message]
2008-07-12 10:30 ` Bartlomiej Zolnierkiewicz
2008-07-10 12:11 ` Dubious IRQ masking in ide_config_drive_speed() Sergei Shtylyov
2008-07-11 19:39 ` 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=487758B2.8060909@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 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).