From: Tomas Henzl <thenzl@redhat.com>
To: Mike Miller <mike.miller@hp.com>
Cc: Valdis.Kletnieks@vt.edu, scameron@beardog.cce.hp.com,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
LKML-scsi <linux-scsi@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH 01/16] hpsa: do readl after writel in main i/o path to ensure commands don't get lost.
Date: Mon, 23 May 2011 13:37:33 +0200 [thread overview]
Message-ID: <4DDA46FD.904@redhat.com> (raw)
In-Reply-To: <20110505183515.GA14193@beardog.cce.hp.com>
On 05/05/2011 08:35 PM, Mike Miller wrote:
> On Wed, May 04, 2011 at 01:54:22PM -0400, Valdis.Kletnieks@vt.edu wrote:
>
>> On Wed, 04 May 2011 11:37:35 MDT, Matthew Wilcox said:
>>
>>>> This probably needs a comment like
>>>> /* don't care - dummy read just to force write posting to chipset */
>>>> or similar. I'm assuming it's just functioning as a barrier-type flush of some sort?
>>>>
>>> It's a PCI write flush. It's not clear to me why it's needed here,
>>> though. The write will eventually get to the device; why we need to
>>> make the CPU wait around for it to actually get there doesn't make sense.
>>>
>> Exactly why I think it needs a one-liner comment. :)
>>
>>
> So we're not exactly sure why it's needed either. We've had reports of
> commands getting "lost" or "stuck" under some workloads. The extra readl
> works around the issue but certainly may have negative side effects.
>
> I'm not sure I understand how writel works.
>
> From linux-2.6/arch/x86/include/asm/io.h:
>
> #define build_mmio_write(name, size, type, reg, barrier) \
> static inline void name(type val, volatile void __iomem *addr) \
> { asm volatile("mov" size " %0,%1": :reg (val), \
> "m" (*(volatile type __force *)addr) barrier); }
>
> This implies (at least to me) that a barrier is part of writel. I don't know
> why a write operation needs a barrier but thats essentially what we've done
> by adding the extra readl. Can someone confirm or deny that a barrier is
> actually built into writel? Or used by writel? If so, does this indicate
> that barrier is broken?
>
> At this point we (the software guys) are pretty much at a loss as to how to
> continue debugging. We don't know what to trigger on for the PCIe analyzer.
> If we track outstanding commands then trigger on one that doesn't complete in
> some amount of time the problem could conceivably be far in the past and
> difficult to correlate to the data in the trace.
>
I'd look at the firmware part, you could check what happens for example when
the firmware gets send a command it doesn't understand.
You could also change the communication with the fw by adding a count field, which can
be then checked for the !(next_value == previous_value + 1) and raise an event.
tomas
> If anyone has any thoughts, suggestions, or flames they would be greatly
> appreciated.
>
> -- mikem
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2011-05-23 11:37 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-03 19:58 [PATCH 00/16] hpsa: May 3, 2011 updates Stephen M. Cameron
2011-05-03 19:58 ` [PATCH 01/16] hpsa: do readl after writel in main i/o path to ensure commands don't get lost Stephen M. Cameron
2011-05-04 11:15 ` Tomas Henzl
2011-05-04 12:52 ` scameron
2011-05-04 13:34 ` Tomas Henzl
2011-05-04 17:28 ` Valdis.Kletnieks
2011-05-04 17:37 ` Matthew Wilcox
2011-05-04 17:54 ` Valdis.Kletnieks
2011-05-05 18:35 ` Mike Miller
2011-05-23 11:37 ` Tomas Henzl [this message]
2011-05-25 15:20 ` Miller, Mike (OS Dev)
2011-05-26 12:13 ` Tomas Henzl
2011-05-26 14:53 ` Miller, Mike (OS Dev)
2011-05-03 19:58 ` [PATCH 02/16] hpsa: add readl after writel in interrupt mask setting code Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 03/16] hpsa: remove unused parameter from hpsa_complete_scsi_command() Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 04/16] hpsa: delete old unused padding garbage Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 05/16] hpsa: do a better job of detecting controller reset failure Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 06/16] hpsa: wait longer for no-op to complete after resetting controller Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 07/16] hpsa: factor out cmd pool allocation functions Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 08/16] hpsa: factor out irq request code Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 09/16] hpsa: increase time to wait for board reset Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 10/16] hpsa: clarify messages around reset behavior Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 11/16] hpsa: remove atrophied hpsa_scsi_setup function Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 12/16] hpsa: use new doorbell-bit-5 reset method Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 13/16] hpsa: do soft reset if hard reset is broken Stephen M. Cameron
2011-05-03 19:59 ` [PATCH 14/16] hpsa: remove superfluous sleeps around reset code Stephen M. Cameron
2011-05-03 20:00 ` [PATCH 15/16] hpsa: do not attempt PCI power management reset method if we know it won't work Stephen M. Cameron
2011-05-03 20:00 ` [PATCH 16/16] hpsa: add P2000 to list of shared SAS devices Stephen M. Cameron
2011-05-17 10:12 ` James Bottomley
2011-05-17 13:26 ` scameron
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=4DDA46FD.904@redhat.com \
--to=thenzl@redhat.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mike.miller@hp.com \
--cc=scameron@beardog.cce.hp.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;
as well as URLs for NNTP newsgroup(s).