Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/5] ARM: dts: exynos: add support for ISP power domain to exynos4x12 clocks device
From: Ulf Hansson @ 2016-09-15 14:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <6e52af56-8b0e-d8c4-62c2-6efeee0e912d@samsung.com>

[...]

>>> I see some serious design problems with multiple entries in power domains
>>> property. First how to show that some part of the device IS NOT in
>>> any domain?
>>
>> Is that even possible? Every device should be in some power
>> domain, even if it's just an "always on" power domain that we
>> don't really control from software.
>
>
> Right now none dts of which I'm aware of doesn't define the power domain for
> the parts of the SoC, which are always on and doesn't need any additional
> management.

Actually there's is one reason for doing this, as it would allow
devices to be monitored for device PM QoS constraints by the genpd
governor.

Although, I doubt's someone actually does it because of this benefit,
at least yet.

[...]

Kind regards
Uffe

^ permalink raw reply

* [PATCH V3 2/4] ARM64 LPC: LPC driver implementation on Hip06
From: Gabriele Paoloni @ 2016-09-15 14:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <26171742.fWcrANu6EP@wuerfel>

> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd at arndb.de]
> Sent: 15 September 2016 13:25
> To: linux-arm-kernel at lists.infradead.org
> Cc: Gabriele Paoloni; devicetree at vger.kernel.org;
> lorenzo.pieralisi at arm.com; minyard at acm.org; linux-pci at vger.kernel.org;
> gregkh at linuxfoundation.org; John Garry; will.deacon at arm.com; linux-
> kernel at vger.kernel.org; Yuanzhichang; Linuxarm; xuwei (O); linux-
> serial at vger.kernel.org; benh at kernel.crashing.org;
> zourongrong at gmail.com; liviu.dudau at arm.com; kantyzc at 163.com;
> zhichang.yuan02 at gmail.com
> Subject: Re: [PATCH V3 2/4] ARM64 LPC: LPC driver implementation on
> Hip06
> 
> On Thursday, September 15, 2016 12:05:51 PM CEST Gabriele Paoloni
> wrote:
> > > -----Original Message-----
> > > On Thursday, September 15, 2016 8:02:27 AM CEST Gabriele Paoloni
> wrote:
> > > >
> > > > From <<3.1.1. Open Firmware Properties for Bus Nodes>> in
> > > > http://www.firmware.org/1275/bindings/isa/isa0_4d.ps
> > > >
> > > > I quote:
> > > > "There shall be an entry in the "ranges" property for each
> > > > of the Memory and/or I/O spaces if that address space is
> > > > mapped through the bridge."
> > > >
> > > > It seems to me that it is ok to have 1:1 address mapping and that
> > > > therefore of_translate_address() should fail if "ranges" is not
> > > > present.
> > >
> > > The key here is the definition of "mapped through the bridge".
> > > I can only understand this as "directly mapped", i.e. an I/O
> > > port of the child bus corresponds directly to a memory address
> > > on the parent bus, but this is not the case here.
> > >
> > > The problem with adding the mapping here is that it looks
> > > like it should be valid to create a page table entry for
> > > the address returned from the translation and access it through
> > > a pointer dereference, but that is clearly not possible.
> >
> > I understand that somehow we are abusing of the ranges property
> > here however the point is that with the current implementation ranges
> > is needed because otherwise the ipmi driver probe will fail here:
> >
> > of_ipmi_probe -> of_address_to_resource -> __of_address_to_resource
> > -> of_translate_address -> __of_translate_address
> >
> > Now we had a bit of discussion internally and to avoid
> > having ranges we came up with two possible solutions:
> >
> > 1) Using bit 3 of phys.hi cell in 2.2.1 of
> > http://www.firmware.org/1275/bindings/isa/isa0_4d.ps
> > This would mean reworking of_bus_isa_get_flags in
> > http://lxr.free-electrons.com/source/drivers/of/address.c#L398
> > and setting a new flag to be checked in __of_address_to_resource
> >
> > 2) Adding a property in the bindings of each device that is
> > a child of our LPC bus and modify __of_address_to_resource
> > to check if the property is in the DT and eventually bypass
> > of_translate_address
> >
> > However in both 1) and 2) there are some issues:
> > in 1) we are not complying with the isa binding doc (we use
> > a bit that should be zero); in 2) we need to modify the
> > bindings documentation of the devices that are connected
> > to our LPC controller (therefore modifying other devices
> > bindings to fit our special case).
> >
> > I think that maybe having the 1:1 range mapping doesn't
> > reflect well the reality but it is the less painful
> > solution...
> >
> > What's your view?
> 
> We can check the 'i' bit for I/O space in of_bus_isa_get_flags,
> and that should be enough to translate the I/O port number.
> 
> The only part we need to change here is to not go through
> the crazy conversion all the way from PCI I/O space to a
> physical address and back to a (logical) port number
> that we do today with of_translate_address/pci_address_to_pio.
> 
> I can think of a several of ways to fix __of_address_to_resource
> to just do the right thing according to the ISA binding to
> make the normal drivers work.
> 
> The easiest solution is probably to hook into the
> "taddr == OF_BAD_ADDR" case in __of_address_to_resource
> and add a lookup for ISA buses there, and instead check
> if some special I/O port operations were registered
> for the port number, using an architecture specific
> function that arm64 implements. Other architectures
> like x86 that don't have a direct mapping between I/O
> ports and MMIO addresses would implement that same
> function differently.

So with respect to this patchset once we enter the
"taddr == OF_BAD_ADDR" case you would add an arch
specific function that checks if the resource is an I/O 
resource, if the parent node is an ISA bus (calling 
of_bus_isa_match) and if arm64_extio_ops is non NULL. 
 
I think it can work for us and it doesn't affect current
devices. I will talk to Zhichang about this for the next
patchset version.

Many Thanks for your ideas

Gab


> 
> 	Arnd

^ permalink raw reply

* [PATCH] ARM: multi_v7_defconfig: enable CONFIG_EFI
From: Ard Biesheuvel @ 2016-09-15 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

This enables CONFIG_EFI for multi_v7_defconfig, which adds support for
booting via EFI, and for the EFI framebuffer as builtin options. It
also enables the EFI rtc, the EFI variable pseudo-filesystem and the
EFI capsule loader as modules.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---

We have been happily booting multi_v7_defconfig+CONFIG_EFI=y kernels on
kernelci for months now, so please consider enabling this by default.
The increase in compressed kernel footprint is ~30 KB, for the uncompressed
kernel it's ~10 KB, some of which is .init code.

 arch/arm/configs/multi_v7_defconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 2c8665cd9dc5..f30e8b44ea0d 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -129,6 +129,7 @@ CONFIG_CMA=y
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_KEXEC=y
+CONFIG_EFI=y
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_STAT_DETAILS=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
@@ -593,6 +594,7 @@ CONFIG_DRM_PANEL_SIMPLE=y
 CONFIG_DRM_STI=m
 CONFIG_DRM_VC4=y
 CONFIG_FB_ARMCLCD=y
+CONFIG_FB_EFI=y
 CONFIG_FB_WM8505=y
 CONFIG_FB_SH_MOBILE_LCDC=y
 CONFIG_FB_SIMPLE=y
@@ -750,6 +752,7 @@ CONFIG_RTC_DRV_S35390A=m
 CONFIG_RTC_DRV_RX8581=m
 CONFIG_RTC_DRV_EM3027=y
 CONFIG_RTC_DRV_DA9063=m
