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: <BY5PR11MB38788139CE6E4BA6A667CB84D2999@BY5PR11MB3878.namprd11.prod.outlook.com>
Date:   Tue, 2 Mar 2021 00:09:21 +0000
From:   "Yoo, Jae Hyun" <jae.hyun.yoo@...el.com>
To:     Joel Stanley <joel@....id.au>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        John Wang <wangzhiqiang.bj@...edance.com>
CC:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        Vernon Mauery <vernon.mauery@...ux.intel.com>,
        Sasha Levin <sashal@...nel.org>
Subject: RE: [PATCH 4.19 055/247] soc: aspeed: snoop: Add clock control logic

> -----Original Message-----
> From: Joel Stanley <joel@....id.au>
> Sent: Monday, March 1, 2021 2:44 PM
> To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>; John Wang
> <wangzhiqiang.bj@...edance.com>; Yoo, Jae Hyun
> <jae.hyun.yoo@...el.com>
> Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>;
> stable@...r.kernel.org; Vernon Mauery <vernon.mauery@...ux.intel.com>;
> Sasha Levin <sashal@...nel.org>
> Subject: Re: [PATCH 4.19 055/247] soc: aspeed: snoop: Add clock control logic
> 
> On Mon, 1 Mar 2021 at 16:37, Greg Kroah-Hartman
> <gregkh@...uxfoundation.org> wrote:
> >
> > From: Jae Hyun Yoo <jae.hyun.yoo@...el.com>
> >
> > [ Upstream commit 3f94cf15583be554df7aaa651b8ff8e1b68fbe51 ]
> >
> > If LPC SNOOP driver is registered ahead of lpc-ctrl module, LPC SNOOP
> > block will be enabled without heart beating of LCLK until lpc-ctrl
> > enables the LCLK. This issue causes improper handling on host
> > interrupts when the host sends interrupt in that time frame.
> > Then kernel eventually forcibly disables the interrupt with dumping
> > stack and printing a 'nobody cared this irq' message out.
> >
> > To prevent this issue, all LPC sub-nodes should enable LCLK
> > individually so this patch adds clock control logic into the LPC SNOOP
> > driver.
> 
> Jae, John; with this backported do we need to also provide a corresponding
> device tree change for the stable tree, otherwise this driver will no longer
> probe?

Right. The second patch
https://lore.kernel.org/linux-arm-kernel/20201208091748.1920-2-wangzhiqiang.bj@bytedance.com/
John submitted should be applied to stable tree too to make this module be probed
correctly.

> >
> > Fixes: 3772e5da4454 ("drivers/misc: Aspeed LPC snoop output using misc
> > chardev")
> > Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@...el.com>
> > Signed-off-by: Vernon Mauery <vernon.mauery@...ux.intel.com>
> > Signed-off-by: John Wang <wangzhiqiang.bj@...edance.com>
> > Reviewed-by: Joel Stanley <joel@....id.au>
> > Link:
> > https://lore.kernel.org/r/20201208091748.1920-1-wangzhiqiang.bj@byteda
> > nce.com
> > Signed-off-by: Joel Stanley <joel@....id.au>
> > Signed-off-by: Sasha Levin <sashal@...nel.org>
> > ---
> >  drivers/misc/aspeed-lpc-snoop.c | 30 +++++++++++++++++++++++++++-
> --
> >  1 file changed, 27 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/misc/aspeed-lpc-snoop.c
> > b/drivers/misc/aspeed-lpc-snoop.c index c10be21a1663d..b4a776bf44bc5
> > 100644
> > --- a/drivers/misc/aspeed-lpc-snoop.c
> > +++ b/drivers/misc/aspeed-lpc-snoop.c
> > @@ -15,6 +15,7 @@
> >   */
> >
> >  #include <linux/bitops.h>
> > +#include <linux/clk.h>
> >  #include <linux/interrupt.h>
> >  #include <linux/fs.h>
> >  #include <linux/kfifo.h>
> > @@ -71,6 +72,7 @@ struct aspeed_lpc_snoop_channel {  struct
> > aspeed_lpc_snoop {
> >         struct regmap           *regmap;
> >         int                     irq;
> > +       struct clk              *clk;
> >         struct aspeed_lpc_snoop_channel chan[NUM_SNOOP_CHANNELS];  };
> >
> > @@ -286,22 +288,42 @@ static int aspeed_lpc_snoop_probe(struct
> platform_device *pdev)
> >                 return -ENODEV;
> >         }
> >
> > +       lpc_snoop->clk = devm_clk_get(dev, NULL);
> > +       if (IS_ERR(lpc_snoop->clk)) {
> > +               rc = PTR_ERR(lpc_snoop->clk);
> > +               if (rc != -EPROBE_DEFER)
> > +                       dev_err(dev, "couldn't get clock\n");
> > +               return rc;
> > +       }
> > +       rc = clk_prepare_enable(lpc_snoop->clk);
> > +       if (rc) {
> > +               dev_err(dev, "couldn't enable clock\n");
> > +               return rc;
> > +       }
> > +
> >         rc = aspeed_lpc_snoop_config_irq(lpc_snoop, pdev);
> >         if (rc)
> > -               return rc;
> > +               goto err;
> >
> >         rc = aspeed_lpc_enable_snoop(lpc_snoop, dev, 0, port);
> >         if (rc)
> > -               return rc;
> > +               goto err;
> >
> >         /* Configuration of 2nd snoop channel port is optional */
> >         if (of_property_read_u32_index(dev->of_node, "snoop-ports",
> >                                        1, &port) == 0) {
> >                 rc = aspeed_lpc_enable_snoop(lpc_snoop, dev, 1, port);
> > -               if (rc)
> > +               if (rc) {
> >                         aspeed_lpc_disable_snoop(lpc_snoop, 0);
> > +                       goto err;
> > +               }
> >         }
> >
> > +       return 0;
> > +
> > +err:
> > +       clk_disable_unprepare(lpc_snoop->clk);
> > +
> >         return rc;
> >  }
> >
> > @@ -313,6 +335,8 @@ static int aspeed_lpc_snoop_remove(struct
> platform_device *pdev)
> >         aspeed_lpc_disable_snoop(lpc_snoop, 0);
> >         aspeed_lpc_disable_snoop(lpc_snoop, 1);
> >
> > +       clk_disable_unprepare(lpc_snoop->clk);
> > +
> >         return 0;
> >  }
> >
> > --
> > 2.27.0
> >
> >
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