From: Mikael Pettersson <mikpe@it.uu.se>
To: Adko Branil <adkobranil@yahoo.com>
Cc: Mikael Pettersson <mikpe@it.uu.se>,
Borislav Petkov <bp@alien8.de>, Jeff Garzik <jgarzik@pobox.com>,
linux-ide <linux-ide@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Dan Merillat <dan.merillat@gmail.com>,
"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: HDD problem, software bug, bios bug, or hardware ?
Date: Sat, 8 Sep 2012 18:30:41 +0200 [thread overview]
Message-ID: <20555.29361.138287.766030@pilspetsen.it.uu.se> (raw)
In-Reply-To: <1347017576.44763.YahooMailNeo@web124703.mail.ne1.yahoo.com>
Adko Branil writes:
> After updating bios no more crashes happened, i tested it many times
> on heavy HDD IO loads, with many kernels (including CONFIG_PREEMPT
> kernels). But now if enable "Cool'n' Quiet" option in bios,
> CONFIG_PREEMPT_VOLUNTARY kernel with passed "nosmp" at boot time,
> crashes during boot process with kernel panic, while CONFIG_PREEMPT
> kernlel without "nosmp" works fine - but it is another story i think,
> should not be related with the crashes when it was old bios, and i
> think it is probably "nosmp" the reason. (i have never changed cpu
> frequency of this cpu at all) When "Cool'n' Quiet" is disabled, the
> system works perfectly adequately with all kind of kernels i tried.
> Except that this warning message in dmesg still appears (if it is
> problem at all). I put here this message for "nosmp" case as well,
> kernel is 3.5.2:
>
> [ 1.912494] =================================
> [ 1.912494] [ INFO: inconsistent lock state ]
> [ 1.912494] 3.5.2 #4 Not tainted
> [ 1.912494] ---------------------------------
> [ 1.912494] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
> [ 1.912494] swapper/0/1 [HC1[1]:SC1[1]:HE0:SE0] takes:
> [ 1.912494] (&(&host->lock)->rlock){?.+...}, at: [<ffffffff818f4e47>] ata_bmdma_interrupt+0x27/0x1d0
> [ 1.912494] {HARDIRQ-ON-W} state was registered at:
> [ 1.912494] [<ffffffff810998fb>] __lock_acquire+0x61b/0x1af0
> [ 1.912494] [<ffffffff8109b31a>] lock_acquire+0x8a/0x110
> [ 1.912494] [<ffffffff81b4d051>] _raw_spin_lock+0x31/0x40
> [ 1.912494] [<ffffffff8190b3c5>] pdc_sata_hardreset+0x85/0x100
Please try the patch below, which implements the fix I described a
week ago. It's for 3.6-rc4 but should work in any recent kernel.
Without this patch one of my test machines always throws a lockdep
warning involving pdc_sata_hardreset and pdc_interrupt during bootup,
but with the patch the warning is gone, as expected.
If it works for you I'll add your Tested-by: and submit it properly.
/Mikael
--- linux-3.6-rc4/drivers/ata/sata_promise.c.~1~ 2012-09-08 12:18:24.000000000 +0200
+++ linux-3.6-rc4/drivers/ata/sata_promise.c 2012-09-08 17:55:49.000000000 +0200
@@ -147,6 +147,10 @@ struct pdc_port_priv {
dma_addr_t pkt_dma;
};
+struct pdc_host_priv {
+ spinlock_t hard_reset_lock;
+};
+
static int pdc_sata_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
@@ -801,9 +805,10 @@ static void pdc_hard_reset_port(struct a
void __iomem *host_mmio = ap->host->iomap[PDC_MMIO_BAR];
void __iomem *pcictl_b1_mmio = host_mmio + PDC_PCI_CTL + 1;
unsigned int ata_no = pdc_ata_port_to_ata_no(ap);
+ struct pdc_host_priv *hpriv = ap->host->private_data;
u8 tmp;
- spin_lock(&ap->host->lock);
+ spin_lock(&hpriv->hard_reset_lock);
tmp = readb(pcictl_b1_mmio);
tmp &= ~(0x10 << ata_no);
@@ -814,7 +819,7 @@ static void pdc_hard_reset_port(struct a
writeb(tmp, pcictl_b1_mmio);
readb(pcictl_b1_mmio); /* flush */
- spin_unlock(&ap->host->lock);
+ spin_unlock(&hpriv->hard_reset_lock);
}
static int pdc_sata_hardreset(struct ata_link *link, unsigned int *class,
@@ -1182,6 +1187,7 @@ static int pdc_ata_init_one(struct pci_d
const struct ata_port_info *pi = &pdc_port_info[ent->driver_data];
const struct ata_port_info *ppi[PDC_MAX_PORTS];
struct ata_host *host;
+ struct pdc_host_priv *hpriv;
void __iomem *host_mmio;
int n_ports, i, rc;
int is_sataii_tx4;
@@ -1218,6 +1224,11 @@ static int pdc_ata_init_one(struct pci_d
dev_err(&pdev->dev, "failed to allocate host\n");
return -ENOMEM;
}
+ hpriv = devm_kzalloc(&pdev->dev, sizeof *hpriv, GFP_KERNEL);
+ if (!hpriv)
+ return -ENOMEM;
+ spin_lock_init(&hpriv->hard_reset_lock);
+ host->private_data = hpriv;
host->iomap = pcim_iomap_table(pdev);
is_sataii_tx4 = pdc_is_sataii_tx4(pi->flags);
next prev parent reply other threads:[~2012-09-08 16:32 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-25 13:36 HDD problem, software bug, bios bug, or hardware ? Adko Branil
2012-08-25 17:46 ` Adko Branil
2012-08-26 13:01 ` Borislav Petkov
2012-08-27 17:01 ` Adko Branil
2012-08-27 17:21 ` Felix Miata
2012-08-27 21:59 ` Borislav Petkov
2012-08-29 17:02 ` Adko Branil
2012-08-29 17:31 ` Adko Branil
2012-08-30 10:12 ` Borislav Petkov
[not found] ` <1346259574.81504.YahooMailNeo@web124706.mail.ne1.yahoo.com>
2012-08-30 9:58 ` Borislav Petkov
2012-08-30 10:11 ` Borislav Petkov
2012-08-30 11:10 ` Adko Branil
2012-09-02 20:04 ` Mikael Pettersson
2012-09-03 21:46 ` Adko Branil
2012-09-07 11:32 ` Adko Branil
2012-09-08 16:30 ` Mikael Pettersson [this message]
2012-09-08 17:22 ` Adko Branil
2012-09-11 13:38 ` Adko Branil
2012-09-10 9:15 ` Borislav Petkov
2012-09-10 9:17 ` Borislav Petkov
-- strict thread matches above, loose matches on Subject: below --
2012-08-25 1:31 Adko Branil
2012-08-25 11:33 ` Borislav Petkov
2012-08-27 7:50 ` Rafael J. Wysocki
2012-09-01 12:45 ` Dan Merillat
2012-09-02 7:24 ` Borislav Petkov
2012-09-03 0:38 ` Dan Merillat
2012-09-10 20:51 ` Borislav Petkov
2012-09-10 21:29 ` Dan Merillat
2012-09-10 21:59 ` Borislav Petkov
2012-09-15 1:34 ` Dan Merillat
2012-09-15 10:34 ` Borislav Petkov
2012-08-25 0:54 Adko Branil
2012-08-25 2:58 ` Felix Miata
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=20555.29361.138287.766030@pilspetsen.it.uu.se \
--to=mikpe@it.uu.se \
--cc=adkobranil@yahoo.com \
--cc=bp@alien8.de \
--cc=dan.merillat@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/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