+CONFIG_RTC_DRV_EFI=m
 CONFIG_RTC_DRV_DIGICOLOR=m
 CONFIG_RTC_DRV_S5M=m
 CONFIG_RTC_DRV_S3C=m
@@ -867,6 +870,8 @@ CONFIG_NVMEM=y
 CONFIG_NVMEM_SUNXI_SID=y
 CONFIG_BCM2835_MBOX=y
 CONFIG_RASPBERRYPI_FIRMWARE=y
+CONFIG_EFI_VARS=m
+CONFIG_EFI_CAPSULE_LOADER=m
 CONFIG_EXT4_FS=y
 CONFIG_AUTOFS4_FS=y
 CONFIG_MSDOS_FS=y
-- 
2.7.4

^ permalink raw reply related

* [PATCH v2 6/8] ARM: dts: sun9i: a80-optimus: Add AXP806 PMIC device node and regulators
From: Chen-Yu Tsai @ 2016-09-15 14:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160827075544.26316-7-wens@csie.org>

Hi Maxime,

On Sat, Aug 27, 2016 at 3:55 PM, Chen-Yu Tsai <wens@csie.org> wrote:
> The AXP806 PMIC is the secondary PMIC. It provides various supply
> voltages for the SoC and other peripherals. The PMIC's interrupt
> line is connected to NMI pin of the SoC.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

The driver patches have all been merged into the mfd tree. Could
you queue up the dts patches?

Thanks
ChenYu

^ permalink raw reply

* [PATCH v3 0/3] ASoC: sun4i-codec: Distinguish sun4i from sun7i
From: Danny Milosavljevic @ 2016-09-15 14:39 UTC (permalink / raw)
  To: linux-arm-kernel

Introduce mechanism to detect sun7i and provide a different regmap different compared to sun4i Allwinner A10.
 
The controls will be extended in a forthcoming patch - it is necessary to
distinguish between sun4i and sun7i controls because they have different registers.
 
Renamed SUN4I_CODEC_AC_SYS_VERI to SUN7I_CODEC_AC_DAC_CAL and renamed
SUN4I_CODEC_AC_MIC_PHONE_CAL to SUN7I_CODEC_AC_MIC_PHONE_CAL because these
are actually not present on Allwinner A10.

Handle quirks by regmap config and codec and select the correct quirks
automatically.  

Danny Milosavljevic (3):
  ASoC: sun4i-codec: rename "sun4i_codec_widgets" to
    "sun4i_codec_controls" for consistency with the struct field name.
  ASoC: rename "SUN4I_CODEC_SYS_VERI" to "SUN7I_CODEC_AC_DAC_CAL";
    rename "SUN4I_CODEC_AC_MIC_PHONE_CAL" to
    "SUN7I_CODEC_AC_MIC_PHONE_CAL".
  ASoC: sun4i-codec: Add custom regmap configs for the A10 and A20
    variants.

 sound/soc/sunxi/sun4i-codec.c | 45 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 36 insertions(+), 9 deletions(-)

^ permalink raw reply

* [PATCH v3 1/3] ASoC: sun4i-codec: rename "sun4i_codec_widgets" to "sun4i_codec_controls" for consistency with the struct field name.
From: Danny Milosavljevic @ 2016-09-15 14:39 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915143922.4890-1-dannym@scratchpost.org>

ASoC: sun4i-codec: rename "sun4i_codec_widgets" to "sun4i_codec_controls" for
consistency with the struct field name.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
---
 sound/soc/sunxi/sun4i-codec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 0e19c50..c2c0583 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -509,7 +509,7 @@ static const struct snd_kcontrol_new sun4i_codec_pa_mute =
 
 static DECLARE_TLV_DB_SCALE(sun4i_codec_pa_volume_scale, -6300, 100, 1);
 
