* [PATCH v2 7/8] PM / Domains: Support IRQ safe PM domains
From: Ulf Hansson @ 2016-10-10 11:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475879821-8035-8-git-send-email-lina.iyer@linaro.org>
On 8 October 2016 at 00:37, Lina Iyer <lina.iyer@linaro.org> wrote:
> Generic Power Domains currently support turning on/off only in process
> context. This prevents the usage of PM domains for domains that could be
> powered on/off in a context where IRQs are disabled. Many such domains
> exist today and do not get powered off, when the IRQ safe devices in
> that domain are powered off, because of this limitation.
>
> However, not all domains can operate in IRQ safe contexts. Genpd
> therefore, has to support both cases where the domain may or may not
> operate in IRQ safe contexts. Configuring genpd to use an appropriate
> lock for that domain, would allow domains that have IRQ safe devices to
> runtime suspend and resume, in atomic context.
>
> To achieve domain specific locking, set the domain's ->flag to
> GENPD_FLAG_IRQ_SAFE while defining the domain. This indicates that genpd
> should use a spinlock instead of a mutex for locking the domain. Locking
> is abstracted through genpd_lock() and genpd_unlock() functions that use
> the flag to determine the appropriate lock to be used for that domain.
>
> Domains that have lower latency to suspend and resume and can operate
> with IRQs disabled may now be able to save power, when the component
> devices and sub-domains are idle at runtime.
>
> The restriction this imposes on the domain hierarchy is that non-IRQ
> safe domains may not have IRQ-safe subdomains, but IRQ safe domains may
> have IRQ safe and non-IRQ safe subdomains and devices.
>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Kevin Hilman <khilman@kernel.org>
> Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
> Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Uffe
> ---
> drivers/base/power/domain.c | 111 ++++++++++++++++++++++++++++++++++++++++----
> include/linux/pm_domain.h | 10 +++-
> 2 files changed, 110 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index d0ae559..87a016a 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -74,11 +74,70 @@ static const struct genpd_lock_ops genpd_mtx_ops = {
> .unlock = genpd_unlock_mtx,
> };
>
> +static void genpd_lock_spin(struct generic_pm_domain *genpd)
> + __acquires(&genpd->slock)
> +{
> + unsigned long flags;
> +
> + spin_lock_irqsave(&genpd->slock, flags);
> + genpd->lock_flags = flags;
> +}
> +
> +static void genpd_lock_nested_spin(struct generic_pm_domain *genpd,
> + int depth)
> + __acquires(&genpd->slock)
> +{
> + unsigned long flags;
> +
> + spin_lock_irqsave_nested(&genpd->slock, flags, depth);
> + genpd->lock_flags = flags;
> +}
> +
> +static int genpd_lock_interruptible_spin(struct generic_pm_domain *genpd)
> + __acquires(&genpd->slock)
> +{
> + unsigned long flags;
> +
> + spin_lock_irqsave(&genpd->slock, flags);
> + genpd->lock_flags = flags;
> + return 0;
> +}
> +
> +static void genpd_unlock_spin(struct generic_pm_domain *genpd)
> + __releases(&genpd->slock)
> +{
> + spin_unlock_irqrestore(&genpd->slock, genpd->lock_flags);
> +}
> +
> +static const struct genpd_lock_ops genpd_spin_ops = {
> + .lock = genpd_lock_spin,
> + .lock_nested = genpd_lock_nested_spin,
> + .lock_interruptible = genpd_lock_interruptible_spin,
> + .unlock = genpd_unlock_spin,
> +};
> +
> #define genpd_lock(p) p->lock_ops->lock(p)
> #define genpd_lock_nested(p, d) p->lock_ops->lock_nested(p, d)
> #define genpd_lock_interruptible(p) p->lock_ops->lock_interruptible(p)
> #define genpd_unlock(p) p->lock_ops->unlock(p)
>
> +#define genpd_is_irq_safe(genpd) (genpd->flags & GENPD_FLAG_IRQ_SAFE)
> +
> +static inline bool irq_safe_dev_in_no_sleep_domain(struct device *dev,
> + struct generic_pm_domain *genpd)
> +{
> + bool ret;
> +
> + ret = pm_runtime_is_irq_safe(dev) && !genpd_is_irq_safe(genpd);
> +
> + /* Warn once for each IRQ safe dev in no sleep domain */
> + if (ret)
> + dev_warn_once(dev, "PM domain %s will not be powered off\n",
> + genpd->name);
> +
> + return ret;
> +}
> +
> /*
> * Get the generic PM domain for a particular struct device.
> * This validates the struct device pointer, the PM domain pointer,
> @@ -343,7 +402,12 @@ static int genpd_poweroff(struct generic_pm_domain *genpd, bool is_async)
> if (stat > PM_QOS_FLAGS_NONE)
> return -EBUSY;
>
> - if (!pm_runtime_suspended(pdd->dev) || pdd->dev->power.irq_safe)
> + /*
> + * Do not allow PM domain to be powered off, when an IRQ safe
> + * device is part of a non-IRQ safe domain.
> + */
> + if (!pm_runtime_suspended(pdd->dev) ||
> + irq_safe_dev_in_no_sleep_domain(pdd->dev, genpd))
> not_suspended++;
> }
>
> @@ -506,10 +570,10 @@ static int genpd_runtime_suspend(struct device *dev)
> }
>
> /*
> - * If power.irq_safe is set, this routine will be run with interrupts
> - * off, so it can't use mutexes.
> + * If power.irq_safe is set, this routine may be run with
> + * IRQs disabled, so suspend only if the PM domain also is irq_safe.
> */
> - if (dev->power.irq_safe)
> + if (irq_safe_dev_in_no_sleep_domain(dev, genpd))
> return 0;
>
> genpd_lock(genpd);
> @@ -543,8 +607,11 @@ static int genpd_runtime_resume(struct device *dev)
> if (IS_ERR(genpd))
> return -EINVAL;
>
> - /* If power.irq_safe, the PM domain is never powered off. */
> - if (dev->power.irq_safe) {
> + /*
> + * As we don't power off a non IRQ safe domain, which holds
> + * an IRQ safe device, we don't need to restore power to it.
> + */
> + if (irq_safe_dev_in_no_sleep_domain(dev, genpd)) {
> timed = false;
> goto out;
> }
> @@ -586,7 +653,8 @@ static int genpd_runtime_resume(struct device *dev)
> err_stop:
> genpd_stop_dev(genpd, dev);
> err_poweroff:
> - if (!dev->power.irq_safe) {
> + if (!pm_runtime_is_irq_safe(dev) ||
> + (pm_runtime_is_irq_safe(dev) && genpd_is_irq_safe(genpd))) {
> genpd_lock(genpd);
> genpd_poweroff(genpd, 0);
> genpd_unlock(genpd);
> @@ -1223,6 +1291,17 @@ static int genpd_add_subdomain(struct generic_pm_domain *genpd,
> || genpd == subdomain)
> return -EINVAL;
>
> + /*
> + * If the domain can be powered on/off in an IRQ safe
> + * context, ensure that the subdomain can also be
> + * powered on/off in that context.
> + */
> + if (!genpd_is_irq_safe(genpd) && genpd_is_irq_safe(subdomain)) {
> + WARN("Parent %s of subdomain %s must be IRQ safe\n",
> + genpd->name, subdomain->name);
> + return -EINVAL;
> + }
> +
> link = kzalloc(sizeof(*link), GFP_KERNEL);
> if (!link)
> return -ENOMEM;
> @@ -1337,6 +1416,17 @@ static int genpd_set_default_power_state(struct generic_pm_domain *genpd)
> return 0;
> }
>
> +static void genpd_lock_init(struct generic_pm_domain *genpd)
> +{
> + if (genpd->flags & GENPD_FLAG_IRQ_SAFE) {
> + spin_lock_init(&genpd->slock);
> + genpd->lock_ops = &genpd_spin_ops;
> + } else {
> + mutex_init(&genpd->mlock);
> + genpd->lock_ops = &genpd_mtx_ops;
> + }
> +}
> +
> /**
> * pm_genpd_init - Initialize a generic I/O PM domain object.
> * @genpd: PM domain object to initialize.
> @@ -1356,8 +1446,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
> INIT_LIST_HEAD(&genpd->master_links);
> INIT_LIST_HEAD(&genpd->slave_links);
> INIT_LIST_HEAD(&genpd->dev_list);
> - mutex_init(&genpd->mlock);
> - genpd->lock_ops = &genpd_mtx_ops;
> + genpd_lock_init(genpd);
> genpd->gov = gov;
> INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn);
> atomic_set(&genpd->sd_count, 0);
> @@ -2133,7 +2222,9 @@ static int pm_genpd_summary_one(struct seq_file *s,
> }
>
> list_for_each_entry(pm_data, &genpd->dev_list, list_node) {
> - kobj_path = kobject_get_path(&pm_data->dev->kobj, GFP_KERNEL);
> + kobj_path = kobject_get_path(&pm_data->dev->kobj,
> + genpd_is_irq_safe(genpd) ?
> + GFP_ATOMIC : GFP_KERNEL);
> if (kobj_path == NULL)
> continue;
>
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index 811b968..81ece61 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -15,9 +15,11 @@
> #include <linux/err.h>
> #include <linux/of.h>
> #include <linux/notifier.h>
> +#include <linux/spinlock.h>
>
> /* Defines used for the flags field in the struct generic_pm_domain */
> #define GENPD_FLAG_PM_CLK (1U << 0) /* PM domain uses PM clk */
> +#define GENPD_FLAG_IRQ_SAFE (1U << 1) /* PM domain operates in atomic */
>
> enum gpd_status {
> GPD_STATE_ACTIVE = 0, /* PM domain is active */
> @@ -76,7 +78,13 @@ struct generic_pm_domain {
> unsigned int state_idx; /* state that genpd will go to when off */
> void *free; /* Free the state that was allocated for default */
> const struct genpd_lock_ops *lock_ops;
> - struct mutex mlock;
> + union {
> + struct mutex mlock;
> + struct {
> + spinlock_t slock;
> + unsigned long lock_flags;
> + };
> + };
>
> };
>
> --
> 2.7.4
>
^ permalink raw reply
* [RESEND PATCH v6, 3/5] usb: xhci-mtk: make IPPC register optional
From: Matthias Brugger @ 2016-10-10 10:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1474437277-27201-4-git-send-email-chunfeng.yun@mediatek.com>
On 09/21/2016 07:54 AM, Chunfeng Yun wrote:
> Make IPPC register optional to support host side of dual-role mode,
> due to it is moved into common glue layer for simplification.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
> drivers/usb/host/xhci-mtk.c | 36 +++++++++++++++++++++++++++++-------
> 1 file changed, 29 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> index 79959f1..4bf99b9 100644
> --- a/drivers/usb/host/xhci-mtk.c
> +++ b/drivers/usb/host/xhci-mtk.c
> @@ -94,6 +94,9 @@ static int xhci_mtk_host_enable(struct xhci_hcd_mtk *mtk)
> int ret;
> int i;
>
> + if (ippc == NULL)
> + return 0;
> +
> /* power on host ip */
> value = readl(&ippc->ip_pw_ctr1);
> value &= ~CTRL1_IP_HOST_PDN;
> @@ -139,6 +142,9 @@ static int xhci_mtk_host_disable(struct xhci_hcd_mtk *mtk)
> int ret;
> int i;
>
> + if (ippc == NULL)
> + return 0;
> +
> /* power down all u3 ports */
> for (i = 0; i < mtk->num_u3_ports; i++) {
> value = readl(&ippc->u3_ctrl_p[i]);
> @@ -173,6 +179,9 @@ static int xhci_mtk_ssusb_config(struct xhci_hcd_mtk *mtk)
> struct mu3c_ippc_regs __iomem *ippc = mtk->ippc_regs;
> u32 value;
>
> + if (ippc == NULL)
> + return 0;
> +
I would prefer to add a flag/bool in xhci_hcd_mtk to signal the absence
of the ippc. Or at least use a macro which checks the presence before
calling any of this three functions.
Regards,
Matthias
> /* reset whole ip */
> value = readl(&ippc->ip_pw_ctr0);
> value |= CTRL0_IP_SW_RST;
> @@ -475,6 +484,7 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci)
> /* called during probe() after chip reset completes */
> static int xhci_mtk_setup(struct usb_hcd *hcd)
> {
> + struct xhci_hcd *xhci = hcd_to_xhci(hcd);
> struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd);
> int ret;
>
> @@ -482,12 +492,21 @@ static int xhci_mtk_setup(struct usb_hcd *hcd)
> ret = xhci_mtk_ssusb_config(mtk);
> if (ret)
> return ret;
> + }
> +
> + ret = xhci_gen_setup(hcd, xhci_mtk_quirks);
> + if (ret)
> + return ret;
> +
> + if (usb_hcd_is_primary_hcd(hcd)) {
> + mtk->num_u3_ports = xhci->num_usb3_ports;
> + mtk->num_u2_ports = xhci->num_usb2_ports;
> ret = xhci_mtk_sch_init(mtk);
> if (ret)
> return ret;
> }
>
> - return xhci_gen_setup(hcd, xhci_mtk_quirks);
> + return ret;
> }
>
> static int xhci_mtk_probe(struct platform_device *pdev)
> @@ -586,7 +605,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> mtk->hcd = platform_get_drvdata(pdev);
> platform_set_drvdata(pdev, mtk);
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac");
> hcd->regs = devm_ioremap_resource(dev, res);
> if (IS_ERR(hcd->regs)) {
> ret = PTR_ERR(hcd->regs);
> @@ -595,11 +614,14 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> hcd->rsrc_start = res->start;
> hcd->rsrc_len = resource_size(res);
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - mtk->ippc_regs = devm_ioremap_resource(dev, res);
> - if (IS_ERR(mtk->ippc_regs)) {
> - ret = PTR_ERR(mtk->ippc_regs);
> - goto put_usb2_hcd;
> + mtk->ippc_regs = NULL;
> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ippc");
> + if (res) { /* ippc register is optional */
> + mtk->ippc_regs = devm_ioremap_resource(dev, res);
> + if (IS_ERR(mtk->ippc_regs)) {
> + ret = PTR_ERR(mtk->ippc_regs);
> + goto put_usb2_hcd;
> + }
> }
>
> for (phy_num = 0; phy_num < mtk->num_phys; phy_num++) {
>
^ permalink raw reply
* [PATCH v6 0/6] ARM: dts: imx6q: Add Engicam i.CoreM6 dts
From: Jagan Teki @ 2016-10-10 10:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAD6G_RRw68FVxG5rum41OeSrb9wDD0SkKeDgwjRLSJ2BuVtqfw@mail.gmail.com>
Hi Shawn,
On Fri, Oct 7, 2016 at 7:51 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> On Tue, Sep 27, 2016 at 12:53 AM, Jagan Teki <jteki@openedev.com> wrote:
>> This is series add dts support for Engicam I.Core M6 qdl modules on
>> top of */shawnguo/linux.git for-next.
>>
>> Jagan Teki (6):
>> of: Add vendor prefix for Engicam s.r.l company
This patch applied already.
>> ARM: dts: imx6q: Add Engicam i.CoreM6 Quad/Dual initial support
>> ARM: dts: imx6q: Add Engicam i.CoreM6 DualLite/Solo initial support
>> ARM: dts: imx6qdl-icore: Add usbhost support
>> ARM: dts: imx6qdl-icore: Add usbotg support
>> ARM: dts: imx6qdl-icore: Add FEC support
Please take these five patches, I was trying to rebase but no resent
*/git/shawnguo/linux.git tree.
thanks!
--
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
^ permalink raw reply
* [PATCH] MAINTAINERS: Add ARM64-specific ACPI maintainers entry
From: Will Deacon @ 2016-10-10 10:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161005112540.22189-1-lorenzo.pieralisi@arm.com>
On Wed, Oct 05, 2016 at 12:25:40PM +0100, Lorenzo Pieralisi wrote:
> The ARM64 architecture defines ARM64 specific ACPI bindings to
> configure and set-up arch specific components. To simplify
> code reviews/updates and streamline the maintainership structure
> supporting the arch specific code, a new arm64 directory was created in
> /drivers/acpi, to contain ACPI code that is specific to ARM64
> architecture.
>
> Add the ARM64-specific ACPI maintainers entry in MAINTAINERS for
> the newly created subdirectory and respective code content.
>
> Lorenzo Pieralisi will be in charge of submitting and managing
> the pull requests on behalf of all maintainers listed.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Hanjun Guo <hanjun.guo@linaro.org>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Link: http://lkml.kernel.org/r/1603704.EGiVTcCxLR at vostro.rjw.lan
> ---
> MAINTAINERS | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f593300..2a70dd9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -316,6 +316,14 @@ W: https://01.org/linux-acpi
> S: Supported
> F: drivers/acpi/fan.c
>
> +ACPI FOR ARM64 (ACPI/arm64)
> +M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> +M: Hanjun Guo <hanjun.guo@linaro.org>
> +M: Sudeep Holla <sudeep.holla@arm.com>
> +L: linux-acpi at vger.kernel.org
> +S: Maintained
> +F: drivers/acpi/arm64
Thanks for doing this:
Acked-by: Will Deacon <will.deacon@arm.com>
Will
^ permalink raw reply
* [PATCH] Reorganize STM32 clocks in order to prepare them for PLLI2S and PLLSAI
From: Daniel Thompson @ 2016-10-10 10:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAFvLkMQjDZysgoT3FfkVP8UQVkqghW9=CZU-OEmGUAdMR7CO2A@mail.gmail.com>
On 10/10/16 10:56, Rados?aw Pietrzyk wrote:
> Hi,
> all plls have the same clock parent which is after a main divider.
> Currently the divider and multiplier are connected together within vco
> clock and therefore there is no chance to reuse the divider and clearly
> state where the conncetion "really" is. We can arrange all of them
> separately but than the divider will be hidden for all of them separately.
Quoting my last mail "I can see the value of naming the "/M"
pre-division separately". In other words I agree with the idea of the patch.
To more explicitly state my review comments...
> From: Radoslaw Pietrzyk <radoslaw.pietrzyk@gmail.com>
Please add a explanation of the problem and solution in the patch
description.
> Signed-off-by: Radoslaw Pietrzyk <radoslaw.pietrzyk@gmail.com>
> ---
> drivers/clk/clk-stm32f4.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c
> index 02d6810..1fd3eac 100644
> --- a/drivers/clk/clk-stm32f4.c
> +++ b/drivers/clk/clk-stm32f4.c
> @@ -245,9 +245,10 @@ static void stm32f4_rcc_register_pll(const char
*hse_clk, const char *hsi_clk)
> const char *pllsrc = pllcfgr & BIT(22) ? hse_clk : hsi_clk;
> unsigned long pllq = (pllcfgr >> 24) & 0xf;
>
> - clk_register_fixed_factor(NULL, "vco", pllsrc, 0, plln, pllm);
> - clk_register_fixed_factor(NULL, "pll", "vco", 0, 1, pllp);
> - clk_register_fixed_factor(NULL, "pll48", "vco", 0, 1, pllq);
> + clk_register_fixed_factor(NULL, "vco-div", pllsrc, 0, 1, pllm);
This strikes me as a bad name for a clock that is shared by all three
PLLs (the vco being an internal component of the PLL) however since the
clock is not named in the datasheet we are forced to invent a name [I
suspect that's why I gave up trying to name it when I wrote the driver
originally ;-) ].
Perhaps "pllin-prediv"?
> + clk_register_fixed_factor(NULL, "vco-mul", "vco-div", 0, plln, 1);
Why rename this clock? Multiplying is a what the vco (and its control
circuits) is *for*. Tagging it "-mul" is meaningless.
Daniel.
^ permalink raw reply
* [PATCH 05/12] ASoC: sun4i-codec: Add support for A31 playback through headphone output
From: Maxime Ripard @ 2016-10-10 10:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAGb2v66b_zG=xK_JVBnwY=SPtvJ+c-fZjuugAHUybzZdkkcScg@mail.gmail.com>
On Tue, Oct 04, 2016 at 12:26:08PM +0800, Chen-Yu Tsai wrote:
> >> +struct sun4i_codec_regs {
> >> + u32 adc_fifoc;
> >> + u32 adc_fifos;
> >> + u32 adc_rxdata;
> >> +};
> >> +
> >> struct sun4i_codec {
> >> struct device *dev;
> >> struct regmap *regmap;
> >> struct clk *clk_apb;
> >> struct clk *clk_module;
> >> struct gpio_desc *gpio_pa;
> >> + const struct sun4i_codec_regs *regs;
> >
> > You're reimplementing reg_field here.
>
> Are you suggesting we do reg_fields for each register?
> Or all the bit fields separately. The latter would add
> quite a few pointers.
only the one that change, so judging from your structure, only the ADC
fifo control, status and data registers.
> >> +static const struct of_device_id sun4i_codec_of_match[] = {
> >> + {
> >> + .compatible = "allwinner,sun4i-a10-codec",
> >> + .data = &sun4i_codec_quirks,
> >> + },
> >> + {
> >> + .compatible = "allwinner,sun6i-a31-codec",
> >> + .data = &sun6i_a31_codec_quirks,
> >> + },
> >> + {
> >> + .compatible = "allwinner,sun7i-a20-codec",
> >> + .data = &sun7i_codec_quirks,
> >> + },
> >> + {}
> >> +};
> >> +MODULE_DEVICE_TABLE(of, sun4i_codec_of_match);
> >> +
> >
> > I don't really like moving blocks of code over and over again,
> > especially in the middle of an unrelated patch.
>
> It's not completely unrelated. I want different create_card
> functions for the different SoCs, and that has to be part of the
> quirks, so the quirks and the of_match list have to be moved
> below them. I suppose I could leave the regmap parts in place,
> but keeping them together is nicer.
>
> If I split out the addition of the .create_card field and
> code movement into a separate patch, would that be OK?
Yep, that would work.
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161010/0827457c/attachment.sig>
^ permalink raw reply
* [PATCH v2 4/8] PM / Domains: Save the fwnode in genpd_power_state
From: Ulf Hansson @ 2016-10-10 10:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475879821-8035-5-git-send-email-lina.iyer@linaro.org>
On 8 October 2016 at 00:36, Lina Iyer <lina.iyer@linaro.org> wrote:
> Save the fwnode for the genpd state in the state node. PM Domain clients
> may use the fwnode to read in the platform specific domain state
> properties and associate them with the state.
>
> Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Uffe
> ---
> drivers/base/power/domain.c | 1 +
> include/linux/pm_domain.h | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 4208b67..e0f31fe 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1957,6 +1957,7 @@ static int genpd_parse_state(struct genpd_power_state *genpd_state,
>
> genpd_state->power_on_latency_ns = 1000 * exit_latency;
> genpd_state->power_off_latency_ns = 1000 * entry_latency;
> + genpd_state->fwnode = &state_node->fwnode;
>
> return 0;
> }
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index b489496..6a89881 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -39,6 +39,7 @@ struct genpd_power_state {
> s64 power_off_latency_ns;
> s64 power_on_latency_ns;
> s64 residency_ns;
> + struct fwnode_handle *fwnode;
> };
>
> struct generic_pm_domain {
> --
> 2.7.4
>
^ permalink raw reply
* [PATCH v2 2/2] clk: imx: improve precision of AV PLL to 1 Hz
From: Emil Lundmark @ 2016-10-10 10:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <cover.1476092427.git.emil@limesaudio.com>
The audio and video PLLs are designed to have a precision of 1 Hz if some
conditions are met. The current implementation only allows a precision that
depends on the rate of the parent clock. E.g., if the parent clock is 24
MHz, the precision will be 24 Hz; or more generally the precision will be
p / 10^6 Hz
where p is the parent clock rate. This comes down to how the register
values for the PLL's fractional loop divider are chosen.
The clock rate calculation for the PLL is
PLL output frequency = Fref * (DIV_SELECT + NUM / DENOM)
or with a shorter notation
r = p * (d + a / b)
In addition to all variables being integers, we also have the following
conditions:
27 <= d <= 54
-2^29 <= a <= 2^29-1
0 < b <= 2^30-1
|a| < b
Here, d, a and b are register values for the fractional loop divider. We
want to chose d, a and b such that f(p, r) = p, i.e. f is our round_rate
function. Currently, d and b are chosen as
d = r / p
b = 10^6
hence we get the poor precision. And a is defined in terms of r, d, p and
b:
a = (r - d * p) * b / p
I propose that if p <= 2^30-1 (i.e., the max value for b), we chose b as
b = p
We can do this since
|a| < b
|(r - d * p) * b / p| < b
|r - d * p| < p
Which have two solutions, one of them is when p < 0, so we can skip that
one. The other is when p > 0 and
p * (d - 1) < r < p * (d + 1)
Substitute d = r / p:
(r - p) < r < (r + p) <=> p > 0
So, as long as p > 0, we can chose b = p. This is a good choice for b since
a = (r - d * p) * b / p
= r - d * p
r = p * (d + a / b)
= p * d + p * a / b
= p * d + a
and if d = r / p:
a = r - d * p
= r - r / p * p
= 0
r = p * d + a
= p * d + 0
= p * r / p
= r
I reckon this is the intention by the design of the clock rate formula.
Signed-off-by: Emil Lundmark <emil@limesaudio.com>
---
drivers/clk/imx/clk-pllv3.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index bc7f163ea13c..5ff55ff5fd81 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -234,6 +234,7 @@ static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long max_rate = parent_rate * 54;
u32 div;
u32 mfn, mfd = 1000000;
+ u32 max_mfd = 0x3FFFFFFF;
u64 temp64;
if (rate > max_rate)
@@ -241,6 +242,9 @@ static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate,
else if (rate < min_rate)
rate = min_rate;
+ if (parent_rate <= max_mfd)
+ mfd = parent_rate;
+
div = rate / parent_rate;
temp64 = (u64) (rate - div * parent_rate);
temp64 *= mfd;
@@ -262,11 +266,15 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long max_rate = parent_rate * 54;
u32 val, div;
u32 mfn, mfd = 1000000;
+ u32 max_mfd = 0x3FFFFFFF;
u64 temp64;
if (rate < min_rate || rate > max_rate)
return -EINVAL;
+ if (parent_rate <= max_mfd)
+ mfd = parent_rate;
+
div = rate / parent_rate;
temp64 = (u64) (rate - div * parent_rate);
temp64 *= mfd;
--
2.7.4
^ permalink raw reply related
* [PATCH v2 1/2] clk: imx: fix integer overflow in AV PLL round rate
From: Emil Lundmark @ 2016-10-10 10:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <cover.1476092427.git.emil@limesaudio.com>
Since 'parent_rate * mfn' may overflow 32 bits, the result should be
stored using 64 bits.
Fixes: ba7f4f557eb6 ("clk: imx: correct AV PLL rate formula")
Signed-off-by: Emil Lundmark <emil@limesaudio.com>
---
drivers/clk/imx/clk-pllv3.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index 19f9b622981a..bc7f163ea13c 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -247,7 +247,11 @@ static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate,
do_div(temp64, parent_rate);
mfn = temp64;
- return parent_rate * div + parent_rate * mfn / mfd;
+ temp64 = (u64)parent_rate;
+ temp64 *= mfn;
+ do_div(temp64, mfd);
+
+ return parent_rate * div + (u32)temp64;
}
static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
--
2.7.4
^ permalink raw reply related
* [PATCH v2 0/2] clk: imx: fix AV PLL rate setting
From: Emil Lundmark @ 2016-10-10 10:03 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
I did not use a cover letter in v1, so here is a summary instead.
I discovered a problem when trying to set the rate of the audio PLL
(pll4_post_div) on an i.MX6Q. The rate I wanted to set was 196.608 MHz, but
the actual rate I got was 192.000570 MHz. This patch series fixes this
issue and also improves the precision of the audio/video PLL.
There are no code changes in v2, only clarifications in the commit
messages.
Changes since v1:
- Use correct subsystem name in commit summary.
- Use 'Fixes:' tag to indicate bug fix.
- Revise argument for choosing the denominator register value after
comments from Lothar Wa?mann.
v1: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-October/460350.html
Emil Lundmark (2):
clk: imx: fix integer overflow in AV PLL round rate
clk: imx: improve precision of AV PLL to 1 Hz
drivers/clk/imx/clk-pllv3.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--
2.7.4
^ permalink raw reply
* [PATCH v2 3/8] PM / Domains: Allow domain power states to be read from DT
From: Ulf Hansson @ 2016-10-10 10:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475879821-8035-4-git-send-email-lina.iyer@linaro.org>
On 8 October 2016 at 00:36, Lina Iyer <lina.iyer@linaro.org> wrote:
> This patch allows domains to define idle states in the DT. SoC's can
> define domain idle states in DT using the "domain-idle-states" property
> of the domain provider. Add API to read the idle states from DT that can
> be set in the genpd object.
>
> This patch is based on the original patch by Marc Titinger.
>
> Signed-off-by: Marc Titinger <mtitinger+renesas@baylibre.com>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
> ---
> drivers/base/power/domain.c | 95 +++++++++++++++++++++++++++++++++++++++++++++
> include/linux/pm_domain.h | 8 ++++
> 2 files changed, 103 insertions(+)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 4e87170..4208b67 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1917,6 +1917,101 @@ out:
> return ret ? -EPROBE_DEFER : 0;
> }
> EXPORT_SYMBOL_GPL(genpd_dev_pm_attach);
> +
> +static const struct of_device_id idle_state_match[] = {
> + { .compatible = "arm,idle-state", },
> + { }
> +};
> +
> +static int genpd_parse_state(struct genpd_power_state *genpd_state,
> + struct device_node *state_node)
> +{
> + int err;
> + u32 residency;
> + u32 entry_latency, exit_latency;
> + const struct of_device_id *match_id;
> +
> + match_id = of_match_node(idle_state_match, state_node);
> + if (!match_id)
> + return -EINVAL;
> +
> + err = of_property_read_u32(state_node, "entry-latency-us",
> + &entry_latency);
> + if (err) {
> + pr_debug(" * %s missing entry-latency-us property\n",
> + state_node->full_name);
> + return -EINVAL;
> + }
> +
> + err = of_property_read_u32(state_node, "exit-latency-us",
> + &exit_latency);
> + if (err) {
> + pr_debug(" * %s missing exit-latency-us property\n",
> + state_node->full_name);
> + return -EINVAL;
> + }
> +
> + err = of_property_read_u32(state_node, "min-residency-us", &residency);
> + if (!err)
> + genpd_state->residency_ns = 1000 * residency;
> +
> + genpd_state->power_on_latency_ns = 1000 * exit_latency;
> + genpd_state->power_off_latency_ns = 1000 * entry_latency;
> +
> + return 0;
> +}
> +
> +/**
> + * of_genpd_parse_idle_states: Return array of idle states for the genpd.
> + *
> + * @dn: The genpd device node
> + * @states: The pointer to which the state array will be saved.
> + * @n: The count of elements in the array returned from this function.
> + *
> + * Returns the device states parsed from the OF node. The memory for the states
> + * is allocated by this function and is the responsibility of the caller to
> + * free the memory after use.
> + */
> +int of_genpd_parse_idle_states(struct device_node *dn,
> + struct genpd_power_state **states, int *n)
Instead of taking **states as a parameter, let's instead return it as
a pointer for the allocated struct. In case of failures, let's return
ERR_PTR().
> +{
> + struct genpd_power_state *st;
> + struct device_node *np;
> + int i = 0;
> + int err, ret;
> + int count;
> + struct of_phandle_iterator it;
> +
> + count = of_count_phandle_with_args(dn, "domain-idle-states", NULL);
If count is zero or an error, we should return an error code (ERR_PTR()). Right?
> +
> + st = kcalloc(count, sizeof(*st), GFP_KERNEL);
> + if (!st)
> + return -ENOMEM;
> +
> + /* Loop over the phandles until all the requested entry is found */
> + of_for_each_phandle(&it, err, dn, "domain-idle-states", NULL, 0) {
> + np = of_node_get(it.node);
I don't think you need to increment the usage count for the device
node as that is already managed by of_for_each_phandle().
It's only in the error case below, when it's needed.
> + ret = genpd_parse_state(&st[i++], np);
> + if (ret) {
> + pr_err
> + ("Parsing idle state node %s failed with err %d\n",
> + np->full_name, ret);
> + of_node_put(np);
> + goto fail;
The goto seems unnecessary. Why not deal with all error handling here
and return the error code?
> + }
> + of_node_put(np);
According the comment above, you should be able to remove this.
> + }
> +
> + *n = count;
> + *states = st;
> +
> + return 0;
> +fail:
> + kfree(st);
> + return ret;
> +}
> +EXPORT_SYMBOL(of_genpd_parse_idle_states);
Please use EXPORT_SYMBOL_GPL() instead.
> +
> #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */
>
>
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index f4492eb..b489496 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -205,6 +205,8 @@ extern int of_genpd_add_device(struct of_phandle_args *args,
> extern int of_genpd_add_subdomain(struct of_phandle_args *parent,
> struct of_phandle_args *new_subdomain);
> extern struct generic_pm_domain *of_genpd_remove_last(struct device_node *np);
> +extern int of_genpd_parse_idle_states(struct device_node *dn,
> + struct genpd_power_state **states, int *n);
>
> int genpd_dev_pm_attach(struct device *dev);
> #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
> @@ -234,6 +236,12 @@ static inline int of_genpd_add_subdomain(struct of_phandle_args *parent,
> return -ENODEV;
> }
>
> +static inline int of_genpd_parse_idle_states(struct device_node *dn,
> + struct genpd_power_state **states, int *n)
> +{
> + return -ENODEV;
> +}
> +
> static inline int genpd_dev_pm_attach(struct device *dev)
> {
> return -ENODEV;
> --
> 2.7.4
>
Kind regards
Uffe
^ permalink raw reply
* [PATCH v1 1/2] ARM: dts: add rockchip PX3 Evaluation board
From: Heiko Stuebner @ 2016-10-10 9:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <64f4be31-1b19-60e3-da7c-f2fec186fab9@suse.de>
Hi Andreas, Andy,
Am Dienstag, 13. September 2016, 14:14:01 CEST schrieb Andreas F?rber:
> Hi Andy,
>
> This patch didn't make it to linux-rockchip list somehow...
> Not sure why I'm CC'ed, I don't have access to such a board to check, so
> just a couple formal nitpicks:
>
> Am 10.09.2016 um 19:44 schrieb Andy Yan:
> > PX3 EVB is designed by Rockchip for automotive field,
> > which intergrated with CVBS(TP2825)/MIPI DSI/LVDS/HDMI
>
> "integrated"
> but the grammar is somewhat incorrect with "which" referring to field -
> I assume you meant "with integrated CVBS..."?
>
> > video input/output interface, WIFI/BT/GPS(on a module
>
> Also please always leave a space before an opening parenthesis in
> English text. Similarly above, spaces around "/" would help recognize
> that MIPI DSI belongs together rather than being two lists.
>
> If nothing else applies below then maybe Heiko can edit it for you?
I've fixed the remarks in the commit description.
> > named S500 which based on MT6620), Gsensor BMA250E and
> > light&proximity sensor STK3410.
> >
> > Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> >
> > ---
> >
> > Changes in v1:
> > - board rename
> > - add vendor prefix for i2c interfaced sensors
> > - use stdout-path to set the default console
> >
> > Documentation/devicetree/bindings/arm/rockchip.txt | 4 +
> > arch/arm/boot/dts/Makefile | 1 +
> > arch/arm/boot/dts/rk3188-px3-evb.dts | 337
> > +++++++++++++++++++++ 3 files changed, 342 insertions(+)
> > create mode 100644 arch/arm/boot/dts/rk3188-px3-evb.dts
> >
> > diff --git a/Documentation/devicetree/bindings/arm/rockchip.txt
> > b/Documentation/devicetree/bindings/arm/rockchip.txt index
> > 6668645..6da3881 100644
> > --- a/Documentation/devicetree/bindings/arm/rockchip.txt
> > +++ b/Documentation/devicetree/bindings/arm/rockchip.txt
> > @@ -21,6 +21,10 @@ Rockchip platforms device tree bindings
> >
> > Required root node properties:
> > - compatible = "radxa,rock", "rockchip,rk3188";
> >
> > +- Rockchip PX3 Evaluation board:
> > + Required root node properties:
> > + - compatible = "rockchip,px3-evb", "rockchip,px3",
> > "rockchip,rk3188";
> How compatible is PX3 with RK3188? It is a separate SoC product:
>
> http://www.rock-chips.com/a/en/products/rkpower/2015/1125/730.html
>
> Wondering whether or not to drop the third compatible string.
As discussed in IRC (and with arm-soc maintainers), I intend to keep the
rk3188 part, as the chip really is just a (hardened?) variant of the consumer
rk3188, but shares the same internals with the original.
> > +
> >
> > - Radxa Rock2 Square board:
> > Required root node properties:
> > - compatible = "radxa,rock2-square", "rockchip,rk3288";
> >
> > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> > index faacd52..88d27a2 100644
> > --- a/arch/arm/boot/dts/Makefile
> > +++ b/arch/arm/boot/dts/Makefile
> > @@ -620,6 +620,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
> >
> > rk3066a-marsboard.dtb \
> > rk3066a-rayeager.dtb \
> > rk3188-radxarock.dtb \
> >
> > + rk3188-px3-evb.dtb \
>
> Affects file naming as well: px3-evb.dtb?
see above
>
> > rk3228-evb.dtb \
> > rk3229-evb.dtb \
> > rk3288-evb-act8846.dtb \
> >
> > diff --git a/arch/arm/boot/dts/rk3188-px3-evb.dts
> > b/arch/arm/boot/dts/rk3188-px3-evb.dts new file mode 100644
> > index 0000000..f6bc738
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/rk3188-px3-evb.dts
> > @@ -0,0 +1,337 @@
> > +/*
> > + * Copyright (c) 2016 Andy Yan <andy.yan@rock-chips.com>
> > + *
> > + * This file is dual-licensed: you can use it either under the terms
> > + * of the GPL or the X11 license, at your option. Note that this dual
> > + * licensing only applies to this file, and not this project as a
> > + * whole.
> > + *
> > + * a) This file 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; either version 2 of the
> > + * License, or (at your option) any later version.
> > + *
> > + * This file 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.
> > + *
> > + * Or, alternatively,
> > + *
> > + * b) Permission is hereby granted, free of charge, to any person
> > + * obtaining a copy of this software and associated documentation
> > + * files (the "Software"), to deal in the Software without
> > + * restriction, including without limitation the rights to use,
> > + * copy, modify, merge, publish, distribute, sublicense, and/or
> > + * sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following
> > + * conditions:
> > + *
> > + * The above copyright notice and this permission notice shall be
> > + * included in all copies or substantial portions of the Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > + * OTHER DEALINGS IN THE SOFTWARE.
> > + */
> > +
> > +/dts-v1/;
> > +#include <dt-bindings/input/input.h>
> > +#include "rk3188.dtsi"
>
> I'm surprised there is no [rk3188-]px3.dtsi here! Surely some automotive
> vendor may design their own board with it and should have at least the
> two trailing compatible strings pre-set.
see above. I don't think there is a need to pollute the directory with
(nearly) empty dtsi files, especially as the compatible will get overwritten by
a board compatible anyway.
>
> > +
> > +/ {
> > + model = "Rockchip PX3-EVB";
> > + compatible = "rockchip,px3-evb", "rockchip,px3", "rockchip,rk3188";
> > +
> > + chosen {
> > + stdout-path = "serial2:115200n8";
> > + };
> > +
> > + memory {
> > + device_type = "memory";
> > + reg = <0x60000000 0x80000000>;
> > + };
> > +
> > + gpio-keys {
> > + compatible = "gpio-keys";
> > + autorepeat;
> > +
> > + power {
> > + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
> > + linux,code = <KEY_POWER>;
> > + label = "GPIO Key Power";
> > + linux,input-type = <1>;
> > + wakeup-source;
> > + debounce-interval = <100>;
> > + };
> > + };
> > +
> > + vcc_sys: vsys-regulator {
> > + compatible = "regulator-fixed";
> > + regulator-name = "vsys";
> > + regulator-min-microvolt = <5000000>;
> > + regulator-max-microvolt = <5000000>;
> > + regulator-boot-on;
> > + };
> > +};
> > +
> > +&cpu0 {
> > + cpu0-supply = <&vdd_cpu>;
> > +};
> > +
> > +&i2c0 {
> > + status = "okay";
> > +
> > + /* Accelerometer */
>
> Space after tab intentional?
>
> > + bma250 at 18 {
> > + compatible = "bosch,bma250";
> > + reg = <0x18>;
> > + interrupt-parent = <&gpio0>;
> > + interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
> > + };
> > +
> > + stk3410 at 48 {
> > + compatible = "sensortek,STK3310";
> > + reg = <0x48>;
> > + interrupt-parent = <&gpio1>;
> > + interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
> > + };
>
> Generally it is undesired to repeat the compatible name as node name -
> did you compare other .dts files? (e.g., accelerometer at 18 would be
> self-documenting) If this is a copy from an existing .dts then please
> ignore this comment.
due to the compatible ambiguity, I had dropped the stk3410 node anyway.
I've also checked how the bma250 gets specified and there are both variants in
use (accelerometer@ and bmc250@). So to set a good example for the future,
I've changed the node name to accelerometer at 18 and dropped the now self
explanatory comment obove it.
>
> > +};
> > +
> > +&i2c1 {
> > + status = "okay";
> > + clock-frequency = <400000>;
>
> Insert white line?
done
Heiko
^ permalink raw reply
* [PATCH] Reorganize STM32 clocks in order to prepare them for PLLI2S and PLLSAI
From: Daniel Thompson @ 2016-10-10 9:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475791294-5804-1-git-send-email-user@localhost>
On 06/10/16 23:01, radek wrote:
> From: Radoslaw Pietrzyk <radoslaw.pietrzyk@gmail.com>
>
> Signed-off-by: Radoslaw Pietrzyk <radoslaw.pietrzyk@gmail.com>
> ---
> drivers/clk/clk-stm32f4.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c
> index 02d6810..1fd3eac 100644
> --- a/drivers/clk/clk-stm32f4.c
> +++ b/drivers/clk/clk-stm32f4.c
> @@ -245,9 +245,10 @@ static void stm32f4_rcc_register_pll(const char *hse_clk, const char *hsi_clk)
> const char *pllsrc = pllcfgr & BIT(22) ? hse_clk : hsi_clk;
> unsigned long pllq = (pllcfgr >> 24) & 0xf;
>
> - clk_register_fixed_factor(NULL, "vco", pllsrc, 0, plln, pllm);
> - clk_register_fixed_factor(NULL, "pll", "vco", 0, 1, pllp);
> - clk_register_fixed_factor(NULL, "pll48", "vco", 0, 1, pllq);
> + clk_register_fixed_factor(NULL, "vco-div", pllsrc, 0, 1, pllm);
> + clk_register_fixed_factor(NULL, "vco-mul", "vco-div", 0, plln, 1);
> + clk_register_fixed_factor(NULL, "pll", "vco-mul", 0, 1, pllp);
> + clk_register_fixed_factor(NULL, "pll48", "vco-mul", 0, 1, pllq);
I'm struggling to marry this up to the clock tree diagram for the
F4-series (and there's no patch description to help me).
I can see the value of naming the "/M" pre-division separately (and
agree that its hard to find it a good name for this clock in the
datasheet). However I am struggling to work out why we'd want to rename
the vco output.
For me the names for the multiplies clock within each pll emerges fairly
cleanly from the datasheet (PLL -> vco, PLLI2S -> vcoi2s, PLLSAI ->
vcosai). What does the '-mul' add?
Daniel.
^ permalink raw reply
* [PATCH v5 2/5] drm/bridge: Add RGB to VGA bridge support
From: Archit Taneja @ 2016-10-10 9:34 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <2147837.toaTVtNybe@avalon>
On 10/10/2016 12:45 PM, Laurent Pinchart wrote:
> Hi Archit,
>
> On Monday 10 Oct 2016 11:05:10 Archit Taneja wrote:
>> On 10/07/2016 02:44 PM, Maxime Ripard wrote:
>>> On Fri, Oct 07, 2016 at 10:27:31AM +0530, Archit Taneja wrote:
>
> [snip]
>
>>>> If no one has any more objections within the next day, I'll pull in
>>>> Maxime's v5 RGB to VGA bridge driver, and change the compatible to
>>>> "dumb-vga-dac".
>>>
>>> That works for me. You'll probably want to update the Kconfig and file
>>> name to match though.
>>
>> Queued to drm-misc, with the changes suggested by you and Laurent.
>
> Those changes would have been worth a repost. I've had a look at the patch
> you've committed and it looks OK to me, so no harm done (the commit message is
> a bit inaccurate, but it's not the end of the world). Could you please make
> sure you repost patches in the future when you change them in non-trivial ways
> ?
Sorry about that. Will repost from now onwards if the changes are too
significant.
Archit
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply
* [PATCH] arm64: defconfig: enable EEPROM_AT25 config option
From: Arnd Bergmann @ 2016-10-10 9:20 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <a61b2b9d-356f-f24b-914b-0fb0e2bcdcc6@gmail.com>
On Monday, October 10, 2016 2:08:05 AM CEST Florian Fainelli wrote:
> On 10/07/2016 02:23 PM, Scott Branden wrote:
> > Enable support for on board SPI EEPROM by turning on
> > CONFIG_EEPROM_AT25.
> >
> > Signed-off-by: Scott Branden <scott.branden@broadcom.com>
>
> Looks fine to me, unless this needs to be a module, Arnd, what do you think?
Please either make it a module or explain in the patch description
why it should be built-in.
Arnd
^ permalink raw reply
* [PATCH v3 07/12] scsi/ncr5380: Store IO ports and addresses in host private data
From: Russell King - ARM Linux @ 2016-10-10 9:19 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <5c9f6b4913bc8bc4938d2de0bb19d4289226ec26.1476051962.git.fthain@telegraphics.com.au>
On Mon, Oct 10, 2016 at 12:46:53AM -0400, Finn Thain wrote:
> The various 5380 drivers inconsistently store register pointers
> either in the Scsi_Host struct "legacy crap" area or in special,
> board-specific members of the NCR5380_hostdata struct. Uniform
> use of the latter struct makes for simpler and faster code (see
> the following patches) and helps to reduce use of the
> NCR5380_implementation_fields macro.
>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Tested-by: Ondrej Zary <linux@rainbow-software.org>
> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
> ---
> drivers/scsi/arm/cumana_1.c | 60 ++++++++++++++++++++--------------------
> drivers/scsi/arm/oak.c | 23 ++++++++--------
For these two,
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply
* [PATCH v3 10/12] scsi/ncr5380: Expedite register polling
From: Russell King - ARM Linux @ 2016-10-10 9:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <2806ba151f6983923fa0aae700245dfeb4cfaf38.1476051962.git.fthain@telegraphics.com.au>
On Mon, Oct 10, 2016 at 12:46:53AM -0400, Finn Thain wrote:
> Avoid the call to NCR5380_poll_politely2() when possible. The call is
> easily short-circuited on the PIO fast path, using the inline wrapper.
> This requires that the NCR5380_read macro be made available before
> any #include "NCR5380.h" so a few declarations have to be moved too.
>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Tested-by: Ondrej Zary <linux@rainbow-software.org>
> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
> ---
> diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
> index ae1d4c6..fb7600d 100644
> --- a/drivers/scsi/arm/cumana_1.c
> +++ b/drivers/scsi/arm/cumana_1.c
> @@ -29,6 +29,10 @@
> #define NCR5380_implementation_fields \
> unsigned ctrl
>
> +struct NCR5380_hostdata;
> +static u8 cumanascsi_read(struct NCR5380_hostdata *, unsigned int);
> +static void cumanascsi_write(struct NCR5380_hostdata *, unsigned int, u8);
> +
> #include "../NCR5380.h"
>
> #define CTRL 0x16fc
This seems to be non-obviously unrelated to this commit - should it be in
some other commit?
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply
* [PATCH v3 11/12] scsi/ncr5380: Use correct types for DMA routines
From: Russell King - ARM Linux @ 2016-10-10 9:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <8390541e30d7b7cd418a7b5095fdb4b5fc7aa0ed.1476051962.git.fthain@telegraphics.com.au>
On Mon, Oct 10, 2016 at 12:46:53AM -0400, Finn Thain wrote:
> Apply prototypes to get consistent function signatures for the DMA
> functions implemented in the board-specific drivers. To avoid using
> macros to alter actual parameters, some of those functions are reworked
> slightly.
>
> This is a step toward the goal of passing the board-specific routines
> to the core driver using an ops struct (as in a platform driver or
> library module).
>
> This also helps fix some inconsistent types: where the core driver uses
> ints (cmd->SCp.this_residual and hostdata->dma_len) for keeping track of
> transfers, certain board-specific routines used unsigned long.
>
> While we are fixing these function signatures, pass the hostdata pointer
> to DMA routines instead of a Scsi_Host pointer, for shorter and faster
> code.
>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Tested-by: Ondrej Zary <linux@rainbow-software.org>
> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
> ---
> drivers/scsi/arm/cumana_1.c | 26 ++++++++++------
> drivers/scsi/arm/oak.c | 13 ++++----
For these two,
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Thanks.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply
* [PATCH v3] arm64: mm: move zero page from .bss to right before swapper_pg_dir
From: Ard Biesheuvel @ 2016-10-10 9:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161009231017.GA11582@remoulade>
On 10 October 2016 at 00:10, Mark Rutland <mark.rutland@arm.com> wrote:
> On Fri, Oct 07, 2016 at 10:31:14AM +0100, Ard Biesheuvel wrote:
>> On 12 September 2016 at 17:15, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> > Move the statically allocated zero page from the .bss section to right
>> > before swapper_pg_dir. This allows us to refer to its physical address
>> > by simply reading TTBR1_EL1 (which always points to swapper_pg_dir and
>> > always has its ASID field cleared), and subtracting PAGE_SIZE.
>> >
>> > To protect the zero page from inadvertent modification, carve out a
>> > segment that covers it as well as idmap_pg_dir[], and mark it read-only
>> > in both the primary and the linear mappings of the kernel.
>
> [...]
>
>> > - map_kernel_segment(pgd, _data, _end, PAGE_KERNEL, &vmlinux_data);
>> > + map_kernel_segment(pgd, _data, __robss_start, PAGE_KERNEL,
>> > + &vmlinux_data);
>> > + map_kernel_segment(pgd, __robss_start, __robss_end, PAGE_KERNEL_RO,
>> > + &vmlinux_robss);
>>
>> I realised it is actually unnecessary to map the idmap and the zero
>> page into the kernel mapping, so we could drop this line.
>
> Given that drivers use the zero page, I wouldn't be entirely surprised to see
> phys_to_virt(virt_to_phys(zero_page)) happen indirectly, and the end result
> read. Are we sure that doesn't happen anywhere?
>
That conversion would actually still work, it would be the direct
reference that is left unmapped. But given that it is mapped R/O
anyway (which is the whole point of the patch), it makes more sense to
follow the principle of least surprise, and make the direct symbol
dereference work as expected.
> For the idmap, I think we might walk that were we to take a fault (though
> perhaps we don't). Otherwise, unless we add a sysfs walker for it I guess we
> don't strictly need it in the linear map.
>
Likewise, this is the kernel mapping not the linear mapping. But given
how little this matters, please forget I said anything :-)
^ permalink raw reply
* [PATCH v3 08/12] scsi/ncr5380: Use correct types for device register accessors
From: Russell King - ARM Linux @ 2016-10-10 9:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <7f9f43fa2d3ba08a3277b749ea38acad3c8e8337.1476051962.git.fthain@telegraphics.com.au>
On Mon, Oct 10, 2016 at 12:46:53AM -0400, Finn Thain wrote:
> For timeout values adopt unsigned long, which is the type of jiffies etc.
>
> For chip register values and bit masks pass u8, which is the return type
> of readb, inb etc.
>
> For device register offsets adopt unsigned int, as it is suitable for
> adding to base addresses.
>
> Pass the NCR5380_hostdata pointer to the board-specific routines instead
> of the Scsi_Host pointer. The board-specific code is concerned with
> hardware and not with SCSI protocol or the mid-layer.
>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Tested-by: Ondrej Zary <linux@rainbow-software.org>
> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
> ---
> drivers/scsi/arm/cumana_1.c | 20 +++++++++++---------
> drivers/scsi/arm/oak.c | 6 ++----
For these two:
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Thanks.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply
* camera on n900, v4.8
From: Pavel Machek @ 2016-10-10 9:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161010084859.GD4467@pali>
On Mon 2016-10-10 10:48:59, Pali Roh?r wrote:
> On Wednesday 05 October 2016 21:03:41 Pavel Machek wrote:
> > Hi!
> >
> > Camera has some non-trivial dependencies on N900; it seems to rely on
> > gpio-switch.c, for example. I'll try to strip the diff further, but in
> > the meantime, here's the version I'm working with.
> >
>
> With "Camera" do you mean some Maemo userspace application? Because I
> think that nobody else could depends on gpio-switch kernel driver.
With camera, I mean kernel drivers for /dev/video*. I don't know why
they depend on gpio-switch.c, but they do.
I'm using fcam-dev for userspace control of camera. I'd prefer not to
touch anything w/o sources.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161010/1f4c86e0/attachment.sig>
^ permalink raw reply
* [PATCH v3 02/12] scsi/cumana_1: Remove unused cumanascsi_setup() function
From: Russell King - ARM Linux @ 2016-10-10 9:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <0e4fe7993945cd855f230f95bc0d7410dd5a9baa.1476051962.git.fthain@telegraphics.com.au>
On Mon, Oct 10, 2016 at 12:46:52AM -0400, Finn Thain wrote:
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
Thanks.
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply
* [PATCH] ARM: dts: rockchip: Reserve unusable memory region on rk3066
From: Paweł Jarosz @ 2016-10-10 9:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <67831fd0-76af-a793-0b2f-958e45633fe8@rock-chips.com>
Hi
W dniu 10.10.2016 o 09:18, Huang, Tao pisze:
> Our IC guy need us tell them which master can not access such area, DMA
> or EMMC Controller or GPU, etc? Could you tell me how to reproduce such
> issue?
> And we can confirm CPU core can access this memory through /dev/mem and
> the test board is 1GB too. Personally, I don't think RK3066 has such
> limit because when we verify this chip, we don't found such limit at all.
>
> Thanks,
> Huang, Tao
I'm getting this on Ubuntu 16.04 with mainline kernel.
My board always freezes when i type: "memtester 800M"
^ permalink raw reply
* [PATCH] arm64: defconfig: enable EEPROM_AT25 config option
From: Florian Fainelli @ 2016-10-10 9:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475875432-13627-1-git-send-email-scott.branden@broadcom.com>
On 10/07/2016 02:23 PM, Scott Branden wrote:
> Enable support for on board SPI EEPROM by turning on
> CONFIG_EEPROM_AT25.
>
> Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Looks fine to me, unless this needs to be a module, Arnd, what do you think?
> ---
> arch/arm64/configs/defconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index eadf485..9955ee1 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -136,6 +136,7 @@ CONFIG_MTD_SPI_NOR=y
> CONFIG_BLK_DEV_LOOP=y
> CONFIG_BLK_DEV_NBD=m
> CONFIG_VIRTIO_BLK=y
> +CONFIG_EEPROM_AT25=y
> CONFIG_SRAM=y
> # CONFIG_SCSI_PROC_FS is not set
> CONFIG_BLK_DEV_SD=y
>
--
Florian
^ permalink raw reply
* [PATCH] ARM: dts: fix naming of pinctrl node
From: Florian Fainelli @ 2016-10-10 9:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <6039a5f9-2b36-c427-2f8a-addf76cf1c26@broadcom.com>
On 10/08/2016 02:03 PM, Ray Jui wrote:
>
>
> On 10/8/2016 1:34 PM, Scott Branden wrote:
>> Remove 0x from pinctrl node to match device tree naming convention.
>>
>> Signed-off-by: Scott Branden <scott.branden@broadcom.com>
>> ---
>> arch/arm/boot/dts/bcm-cygnus.dtsi | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi
>> b/arch/arm/boot/dts/bcm-cygnus.dtsi
>> index fabc9f3..539c58f 100644
>> --- a/arch/arm/boot/dts/bcm-cygnus.dtsi
>> +++ b/arch/arm/boot/dts/bcm-cygnus.dtsi
>> @@ -108,7 +108,7 @@
>> };
>> };
>>
>> - pinctrl: pinctrl at 0x0301d0c8 {
>> + pinctrl: pinctrl at 0301d0c8 {
>> compatible = "brcm,cygnus-pinmux";
>> reg = <0x0301d0c8 0x30>,
>> <0x0301d24c 0x2c>;
>>
>
> Looks good to me!
>
> Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Applied, thanks!
--
Florian
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox