lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ce800827-d867-87a7-47fd-a65e92bd26db@intel.com>
Date:   Fri, 18 Oct 2019 10:30:43 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Faiz Abbas <faiz_abbas@...com>, linux-kernel@...r.kernel.org,
        linux-mmc@...r.kernel.org
Cc:     ulf.hansson@...aro.org, asutoshd@...eaurora.org,
        riteshh@...eaurora.org, venkatg@...eaurora.org
Subject: Re: [RFC] mmc: cqhci: commit descriptors before setting the doorbell

On 18/10/19 10:22 AM, Faiz Abbas wrote:
> Adrian,
> 
> On 16/10/19 5:46 PM, Faiz Abbas wrote:
>> Adrian,
>>
>> On 15/10/19 7:15 PM, Adrian Hunter wrote:
>>> On 15/10/19 10:55 AM, Faiz Abbas wrote:
>>>> Hi,
>>>>
>>>> On 15/10/19 12:08 AM, Faiz Abbas wrote:
>>>>> Add a write memory barrier to make sure that descriptors are actually
>>>>> written to memory before ringing the doorbell.
>>>>>
>>>>> Signed-off-by: Faiz Abbas <faiz_abbas@...com>
>>>>> ---
>>>>>
>>>>> This patch fixes a very infrequent ADMA error (1 out of 100 times) that
>>>>> I have been seeing after enabling command queuing for J721e.
>>>>> Also looking at memory-barriers.txt and this commit[1],
>>>>> it looks like we should be doing this before any descriptor write
>>>>> followed by a doorbell ring operation. It'll be nice if someone with more
>>>>> expertise in memory barriers can comment.
>>>>>
>>>>> [1] ad1a1b9cd67a ("scsi: ufs: commit descriptors before setting the
>>>>>     doorbell")
>>>>
>>>> So I see that cqhci_readl/writel() use readl/writel_relaxed() which
>>>> seems to be causing this issue. Should I just fix this by converting
>>>> those to readl/writel with memory barriers instead?
>>>
>>> Perhaps we could do both changes i.e. add wmb() and convert to non-relaxed
>>> readl/writel
>>>
>>
>> readl is implemented as  readl_relaxed(); __rmb();
>> and
>> writel is implemented as wmb(); writel_relaxed();
>>
>> I think another wmb() before writel will be redundant.
>>
>> Maybe this patch is good enough in itself.
>>
> 
> Do you agree?

Sure.

Acked-by: Adrian Hunter <adrian.hunter@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