-static const struct snd_kcontrol_new sun4i_codec_widgets[] = {
+static const struct snd_kcontrol_new sun4i_codec_controls[] = {
 	SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL,
 		       SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0,
 		       sun4i_codec_pa_volume_scale),
@@ -629,8 +629,8 @@ static const struct snd_soc_dapm_route sun4i_codec_codec_dapm_routes[] = {
 
 static struct snd_soc_codec_driver sun4i_codec_codec = {
 	.component_driver = {
-		.controls		= sun4i_codec_widgets,
-		.num_controls		= ARRAY_SIZE(sun4i_codec_widgets),
+		.controls		= sun4i_codec_controls,
+		.num_controls		= ARRAY_SIZE(sun4i_codec_controls),
 		.dapm_widgets		= sun4i_codec_codec_dapm_widgets,
 		.num_dapm_widgets	= ARRAY_SIZE(sun4i_codec_codec_dapm_widgets),
 		.dapm_routes		= sun4i_codec_codec_dapm_routes,

^ permalink raw reply related

* [PATCH v3 2/3] ASoC: rename "SUN4I_CODEC_SYS_VERI" to "SUN7I_CODEC_AC_DAC_CAL"; rename "SUN4I_CODEC_AC_MIC_PHONE_CAL" to "SUN7I_CODEC_AC_MIC_PHONE_CAL".
From: Danny Milosavljevic @ 2016-09-15 14:39 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915143922.4890-1-dannym@scratchpost.org>

This patch renames some sun7i-only registers to reflect that fact.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
---
 sound/soc/sunxi/sun4i-codec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index c2c0583..3b53b78 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -96,8 +96,8 @@
 /* Other various ADC registers */
 #define SUN4I_CODEC_DAC_TXCNT			(0x30)
 #define SUN4I_CODEC_ADC_RXCNT			(0x34)
-#define SUN4I_CODEC_AC_SYS_VERI			(0x38)
-#define SUN4I_CODEC_AC_MIC_PHONE_CAL		(0x3c)
+#define SUN7I_CODEC_AC_DAC_CAL			(0x38)
+#define SUN7I_CODEC_AC_MIC_PHONE_CAL		(0x3c)
 
 struct sun4i_codec {
 	struct device	*dev;
@@ -682,7 +682,7 @@ static const struct regmap_config sun4i_codec_regmap_config = {
 	.reg_bits	= 32,
 	.reg_stride	= 4,
 	.val_bits	= 32,
-	.max_register	= SUN4I_CODEC_AC_MIC_PHONE_CAL,
+	.max_register	= SUN7I_CODEC_AC_MIC_PHONE_CAL,
 };
 
 static const struct of_device_id sun4i_codec_of_match[] = {

^ permalink raw reply related

* [PATCH v3 3/3] ASoC: sun4i-codec: Add custom regmap configs for the A10 and A20 variants.
From: Danny Milosavljevic @ 2016-09-15 14:39 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915143922.4890-1-dannym@scratchpost.org>

ASoC: sun4i-codec: Add custom regmap configs for the A10 and A20 variants.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
---
 sound/soc/sunxi/sun4i-codec.c | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 3b53b78..c5d6d84c 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -682,12 +682,37 @@ static const struct regmap_config sun4i_codec_regmap_config = {
 	.reg_bits	= 32,
 	.reg_stride	= 4,
 	.val_bits	= 32,
+	.max_register	= SUN4I_CODEC_ADC_RXCNT,
+};
+
+static const struct regmap_config sun7i_codec_regmap_config = {
+	.reg_bits	= 32,
+	.reg_stride	= 4,
+	.val_bits	= 32,
 	.max_register	= SUN7I_CODEC_AC_MIC_PHONE_CAL,
 };
 
+struct sun4i_codec_quirks {
+	const struct regmap_config *regmap_config;
+};
+
+static const struct sun4i_codec_quirks sun4i_codec_quirks = {
+	.regmap_config = &sun4i_codec_regmap_config,
+};
+
+static const struct sun4i_codec_quirks sun7i_codec_quirks = {
+	.regmap_config = &sun7i_codec_regmap_config,
+};
+
 static const struct of_device_id sun4i_codec_of_match[] = {
-	{ .compatible = "allwinner,sun4i-a10-codec" },
-	{ .compatible = "allwinner,sun7i-a20-codec" },
+	{
+		.compatible = "allwinner,sun4i-a10-codec",
+		.data = &sun4i_codec_quirks,
+	},
+	{
+		.compatible = "allwinner,sun7i-a20-codec",
+		.data = &sun7i_codec_quirks,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, sun4i_codec_of_match);
@@ -760,6 +785,7 @@ static int sun4i_codec_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card;
 	struct sun4i_codec *scodec;
+	const struct sun4i_codec_quirks *quirks;
 	struct resource *res;
 	void __iomem *base;
 	int ret;
@@ -777,8 +803,9 @@ static int sun4i_codec_probe(struct platform_device *pdev)
 		return PTR_ERR(base);
 	}
 
+	quirks = of_device_get_match_data(&pdev->dev);
 	scodec->regmap = devm_regmap_init_mmio(&pdev->dev, base,
-					     &sun4i_codec_regmap_config);
+					       quirks->regmap_config);
 	if (IS_ERR(scodec->regmap)) {
 		dev_err(&pdev->dev, "Failed to create our regmap\n");
 		return PTR_ERR(scodec->regmap);

^ permalink raw reply related

* [PATCH] soc: rockchip: power-domain: Handle errors from of_genpd_add_provider_onecell
From: Heiko Stübner @ 2016-09-15 14:39 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1473936221-9248-1-git-send-email-tomeu.vizoso@collabora.com>

Am Donnerstag, 15. September 2016, 12:43:41 schrieb Tomeu Vizoso:
> It was a bit surprising that the device was reported to have probed just
> fine, but the provider hadn't been registered.
> 
> So handle any errors when registering the provider and fail the probe
> accordingly.
> 
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Cc: Caesar Wang <wxt@rock-chips.com>
> ---
>  drivers/soc/rockchip/pm_domains.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/rockchip/pm_domains.c
> b/drivers/soc/rockchip/pm_domains.c index 7acd1517dd37..57e920128cb2 100644
> --- a/drivers/soc/rockchip/pm_domains.c
> +++ b/drivers/soc/rockchip/pm_domains.c
> @@ -627,7 +627,11 @@ static int rockchip_pm_domain_probe(struct
> platform_device *pdev) goto err_out;
>  	}
> 
> -	of_genpd_add_provider_onecell(np, &pmu->genpd_data);
> +	error = of_genpd_add_provider_onecell(np, &pmu->genpd_data);
> +	if (error) {
> +		dev_err(dev, "failed to add provider: %d\n", error);
> +		goto err_out;
> +	}
> 
>  	return 0;

Looks good in itself, but seems to trigger some issue in the genpd code
when applied alone on top of linux-next-20160915. Looks like genpd
is missing counter-initialization somewhere, as I'm seeing now:

[    1.664744] genpd_poweroff_unused disabling (null)
[    1.669553] ------------[ cut here ]------------
[    1.674169] WARNING: CPU: 0 PID: 1 at ../kernel/workqueue.c:1440 __queue_work+0x2b8/0x3f8
[    1.682337] Modules linked in:
[    1.685401] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc6-next-20160915-00001-g7432710-dirty #5
[    1.694608] Hardware name: Rockchip (Device Tree)
[    1.699312] [<c0310388>] (unwind_backtrace) from [<c030ba04>] (show_stack+0x10/0x14)
[    1.707050] [<c030ba04>] (show_stack) from [<c0599c90>] (dump_stack+0x90/0xa4)
[    1.714267] [<c0599c90>] (dump_stack) from [<c0341bc0>] (__warn+0xe8/0x100)
[    1.721221] [<c0341bc0>] (__warn) from [<c0341c88>] (warn_slowpath_null+0x20/0x28)
[    1.728785] [<c0341c88>] (warn_slowpath_null) from [<c0355b28>] (__queue_work+0x2b8/0x3f8)
[    1.737041] [<c0355b28>] (__queue_work) from [<c0355ca8>] (queue_work_on+0x40/0x4c)
[    1.744692] [<c0355ca8>] (queue_work_on) from [<c103e8b8>] (genpd_poweroff_unused+0x78/0x9c)
[    1.753123] [<c103e8b8>] (genpd_poweroff_unused) from [<c0301e78>] (do_one_initcall+0x40/0x170)
[    1.761815] [<c0301e78>] (do_one_initcall) from [<c1000dc8>] (kernel_init_freeable+0x15c/0x1fc)
[    1.770507] [<c1000dc8>] (kernel_init_freeable) from [<c0bb7ba0>] (kernel_init+0x8/0x114)
[    1.778678] [<c0bb7ba0>] (kernel_init) from [<c0307df8>] (ret_from_fork+0x14/0x3c)
[    1.786240] ---[ end trace b38c51ace1463add ]---
[    1.790875] genpd_poweroff_unused disabling ??????
[    1.795856] genpd_poweroff_unused disabling ??????
[    1.800830] ------------[ cut here ]------------
[    1.805443] WARNING: CPU: 0 PID: 1 at ../kernel/workqueue.c:1440 __queue_work+0x2b8/0x3f8
[    1.813610] Modules linked in:
[    1.816673] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W       4.8.0-rc6-next-20160915-00001-g7432710-dirty #5
[    1.827094] Hardware name: Rockchip (Device Tree)
[    1.831795] [<c0310388>] (unwind_backtrace) from [<c030ba04>] (show_stack+0x10/0x14)
[    1.839532] [<c030ba04>] (show_stack) from [<c0599c90>] (dump_stack+0x90/0xa4)
[    1.846747] [<c0599c90>] (dump_stack) from [<c0341bc0>] (__warn+0xe8/0x100)
[    1.853700] [<c0341bc0>] (__warn) from [<c0341c88>] (warn_slowpath_null+0x20/0x28)
[    1.861264] [<c0341c88>] (warn_slowpath_null) from [<c0355b28>] (__queue_work+0x2b8/0x3f8)
[    1.869521] [<c0355b28>] (__queue_work) from [<c0355ca8>] (queue_work_on+0x40/0x4c)
[    1.877170] [<c0355ca8>] (queue_work_on) from [<c103e8b8>] (genpd_poweroff_unused+0x78/0x9c)
[    1.885600] [<c103e8b8>] (genpd_poweroff_unused) from [<c0301e78>] (do_one_initcall+0x40/0x170)
[    1.894290] [<c0301e78>] (do_one_initcall) from [<c1000dc8>] (kernel_init_freeable+0x15c/0x1fc)
[    1.902981] [<c1000dc8>] (kernel_init_freeable) from [<c0bb7ba0>] (kernel_init+0x8/0x114)
[    1.911152] [<c0bb7ba0>] (kernel_init) from [<c0307df8>] (ret_from_fork+0x14/0x3c)
[    1.918713] ---[ end trace b38c51ace1463ade ]---
[    1.923338] genpd_poweroff_unused disabling ??????
[    1.928325] genpd_poweroff_unused disabling ??????

[+ millions more of those]

^ permalink raw reply

* [GIT PULL] DaVinci DTS updates for v4.9 (part 2)
From: Sekhar Nori @ 2016-09-15 14:44 UTC (permalink / raw)
  To: linux-arm-kernel

The following changes since commit 9d05b389846312751108b16f3f8fccd51fa92715:

  ARM: dts: da850-lcdk: Audio support via simple-card (2016-08-19 17:51:27 +0530)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git tags/davinci-for-v4.9/dts-p2

for you to fetch changes up to 9304af1b9ffa95dcb37d642852f8c67b98ea349a:

  ARM: dts: da850-lcdk: Add NAND to DT (2016-09-15 19:37:32 +0530)

----------------------------------------------------------------
This pull request adds NAND support to
DA850 based LCDK board.

----------------------------------------------------------------
Karl Beldan (1):
      ARM: dts: da850-lcdk: Add NAND to DT

 arch/arm/boot/dts/da850-lcdk.dts | 83 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

^ permalink raw reply

* [PATCH v2] ARM: dts: da850-lcdk: Add NAND to DT
From: Sekhar Nori @ 2016-09-15 14:46 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAOi56cWJpx-+s7h_+qypj-0HOcC2vDs2PLtZbdMO92TzdvECpQ@mail.gmail.com>

Hi Kevin,

On Wednesday 14 September 2016 10:54 PM, Kevin Hilman wrote:
> Hi Sekhar,
> 
> On Thu, Sep 8, 2016 at 11:33 AM, Kevin Hilman <khilman@baylibre.com> wrote:
>> From: Karl Beldan <kbeldan@baylibre.com>
>>
>> This adds DT support for the NAND connected to the SoC AEMIF.
>> Passed torture hashing a 40MB file on top of UBIFS using subpages.
>>
>> Signed-off-by: Karl Beldan <kbeldan@baylibre.com>
>> [khilman: add back default partitions from an earlier patch]
>> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
>> ---
>> Applies on Sekhar's v4.9/dts branch.
>>
> 
> Looks like you need to respin your DT series for arm-soc due to build
> errors.  Can you add this while you're at it so we have 4-bit ECC in
> v4.9?

The comments in the patch were fine. I applied this patch and just sent
a pull request for ARM-SoC maintainers too. Hopefully its not too late
for v4.9

Thanks,
Sekhar

^ permalink raw reply

* [PATCH v2 6/8] ARM: dts: sun9i: a80-optimus: Add AXP806 PMIC device node and regulators
From: Maxime Ripard @ 2016-09-15 14:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAGb2v65cQR9F1=0_9mM6guKrMhOX7TqMqfHJU5hJxUXtBZiYaw@mail.gmail.com>

On Thu, Sep 15, 2016 at 10:33:50PM +0800, Chen-Yu Tsai wrote:
> Hi Maxime,
> 
> On Sat, Aug 27, 2016 at 3:55 PM, Chen-Yu Tsai <wens@csie.org> wrote:
> > The AXP806 PMIC is the secondary PMIC. It provides various supply
> > voltages for the SoC and other peripherals. The PMIC's interrupt
> > line is connected to NMI pin of the SoC.
> >
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> 
> The driver patches have all been merged into the mfd tree. Could
> you queue up the dts patches?

I just did.

Thanks for the remainder,
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/20160915/7d725958/attachment.sig>

^ permalink raw reply

* [PATCH v5 0/5] dts: sun8i-h3: complete UART I2C for H3
From: Maxime Ripard @ 2016-09-15 14:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1473703967-21356-1-git-send-email-jorik@kippendief.biz>

On Mon, Sep 12, 2016 at 08:12:42PM +0200, jorik at kippendief.biz wrote:
> From: Jorik Jonker <jorik@kippendief.biz>
> 
> This is my fifth attempt to complete the UART/I2C definitions on H3.
> 
> Many thanks to Maxime and Chen-Yu for helping me understand the 
> philosophy behind the DTS/DTSI structure. I hope I get it and five
> times is a charm :-)

I queued it, 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/20160915/87dc4dd1/attachment.sig>

^ permalink raw reply

* linux-next: Tree for Sep 15 (phy/phy-meson-usb2.c)
From: Randy Dunlap @ 2016-09-15 15:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915165008.40acdecf@canb.auug.org.au>

On 09/14/16 23:50, Stephen Rothwell wrote:
> Hi all,
> 
> Changes since 20160914:
> 

on x86_64:

drivers/built-in.o: In function `phy_meson_usb2_probe':
phy-meson-usb2.c:(.text+0x350c): undefined reference to `of_usb_get_dr_mode_by_phy'


when CONFIG_USB_SUPPORT is not enabled.

-- 
~Randy

^ permalink raw reply

* [PATCH] usb: gadget: udc: atmel: fix endpoint name
From: Alexandre Belloni @ 2016-09-15 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

Since commit c32b5bcfa3c4 ("ARM: dts: at91: Fix USB endpoint nodes"),
atmel_usba_udc fails with:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at include/linux/usb/gadget.h:405
ecm_do_notify+0x188/0x1a0
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 4.7.0+ #15
Hardware name: Atmel SAMA5
[<c010ccfc>] (unwind_backtrace) from [<c010a7ec>] (show_stack+0x10/0x14)
[<c010a7ec>] (show_stack) from [<c0115c10>] (__warn+0xe4/0xfc)
[<c0115c10>] (__warn) from [<c0115cd8>] (warn_slowpath_null+0x20/0x28)
[<c0115cd8>] (warn_slowpath_null) from [<c04377ac>] (ecm_do_notify+0x188/0x1a0)
[<c04377ac>] (ecm_do_notify) from [<c04379a4>] (ecm_set_alt+0x74/0x1ac)
[<c04379a4>] (ecm_set_alt) from [<c042f74c>] (composite_setup+0xfc0/0x19f8)
[<c042f74c>] (composite_setup) from [<c04356e8>] (usba_udc_irq+0x8f4/0xd9c)
[<c04356e8>] (usba_udc_irq) from [<c013ec9c>] (handle_irq_event_percpu+0x9c/0x158)
[<c013ec9c>] (handle_irq_event_percpu) from [<c013ed80>] (handle_irq_event+0x28/0x3c)
[<c013ed80>] (handle_irq_event) from [<c01416d4>] (handle_fasteoi_irq+0xa0/0x168)
[<c01416d4>] (handle_fasteoi_irq) from [<c013e3f8>] (generic_handle_irq+0x24/0x34)
[<c013e3f8>] (generic_handle_irq) from [<c013e640>] (__handle_domain_irq+0x54/0xa8)
[<c013e640>] (__handle_domain_irq) from [<c010b214>] (__irq_svc+0x54/0x70)
[<c010b214>] (__irq_svc) from [<c0107eb0>] (arch_cpu_idle+0x38/0x3c)
[<c0107eb0>] (arch_cpu_idle) from [<c0137300>] (cpu_startup_entry+0x9c/0xdc)
[<c0137300>] (cpu_startup_entry) from [<c0900c40>] (start_kernel+0x354/0x360)
[<c0900c40>] (start_kernel) from [<20008078>] (0x20008078)
---[ end trace e7cf9dcebf4815a6 ]---

Fixes: c32b5bcfa3c4 ("ARM: dts: at91: Fix USB endpoint nodes")
Reported-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index bb1f6c8f0f01..45bc997d0711 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -1978,7 +1978,7 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
 			dev_err(&pdev->dev, "of_probe: name error(%d)\n", ret);
 			goto err;
 		}
-		ep->ep.name = name;
+		ep->ep.name = kasprintf(GFP_KERNEL, "ep%d", ep->index);
 
 		ep->ep_regs = udc->regs + USBA_EPT_BASE(i);
 		ep->dma_regs = udc->regs + USBA_DMA_BASE(i);
-- 
2.9.3

^ permalink raw reply related

* [PATCH v3 1/7] arm64: Factor out PAN enabling/disabling into separate uaccess_* macros
From: Mark Rutland @ 2016-09-15 15:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1473788797-10879-2-git-send-email-catalin.marinas@arm.com>

Hi Catalin,

On Tue, Sep 13, 2016 at 06:46:31PM +0100, Catalin Marinas wrote:
> This patch moves the directly coded alternatives for turning PAN on/off
> into separate uaccess_{enable,disable} macros or functions. The asm
> macros take a few arguments which will be used in subsequent patches.
> 
> Note that any (unlikely) access that the compiler might generate between
> uaccess_enable() and uaccess_disable(), other than those explicitly
> specified by the user access code, will not be protected by PAN.

There's one missing include that I've noted below, along with a number
we can now drop. Otherwise, the important parts all look good to me.

With the includes fixed up:

Reviewed-by: Mark Rutland <mark.rutland@arm.com>

[...]

> Cc: Will Deacon <will.deacon@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> ---
>  arch/arm64/include/asm/futex.h       | 14 +++----
>  arch/arm64/include/asm/uaccess.h     | 79 ++++++++++++++++++++++++++++++++----
>  arch/arm64/kernel/armv8_deprecated.c | 10 ++---
>  arch/arm64/lib/clear_user.S          |  8 ++--
>  arch/arm64/lib/copy_from_user.S      |  8 ++--
>  arch/arm64/lib/copy_in_user.S        |  8 ++--
>  arch/arm64/lib/copy_to_user.S        |  8 ++--
>  7 files changed, 95 insertions(+), 40 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/futex.h b/arch/arm64/include/asm/futex.h
> index f2585cdd32c2..71dfa3b42313 100644
> --- a/arch/arm64/include/asm/futex.h
> +++ b/arch/arm64/include/asm/futex.h
> @@ -27,9 +27,9 @@
>  #include <asm/sysreg.h>
>  
>  #define __futex_atomic_op(insn, ret, oldval, uaddr, tmp, oparg)		\
> +do {									\
> +	uaccess_enable();						\
>  	asm volatile(							\
> -	ALTERNATIVE("nop", SET_PSTATE_PAN(0), ARM64_HAS_PAN,		\
> -		    CONFIG_ARM64_PAN)					\
>  "	prfm	pstl1strm, %2\n"					\
>  "1:	ldxr	%w1, %2\n"						\
>  	insn "\n"							\
> @@ -44,11 +44,11 @@
>  "	.popsection\n"							\
>  	_ASM_EXTABLE(1b, 4b)						\
>  	_ASM_EXTABLE(2b, 4b)						\
> -	ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN,		\
> -		    CONFIG_ARM64_PAN)					\
>  	: "=&r" (ret), "=&r" (oldval), "+Q" (*uaddr), "=&r" (tmp)	\
>  	: "r" (oparg), "Ir" (-EFAULT)					\
> -	: "memory")
> +	: "memory");							\
> +	uaccess_disable();						\
> +} while (0)

With the uaccess_{enable,disable}* macros, we can drop the includes for
<asm/alternative.h>, <asm/cpufeature.h>, and <asm/sysreg.h> from
futex.h, as we no longer (directly) use anything from those.

[...]

> diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
> index c47257c91b77..cc6c32d4dcc4 100644
> --- a/arch/arm64/include/asm/uaccess.h
> +++ b/arch/arm64/include/asm/uaccess.h

> @@ -321,4 +357,31 @@ extern long strncpy_from_user(char *dest, const char __user *src, long count);
>  extern __must_check long strlen_user(const char __user *str);
>  extern __must_check long strnlen_user(const char __user *str, long n);
>  
> +#else	/* __ASSEMBLY__ */
> +
> +#include <asm/alternative.h>
> +#include <asm/assembler.h>

We also need <asm/sysreg.h> for SET_PSTATE_PAN()

Given we use that and <asm/alternative.h> either way, should we pull
those above the #ifdef __ASSEMBLY__? I have no feeling either way.

[...]

> diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c
> index 42ffdb54e162..7156e7bfcd89 100644
> --- a/arch/arm64/kernel/armv8_deprecated.c
> +++ b/arch/arm64/kernel/armv8_deprecated.c
> @@ -281,9 +281,9 @@ static void __init register_insn_emulation_sysctl(struct ctl_table *table)
>   * Error-checking SWP macros implemented using ldxr{b}/stxr{b}
>   */
>  #define __user_swpX_asm(data, addr, res, temp, B)		\
> +do {								\
> +	uaccess_enable();					\
>  	__asm__ __volatile__(					\
> -	ALTERNATIVE("nop", SET_PSTATE_PAN(0), ARM64_HAS_PAN,	\
> -		    CONFIG_ARM64_PAN)				\
>  	"0:	ldxr"B"		%w2, [%3]\n"			\
>  	"1:	stxr"B"		%w0, %w1, [%3]\n"		\
>  	"	cbz		%w0, 2f\n"			\
> @@ -299,11 +299,11 @@ static void __init register_insn_emulation_sysctl(struct ctl_table *table)
>  	"	.popsection"					\
>  	_ASM_EXTABLE(0b, 4b)					\
>  	_ASM_EXTABLE(1b, 4b)					\
> -	ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN,	\
> -		CONFIG_ARM64_PAN)				\
>  	: "=&r" (res), "+r" (data), "=&r" (temp)		\
>  	: "r" (addr), "i" (-EAGAIN), "i" (-EFAULT)		\
> -	: "memory")
> +	: "memory");						\
> +	uaccess_disable();					\
> +} while (0)

