From gregkh at linuxfoundation.org Tue Sep 5 07:29:13 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Tue, 5 Sep 2017 09:29:13 +0200 Subject: [LTSI-dev] [GIT PULL LTSI-4.9] Third Round of Renesas SoCs and Drivers to v4.12 In-Reply-To: <20170831140447.GA24787@verge.net.au> References: <20170831140447.GA24787@verge.net.au> Message-ID: <20170905072913.GA17948@kroah.com> On Thu, Aug 31, 2017 at 04:04:47PM +0200, Simon Horman wrote: > Hi, > > This is a submission to LTSI-v4.9. > > This series is comprised of a limited backport to v4.9 of usb core, > ohci-platform, ehci-platform and cs2000. > > These were have been suggested after examination and testing of > LTSI-4.9 RC1. > > There are 5 patches. > > This is based on a merge of: > * Earlier work posted as > "[GIT PULL LTSI-4.9] Second Round Renesas SoCs and Drivers to v4.12" > and is tagged as tags/backport/v4.9.45/snapshot2-to-v4.12-flattened > * v4.9.46 Did I merge from that tree? I can't find it locally, so maybe I did... > It appears to apply cleanly to an ltsi-4.9 tree generated using > scripts/generate_git > > > The following changes since commit 06ce9c3fa43d22ed328b979562b16216053d031d: > > Merge tag 'v4.9.46' into backport/v4.9.46/snapshot-flattened (2017-08-31 12:31:10 +0200) > > are available in the git repository at: > > https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport.git tags/backport/v4.9.46/snapshot3-to-v4.12-flattened Hm, this is going to be messy, as you are sending me a pull request based on something that I don't really have. Can you just send the individual patches in email instead? There are only 5 here, it should be pretty simple to do so, that way I can pick them up properly. thanks, greg k-h From gregkh at linuxfoundation.org Tue Sep 5 07:30:17 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Tue, 5 Sep 2017 09:30:17 +0200 Subject: [LTSI-dev] [PATCH ltsi-kernel 1/2] generate_git: Fix check for existence of series file In-Reply-To: <1503483022-6452-1-git-send-email-geert+renesas@glider.be> References: <1503483022-6452-1-git-send-email-geert+renesas@glider.be> Message-ID: <20170905073017.GB17948@kroah.com> On Wed, Aug 23, 2017 at 12:10:21PM +0200, Geert Uytterhoeven wrote: > $SERIES always contains at least the string "/series", so the check for > a zero-length string never triggers. > > To fix this, check for the existence of the file instead. > > Signed-off-by: Geert Uytterhoeven > --- > scripts/generate_git | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks for both of these, now applied. greg k-h From gregkh at linuxfoundation.org Tue Sep 5 07:34:31 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Tue, 5 Sep 2017 09:34:31 +0200 Subject: [LTSI-dev] [GIT PULL LTSI-4.9] Second Round of Renesas SoCs and Drivers to v4.12 In-Reply-To: <20170829190853.GA4714@verge.net.au> References: <20170829190853.GA4714@verge.net.au> Message-ID: <20170905073431.GC17948@kroah.com> On Tue, Aug 29, 2017 at 09:08:53PM +0200, Simon Horman wrote: > Hi, > > This is a submission to LTSI-v4.9. > > This series is comprised of a backport v4.9 of the rcar-gen3-thermal driver > to its as of v4.12. This was unintentionally omitted from earlier work > submitted for inclusion in LTSI-4.9. > > There are 9 patches. > > This is based on a merge of: > * Earlier work posted as > "[GIT PULL LTSI-4.9] Renesas SoCs and Drivers to v4.12" > and is tagged as tags/backport/v4.9.36/snapshot-to-v4.12-flattened > * v4.9.45 > > It appears to apply cleanly to an ltsi-4.9 tree generated using > scripts/generate_git > > > The following changes since commit 89dcb9ecf2d34cba6cba23376651476b0273db5d: > > Merge tag 'v4.9.45' into backport/v4.9.45/snapshot-flattened (2017-08-29 20:34:36 +0200) > > are available in the git repository at: > > https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport.git tags/backport/v4.9.45/snapshot2-to-v4.12-flattened Hm, I tried to pull this, based on your previous patch, but I get a merge error: $ git branch -v linux-4.9.y efcfbfb1d8bf Linux 4.9.40 n1 e3eea6cb6b2f Merge tag 'socfpga_updates_for_v4.9-ltsi' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into n1 s1 410f9f76e434 Merge tag 'backport/v4.9.36/snapshot-to-v4.10-flattened' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport into s1 s2 456eeea5eefc Merge tag 'backport/v4.9.36/snapshot-to-v4.11-flattened' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport into s2 s3 a896e47351b4 Merge tag 'backport/v4.9.36/snapshot-to-v4.12-flattened' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport into s3 * s4 a896e47351b4 Merge tag 'backport/v4.9.36/snapshot-to-v4.12-flattened' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport into s3 $ git pull https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport.git tags/backport/v4.9.45/snapshot2-to-v4.12-flattened >From https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport * tag backport/v4.9.45/snapshot2-to-v4.12-flattened -> FETCH_HEAD Auto-merging drivers/pinctrl/sh-pfc/pfc-r8a7795.c CONFLICT (content): Merge conflict in drivers/pinctrl/sh-pfc/pfc-r8a7795.c Auto-merging arch/x86/platform/intel-mid/device_libs/platform_mrfld_spidev.c Automatic merge failed; fix conflicts and then commit the result. $ What am I doing wrong here? confused, greg k-h From horms at verge.net.au Tue Sep 5 07:48:22 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 09:48:22 +0200 Subject: [LTSI-dev] [GIT PULL LTSI-4.9] Second Round of Renesas SoCs and Drivers to v4.12 In-Reply-To: <20170905073431.GC17948@kroah.com> References: <20170829190853.GA4714@verge.net.au> <20170905073431.GC17948@kroah.com> Message-ID: <20170905074822.GA10586@verge.net.au> On Tue, Sep 05, 2017 at 09:34:31AM +0200, Greg KH wrote: > On Tue, Aug 29, 2017 at 09:08:53PM +0200, Simon Horman wrote: > > Hi, > > > > This is a submission to LTSI-v4.9. > > > > This series is comprised of a backport v4.9 of the rcar-gen3-thermal driver > > to its as of v4.12. This was unintentionally omitted from earlier work > > submitted for inclusion in LTSI-4.9. > > > > There are 9 patches. > > > > This is based on a merge of: > > * Earlier work posted as > > "[GIT PULL LTSI-4.9] Renesas SoCs and Drivers to v4.12" > > and is tagged as tags/backport/v4.9.36/snapshot-to-v4.12-flattened > > * v4.9.45 > > > > It appears to apply cleanly to an ltsi-4.9 tree generated using > > scripts/generate_git > > > > > > The following changes since commit 89dcb9ecf2d34cba6cba23376651476b0273db5d: > > > > Merge tag 'v4.9.45' into backport/v4.9.45/snapshot-flattened (2017-08-29 20:34:36 +0200) > > > > are available in the git repository at: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport.git tags/backport/v4.9.45/snapshot2-to-v4.12-flattened > > Hm, I tried to pull this, based on your previous patch, but I get a > merge error: > > $ git branch -v > linux-4.9.y efcfbfb1d8bf Linux 4.9.40 > n1 e3eea6cb6b2f Merge tag 'socfpga_updates_for_v4.9-ltsi' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into n1 > s1 410f9f76e434 Merge tag 'backport/v4.9.36/snapshot-to-v4.10-flattened' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport into s1 > s2 456eeea5eefc Merge tag 'backport/v4.9.36/snapshot-to-v4.11-flattened' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport into s2 > s3 a896e47351b4 Merge tag 'backport/v4.9.36/snapshot-to-v4.12-flattened' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport into s3 > * s4 a896e47351b4 Merge tag 'backport/v4.9.36/snapshot-to-v4.12-flattened' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport into s3 > $ git pull https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport.git tags/backport/v4.9.45/snapshot2-to-v4.12-flattened > >From https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport > * tag backport/v4.9.45/snapshot2-to-v4.12-flattened -> FETCH_HEAD > Auto-merging drivers/pinctrl/sh-pfc/pfc-r8a7795.c > CONFLICT (content): Merge conflict in drivers/pinctrl/sh-pfc/pfc-r8a7795.c > Auto-merging arch/x86/platform/intel-mid/device_libs/platform_mrfld_spidev.c > Automatic merge failed; fix conflicts and then commit the result. > $ > > What am I doing wrong here? > > confused, Sorry for the confusion. I will see about sending patches directly to the ML. From horms at verge.net.au Tue Sep 5 07:50:01 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 09:50:01 +0200 Subject: [LTSI-dev] [GIT PULL LTSI-4.9] Third Round of Renesas SoCs and Drivers to v4.12 In-Reply-To: <20170905072913.GA17948@kroah.com> References: <20170831140447.GA24787@verge.net.au> <20170905072913.GA17948@kroah.com> Message-ID: <20170905075001.GB10586@verge.net.au> On Tue, Sep 05, 2017 at 09:29:13AM +0200, Greg KH wrote: > On Thu, Aug 31, 2017 at 04:04:47PM +0200, Simon Horman wrote: > > Hi, > > > > This is a submission to LTSI-v4.9. > > > > This series is comprised of a limited backport to v4.9 of usb core, > > ohci-platform, ehci-platform and cs2000. > > > > These were have been suggested after examination and testing of > > LTSI-4.9 RC1. > > > > There are 5 patches. > > > > This is based on a merge of: > > * Earlier work posted as > > "[GIT PULL LTSI-4.9] Second Round Renesas SoCs and Drivers to v4.12" > > and is tagged as tags/backport/v4.9.45/snapshot2-to-v4.12-flattened > > * v4.9.46 > > Did I merge from that tree? I can't find it locally, so maybe I did... > > > It appears to apply cleanly to an ltsi-4.9 tree generated using > > scripts/generate_git > > > > > > The following changes since commit 06ce9c3fa43d22ed328b979562b16216053d031d: > > > > Merge tag 'v4.9.46' into backport/v4.9.46/snapshot-flattened (2017-08-31 12:31:10 +0200) > > > > are available in the git repository at: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-backport.git tags/backport/v4.9.46/snapshot3-to-v4.12-flattened > > Hm, this is going to be messy, as you are sending me a pull request > based on something that I don't really have. > > Can you just send the individual patches in email instead? There are > only 5 here, it should be pretty simple to do so, that way I can pick > them up properly. Sure, will do. From horms at verge.net.au Tue Sep 5 08:06:35 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:35 +0200 Subject: [LTSI-dev] [GIT PULL LTSI-4.9 v2 00/13] Second Round of Renesas SoCs and Drivers to v4.12 Message-ID: <1504598808-19810-1-git-send-email-horms@verge.net.au> Hi, This is a submission to LTSI-v4.9. * Backport v4.9 of the rcar-gen3-thermal driver to its as of v4.12. * Limited backport to v4.9 of: - usb core - ohci-platform - ehci-platform - cs2000 There are 13 patches. This patches appear to apply ltsi-4.9 tree generated using scripts/generate_git. Khiem Nguyen (1): clk: cs2000: add Suspend/Resume feature Niklas S?derlund (7): thermal: rcar_gen3_thermal: add delay in .thermal_init on r8a7796 thermal: rcar_gen3_thermal: remove unneeded mutex thermal: rcar_gen3_thermal: check that TSC exists before memory allocation thermal: rcar_gen3_thermal: record and check number of TSCs found thermal: rcar_gen3_thermal: enable hardware interrupts for trip points thermal: rcar_gen3_thermal: store device match data in private structure thermal: rcar_gen3_thermal: add suspend and resume support Wolfram Sang (2): thermal: rcar_gen3_thermal: Document the R-Car Gen3 thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver Yoshihiro Shimoda (3): usb: host: ehci-platform: fix usb 1.1 device is not connected in system resume usb: host: ehci-platform: set hcd->phy to avoid phy_get() in usb_add_hcd() usb: host: ohci-platform: set hcd->phy to avoid phy_get() in usb_add_hcd() .../bindings/thermal/rcar-gen3-thermal.txt | 56 +++ drivers/clk/clk-cs2000-cp.c | 22 + drivers/thermal/Kconfig | 9 + drivers/thermal/Makefile | 1 + drivers/thermal/rcar_gen3_thermal.c | 504 +++++++++++++++++++++ drivers/usb/host/ehci-platform.c | 10 + drivers/usb/host/ohci-platform.c | 3 + 7 files changed, 605 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt create mode 100644 drivers/thermal/rcar_gen3_thermal.c -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:44 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:44 +0200 Subject: [LTSI-dev] [PATCH 09/13] thermal: rcar_gen3_thermal: add suspend and resume support In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-10-git-send-email-horms@verge.net.au> From: Niklas S?derlund To restore operation it's easiest to reinitialise all TSCs. In order to do this the current trip window needs to be stored in the TSC structure so that it can be restored upon resume. Signed-off-by: Niklas S?derlund Reviewed-by: Wolfram Sang Signed-off-by: Eduardo Valentin (cherry picked from commit 75f78d6d9eb793d141affaa5a76f20ce1d6ae5c9) Signed-off-by: Simon Horman --- drivers/thermal/rcar_gen3_thermal.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index f259a995c66c..37fcefd06d9f 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -82,6 +82,8 @@ struct rcar_gen3_thermal_tsc { void __iomem *base; struct thermal_zone_device *zone; struct equation_coefs coef; + int low; + int high; }; struct rcar_gen3_thermal_priv { @@ -217,6 +219,9 @@ static int rcar_gen3_thermal_set_trips(void *devdata, int low, int high) rcar_gen3_thermal_write(tsc, REG_GEN3_IRQTEMP2, rcar_gen3_thermal_mcelsius_to_temp(tsc, high)); + tsc->low = low; + tsc->high = high; + return 0; } @@ -454,9 +459,39 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) return ret; } +static int __maybe_unused rcar_gen3_thermal_suspend(struct device *dev) +{ + struct rcar_gen3_thermal_priv *priv = dev_get_drvdata(dev); + + rcar_thermal_irq_set(priv, false); + + return 0; +} + +static int __maybe_unused rcar_gen3_thermal_resume(struct device *dev) +{ + struct rcar_gen3_thermal_priv *priv = dev_get_drvdata(dev); + unsigned int i; + + for (i = 0; i < priv->num_tscs; i++) { + struct rcar_gen3_thermal_tsc *tsc = priv->tscs[i]; + + priv->data->thermal_init(tsc); + rcar_gen3_thermal_set_trips(tsc, tsc->low, tsc->high); + } + + rcar_thermal_irq_set(priv, true); + + return 0; +} + +static SIMPLE_DEV_PM_OPS(rcar_gen3_thermal_pm_ops, rcar_gen3_thermal_suspend, + rcar_gen3_thermal_resume); + static struct platform_driver rcar_gen3_thermal_driver = { .driver = { .name = "rcar_gen3_thermal", + .pm = &rcar_gen3_thermal_pm_ops, .of_match_table = rcar_gen3_thermal_dt_ids, }, .probe = rcar_gen3_thermal_probe, -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:39 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:39 +0200 Subject: [LTSI-dev] [PATCH 04/13] thermal: rcar_gen3_thermal: remove unneeded mutex In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-5-git-send-email-horms@verge.net.au> From: Niklas S?derlund There is no point in protecting a register read with a lock. This is most likely a leftover from when the driver was reworked before being submitted for upstream. Signed-off-by: Niklas S?derlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Signed-off-by: Eduardo Valentin (cherry picked from commit 100cfbcf2580b0605f50af32fefd9c8d1d8357fb) Signed-off-by: Simon Horman --- drivers/thermal/rcar_gen3_thermal.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index ec477d47d0ba..cb5c362c0000 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -72,7 +71,6 @@ struct rcar_gen3_thermal_tsc { void __iomem *base; struct thermal_zone_device *zone; struct equation_coefs coef; - struct mutex lock; }; struct rcar_gen3_thermal_priv { @@ -163,16 +161,12 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp) u32 reg; /* Read register and convert to mili Celsius */ - mutex_lock(&tsc->lock); - reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK; val1 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1, tsc->coef.a1); val2 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b2, tsc->coef.a2); mcelsius = FIXPT_TO_MCELSIUS((val1 + val2) / 2); - mutex_unlock(&tsc->lock); - /* Make sure we are inside specifications */ if ((mcelsius < MCELSIUS(-40)) || (mcelsius > MCELSIUS(125))) return -EIO; @@ -299,7 +293,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) } priv->tscs[i] = tsc; - mutex_init(&tsc->lock); match_data->thermal_init(tsc); rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]); -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:48 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:48 +0200 Subject: [LTSI-dev] [PATCH 13/13] clk: cs2000: add Suspend/Resume feature In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-14-git-send-email-horms@verge.net.au> From: Khiem Nguyen CS2000 needs re-setup when redume, otherwise, it can't handle correct clock rate. Signed-off-by: Khiem Nguyen [Kuninori: cleanup original patch] Signed-off-by: Kuninori Morimoto Signed-off-by: Stephen Boyd (cherry picked from commit c567fb37f123511d752a454fb11d8bcaf46a7895) Signed-off-by: Simon Horman --- drivers/clk/clk-cs2000-cp.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c index 021f3daf34e1..3fca0526d940 100644 --- a/drivers/clk/clk-cs2000-cp.c +++ b/drivers/clk/clk-cs2000-cp.c @@ -59,6 +59,10 @@ struct cs2000_priv { struct i2c_client *client; struct clk *clk_in; struct clk *ref_clk; + + /* suspend/resume */ + unsigned long saved_rate; + unsigned long saved_parent_rate; }; static const struct of_device_id cs2000_of_match[] = { @@ -286,6 +290,9 @@ static int __cs2000_set_rate(struct cs2000_priv *priv, int ch, if (ret < 0) return ret; + priv->saved_rate = rate; + priv->saved_parent_rate = parent_rate; + return 0; } @@ -489,9 +496,24 @@ static int cs2000_probe(struct i2c_client *client, return ret; } +static int cs2000_resume(struct device *dev) +{ + struct cs2000_priv *priv = dev_get_drvdata(dev); + int ch = 0; /* it uses ch0 only at this point */ + + return __cs2000_set_rate(priv, ch, + priv->saved_rate, + priv->saved_parent_rate); +} + +static const struct dev_pm_ops cs2000_pm_ops = { + .resume_early = cs2000_resume, +}; + static struct i2c_driver cs2000_driver = { .driver = { .name = "cs2000-cp", + .pm = &cs2000_pm_ops, .of_match_table = cs2000_of_match, }, .probe = cs2000_probe, -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:36 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:36 +0200 Subject: [LTSI-dev] [PATCH 01/13] thermal: rcar_gen3_thermal: Document the R-Car Gen3 In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-2-git-send-email-horms@verge.net.au> From: Wolfram Sang Signed-off-by: Hien Dang Signed-off-by: Khiem Nguyen Signed-off-by: Wolfram Sang Signed-off-by: Niklas S?derlund Signed-off-by: Eduardo Valentin (cherry picked from commit b022e9b9d0e67f4cba62bc790bd387e23c29dc6c) Signed-off-by: Simon Horman --- .../bindings/thermal/rcar-gen3-thermal.txt | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt new file mode 100644 index 000000000000..07a9713ae6a7 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt @@ -0,0 +1,56 @@ +* DT bindings for Renesas R-Car Gen3 Thermal Sensor driver + +On R-Car Gen3 SoCs, the thermal sensor controllers (TSC) control the thermal +sensors (THS) which are the analog circuits for measuring temperature (Tj) +inside the LSI. + +Required properties: +- compatible : "renesas,-thermal", + Examples with soctypes are: + - "renesas,r8a7795-thermal" (R-Car H3) + - "renesas,r8a7796-thermal" (R-Car M3-W) +- reg : Address ranges of the thermal registers. Each sensor + needs one address range. Sorting must be done in + increasing order according to datasheet, i.e. + TSC1, TSC2, ... +- clocks : Must contain a reference to the functional clock. +- #thermal-sensor-cells : must be <1>. + +Optional properties: + +- interrupts : interrupts routed to the TSC (3 for H3 and M3-W) +- power-domain : Must contain a reference to the power domain. This + property is mandatory if the thermal sensor instance + is part of a controllable power domain. + +Example: + + tsc: thermal at e6198000 { + compatible = "renesas,r8a7795-thermal"; + reg = <0 0xe6198000 0 0x68>, + <0 0xe61a0000 0 0x5c>, + <0 0xe61a8000 0 0x5c>; + interrupts = , + , + ; + clocks = <&cpg CPG_MOD 522>; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + #thermal-sensor-cells = <1>; + status = "okay"; + }; + + thermal-zones { + sensor_thermal1: sensor-thermal1 { + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&tsc 0>; + + trips { + sensor1_crit: sensor1-crit { + temperature = <90000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:38 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:38 +0200 Subject: [LTSI-dev] [PATCH 03/13] thermal: rcar_gen3_thermal: add delay in .thermal_init on r8a7796 In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-4-git-send-email-horms@verge.net.au> From: Niklas S?derlund The .thermal_init needs to be delayed a short amount of time to allow for the TEMP register to contain something useful. If it's not delayed these warnings are common during boot: thermal thermal_zone0: failed to read out thermal zone (-5) thermal thermal_zone1: failed to read out thermal zone (-5) thermal thermal_zone2: failed to read out thermal zone (-5) The warnings are triggered by the first call to .get_temp() while the TEMP register contains 0 and rcar_gen3_thermal_get_temp() returns -EIO since a TEMP value of 0 will result in a temperature reading which is out of specifications. This should have been done in the initial commit which adds the driver as the same issue was found and corrected for r8a7795. Fixes: 564e73d283af9d4c ("thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver") Signed-off-by: Niklas S?derlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Signed-off-by: Eduardo Valentin (cherry picked from commit 78aefd2d5911c4e0b5dc0b0578b3b8c7673be1d2) Signed-off-by: Simon Horman --- drivers/thermal/rcar_gen3_thermal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index d33c845244b1..ec477d47d0ba 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -222,6 +222,8 @@ static void r8a7796_thermal_init(struct rcar_gen3_thermal_tsc *tsc) reg_val = rcar_gen3_thermal_read(tsc, REG_GEN3_THCTR); reg_val |= THCTR_THSST; rcar_gen3_thermal_write(tsc, REG_GEN3_THCTR, reg_val); + + usleep_range(1000, 2000); } static const struct rcar_gen3_thermal_data r8a7795_data = { -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:37 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:37 +0200 Subject: [LTSI-dev] [PATCH 02/13] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-3-git-send-email-horms@verge.net.au> From: Wolfram Sang Add support for R-Car Gen3 thermal sensors. Polling only for now, interrupts will be added incrementally. Same goes for reading fuses. This is documented already, but no hardware available for now. Signed-off-by: Hien Dang Signed-off-by: Thao Nguyen Signed-off-by: Khiem Nguyen Signed-off-by: Wolfram Sang [Niklas: document and rework temperature calculation] Signed-off-by: Niklas S?derlund Signed-off-by: Eduardo Valentin (cherry picked from commit 564e73d283af9d4c1d642079d5c7ac601876162f) Signed-off-by: Simon Horman --- drivers/thermal/Kconfig | 9 + drivers/thermal/Makefile | 1 + drivers/thermal/rcar_gen3_thermal.c | 335 ++++++++++++++++++++++++++++++++++++ 3 files changed, 345 insertions(+) create mode 100644 drivers/thermal/rcar_gen3_thermal.c diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index a13541bdc726..da71f94d2d33 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -243,6 +243,15 @@ config RCAR_THERMAL Enable this to plug the R-Car thermal sensor driver into the Linux thermal framework. +config RCAR_GEN3_THERMAL + tristate "Renesas R-Car Gen3 thermal driver" + depends on ARCH_RENESAS || COMPILE_TEST + depends on HAS_IOMEM + depends on OF + help + Enable this to plug the R-Car Gen3 thermal sensor driver into the Linux + thermal framework. + config KIRKWOOD_THERMAL tristate "Temperature sensor on Marvell Kirkwood SoCs" depends on MACH_KIRKWOOD || COMPILE_TEST diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile index c92eb22a41ff..1216fb31ed40 100644 --- a/drivers/thermal/Makefile +++ b/drivers/thermal/Makefile @@ -30,6 +30,7 @@ obj-$(CONFIG_QCOM_SPMI_TEMP_ALARM) += qcom-spmi-temp-alarm.o obj-$(CONFIG_SPEAR_THERMAL) += spear_thermal.o obj-$(CONFIG_ROCKCHIP_THERMAL) += rockchip_thermal.o obj-$(CONFIG_RCAR_THERMAL) += rcar_thermal.o +obj-$(CONFIG_RCAR_GEN3_THERMAL) += rcar_gen3_thermal.o obj-$(CONFIG_KIRKWOOD_THERMAL) += kirkwood_thermal.o obj-y += samsung/ obj-$(CONFIG_DOVE_THERMAL) += dove_thermal.o diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c new file mode 100644 index 000000000000..d33c845244b1 --- /dev/null +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -0,0 +1,335 @@ +/* + * R-Car Gen3 THS thermal sensor driver + * Based on rcar_thermal.c and work from Hien Dang and Khiem Nguyen. + * + * Copyright (C) 2016 Renesas Electronics Corporation. + * Copyright (C) 2016 Sang Engineering + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Register offsets */ +#define REG_GEN3_IRQSTR 0x04 +#define REG_GEN3_IRQMSK 0x08 +#define REG_GEN3_IRQCTL 0x0C +#define REG_GEN3_IRQEN 0x10 +#define REG_GEN3_IRQTEMP1 0x14 +#define REG_GEN3_IRQTEMP2 0x18 +#define REG_GEN3_IRQTEMP3 0x1C +#define REG_GEN3_CTSR 0x20 +#define REG_GEN3_THCTR 0x20 +#define REG_GEN3_TEMP 0x28 +#define REG_GEN3_THCODE1 0x50 +#define REG_GEN3_THCODE2 0x54 +#define REG_GEN3_THCODE3 0x58 + +/* CTSR bits */ +#define CTSR_PONM BIT(8) +#define CTSR_AOUT BIT(7) +#define CTSR_THBGR BIT(5) +#define CTSR_VMEN BIT(4) +#define CTSR_VMST BIT(1) +#define CTSR_THSST BIT(0) + +/* THCTR bits */ +#define THCTR_PONM BIT(6) +#define THCTR_THSST BIT(0) + +#define CTEMP_MASK 0xFFF + +#define MCELSIUS(temp) ((temp) * 1000) +#define GEN3_FUSE_MASK 0xFFF + +#define TSC_MAX_NUM 3 + +/* Structure for thermal temperature calculation */ +struct equation_coefs { + int a1; + int b1; + int a2; + int b2; +}; + +struct rcar_gen3_thermal_tsc { + void __iomem *base; + struct thermal_zone_device *zone; + struct equation_coefs coef; + struct mutex lock; +}; + +struct rcar_gen3_thermal_priv { + struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM]; +}; + +struct rcar_gen3_thermal_data { + void (*thermal_init)(struct rcar_gen3_thermal_tsc *tsc); +}; + +static inline u32 rcar_gen3_thermal_read(struct rcar_gen3_thermal_tsc *tsc, + u32 reg) +{ + return ioread32(tsc->base + reg); +} + +static inline void rcar_gen3_thermal_write(struct rcar_gen3_thermal_tsc *tsc, + u32 reg, u32 data) +{ + iowrite32(data, tsc->base + reg); +} + +/* + * Linear approximation for temperature + * + * [reg] = [temp] * a + b => [temp] = ([reg] - b) / a + * + * The constants a and b are calculated using two triplets of int values PTAT + * and THCODE. PTAT and THCODE can either be read from hardware or use hard + * coded values from driver. The formula to calculate a and b are taken from + * BSP and sparsely documented and understood. + * + * Examining the linear formula and the formula used to calculate constants a + * and b while knowing that the span for PTAT and THCODE values are between + * 0x000 and 0xfff the largest integer possible is 0xfff * 0xfff == 0xffe001. + * Integer also needs to be signed so that leaves 7 bits for binary + * fixed point scaling. + */ + +#define FIXPT_SHIFT 7 +#define FIXPT_INT(_x) ((_x) << FIXPT_SHIFT) +#define FIXPT_DIV(_a, _b) DIV_ROUND_CLOSEST(((_a) << FIXPT_SHIFT), (_b)) +#define FIXPT_TO_MCELSIUS(_x) ((_x) * 1000 >> FIXPT_SHIFT) + +#define RCAR3_THERMAL_GRAN 500 /* mili Celsius */ + +/* no idea where these constants come from */ +#define TJ_1 96 +#define TJ_3 -41 + +static void rcar_gen3_thermal_calc_coefs(struct equation_coefs *coef, + int *ptat, int *thcode) +{ + int tj_2; + + /* TODO: Find documentation and document constant calculation formula */ + + /* + * Division is not scaled in BSP and if scaled it might overflow + * the dividend (4095 * 4095 << 14 > INT_MAX) so keep it unscaled + */ + tj_2 = (FIXPT_INT((ptat[1] - ptat[2]) * 137) + / (ptat[0] - ptat[2])) - FIXPT_INT(41); + + coef->a1 = FIXPT_DIV(FIXPT_INT(thcode[1] - thcode[2]), + tj_2 - FIXPT_INT(TJ_3)); + coef->b1 = FIXPT_INT(thcode[2]) - coef->a1 * TJ_3; + + coef->a2 = FIXPT_DIV(FIXPT_INT(thcode[1] - thcode[0]), + tj_2 - FIXPT_INT(TJ_1)); + coef->b2 = FIXPT_INT(thcode[0]) - coef->a2 * TJ_1; +} + +static int rcar_gen3_thermal_round(int temp) +{ + int result, round_offs; + + round_offs = temp >= 0 ? RCAR3_THERMAL_GRAN / 2 : + -RCAR3_THERMAL_GRAN / 2; + result = (temp + round_offs) / RCAR3_THERMAL_GRAN; + return result * RCAR3_THERMAL_GRAN; +} + +static int rcar_gen3_thermal_get_temp(void *devdata, int *temp) +{ + struct rcar_gen3_thermal_tsc *tsc = devdata; + int mcelsius, val1, val2; + u32 reg; + + /* Read register and convert to mili Celsius */ + mutex_lock(&tsc->lock); + + reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK; + + val1 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1, tsc->coef.a1); + val2 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b2, tsc->coef.a2); + mcelsius = FIXPT_TO_MCELSIUS((val1 + val2) / 2); + + mutex_unlock(&tsc->lock); + + /* Make sure we are inside specifications */ + if ((mcelsius < MCELSIUS(-40)) || (mcelsius > MCELSIUS(125))) + return -EIO; + + /* Round value to device granularity setting */ + *temp = rcar_gen3_thermal_round(mcelsius); + + return 0; +} + +static struct thermal_zone_of_device_ops rcar_gen3_tz_of_ops = { + .get_temp = rcar_gen3_thermal_get_temp, +}; + +static void r8a7795_thermal_init(struct rcar_gen3_thermal_tsc *tsc) +{ + rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, CTSR_THBGR); + rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, 0x0); + + usleep_range(1000, 2000); + + rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, CTSR_PONM); + rcar_gen3_thermal_write(tsc, REG_GEN3_IRQCTL, 0x3F); + rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, + CTSR_PONM | CTSR_AOUT | CTSR_THBGR | CTSR_VMEN); + + usleep_range(100, 200); + + rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, + CTSR_PONM | CTSR_AOUT | CTSR_THBGR | CTSR_VMEN | + CTSR_VMST | CTSR_THSST); + + usleep_range(1000, 2000); +} + +static void r8a7796_thermal_init(struct rcar_gen3_thermal_tsc *tsc) +{ + u32 reg_val; + + reg_val = rcar_gen3_thermal_read(tsc, REG_GEN3_THCTR); + reg_val &= ~THCTR_PONM; + rcar_gen3_thermal_write(tsc, REG_GEN3_THCTR, reg_val); + + usleep_range(1000, 2000); + + rcar_gen3_thermal_write(tsc, REG_GEN3_IRQCTL, 0x3F); + reg_val = rcar_gen3_thermal_read(tsc, REG_GEN3_THCTR); + reg_val |= THCTR_THSST; + rcar_gen3_thermal_write(tsc, REG_GEN3_THCTR, reg_val); +} + +static const struct rcar_gen3_thermal_data r8a7795_data = { + .thermal_init = r8a7795_thermal_init, +}; + +static const struct rcar_gen3_thermal_data r8a7796_data = { + .thermal_init = r8a7796_thermal_init, +}; + +static const struct of_device_id rcar_gen3_thermal_dt_ids[] = { + { .compatible = "renesas,r8a7795-thermal", .data = &r8a7795_data}, + { .compatible = "renesas,r8a7796-thermal", .data = &r8a7796_data}, + {}, +}; +MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids); + +static int rcar_gen3_thermal_remove(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + + pm_runtime_put(dev); + pm_runtime_disable(dev); + + return 0; +} + +static int rcar_gen3_thermal_probe(struct platform_device *pdev) +{ + struct rcar_gen3_thermal_priv *priv; + struct device *dev = &pdev->dev; + struct resource *res; + struct thermal_zone_device *zone; + int ret, i; + const struct rcar_gen3_thermal_data *match_data = + of_device_get_match_data(dev); + + /* default values if FUSEs are missing */ + /* TODO: Read values from hardware on supported platforms */ + int ptat[3] = { 2351, 1509, 435 }; + int thcode[TSC_MAX_NUM][3] = { + { 3248, 2800, 2221 }, + { 3245, 2795, 2216 }, + { 3250, 2805, 2237 }, + }; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + platform_set_drvdata(pdev, priv); + + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + + for (i = 0; i < TSC_MAX_NUM; i++) { + struct rcar_gen3_thermal_tsc *tsc; + + tsc = devm_kzalloc(dev, sizeof(*tsc), GFP_KERNEL); + if (!tsc) { + ret = -ENOMEM; + goto error_unregister; + } + + res = platform_get_resource(pdev, IORESOURCE_MEM, i); + if (!res) + break; + + tsc->base = devm_ioremap_resource(dev, res); + if (IS_ERR(tsc->base)) { + ret = PTR_ERR(tsc->base); + goto error_unregister; + } + + priv->tscs[i] = tsc; + mutex_init(&tsc->lock); + + match_data->thermal_init(tsc); + rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]); + + zone = devm_thermal_zone_of_sensor_register(dev, i, tsc, + &rcar_gen3_tz_of_ops); + if (IS_ERR(zone)) { + dev_err(dev, "Can't register thermal zone\n"); + ret = PTR_ERR(zone); + goto error_unregister; + } + tsc->zone = zone; + } + + return 0; + +error_unregister: + rcar_gen3_thermal_remove(pdev); + + return ret; +} + +static struct platform_driver rcar_gen3_thermal_driver = { + .driver = { + .name = "rcar_gen3_thermal", + .of_match_table = rcar_gen3_thermal_dt_ids, + }, + .probe = rcar_gen3_thermal_probe, + .remove = rcar_gen3_thermal_remove, +}; +module_platform_driver(rcar_gen3_thermal_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("R-Car Gen3 THS thermal sensor driver"); +MODULE_AUTHOR("Wolfram Sang "); -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:42 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:42 +0200 Subject: [LTSI-dev] [PATCH 07/13] thermal: rcar_gen3_thermal: enable hardware interrupts for trip points In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-8-git-send-email-horms@verge.net.au> From: Niklas S?derlund Enable hardware trip points by implementing the set_trips callback. The thermal core will take care of setting the initial trip point window and to update it once the driver reports a TSC has moved outside it. The interrupt structure for this device is a bit odd. There is not a dedicated IRQ for each TSC, instead the interrupts are shared between all TSCs. IRQn is fired if the temp monitored in IRQTEMPn is reached in any of the TSCs, example IRQ3 is fired if temperature in IRQTEMP3 is reached in either TSC0, TSC1 or TSC2. For this reason the usage of interrupts in this driver is an all-on or all-off design. When an interrupt happens all TSCs are checked and all thermal zones are updated. This could be refined to be more fine grained but the thermal core takes care of only updating the thermal zones that have left their trip point window. Signed-off-by: Niklas S?derlund Reviewed-by: Wolfram Sang Signed-off-by: Eduardo Valentin (cherry picked from commit 7d4b269776ec67c1b7d83c6c727a2771e5f39d12) Signed-off-by: Simon Horman --- drivers/thermal/rcar_gen3_thermal.c | 132 +++++++++++++++++++++++++++++++++++- 1 file changed, 131 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index 4a08b35533dc..d37c7d8f8fcd 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -23,8 +23,11 @@ #include #include #include +#include #include +#include "thermal_core.h" + /* Register offsets */ #define REG_GEN3_IRQSTR 0x04 #define REG_GEN3_IRQMSK 0x08 @@ -40,6 +43,14 @@ #define REG_GEN3_THCODE2 0x54 #define REG_GEN3_THCODE3 0x58 +/* IRQ{STR,MSK,EN} bits */ +#define IRQ_TEMP1 BIT(0) +#define IRQ_TEMP2 BIT(1) +#define IRQ_TEMP3 BIT(2) +#define IRQ_TEMPD1 BIT(3) +#define IRQ_TEMPD2 BIT(4) +#define IRQ_TEMPD3 BIT(5) + /* CTSR bits */ #define CTSR_PONM BIT(8) #define CTSR_AOUT BIT(7) @@ -76,6 +87,7 @@ struct rcar_gen3_thermal_tsc { struct rcar_gen3_thermal_priv { struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM]; unsigned int num_tscs; + spinlock_t lock; /* Protect interrupts on and off */ }; struct rcar_gen3_thermal_data { @@ -113,6 +125,7 @@ static inline void rcar_gen3_thermal_write(struct rcar_gen3_thermal_tsc *tsc, #define FIXPT_SHIFT 7 #define FIXPT_INT(_x) ((_x) << FIXPT_SHIFT) +#define INT_FIXPT(_x) ((_x) >> FIXPT_SHIFT) #define FIXPT_DIV(_a, _b) DIV_ROUND_CLOSEST(((_a) << FIXPT_SHIFT), (_b)) #define FIXPT_TO_MCELSIUS(_x) ((_x) * 1000 >> FIXPT_SHIFT) @@ -178,10 +191,87 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp) return 0; } +static int rcar_gen3_thermal_mcelsius_to_temp(struct rcar_gen3_thermal_tsc *tsc, + int mcelsius) +{ + int celsius, val1, val2; + + celsius = DIV_ROUND_CLOSEST(mcelsius, 1000); + val1 = celsius * tsc->coef.a1 + tsc->coef.b1; + val2 = celsius * tsc->coef.a2 + tsc->coef.b2; + + return INT_FIXPT((val1 + val2) / 2); +} + +static int rcar_gen3_thermal_set_trips(void *devdata, int low, int high) +{ + struct rcar_gen3_thermal_tsc *tsc = devdata; + + low = clamp_val(low, -40000, 125000); + high = clamp_val(high, -40000, 125000); + + rcar_gen3_thermal_write(tsc, REG_GEN3_IRQTEMP1, + rcar_gen3_thermal_mcelsius_to_temp(tsc, low)); + + rcar_gen3_thermal_write(tsc, REG_GEN3_IRQTEMP2, + rcar_gen3_thermal_mcelsius_to_temp(tsc, high)); + + return 0; +} + static struct thermal_zone_of_device_ops rcar_gen3_tz_of_ops = { .get_temp = rcar_gen3_thermal_get_temp, + .set_trips = rcar_gen3_thermal_set_trips, }; +static void rcar_thermal_irq_set(struct rcar_gen3_thermal_priv *priv, bool on) +{ + unsigned int i; + u32 val = on ? IRQ_TEMPD1 | IRQ_TEMP2 : 0; + + for (i = 0; i < priv->num_tscs; i++) + rcar_gen3_thermal_write(priv->tscs[i], REG_GEN3_IRQMSK, val); +} + +static irqreturn_t rcar_gen3_thermal_irq(int irq, void *data) +{ + struct rcar_gen3_thermal_priv *priv = data; + u32 status; + int i, ret = IRQ_HANDLED; + + spin_lock(&priv->lock); + for (i = 0; i < priv->num_tscs; i++) { + status = rcar_gen3_thermal_read(priv->tscs[i], REG_GEN3_IRQSTR); + rcar_gen3_thermal_write(priv->tscs[i], REG_GEN3_IRQSTR, 0); + if (status) + ret = IRQ_WAKE_THREAD; + } + + if (ret == IRQ_WAKE_THREAD) + rcar_thermal_irq_set(priv, false); + + spin_unlock(&priv->lock); + + return ret; +} + +static irqreturn_t rcar_gen3_thermal_irq_thread(int irq, void *data) +{ + struct rcar_gen3_thermal_priv *priv = data; + unsigned long flags; + int i; + + for (i = 0; i < priv->num_tscs; i++) + thermal_zone_device_update(priv->tscs[i]->zone, + THERMAL_EVENT_UNSPECIFIED); + + spin_lock_irqsave(&priv->lock, flags); + rcar_thermal_irq_set(priv, true); + spin_unlock_irqrestore(&priv->lock, flags); + + return IRQ_HANDLED; +} + static void r8a7795_thermal_init(struct rcar_gen3_thermal_tsc *tsc) { rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, CTSR_THBGR); @@ -190,7 +280,11 @@ static void r8a7795_thermal_init(struct rcar_gen3_thermal_tsc *tsc) usleep_range(1000, 2000); rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, CTSR_PONM); + rcar_gen3_thermal_write(tsc, REG_GEN3_IRQCTL, 0x3F); + rcar_gen3_thermal_write(tsc, REG_GEN3_IRQMSK, 0); + rcar_gen3_thermal_write(tsc, REG_GEN3_IRQEN, IRQ_TEMPD1 | IRQ_TEMP2); + rcar_gen3_thermal_write(tsc, REG_GEN3_CTSR, CTSR_PONM | CTSR_AOUT | CTSR_THBGR | CTSR_VMEN); @@ -214,6 +308,9 @@ static void r8a7796_thermal_init(struct rcar_gen3_thermal_tsc *tsc) usleep_range(1000, 2000); rcar_gen3_thermal_write(tsc, REG_GEN3_IRQCTL, 0x3F); + rcar_gen3_thermal_write(tsc, REG_GEN3_IRQMSK, 0); + rcar_gen3_thermal_write(tsc, REG_GEN3_IRQEN, IRQ_TEMPD1 | IRQ_TEMP2); + reg_val = rcar_gen3_thermal_read(tsc, REG_GEN3_THCTR); reg_val |= THCTR_THSST; rcar_gen3_thermal_write(tsc, REG_GEN3_THCTR, reg_val); @@ -252,7 +349,8 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct resource *res; struct thermal_zone_device *zone; - int ret, i; + int ret, irq, i; + char *irqname; const struct rcar_gen3_thermal_data *match_data = of_device_get_match_data(dev); @@ -269,8 +367,32 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; + spin_lock_init(&priv->lock); + platform_set_drvdata(pdev, priv); + /* + * Request 2 (of the 3 possible) IRQs, the driver only needs to + * to trigger on the low and high trip points of the current + * temp window at this point. + */ + for (i = 0; i < 2; i++) { + irq = platform_get_irq(pdev, i); + if (irq < 0) + return irq; + + irqname = devm_kasprintf(dev, GFP_KERNEL, "%s:ch%d", + dev_name(dev), i); + if (!irqname) + return -ENOMEM; + + ret = devm_request_threaded_irq(dev, irq, rcar_gen3_thermal_irq, + rcar_gen3_thermal_irq_thread, + IRQF_SHARED, irqname, priv); + if (ret) + return ret; + } + pm_runtime_enable(dev); pm_runtime_get_sync(dev); @@ -306,6 +428,12 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) goto error_unregister; } tsc->zone = zone; + + ret = of_thermal_get_ntrips(tsc->zone); + if (ret < 0) + goto error_unregister; + + dev_info(dev, "TSC%d: Loaded %d trip points\n", i, ret); } priv->num_tscs = i; @@ -315,6 +443,8 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) goto error_unregister; } + rcar_thermal_irq_set(priv, true); + return 0; error_unregister: -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:41 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:41 +0200 Subject: [LTSI-dev] [PATCH 06/13] thermal: rcar_gen3_thermal: record and check number of TSCs found In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-7-git-send-email-horms@verge.net.au> From: Niklas S?derlund Record how many TSCs are found in struct rcar_gen3_thermal_priv, this is needed to be able to add hardware interrupts for trip points later. Also add a check to make sure at least one TSC is found. Signed-off-by: Niklas S?derlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Signed-off-by: Eduardo Valentin (cherry picked from commit 97dad1f1d2b3f2a2a77551849357b7ac38b0b6ff) Signed-off-by: Simon Horman --- drivers/thermal/rcar_gen3_thermal.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index 9b6bc03dd142..4a08b35533dc 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -75,6 +75,7 @@ struct rcar_gen3_thermal_tsc { struct rcar_gen3_thermal_priv { struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM]; + unsigned int num_tscs; }; struct rcar_gen3_thermal_data { @@ -307,6 +308,13 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) tsc->zone = zone; } + priv->num_tscs = i; + + if (!priv->num_tscs) { + ret = -ENODEV; + goto error_unregister; + } + return 0; error_unregister: -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:40 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:40 +0200 Subject: [LTSI-dev] [PATCH 05/13] thermal: rcar_gen3_thermal: check that TSC exists before memory allocation In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-6-git-send-email-horms@verge.net.au> From: Niklas S?derlund Move the check for a TSC resource before allocating memory for a new TSC. If no TSC is found there is little point in allocating memory for it. Signed-off-by: Niklas S?derlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Signed-off-by: Eduardo Valentin (cherry picked from commit d51546c0db975a4750161d17eef62dfcf9eedc90) Signed-off-by: Simon Horman --- drivers/thermal/rcar_gen3_thermal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index cb5c362c0000..9b6bc03dd142 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -276,16 +276,16 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) for (i = 0; i < TSC_MAX_NUM; i++) { struct rcar_gen3_thermal_tsc *tsc; + res = platform_get_resource(pdev, IORESOURCE_MEM, i); + if (!res) + break; + tsc = devm_kzalloc(dev, sizeof(*tsc), GFP_KERNEL); if (!tsc) { ret = -ENOMEM; goto error_unregister; } - res = platform_get_resource(pdev, IORESOURCE_MEM, i); - if (!res) - break; - tsc->base = devm_ioremap_resource(dev, res); if (IS_ERR(tsc->base)) { ret = PTR_ERR(tsc->base); -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:46 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:46 +0200 Subject: [LTSI-dev] [PATCH 11/13] usb: host: ehci-platform: set hcd->phy to avoid phy_get() in usb_add_hcd() In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-12-git-send-email-horms@verge.net.au> From: Yoshihiro Shimoda This patch sets hcd->phy from own phy context to avoid phy_get() in usb_add_hcd(). Since core/hcd.c manages the phy only in usb_add_hcd() and usb_remove_hcd(), there is difficult to manage the phy in suspend/resume. Signed-off-by: Yoshihiro Shimoda Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 42a58c9949ddf16e557f5c2e22566f3440e7b60f) Signed-off-by: Simon Horman --- drivers/usb/host/ehci-platform.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index 3214300396a0..bc7b9be12f54 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -221,6 +221,9 @@ static int ehci_platform_probe(struct platform_device *dev) if (IS_ERR(priv->phys[phy_num])) { err = PTR_ERR(priv->phys[phy_num]); goto err_put_hcd; + } else if (!hcd->phy) { + /* Avoiding phy_get() in usb_add_hcd() */ + hcd->phy = priv->phys[phy_num]; } } -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:47 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:47 +0200 Subject: [LTSI-dev] [PATCH 12/13] usb: host: ohci-platform: set hcd->phy to avoid phy_get() in usb_add_hcd() In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-13-git-send-email-horms@verge.net.au> From: Yoshihiro Shimoda This patch sets hcd->phy from own phy context to avoid phy_get() in usb_add_hcd(). Since core/hcd.c manages the phy only in usb_add_hcd() and usb_remove_hcd(), there is difficult to manage the phy in suspend/resume. Signed-off-by: Yoshihiro Shimoda Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman (cherry picked from commit d3d6ef1fb908b286a610fe063613e519bc50178b) Signed-off-by: Simon Horman --- drivers/usb/host/ohci-platform.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index 898b74086c12..6368fce43197 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -183,6 +183,9 @@ static int ohci_platform_probe(struct platform_device *dev) if (IS_ERR(priv->phys[phy_num])) { err = PTR_ERR(priv->phys[phy_num]); goto err_put_hcd; + } else if (!hcd->phy) { + /* Avoiding phy_get() in usb_add_hcd() */ + hcd->phy = priv->phys[phy_num]; } } -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:43 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:43 +0200 Subject: [LTSI-dev] [PATCH 08/13] thermal: rcar_gen3_thermal: store device match data in private structure In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-9-git-send-email-horms@verge.net.au> From: Niklas S?derlund The device match data needs to be accessible outside the probe function, store it in the private data structure. Signed-off-by: Niklas S?derlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Signed-off-by: Eduardo Valentin (cherry picked from commit cc4d072b66298716484f5c78d782c64509f4b6d9) Signed-off-by: Simon Horman --- drivers/thermal/rcar_gen3_thermal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index d37c7d8f8fcd..f259a995c66c 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -88,6 +88,7 @@ struct rcar_gen3_thermal_priv { struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM]; unsigned int num_tscs; spinlock_t lock; /* Protect interrupts on and off */ + const struct rcar_gen3_thermal_data *data; }; struct rcar_gen3_thermal_data { @@ -351,8 +352,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) struct thermal_zone_device *zone; int ret, irq, i; char *irqname; - const struct rcar_gen3_thermal_data *match_data = - of_device_get_match_data(dev); /* default values if FUSEs are missing */ /* TODO: Read values from hardware on supported platforms */ @@ -367,6 +366,8 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; + priv->data = of_device_get_match_data(dev); + spin_lock_init(&priv->lock); platform_set_drvdata(pdev, priv); @@ -417,7 +418,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) priv->tscs[i] = tsc; - match_data->thermal_init(tsc); + priv->data->thermal_init(tsc); rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]); zone = devm_thermal_zone_of_sensor_register(dev, i, tsc, -- 2.1.4 From horms at verge.net.au Tue Sep 5 08:06:45 2017 From: horms at verge.net.au (Simon Horman) Date: Tue, 5 Sep 2017 10:06:45 +0200 Subject: [LTSI-dev] [PATCH 10/13] usb: host: ehci-platform: fix usb 1.1 device is not connected in system resume In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <1504598808-19810-11-git-send-email-horms@verge.net.au> From: Yoshihiro Shimoda This patch fixes an issue that a usb 1.1 device is not connected in system resume and then the following message appeared if debug messages are enabled: usb 2-1: Waited 2000ms for CONNECT To resolve this issue, the EHCI controller must be resumed after its companion controllers. So, this patch adds such code on the driver. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Greg Kroah-Hartman (cherry picked from commit d4d75128b8fd727d42c775a16b41634d09409dba) Signed-off-by: Simon Horman --- drivers/usb/host/ehci-platform.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index a268d9e8d6cf..3214300396a0 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "ehci.h" @@ -297,6 +298,7 @@ static int ehci_platform_probe(struct platform_device *dev) goto err_power; device_wakeup_enable(hcd->self.controller); + device_enable_async_suspend(hcd->self.controller); platform_set_drvdata(dev, hcd); return err; @@ -370,6 +372,7 @@ static int ehci_platform_resume(struct device *dev) struct usb_ehci_pdata *pdata = dev_get_platdata(dev); struct platform_device *pdev = to_platform_device(dev); struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd); + struct device *companion_dev; if (pdata->power_on) { int err = pdata->power_on(pdev); @@ -377,6 +380,10 @@ static int ehci_platform_resume(struct device *dev) return err; } + companion_dev = usb_of_get_companion_dev(hcd->self.controller); + if (companion_dev) + device_pm_wait_for_dev(hcd->self.controller, companion_dev); + ehci_resume(hcd, priv->reset_on_resume); return 0; } -- 2.1.4 From gregkh at linuxfoundation.org Tue Sep 5 14:33:27 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Tue, 5 Sep 2017 16:33:27 +0200 Subject: [LTSI-dev] [GIT PULL LTSI-4.9 v2 00/13] Second Round of Renesas SoCs and Drivers to v4.12 In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Message-ID: <20170905143327.GA12405@kroah.com> On Tue, Sep 05, 2017 at 10:06:35AM +0200, Simon Horman wrote: > Hi, > > This is a submission to LTSI-v4.9. > > * Backport v4.9 of the rcar-gen3-thermal driver to its as of v4.12. > * Limited backport to v4.9 of: > - usb core > - ohci-platform > - ehci-platform > - cs2000 > > There are 13 patches. > > This patches appear to apply ltsi-4.9 tree generated using > scripts/generate_git. Thanks, that worked just fine, all now queued up. greg k-h From khiem.nguyen.xt at renesas.com Wed Sep 6 02:42:04 2017 From: khiem.nguyen.xt at renesas.com (Khiem Nguyen) Date: Wed, 6 Sep 2017 02:42:04 +0000 Subject: [LTSI-dev] [GIT PULL LTSI-4.9 v2 00/13] Second Round of Renesas SoCs and Drivers to v4.12 In-Reply-To: <20170905143327.GA12405@kroah.com> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> <20170905143327.GA12405@kroah.com> Message-ID: Hi Greg, > > This patches appear to apply ltsi-4.9 tree generated using > > scripts/generate_git. > > Thanks, that worked just fine, all now queued up. I checked the master branch of ltsi-kernel [1] and it said the LTS base is LTS 4.9.47. So, you will release RC2 soon with LTS 4.9.47 as base. Is my understanding correct ? [1] http://git.linuxfoundation.org/?p=ltsi-kernel.git;a=shortlog;h=refs/heads/master Update to KERNEL_VERSION 4.9.47 Best regards, KHIEM Nguyen From fukuyasu at linuxfoundation.org Wed Sep 6 03:25:52 2017 From: fukuyasu at linuxfoundation.org (Noriaki Fukuyasu) Date: Wed, 6 Sep 2017 12:25:52 +0900 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! Message-ID: Hi everyone RC2 is now out for testing. Let's try to target September 16th to finish testing. You can download the RC2 patch from below URL. http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2/release-candidate Thanks Greg for preparing the RC2 patch!! regards Nori -- Noriaki Fukuyasu VP of Japan Operations The Linux Foundation Mail: fukuyasu at linuxfoundation.org Tel: +81-80-4350-1133 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gregkh at linuxfoundation.org Wed Sep 6 07:10:19 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Wed, 6 Sep 2017 09:10:19 +0200 Subject: [LTSI-dev] [GIT PULL LTSI-4.9 v2 00/13] Second Round of Renesas SoCs and Drivers to v4.12 In-Reply-To: References: <1504598808-19810-1-git-send-email-horms@verge.net.au> <20170905143327.GA12405@kroah.com> Message-ID: <20170906071019.GA19059@kroah.com> On Wed, Sep 06, 2017 at 02:42:04AM +0000, Khiem Nguyen wrote: > Hi Greg, > > > > This patches appear to apply ltsi-4.9 tree generated using > > > scripts/generate_git. > > > > Thanks, that worked just fine, all now queued up. > > I checked the master branch of ltsi-kernel [1] and it said the LTS base is LTS 4.9.47. > So, you will release RC2 soon with LTS 4.9.47 as base. > > Is my understanding correct ? > > [1] > http://git.linuxfoundation.org/?p=ltsi-kernel.git;a=shortlog;h=refs/heads/master > Update to KERNEL_VERSION 4.9.47 Yes, it will be against 4.9.47. From gregkh at linuxfoundation.org Wed Sep 6 07:10:54 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Wed, 6 Sep 2017 09:10:54 +0200 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: References: Message-ID: <20170906071054.GB19059@kroah.com> On Wed, Sep 06, 2017 at 12:25:52PM +0900, Noriaki Fukuyasu wrote: > Hi everyone > > RC2 is now out for testing. > Let's try to target September 16th to finish testing. > > You can download the RC2 patch from below URL. > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2/ > release-candidate > > Thanks Greg for preparing the RC2 patch!! Oops, I named this wrong, the patch is really against 4.9.47, not 4.9.45, sorry about that. thanks, greg k-h From fukuyasu at linuxfoundation.org Wed Sep 6 07:16:31 2017 From: fukuyasu at linuxfoundation.org (Noriaki Fukuyasu) Date: Wed, 6 Sep 2017 16:16:31 +0900 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: <20170906071054.GB19059@kroah.com> References: <20170906071054.GB19059@kroah.com> Message-ID: Hi Greg Thanks! I just updated the web and the patch name! http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.47-ltsi-rc2/release-candidate regards Nori On Wed, Sep 6, 2017 at 4:10 PM, Greg KH wrote: > On Wed, Sep 06, 2017 at 12:25:52PM +0900, Noriaki Fukuyasu wrote: > > Hi everyone > > > > RC2 is now out for testing. > > Let's try to target September 16th to finish testing. > > > > You can download the RC2 patch from below URL. > > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2/ > > release-candidate > > > > Thanks Greg for preparing the RC2 patch!! > > Oops, I named this wrong, the patch is really against 4.9.47, not > 4.9.45, sorry about that. > > thanks, > > greg k-h > -- Noriaki Fukuyasu VP of Japan Operations The Linux Foundation Mail: fukuyasu at linuxfoundation.org Tel: +81-80-4350-1133 -------------- next part -------------- An HTML attachment was scrubbed... URL: From horms at verge.net.au Wed Sep 6 08:13:13 2017 From: horms at verge.net.au (Simon Horman) Date: Wed, 6 Sep 2017 10:13:13 +0200 Subject: [LTSI-dev] [GIT PULL LTSI-4.9 v2 00/13] Second Round of Renesas SoCs and Drivers to v4.12 In-Reply-To: <20170905143327.GA12405@kroah.com> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> <20170905143327.GA12405@kroah.com> Message-ID: <20170906081313.GB10048@verge.net.au> On Tue, Sep 05, 2017 at 04:33:27PM +0200, Greg KH wrote: > On Tue, Sep 05, 2017 at 10:06:35AM +0200, Simon Horman wrote: > > Hi, > > > > This is a submission to LTSI-v4.9. > > > > * Backport v4.9 of the rcar-gen3-thermal driver to its as of v4.12. > > * Limited backport to v4.9 of: > > - usb core > > - ohci-platform > > - ehci-platform > > - cs2000 > > > > There are 13 patches. > > > > This patches appear to apply ltsi-4.9 tree generated using > > scripts/generate_git. > > Thanks, that worked just fine, all now queued up. Great, thanks for your patience. From khiem.nguyen.xt at renesas.com Wed Sep 6 10:10:36 2017 From: khiem.nguyen.xt at renesas.com (Khiem Nguyen) Date: Wed, 6 Sep 2017 10:10:36 +0000 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: <20170906071054.GB19059@kroah.com> References: <20170906071054.GB19059@kroah.com> Message-ID: Hi Simon, Greg, > > RC2 is now out for testing. > > Let's try to target September 16th to finish testing. > > > > You can download the RC2 patch from below URL. > > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2/ > > release-candidate > > > > Thanks Greg for preparing the RC2 patch!! > > Oops, I named this wrong, the patch is really against 4.9.47, not 4.9.45, sorry > about that. Sorry, We got build error with arm64 build. The reason is lacking of one patch which Shimoda-san has been requested. Somehow, when preparing Renesas patches, the patch has been slipped through the cracks... i.e 5095cb8 usb: of: add functions to bind a companion controller Please consider to backport the patch. Best regards, KHIEM Nguyen From gregkh at linuxfoundation.org Wed Sep 6 13:09:54 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Wed, 6 Sep 2017 15:09:54 +0200 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: References: <20170906071054.GB19059@kroah.com> Message-ID: <20170906130954.GB4033@kroah.com> On Wed, Sep 06, 2017 at 10:10:36AM +0000, Khiem Nguyen wrote: > Hi Simon, Greg, > > > > RC2 is now out for testing. > > > Let's try to target September 16th to finish testing. > > > > > > You can download the RC2 patch from below URL. > > > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2/ > > > release-candidate > > > > > > Thanks Greg for preparing the RC2 patch!! > > > > Oops, I named this wrong, the patch is really against 4.9.47, not 4.9.45, sorry > > about that. > > Sorry, > We got build error with arm64 build. > > The reason is lacking of one patch which Shimoda-san has been requested. > Somehow, when preparing Renesas patches, the patch has been slipped through the cracks... > i.e > 5095cb8 usb: of: add functions to bind a companion controller > > Please consider to backport the patch. Where in the series file does this patch belong to prevent the build error? thanks, greg k-h From khiem.nguyen.xt at renesas.com Wed Sep 6 13:30:58 2017 From: khiem.nguyen.xt at renesas.com (Khiem Nguyen) Date: Wed, 6 Sep 2017 13:30:58 +0000 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: <20170906130954.GB4033@kroah.com> References: <20170906071054.GB19059@kroah.com> <20170906130954.GB4033@kroah.com> Message-ID: Hi Greg, > > > > RC2 is now out for testing. > > > > Let's try to target September 16th to finish testing. > > > > > > > > You can download the RC2 patch from below URL. > > > > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2 > > > > / > > > > release-candidate > > > > > > > > Thanks Greg for preparing the RC2 patch!! > > > > > > Oops, I named this wrong, the patch is really against 4.9.47, not > > > 4.9.45, sorry about that. > > > > Sorry, > > We got build error with arm64 build. > > > > The reason is lacking of one patch which Shimoda-san has been requested. > > Somehow, when preparing Renesas patches, the patch has been slipped > through the cracks... > > i.e > > 5095cb8 usb: of: add functions to bind a companion controller > > > > Please consider to backport the patch. > > Where in the series file does this patch belong to prevent the build error? This patch should be placed next to other 3 USB patches, i.e patches.renesas/usb-host-ehci-platform-fix-usb-1.1-device-is-not-connected-in-system-resume.patch patches.renesas/usb-host-ehci-platform-set-hcd-phy-to-avoid-phy_get-in-usb_add_hcd.patch patches.renesas/usb-host-ohci-platform-set-hcd-phy-to-avoid-phy_get-in-usb_add_hcd.patch Best regards, KHIEM Nguyen From horms at verge.net.au Wed Sep 6 13:37:32 2017 From: horms at verge.net.au (Simon Horman) Date: Wed, 6 Sep 2017 15:37:32 +0200 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: References: <20170906071054.GB19059@kroah.com> <20170906130954.GB4033@kroah.com> Message-ID: <20170906133728.GA1091@verge.net.au> On Wed, Sep 06, 2017 at 01:30:58PM +0000, Khiem Nguyen wrote: > Hi Greg, > > > > > > RC2 is now out for testing. > > > > > Let's try to target September 16th to finish testing. > > > > > > > > > > You can download the RC2 patch from below URL. > > > > > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2 > > > > > / > > > > > release-candidate > > > > > > > > > > Thanks Greg for preparing the RC2 patch!! > > > > > > > > Oops, I named this wrong, the patch is really against 4.9.47, not > > > > 4.9.45, sorry about that. > > > > > > Sorry, > > > We got build error with arm64 build. > > > > > > The reason is lacking of one patch which Shimoda-san has been requested. > > > Somehow, when preparing Renesas patches, the patch has been slipped > > through the cracks... > > > i.e > > > 5095cb8 usb: of: add functions to bind a companion controller > > > > > > Please consider to backport the patch. > > > > Where in the series file does this patch belong to prevent the build error? > > This patch should be placed next to other 3 USB patches, > i.e > patches.renesas/usb-host-ehci-platform-fix-usb-1.1-device-is-not-connected-in-system-resume.patch > patches.renesas/usb-host-ehci-platform-set-hcd-phy-to-avoid-phy_get-in-usb_add_hcd.patch > patches.renesas/usb-host-ohci-platform-set-hcd-phy-to-avoid-phy_get-in-usb_add_hcd.patch Hi Khiem-san, thanks for your analysis and testing and sorry for missing this vital patch - it was in my queue but somehow didn't make it into the patch-set that I sent Greg. I believe 5095cb8 should go immediately above patches.renesas/usb-host-ehci-platform-fix-usb-1.1-device-is-not-connected-in-system-resume.patch I have tested the arm64 build locally this afternoon and that seems to resolve the problem. Greg, do you want me to post a backport of this patch or will you handle it? From gregkh at linuxfoundation.org Wed Sep 6 15:42:41 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Wed, 6 Sep 2017 17:42:41 +0200 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: <20170906133728.GA1091@verge.net.au> References: <20170906071054.GB19059@kroah.com> <20170906130954.GB4033@kroah.com> <20170906133728.GA1091@verge.net.au> Message-ID: <20170906154241.GA3967@kroah.com> On Wed, Sep 06, 2017 at 03:37:32PM +0200, Simon Horman wrote: > On Wed, Sep 06, 2017 at 01:30:58PM +0000, Khiem Nguyen wrote: > > Hi Greg, > > > > > > > > RC2 is now out for testing. > > > > > > Let's try to target September 16th to finish testing. > > > > > > > > > > > > You can download the RC2 patch from below URL. > > > > > > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2 > > > > > > / > > > > > > release-candidate > > > > > > > > > > > > Thanks Greg for preparing the RC2 patch!! > > > > > > > > > > Oops, I named this wrong, the patch is really against 4.9.47, not > > > > > 4.9.45, sorry about that. > > > > > > > > Sorry, > > > > We got build error with arm64 build. > > > > > > > > The reason is lacking of one patch which Shimoda-san has been requested. > > > > Somehow, when preparing Renesas patches, the patch has been slipped > > > through the cracks... > > > > i.e > > > > 5095cb8 usb: of: add functions to bind a companion controller > > > > > > > > Please consider to backport the patch. > > > > > > Where in the series file does this patch belong to prevent the build error? > > > > This patch should be placed next to other 3 USB patches, > > i.e > > patches.renesas/usb-host-ehci-platform-fix-usb-1.1-device-is-not-connected-in-system-resume.patch > > patches.renesas/usb-host-ehci-platform-set-hcd-phy-to-avoid-phy_get-in-usb_add_hcd.patch > > patches.renesas/usb-host-ohci-platform-set-hcd-phy-to-avoid-phy_get-in-usb_add_hcd.patch > > Hi Khiem-san, > > thanks for your analysis and testing and sorry for missing this vital patch > - it was in my queue but somehow didn't make it into the patch-set that > I sent Greg. > > I believe 5095cb8 should go immediately above > > patches.renesas/usb-host-ehci-platform-fix-usb-1.1-device-is-not-connected-in-system-resume.patch > > I have tested the arm64 build locally this afternoon and that seems to > resolve the problem. > > Greg, do you want me to post a backport of this patch or will > you handle it? I've now added it to the tree, if you could verify I got it right, that would be great. thanks, greg k-h From khiem.nguyen.xt at renesas.com Thu Sep 7 04:32:59 2017 From: khiem.nguyen.xt at renesas.com (Khiem Nguyen) Date: Thu, 7 Sep 2017 04:32:59 +0000 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: <20170906154241.GA3967@kroah.com> References: <20170906071054.GB19059@kroah.com> <20170906130954.GB4033@kroah.com> <20170906133728.GA1091@verge.net.au> <20170906154241.GA3967@kroah.com> Message-ID: Hi Greg, > -----Original Message----- > From: Greg KH [mailto:gregkh at linuxfoundation.org] > Sent: Wednesday, September 6, 2017 10:43 PM > To: Simon Horman > Cc: Khiem Nguyen ; Noriaki Fukuyasu > ; ltsi-dev at lists.linuxfoundation.org > Subject: Re: [LTSI-dev] LTSI-4.9 RC2 is out for testing! > > On Wed, Sep 06, 2017 at 03:37:32PM +0200, Simon Horman wrote: > > On Wed, Sep 06, 2017 at 01:30:58PM +0000, Khiem Nguyen wrote: > > > Hi Greg, > > > > > > > > > > RC2 is now out for testing. > > > > > > > Let's try to target September 16th to finish testing. > > > > > > > > > > > > > > You can download the RC2 patch from below URL. > > > > > > > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-lt > > > > > > > si-rc2 > > > > > > > / > > > > > > > release-candidate > > > > > > > > > > > > > > Thanks Greg for preparing the RC2 patch!! > > > > > > > > > > > > Oops, I named this wrong, the patch is really against 4.9.47, > > > > > > not 4.9.45, sorry about that. > > > > > > > > > > Sorry, > > > > > We got build error with arm64 build. > > > > > > > > > > The reason is lacking of one patch which Shimoda-san has been requested. > > > > > Somehow, when preparing Renesas patches, the patch has been > > > > > slipped > > > > through the cracks... > > > > > i.e > > > > > 5095cb8 usb: of: add functions to bind a companion controller > > > > > > > > > > Please consider to backport the patch. > > > > > > > > Where in the series file does this patch belong to prevent the build error? > > > > > > This patch should be placed next to other 3 USB patches, i.e > > > patches.renesas/usb-host-ehci-platform-fix-usb-1.1-device-is-not-con > > > nected-in-system-resume.patch > > > patches.renesas/usb-host-ehci-platform-set-hcd-phy-to-avoid-phy_get- > > > in-usb_add_hcd.patch > > > patches.renesas/usb-host-ohci-platform-set-hcd-phy-to-avoid-phy_get- > > > in-usb_add_hcd.patch > > > > Hi Khiem-san, > > > > thanks for your analysis and testing and sorry for missing this vital > > patch > > - it was in my queue but somehow didn't make it into the patch-set > > that I sent Greg. > > > > I believe 5095cb8 should go immediately above > > > > patches.renesas/usb-host-ehci-platform-fix-usb-1.1-device-is-not-conne > > cted-in-system-resume.patch > > > > I have tested the arm64 build locally this afternoon and that seems to > > resolve the problem. > > > > Greg, do you want me to post a backport of this patch or will you > > handle it? > > I've now added it to the tree, if you could verify I got it right, that would be great. I have confirmed build test for arm/arm64 as well as boot test. All tests are OK. Will inform more test result within 1 week. Best regards, KHIEM Nguyen From khiem.nguyen.xt at renesas.com Fri Sep 15 09:24:59 2017 From: khiem.nguyen.xt at renesas.com (Khiem Nguyen) Date: Fri, 15 Sep 2017 09:24:59 +0000 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: References: Message-ID: Hi Greg et al., > RC2 is now out for testing. > Let's try to target September 16th to finish testing. > > You can download the RC2 patch from below URL. > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2/release-candidate I'd like to share the updated test result based on LTSI 4.9-RC2. - Basically, there are some improvement in R-Car BSP test result for some drivers as the result of adding new patches into RC2. i.e Sound, USB Note that there are still some failed test cases. However, the results are similar with the status in upstream kernel v4.12. I expect those failed cases will be fixed in v4.13 and v4.14 upstream. In brief, I think the test result is acceptable. - About LTP test result, there are small changes in test results. However, the changes are same with LTS kernel (base of LTSI 4.9-RC2). Therefore, I think it's acceptable, too. I hope official LTSI 4.9 is going to be released soon. Best regards, KHIEM Nguyen -------------- next part -------------- A non-text attachment was scrubbed... Name: LTSI_4.9_RC2_BSP_tests_with_Fuego_v1.xls Type: application/vnd.ms-excel Size: 97792 bytes Desc: LTSI_4.9_RC2_BSP_tests_with_Fuego_v1.xls URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 20170915_LTP_report_for_LTSI-4.9-rc2_Salvator-X-2.0.xlsm Type: application/vnd.ms-excel.sheet.macroenabled.12 Size: 43966 bytes Desc: 20170915_LTP_report_for_LTSI-4.9-rc2_Salvator-X-2.0.xlsm URL: From gregkh at linuxfoundation.org Fri Sep 15 17:32:48 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Fri, 15 Sep 2017 10:32:48 -0700 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: References: Message-ID: <20170915173248.GB26162@kroah.com> On Fri, Sep 15, 2017 at 09:24:59AM +0000, Khiem Nguyen wrote: > Hi Greg et al., > > > RC2 is now out for testing. > > Let's try to target September 16th to finish testing. > > > > You can download the RC2 patch from below URL. > > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2/release-candidate > > I'd like to share the updated test result based on LTSI 4.9-RC2. > - Basically, there are some improvement in R-Car BSP test result for some drivers > as the result of adding new patches into RC2. i.e Sound, USB > Note that there are still some failed test cases. However, the results are similar with the status in upstream kernel v4.12. > I expect those failed cases will be fixed in v4.13 and v4.14 upstream. > In brief, I think the test result is acceptable. > > - About LTP test result, there are small changes in test results. > However, the changes are same with LTS kernel (base of LTSI 4.9-RC2). > Therefore, I think it's acceptable, too. Wait, no! What is the new failure that is upstream in the LTS kernel? No one has told me about a failure there, we need to get that fixed. thanks for the testing and the results, hopefully we can use it to fix the issue. thanks, greg k-h From khiem.nguyen.xt at renesas.com Wed Sep 20 09:22:23 2017 From: khiem.nguyen.xt at renesas.com (Khiem Nguyen) Date: Wed, 20 Sep 2017 09:22:23 +0000 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: <20170915173248.GB26162@kroah.com> References: <20170915173248.GB26162@kroah.com> Message-ID: Hi Greg, > > - About LTP test result, there are small changes in test results. > > However, the changes are same with LTS kernel (base of LTSI 4.9-RC2). > > Therefore, I think it's acceptable, too. > > Wait, no! What is the new failure that is upstream in the LTS kernel? > No one has told me about a failure there, we need to get that fixed. > > thanks for the testing and the results, hopefully we can use it to fix the issue. Sorry, it's a false alarm. I confirmed again the LTP test report. LTSI 4.9 RC2 has no new LTP failed cases. Actually, there are some improvement compared with RC1. Please consider to release LTSI 4.9 soon. Best regards, KHIEM Nguyen From khiem.nguyen.xt at renesas.com Wed Sep 20 10:00:09 2017 From: khiem.nguyen.xt at renesas.com (Khiem Nguyen) Date: Wed, 20 Sep 2017 10:00:09 +0000 Subject: [LTSI-dev] LTSI-4.9 RC2 is out for testing! In-Reply-To: References: Message-ID: Hi all, > > RC2 is now out for testing. > > Let's try to target September 16th to finish testing. > > > > You can download the RC2 patch from below URL. > > http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.45-ltsi-rc2/release- > candidate > > I'd like to share the updated test result based on LTSI 4.9-RC2. > - Basically, there are some improvement in R-Car BSP test result for some drivers > as the result of adding new patches into RC2. i.e Sound, USB > Note that there are still some failed test cases. However, the results are similar > with the status in upstream kernel v4.12. > I expect those failed cases will be fixed in v4.13 and v4.14 upstream. > In brief, I think the test result is acceptable. About the failed cases of "Functional" and "Benchmark" in our test report, there are mainly the issues of test environment (rootfs) or Fuego environment themselves. I updated the BSP test result report with the analysis of those failed cases. Please refer it for your information. As I said in previous post, we will confirm Fuego v1.2 (to be released in coming weeks) and contribute the fixes, if any. Best regards, KHIEM Nguyen -------------- next part -------------- A non-text attachment was scrubbed... Name: LTSI_4.9_RC2_BSP_tests_with_Fuego_v1_comments.xls Type: application/vnd.ms-excel Size: 99328 bytes Desc: LTSI_4.9_RC2_BSP_tests_with_Fuego_v1_comments.xls URL: From fukuyasu at linuxfoundation.org Thu Sep 21 08:30:31 2017 From: fukuyasu at linuxfoundation.org (Noriaki Fukuyasu) Date: Thu, 21 Sep 2017 01:30:31 -0700 Subject: [LTSI-dev] LTSI 4.9 is NOW AVAILABLE Message-ID: Dear LTSI community participants I am please to inform all of you that Greg has released the LTSI 4.9 (4.9.51-ltsi) today! http://ltsi.linuxfoundation.org/releases/ltsi-tree/4.9.51-ltsi/stable-release Please enjoy :) Best regards Nori -- Noriaki Fukuyasu VP of Japan Operations The Linux Foundation Mail: fukuyasu at linuxfoundation.org Tel: +81-80-4350-1133 -------------- next part -------------- An HTML attachment was scrubbed... URL: