From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Fuzhou Chen <fuzhouch@microsoft.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
KY Srinivasan <kys@microsoft.com>,
jgarzik@redhat.com, mjg@redhat.com
Subject: Re: linux-next: pata_acpi.ko crashes at ata_ap_acpi_handle()
Date: Fri, 24 Feb 2012 14:26:09 +0000 [thread overview]
Message-ID: <20120224142609.2c7e519d@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <6689D53B948ACF469C8E9C8CCD48EBE1114EFE01@SINEX14MBXC415.southpacific.corp.microsoft.com>
> We can see the code in ata_ap_acpi_handle()accesses ap->scsi_host filed without checking if itâs initialized, which causes NULL pointer panic. Meanwhile, ata_pci_sff_activate_host() calls ata_host_register(), which calls ata_scsi_add_hosts() to initialize scsi_host field. Both calls are after ata_host_start() in a must-visit code path. I believe ata_scsi_add_hosts() is the first place for initialization because it does not check if scsi_host field is NULL either. So it makes no sense to access ap->scsi_host in ata_ap_acpi_handle().
This appears to be caused by broken changes to the libata code from
Matthew Garrett and others who introduced a dependancy on scsi_host which
isn't safe to do because drivers can touch the ACPI earlier than the
scsi registration and in fact *NEED* to do so.
Jeff - can we get these patches dropped back out for the moment - they
cause a regression and boot crash in pata_acpi.
The stack from 75d22cd567cac6fe2af8acb33f6ebcd16876d250 needs to get
punted and the scsi_host indirection removed and fixed up for it to work
safely with existing libata drivers.
I don't see an obvious way to fix up the existing ordering dependancies,
especially on the pata_acpi side but if someone has bright ideas there
that would probably be the best choice. Right now these patches stop any
ACPI querying being done during the port setup. We need to do those
queries in order to know if the port can be driven by ACPI and what modes
we can make work.
Alan
next prev parent reply other threads:[~2012-02-24 14:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 5:21 linux-next: pata_acpi.ko crashes at ata_ap_acpi_handle() Fuzhou Chen
2012-02-24 14:26 ` Alan Cox [this message]
2012-02-24 17:01 ` Jeff Garzik
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=20120224142609.2c7e519d@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=fuzhouch@microsoft.com \
--cc=jgarzik@redhat.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.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