With this, we can drop the include of <asm/alternative.h>, though unlike
futex.h we need to keep <asm/cpufeature.h> and <asm/sysreg.h>.

[...]

> diff --git a/arch/arm64/lib/clear_user.S b/arch/arm64/lib/clear_user.S
> index 5d1cad3ce6d6..08b5f18ba604 100644
> --- a/arch/arm64/lib/clear_user.S
> +++ b/arch/arm64/lib/clear_user.S
> @@ -17,10 +17,10 @@
>   */
>  #include <linux/linkage.h>
>  
> -#include <asm/alternative.h>
>  #include <asm/assembler.h>
>  #include <asm/cpufeature.h>
>  #include <asm/sysreg.h>
> +#include <asm/uaccess.h>

As with futex.h, we can drop <asm/assembler.h>, <asm/cpufeature.h>, and
<asm/sysreg.h>, as the uaccess_{enable,disable}* macros mean we no
longer use anything from those directly.

[...]

> diff --git a/arch/arm64/lib/copy_from_user.S b/arch/arm64/lib/copy_from_user.S
> index 0b90497d4424..6505ec81f1da 100644
> --- a/arch/arm64/lib/copy_from_user.S
> +++ b/arch/arm64/lib/copy_from_user.S
> @@ -16,11 +16,11 @@
>  
>  #include <linux/linkage.h>
>  
> -#include <asm/alternative.h>
>  #include <asm/assembler.h>
>  #include <asm/cache.h>
>  #include <asm/cpufeature.h>
>  #include <asm/sysreg.h>
> +#include <asm/uaccess.h>

