* [PATCH 1/2] ARM: dts: imx6: RDU2: disable internal watchdog
From: Fabio Estevam @ 2017-12-27 11:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171227035656.4941-1-andrew.smirnov@gmail.com>
Hi Andrey,
On Wed, Dec 27, 2017 at 1:56 AM, Andrey Smirnov
<andrew.smirnov@gmail.com> wrote:
> The system has an external watchdog in the environment processor
> so the internal watchdog is of no use.
>
> Cc: Sascha Hauer <kernel@pengutronix.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: devicetree at vger.kernel.org
> Cc: linux-kernel at vger.kernel.org
> Cc: cphealy at gmail.com
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Patch looks good.
Just not clear if the authorship comes from you or Lucas.
If Lucas is the original author then his name should appear in the From field.
^ permalink raw reply
* [PATCH 2/2] ARM: dts: imx6: RDU2: correct RTC compatible
From: Fabio Estevam @ 2017-12-27 11:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171227035656.4941-2-andrew.smirnov@gmail.com>
Hi Andrey,
On Wed, Dec 27, 2017 at 1:56 AM, Andrey Smirnov
<andrew.smirnov@gmail.com> wrote:
> The RTC is manufactured by Maxim. This is a cosmetic fix, as Linux
> doesn't match the vendor string for i2c devices.
>
> Cc: Sascha Hauer <kernel@pengutronix.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: devicetree at vger.kernel.org
> Cc: linux-kernel at vger.kernel.org
> Cc: cphealy at gmail.com
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
This patch seems to be from Lucas:
https://patchwork.kernel.org/patch/10099397/
,so his name should appear in the From field.
Anyway, this patch has been sent earlier and we suggested to keep the
existing binding, which is the documented form:
https://patchwork.kernel.org/patch/10099397/
^ permalink raw reply
* [PATCH] Input: misc: gpio_tilt: Delete driver
From: Linus Walleij @ 2017-12-27 12:15 UTC (permalink / raw)
To: linux-arm-kernel
This driver was merged in 2011 as a tool for detecting the orientation
of a screen. The device driver assumes board file setup using the
platform data from <linux/input/gpio_tilt.h>. But no boards in the
kernel tree defines this platform data.
As I am faced with refactoring drivers to use GPIO descriptors and
pass decriptor tables from boards, or use the device tree device
drivers like these creates a serious problem: I cannot fix them and
cannot test them, not even compile-test them with a system actually
using it (no in-tree boardfile).
I suggest to delete this driver and rewrite it using device tree if
it is still in use on actively maintained systems.
I can also offer to rewrite it out of the blue using device tree if
someone promise to test it and help me iterate it.
Cc: Heiko St?bner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Heiko: not meaning to be militant here, just contain the situation,
as stated: if you like the driver and can test it, I can reimplement
it from scratch using device tree.
---
Documentation/gpio/drivers-on-gpio.txt | 5 -
Documentation/input/devices/gpio-tilt.rst | 103 ---------------
drivers/input/misc/Kconfig | 14 --
drivers/input/misc/Makefile | 1 -
drivers/input/misc/gpio_tilt_polled.c | 210 ------------------------------
include/linux/input/gpio_tilt.h | 74 -----------
6 files changed, 407 deletions(-)
delete mode 100644 Documentation/input/devices/gpio-tilt.rst
delete mode 100644 drivers/input/misc/gpio_tilt_polled.c
delete mode 100644 include/linux/input/gpio_tilt.h
diff --git a/Documentation/gpio/drivers-on-gpio.txt b/Documentation/gpio/drivers-on-gpio.txt
index 9a78d385b92e..a2ccbab12eb7 100644
--- a/Documentation/gpio/drivers-on-gpio.txt
+++ b/Documentation/gpio/drivers-on-gpio.txt
@@ -28,11 +28,6 @@ hardware descriptions such as device tree or ACPI:
- gpio-beeper: drivers/input/misc/gpio-beeper.c is used to provide a beep from
an external speaker connected to a GPIO line.
-- gpio-tilt-polled: drivers/input/misc/gpio_tilt_polled.c provides tilt
- detection switches using GPIO, which is useful for your homebrewn pinball
- machine if for nothing else. It can detect different tilt angles of the
- monitored object.
-
- extcon-gpio: drivers/extcon/extcon-gpio.c is used when you need to read an
external connector status, such as a headset line for an audio driver or an
HDMI connector. It will provide a better userspace sysfs interface than GPIO.
diff --git a/Documentation/input/devices/gpio-tilt.rst b/Documentation/input/devices/gpio-tilt.rst
deleted file mode 100644
index fa6e64570aa7..000000000000
--- a/Documentation/input/devices/gpio-tilt.rst
+++ /dev/null
@@ -1,103 +0,0 @@
-Driver for tilt-switches connected via GPIOs
-============================================
-
-Generic driver to read data from tilt switches connected via gpios.
-Orientation can be provided by one or more than one tilt switches,
-i.e. each tilt switch providing one axis, and the number of axes
-is also not limited.
-
-
-Data structures
----------------
-
-The array of struct gpio in the gpios field is used to list the gpios
-that represent the current tilt state.
-
-The array of struct gpio_tilt_axis describes the axes that are reported
-to the input system. The values set therein are used for the
-input_set_abs_params calls needed to init the axes.
-
-The array of struct gpio_tilt_state maps gpio states to the corresponding
-values to report. The gpio state is represented as a bitfield where the
-bit-index corresponds to the index of the gpio in the struct gpio array.
-In the same manner the values stored in the axes array correspond to
-the elements of the gpio_tilt_axis-array.
-
-
-Example
--------
-
-Example configuration for a single TS1003 tilt switch that rotates around
-one axis in 4 steps and emits the current tilt via two GPIOs::
-
- static int sg060_tilt_enable(struct device *dev) {
- /* code to enable the sensors */
- };
-
- static void sg060_tilt_disable(struct device *dev) {
- /* code to disable the sensors */
- };
-
- static struct gpio sg060_tilt_gpios[] = {
- { SG060_TILT_GPIO_SENSOR1, GPIOF_IN, "tilt_sensor1" },
- { SG060_TILT_GPIO_SENSOR2, GPIOF_IN, "tilt_sensor2" },
- };
-
- static struct gpio_tilt_state sg060_tilt_states[] = {
- {
- .gpios = (0 << 1) | (0 << 0),
- .axes = (int[]) {
- 0,
- },
- }, {
- .gpios = (0 << 1) | (1 << 0),
- .axes = (int[]) {
- 1, /* 90 degrees */
- },
- }, {
- .gpios = (1 << 1) | (1 << 0),
- .axes = (int[]) {
- 2, /* 180 degrees */
- },
- }, {
- .gpios = (1 << 1) | (0 << 0),
- .axes = (int[]) {
- 3, /* 270 degrees */
- },
- },
- };
-
- static struct gpio_tilt_axis sg060_tilt_axes[] = {
- {
- .axis = ABS_RY,
- .min = 0,
- .max = 3,
- .fuzz = 0,
- .flat = 0,
- },
- };
-
- static struct gpio_tilt_platform_data sg060_tilt_pdata= {
- .gpios = sg060_tilt_gpios,
- .nr_gpios = ARRAY_SIZE(sg060_tilt_gpios),
-
- .axes = sg060_tilt_axes,
- .nr_axes = ARRAY_SIZE(sg060_tilt_axes),
-
- .states = sg060_tilt_states,
- .nr_states = ARRAY_SIZE(sg060_tilt_states),
-
- .debounce_interval = 100,
-
- .poll_interval = 1000,
- .enable = sg060_tilt_enable,
- .disable = sg060_tilt_disable,
- };
-
- static struct platform_device sg060_device_tilt = {
- .name = "gpio-tilt-polled",
- .id = -1,
- .dev = {
- .platform_data = &sg060_tilt_pdata,
- },
- };
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 9f082a388388..4791e73839d9 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -268,20 +268,6 @@ config INPUT_GPIO_BEEPER
To compile this driver as a module, choose M here: the
module will be called gpio-beeper.
-config INPUT_GPIO_TILT_POLLED
- tristate "Polled GPIO tilt switch"
- depends on GPIOLIB || COMPILE_TEST
- select INPUT_POLLDEV
- help
- This driver implements support for tilt switches connected
- to GPIO pins that are not capable of generating interrupts.
-
- The list of gpios to use and the mapping of their states
- to specific angles is done via platform data.
-
- To compile this driver as a module, choose M here: the
- module will be called gpio_tilt_polled.
-
config INPUT_GPIO_DECODER
tristate "Polled GPIO Decoder Input driver"
depends on GPIOLIB || COMPILE_TEST
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 4b6118d313fe..a8f61af865aa 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -36,7 +36,6 @@ obj-$(CONFIG_INPUT_DRV2665_HAPTICS) += drv2665.o
obj-$(CONFIG_INPUT_DRV2667_HAPTICS) += drv2667.o
obj-$(CONFIG_INPUT_GP2A) += gp2ap002a00f.o
obj-$(CONFIG_INPUT_GPIO_BEEPER) += gpio-beeper.o
-obj-$(CONFIG_INPUT_GPIO_TILT_POLLED) += gpio_tilt_polled.o
obj-$(CONFIG_INPUT_GPIO_DECODER) += gpio_decoder.o
obj-$(CONFIG_INPUT_HISI_POWERKEY) += hisi_powerkey.o
obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o
diff --git a/drivers/input/misc/gpio_tilt_polled.c b/drivers/input/misc/gpio_tilt_polled.c
deleted file mode 100644
index 6e217a45e39a..000000000000
--- a/drivers/input/misc/gpio_tilt_polled.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Driver for tilt switches connected via GPIO lines
- * not capable of generating interrupts
- *
- * Copyright (C) 2011 Heiko Stuebner <heiko@sntech.de>
- *
- * based on: drivers/input/keyboard/gpio_keys_polled.c
- *
- * Copyright (C) 2007-2010 Gabor Juhos <juhosg@openwrt.org>
- * Copyright (C) 2010 Nuno Goncalves <nunojpg@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/input.h>
-#include <linux/input-polldev.h>
-#include <linux/ioport.h>
-#include <linux/platform_device.h>
-#include <linux/gpio.h>
-#include <linux/input/gpio_tilt.h>
-
-#define DRV_NAME "gpio-tilt-polled"
-
-struct gpio_tilt_polled_dev {
- struct input_polled_dev *poll_dev;
- struct device *dev;
- const struct gpio_tilt_platform_data *pdata;
-
- int last_state;
-
- int threshold;
- int count;
-};
-
-static void gpio_tilt_polled_poll(struct input_polled_dev *dev)
-{
- struct gpio_tilt_polled_dev *tdev = dev->private;
- const struct gpio_tilt_platform_data *pdata = tdev->pdata;
- struct input_dev *input = dev->input;
- struct gpio_tilt_state *tilt_state = NULL;
- int state, i;
-
- if (tdev->count < tdev->threshold) {
- tdev->count++;
- } else {
- state = 0;
- for (i = 0; i < pdata->nr_gpios; i++)
- state |= (!!gpio_get_value(pdata->gpios[i].gpio) << i);
-
- if (state != tdev->last_state) {
- for (i = 0; i < pdata->nr_states; i++)
- if (pdata->states[i].gpios == state)
- tilt_state = &pdata->states[i];
-
- if (tilt_state) {
- for (i = 0; i < pdata->nr_axes; i++)
- input_report_abs(input,
- pdata->axes[i].axis,
- tilt_state->axes[i]);
-
- input_sync(input);
- }
-
- tdev->count = 0;
- tdev->last_state = state;
- }
- }
-}
-
-static void gpio_tilt_polled_open(struct input_polled_dev *dev)
-{
- struct gpio_tilt_polled_dev *tdev = dev->private;
- const struct gpio_tilt_platform_data *pdata = tdev->pdata;
-
- if (pdata->enable)
- pdata->enable(tdev->dev);
-
- /* report initial state of the axes */
- tdev->last_state = -1;
- tdev->count = tdev->threshold;
- gpio_tilt_polled_poll(tdev->poll_dev);
-}
-
-static void gpio_tilt_polled_close(struct input_polled_dev *dev)
-{
- struct gpio_tilt_polled_dev *tdev = dev->private;
- const struct gpio_tilt_platform_data *pdata = tdev->pdata;
-
- if (pdata->disable)
- pdata->disable(tdev->dev);
-}
-
-static int gpio_tilt_polled_probe(struct platform_device *pdev)
-{
- const struct gpio_tilt_platform_data *pdata =
- dev_get_platdata(&pdev->dev);
- struct device *dev = &pdev->dev;
- struct gpio_tilt_polled_dev *tdev;
- struct input_polled_dev *poll_dev;
- struct input_dev *input;
- int error, i;
-
- if (!pdata || !pdata->poll_interval)
- return -EINVAL;
-
- tdev = kzalloc(sizeof(struct gpio_tilt_polled_dev), GFP_KERNEL);
- if (!tdev) {
- dev_err(dev, "no memory for private data\n");
- return -ENOMEM;
- }
-
- error = gpio_request_array(pdata->gpios, pdata->nr_gpios);
- if (error) {
- dev_err(dev,
- "Could not request tilt GPIOs: %d\n", error);
- goto err_free_tdev;
- }
-
- poll_dev = input_allocate_polled_device();
- if (!poll_dev) {
- dev_err(dev, "no memory for polled device\n");
- error = -ENOMEM;
- goto err_free_gpios;
- }
-
- poll_dev->private = tdev;
- poll_dev->poll = gpio_tilt_polled_poll;
- poll_dev->poll_interval = pdata->poll_interval;
- poll_dev->open = gpio_tilt_polled_open;
- poll_dev->close = gpio_tilt_polled_close;
-
- input = poll_dev->input;
-
- input->name = pdev->name;
- input->phys = DRV_NAME"/input0";
- input->dev.parent = dev;
-
- input->id.bustype = BUS_HOST;
- input->id.vendor = 0x0001;
- input->id.product = 0x0001;
- input->id.version = 0x0100;
-
- __set_bit(EV_ABS, input->evbit);
- for (i = 0; i < pdata->nr_axes; i++)
- input_set_abs_params(input, pdata->axes[i].axis,
- pdata->axes[i].min, pdata->axes[i].max,
- pdata->axes[i].fuzz, pdata->axes[i].flat);
-
- tdev->threshold = DIV_ROUND_UP(pdata->debounce_interval,
- pdata->poll_interval);
-
- tdev->poll_dev = poll_dev;
- tdev->dev = dev;
- tdev->pdata = pdata;
-
- error = input_register_polled_device(poll_dev);
- if (error) {
- dev_err(dev, "unable to register polled device, err=%d\n",
- error);
- goto err_free_polldev;
- }
-
- platform_set_drvdata(pdev, tdev);
-
- return 0;
-
-err_free_polldev:
- input_free_polled_device(poll_dev);
-err_free_gpios:
- gpio_free_array(pdata->gpios, pdata->nr_gpios);
-err_free_tdev:
- kfree(tdev);
-
- return error;
-}
-
-static int gpio_tilt_polled_remove(struct platform_device *pdev)
-{
- struct gpio_tilt_polled_dev *tdev = platform_get_drvdata(pdev);
- const struct gpio_tilt_platform_data *pdata = tdev->pdata;
-
- input_unregister_polled_device(tdev->poll_dev);
- input_free_polled_device(tdev->poll_dev);
-
- gpio_free_array(pdata->gpios, pdata->nr_gpios);
-
- kfree(tdev);
-
- return 0;
-}
-
-static struct platform_driver gpio_tilt_polled_driver = {
- .probe = gpio_tilt_polled_probe,
- .remove = gpio_tilt_polled_remove,
- .driver = {
- .name = DRV_NAME,
- },
-};
-
-module_platform_driver(gpio_tilt_polled_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Heiko Stuebner <heiko@sntech.de>");
-MODULE_DESCRIPTION("Polled GPIO tilt driver");
-MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/include/linux/input/gpio_tilt.h b/include/linux/input/gpio_tilt.h
deleted file mode 100644
index f9d932476a80..000000000000
--- a/include/linux/input/gpio_tilt.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _INPUT_GPIO_TILT_H
-#define _INPUT_GPIO_TILT_H
-
-/**
- * struct gpio_tilt_axis - Axis used by the tilt switch
- * @axis: Constant describing the axis, e.g. ABS_X
- * @min: minimum value for abs_param
- * @max: maximum value for abs_param
- * @fuzz: fuzz value for abs_param
- * @flat: flat value for abs_param
- */
-struct gpio_tilt_axis {
- int axis;
- int min;
- int max;
- int fuzz;
- int flat;
-};
-
-/**
- * struct gpio_tilt_state - state description
- * @gpios: bitfield of gpio target-states for the value
- * @axes: array containing the axes settings for the gpio state
- * The array indizes must correspond to the axes defined
- * in platform_data
- *
- * This structure describes a supported axis settings
- * and the necessary gpio-state which represent it.
- *
- * The n-th bit in the bitfield describes the state of the n-th GPIO
- * from the gpios-array defined in gpio_regulator_config below.
- */
-struct gpio_tilt_state {
- int gpios;
- int *axes;
-};
-
-/**
- * struct gpio_tilt_platform_data
- * @gpios: Array containing the gpios determining the tilt state
- * @nr_gpios: Number of gpios
- * @axes: Array of gpio_tilt_axis descriptions
- * @nr_axes: Number of axes
- * @states: Array of gpio_tilt_state entries describing
- * the gpio state for specific tilts
- * @nr_states: Number of states available
- * @debounce_interval: debounce ticks interval in msecs
- * @poll_interval: polling interval in msecs - for polling driver only
- * @enable: callback to enable the tilt switch
- * @disable: callback to disable the tilt switch
- *
- * This structure contains gpio-tilt-switch configuration
- * information that must be passed by platform code to the
- * gpio-tilt input driver.
- */
-struct gpio_tilt_platform_data {
- struct gpio *gpios;
- int nr_gpios;
-
- struct gpio_tilt_axis *axes;
- int nr_axes;
-
- struct gpio_tilt_state *states;
- int nr_states;
-
- int debounce_interval;
-
- unsigned int poll_interval;
- int (*enable)(struct device *dev);
- void (*disable)(struct device *dev);
-};
-
-#endif
--
2.14.3
^ permalink raw reply related
* [PATCH] Input: misc: gpio_tilt: Delete driver
From: Heiko Stuebner @ 2017-12-27 13:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171227121547.20558-1-linus.walleij@linaro.org>
Hi Linus,
Am Mittwoch, 27. Dezember 2017, 13:15:47 CET schrieb Linus Walleij:
> This driver was merged in 2011 as a tool for detecting the orientation
> of a screen. The device driver assumes board file setup using the
> platform data from <linux/input/gpio_tilt.h>. But no boards in the
> kernel tree defines this platform data.
>
> As I am faced with refactoring drivers to use GPIO descriptors and
> pass decriptor tables from boards, or use the device tree device
> drivers like these creates a serious problem: I cannot fix them and
> cannot test them, not even compile-test them with a system actually
> using it (no in-tree boardfile).
>
> I suggest to delete this driver and rewrite it using device tree if
> it is still in use on actively maintained systems.
>
> I can also offer to rewrite it out of the blue using device tree if
> someone promise to test it and help me iterate it.
>
> Cc: Heiko St?bner <heiko@sntech.de>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Heiko: not meaning to be militant here, just contain the situation,
> as stated: if you like the driver and can test it, I can reimplement
> it from scratch using device tree.
It seems that piece of hardware (gpio-connected orientation-sensors)
was really only used in the one s3c24xx-based device I hacked on in 2011.
I somehow lost focus from trying to do the s3c24xx devicetree migration
when I started hacking on Rockchip stuff, so while I do have the devices
still around, I don't think I'll find the time and energy trying to get a
recent kernel to run on them anyway, so I'm fine with dropping the driver.
It's simple enough to get reintroduced if someone really finds a device
using it or time to redo the ereader support using devicetree.
So long story short
Acked-by: Heiko Stuebner <heiko@sntech.de>
Heiko
^ permalink raw reply
* [PATCH 1/5] ARM: dts: imx23: Pass unit address and reg to IOMUX node
From: Fabio Estevam @ 2017-12-27 14:04 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@nxp.com>
Pass unit address and reg to IOMUX node to fix the following build
warning with W=1:
arch/arm/boot/dts/imx23-evk.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/gpmi-pins-fixup missing or empty reg/ranges property
arch/arm/boot/dts/imx23-evk.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/mmc0-pins-fixup missing or empty reg/ranges property
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx23.dtsi | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index 10d57f9..da935a4 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -222,7 +222,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- gpmi_pins_fixup: gpmi-pins-fixup {
+ gpmi_pins_fixup: gpmi-pins-fixup at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX23_PAD_GPMI_WPN__GPMI_WPN
MX23_PAD_GPMI_WRN__GPMI_WRN
@@ -266,7 +267,8 @@
fsl,pull-up = <MXS_PULL_ENABLE>;
};
- mmc0_pins_fixup: mmc0-pins-fixup {
+ mmc0_pins_fixup: mmc0-pins-fixup at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX23_PAD_SSP1_DETECT__SSP1_DETECT
MX23_PAD_SSP1_SCK__SSP1_SCK
--
2.7.4
^ permalink raw reply related
* [PATCH 2/5] ARM: dts: imx28: Pass unit address and reg to IOMUX node
From: Fabio Estevam @ 2017-12-27 14:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1514383478-32544-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@nxp.com>
Pass unit address and reg to IOMUX node to fix the following build
warning with W=1:
arch/arm/boot/dts/imx28-apf28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/gpmi-status-cfg missing or empty reg/ranges property
arch/arm/boot/dts/imx28-apf28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/mmc0-cd-cfg missing or empty reg/ranges property
arch/arm/boot/dts/imx28-apf28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/mmc0-sck-cfg missing or empty reg/ranges property
arch/arm/boot/dts/imx28-apf28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/mmc1-cd-cfg missing or empty reg/ranges property
arch/arm/boot/dts/imx28-apf28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/mmc1-sck-cfg missing or empty reg/ranges property
arch/arm/boot/dts/imx28-apf28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/mmc2-cd-cfg missing or empty reg/ranges property
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx28.dtsi | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 2f4ebe0..8a6f3e0 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -283,7 +283,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- gpmi_status_cfg: gpmi-status-cfg {
+ gpmi_status_cfg: gpmi-status-cfg at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_GPMI_RDN__GPMI_RDN
MX28_PAD_GPMI_WRN__GPMI_WRN
@@ -527,14 +528,16 @@
fsl,pull-up = <MXS_PULL_ENABLE>;
};
- mmc0_cd_cfg: mmc0-cd-cfg {
+ mmc0_cd_cfg: mmc0-cd-cfg at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT
>;
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- mmc0_sck_cfg: mmc0-sck-cfg {
+ mmc0_sck_cfg: mmc0-sck-cfg at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_SSP0_SCK__SSP0_SCK
>;
@@ -558,14 +561,16 @@
fsl,pull-up = <MXS_PULL_ENABLE>;
};
- mmc1_cd_cfg: mmc1-cd-cfg {
+ mmc1_cd_cfg: mmc1-cd-cfg at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_GPMI_RDY0__SSP1_CARD_DETECT
>;
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- mmc1_sck_cfg: mmc1-sck-cfg {
+ mmc1_sck_cfg: mmc1-sck-cfg at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_GPMI_WRN__SSP1_SCK
>;
@@ -606,7 +611,8 @@
fsl,pull-up = <MXS_PULL_ENABLE>;
};
- mmc2_cd_cfg: mmc2-cd-cfg {
+ mmc2_cd_cfg: mmc2-cd-cfg at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_AUART1_RX__SSP2_CARD_DETECT
>;
--
2.7.4
^ permalink raw reply related
* [PATCH 3/5] ARM: dts: imx28-tx28: Pass unit address and reg to IOMUX node
From: Fabio Estevam @ 2017-12-27 14:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1514383478-32544-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@nxp.com>
Pass unit address and reg to IOMUX node to fix the following build
warning with W=1:
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/tx28-edt-ft5x06-pins missing or empty reg/ranges property
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/tx28-flexcan-xcvr-pins missing or empty reg/ranges property
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/tx28-lcdif-23bit missing or empty reg/ranges property
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/tx28-lcdif-ctrl missing or empty reg/ranges property
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/tx28-mac0-gpio-pins missing or empty reg/ranges property
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/tx28-pca9554-pins missing or empty reg/ranges property
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/spi-gpiogrp missing or empty reg/ranges property
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/tx28-tsc2007-pins missing or empty reg/ranges property
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/tx28-usbphy0-pins missing or empty reg/ranges property
arch/arm/boot/dts/imx28-tx28.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/tx28-usbphy1-pins missing or empty reg/ranges property
Cc: Lothar Wa?mann <LW@KARO-electronics.de>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx28-tx28.dts | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index 152621e..8a4f5bc 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -531,7 +531,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- tx28_edt_ft5x06_pins: tx28-edt-ft5x06-pins {
+ tx28_edt_ft5x06_pins: tx28-edt-ft5x06-pins at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_SSP0_DATA6__GPIO_2_6 /* RESET */
MX28_PAD_SSP0_DATA5__GPIO_2_5 /* IRQ */
@@ -542,7 +543,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- tx28_flexcan_xcvr_pins: tx28-flexcan-xcvr-pins {
+ tx28_flexcan_xcvr_pins: tx28-flexcan-xcvr-pins at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_LCD_D00__GPIO_1_0
>;
@@ -551,7 +553,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- tx28_lcdif_23bit_pins: tx28-lcdif-23bit {
+ tx28_lcdif_23bit_pins: tx28-lcdif-23bit at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
/* LCD_D00 may be used as Flexcan Transceiver Enable on STK5-V5 */
MX28_PAD_LCD_D01__LCD_D1
@@ -583,7 +586,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- tx28_lcdif_ctrl_pins: tx28-lcdif-ctrl {
+ tx28_lcdif_ctrl_pins: tx28-lcdif-ctrl at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_LCD_ENABLE__GPIO_1_31 /* Enable */
MX28_PAD_LCD_RESET__GPIO_3_30 /* Reset */
@@ -593,7 +597,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- tx28_mac0_pins_gpio: tx28-mac0-gpio-pins {
+ tx28_mac0_pins_gpio: tx28-mac0-gpio-pins at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_ENET0_MDC__GPIO_4_0
MX28_PAD_ENET0_MDIO__GPIO_4_1
@@ -610,7 +615,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- tx28_pca9554_pins: tx28-pca9554-pins {
+ tx28_pca9554_pins: tx28-pca9554-pins at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_PWM3__GPIO_3_28
>;
@@ -619,7 +625,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- tx28_spi_gpio_pins: spi-gpiogrp {
+ tx28_spi_gpio_pins: spi-gpiogrp at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_AUART2_RX__GPIO_3_8
MX28_PAD_AUART2_TX__GPIO_3_9
@@ -633,7 +640,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- tx28_tsc2007_pins: tx28-tsc2007-pins {
+ tx28_tsc2007_pins: tx28-tsc2007-pins at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_SAIF0_MCLK__GPIO_3_20 /* TSC2007 IRQ */
>;
@@ -643,7 +651,8 @@
};
- tx28_usbphy0_pins: tx28-usbphy0-pins {
+ tx28_usbphy0_pins: tx28-usbphy0-pins at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_GPMI_CE2N__GPIO_0_18 /* USBOTG_VBUSEN */
MX28_PAD_GPMI_CE3N__GPIO_0_19 /* USBOTH_OC */
@@ -653,7 +662,8 @@
fsl,pull-up = <MXS_PULL_DISABLE>;
};
- tx28_usbphy1_pins: tx28-usbphy1-pins {
+ tx28_usbphy1_pins: tx28-usbphy1-pins at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_SPDIF__GPIO_3_27 /* USBH_VBUSEN */
MX28_PAD_JTAG_RTCK__GPIO_4_20 /* USBH_OC */
--
2.7.4
^ permalink raw reply related
* [PATCH 4/5] ARM: dts: imx28-apx4devkit: Pass unit address and reg to IOMUX node
From: Fabio Estevam @ 2017-12-27 14:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1514383478-32544-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@nxp.com>
Pass unit address and reg to IOMUX node to fix the following build
warning with W=1:
arch/arm/boot/dts/imx28-apx4devkit.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbh at 80000000/pinctrl at 80018000/mmc2-sck-cfg-apx4 missing or empty reg/ranges property
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx28-apx4devkit.dts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/imx28-apx4devkit.dts b/arch/arm/boot/dts/imx28-apx4devkit.dts
index ae07834..91456bc 100644
--- a/arch/arm/boot/dts/imx28-apx4devkit.dts
+++ b/arch/arm/boot/dts/imx28-apx4devkit.dts
@@ -82,7 +82,8 @@
fsl,pull-up = <MXS_PULL_ENABLE>;
};
- mmc2_sck_cfg_apx4: mmc2-sck-cfg-apx4 {
+ mmc2_sck_cfg_apx4: mmc2-sck-cfg-apx4 at 0 {
+ reg = <0>;
fsl,pinmux-ids = <
MX28_PAD_SSP0_DATA7__SSP2_SCK
>;
--
2.7.4
^ permalink raw reply related
* [PATCH 5/5] ARM: dts: imx28-cfa10049: Move i2cmux out of bus node
From: Fabio Estevam @ 2017-12-27 14:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1514383478-32544-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@nxp.com>
Move i2cmux node from soc node to root node.
i2cmux node does not have any register properties and thus shouldn't be
placed on the bus.
This fixes the following build warnings with W=1:
arch/arm/boot/dts/imx28-cfa10049.dtb: Warning (simple_bus_reg): Node /apb at 80000000/apbx at 80040000/i2cmux missing or empty reg/ranges property
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx28-cfa10049.dts | 130 +++++++++++++++++------------------
1 file changed, 65 insertions(+), 65 deletions(-)
diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
index 4cd52d5..60e5c7f 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -19,6 +19,71 @@
model = "Crystalfontz CFA-10049 Board";
compatible = "crystalfontz,cfa10049", "crystalfontz,cfa10036", "fsl,imx28";
+ i2cmux {
+ compatible = "i2c-mux-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2cmux_pins_cfa10049>;
+ mux-gpios = <&gpio1 22 0 &gpio1 23 0>;
+ i2c-parent = <&i2c1>;
+
+ i2c at 0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ adc0: nau7802 at 2a {
+ compatible = "nuvoton,nau7802";
+ reg = <0x2a>;
+ nuvoton,vldo = <3000>;
+ };
+ };
+
+ i2c at 1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+
+ adc1: nau7802 at 2a {
+ compatible = "nuvoton,nau7802";
+ reg = <0x2a>;
+ nuvoton,vldo = <3000>;
+ };
+ };
+
+ i2c at 2 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <2>;
+
+ adc2: nau7802 at 2a {
+ compatible = "nuvoton,nau7802";
+ reg = <0x2a>;
+ nuvoton,vldo = <3000>;
+ };
+ };
+
+ i2c at 3 {
+ reg = <3>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pca9555: pca9555 at 20 {
+ compatible = "nxp,pca9555";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pca_pins_cfa10049>;
+ interrupt-parent = <&gpio2>;
+ interrupts = <19 0x2>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ reg = <0x20>;
+ };
+ };
+ };
+
apb at 80000000 {
apbh at 80000000 {
pinctrl at 80018000 {
@@ -219,71 +284,6 @@
status = "okay";
};
- i2cmux {
- compatible = "i2c-mux-gpio";
- #address-cells = <1>;
- #size-cells = <0>;
- pinctrl-names = "default";
- pinctrl-0 = <&i2cmux_pins_cfa10049>;
- mux-gpios = <&gpio1 22 0 &gpio1 23 0>;
- i2c-parent = <&i2c1>;
-
- i2c at 0 {
- #address-cells = <1>;
- #size-cells = <0>;
- reg = <0>;
-
- adc0: nau7802 at 2a {
- compatible = "nuvoton,nau7802";
- reg = <0x2a>;
- nuvoton,vldo = <3000>;
- };
- };
-
- i2c at 1 {
- #address-cells = <1>;
- #size-cells = <0>;
- reg = <1>;
-
- adc1: nau7802 at 2a {
- compatible = "nuvoton,nau7802";
- reg = <0x2a>;
- nuvoton,vldo = <3000>;
- };
- };
-
- i2c at 2 {
- #address-cells = <1>;
- #size-cells = <0>;
- reg = <2>;
-
- adc2: nau7802 at 2a {
- compatible = "nuvoton,nau7802";
- reg = <0x2a>;
- nuvoton,vldo = <3000>;
- };
- };
-
- i2c at 3 {
- reg = <3>;
- #address-cells = <1>;
- #size-cells = <0>;
-
- pca9555: pca9555 at 20 {
- compatible = "nxp,pca9555";
- pinctrl-names = "default";
- pinctrl-0 = <&pca_pins_cfa10049>;
- interrupt-parent = <&gpio2>;
- interrupts = <19 0x2>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupt-cells = <2>;
- reg = <0x20>;
- };
- };
- };
-
usbphy1: usbphy at 8007e000 {
status = "okay";
};
--
2.7.4
^ permalink raw reply related
* [PATCH 00/12] drop unneeded newline
From: Julia Lawall @ 2017-12-27 14:51 UTC (permalink / raw)
To: linux-arm-kernel
Drop newline at the end of a message string when the printing function adds
a newline.
The complete semantic patch that detects this issue is as shown below
(http://coccinelle.lip6.fr/). It works in two phases - the first phase
counts how many uses of a function involve a newline and how many don't,
and then the second phase removes newlines in the case of calls where a
newline is used one fourth of the times or less.
This approach is only moderately reliable, and all patches have been
checked to ensure that the newline is not needed.
This also converts some cases of string concatenation to single strings in
modified code, as this improves greppability.
// <smpl>
virtual after_start
@initialize:ocaml@
@@
let withnl = Hashtbl.create 101
let withoutnl = Hashtbl.create 101
let ignore =
["strcpy";"strlcpy";"strcat";"strlcat";"strcmp";"strncmp";"strcspn";
"strsep";"sprintf";"printf";"strncasecmp";"seq_printf";"strstr";"strspn";
"strlen";"strpbrk";"strtok_r";"memcmp";"memcpy"]
let dignore = ["tools";"samples"]
let inc tbl k =
let cell =
try Hashtbl.find tbl k
with Not_found ->
let cell = ref 0 in
Hashtbl.add tbl k cell;
cell in
cell := 1 + !cell
let endnl c =
let len = String.length c in
try
String.get c (len-3) = '\\' && String.get c (len-2) = 'n' &&
String.get c (len-1) = '"'
with _ -> false
let clean_string s extra =
let pieces = Str.split (Str.regexp "\" \"") s in
let nonempty s =
not (s = "") && String.get s 0 = '"' && not (String.get s 1 = '"') in
let rec loop = function
[] -> []
| [x] -> [x]
| x::y::rest ->
if nonempty x && nonempty y
then
let xend = String.get x (String.length x - 2) = ' ' in
let yend = String.get y 1 = ' ' in
match (xend,yend) with
(true,false) | (false,true) -> x :: (loop (y::rest))
| (true,true) ->
x :: (loop (((String.sub y 0 (String.length y - 2))^"\"")::rest))
| (false,false) ->
((String.sub x 0 (String.length x - 1)) ^ " \"") ::
(loop (y::rest))
else x :: (loop (y::rest)) in
(String.concat "" (loop pieces))^extra
@r depends on !after_start@
constant char[] c;
expression list[n] es;
identifier f;
position p;
@@
f at p(es,c,...)
@script:ocaml@
f << r.f;
n << r.n;
p << r.p;
c << r.c;
@@
let pieces = Str.split (Str.regexp "/") (List.hd p).file in
if not (List.mem f ignore) &&
List.for_all (fun x -> not (List.mem x pieces)) dignore
then
(if endnl c
then inc withnl (f,n)
else inc withoutnl (f,n))
@finalize:ocaml depends on !after_start@
w1 << merge.withnl;
w2 << merge.withoutnl;
@@
let names = ref [] in
let incn tbl k v =
let cell =
try Hashtbl.find tbl k
with Not_found ->
begin
let cell = ref 0 in
Hashtbl.add tbl k cell;
cell
end in
(if not (List.mem k !names) then names := k :: !names);
cell := !v + !cell in
List.iter (function w -> Hashtbl.iter (incn withnl) w) w1;
List.iter (function w -> Hashtbl.iter (incn withoutnl) w) w2;
List.iter
(function name ->
let wth = try !(Hashtbl.find withnl name) with _ -> 0 in
let wo = try !(Hashtbl.find withoutnl name) with _ -> 0 in
if wth > 0 && wth <= wo / 3 then Hashtbl.remove withnl name
else (Printf.eprintf "dropping %s %d %d\n" (fst name) wth wo; Hashtbl.remove withoutnl name; Hashtbl.remove withnl name))
!names;
let it = new iteration() in
it#add_virtual_rule After_start;
it#register()
@s1 depends on after_start@
constant char[] c;
expression list[n] es;
identifier f;
position p;
@@
f(es,c@p,...)
@script:ocaml s2@
f << s1.f;
n << s1.n;
c << s1.c;
newc;
@@
try
let _ = Hashtbl.find withnl (f,n) in
if endnl c
then Coccilib.include_match false
else newc :=
make_expr(clean_string (String.sub c 0 (String.length c - 1)) "\\n\"")
with Not_found ->
try
let _ = Hashtbl.find withoutnl (f,n) in
if endnl c
then newc :=
make_expr(clean_string (String.sub c 0 (String.length c - 3)) "\"")
else Coccilib.include_match false
with Not_found -> Coccilib.include_match false
@@
constant char[] s1.c;
position s1.p;
expression s2.newc;
@@
- c at p
+ newc
// </smpl>
---
arch/arm/mach-davinci/board-da850-evm.c | 4 ++--
drivers/block/DAC960.c | 4 ++--
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 12 ++++++++----
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 2 +-
drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c | 2 +-
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 2 +-
drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 2 +-
drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 3 ++-
drivers/s390/block/dasd_diag.c | 3 +--
drivers/scsi/hpsa.c | 2 +-
fs/dlm/plock.c | 3 +--
fs/ext2/super.c | 2 +-
fs/hpfs/dnode.c | 3 ++-
net/dccp/ackvec.c | 2 +-
net/openvswitch/conntrack.c | 4 ++--
tools/perf/tests/dso-data.c | 9 +++++----
16 files changed, 32 insertions(+), 27 deletions(-)
^ permalink raw reply
* [PATCH 07/12] ARM: davinci: drop unneeded newline
From: Julia Lawall @ 2017-12-27 14:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1514386305-7402-1-git-send-email-Julia.Lawall@lip6.fr>
gpio_request uses its second argument as a label, so it doesn't seem
appropriate for it to have a newline. Done using Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
arch/arm/mach-davinci/board-da850-evm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index cbde003..d898a94 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -798,11 +798,11 @@ static int da850_lcd_hw_init(void)
{
int status;
- status = gpio_request(DA850_LCD_BL_PIN, "lcd bl\n");
+ status = gpio_request(DA850_LCD_BL_PIN, "lcd bl");
if (status < 0)
return status;
- status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr\n");
+ status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr");
if (status < 0) {
gpio_free(DA850_LCD_BL_PIN);
return status;
^ permalink raw reply related
* [PATCH 0/4] Sunxi: Add SMP support on A83T
From: Mylene JOSSERAND @ 2017-12-27 15:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171215061046.GA9845@Red>
Hello Corentin,
Le Fri, 15 Dec 2017 07:10:46 +0100,
Corentin Labbe <clabbe.montjoie@gmail.com> a ?crit :
> On Tue, Dec 12, 2017 at 09:24:25AM +0100, Maxime Ripard wrote:
> > Hi,
> >
> > On Mon, Dec 11, 2017 at 08:35:34PM +0100, Corentin Labbe wrote:
> > > On Mon, Dec 11, 2017 at 08:49:57AM +0100, Myl?ne Josserand wrote:
> > > > This series adds SMP support for Allwinner Sun8i-a83t
> > > > with MCPM (Multi-Cluster Power Management).
> > > > Series information:
> > > > - Based on last linux-next (next-20171211)
> > > > - Had dependencies on Chen Yu's patch that add MCPM
> > > > support:
> > > > https://patchwork.kernel.org/patch/6402801/
> > > >
> > > > Patch 01: Convert the mcpm driver (initially for A80) to be able
> > > > to use it for A83T. This SoC has a bit flip that needs to be handled.
> > > > Patch 02: Add registers nodes (prcm, cpucfg and r_cpucfg) needed
> > > > for MCPM.
> > > > Patch 03: Add CCI-400 node for a83t.
> > > > Patch 04: Fix the use of virtual timers that hangs the kernel in
> > > > case of SMP support.
> > >
> > > As we discussed in private, Chen Yu's patch should be added in your series.
> >
> > Not really, she mentionned the dependency in the cover letter, and
> > it's a good way to do things too. Sure, you can do it your way, but
> > there's no preference.
> >
>
> If the goal of this series is to be applied, the dependency must be applied also.
> And since the dependency is 2 years old (and part of a serie which does not apply now), I think cherry picking the patch and send it for review is better.
>
> > > Furthermore, MCPM is not automaticaly selected via imply.
> >
> > Well, yes, is that an issue?
> >
>
> After reading the imply documentation, no.
>
> > > With all patchs I hit a bug:
> > > [ 0.898668] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:238
> >
> > I guess this is with CONFIG_PROVE_LOCKING enabled?
> >
>
> No, the BUG() printed is enabled by default
>
> > > [ 0.911162] in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper/0
> > > [ 0.917776] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.15.0-rc2-next-20171211+ #73
> >
> > What are the changes you've made?
> >
>
> Just adding wens's patch and this series.
I tried to reproduce your issue without success (even with
CONFIG_PROVE_LOCKING enabled, just in case).
Can you give me more details about your tests? which defconfig and
additional configurations?
>
> > > [ 0.925418] Hardware name: Allwinner sun8i Family
> > > [ 0.930118] Backtrace:
> > > [ 0.932596] [<c010cc50>] (dump_backtrace) from [<c010cf0c>] (show_stack+0x18/0x1c)
> > > [ 0.940158] r7:c0b261e4 r6:60000013 r5:00000000 r4:c0b51958
> > > [ 0.945820] [<c010cef4>] (show_stack) from [<c06baccc>] (dump_stack+0x8c/0xa0)
> > > [ 0.953045] [<c06bac40>] (dump_stack) from [<c0149d40>] (___might_sleep+0x150/0x170)
> > > [ 0.960779] r7:c0b261e4 r6:00000000 r5:000000ee r4:ee844000
> > > [ 0.966437] [<c0149bf0>] (___might_sleep) from [<c0149dc8>] (__might_sleep+0x68/0xa0)
> > > [ 0.974253] r4:c0861690
> > > [ 0.976796] [<c0149d60>] (__might_sleep) from [<c06d2918>] (mutex_lock+0x24/0x68)
> > > [ 0.984269] r6:c0892f6c r5:ffffffff r4:c0b1bb24
> > > [ 0.988891] [<c06d28f4>] (mutex_lock) from [<c01ccb6c>] (perf_pmu_register+0x24/0x3e4)
> > > [ 0.996795] r5:ffffffff r4:ee98b014
> > > [ 1.000375] [<c01ccb48>] (perf_pmu_register) from [<c03efabc>] (cci_pmu_probe+0x340/0x484)
> > > [ 1.008631] r10:c0892f6c r9:c0bfd5f0 r8:eea19010 r7:c0b261e4 r6:c0b26240 r5:eea19000
> > > [ 1.016447] r4:ee98b010
> > > [ 1.018989] [<c03ef77c>] (cci_pmu_probe) from [<c045e21c>] (platform_drv_probe+0x58/0xb8)
> > > [ 1.027158] r10:00000000 r9:c0b2610c r8:00000000 r7:fffffdfb r6:c0b2610c r5:ffffffed
> > > [ 1.034974] r4:eea19010
> > > [ 1.037511] [<c045e1c4>] (platform_drv_probe) from [<c045c984>] (driver_probe_device+0x254/0x330)
> > > [ 1.046371] r7:00000000 r6:c0bff498 r5:c0bff494 r4:eea19010
> > > [ 1.052026] [<c045c730>] (driver_probe_device) from [<c045cbc4>] (__device_attach_driver+0xa0/0xd4)
> > > [ 1.061062] r10:00000000 r9:c0bff470 r8:00000000 r7:00000001 r6:eea19010 r5:ee845ac0
> > > [ 1.068879] r4:c0b2610c r3:00000000
> > > [ 1.072454] [<c045cb24>] (__device_attach_driver) from [<c045ad68>] (bus_for_each_drv+0x68/0x9c)
> > > [ 1.081228] r7:00000001 r6:c045cb24 r5:ee845ac0 r4:00000000
> > > [ 1.086883] [<c045ad00>] (bus_for_each_drv) from [<c045c60c>] (__device_attach+0xb8/0x11c)
> > > [ 1.095135] r6:c0b3e848 r5:eea19044 r4:eea19010
> > > [ 1.099750] [<c045c554>] (__device_attach) from [<c045cc44>] (device_initial_probe+0x14/0x18)
> > > [ 1.108263] r7:c0b0a4c8 r6:c0b3e848 r5:eea19010 r4:eea19018
> > > [ 1.113919] [<c045cc30>] (device_initial_probe) from [<c045bb58>] (bus_probe_device+0x8c/0x94)
> > > [ 1.122523] [<c045bacc>] (bus_probe_device) from [<c0459db8>] (device_add+0x40c/0x5a0)
> > > [ 1.130429] r7:c0b0a4c8 r6:eea19010 r5:eea18a10 r4:eea19018
> > > [ 1.136089] [<c04599ac>] (device_add) from [<c0582a58>] (of_device_add+0x3c/0x44)
> > > [ 1.143564] r10:00000000 r9:00000000 r8:00000000 r7:eedf21a4 r6:eea18a10 r5:00000000
> > > [ 1.151380] r4:eea19000
> > > [ 1.153915] [<c0582a1c>] (of_device_add) from [<c0582f80>] (of_platform_device_create_pdata+0x7c/0xac)
> > > [ 1.163210] [<c0582f04>] (of_platform_device_create_pdata) from [<c0583100>] (of_platform_bus_create+0xf4/0x1f0)
> > > [ 1.173372] r9:00000000 r8:00000000 r7:00000001 r6:00000000 r5:eedf2154 r4:00000000
> > > [ 1.181107] [<c058300c>] (of_platform_bus_create) from [<c0583374>] (of_platform_populate+0x74/0xd4)
> > > [ 1.190229] r10:00000001 r9:eea18a10 r8:00000000 r7:00000000 r6:00000000 r5:eedf1d04
> > > [ 1.198045] r4:eedf2154
> > > [ 1.200580] [<c0583300>] (of_platform_populate) from [<c03ef2a8>] (cci_platform_probe+0x3c/0x54)
> > > [ 1.209356] r10:00000000 r9:c0b26168 r8:00000000 r7:fffffdfb r6:c0b26168 r5:ffffffed
> > > [ 1.217172] r4:eea18a00
> > > [ 1.219708] [<c03ef26c>] (cci_platform_probe) from [<c045e21c>] (platform_drv_probe+0x58/0xb8)
> > > [ 1.228306] r5:ffffffed r4:eea18a10
> > > [ 1.231881] [<c045e1c4>] (platform_drv_probe) from [<c045c984>] (driver_probe_device+0x254/0x330)
> > > [ 1.240742] r7:00000000 r6:c0bff498 r5:c0bff494 r4:eea18a10
> > > [ 1.246397] [<c045c730>] (driver_probe_device) from [<c045cbc4>] (__device_attach_driver+0xa0/0xd4)
> > > [ 1.255433] r10:00000000 r9:c0bff470 r8:00000000 r7:00000001 r6:eea18a10 r5:ee845ce8
> > > [ 1.263250] r4:c0b26168 r3:00000000
> > > [ 1.266825] [<c045cb24>] (__device_attach_driver) from [<c045ad68>] (bus_for_each_drv+0x68/0x9c)
> > > [ 1.275598] r7:00000001 r6:c045cb24 r5:ee845ce8 r4:00000000
> > > [ 1.281253] [<c045ad00>] (bus_for_each_drv) from [<c045c60c>] (__device_attach+0xb8/0x11c)
> > > [ 1.289506] r6:c0b3e848 r5:eea18a44 r4:eea18a10
> > > [ 1.294120] [<c045c554>] (__device_attach) from [<c045cc44>] (device_initial_probe+0x14/0x18)
> > > [ 1.302633] r7:c0b0a4c8 r6:c0b3e848 r5:eea18a10 r4:eea18a18
> > > [ 1.308288] [<c045cc30>] (device_initial_probe) from [<c045bb58>] (bus_probe_device+0x8c/0x94)
> > > [ 1.316890] [<c045bacc>] (bus_probe_device) from [<c0459db8>] (device_add+0x40c/0x5a0)
> > > [ 1.324796] r7:c0b0a4c8 r6:eea18a10 r5:ee993810 r4:eea18a18
> > > [ 1.330450] [<c04599ac>] (device_add) from [<c0582a58>] (of_device_add+0x3c/0x44)
> > > [ 1.337926] r10:00000000 r9:c07759d8 r8:00000000 r7:eedf1d54 r6:ee993810 r5:00000000
> > > [ 1.345743] r4:eea18a00
> > > [ 1.348277] [<c0582a1c>] (of_device_add) from [<c0582f80>] (of_platform_device_create_pdata+0x7c/0xac)
> > > [ 1.357572] [<c0582f04>] (of_platform_device_create_pdata) from [<c0583100>] (of_platform_bus_create+0xf4/0x1f0)
> > > [ 1.367734] r9:c07759d8 r8:00000000 r7:00000001 r6:00000000 r5:eedf1d04 r4:00000000
> > > [ 1.375469] [<c058300c>] (of_platform_bus_create) from [<c058315c>] (of_platform_bus_create+0x150/0x1f0)
> > > [ 1.384938] r10:ee993810 r9:c07759d8 r8:00000000 r7:00000001 r6:00000000 r5:eedefe1c
> > > [ 1.392754] r4:eedf1d04
> > > [ 1.395289] [<c058300c>] (of_platform_bus_create) from [<c0583374>] (of_platform_populate+0x74/0xd4)
> > > [ 1.404411] r10:00000001 r9:00000000 r8:00000000 r7:c07759d8 r6:00000000 r5:eedee844
> > > [ 1.412228] r4:eedefe1c
> > > [ 1.414769] [<c0583300>] (of_platform_populate) from [<c0a25ee8>] (of_platform_default_populate_init+0x80/0x94)
> > > [ 1.424844] r10:c0a37848 r9:00000000 r8:c0b59680 r7:c0a37834 r6:ffffe000 r5:c0775ce8
> > > [ 1.432661] r4:00000000
> > > [ 1.435200] [<c0a25e68>] (of_platform_default_populate_init) from [<c0102794>] (do_one_initcall+0x5c/0x194)
> > > [ 1.444925] r5:c0a25e68 r4:c0b0a4c8
> > > [ 1.448506] [<c0102738>] (do_one_initcall) from [<c0a00f88>] (kernel_init_freeable+0x1d4/0x268)
> > > [ 1.457195] r9:00000004 r8:c0b59680 r7:c0a37834 r6:c0b59680 r5:c0a47308 r4:c090cfb8
> > > [ 1.464932] [<c0a00db4>] (kernel_init_freeable) from [<c06cf3b0>] (kernel_init+0x10/0x118)
> > > [ 1.473187] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c06cf3a0
> > > [ 1.481004] r4:00000000
> > > [ 1.483540] [<c06cf3a0>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
> > > [ 1.491098] Exception stack(0xee845fb0 to 0xee845ff8)
> > > [ 1.496146] 5fa0: 00000000 00000000 00000000 00000000
> > > [ 1.504313] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> > > [ 1.512480] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
> > > [ 1.519084] r5:c06cf3a0 r4:00000000
> > > [ 1.522737] ARM CCI_400_r1 PMU driver probed
> > >
> > > And only CPU 0 show up.
> >
> > This looks more like a bug in the CCI code, and not in this serie
> > itself. Can you share your whole boot logs?
> >
>
> This week end I will retry and send it.
By any chance, did you try it again? Can you reproduce it on your side?
Thank you in advance,
Best regards,
--
Myl?ne Josserand, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply
* [PATCH] ARM: NOMMU: Make sure we do not hold stale data in mem[] array
From: Vladimir Murzin @ 2017-12-27 16:11 UTC (permalink / raw)
To: linux-arm-kernel
adjust_lowmem_bounds() called twice which can lead to stalled data
(i.e. subreg) value in mem[] array after the first call.
Zero out mem[] array before we allocate MPU regions for memory.
Fixes: 5c9d9a1b3a54 ("ARM: 8712/1: NOMMU: Use more MPU regions to cover memory")
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
KernelVersion: 4.15-rc1
arch/arm/mm/pmsa-v7.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mm/pmsa-v7.c b/arch/arm/mm/pmsa-v7.c
index 976df60..f65c01f 100644
--- a/arch/arm/mm/pmsa-v7.c
+++ b/arch/arm/mm/pmsa-v7.c
@@ -6,6 +6,7 @@
#include <linux/bitops.h>
#include <linux/memblock.h>
+#include <linux/string.h>
#include <asm/cacheflush.h>
#include <asm/cp15.h>
@@ -296,6 +297,7 @@ void __init adjust_lowmem_bounds_mpu(void)
}
}
+ memset(mem, 0, sizeof(mem));
num = allocate_region(mem_start, specified_mem_size, mem_max_regions, mem);
for (i = 0; i < num; i++) {
--
2.0.0
^ permalink raw reply related
* [PATCH 1/2] ARM: dts: imx27-eukrea-mbimxsd27-baseboard: Pass missing unit address
From: Fabio Estevam @ 2017-12-27 16:23 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@nxp.com>
ads7846 is connected to SPI chip select 0, so pass the unit address
accordingly to fix the following build warning with W=1:
arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dtb: Warning (unit_address_vs_reg): Node /soc/aipi at 10000000/cspi at 1000e000/ads7846 has a reg or ranges property, but no unit name
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts b/arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts
index f565357..15145e7 100644
--- a/arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts
+++ b/arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dts
@@ -84,7 +84,7 @@
cs-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
status = "okay";
- ads7846 {
+ ads7846 at 0 {
compatible = "ti,ads7846";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_touch>;
--
2.7.4
^ permalink raw reply related
* [PATCH 2/2] ARM: dts: imx27-eukrea-cpuimx27: Remove 'simple-bus' from clocks node
From: Fabio Estevam @ 2017-12-27 16:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1514391804-9518-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@nxp.com>
clock node should not have a 'simple-bus' compatible string, so remove it
in order to fix the following build warning with W=1:
arch/arm/boot/dts/imx27-eukrea-mbimxsd27-baseboard.dtb: Warning (simple_bus_reg): Node /clocks/osc26m missing or empty reg/ranges property
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi b/arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi
index 2cf896c..7c75147 100644
--- a/arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi
+++ b/arch/arm/boot/dts/imx27-eukrea-cpuimx27.dtsi
@@ -23,7 +23,6 @@
clocks {
#address-cells = <1>;
#size-cells = <0>;
- compatible = "simple-bus";
clk14745600: clock at 0 {
#clock-cells = <0>;
--
2.7.4
^ permalink raw reply related
* [PATCH v9 8/9] KVM: arm/arm64: Avoid work when userspace iqchips are not used
From: Marc Zyngier @ 2017-12-27 16:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171220113606.7030-9-christoffer.dall@linaro.org>
On Wed, 20 Dec 2017 11:36:05 +0000,
Christoffer Dall wrote:
>
> We currently check if the VM has a userspace irqchip in several places
> along the critical path, and if so, we do some work which is only
> required for having an irqchip in userspace. This is unfortunate, as we
> could avoid doing any work entirely, if we didn't have to support
> irqchip in userspace.
>
> Realizing the userspace irqchip on ARM is mostly a developer or hobby
> feature, and is unlikely to be used in servers or other scenarios where
> performance is a priority, we can use a refcounted static key to only
> check the irqchip configuration when we have at least one VM that uses
> an irqchip in userspace.
>
> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
> ---
> arch/arm/include/asm/kvm_host.h | 2 ++
> arch/arm64/include/asm/kvm_host.h | 2 ++
> virt/kvm/arm/arch_timer.c | 6 ++--
> virt/kvm/arm/arm.c | 59 ++++++++++++++++++++++++++++-----------
> 4 files changed, 50 insertions(+), 19 deletions(-)
>
> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> index a9f7d3f47134..6394fb99da7f 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -48,6 +48,8 @@
> KVM_ARCH_REQ_FLAGS(0, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
> #define KVM_REQ_IRQ_PENDING KVM_ARCH_REQ(1)
>
> +DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
> +
> u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode);
> int __attribute_const__ kvm_target_cpu(void);
> int kvm_reset_vcpu(struct kvm_vcpu *vcpu);
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index ea6cb5b24258..e7218cf7df2a 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -47,6 +47,8 @@
> KVM_ARCH_REQ_FLAGS(0, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
> #define KVM_REQ_IRQ_PENDING KVM_ARCH_REQ(1)
>
> +DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
> +
> int __attribute_const__ kvm_target_cpu(void);
> int kvm_reset_vcpu(struct kvm_vcpu *vcpu);
> int kvm_arch_dev_ioctl_check_extension(struct kvm *kvm, long ext);
> diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
> index d845d67b7062..cfcd0323deab 100644
> --- a/virt/kvm/arm/arch_timer.c
> +++ b/virt/kvm/arm/arch_timer.c
> @@ -103,7 +103,8 @@ static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id)
> if (kvm_timer_irq_can_fire(vtimer))
> kvm_timer_update_irq(vcpu, true, vtimer);
>
> - if (unlikely(!irqchip_in_kernel(vcpu->kvm)))
> + if (static_branch_unlikely(&userspace_irqchip_in_use) &&
> + unlikely(!irqchip_in_kernel(vcpu->kvm)))
> kvm_vtimer_update_mask_user(vcpu);
>
> return IRQ_HANDLED;
> @@ -284,7 +285,8 @@ static void kvm_timer_update_irq(struct kvm_vcpu *vcpu, bool new_level,
> trace_kvm_timer_update_irq(vcpu->vcpu_id, timer_ctx->irq.irq,
> timer_ctx->irq.level);
>
> - if (likely(irqchip_in_kernel(vcpu->kvm))) {
> + if (!static_branch_unlikely(&userspace_irqchip_in_use) &&
> + likely(irqchip_in_kernel(vcpu->kvm))) {
> ret = kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id,
> timer_ctx->irq.irq,
> timer_ctx->irq.level,
> diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
> index 3610e132df8b..0cf0459134ff 100644
> --- a/virt/kvm/arm/arm.c
> +++ b/virt/kvm/arm/arm.c
> @@ -74,6 +74,8 @@ static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu)
> __this_cpu_write(kvm_arm_running_vcpu, vcpu);
> }
>
> +DEFINE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
> +
> /**
> * kvm_arm_get_running_vcpu - get the vcpu running on the current CPU.
> * Must be called from non-preemptible context
> @@ -302,6 +304,8 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
>
> void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
> {
> + if (vcpu->arch.has_run_once && unlikely(!irqchip_in_kernel(vcpu->kvm)))
> + static_branch_dec(&userspace_irqchip_in_use);
> kvm_arch_vcpu_free(vcpu);
> }
>
> @@ -522,14 +526,22 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu)
>
> vcpu->arch.has_run_once = true;
>
> - /*
> - * Map the VGIC hardware resources before running a vcpu the first
> - * time on this VM.
> - */
> - if (unlikely(irqchip_in_kernel(kvm) && !vgic_ready(kvm))) {
> - ret = kvm_vgic_map_resources(kvm);
> - if (ret)
> - return ret;
> + if (likely(irqchip_in_kernel(kvm))) {
> + /*
> + * Map the VGIC hardware resources before running a vcpu the
> + * first time on this VM.
> + */
> + if (unlikely(!vgic_ready(kvm))) {
> + ret = kvm_vgic_map_resources(kvm);
> + if (ret)
> + return ret;
> + }
> + } else {
> + /*
> + * Tell the rest of the code that there are userspace irqchip
> + * VMs in the wild.
> + */
> + static_branch_inc(&userspace_irqchip_in_use);
> }
>
> ret = kvm_timer_enable(vcpu);
> @@ -664,18 +676,29 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
> kvm_vgic_flush_hwstate(vcpu);
>
> /*
> - * If we have a singal pending, or need to notify a userspace
> - * irqchip about timer or PMU level changes, then we exit (and
> - * update the timer level state in kvm_timer_update_run
> - * below).
> + * Exit if we have a singal pending so that we can deliver the
nit: s/singal/signal/
> + * signal to user space.
> */
> - if (signal_pending(current) ||
> - kvm_timer_should_notify_user(vcpu) ||
> - kvm_pmu_should_notify_user(vcpu)) {
> + if (signal_pending(current)) {
> ret = -EINTR;
> run->exit_reason = KVM_EXIT_INTR;
> }
>
> + /*
> + * If we're using a userspace irqchip, then check if we need
> + * to tell a userspace irqchip about timer or PMU level
> + * changes and if so, exit to userspace (the actual level
> + * state gets updated in kvm_timer_update_run and
> + * kvm_pmu_update_run below.
nit: missing closing parenthesis.
> + */
> + if (static_branch_unlikely(&userspace_irqchip_in_use)) {
> + if (kvm_timer_should_notify_user(vcpu) ||
> + kvm_pmu_should_notify_user(vcpu)) {
> + ret = -EINTR;
> + run->exit_reason = KVM_EXIT_INTR;
> + }
> + }
> +
> /*
> * Ensure we set mode to IN_GUEST_MODE after we disable
> * interrupts and before the final VCPU requests check.
> @@ -688,7 +711,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
> kvm_request_pending(vcpu)) {
> vcpu->mode = OUTSIDE_GUEST_MODE;
> kvm_pmu_sync_hwstate(vcpu);
> - kvm_timer_sync_hwstate(vcpu);
> + if (static_branch_unlikely(&userspace_irqchip_in_use))
> + kvm_timer_sync_hwstate(vcpu);
> kvm_vgic_sync_hwstate(vcpu);
> local_irq_enable();
> preempt_enable();
> @@ -732,7 +756,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
> * we don't want vtimer interrupts to race with syncing the
> * timer virtual interrupt state.
> */
> - kvm_timer_sync_hwstate(vcpu);
> + if (static_branch_unlikely(&userspace_irqchip_in_use))
> + kvm_timer_sync_hwstate(vcpu);
>
> /*
> * We may have taken a host interrupt in HYP mode (ie
> --
> 2.14.2
>
Other than the trivial nits above:
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
M.
^ permalink raw reply
* [PATCH v9 9/9] KVM: arm/arm64: Delete outdated forwarded irq documentation
From: Marc Zyngier @ 2017-12-27 16:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171220113606.7030-10-christoffer.dall@linaro.org>
On Wed, 20 Dec 2017 11:36:06 +0000,
Christoffer Dall wrote:
>
> The reason I added this documentation originally was that the concept of
> "never taking the interrupt", but just use the timer to generate an exit
> from the guest, was confusing to most, and we had to explain it several
> times over. But as we can clearly see, we've failed to update the
> documentation as the code has evolved, and people who need to understand
> these details are probably better off reading the code.
>
> Let's lighten our maintenance burden slightly and just get rid of this.
>
> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
> ---
> Documentation/virtual/kvm/arm/vgic-mapped-irqs.txt | 187 ---------------------
> 1 file changed, 187 deletions(-)
> delete mode 100644 Documentation/virtual/kvm/arm/vgic-mapped-irqs.txt
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
M.
^ permalink raw reply
* [PATCH] Device tree binding for Avago APDS990X light sensor
From: Sakari Ailus @ 2017-12-27 18:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171227091828.GA3307@amd>
Hi Pavel,
Thanks for the patch. Please see my comments below.
On Wed, Dec 27, 2017 at 10:18:28AM +0100, Pavel Machek wrote:
> From: Filip Matijevi? <filip.matijevic.pz@gmail.com>
>
> This prepares binding for light sensor used in Nokia N9.
>
> Signed-off-by: Filip Matijevi? <filip.matijevic.pz@gmail.com>
> Signed-off-by: Pavel machek <pavel@ucw.cz>
>
> ---
>
> Patches to convert APDS990X driver to device tree and to switch to iio
> are available.
>
> diff --git a/Documentation/devicetree/bindings/misc/avago-apds990x.txt b/Documentation/devicetree/bindings/misc/avago-apds990x.txt
> new file mode 100644
> index 0000000..e038146
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/misc/avago-apds990x.txt
> @@ -0,0 +1,39 @@
> +Avago APDS990X driver
> +
> +Required properties:
> +- compatible: "avago,apds990x"
> +- reg: address on the I2C bus
> +- interrupts: external interrupt line number
> +- Vdd-supply: power supply for VDD
> +- Vled-supply: power supply for LEDA
AFAIK the custom is to use lower case letters for regulator supplies.
> +- ga: Glass attenuation
> +- cf1: Clear channel factor 1
> +- irf1: IR channel factor 1
> +- cf2: Clear channel factor 2
> +- irf2: IR channel factor 2
> +- df: Device factor
> +- pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
> +- ppcount: Proximity pulse count
Are these device specific? If so, please add the vendor prefix to them.
I might not use short abbreviations such as "df" either. I wonder what
others think.
> +
> +Example (Nokia N9):
> +
> + als_ps at 39 {
> + compatible = "avago,apds990x";
> + reg = <0x39>;
> +
> + interrupt-parent = <&gpio3>;
> + interrupts = <19 10>; /* gpio_83, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW */
> +
> + Vdd-supply = <&vaux1>;
> + Vled-supply = <&vbat>;
> +
> + ga = <168834>;
> + cf1 = <4096>;
> + irf1 = <7824>;
> + cf2 = <877>;
> + irf2 = <1575>;
> + df = <52>;
> +
> + pdrive = <0x2>; /* APDS_IRLED_CURR_25mA */
> + ppcount = <5>;
> + };
>
--
Kind regards,
Sakari Ailus
sakari.ailus at linux.intel.com
^ permalink raw reply
* [PATCH v2 1/4] dt-bindings: usb: add DT binding for RK3328 dwc3 controller
From: Heiko Stuebner @ 2017-12-27 18:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171204094041.25439-1-heiko@sntech.de>
Am Montag, 4. Dezember 2017, 10:40:38 CET schrieb Heiko Stuebner:
> From: William Wu <william.wu@rock-chips.com>
>
> Adds the device tree bindings description for RK3328 and
> compatible USB DWC3 controller.
>
> Signed-off-by: William Wu <william.wu@rock-chips.com>
> Acked-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
applied all 4 with Felipe's Ack on patch1
^ permalink raw reply
* [PATCH v5 2/2] PCI: mediatek: Set up class type and vendor ID for MT7622
From: Bjorn Helgaas @ 2017-12-27 18:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1514336394-17747-3-git-send-email-honghui.zhang@mediatek.com>
On Wed, Dec 27, 2017 at 08:59:54AM +0800, honghui.zhang at mediatek.com wrote:
> From: Honghui Zhang <honghui.zhang@mediatek.com>
>
> The hardware default value of IDs and class type is not correct,
> fix that by setup the correct values before start up.
>
> Signed-off-by: Honghui Zhang <honghui.zhang@mediatek.com>
> ---
> drivers/pci/host/pcie-mediatek.c | 12 ++++++++++++
> include/linux/pci_ids.h | 2 ++
> 2 files changed, 14 insertions(+)
>
> diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c
> index fc29a9a..62aac0ea 100644
> --- a/drivers/pci/host/pcie-mediatek.c
> +++ b/drivers/pci/host/pcie-mediatek.c
> @@ -74,6 +74,10 @@
>
> /* PCIe V2 per-port registers */
> #define PCIE_MSI_VECTOR 0x0c0
> +
> +#define PCIE_CONF_ID 0x100
> +#define PCIE_CONF_CLASS 0x104
> +
> #define PCIE_INT_MASK 0x420
> #define INTX_MASK GENMASK(19, 16)
> #define INTX_SHIFT 16
> @@ -393,6 +397,14 @@ static int mtk_pcie_startup_port_v2(struct mtk_pcie_port *port)
> val |= PCIE_CSR_LTSSM_EN(port->slot) |
> PCIE_CSR_ASPM_L1_EN(port->slot);
> writel(val, pcie->base + PCIE_SYS_CFG_V2);
> +
> + /* Set up vendor ID and device ID for MT7622*/
> + val = PCI_VENDOR_ID_MEDIATEK;
> + writel(val, port->base + PCIE_CONF_ID);
> +
> + /* Set up class code for MT7622 */
> + val = PCI_CLASS_BRIDGE_PCI << 16;
> + writel(val, port->base + PCIE_CONF_CLASS);
1) Your comments mention MT7622 specifically, but this code is run for
both mt2712-pcie and mt7622-pcie. If this code is safe and necessary
for both mt2712-pcie and mt7622-pcie, please remove the mention of
MT7622.
2) The first comment mentions both "vendor ID and device ID" but you
don't write the device ID. Since this code applies to both
mt2712-pcie and mt7622-pcie, my guess is that you don't *want* to
write the device ID. If that's the case, please fix the comment.
3) If you only need to set the vendor ID, you're performing a 32-bit
write (writel()) to update a 16-bit value. Please use writew()
instead.
4) If you only need to set the vendor ID, please use a definition like
"PCIE_CONF_VENDOR_ID" instead of the ambiguous "PCIE_CONF_ID".
5) If you only need to set the vendor ID, please update the changelog
to mention "vendor ID" specifically instead of the ambiguous "IDs".
6) Please add a space before the closing "*/" of the first comment.
7) PCI_CLASS_BRIDGE_PCI is for a PCI-to-PCI bridge, i.e., one that has
PCI on both the primary (upstream) side and the secondary (downstream)
side. That kind of bridge has a type 1 config header (see
PCI_HEADER_TYPE) and the PCI_PRIMARY_BUS and PCI_SECONDARY_BUS
registers tell us the bus number of the primary and secondary sides.
I don't believe this device is a PCI-to-PCI bridge. I think it's a
*host* bridge that has some non-PCI interface on the upstream side and
should have a type 0 config header. If that's the case you should use
PCI_CLASS_BRIDGE_HOST instead.
> }
>
> /* Assert all reset signals */
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index ab20dc5..2480b0e 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -2113,6 +2113,8 @@
>
> #define PCI_VENDOR_ID_MYRICOM 0x14c1
>
> +#define PCI_VENDOR_ID_MEDIATEK 0x14c3
> +
> #define PCI_VENDOR_ID_TITAN 0x14D2
> #define PCI_DEVICE_ID_TITAN_010L 0x8001
> #define PCI_DEVICE_ID_TITAN_100L 0x8010
> --
> 2.6.4
>
^ permalink raw reply
* [PATCH] Device tree binding for Avago APDS990X light sensor
From: Filip Matijević @ 2017-12-27 18:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171227180000.6ejpbqmr736nqx5i@kekkonen.localdomain>
Hi Sakari,
and thank you for your input - I've added a few comments below.
On 12/27/2017 07:00 PM, Sakari Ailus wrote:
> Hi Pavel,
>
> Thanks for the patch. Please see my comments below.
>
> On Wed, Dec 27, 2017 at 10:18:28AM +0100, Pavel Machek wrote:
>> From: Filip Matijevi? <filip.matijevic.pz@gmail.com>
>>
>> This prepares binding for light sensor used in Nokia N9.
>>
>> Signed-off-by: Filip Matijevi? <filip.matijevic.pz@gmail.com>
>> Signed-off-by: Pavel machek <pavel@ucw.cz>
>>
>> ---
>>
>> Patches to convert APDS990X driver to device tree and to switch to iio
>> are available.
>>
>> diff --git a/Documentation/devicetree/bindings/misc/avago-apds990x.txt b/Documentation/devicetree/bindings/misc/avago-apds990x.txt
>> new file mode 100644
>> index 0000000..e038146
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/misc/avago-apds990x.txt
>> @@ -0,0 +1,39 @@
>> +Avago APDS990X driver
>> +
>> +Required properties:
>> +- compatible: "avago,apds990x"
>> +- reg: address on the I2C bus
>> +- interrupts: external interrupt line number
>> +- Vdd-supply: power supply for VDD
>> +- Vled-supply: power supply for LEDA
>
> AFAIK the custom is to use lower case letters for regulator supplies.
I've just used the same notation as in current driver. Datasheet calls
those VDD (with DD being in subscript) and LEDA. I see no problem in
changing those to vdd-supply and vled-supply if no one else objects.
>
>> +- ga: Glass attenuation
>> +- cf1: Clear channel factor 1
>> +- irf1: IR channel factor 1
>> +- cf2: Clear channel factor 2
>> +- irf2: IR channel factor 2
>> +- df: Device factor
>> +- pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
>> +- ppcount: Proximity pulse count
>
> Are these device specific? If so, please add the vendor prefix to them.
AFAIK yes - same as before if no one else objects, these will be changed.
>
> I might not use short abbreviations such as "df" either. I wonder what
> others think.
These are also come from current driver - some of these comes from the
datasheet itself, but not all. For example "ga" and "df" are in there
(so I I would leave those alone), but "irf1" is called "B", "cf2" is
called "C" and "irf2" is called "D" (I guess the missing "cf1" should be
"A", but there is no such thing in the datasheet).
IMHO using some other names might just add to the confusion.
>
>> +
>> +Example (Nokia N9):
>> +
>> + als_ps at 39 {
>> + compatible = "avago,apds990x";
>> + reg = <0x39>;
>> +
>> + interrupt-parent = <&gpio3>;
>> + interrupts = <19 10>; /* gpio_83, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW */
>> +
>> + Vdd-supply = <&vaux1>;
>> + Vled-supply = <&vbat>;
>> +
>> + ga = <168834>;
>> + cf1 = <4096>;
>> + irf1 = <7824>;
>> + cf2 = <877>;
>> + irf2 = <1575>;
>> + df = <52>;
>> +
>> + pdrive = <0x2>; /* APDS_IRLED_CURR_25mA */
>> + ppcount = <5>;
>> + };
>>
>
Best regards,
Filip
^ permalink raw reply
* [PATCH 1/2] ARM: dts: imx6: RDU2: disable internal watchdog
From: Andrey Smirnov @ 2017-12-27 19:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAOMZO5AGrJ0f64mLQyjpbiZWusT+J6Q39Rc6+aN-hxX8Xe=R8A@mail.gmail.com>
On Wed, Dec 27, 2017 at 3:09 AM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Andrey,
>
> On Wed, Dec 27, 2017 at 1:56 AM, Andrey Smirnov
> <andrew.smirnov@gmail.com> wrote:
>> The system has an external watchdog in the environment processor
>> so the internal watchdog is of no use.
>>
>> Cc: Sascha Hauer <kernel@pengutronix.de>
>> Cc: Fabio Estevam <fabio.estevam@nxp.com>
>> Cc: Rob Herring <robh+dt@kernel.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: devicetree at vger.kernel.org
>> Cc: linux-kernel at vger.kernel.org
>> Cc: cphealy at gmail.com
>> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
>> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
>
> Patch looks good.
>
> Just not clear if the authorship comes from you or Lucas.
>
> If Lucas is the original author then his name should appear in the From field.
Lucas is the original author and I am just a messenger. Sorry for the
confusion, will send a v2 with "From" fixed.
Sorry for the noise.
Thanks,
Andrey Smirnov
^ permalink raw reply
* [PATCH 2/2] ARM: dts: imx6: RDU2: correct RTC compatible
From: Andrey Smirnov @ 2017-12-27 19:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAOMZO5BO=kX6ZDLV75c44VPNOggLzf630SHcyzfAU_+4ME2vDQ@mail.gmail.com>
On Wed, Dec 27, 2017 at 3:11 AM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Andrey,
>
> On Wed, Dec 27, 2017 at 1:56 AM, Andrey Smirnov
> <andrew.smirnov@gmail.com> wrote:
>> The RTC is manufactured by Maxim. This is a cosmetic fix, as Linux
>> doesn't match the vendor string for i2c devices.
>>
>> Cc: Sascha Hauer <kernel@pengutronix.de>
>> Cc: Fabio Estevam <fabio.estevam@nxp.com>
>> Cc: Rob Herring <robh+dt@kernel.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: devicetree at vger.kernel.org
>> Cc: linux-kernel at vger.kernel.org
>> Cc: cphealy at gmail.com
>> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
>> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
>
> This patch seems to be from Lucas:
> https://patchwork.kernel.org/patch/10099397/
>
> ,so his name should appear in the From field.
>
> Anyway, this patch has been sent earlier and we suggested to keep the
> existing binding, which is the documented form:
> https://patchwork.kernel.org/patch/10099397/
Yes, the patch is from Lucas and I was just being a messenger. And
understood and thanks for the info.
Sorry for the noise and disregard this patch.
Thanks,
Andrey Smirnov
^ permalink raw reply
* [PATCH V1 0/1] Fix kernel panic caused by device ID duplication presented to the IOMMU
From: Jayachandran C @ 2017-12-27 19:34 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <7f7fca76-88f8-6ee7-c402-fe4300c62253@arm.com>
Hi Robin,
On Tue, Dec 19, 2017 at 04:34:46PM +0000, Robin Murphy wrote:
> Hi Tomasz,
>
> On 19/12/17 15:13, Tomasz Nowicki wrote:
> >Here is my lspci output of ThunderX2 for which I am observing kernel panic coming from
> >SMMUv3 driver -> arm_smmu_write_strtab_ent() -> BUG_ON(ste_live):
> >
> ># lspci -vt
> >-[0000:00]-+-00.0-[01-1f]--+ [...]
> > + [...]
> > \-00.0-[1e-1f]----00.0-[1f]----00.0 ASPEED Technology, Inc. ASPEED Graphics Family
> >
> >ASP device -> 1f:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family
> >PCI-Express to PCI/PCI-X Bridge -> 1e:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge
> >While setting up ASP device SID in IORT dirver:
> >iort_iommu_configure() -> pci_for_each_dma_alias()
> >we need to walk up and iterate over each device which alias transaction from
> >downstream devices.
> >
> >AST device (1f:00.0) gets BDF=0x1f00 and corresponding SID=0x1f00 from IORT.
> >Bridge (1e:00.0) is the first alias. Following PCI Express to PCI/PCI-X Bridge
> >spec: PCIe-to-PCI/X bridges alias transactions from downstream devices using
> >the subordinate bus number. For bridge (1e:00.0), the subordinate is equal
> >to 0x1f. This gives BDF=0x1f00 and SID=1f00 which is the same as downstream
> >device. So it is possible to have two identical SIDs. The question is what we
> >should do about such case. Presented patch prevents from registering the same
> >ID so that SMMUv3 is not complaining later on.
>
> Ooh, subtle :( There is logic in arm_smmu_attach_device() to tolerate
> grouped devices aliasing to the same ID, but I guess I overlooked the
> distinction of a device sharing an alias ID with itself. I'm not sure
> I really like trying to work around this in generic code, since
> fwspec->ids is essentially opaque data in a driver-specific format - in
> theory a driver is free to encode a single logical ID into multiple
> fwspec elements (I think I did that in an early draft of SMMUv2 SMR
> support), at which point this approach might corrupt things massively.
>
> Does the (untested) diff below suffice?
>
> Robin.
>
> ----->8-----diff --git a/drivers/iommu/arm-smmu-v3.c
> b/drivers/iommu/arm-smmu-v3.c
> index f122071688fd..d8a730d83401 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -1731,7 +1731,7 @@ static __le64 *arm_smmu_get_step_for_sid(struct
> arm_smmu_device *smmu, u32 sid)
>
> static void arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec)
> {
> - int i;
> + int i, j;
> struct arm_smmu_master_data *master = fwspec->iommu_priv;
> struct arm_smmu_device *smmu = master->smmu;
>
> @@ -1739,6 +1739,13 @@ static void arm_smmu_install_ste_for_dev(struct
> iommu_fwspec *fwspec)
> u32 sid = fwspec->ids[i];
> __le64 *step = arm_smmu_get_step_for_sid(smmu, sid);
>
> + /* Bridged PCI devices may end up with duplicated IDs */
> + for (j = 0; j < i; j++)
> + if (fwspec->ids[j] == sid)
> + break;
> + if (j < i)
> + continue;
> +
> arm_smmu_write_strtab_ent(smmu, sid, step, &master->ste);
> }
> }
Here is another tested by if you need one more:
Tested-by: Jayachandran C. <jnair@caviumnetworks.com>
This fixes the crash below seen in ThunderX2 boards with Aspeed BMC (when
booted without iommu.passthrough). Since this is a regression that breaks
bootup on the platform, can you consider submitting this for the 4.15 cycle?
[ 84.729351] ------------[ cut here ]------------
[ 84.729354] kernel BUG at /home/ubuntu/linux/drivers/iommu/arm-smmu-v3.c:1201!
[ 84.729358] Internal error: Oops - BUG: 0 [#1] SMP
[ 84.729360] Modules linked in: ast(+) ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops qede(+) drm q
ed bnx2x(+) mpt3sas raid_class scsi_transport_sas sdhci_acpi mdio sdhci libcrc32c gpio_xlp
[ 84.729375] CPU: 190 PID: 1725 Comm: systemd-udevd Not tainted 4.15.0-rc5 #37
[ 84.729376] Hardware name: Cavium Inc. Unknown/Unknown, BIOS 1.0 11/08/2017
[ 84.729379] pstate: 80400009 (Nzcv daif +PAN -UAO)
[ 84.729388] pc : arm_smmu_write_strtab_ent+0x1f0/0x1f8
[ 84.729391] lr : arm_smmu_install_ste_for_dev+0x70/0xc8
[ 84.729392] sp : ffff00001f6e3730
[ 84.729393] x29: ffff00001f6e3730 x28: ffff809ecc0d2268
[ 84.729395] x27: 0000000000000018 x26: ffff00001f6e3910
[ 84.729397] x25: ffff809ecc0d2238 x24: ffff809ecdc94158
[ 84.729398] x23: 0000000000000018 x22: 0000000000001d00
[ 84.729400] x21: ffff809ecdc90018 x20: ffff809ecb5ef288
[ 84.729401] x19: ffff80beca480000 x18: ffff0000093b8c08
[ 84.729402] x17: ffff000008aeab70 x16: ffff00001f6e3a20
[ 84.729404] x15: 0000000000000000 x14: dead000000000100
[ 84.729405] x13: dead000000000200 x12: 0000000000000020
[ 84.729407] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[ 84.729408] x9 : 0000000000000000 x8 : 0000000000000000
[ 84.729410] x7 : 0000000000000100 x6 : 0000000000000015
[ 84.729411] x5 : 0000000000000015 x4 : 0000000000000002
[ 84.729413] x3 : ffff809ecb5ef288 x2 : 0000000000000001
[ 84.729414] x1 : ffff000008691e30 x0 : ffff809ecc0d2238
[ 84.729418] Process systemd-udevd (pid: 1725, stack limit = 0x000000002c585821)
[ 84.729420] Call trace:
[ 84.729423] arm_smmu_write_strtab_ent+0x1f0/0x1f8
[ 84.729425] arm_smmu_install_ste_for_dev+0x70/0xc8
[ 84.729426] arm_smmu_attach_dev+0x100/0x2f8
[ 84.729431] __iommu_attach_device+0x54/0xe0
[ 84.729433] iommu_group_add_device+0x150/0x428
[ 84.729435] iommu_group_get_for_dev+0x84/0x180
[ 84.729436] arm_smmu_add_device+0x138/0x240
[ 84.729445] iort_iommu_configure+0x138/0x188
[ 84.729452] acpi_dma_configure+0x3c/0x80
[ 84.729456] dma_configure+0xb0/0xe0
[ 84.729462] driver_probe_device+0x1f0/0x4a8
[ 84.729464] __driver_attach+0x124/0x128
[ 84.729466] bus_for_each_dev+0x70/0xb0
[ 84.729467] driver_attach+0x30/0x40
[ 84.729469] bus_add_driver+0x248/0x2b8
[ 84.729471] driver_register+0x68/0x100
[ 84.729478] __pci_register_driver+0x5c/0x70
[ 84.729488] ast_init+0x30/0x1000 [ast]
[ 84.729494] do_one_initcall+0x5c/0x168
[ 84.729501] do_init_module+0x64/0x1f4
[ 84.729502] load_module+0x1e64/0x21e8
[ 84.729503] SyS_finit_module+0x108/0x118
[ 84.729505] el0_svc_naked+0x20/0x24
[ 84.729508] Code: 34ffff82 d4210000 d2800120 17ffffd8 (d4210000)
Thanks,
JC.
^ permalink raw reply
* [PATCH v6 1/8] arch: enable relative relocations for arm64, power, x86, s390 and x86
From: Linus Torvalds @ 2017-12-27 19:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171227085033.22389-2-ard.biesheuvel@linaro.org>
On Wed, Dec 27, 2017 at 12:50 AM, Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
> diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
> index 7da3e5c366a0..49ae5b43fe2b 100644
> --- a/arch/arm64/kernel/vmlinux.lds.S
> +++ b/arch/arm64/kernel/vmlinux.lds.S
> @@ -156,7 +156,7 @@ SECTIONS
> CON_INITCALL
> SECURITY_INITCALL
> INIT_RAM_FS
> - *(.init.rodata.* .init.bss) /* from the EFI stub */
> + *(.init.rodata.* .init.bss .init.discard.*) /* EFI stub */
> }
> .exit.data : {
> ARM_EXIT_KEEP(EXIT_DATA)
Weren't you supposed to explain this part in the commit message?
It isn't obvious why this is mixed up with the Kconfig changes, and
somebody already asked about it. The commit message only talks about
the Kconfig changes, and then suddenly there's that odd vmlinux.lds.S
change in there...
Linus
^ 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