From: Tejun Heo <tj@kernel.org>
To: Mark Knecht <markknecht@gmail.com>
Cc: Linux Kernel List <linux-kernel@vger.kernel.org>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>
Subject: Re: Drives missing at boot
Date: Mon, 19 Jul 2010 23:01:54 +0200 [thread overview]
Message-ID: <4C44BD42.3030904@kernel.org> (raw)
In-Reply-To: <AANLkTilDbrA6lLPSOAtA8_4mLNkUZibHweTliqU5jd03@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 456 bytes --]
Hello,
On 07/19/2010 09:31 PM, Mark Knecht wrote:
> With about 10-12 day of testing, 1-2 boots/day, I've not had a
> single boot failure since adding the patch. Only twice has it said
> tries=2. Every other time it's tries=1. The machine seems to work fine
> either way.
Hmmm... can you please test the attached patch instead? It seems
likely that the root cause is not flakiness of SIDPR but incorrect
locking in libata EH code.
Thanks.
--
tejun
[-- Attachment #2: ata_piix-sidpr-lock.patch --]
[-- Type: text/x-patch, Size: 1609 bytes --]
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 7409f98..3971bc0 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -158,6 +158,7 @@ struct piix_map_db {
struct piix_host_priv {
const int *map;
u32 saved_iocfg;
+ spinlock_t sidpr_lock; /* FIXME: remove once locking in EH is fixed */
void __iomem *sidpr;
};
@@ -951,12 +952,15 @@ static int piix_sidpr_scr_read(struct ata_link *link,
unsigned int reg, u32 *val)
{
struct piix_host_priv *hpriv = link->ap->host->private_data;
+ unsigned long flags;
if (reg >= ARRAY_SIZE(piix_sidx_map))
return -EINVAL;
+ spin_lock_irqsave(&hpriv->sidpr_lock, flags);
piix_sidpr_sel(link, reg);
*val = ioread32(hpriv->sidpr + PIIX_SIDPR_DATA);
+ spin_unlock_irqrestore(&hpriv->sidpr_lock, flags);
return 0;
}
@@ -964,12 +968,15 @@ static int piix_sidpr_scr_write(struct ata_link *link,
unsigned int reg, u32 val)
{
struct piix_host_priv *hpriv = link->ap->host->private_data;
+ unsigned long flags;
if (reg >= ARRAY_SIZE(piix_sidx_map))
return -EINVAL;
+ spin_lock_irqsave(&hpriv->sidpr_lock, flags);
piix_sidpr_sel(link, reg);
iowrite32(val, hpriv->sidpr + PIIX_SIDPR_DATA);
+ spin_unlock_irqrestore(&hpriv->sidpr_lock, flags);
return 0;
}
@@ -1566,6 +1573,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
if (!hpriv)
return -ENOMEM;
+ spin_lock_init(&hpriv->sidpr_lock);
/* Save IOCFG, this will be used for cable detection, quirk
* detection and restoration on detach. This is necessary
next prev parent reply other threads:[~2010-07-19 21:01 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-02 17:56 Drives missing at boot Mark Knecht
2010-07-03 15:20 ` Mark Knecht
2010-07-03 16:01 ` Tejun Heo
2010-07-03 16:06 ` Mark Knecht
2010-07-03 16:13 ` Tejun Heo
2010-07-03 16:42 ` Mark Knecht
2010-07-05 6:30 ` Tejun Heo
2010-07-05 16:56 ` Mark Knecht
2010-07-06 6:33 ` Tejun Heo
2010-07-06 18:13 ` Mark Knecht
2010-07-07 5:50 ` Tejun Heo
2010-07-07 15:34 ` Mark Knecht
2010-07-07 15:48 ` Tejun Heo
2010-07-07 16:15 ` Mark Knecht
2010-07-07 16:19 ` Tejun Heo
2010-07-07 16:27 ` Mark Knecht
2010-07-07 17:06 ` Mark Knecht
2010-07-07 17:26 ` Tejun Heo
2010-07-07 17:32 ` Mark Knecht
2010-07-19 19:31 ` Mark Knecht
2010-07-19 21:01 ` Tejun Heo [this message]
2010-07-20 3:14 ` Paul Check
2010-07-20 14:14 ` Tejun Heo
2010-07-20 14:53 ` Mark Knecht
2010-07-20 16:16 ` Mark Knecht
2010-07-21 20:54 ` Mark Knecht
2010-07-21 21:22 ` Paul Check
2010-07-22 12:39 ` Tejun Heo
2010-08-02 22:07 ` Mark Knecht
2010-08-03 18:41 ` Randy Dunlap
2010-08-03 18:47 ` Mark Knecht
2010-08-03 18:55 ` Randy Dunlap
2010-08-04 16:16 ` Mark Knecht
2010-08-03 18:49 ` Jim Paris
2010-08-03 18:53 ` Mark Knecht
2010-07-20 20:52 ` Mark Knecht
2010-07-20 21:19 ` Paul Check
2010-07-20 21:26 ` Mark Knecht
2010-07-20 23:05 ` Paul Check
2010-07-03 18:56 ` Stan Hoeppner
2010-07-03 19:21 ` Mark Knecht
2010-07-03 19:42 ` Stan Hoeppner
2010-07-03 19:57 ` Mark Knecht
2010-07-03 22:31 ` Mark Knecht
2010-07-04 1:25 ` Thomas Fjellstrom
2010-07-05 6:19 ` Tejun Heo
2010-07-05 16:48 ` Mark Knecht
2010-07-05 23:59 ` Robert Hancock
2010-07-06 4:16 ` Mark Knecht
2010-07-06 6:13 ` Stan Hoeppner
2010-07-06 11:26 ` Sander
2010-07-06 6:32 ` Tejun Heo
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=4C44BD42.3030904@kernel.org \
--to=tj@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markknecht@gmail.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