Likewise, we can also drop <asm/assembler.h>, <asm/cpufeature.h>, and
<asm/sysreg.h> here.

[...]

> diff --git a/arch/arm64/lib/copy_in_user.S b/arch/arm64/lib/copy_in_user.S
> index f7292dd08c84..9b04ff3ab610 100644
> --- a/arch/arm64/lib/copy_in_user.S
> +++ b/arch/arm64/lib/copy_in_user.S
> @@ -18,11 +18,11 @@
>  
>  #include <linux/linkage.h>
>  
> -#include <asm/alternative.h>
>  #include <asm/assembler.h>
>  #include <asm/cache.h>
>  #include <asm/cpufeature.h>
>  #include <asm/sysreg.h>
> +#include <asm/uaccess.h>

Likewise, we can also drop <asm/assembler.h>, <asm/cpufeature.h>, and
<asm/sysreg.h> here.

[...]

> diff --git a/arch/arm64/lib/copy_to_user.S b/arch/arm64/lib/copy_to_user.S
> index 7a7efe255034..8077e4f34d56 100644
> --- a/arch/arm64/lib/copy_to_user.S
> +++ b/arch/arm64/lib/copy_to_user.S
> @@ -16,11 +16,11 @@
>  
>  #include <linux/linkage.h>
>  
> -#include <asm/alternative.h>
>  #include <asm/assembler.h>
>  #include <asm/cache.h>
>  #include <asm/cpufeature.h>
>  #include <asm/sysreg.h>
> +#include <asm/uaccess.h>

