Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1665708

Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon Djtag driver

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon Djtag driver
Date Wed, 14 Jun 2017 13:00:02 +0200
Message-ID <tSebM-48n-29@gated-at.bofh.it> (permalink)
References <tJUtz-5zo-5@gated-at.bofh.it> <tQ8Dw-6E7-15@gated-at.bofh.it> <tQsVA-2Cx-15@gated-at.bofh.it> <tQteW-2JK-3@gated-at.bofh.it> <tQtRD-3bI-3@gated-at.bofh.it> <tSdz4-3TR-17@gated-at.bofh.it> <tSebM-48n-31@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 61
Organization linux.* mail to news gateway
X-Original-Cc dikshit.n@huawei.com, shyju.pv@huawei.com, anurupvasu@gmail.com, gabriele.paoloni@huawei.com, huangdaode@hisilicon.com, John Garry <john.garry@huawei.com>, linux-kernel@vger.kernel.org, xuwei5@hisilicon.com, linuxarm@huawei.com, Shaokun Zhang <zhangshaokun@hisilicon.com>, sanil.kumar@hisilicon.com, linux-arm-kernel@lists.infradead.org, shiju.jose@huawei.com, tanxiaojun@huawei.com, anurup.m@huawei.com
X-Original-Date Wed, 14 Jun 2017 11:50:58 +0100
X-Original-Message-ID <20170614105057.GA7236@leverpostej>
X-Original-References <1495457312-237127-1-git-send-email-zhangshaokun@hisilicon.com> <20170608163519.GA19643@leverpostej> <8666a0fa-126d-e4a3-ac4b-7962f5d79942@huawei.com> <20170609143050.GM13955@arm.com> <0fbf57f0-9ff7-4fd4-07c7-c5e86028a7d2@huawei.com> <20170614100658.GE16190@arm.com> <20170614104230.GC6085@leverpostej>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1665708

Show key headers only | View raw


On Wed, Jun 14, 2017 at 11:42:30AM +0100, Mark Rutland wrote:
> On Wed, Jun 14, 2017 at 11:06:58AM +0100, Will Deacon wrote:
> > Apologies, I misunderstood your algorithm (I thought step (a) was on one CPU
> > and step (b) was on another). Still, I don't understand the need for the
> > timeout. If you instead read back the flag immediately, wouldn't it still
> > work? e.g.
> >
> >
> > lock:
> >   Readl_relaxed flag
> >   if (locked)
> >     goto lock;
> >
> >   Writel_relaxed unique ID to flag
> >   Readl flag
> >   if (locked by somebody else)
> >     goto lock;
> >
> > <critical section>
> >
> > unlock:
> >   Writel unlocked value to flag
> >
> >
> > Given that we're dealing with iomem, I think it will work, but I could be
> > missing something obvious.
> 
> Don't we have the race below where both threads can enter the critical
> section?
> 
>         // flag f initial zero (unlocked)
> 
>         // t1, flag 1                   // t2, flag 2
>         readl(f); // reads 0            l = readl(f); // reads 0
> 
>         <thinks lock is free>           <thinks lock is free>
> 
>         writel(1, f);
>         readl(f); // reads 1
>         <thinks lock owned>
>                                         writel(2, f);
>                                         readl(f) // reads 2
>                                         <thinks lock owned>
> 
>         <crticial section>              <critical section>
> 
> Thanks,
> Mark.

> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose
> the contents to any other person, use it for any purpose, or store or
> copy the information in any medium. Thank you.

Please ignore the disclaimer on this mail; my client was mis-configured.

I will ensure I avoid sending bogus disclaimers in future.

Thanks,
Mark.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Mark Rutland <mark.rutland@arm.com> - 2017-06-08 18:40 +0200
  Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver John Garry <john.garry@huawei.com> - 2017-06-09 16:20 +0200
    Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Will Deacon <will.deacon@arm.com> - 2017-06-09 16:40 +0200
      Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver John Garry <john.garry@huawei.com> - 2017-06-09 17:20 +0200
        Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Will Deacon <will.deacon@arm.com> - 2017-06-14 12:20 +0200
          Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-06-14 12:50 +0200
            Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Will Deacon <will.deacon@arm.com> - 2017-06-14 13:10 +0200
          Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Mark Rutland <mark.rutland@arm.com> - 2017-06-14 13:00 +0200
          Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Will Deacon <will.deacon@arm.com> - 2017-06-14 13:10 +0200
            Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver John Garry <john.garry@huawei.com> - 2017-06-14 13:40 +0200
              Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Will Deacon <will.deacon@arm.com> - 2017-06-14 13:50 +0200
                Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver John Garry <john.garry@huawei.com> - 2017-06-14 14:00 +0200
    Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Mark Rutland <mark.rutland@arm.com> - 2017-06-09 17:50 +0200
      Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver John Garry <john.garry@huawei.com> - 2017-06-09 18:10 +0200
        Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Mark Rutland <mark.rutland@arm.com> - 2017-06-09 18:50 +0200
  Re: [PATCH v8 6/9] drivers: perf: hisi: Add support for Hisilicon  Djtag driver Zhangshaokun <zhangshaokun@hisilicon.com> - 2017-06-14 10:20 +0200

csiph-web