linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Holger Macht <hmacht@suse.de>
To: Tejun Heo <tj@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org, Jeff Garzik <jeff@garzik.org>,
	linux-ide@vger.kernel.org
Subject: Re: [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller
Date: Tue, 1 Dec 2009 13:44:38 +0100	[thread overview]
Message-ID: <200912011344.38656.hmacht@suse.de> (raw)
In-Reply-To: <4B14CD22.4020806@kernel.org>

On Tuesday 01 December 2009 09:00:34 Tejun Heo wrote:
> (cc'ing Holger Macht, please read the comment below pata_macio_mb_event())
> Hello,
> 
> On 12/01/2009 04:08 PM, Benjamin Herrenschmidt wrote:
> > This is a libata driver for the "macio" IDE controller used on most Apple
> > PowerMac and PowerBooks. It's a libata equivalent of drivers/ide/ppc/pmac.c
[...]
> > +#ifdef CONFIG_PMAC_MEDIABAY
> > +static void pata_macio_mb_event(struct macio_dev* mdev, int mb_state)
> > +{
> > +	struct ata_host *host = macio_get_drvdata(mdev);
> > +	struct ata_port *ap;
> > +	struct ata_eh_info *ehi;
> > +	struct ata_device *dev;
> > +	unsigned long flags;
> > +
> > +	if (!host)
> > +		return;
> > +	ap = host->ports[0];
> > +	spin_lock_irqsave(ap->lock, flags);
> > +	ehi = &ap->link.eh_info;
> > +	if (mb_state == MB_CD) {
> > +		ata_ehi_push_desc(ehi, "mediabay plug");
> > +		ata_ehi_hotplugged(ehi);
> > +		ata_port_freeze(ap);
> > +	} else {
> > +		ata_ehi_push_desc(ehi, "mediabay unplug");
> > +		ata_for_each_dev(dev, &ap->link, ALL)
> > +			dev->flags |= ATA_DFLAG_DETACH;
> > +		ata_port_schedule_eh(ap);
> 
> I think you'll need an ata_port_freeze() or abort() here because at
> this point the drive is already gone and all in-flight commands need
> to be failed right away.  Holger, do you remember why
> ata_acpi_detach_device() is using ata_port_schedule_eh() instead?  Was
> it because ata_port_freeze() might end up poking registers after
> hotunplug happened?  ISTR reports where accessing any register there
> causing the whole system to lock up but then why can't it use
> ata_port_abort() instead?

I do not remember any specific reason for using ata_port_schedule_eh(). I
guess it's just there because the previous implementation used
it. ata_port_freeze()/abort() might as well work properly. However, I
would hesitate to change the existing code, because verifying that
everything works contains quite some effort. There are so many different
use cases this code can be accessed with and it has to be verified with
all kind of different hardware to make sure we get no hard
freezes. Testing that freeze()/abort() in this new driver would be worth a
try, though. Next time I have setup my test environment again I can verify
that it also works in the general libata-acpi code.

Regards,
 Holger

  reply	other threads:[~2009-12-01 12:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01  7:08 [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller Benjamin Herrenschmidt
2009-12-01  8:00 ` Tejun Heo
2009-12-01 12:44   ` Holger Macht [this message]
2009-12-01 12:48     ` Tejun Heo
2009-12-01 23:19   ` Benjamin Herrenschmidt
2009-12-01 23:27     ` Tejun Heo
2009-12-01 23:35       ` Benjamin Herrenschmidt
2009-12-01 23:44         ` Tejun Heo
2009-12-02  0:00           ` Benjamin Herrenschmidt
2009-12-01 10:48 ` Mikael Pettersson
2009-12-01 10:53   ` Benjamin Herrenschmidt
2009-12-01 20:43 ` Andreas Schwab
2009-12-01 22:34   ` Benjamin Herrenschmidt
2009-12-01 22:58   ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2009-12-02  0:36 Benjamin Herrenschmidt
2009-12-02  1:07 ` Tejun Heo
2009-12-02  1:51   ` Benjamin Herrenschmidt
2009-12-02  1:55     ` Tejun Heo
2009-12-02 11:44 ` Andreas Schwab
2009-12-03  8:12 ` Jeff Garzik
2009-12-03 23:55   ` Benjamin Herrenschmidt
2009-12-03 15:10 ` Mikael Pettersson

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=200912011344.38656.hmacht@suse.de \
    --to=hmacht@suse.de \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=tj@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).