Likewise, we can also drop <asm/assembler.h>, <asm/cpufeature.h>, and
<asm/sysreg.h> here.

Thanks,
Mark.

^ permalink raw reply

* [PATCH 0/4] drm/sun4i: rgb and dotclock misc fixes and improvements
From: Chen-Yu Tsai @ 2016-09-15 15:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Maxime,

Here are a few small fixes and improvements to the sun4i drm driver.

Patch 1 declares the LCD panel RGB interface encoder and connector types
as MIPI DPI. AFAIK DPI is the parallel RGB variant.

Patch 2 fixes the weird clock rates I was getting on the dot clock when
testing the RGB-to-VGA bridge patches. You may want to queue this as a
fix for 4.8.

Patch 3 increases the dot clock divider upper bound by 1 to 127. AFAIK
127 is a valid divider. I doubt we will ever use it, since the parents
will go way higher than they are supposed to, but getting it right is
nicer.

Patch 4 changes the dot clock's behavior to make it round to the closest
clock rate. I think this would make it easier to match the LCD panel's
timings. More on the LCD timings in a later patch set.


Regards
ChenYu

Chen-Yu Tsai (4):
  drm/sun4i: rgb: Declare RGB encoder and connector as MIPI DPI
  drm/sun4i: dotclock: Fix clock rate read back calcation
  drm/sun4i: dotclock: Allow divider = 127
  drm/sun4i: dotclock: Round to closest clock rate

 drivers/gpu/drm/sun4i/sun4i_dotclock.c | 7 ++++---
 drivers/gpu/drm/sun4i/sun4i_rgb.c      | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

-- 
2.9.3

^ permalink raw reply

* [PATCH 1/4] drm/sun4i: rgb: Declare RGB encoder and connector as MIPI DPI
From: Chen-Yu Tsai @ 2016-09-15 15:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915151402.15992-1-wens@csie.org>

