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: <CAD=FV=U9Jr0AKy1ovhQeUbc0O8SMK5k7XJomdRowGUMZ5X0Oxg@mail.gmail.com>
Date:   Tue, 13 Oct 2020 14:38:15 -0700
From:   Doug Anderson <dianders@...omium.org>
To:     Stephen Boyd <swboyd@...omium.org>
Cc:     Akash Asthana <akashast@...eaurora.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Wolfram Sang <wsa@...nel.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        linux-i2c@...r.kernel.org, Andy Gross <agross@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] soc: qcom: geni: Optimize select fifo/dma mode

Hi,

On Fri, Oct 9, 2020 at 5:32 PM Stephen Boyd <swboyd@...omium.org> wrote:
>
> Quoting Douglas Anderson (2020-10-08 15:52:35)
> > diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c
> > index 751a49f6534f..746854745b15 100644
> > --- a/drivers/soc/qcom/qcom-geni-se.c
> > +++ b/drivers/soc/qcom/qcom-geni-se.c
> > @@ -266,49 +266,53 @@ EXPORT_SYMBOL(geni_se_init);
> >  static void geni_se_select_fifo_mode(struct geni_se *se)
> >  {
> >         u32 proto = geni_se_read_proto(se);
> > -       u32 val;
> > +       u32 val, val_old;
> >
> >         geni_se_irq_clear(se);
> >
> > -       val = readl_relaxed(se->base + SE_GENI_M_IRQ_EN);
> >         if (proto != GENI_SE_UART) {
> > +               val_old = val = readl_relaxed(se->base + SE_GENI_M_IRQ_EN);
> >                 val |= M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN;
> >                 val |= M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN;
> > -       }
> > -       writel_relaxed(val, se->base + SE_GENI_M_IRQ_EN);
> > +               if (val != val_old)
> > +                       writel_relaxed(val, se->base + SE_GENI_M_IRQ_EN);
> >
> > -       val = readl_relaxed(se->base + SE_GENI_S_IRQ_EN);
> > -       if (proto != GENI_SE_UART)
> > -               val |= S_CMD_DONE_EN;
> > -       writel_relaxed(val, se->base + SE_GENI_S_IRQ_EN);
> > +               val = readl_relaxed(se->base + SE_GENI_S_IRQ_EN);
>
> Can we use the val_old trick here too?
>
> > +               if (!(val & S_CMD_DONE_EN))
> > +                       writel_relaxed(val | S_CMD_DONE_EN,
>
> Because this val | S_CMD_DONE_EN thing is just hard to read :/

This is done in v2.  Thanks for your review!

-Doug

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