From: Lukasz Kosewski <lkosewsk@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH 3/3] Add disk hotswap support to libata RESEND #5
Date: Wed, 28 Sep 2005 15:58:50 -0400 [thread overview]
Message-ID: <355e5e5e0509281258536e4be4@mail.gmail.com> (raw)
In-Reply-To: <433AEB4F.7010502@pobox.com>
On 9/28/05, Jeff Garzik <jgarzik@pobox.com> wrote:
> > +/* Mask hotplug interrupts for one channel (ap) */
> > +static inline void pdc_disable_channel_hotplug_interrupts(struct ata_port *ap)
<snip>
> > +/* Clear and unmask hotplug interrupts for one channel (ap) */
> > +static inline void pdc_enable_channel_hotplug_interrupts(struct ata_port *ap)
> Rather than two functions, I prefer one function that takes an 'enable'
> boolean argument, just like pci_intx()
>
> Also, the function names are way too long.
OK, I'll change that.
> > - sata_phy_reset(ap);
> > + if (ap->flags & ATA_FLAG_SATA_RESET) {
> > + pdc_disable_channel_hotplug_interrupts(ap);
> > + sata_phy_reset(ap);
> > + pdc_enable_channel_hotplug_interrupts(ap);
> > + } else
> > + sata_phy_reset(ap);
>
> I don't see the point of this. Might as well unconditionally disable
> hotplug interrupts.
Sure.
> > + if (plugdata) {
> > + writeb(plugdata, mmio_base + hotplug_offset);
> > + for (i = 0; i < host_set->n_ports; ++i) {
> > + ap = host_set->ports[i];
> > + if (!(ap->flags & ATA_FLAG_SATA))
> > + continue; //No PATA support here... yet
> > + // Check unplug flag
> > + if (plugdata & 0x1) {
> > + /* Do stuff related to unplugging a device */
> > + ata_hotplug_unplug(ap);
> > + handled = 1;
> > + } else if ((plugdata >> 4) & 0x1) { //Check plug flag
> > + /* Do stuff related to plugging in a device */
> > + ata_hotplug_plug(ap);
> > + handled = 1;
>
> What happens if both bits are set? Seems like that could happen, if a
> plug+unplug (cable blip?) occurs in rapid succession.
What IF both bits are set? This is why we have a debounce timer to
take care of the problem :P
The way this is set up, unplugging will win out (plugging will come
first, unplugging will come and destroy 'plug's timer, and then the
unplug action will be performed on timer expiry). Personally, I like
it this way, but I can reverse the order of these two to make plugging
the default action. Which do you prefer?
> The rest seems OK to me.
Excellent. I'll repost when the issues you point out have been addressed.
Luke
next prev parent reply other threads:[~2005-09-28 19:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-27 1:01 [PATCH 3/3] Add disk hotswap support to libata RESEND #5 Lukasz Kosewski
2005-09-28 19:13 ` Jeff Garzik
2005-09-28 19:58 ` Lukasz Kosewski [this message]
2005-09-28 20:09 ` Jeff Garzik
2005-09-28 20:21 ` Lukasz Kosewski
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=355e5e5e0509281258536e4be4@mail.gmail.com \
--to=lkosewsk@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.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 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).