The 18 or 24 bit parallel RGB LCD panel interface found on Allwinner
SoCs matches the description of MIPI DPI. Declare the RGB encoder and
connector as MIPI DPI.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/gpu/drm/sun4i/sun4i_rgb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index c3ff10f559cc..8b520d9f5bd9 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -240,7 +240,7 @@ int sun4i_rgb_init(struct drm_device *drm)
 	ret = drm_encoder_init(drm,
 			       &rgb->encoder,
 			       &sun4i_rgb_enc_funcs,
-			       DRM_MODE_ENCODER_NONE,
+			       DRM_MODE_ENCODER_DPI,
 			       NULL);
 	if (ret) {
 		dev_err(drm->dev, "Couldn't initialise the rgb encoder\n");
@@ -255,7 +255,7 @@ int sun4i_rgb_init(struct drm_device *drm)
 					 &sun4i_rgb_con_helper_funcs);
 		ret = drm_connector_init(drm, &rgb->connector,
 					 &sun4i_rgb_con_funcs,
-					 DRM_MODE_CONNECTOR_Unknown);
+					 DRM_MODE_CONNECTOR_DPI);
 		if (ret) {
 			dev_err(drm->dev, "Couldn't initialise the rgb connector\n");
 			goto err_cleanup_connector;
-- 
2.9.3

^ permalink raw reply related

* [PATCH 2/4] drm/sun4i: dotclock: Fix clock rate read back calcation
From: Chen-Yu Tsai @ 2016-09-15 15:14 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915151402.15992-1-wens@csie.org>

When reading back the divider set in the register, we mask off the
bits that aren't part of the divider. Unfortunately the mask used
here was not converted from the field width.

Fix this by converting the field width to a proper bit mask.

Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/gpu/drm/sun4i/sun4i_dotclock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 4332da48b1b3..1b6c2253192e 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -62,7 +62,7 @@ static unsigned long sun4i_dclk_recalc_rate(struct clk_hw *hw,
 	regmap_read(dclk->regmap, SUN4I_TCON0_DCLK_REG, &val);
 
 	val >>= SUN4I_TCON0_DCLK_DIV_SHIFT;
-	val &= SUN4I_TCON0_DCLK_DIV_WIDTH;
+	val &= (1 << SUN4I_TCON0_DCLK_DIV_WIDTH) - 1;
 
 	if (!val)
 		val = 1;
-- 
2.9.3

^ permalink raw reply related

* [PATCH 3/4] drm/sun4i: dotclock: Allow divider = 127
From: Chen-Yu Tsai @ 2016-09-15 15:14 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915151402.15992-1-wens@csie.org>

The dot clock divider is 7 bits wide, and the divider range is 1 ~ 127,
or 6 ~ 127 if phase offsets are used. The 0 register value also
represents a divider of 1 or bypass.

Make the end condition of the for loop inclusive of 127 in the
round_rate callback.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/gpu/drm/sun4i/sun4i_dotclock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 1b6c2253192e..3eb99784f371 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -77,7 +77,7 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
 	u8 best_div = 1;
 	int i;
 
-	for (i = 6; i < 127; i++) {
+	for (i = 6; i <= 127; i++) {
 		unsigned long ideal = rate * i;
 		unsigned long rounded;
 
-- 
2.9.3

^ permalink raw reply related

* [PATCH 4/4] drm/sun4i: dotclock: Round to closest clock rate
From: Chen-Yu Tsai @ 2016-09-15 15:14 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915151402.15992-1-wens@csie.org>

With display pixel clocks we want to have the closest possible clock
rate, to minimize timing and refresh rate skews. Whether the actual
clock rate is higher or lower than the requested rate is less important.

Also check candidates against the requested rate, rather than the
ideal parent rate, the varying dividers also influence the difference
between the requested rate and the rounded rate.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/gpu/drm/sun4i/sun4i_dotclock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 3eb99784f371..d401156490f3 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -90,7 +90,8 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
 			goto out;
 		}
 
-		if ((rounded < ideal) && (rounded > best_parent)) {
+		if (abs(rate - rounded / i) <
+		    abs(rate - best_parent / best_div)) {
 			best_parent = rounded;
 			best_div = i;
 		}
-- 
2.9.3

^ permalink raw reply related

* [PATCH v3 2/3] ASoC: rename "SUN4I_CODEC_SYS_VERI" to "SUN7I_CODEC_AC_DAC_CAL"; rename "SUN4I_CODEC_AC_MIC_PHONE_CAL" to "SUN7I_CODEC_AC_MIC_PHONE_CAL".
From: Chen-Yu Tsai @ 2016-09-15 15:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915143922.4890-3-dannym@scratchpost.org>

On Thu, Sep 15, 2016 at 10:39 PM, Danny Milosavljevic
<dannym@scratchpost.org> wrote:
> This patch renames some sun7i-only registers to reflect that fact.

The subject line is way longer than it should be. Perhaps you could use
the above message as the description part of the subject?

ChenYu

>
> Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
> ---
>  sound/soc/sunxi/sun4i-codec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
> index c2c0583..3b53b78 100644
> --- a/sound/soc/sunxi/sun4i-codec.c
> +++ b/sound/soc/sunxi/sun4i-codec.c
> @@ -96,8 +96,8 @@
>  /* Other various ADC registers */
>  #define SUN4I_CODEC_DAC_TXCNT                  (0x30)
>  #define SUN4I_CODEC_ADC_RXCNT                  (0x34)
> -#define SUN4I_CODEC_AC_SYS_VERI                        (0x38)
> -#define SUN4I_CODEC_AC_MIC_PHONE_CAL           (0x3c)
> +#define SUN7I_CODEC_AC_DAC_CAL                 (0x38)
> +#define SUN7I_CODEC_AC_MIC_PHONE_CAL           (0x3c)
>
>  struct sun4i_codec {
>         struct device   *dev;
> @@ -682,7 +682,7 @@ static const struct regmap_config sun4i_codec_regmap_config = {
>         .reg_bits       = 32,
>         .reg_stride     = 4,
>         .val_bits       = 32,
> -       .max_register   = SUN4I_CODEC_AC_MIC_PHONE_CAL,
> +       .max_register   = SUN7I_CODEC_AC_MIC_PHONE_CAL,
>  };
>
>  static const struct of_device_id sun4i_codec_of_match[] = {

^ permalink raw reply

* [RFC PATCH v2 05/11] ACPI: platform: setup MSI domain for ACPI based platform device
From: Marc Zyngier @ 2016-09-15 15:18 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <57DAAAAE.6010206@linaro.org>

On 15/09/16 15:05, Hanjun Guo wrote:
> Hi Marc,
> 
> Thanks for your review, reply inline.
> 
> On 09/14/2016 11:45 PM, Marc Zyngier wrote:
>> On 14/09/16 15:21, Hanjun Guo wrote:
>>> From: Hanjun Guo <hanjun.guo@linaro.org>
>>>
>>> With the platform msi domain created, we can set up the msi domain
>>> for a platform device when it's probed.
>>>
>>> This patch introduces acpi_configure_msi_domain(), which retrieves
>>> the domain from iort and set it to platform device.
>>>
>>> As some platform devices such as an irqchip needs the msi irqdomain
>>> to be the interrupt parent domain, we need to get irqdomain before
>>> platform device is probed.
>>>
>>> Cc: Marc Zyngier <marc.zyngier@arm.com>
>>> Cc: Greg KH <gregkh@linuxfoundation.org>
>>> Cc: Thomas Gleixner <tglx@linutronix.de>
>>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>>> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
>>> Cc: Tomasz Nowicki <tn@semihalf.com>
>>> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
>>> ---
>>>   drivers/acpi/arm64/iort.c   |  5 ++++-
>>>   drivers/base/platform-msi.c | 15 ++++++++++++++-
>>>   drivers/base/platform.c     |  2 ++
>>>   include/linux/msi.h         |  1 +
>>>   4 files changed, 21 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
>>> index 13a1905..bccd3cc 100644
>>> --- a/drivers/acpi/arm64/iort.c
>>> +++ b/drivers/acpi/arm64/iort.c
>>> @@ -478,6 +478,7 @@ struct irq_domain *iort_get_device_domain(struct device *dev, u32 req_id)
>>>   {
>>>   	struct fwnode_handle *handle;
>>>   	int its_id;
>>> +	enum irq_domain_bus_token bus_token;
>>>
>>>   	if (iort_dev_find_its_id(dev, req_id, 0, &its_id))
>>>   		return NULL;
>>> @@ -486,7 +487,9 @@ struct irq_domain *iort_get_device_domain(struct device *dev, u32 req_id)
>>>   	if (!handle)
>>>   		return NULL;
>>>
>>> -	return irq_find_matching_fwnode(handle, DOMAIN_BUS_PCI_MSI);
>>> +	bus_token = dev_is_pci(dev) ?
>>> +			DOMAIN_BUS_PCI_MSI : DOMAIN_BUS_PLATFORM_MSI;
>>> +	return irq_find_matching_fwnode(handle, bus_token);
>>>   }
>>>
>>>   static int __get_pci_rid(struct pci_dev *pdev, u16 alias, void *data)
>>> diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c
>>> index 279e539..f6eae18 100644
>>> --- a/drivers/base/platform-msi.c
>>> +++ b/drivers/base/platform-msi.c
>>> @@ -17,8 +17,8 @@
>>>    * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>>>    */
>>>
>>> +#include <linux/acpi_iort.h>
>>>   #include <linux/device.h>
>>> -#include <linux/idr.h>
>>>   #include <linux/irq.h>
>>>   #include <linux/irqdomain.h>
>>>   #include <linux/msi.h>
>>> @@ -416,3 +416,16 @@ int platform_msi_domain_alloc(struct irq_domain *domain, unsigned int virq,
>>>
>>>   	return err;
>>>   }
>>> +
>>> +int acpi_configure_msi_domain(struct device *dev)
>>> +{
>>> +	struct irq_domain *d = NULL;
>>> +
>>> +	d = iort_get_device_domain(dev, 0);
>>
>> This looks completely wrong. Why RID 0? As far as I can see, 0 is not a
>> special value, and could be something else.
> 
> You are right. I tried to reuse the API of get irqdomain in IORT for
> PCI devices, but for platform device, we don't have req id in named
> component, so I just pass 0 here, I think I need to prepare another
> API for platform devices.
> 
>>
>>> +	if (d) {
>>> +		dev_set_msi_domain(dev, d);
>>> +		return 0;
>>> +	}
>>> +
>>> +	return -EINVAL;
>>> +}
>>
>> I really hate this, as the platform MSI code is intentionally free of
>> any firmware reference. This should live in the ACPI code.
> 
> Will do, I think locate it in iort.c is better.
> 
>>
>>> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
>>> index 6482d47..ea01a37 100644
>>> --- a/drivers/base/platform.c
>>> +++ b/drivers/base/platform.c
>>> @@ -24,6 +24,7 @@
>>>   #include <linux/pm_domain.h>
>>>   #include <linux/idr.h>
>>>   #include <linux/acpi.h>
>>> +#include <linux/msi.h>
>>>   #include <linux/clk/clk-conf.h>
>>>   #include <linux/limits.h>
>>>   #include <linux/property.h>
>>> @@ -500,6 +501,7 @@ struct platform_device *platform_device_register_full(
>>>   	pdev->dev.parent = pdevinfo->parent;
>>>   	pdev->dev.fwnode = pdevinfo->fwnode;
>>>
>>> +	acpi_configure_msi_domain(&pdev->dev);
>>
>> It feels odd to put this in the generic code, while you could perfectly
>> put the call into acpi_platform.c and keep the firmware stuff away from
>> the generic code.
> 
> My feeling is the same, I'm still trying to find a new way to do it,
> but I can't simply put that in acpi_platform.c, because
> 
> acpi_create_platform_device()
>     platform_device_register_full()
> 	platform_device_alloc()  --> dev is alloced
>          ...
>          dev.fwnode  is set
> 	(I get the msi domain by the fwnode in acpi_configure_msi_domain)
>          ...
>          platform_device_add()  --> which the device is probed.
> 
> For devices like irqchip which needs the dev->msi_domain to be
> set before it's really probed, because it needs the msi domain
> to be the parent domain.
> 
> If I call the function in acpi_create_platform_device() before
> platform_device_register_full(), we just can't set dev's msi
> domain, but if call it after platform_device_register_full(),
> the irqchip like mbigen will not get its parent domain...
> 
> DT is using another API for platform device probe, so has no
> problems like I said above, any suggestions to do it right in
> ACPI?

How about having something that's completely generic and solves
the problem once and for all? Something like this:

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 6482d47..6f0f90b 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -533,6 +533,9 @@ struct platform_device *platform_device_register_full(
 			goto err;
 	}
 
+	if (pdevinfo->pre_add_cb)
+		pdevinfo->pre_add_cb(&pdev->dev);
+
 	ret = platform_device_add(pdev);
 	if (ret) {
 err:
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 98c2a7c..44ea133 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -74,6 +74,7 @@ struct platform_device_info {
 		u64 dma_mask;
 
 		struct property_entry *properties;
+		void (*pre_add_cb)(struct device *);
 };
 extern struct platform_device *platform_device_register_full(
 		const struct platform_device_info *pdevinfo);

Plug pre_add_cb with your ACPI callback where you can do all the
processing you want before the device is actually added.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply related

* [PATCH v3 2/7] arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro
From: Mark Rutland @ 2016-09-15 15:19 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1473788797-10879-3-git-send-email-catalin.marinas@arm.com>

On Tue, Sep 13, 2016 at 06:46:32PM +0100, Catalin Marinas wrote:
> This patch takes the errata workaround code out of cpu_do_switch_mm into
> a dedicated post_ttbr0_update_workaround macro which will be reused in a
> subsequent patch.
> 
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> ---
>  arch/arm64/include/asm/assembler.h | 17 +++++++++++++++++
>  arch/arm64/mm/proc.S               | 11 +----------
>  2 files changed, 18 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
> index d5025c69ca81..0a47632787d9 100644
> --- a/arch/arm64/include/asm/assembler.h
> +++ b/arch/arm64/include/asm/assembler.h
> @@ -350,4 +350,21 @@ alternative_endif
>  	movk	\reg, :abs_g0_nc:\val
>  	.endm
>  
> +/*
> + * Errata workaround post TTBR0_EL1 update.
> + */
> +	.macro	post_ttbr0_update_workaround
> +#ifdef CONFIG_CAVIUM_ERRATUM_27456
> +alternative_if_not ARM64_WORKAROUND_CAVIUM_27456
> +	nop
> +	nop
> +	nop
> +alternative_else
> +	ic	iallu
> +	dsb	nsh
> +	isb
> +alternative_endif
> +#endif
> +	.endm
> +
>  #endif	/* __ASM_ASSEMBLER_H */

As a general note, it's unfortunate that we put asm with alternatives in
<asm/assembler.h>, as that's included by <asm/alternative.h>, so we're
relying on things that aren't defined yet, and users have to remember to
include <asm/alternative.h>.

That's already the case for dcache_by_line_op, so I guess that's
something to deal with another day.

Otherwise, this looks good, and I guess this wil be auto-nopped in a
subsqeuent version, so FWIW:

Reviewed-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

^ permalink raw reply

* [PATCH v3 3/3] ASoC: sun4i-codec: Add custom regmap configs for the A10 and A20 variants.
From: Chen-Yu Tsai @ 2016-09-15 15:19 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20160915143922.4890-4-dannym@scratchpost.org>

On Thu, Sep 15, 2016 at 10:39 PM, Danny Milosavljevic
<dannym@scratchpost.org> wrote:
> ASoC: sun4i-codec: Add custom regmap configs for the A10 and A20 variants.

The commit message should be a straight forward description about what
the patch does and why you did it, not a direct copy of the subject.

Something along the lines of "The A20 has a few extra registers that
the A10 doesn't have ..." will do for the why.

Regards
ChenYu

>
> Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
> ---
>  sound/soc/sunxi/sun4i-codec.c | 33 ++++++++++++++++++++++++++++++---
>  1 file changed, 30 insertions(+), 3 deletions(-)
>
> diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
> index 3b53b78..c5d6d84c 100644
> --- a/sound/soc/sunxi/sun4i-codec.c
> +++ b/sound/soc/sunxi/sun4i-codec.c
> @@ -682,12 +682,37 @@ static const struct regmap_config sun4i_codec_regmap_config = {
>         .reg_bits       = 32,
>         .reg_stride     = 4,
>         .val_bits       = 32,
> +       .max_register   = SUN4I_CODEC_ADC_RXCNT,
> +};
> +
> +static const struct regmap_config sun7i_codec_regmap_config = {
> +       .reg_bits       = 32,
> +       .reg_stride     = 4,
> +       .val_bits       = 32,
>         .max_register   = SUN7I_CODEC_AC_MIC_PHONE_CAL,
>  };
>
> +struct sun4i_codec_quirks {
> +       const struct regmap_config *regmap_config;
> +};
> +
> +static const struct sun4i_codec_quirks sun4i_codec_quirks = {
> +       .regmap_config = &sun4i_codec_regmap_config,
> +};
> +
> +static const struct sun4i_codec_quirks sun7i_codec_quirks = {
> +       .regmap_config = &sun7i_codec_regmap_config,
> +};
> +
>  static const struct of_device_id sun4i_codec_of_match[] = {
> -       { .compatible = "allwinner,sun4i-a10-codec" },
> -       { .compatible = "allwinner,sun7i-a20-codec" },
> +       {
> +               .compatible = "allwinner,sun4i-a10-codec",
> +               .data = &sun4i_codec_quirks,
> +       },
> +       {
> +               .compatible = "allwinner,sun7i-a20-codec",
> +               .data = &sun7i_codec_quirks,
> +       },
>         {}
>  };
>  MODULE_DEVICE_TABLE(of, sun4i_codec_of_match);
> @@ -760,6 +785,7 @@ static int sun4i_codec_probe(struct platform_device *pdev)
>  {
>         struct snd_soc_card *card;
>         struct sun4i_codec *scodec;
> +       const struct sun4i_codec_quirks *quirks;
>         struct resource *res;
>         void __iomem *base;
>         int ret;
> @@ -777,8 +803,9 @@ static int sun4i_codec_probe(struct platform_device *pdev)
>                 return PTR_ERR(base);
>         }
>
> +       quirks = of_device_get_match_data(&pdev->dev);
>         scodec->regmap = devm_regmap_init_mmio(&pdev->dev, base,
> -                                            &sun4i_codec_regmap_config);
> +                                              quirks->regmap_config);
>         if (IS_ERR(scodec->regmap)) {
>                 dev_err(&pdev->dev, "Failed to create our regmap\n");
>                 return PTR_ERR(scodec->regmap);

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox