* [PATCH #upstream] libata: don't set IORDY for reset
@ 2009-06-11 2:04 Tejun Heo
2009-06-11 9:15 ` Alan Cox
2009-06-23 5:57 ` Jeff Garzik
0 siblings, 2 replies; 3+ messages in thread
From: Tejun Heo @ 2009-06-11 2:04 UTC (permalink / raw)
To: Jeff Garzik, IDE/ATA development list, gnoutchd,
constantine.gavrilov, Alan Cox
Before issuing reset, libata configures xfermode to PIO0 which makes
some drivers turn on IORDY which may cause the controller to lock up
if the port is not occupied. IORDY isn't necessary at this point
anyway. Make ata_pio_need_iordy() return zero if it's being called
for reset.
This fixes bko#11703. Reported and tracked down by Daniel Gnoutcheff
and Constantine Gavrilov.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Daniel Gnoutcheff <gnoutchd@union.edu>
Cc: Constantine Gavrilov <constantine.gavrilov@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
---
drivers/ata/libata-core.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ca4d208..41d5593 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1993,11 +1993,17 @@ unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd)
* Check if the current speed of the device requires IORDY. Used
* by various controllers for chip configuration.
*/
-
unsigned int ata_pio_need_iordy(const struct ata_device *adev)
{
- /* Controller doesn't support IORDY. Probably a pointless check
- as the caller should know this */
+ /* Don't set IORDY if we're preparing for reset. IORDY may
+ * lead to controller lock up on certain controllers if the
+ * port is not occupied. See bko#11703 for details.
+ */
+ if (adev->link->ap->pflags & ATA_PFLAG_RESETTING)
+ return 0;
+ /* Controller doesn't support IORDY. Probably a pointless
+ * check as the caller should know this.
+ */
if (adev->link->ap->flags & ATA_FLAG_NO_IORDY)
return 0;
/* CF spec. r4.1 Table 22 says no iordy on PIO5 and PIO6. */
@@ -2020,7 +2026,6 @@ unsigned int ata_pio_need_iordy(const struct ata_device *adev)
* Compute the highest mode possible if we are not using iordy. Return
* -1 if no iordy mode is available.
*/
-
static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
{
/* If we have no drive specific rule, then PIO 2 is non IORDY */
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH #upstream] libata: don't set IORDY for reset
2009-06-11 2:04 [PATCH #upstream] libata: don't set IORDY for reset Tejun Heo
@ 2009-06-11 9:15 ` Alan Cox
2009-06-23 5:57 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2009-06-11 9:15 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, IDE/ATA development list, gnoutchd,
constantine.gavrilov
On Thu, 11 Jun 2009 11:04:45 +0900
Tejun Heo <tj@kernel.org> wrote:
> Before issuing reset, libata configures xfermode to PIO0 which makes
> some drivers turn on IORDY which may cause the controller to lock up
> if the port is not occupied. IORDY isn't necessary at this point
> anyway. Make ata_pio_need_iordy() return zero if it's being called
> for reset.
Ewww
Acked-by: Alan Cox <alan.cox@linux.intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH #upstream] libata: don't set IORDY for reset
2009-06-11 2:04 [PATCH #upstream] libata: don't set IORDY for reset Tejun Heo
2009-06-11 9:15 ` Alan Cox
@ 2009-06-23 5:57 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2009-06-23 5:57 UTC (permalink / raw)
To: Tejun Heo
Cc: IDE/ATA development list, gnoutchd, constantine.gavrilov,
Alan Cox
Tejun Heo wrote:
> Before issuing reset, libata configures xfermode to PIO0 which makes
> some drivers turn on IORDY which may cause the controller to lock up
> if the port is not occupied. IORDY isn't necessary at this point
> anyway. Make ata_pio_need_iordy() return zero if it's being called
> for reset.
>
> This fixes bko#11703. Reported and tracked down by Daniel Gnoutcheff
> and Constantine Gavrilov.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reported-by: Daniel Gnoutcheff <gnoutchd@union.edu>
> Cc: Constantine Gavrilov <constantine.gavrilov@gmail.com>
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> ---
> drivers/ata/libata-core.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
applied
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-23 5:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-11 2:04 [PATCH #upstream] libata: don't set IORDY for reset Tejun Heo
2009-06-11 9:15 ` Alan Cox
2009-06-23 5:57 ` Jeff Garzik
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).