* Re: [PATCH 1/3] arm_pmu: Add support for perf NMI interrupts registration
From: Lecopzer Chen @ 2020-05-17 6:39 UTC (permalink / raw)
To: linux-kernel
Cc: mark.rutland, Jian-Lin Chen, alexander.shishkin, catalin.marinas,
jolsa, acme, peterz, mingo, linux-mediatek, matthias.bgg,
namhyung, will, yj.chiang, linux-arm-kernel
In-Reply-To: <20200516124857.75004-2-lecopzer@gmail.com>
There was some mistakes when merging this patch.
The free nmi part is not present :(
The following part will be added in V2 next weekend.
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index fa37b72d19e2..aa9ed09e5303 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -544,6 +544,38 @@ static int armpmu_count_irq_users(const int irq)
return count;
}
+static void armpmu_teardown_percpu_nmi_other(void* info)
+{
+ /*
+ * We don't need to disable preemption since smp_call_function()
+ * did this for us.
+ */
+ teardown_percpu_nmi((uintptr_t) info);
+}
+
+static void _armpmu_free_irq(unsigned int irq, void *dev_id)
+{
+ if (armpmu_support_nmi())
+ free_nmi(irq, dev_id);
+ else
+ free_irq(irq, dev_id);
+}
+
+static void _armpmu_free_percpu_irq(unsigned int irq, void __percpu *dev_id)
+{
+ if (armpmu_support_nmi()) {
+ preempt_disable();
+ teardown_percpu_nmi(irq);
+ smp_call_function(armpmu_teardown_percpu_nmi_other,
+ (void *)(uintptr_t) irq, true);
+ preempt_enable();
+
+ free_percpu_nmi(irq, dev_id);
+ }
+ else
+ free_percpu_irq(irq, dev_id);
+}
+
void armpmu_free_irq(int irq, int cpu)
{
if (per_cpu(cpu_irq, cpu) == 0)
@@ -552,9 +584,9 @@ void armpmu_free_irq(int irq, int cpu)
return;
if (!irq_is_percpu_devid(irq))
- free_irq(irq, per_cpu_ptr(&cpu_armpmu, cpu));
+ _armpmu_free_irq(irq, per_cpu_ptr(&cpu_armpmu, cpu));
else if (armpmu_count_irq_users(irq) == 1)
- free_percpu_irq(irq, &cpu_armpmu);
+ _armpmu_free_percpu_irq(irq, &cpu_armpmu);
per_cpu(cpu_irq, cpu) = 0;
}
Thanks,
Lecopzer
Lecopzer Chen <lecopzer@gmail.com> 於 2020年5月16日 週六 下午8:50寫道:
>
> Register perf interrupts by request_nmi()/percpu_nmi() when both
> ARM64_PSEUDO_NMI and ARM64_PSEUDO_NMI_PERF are enabled and nmi
> cpufreature is active.
>
> Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
> ---
> drivers/perf/arm_pmu.c | 51 +++++++++++++++++++++++++++++++-----
> include/linux/perf/arm_pmu.h | 6 +++++
> 2 files changed, 51 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> index df352b334ea7..fa37b72d19e2 100644
> --- a/drivers/perf/arm_pmu.c
> +++ b/drivers/perf/arm_pmu.c
> @@ -559,6 +559,48 @@ void armpmu_free_irq(int irq, int cpu)
> per_cpu(cpu_irq, cpu) = 0;
> }
>
> +static void armpmu_prepare_percpu_nmi_other(void *info)
> +{
> + /*
> + * We don't need to disable preemption since smp_call_function()
> + * did this for us.
> + */
> + prepare_percpu_nmi((uintptr_t) info);
> +}
> +
> +static int _armpmu_request_irq(unsigned int irq, irq_handler_t handler,
> + unsigned long flags, int cpu)
> +{
> + if (armpmu_support_nmi())
> + return request_nmi(irq, handler, flags, "arm-pmu",
> + per_cpu_ptr(&cpu_armpmu, cpu));
> + return request_irq(irq, handler, flags, "arm-pmu",
> + per_cpu_ptr(&cpu_armpmu, cpu));
> +}
> +
> +static int _armpmu_request_percpu_irq(unsigned int irq, irq_handler_t handler)
> +{
> + if (armpmu_support_nmi()) {
> + int err;
> +
> + err = request_percpu_nmi(irq, handler, "arm-pmu",
> + &cpu_armpmu);
> + if (err)
> + return err;
> +
> + preempt_disable();
> + err = prepare_percpu_nmi(irq);
> + if (err) {
> + return err;
> + preempt_enable();
> + }
> + smp_call_function(armpmu_prepare_percpu_nmi_other,
> + (void *)(uintptr_t) irq, true);
> + preempt_enable();
> + }
> + return request_percpu_irq(irq, handler, "arm-pmu",
> + &cpu_armpmu);
> +}
> +
> int armpmu_request_irq(int irq, int cpu)
> {
> int err = 0;
> @@ -582,12 +624,9 @@ int armpmu_request_irq(int irq, int cpu)
> IRQF_NO_THREAD;
>
> irq_set_status_flags(irq, IRQ_NOAUTOEN);
> - err = request_irq(irq, handler, irq_flags, "arm-pmu",
> - per_cpu_ptr(&cpu_armpmu, cpu));
> - } else if (armpmu_count_irq_users(irq) == 0) {
> - err = request_percpu_irq(irq, handler, "arm-pmu",
> - &cpu_armpmu);
> - }
> + err = _armpmu_request_irq(irq, handler, irq_flags, cpu);
> + } else if (armpmu_count_irq_users(irq) == 0)
> + err = _armpmu_request_percpu_irq(irq, handler);
>
> if (err)
> goto err_out;
> diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h
> index 5b616dde9a4c..5b878b5a22aa 100644
> --- a/include/linux/perf/arm_pmu.h
> +++ b/include/linux/perf/arm_pmu.h
> @@ -160,6 +160,12 @@ int arm_pmu_acpi_probe(armpmu_init_fn init_fn);
> static inline int arm_pmu_acpi_probe(armpmu_init_fn init_fn) { return 0; }
> #endif
>
> +static inline bool armpmu_support_nmi(void)
> +{
> + return IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI_PERF) &&
> + system_uses_irq_prio_masking();
> +}
> +
> /* Internal functions only for core arm_pmu code */
> struct arm_pmu *armpmu_alloc(void);
> struct arm_pmu *armpmu_alloc_atomic(void);
> --
> 2.25.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* Re: [GIT PULL] ARM: SoC/DT fixes for v5.7
From: Arnd Bergmann @ 2020-05-17 8:54 UTC (permalink / raw)
To: Linus Torvalds
Cc: Heiko Stuebner, Kevin Hilman, Tony Lindgren, SoC Team,
Maxime Ripard, Linux Kernel Mailing List, Chen-Yu Tsai,
Geert Uytterhoeven, Thierry Reding, Shawn Guo, Linux ARM
In-Reply-To: <CAK8P3a1L6R+tomzXsdhXY3vfctS+2t9sD4+uDmJShUX98W=hKg@mail.gmail.com>
Linus pointed out I missed the usual Cc to the mailing lists. It's
already merged,
but for reference here is the pull request I sent.
Arnd
On Fri, May 15, 2020 at 11:59 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> The following changes since commit 0e698dfa282211e414076f9dc7e83c1c288314fd:
>
> Linux 5.7-rc4 (2020-05-03 14:56:04 -0700)
>
> are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
> tags/arm-soc-fixes-5.7
>
> for you to fetch changes up to d5fef88ccbd3a2d3674e6cc868804a519ef9e5b6:
>
> Merge tag 'renesas-fixes-for-v5.7-tag2' of
> git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into
> arm/fixes (2020-05-15 23:14:36 +0200)
>
> ----------------------------------------------------------------
> ARM: SoC/dt fixes for v5.7
>
> This round of fixes is almost exclusively device tree changes,
> with trivial defconfig fixes and one compiler warning fix
> added in.
>
> A number of patches are to fix dtc warnings, in particular on
> Amlogic, i.MX and Rockchips.
>
> Other notable changes include:
>
> Renesas:
> - Fix a wrong clock configuration on R-Mobile A1,
> - Fix IOMMU support on R-Car V3H
>
> Allwinner
> - Multiple audio fixes
>
> Qualcomm
> - Use a safe CPU voltage on MSM8996
> - Fixes to match a late audio driver change
>
> Rockchip:
> - Some fixes for the newly added Pinebook Pro
>
> NXP i.MX:
> - Fix I2C1 pinctrl configuration for i.MX27 phytec-phycard board.
> - Fix imx6dl-yapp4-ursa board Ethernet connection.
>
> OMAP:
> - A regression fix for non-existing can device on am534x-idk
> - Fix flakey wlan on droid4 where some devices would not connect
> at all because of internal pull being used with an external pull
> - Fix occasional missed wake-up events on droid4 modem uart
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> ----------------------------------------------------------------
> Adam Ford (1):
> arm64: dts: imx8mn: Change SDMA1 ahb clock for imx8mn
>
> Ahmad Fatoum (1):
> ARM: imx: provide v7_cpu_resume() only on ARM_CPU_SUSPEND=y
>
> Arnd Bergmann (10):
> Merge tag 'qcom-arm64-fixes-for-5.7' of
> git://git.kernel.org/.../qcom/linux into arm/fixes
> Merge tag 'imx-fixes-5.7' of
> git://git.kernel.org/.../shawnguo/linux into arm/fixes
> Merge tag 'renesas-fixes-for-v5.7-tag1' of
> git://git.kernel.org/.../geert/renesas-devel into arm/fixes
> Merge tag 'tegra-for-5.7-arm64-defconfig-fixes' of
> git://git.kernel.org/.../tegra/linux into arm/fixes
> Merge tag 'v5.7-rockchip-dtsfixes1' of
> git://git.kernel.org/.../mmind/linux-rockchip into arm/fixes
> Merge tag 'omap-for-v5.6/fixes-rc4' of
> git://git.kernel.org/.../tmlind/linux-omap into arm/fixes
> Merge tag 'amlogic-fixes' of
> git://git.kernel.org/.../khilman/linux-amlogic into arm/fixes
> Merge tag 'arm-soc-fixes-for-5.7' of
> git://git.kernel.org/.../narmstrong/linux-oxnas into arm/fixes
> Merge tag 'sunxi-fixes-for-5.7-1' of
> git://git.kernel.org/.../sunxi/linux into arm/fixes
> Merge tag 'renesas-fixes-for-v5.7-tag2' of
> git://git.kernel.org/.../geert/renesas-devel into arm/fixes
>
> Bjorn Andersson (1):
> arm64: dts: qcom: msm8996: Reduce vdd_apc voltage
>
> Chen-Yu Tsai (5):
> arm64: dts: rockchip: Replace RK805 PMIC node name with "pmic"
> on rk3328 boards
> arm64: dts: rockchip: drop non-existent gmac2phy pinmux options
> from rk3328
> arm64: dts: rockchip: drop #address-cells, #size-cells from
> rk3328 grf node
> arm64: dts: rockchip: drop #address-cells, #size-cells from
> rk3399 pmugrf node
> arm64: dts: rockchip: Rename dwc3 device nodes on rk3399 to make dtc happy
>
> Fabio Estevam (2):
> ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries
> arm64: dts: imx8m: Fix AIPS reg properties
>
> Faiz Abbas (1):
> ARM: dts: am574x-idk: Disable m_can node
>
> Geert Uytterhoeven (3):
> ARM: dts: r8a73a4: Add missing CMT1 interrupts
> ARM: dts: r7s9210: Remove bogus clock-names from OSTM nodes
> ARM: dts: r8a7740: Add missing extal2 to CPG node
>
> Johan Jonker (7):
> ARM: dts: rockchip: fix phy nodename for rk3228-evb
> ARM: dts: rockchip: fix phy nodename for rk3229-xms6
> arm64: dts: rockchip: remove extra assigned-clocks property from
> &gmac2phy node in rk3328-evb.dts
> arm64: dts: rockchip: fix status for &gmac2phy in rk3328-evb.dts
> arm64: dts: rockchip: swap interrupts interrupt-names rk3399 gpu node
> ARM: dts: rockchip: swap clock-names of gpu nodes
> ARM: dts: rockchip: fix pinctrl sub nodename for spi in rk322x.dtsi
>
> Jon Hunter (1):
> arm64: defconfig: Re-enable Tegra PCIe host driver
>
> Kishon Vijay Abraham I (1):
> ARM: dts: dra7: Fix bus_dma_limit for PCIe
>
> Ma Feng (1):
> ARM: oxnas: make ox820_boot_secondary static
>
> Max Krummenacher (4):
> arm64: defconfig: DRM_DUMB_VGA_DAC: follow changed config symbol name
> arm64: defconfig: add DRM_DISPLAY_CONNECTOR
> arm64: defconfig: ARCH_R8A7795: follow changed config symbol name
> arm64: defconfig: add MEDIA_PLATFORM_SUPPORT
>
> Michael Walle (2):
> dt-bindings: dma: fsl-edma: fix ls1028a-edma compatible
> arm64: dts: ls1028a: add "fsl,vf610-edma" compatible
>
> Michal Vokáč (1):
> ARM: dts: imx6dl-yapp4: Fix Ursa board Ethernet connection
>
> Neil Armstrong (4):
> arm64: dts: meson-g12b-ugoos-am6: fix usb vbus-supply
> arm64: dts: meson-g12-common: fix dwc2 clock names
> arm64: dts: meson-g12b-khadas-vim3: add missing frddr_a status property
> arm64: dts: meson-g12: remove spurious blank line
>
> Ricardo Cañuelo (3):
> arm64: dts: renesas: Make hdmi encoder nodes compliant with DT bindings
> ARM: dts: renesas: Make hdmi encoder nodes compliant with DT bindings
> ARM: dts: iwg20d-q7-dbcm-ca: Remove unneeded properties in hdmi@39
>
> Robin Murphy (2):
> arm64: dts: rockchip: Correct PMU compatibles for PX30 and RK3308
> arm64: dts: rockchip: Fix Pinebook Pro FUSB302 interrupt
>
> Samuel Holland (2):
> arm64: dts: allwinner: a64: pinetab: Fix cpvdd supply name
> arm64: dts: allwinner: a64: Remove unused SPDIF sound card
>
> Shengjiu Wang (1):
> arm64: dts: freescale: imx8mp: update input_val for AUDIOMIX_BIT_STREAM
>
> Srinivas Kandagatla (3):
> arm64: qcom: c630: fix asm dai setup
> arm64: dts: qcom: db845c: fix asm dai setup
> arm64: dts: qcom: db820c: fix audio configuration
>
> Tobias Schramm (2):
> arm64: dts: rockchip: fix inverted headphone detection on Pinebook Pro
> arm64: dts: rockchip: enable DC charger detection pullup on Pinebook Pro
>
> Tony Lindgren (3):
> Merge branch 'fixes-v5.7' into fixes
> ARM: dts: omap4-droid4: Fix flakey wlan by disabling internal
> pull for gpio
> ARM: dts: omap4-droid4: Fix occasional lost wakeirq for uart1
>
> Yoshihiro Shimoda (1):
> arm64: dts: renesas: r8a77980: Fix IPMMU VIP[01] nodes
>
> Documentation/devicetree/bindings/dma/fsl-edma.txt | 3 +-
> arch/arm/boot/dts/am574x-idk.dts | 4 ++
> arch/arm/boot/dts/dra7.dtsi | 4 +-
> arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts | 4 +-
> arch/arm/boot/dts/imx6dl-yapp4-ursa.dts | 2 +-
> arch/arm/boot/dts/iwg20d-q7-dbcm-ca.dtsi | 2 -
> arch/arm/boot/dts/motorola-mapphone-common.dtsi | 43 ++++++++++++++++++--
> arch/arm/boot/dts/r7s9210.dtsi | 3 --
> arch/arm/boot/dts/r8a73a4.dtsi | 9 ++++-
> arch/arm/boot/dts/r8a7740.dtsi | 2 +-
> .../arm/boot/dts/r8a7745-iwg22d-sodimm-dbhd-ca.dts | 2 -
> arch/arm/boot/dts/r8a7790-lager.dts | 2 -
> arch/arm/boot/dts/r8a7790-stout.dts | 2 -
> arch/arm/boot/dts/r8a7791-koelsch.dts | 2 -
> arch/arm/boot/dts/r8a7791-porter.dts | 2 -
> arch/arm/boot/dts/r8a7792-blanche.dts | 2 -
> arch/arm/boot/dts/r8a7792-wheat.dts | 12 ++----
> arch/arm/boot/dts/r8a7793-gose.dts | 2 -
> arch/arm/boot/dts/r8a7794-silk.dts | 2 -
> arch/arm/boot/dts/rk3036.dtsi | 2 +-
> arch/arm/boot/dts/rk3228-evb.dts | 2 +-
> arch/arm/boot/dts/rk3229-xms6.dts | 2 +-
> arch/arm/boot/dts/rk322x.dtsi | 6 +--
> arch/arm/boot/dts/rk3xxx.dtsi | 2 +-
> arch/arm/mach-oxnas/platsmp.c | 3 +-
> .../boot/dts/allwinner/sun50i-a64-pinetab.dts | 2 +-
> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 18 ---------
> arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 2 +-
> arch/arm64/boot/dts/amlogic/meson-g12.dtsi | 1 -
> .../boot/dts/amlogic/meson-g12b-khadas-vim3.dtsi | 4 ++
> .../boot/dts/amlogic/meson-g12b-ugoos-am6.dts | 2 +-
> arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +-
> arch/arm64/boot/dts/freescale/imx8mm.dtsi | 8 ++--
> arch/arm64/boot/dts/freescale/imx8mn.dtsi | 10 ++---
> arch/arm64/boot/dts/freescale/imx8mp-pinfunc.h | 46 +++++++++++-----------
> arch/arm64/boot/dts/freescale/imx8mp.dtsi | 6 +--
> arch/arm64/boot/dts/freescale/imx8mq.dtsi | 8 ++--
> arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 23 +++++++++--
> arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +
> arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 3 --
> .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 2 -
> arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 2 -
> arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts | 2 -
> arch/arm64/boot/dts/renesas/r8a77980-condor.dts | 2 -
> arch/arm64/boot/dts/renesas/r8a77980-v3hsk.dts | 2 -
> arch/arm64/boot/dts/renesas/r8a77980.dtsi | 2 +
> arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts | 2 -
> arch/arm64/boot/dts/renesas/r8a77995-draak.dts | 6 +--
> arch/arm64/boot/dts/rockchip/px30.dtsi | 2 +-
> arch/arm64/boot/dts/rockchip/rk3308.dtsi | 2 +-
> arch/arm64/boot/dts/rockchip/rk3328-evb.dts | 5 +--
> arch/arm64/boot/dts/rockchip/rk3328-rock64.dts | 2 +-
> arch/arm64/boot/dts/rockchip/rk3328.dtsi | 18 ---------
> .../boot/dts/rockchip/rk3399-pinebook-pro.dts | 9 +++--
> arch/arm64/boot/dts/rockchip/rk3399.dtsi | 14 +++----
> arch/arm64/configs/defconfig | 9 +++--
> 56 files changed, 168 insertions(+), 171 deletions(-)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH v9] arm64: dts: qcom: sc7180: Add WCN3990 WLAN module device node
From: Rakesh Pillai @ 2020-05-17 10:46 UTC (permalink / raw)
To: devicetree; +Cc: linux-arm-msm, Rakesh Pillai, linux-kernel, linux-arm-kernel
Add device node for the ath10k SNOC platform driver probe
and add resources required for WCN3990 on sc7180 soc.
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
---
Changes from v8:
- Removed the qcom,msa-fixed-perm
---
arch/arm64/boot/dts/qcom/sc7180-idp.dts | 7 +++++++
arch/arm64/boot/dts/qcom/sc7180.dtsi | 27 +++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sc7180-idp.dts b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
index 4e9149d..38b102e 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-idp.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
@@ -389,6 +389,13 @@
};
};
+&wifi {
+ status = "okay";
+ wifi-firmware {
+ iommus = <&apps_smmu 0xc2 0x1>;
+ };
+};
+
/* PINCTRL - additions to nodes defined in sc7180.dtsi */
&qspi_clk {
diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index f1280e0..dd4e095 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -63,6 +63,11 @@
clock-frequency = <32764>;
#clock-cells = <0>;
};
+
+ wlan_fw_mem: memory@94100000 {
+ reg = <0 0x94100000 0 0x200000>;
+ no-map;
+ };
};
reserved_memory: reserved-memory {
@@ -944,6 +949,28 @@
};
};
+ wifi: wifi@18800000 {
+ compatible = "qcom,wcn3990-wifi";
+ reg = <0 0x18800000 0 0x800000>;
+ reg-names = "membase";
+ iommus = <&apps_smmu 0xc0 0x1>;
+ interrupts =
+ <GIC_SPI 414 IRQ_TYPE_LEVEL_HIGH /* CE0 */ >,
+ <GIC_SPI 415 IRQ_TYPE_LEVEL_HIGH /* CE1 */ >,
+ <GIC_SPI 416 IRQ_TYPE_LEVEL_HIGH /* CE2 */ >,
+ <GIC_SPI 417 IRQ_TYPE_LEVEL_HIGH /* CE3 */ >,
+ <GIC_SPI 418 IRQ_TYPE_LEVEL_HIGH /* CE4 */ >,
+ <GIC_SPI 419 IRQ_TYPE_LEVEL_HIGH /* CE5 */ >,
+ <GIC_SPI 420 IRQ_TYPE_LEVEL_HIGH /* CE6 */ >,
+ <GIC_SPI 421 IRQ_TYPE_LEVEL_HIGH /* CE7 */ >,
+ <GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH /* CE8 */ >,
+ <GIC_SPI 423 IRQ_TYPE_LEVEL_HIGH /* CE9 */ >,
+ <GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH /* CE10 */>,
+ <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH /* CE11 */>;
+ memory-region = <&wlan_fw_mem>;
+ status = "disabled";
+ };
+
config_noc: interconnect@1500000 {
compatible = "qcom,sc7180-config-noc";
reg = <0 0x01500000 0 0x28000>;
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
From: Amit Tomer @ 2020-05-17 11:56 UTC (permalink / raw)
To: André Przywara
Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel
In-Reply-To: <b2ad8a81-619f-5f35-9596-c2061ae15e4c@arm.com>
Hi,
> So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
> to the binding, but leaving the driver alone for now.
But if we leave this new string from driver , there would be DT
validation issue.
Are we okay with it ?
Thanks
-Amit
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [GIT PULL] ARM: simplify handover from UEFI to decompressor
From: Ard Biesheuvel @ 2020-05-17 12:09 UTC (permalink / raw)
To: linux-efi; +Cc: linux+pull, linux-arm-kernel
The following changes since commit 91e4f3d37e1a932396801fc2831286353821ff23:
ARM: 8972/1: boot: Obtain start of physical memory from DTB (2020-04-29 13:30:29 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git tags/pr-efi-arm-no-relocate
for you to fetch changes up to ea98a6da3baf477541f8cbb036d1827e6b84ac91:
ARM: decompressor: run decompressor in place if loaded via UEFI (2020-05-06 09:58:24 +0200)
----------------------------------------------------------------
Simply EFI handover to decompressor
The EFI stub in the ARM kernel runs in the context of the firmware, which
means it usually runs with the caches and MMU on. Currently, we relocate
the zImage so it appears in the first 128 MiB, disable the MMU and caches
and invoke the decompressor via its ordinary entry point. However, since we
can pass the base of DRAM directly, there is no need to relocate the zImage,
which also means there is no need to disable and re-enable the caches and
create new page tables etc.
----------------------------------------------------------------
Ard Biesheuvel (5):
ARM: decompressor: move headroom variable out of LC0
ARM: decompressor: split off _edata and stack base into separate object
ARM: decompressor: defer loading of the contents of the LC0 structure
ARM: decompressor: move GOT into .data for EFI enabled builds
ARM: decompressor: run decompressor in place if loaded via UEFI
arch/arm/boot/compressed/head.S | 91 +++++++++++++------------------
arch/arm/boot/compressed/vmlinux.lds.S | 5 ++
drivers/firmware/efi/libstub/arm32-stub.c | 45 ++-------------
3 files changed, 48 insertions(+), 93 deletions(-)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH 2/3] sdhci: sparx5: Add Sparx5 SoC eMMC driver
From: Adrian Hunter @ 2020-05-17 12:58 UTC (permalink / raw)
To: Lars Povlsen, Ulf Hansson, SoC Team
Cc: devicetree, Alexandre Belloni, linux-mmc, linux-kernel,
Microchip Linux Driver Support, linux-arm-kernel
In-Reply-To: <20200513133122.25121-3-lars.povlsen@microchip.com>
On 13/05/20 4:31 pm, Lars Povlsen wrote:
> This adds the eMMC driver for the Sparx5 SoC. It is based upon the
> designware IP, but requires some extra initialization and quirks.
>
> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
> ---
> drivers/mmc/host/Kconfig | 13 ++
> drivers/mmc/host/Makefile | 1 +
> drivers/mmc/host/sdhci-of-sparx5.c | 348 +++++++++++++++++++++++++++++
> 3 files changed, 362 insertions(+)
> create mode 100644 drivers/mmc/host/sdhci-of-sparx5.c
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index 462b5352fea75..1e8396d09df75 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -213,6 +213,19 @@ config MMC_SDHCI_OF_DWCMSHC
> If you have a controller with this interface, say Y or M here.
> If unsure, say N.
>
> +config MMC_SDHCI_OF_SPARX5
> + tristate "SDHCI OF support for the MCHP Sparx5 SoC"
> + depends on MMC_SDHCI_PLTFM
> + depends on ARCH_SPARX5
> + select MMC_SDHCI_IO_ACCESSORS
> + help
> + This selects the Secure Digital Host Controller Interface (SDHCI)
> + found in the MCHP Sparx5 SoC.
> +
> + If you have a Sparx5 SoC with this interface, say Y or M here.
> +
> + If unsure, say N.
> +
> config MMC_SDHCI_CADENCE
> tristate "SDHCI support for the Cadence SD/SDIO/eMMC controller"
> depends on MMC_SDHCI_PLTFM
> diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
> index b929ef9412083..9f09b7ffaaa16 100644
> --- a/drivers/mmc/host/Makefile
> +++ b/drivers/mmc/host/Makefile
> @@ -89,6 +89,7 @@ obj-$(CONFIG_MMC_SDHCI_OF_ARASAN) += sdhci-of-arasan.o
> obj-$(CONFIG_MMC_SDHCI_OF_ASPEED) += sdhci-of-aspeed.o
> obj-$(CONFIG_MMC_SDHCI_OF_AT91) += sdhci-of-at91.o
> obj-$(CONFIG_MMC_SDHCI_OF_ESDHC) += sdhci-of-esdhc.o
> +obj-$(CONFIG_MMC_SDHCI_OF_SPARX5) += sdhci-of-sparx5.o
> obj-$(CONFIG_MMC_SDHCI_OF_HLWD) += sdhci-of-hlwd.o
> obj-$(CONFIG_MMC_SDHCI_OF_DWCMSHC) += sdhci-of-dwcmshc.o
> obj-$(CONFIG_MMC_SDHCI_BCM_KONA) += sdhci-bcm-kona.o
> diff --git a/drivers/mmc/host/sdhci-of-sparx5.c b/drivers/mmc/host/sdhci-of-sparx5.c
> new file mode 100644
> index 0000000000000..8253bf80e175a
> --- /dev/null
> +++ b/drivers/mmc/host/sdhci-of-sparx5.c
> @@ -0,0 +1,348 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * drivers/mmc/host/sdhci-of-sparx5.c
> + *
> + * MCHP Sparx5 SoC Secure Digital Host Controller Interface.
> + *
> + * Copyright (c) 2019 Microchip Inc.
> + *
> + * Author: Lars Povlsen <lars.povlsen@microchip.com>
> + */
> +
> +//#define DEBUG
> +//#define TRACE_REGISTER
No commented out code please.
> +
> +#include <linux/sizes.h>
> +#include <linux/delay.h>
> +#include <linux/module.h>
> +#include <linux/regmap.h>
> +#include <linux/of_device.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/dma-mapping.h>
> +
> +#include "sdhci-pltfm.h"
> +
> +#define CPU_REGS_GENERAL_CTRL (0x22 * 4)
> +#define MSHC_DLY_CC_MASK GENMASK(16, 13)
> +#define MSHC_DLY_CC_SHIFT 13
> +#define MSHC_DLY_CC_MAX 15
> +
> +#define CPU_REGS_PROC_CTRL (0x2C * 4)
> +#define ACP_CACHE_FORCE_ENA BIT(4)
> +#define ACP_AWCACHE BIT(3)
> +#define ACP_ARCACHE BIT(2)
> +#define ACP_CACHE_MASK (ACP_CACHE_FORCE_ENA|ACP_AWCACHE|ACP_ARCACHE)
> +
> +#define MSHC2_VERSION 0x500 /* Off 0x140, reg 0x0 */
> +#define MSHC2_TYPE 0x504 /* Off 0x140, reg 0x1 */
> +#define MSHC2_EMMC_CTRL 0x52c /* Off 0x140, reg 0xB */
> +#define MSHC2_EMMC_CTRL_EMMC_RST_N BIT(2)
> +#define MSHC2_EMMC_CTRL_IS_EMMC BIT(0)
> +
> +struct sdhci_sparx5_data {
> + struct sdhci_host *host;
> + struct regmap *cpu_ctrl;
> + int delay_clock;
> + struct device_attribute dev_delay_clock;
> +};
> +
> +#define BOUNDARY_OK(addr, len) \
> + ((addr | (SZ_128M - 1)) == ((addr + len - 1) | (SZ_128M - 1)))
> +
> +#if defined(TRACE_REGISTER)
If you want this then add a Kconfig entry for it
> +static void sdhci_sparx5_writel(struct sdhci_host *host, u32 val, int reg)
> +{
> + pr_debug("$$$ writel(0x%08x, 0x%02x)\n", val, reg);
> + writel(val, host->ioaddr + reg);
> +}
> +
> +static void sdhci_sparx5_writew(struct sdhci_host *host, u16 val, int reg)
> +{
> + pr_debug("$$$ writew(0x%04x, 0x%02x)\n", val, reg);
> + writew(val, host->ioaddr + reg);
> +}
> +
> +static void sdhci_sparx5_writeb(struct sdhci_host *host, u8 val, int reg)
> +{
> + pr_debug("$$$ writeb(0x%02x, 0x%02x)\n", val, reg);
> + writeb(val, host->ioaddr + reg);
> +}
> +#endif
> +
> +/*
> + * If DMA addr spans 128MB boundary, we split the DMA transfer into two
> + * so that each DMA transfer doesn't exceed the boundary.
> + */
> +static void sdhci_sparx5_adma_write_desc(struct sdhci_host *host, void **desc,
> + dma_addr_t addr, int len,
> + unsigned int cmd)
> +{
> + int tmplen, offset;
> +
> + pr_debug("write_desc: cmd %02x: len %d, offset 0x%0llx\n",
> + cmd, len, addr);
Please prefix all kernel messages by either the mmc or device e.g.
pr_debug("%s: write_desc: cmd %02x: len %d, offset 0x%0llx\n",
mmc_hostname(host->mmc), cmd, len, addr);
> +
> + if (likely(!len || BOUNDARY_OK(addr, len))) {
> + sdhci_adma_write_desc(host, desc, addr, len, cmd);
> + return;
> + }
> +
> + pr_debug("write_desc: splitting dma len %d, offset 0x%0llx\n",
> + len, addr);
> +
> + offset = addr & (SZ_128M - 1);
> + tmplen = SZ_128M - offset;
> + sdhci_adma_write_desc(host, desc, addr, tmplen, cmd);
> +
> + addr += tmplen;
> + len -= tmplen;
> + sdhci_adma_write_desc(host, desc, addr, len, cmd);
> +}
> +
> +static void sparx5_set_cacheable(struct sdhci_host *host, u32 value)
> +{
> + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> + struct sdhci_sparx5_data *sdhci_sparx5 = sdhci_pltfm_priv(pltfm_host);
> +
> + pr_debug("%s: Set Cacheable = 0x%x\n", mmc_hostname(host->mmc), value);
> +
> + /* Update ACP caching attributes in HW */
> + regmap_update_bits(sdhci_sparx5->cpu_ctrl,
> + CPU_REGS_PROC_CTRL, ACP_CACHE_MASK, value);
> +}
> +
> +static void sparx5_set_delay(struct sdhci_host *host, u8 value)
> +{
> + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> + struct sdhci_sparx5_data *sdhci_sparx5 = sdhci_pltfm_priv(pltfm_host);
> +
> + pr_debug("%s: Set DLY_CC = %u\n", mmc_hostname(host->mmc), value);
> +
> + /* Update DLY_CC in HW */
> + regmap_update_bits(sdhci_sparx5->cpu_ctrl,
> + CPU_REGS_GENERAL_CTRL,
> + MSHC_DLY_CC_MASK,
> + (value << MSHC_DLY_CC_SHIFT));
> +}
> +
> +static void sdhci_sparx5_set_emmc(struct sdhci_host *host)
> +{
> + if (!mmc_card_is_removable(host->mmc)) {
> + u8 value;
> +
> + value = sdhci_readb(host, MSHC2_EMMC_CTRL);
> + if (!(value & MSHC2_EMMC_CTRL_IS_EMMC)) {
> + pr_debug("Get EMMC_CTRL: 0x%08x\n", value);
> + value |= MSHC2_EMMC_CTRL_IS_EMMC;
> + pr_debug("Set EMMC_CTRL: 0x%08x\n", value);
> + sdhci_writeb(host, value, MSHC2_EMMC_CTRL);
> + }
> + }
> +}
> +
> +static void sdhci_sparx5_reset_emmc(struct sdhci_host *host)
> +{
> + u8 value;
> +
> + pr_debug("Toggle EMMC_CTRL.EMMC_RST_N\n");
> + value = sdhci_readb(host, MSHC2_EMMC_CTRL) &
> + ~MSHC2_EMMC_CTRL_EMMC_RST_N;
> + sdhci_writeb(host, value, MSHC2_EMMC_CTRL);
> + /* For eMMC, minimum is 1us but give it 10us for good measure */
> + udelay(10);
> + sdhci_writeb(host, value | MSHC2_EMMC_CTRL_EMMC_RST_N,
> + MSHC2_EMMC_CTRL);
> + /* For eMMC, minimum is 200us but give it 300us for good measure */
> + udelay(300);
usleep_range() is better here
> +}
> +
> +static void sdhci_sparx5_reset(struct sdhci_host *host, u8 mask)
> +{
> + pr_debug("*** RESET: mask %d\n", mask);
> +
> + sdhci_reset(host, mask);
> +
> + /* Be sure CARD_IS_EMMC stays set */
> + sdhci_sparx5_set_emmc(host);
> +}
> +
> +static const struct sdhci_ops sdhci_sparx5_ops = {
> +#if defined(TRACE_REGISTER)
> + .write_l = sdhci_sparx5_writel,
> + .write_w = sdhci_sparx5_writew,
> + .write_b = sdhci_sparx5_writeb,
> +#endif
> + .set_clock = sdhci_set_clock,
> + .set_bus_width = sdhci_set_bus_width,
> + .set_uhs_signaling = sdhci_set_uhs_signaling,
> + .get_max_clock = sdhci_pltfm_clk_get_max_clock,
> + .reset = sdhci_sparx5_reset,
> + .adma_write_desc = sdhci_sparx5_adma_write_desc,
> +};
> +
> +static const struct sdhci_pltfm_data sdhci_sparx5_pdata = {
> + .quirks = 0,
> + .quirks2 = SDHCI_QUIRK2_HOST_NO_CMD23 | /* Card quirk */
If this is a card quirk then it should be in drivers/mmc/core/quirks.h not here.
> + SDHCI_QUIRK2_NO_1_8_V, /* No sdr104, ddr50, etc */
> + .ops = &sdhci_sparx5_ops,
> +};
> +
> +static ssize_t sparx5_delay_clock_show(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct sdhci_sparx5_data *sdhci_sparx5;
> +
> + sdhci_sparx5 = container_of(attr, struct sdhci_sparx5_data,
> + dev_delay_clock);
> + return scnprintf(buf, PAGE_SIZE, "%d\n", sdhci_sparx5->delay_clock);
> +}
> +
> +static ssize_t sparx5_delay_clock_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + unsigned int delay_clock;
> + struct sdhci_sparx5_data *sdhci_sparx5;
> +
> + sdhci_sparx5 = container_of(attr, struct sdhci_sparx5_data,
> + dev_delay_clock);
> +
> + if (kstrtoint(buf, 10, &delay_clock) ||
> + delay_clock > MSHC_DLY_CC_MAX) {
> + dev_err(dev, "sdhci-of-sparx5: wrong parameter format.\n");
> + return -EINVAL;
> + }
> +
> + sdhci_sparx5->delay_clock = delay_clock;
> + sparx5_set_delay(sdhci_sparx5->host, sdhci_sparx5->delay_clock);
> +
> + return strlen(buf);
> +}
> +
> +int sdhci_sparx5_probe(struct platform_device *pdev)
> +{
> + int ret;
> + const char *syscon = "microchip,sparx5-cpu-syscon";
> + struct sdhci_host *host;
> + struct sdhci_pltfm_host *pltfm_host;
> + struct sdhci_sparx5_data *sdhci_sparx5;
> + struct device_node *np = pdev->dev.of_node;
> + u32 value;
> + u32 extra;
> +
> + host = sdhci_pltfm_init(pdev, &sdhci_sparx5_pdata,
> + sizeof(*sdhci_sparx5));
> +
> + if (IS_ERR(host))
> + return PTR_ERR(host);
> +
> + /*
> + * extra adma table cnt for cross 128M boundary handling.
> + */
> + extra = DIV_ROUND_UP_ULL(dma_get_required_mask(&pdev->dev), SZ_128M);
> + if (extra > SDHCI_MAX_SEGS)
> + extra = SDHCI_MAX_SEGS;
> + host->adma_table_cnt += extra;
> +
> + pltfm_host = sdhci_priv(host);
> + sdhci_sparx5 = sdhci_pltfm_priv(pltfm_host);
> + sdhci_sparx5->host = host;
> +
> + pltfm_host->clk = devm_clk_get(&pdev->dev, "core");
> + if (IS_ERR(pltfm_host->clk)) {
> + ret = PTR_ERR(pltfm_host->clk);
> + dev_err(&pdev->dev, "failed to get core clk: %d\n", ret);
> + goto free_pltfm;
> + }
> + ret = clk_prepare_enable(pltfm_host->clk);
> + if (ret)
> + goto free_pltfm;
> +
> + if (!of_property_read_u32(np, "microchip,clock-delay", &value) &&
> + value <= MSHC_DLY_CC_MAX)
> + sdhci_sparx5->delay_clock = value;
> + else
> + sdhci_sparx5->delay_clock = -1; /* Autotune */
> +
> + /* Sysfs delay_clock interface */
> + sdhci_sparx5->dev_delay_clock.show = sparx5_delay_clock_show;
> + sdhci_sparx5->dev_delay_clock.store = sparx5_delay_clock_store;
> + sysfs_attr_init(&sdhci_sparx5->dev_delay_clock.attr);
> + sdhci_sparx5->dev_delay_clock.attr.name = "delay_clock";
> + sdhci_sparx5->dev_delay_clock.attr.mode = 0644;
> + ret = device_create_file(&pdev->dev, &sdhci_sparx5->dev_delay_clock);
Why is this needed? It seems doubtful that user space knows what value to
put here if neither the board information nor the driver have that information.
> + if (ret)
> + dev_err(&pdev->dev, "failure creating '%s' device file",
> + sdhci_sparx5->dev_delay_clock.attr.name);
> +
> + sdhci_get_of_property(pdev);
> +
> + ret = mmc_of_parse(host->mmc);
> + if (ret)
> + goto err_clk;
> +
> + sdhci_sparx5->cpu_ctrl = syscon_regmap_lookup_by_compatible(syscon);
> + if (IS_ERR(sdhci_sparx5->cpu_ctrl)) {
> + dev_err(&pdev->dev, "No CPU syscon regmap !\n");
> + ret = PTR_ERR(sdhci_sparx5->cpu_ctrl);
> + goto err_clk;
> + }
> +
> + if (sdhci_sparx5->delay_clock >= 0)
> + sparx5_set_delay(host, sdhci_sparx5->delay_clock);
> +
> + if (!mmc_card_is_removable(host->mmc)) {
> + /* Do a HW reset of eMMC card */
> + sdhci_sparx5_reset_emmc(host);
> + /* Update EMMC_CTRL */
> + sdhci_sparx5_set_emmc(host);
> + /* If eMMC, disable SD and SDIO */
> + host->mmc->caps2 |= (MMC_CAP2_NO_SDIO|MMC_CAP2_NO_SD);
> + }
> +
> + /* Enable v4 mode */
> + //sdhci_enable_v4_mode(host);
No commented out code please.
> +
> + ret = sdhci_add_host(host);
> + if (ret)
> + dev_err(&pdev->dev, "sdhci_add_host() failed (%d)\n", ret);
> +
> + /* Set AXI bus master to use un-cached access (for DMA) */
> + if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA) &&
> + IS_ENABLED(CONFIG_DMA_DECLARE_COHERENT))
> + sparx5_set_cacheable(host, ACP_CACHE_FORCE_ENA);
> +
> + pr_debug("SDHC version: 0x%08x\n", sdhci_readl(host, MSHC2_VERSION));
> + pr_debug("SDHC type: 0x%08x\n", sdhci_readl(host, MSHC2_TYPE));
> +
> + return ret;
> +
> +err_clk:
> + clk_disable_unprepare(pltfm_host->clk);
> +free_pltfm:
> + sdhci_pltfm_free(pdev);
> + return ret;
> +}
> +
> +static const struct of_device_id sdhci_sparx5_of_match[] = {
> + { .compatible = "microchip,dw-sparx5-sdhci" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, sdhci_sparx5_of_match);
> +
> +static struct platform_driver sdhci_sparx5_driver = {
> + .driver = {
> + .name = "sdhci-sparx5",
> + .of_match_table = sdhci_sparx5_of_match,
> + .pm = &sdhci_pltfm_pmops,
> + },
> + .probe = sdhci_sparx5_probe,
> + .remove = sdhci_pltfm_unregister,
> +};
> +
> +module_platform_driver(sdhci_sparx5_driver);
> +
> +MODULE_DESCRIPTION("Sparx5 SDHCI OF driver");
> +MODULE_AUTHOR("Lars Povlsen <lars.povlsen@microchip.com>");
> +MODULE_LICENSE("GPL v2");
> --
> 2.26.2
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH] ARM: dts: ls1021a: output PPS signal on FIPER2
From: Shawn Guo @ 2020-05-17 13:54 UTC (permalink / raw)
To: Y.b. Lu; +Cc: Richard Cochran, linux-arm-kernel@lists.infradead.org, Leo Li
In-Reply-To: <AM7PR04MB688584E51D49FD4A7761734DF8BC0@AM7PR04MB6885.eurprd04.prod.outlook.com>
On Thu, May 14, 2020 at 03:13:45AM +0000, Y.b. Lu wrote:
> Hi Shawn,
>
> > -----Original Message-----
> > From: Shawn Guo <shawnguo@kernel.org>
> > Sent: Wednesday, May 13, 2020 4:23 PM
> > To: Y.b. Lu <yangbo.lu@nxp.com>
> > Cc: linux-arm-kernel@lists.infradead.org; Leo Li <leoyang.li@nxp.com>;
> > Richard Cochran <richardcochran@gmail.com>
> > Subject: Re: [PATCH] ARM: dts: ls1021a: output PPS signal on FIPER2
> >
> > On Mon, Apr 27, 2020 at 11:56:55AM +0800, Yangbo Lu wrote:
> > > Output PPS signal on FIPER2 (Fixed Period Interval Pulse)
> > > which is more desired by user.
> > >
> > > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> > > ---
> > > arch/arm/boot/dts/ls1021a.dtsi | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
> > > index 760a68c..b2ff27a 100644
> > > --- a/arch/arm/boot/dts/ls1021a.dtsi
> > > +++ b/arch/arm/boot/dts/ls1021a.dtsi
> > > @@ -772,7 +772,7 @@
> > > fsl,tmr-prsc = <2>;
> > > fsl,tmr-add = <0xaaaaaaab>;
> > > fsl,tmr-fiper1 = <999999995>;
> > > - fsl,tmr-fiper2 = <99990>;
> > > + fsl,tmr-fiper2 = <999999995>;
> >
> > Not sure code change matches patch subject and commit log. The change
> > is about changing fsl,tmr-fiper2 setting from one value to another.
>
> The calculation refers to Documentation/devicetree/bindings/ptp/ptp-qoriq.txt. It looks complicated.
> But to be simple, to get 1PPS signal (period is 1s) on FIPER2, the value should be set as,
> fiper2 = <desired period> - <tclk-period> = 1000000000ns - 5ns = 999999995.
Please update commit log to include how new value comes.
Shawn
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH 1/1] arm64: dts: imx8mp: add "fsl,imx6sx-fec" compatible string
From: Shawn Guo @ 2020-05-17 14:14 UTC (permalink / raw)
To: fugang.duan
Cc: aisheng.dong, devicetree, Anson.Huang, s.hauer, linux-kernel,
robh+dt, kernel, festevam, linux-arm-kernel
In-Reply-To: <1588154654-13684-1-git-send-email-fugang.duan@nxp.com>
On Wed, Apr 29, 2020 at 06:04:14PM +0800, fugang.duan@nxp.com wrote:
> From: Fugang Duan <fugang.duan@nxp.com>
>
> Add "fsl,imx6sx-fec" compatible string for fec node, then
> i.MX8MP EVK ethernet function can work now.
>
> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Applied, thanks.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH v2 2/2] ARM: dts: kirkwood: Add Check Point L-50 board
From: Gregory CLEMENT @ 2020-05-17 15:26 UTC (permalink / raw)
To: Pawel Dembicki
Cc: Andrew Lunn, Jason Cooper, Stephan Gerhold, devicetree,
Heiko Stuebner, Linus Walleij, linux-kernel, Rob Herring,
Pawel Dembicki, Mark Brown, Maxime Ripard, Sam Ravnborg,
linux-arm-kernel, Sebastian Hesselbarth
In-Reply-To: <20200409070448.3209-2-paweldembicki@gmail.com>
Hi Pawel Dembicki,
> This patch adds dts for the Check Point L-50 from 600/1100 series
> routers.
>
> Specification:
> -CPU: Marvell Kirkwood 88F6821 1200MHz
> -RAM: 512MB
> -Flash: NAND 512MB
> -WiFi: mPCIe card based on Atheros AR9287 b/g/n
> -WAN: 1 Gigabit Port (Marvell 88E1116R PHY)
> -LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+3))
> -USB: 2x USB2.0
> -Express card slot
> -SD card slot
> -Serial console: RJ-45 115200 8n1
> -Unsupported DSL
>
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Applied on mvebu/dt. I think the first patch should be applied by the
device tree maintainers.
Thanks,
Gregory
> ---
> Changes in v2:
> - none
>
> arch/arm/boot/dts/Makefile | 1 +
> arch/arm/boot/dts/kirkwood-l-50.dts | 441 ++++++++++++++++++++++++++++
> 2 files changed, 442 insertions(+)
> create mode 100644 arch/arm/boot/dts/kirkwood-l-50.dts
>
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index e8dd99201397..eba030b3ba69 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -279,6 +279,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
> kirkwood-iomega_ix2_200.dtb \
> kirkwood-is2.dtb \
> kirkwood-km_kirkwood.dtb \
> + kirkwood-l-50.dtb \
> kirkwood-laplug.dtb \
> kirkwood-linkstation-lsqvl.dtb \
> kirkwood-linkstation-lsvl.dtb \
> diff --git a/arch/arm/boot/dts/kirkwood-l-50.dts b/arch/arm/boot/dts/kirkwood-l-50.dts
> new file mode 100644
> index 000000000000..ab3a90287260
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-l-50.dts
> @@ -0,0 +1,441 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Check Point L-50 Board Description
> + * Copyright 2020 Pawel Dembicki <paweldembicki@gmail.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "kirkwood.dtsi"
> +#include "kirkwood-6281.dtsi"
> +
> +/ {
> + model = "Check Point L-50";
> + compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood";
> +
> + memory {
> + device_type = "memory";
> + reg = <0x00000000 0x20000000>;
> + };
> +
> + chosen {
> + bootargs = "console=ttyS0,115200n8";
> + stdout-path = &uart0;
> + };
> +
> + ocp@f1000000 {
> + pinctrl: pin-controller@10000 {
> + pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>;
> + pinctrl-names = "default";
> +
> + pmx_sysrst: pmx-sysrst {
> + marvell,pins = "mpp6";
> + marvell,function = "sysrst";
> + };
> +
> + pmx_button29: pmx_button29 {
> + marvell,pins = "mpp29";
> + marvell,function = "gpio";
> + };
> +
> + pmx_led38: pmx_led38 {
> + marvell,pins = "mpp38";
> + marvell,function = "gpio";
> + };
> +
> + pmx_sdio_cd: pmx-sdio-cd {
> + marvell,pins = "mpp46";
> + marvell,function = "gpio";
> + };
> + };
> +
> + serial@12000 {
> + status = "okay";
> + };
> +
> + mvsdio@90000 {
> + status = "okay";
> + cd-gpios = <&gpio1 14 9>;
> + };
> +
> + i2c@11000 {
> + status = "okay";
> + clock-frequency = <400000>;
> +
> + gpio2: gpio-expander@20{
> + #gpio-cells = <2>;
> + #interrupt-cells = <2>;
> + compatible = "semtech,sx1505q";
> + reg = <0x20>;
> +
> + gpio-controller;
> + };
> +
> + /* Three GPIOs from 0x21 exp. are undescribed in dts:
> + * 1: DSL module reset (active low)
> + * 5: mPCIE reset (active low)
> + * 6: Express card reset (active low)
> + */
> + gpio3: gpio-expander@21{
> + #gpio-cells = <2>;
> + #interrupt-cells = <2>;
> + compatible = "semtech,sx1505q";
> + reg = <0x21>;
> +
> + gpio-controller;
> + };
> +
> + rtc@30 {
> + compatible = "s35390a";
> + reg = <0x30>;
> + };
> + };
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + status_green {
> + label = "l-50:green:status";
> + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
> + };
> +
> + status_orange {
> + label = "l-50:orange:status";
> + gpios = <&gpio3 2 GPIO_ACTIVE_LOW>;
> + };
> +
> + wifi {
> + label = "l-50:green:wifi";
> + gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "phy0tpt";
> + };
> +
> + internet_green {
> + label = "l-50:green:internet";
> + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
> + };
> +
> + internet_red {
> + label = "l-50:red:internet";
> + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
> + };
> +
> + usb1_green {
> + label = "l-50:green:usb1";
> + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "usbport";
> + trigger-sources = <&hub_port3>;
> + };
> +
> + usb1_red {
> + label = "l-50:red:usb1";
> + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
> + };
> +
> + usb2_green {
> + label = "l-50:green:usb2";
> + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "usbport";
> + trigger-sources = <&hub_port1>;
> + };
> +
> + usb2_red {
> + label = "l-50:red:usb2";
> + gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
> + };
> + };
> +
> + usb2_pwr {
> + compatible = "regulator-fixed";
> + regulator-name = "usb2_pwr";
> +
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + gpio = <&gpio3 3 GPIO_ACTIVE_LOW>;
> + enable-active-low;
> + regulator-always-on;
> + };
> +
> + usb1_pwr {
> + compatible = "regulator-fixed";
> + regulator-name = "usb1_pwr";
> +
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + gpio = <&gpio3 4 GPIO_ACTIVE_LOW>;
> + enable-active-low;
> + regulator-always-on;
> + };
> +
> + mpcie_pwr {
> + compatible = "regulator-fixed";
> + regulator-name = "mpcie_pwr";
> +
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>;
> + enable-active-high;
> + regulator-always-on;
> + };
> +
> + express_card_pwr {
> + compatible = "regulator-fixed";
> + regulator-name = "express_card_pwr";
> +
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>;
> + enable-active-high;
> + regulator-always-on;
> + };
> +
> + keys {
> + compatible = "gpio-keys-polled";
> + poll-interval = <20>;
> +
> + factory_defaults {
> + label = "factory_defaults";
> + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
> + linux,code = <KEY_RESTART>;
> + };
> +
> + };
> +};
> +
> +&mdio {
> + status = "okay";
> +
> + ethphy0: ethernet-phy@8 {
> + reg = <0x08>;
> + };
> +
> + switch0: switch@10 {
> + compatible = "marvell,mv88e6085";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0x10>;
> + dsa,member = <0 0>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + label = "lan5";
> + };
> +
> + port@1 {
> + reg = <1>;
> + label = "lan1";
> + };
> +
> + port@2 {
> + reg = <2>;
> + label = "lan6";
> + };
> +
> + port@3 {
> + reg = <3>;
> + label = "lan2";
> + };
> +
> + port@4 {
> + reg = <4>;
> + label = "lan7";
> + };
> +
> + switch0port5: port@5 {
> + reg = <5>;
> + phy-mode = "rgmii-txid";
> + link = <&switch1port5>;
> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + };
> + };
> +
> + port@6 {
> + reg = <6>;
> + label = "cpu";
> + phy-mode = "rgmii-id";
> + ethernet = <ð1port>;
> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + };
> + };
> + };
> + };
> + switch@11 {
> + compatible = "marvell,mv88e6085";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0x11>;
> + dsa,member = <0 1>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + label = "lan3";
> + };
> +
> + port@1 {
> + reg = <1>;
> + label = "lan8";
> + };
> +
> + port@2 {
> + reg = <2>;
> + label = "lan4";
> + };
> +
> + port@3 {
> + reg = <3>;
> + label = "dmz";
> + };
> +
> + switch1port5: port@5 {
> + reg = <5>;
> + phy-mode = "rgmii-txid";
> + link = <&switch0port5>;
> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + };
> + };
> +
> + port@6 {
> + reg = <6>;
> + label = "dsl";
> + fixed-link {
> + speed = <100>;
> + full-duplex;
> + };
> + };
> + };
> + };
> +};
> +
> +ð0 {
> + status = "okay";
> + ethernet0-port@0 {
> + phy-handle = <ðphy0>;
> + };
> +};
> +
> +ð1 {
> + status = "okay";
> + ethernet1-port@0 {
> + speed = <1000>;
> + duplex = <1>;
> + };
> +};
> +
> +&nand {
> + status = "okay";
> + pinctrl-0 = <&pmx_nand>;
> + pinctrl-names = "default";
> +
> + partition@0 {
> + label = "u-boot";
> + reg = <0x0000000 0xc0000>;
> + };
> +
> + partition@a0000 {
> + label = "bootldr-env";
> + reg = <0x000c0000 0x40000>;
> + };
> +
> + partition@100000 {
> + label = "kernel-1";
> + reg = <0x00100000 0x800000>;
> + };
> +
> + partition@900000 {
> + label = "rootfs-1";
> + reg = <0x08200000 0x7100000>;
> + };
> +
> + partition@7a00000 {
> + label = "kernel-2";
> + reg = <0x07a00000 0x800000>;
> + };
> +
> + partition@8200000 {
> + label = "rootfs-2";
> + reg = <0x08200000 0x7100000>;
> + };
> +
> + partition@f300000 {
> + label = "default_sw";
> + reg = <0x0f300000 0x7900000>;
> + };
> +
> + partition@16c00000 {
> + label = "logs";
> + reg = <0x16c00000 0x1800000>;
> + };
> +
> + partition@18400000 {
> + label = "preset_cfg";
> + reg = <0x18400000 0x100000>;
> + };
> +
> + partition@18500000 {
> + label = "adsl";
> + reg = <0x18500000 0x100000>;
> + };
> +
> + partition@18600000 {
> + label = "storage";
> + reg = <0x18600000 0x7A00000>;
> + };
> +};
> +
> +&rtc {
> + status = "disabled";
> +};
> +
> +&pciec {
> + status = "okay";
> +};
> +
> +&pcie0 {
> + status = "okay";
> +};
> +
> +&sata_phy0 {
> + status = "disabled";
> +};
> +
> +&sata_phy1 {
> + status = "disabled";
> +};
> +
> +&usb0 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + status = "okay";
> +
> + port@1 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <1>;
> + #trigger-source-cells = <0>;
> +
> + hub_port1: port@1 {
> + reg = <1>;
> + #trigger-source-cells = <0>;
> + };
> +
> + hub_port3: port@3 {
> + reg = <3>;
> + #trigger-source-cells = <0>;
> + };
> + };
> +};
> --
> 2.20.1
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH] ARM: kprobes: Avoid fortify_panic() when copying optprobe template
From: Andrew Jeffery @ 2020-05-17 15:39 UTC (permalink / raw)
To: linux-arm-kernel
Cc: keescook, linux, linux-kernel, mathieu.desnoyers, mhiramat,
labbott
Setting both CONFIG_KPROBES=y and CONFIG_FORTIFY_SOURCE=y on ARM leads
to a panic in memcpy() when injecting a kprobe despite the fixes found
in commit e46daee53bb5 ("ARM: 8806/1: kprobes: Fix false positive with
FORTIFY_SOURCE") and commit 0ac569bf6a79 ("ARM: 8834/1: Fix: kprobes:
optimized kprobes illegal instruction").
arch/arm/include/asm/kprobes.h effectively declares
the target type of the optprobe_template_entry assembly label as a u32,
which leads memcpy()'s __builtin_object_size() call to determine that
the pointed-to object is of size four. In practical terms the symbol is
used as a handle for the optimised probe assembly template that is at
least 96 bytes in size. The symbol's use despite its type blows up the
memcpy() in ARM's arch_prepare_optimized_kprobe() with a false-positive
fortify_panic() when it should instead copy the optimised probe template
into place.
As mentioned, a couple of attempts have been made to address the issue
by casting a pointer to optprobe_template_entry before providing it to
memcpy(), however gccs such as Ubuntu 20.04's arm-linux-gnueabi-gcc
9.3.0 (Ubuntu 9.3.0-10ubuntu1) see through these efforts.
Squash the false-positive by aliasing the template assembly with a new
symbol 'arm_optprobe_template'; declare it as a function object and
pass the function object as the argument to memcpy() such that
__builtin_object_size() cannot immediately determine the object size.
Fixes: e46daee53bb5 ("ARM: 8806/1: kprobes: Fix false positive with FORTIFY_SOURCE")
Fixes: 0ac569bf6a79 ("ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction")
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
arch/arm/include/asm/kprobes.h | 7 +++++++
arch/arm/probes/kprobes/opt-arm.c | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h
index 213607a1f45c..94db8bf25f9c 100644
--- a/arch/arm/include/asm/kprobes.h
+++ b/arch/arm/include/asm/kprobes.h
@@ -43,6 +43,13 @@ int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
int kprobe_exceptions_notify(struct notifier_block *self,
unsigned long val, void *data);
+/*
+ * The optprobe template buffer is not anything that should be called directly,
+ * however describe it as a function to give ourselves a handle to it that
+ * bypasses CONFIG_FORTIFY_SOURCE=y sanity checks in memcpy().
+ */
+extern __visible void arm_optprobe_template(void);
+
/* optinsn template addresses */
extern __visible kprobe_opcode_t optprobe_template_entry;
extern __visible kprobe_opcode_t optprobe_template_val;
diff --git a/arch/arm/probes/kprobes/opt-arm.c b/arch/arm/probes/kprobes/opt-arm.c
index 7a449df0b359..59133d59616a 100644
--- a/arch/arm/probes/kprobes/opt-arm.c
+++ b/arch/arm/probes/kprobes/opt-arm.c
@@ -31,6 +31,8 @@
* to the stack cost of the instruction.
*/
asm (
+ ".global arm_optprobe_template\n"
+ "arm_optprobe_template:\n"
".global optprobe_template_entry\n"
"optprobe_template_entry:\n"
".global optprobe_template_sub_sp\n"
@@ -234,7 +236,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or
}
/* Copy arch-dep-instance from template. */
- memcpy(code, (unsigned long *)&optprobe_template_entry,
+ memcpy(code, arm_optprobe_template,
TMPL_END_IDX * sizeof(kprobe_opcode_t));
/* Adjust buffer according to instruction. */
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* Re: [PATCH v2 2/2] ARM: dts: kirkwood: Add Check Point L-50 board
From: Paweł Dembicki @ 2020-05-17 15:51 UTC (permalink / raw)
To: Gregory CLEMENT
Cc: Andrew Lunn, Jason Cooper, Stephan Gerhold,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Heiko Stuebner, Linus Walleij, linux-kernel, Maxime Ripard,
Rob Herring, Mark Brown, Sam Ravnborg, Linux ARM,
Sebastian Hesselbarth
In-Reply-To: <87sgfyh9au.fsf@FE-laptop>
On 17.05.2020 at 17:26 Gregory CLEMENT <gregory.clement@bootlin.com> wrote:
>
> Hi Pawel Dembicki,
>
Hi Gregory,
>
> Applied on mvebu/dt. I think the first patch should be applied by the
> device tree maintainers.
>
> Thanks,
>
> Gregory
>
I sent v3 of this patch some time ago:
https://lkml.org/lkml/2020/4/22/1353
Is possible to use it instead v2?
Best Regards,
Pawel Dembicki
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH 2/2] arm64: dts: marvell: drop i2c timeout-ms property
From: Gregory CLEMENT @ 2020-05-17 16:01 UTC (permalink / raw)
To: Baruch Siach, Jason Cooper, Andrew Lunn, Sebastian Hesselbarth
Cc: Baruch Siach, linux-arm-kernel
In-Reply-To: <26aad6ac18993b78496ea224337d9944878fcc81.1588134636.git.baruch@tkos.co.il>
Hello Baruch,
> The timeout-ms property for i2c master nodes is undocumented, and as
> never been supported. Drop it.
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Applied on mvebu/dt64
Thanks,
Gregory
> ---
> arch/arm64/boot/dts/marvell/armada-ap80x.dtsi | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-ap80x.dtsi b/arch/arm64/boot/dts/marvell/armada-ap80x.dtsi
> index e7438c21ccee..7f9b9a647717 100644
> --- a/arch/arm64/boot/dts/marvell/armada-ap80x.dtsi
> +++ b/arch/arm64/boot/dts/marvell/armada-ap80x.dtsi
> @@ -201,7 +201,6 @@ i2c0: i2c@511000 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
> - timeout-ms = <1000>;
> clocks = <&ap_clk 3>;
> status = "disabled";
> };
> --
> 2.26.2
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH] ARM: kprobes: Avoid fortify_panic() when copying optprobe template
From: Russell King - ARM Linux admin @ 2020-05-17 16:02 UTC (permalink / raw)
To: Andrew Jeffery
Cc: keescook, linux-kernel, mathieu.desnoyers, mhiramat, labbott,
linux-arm-kernel
In-Reply-To: <20200517153959.293224-1-andrew@aj.id.au>
On Mon, May 18, 2020 at 01:09:59AM +0930, Andrew Jeffery wrote:
> Setting both CONFIG_KPROBES=y and CONFIG_FORTIFY_SOURCE=y on ARM leads
> to a panic in memcpy() when injecting a kprobe despite the fixes found
> in commit e46daee53bb5 ("ARM: 8806/1: kprobes: Fix false positive with
> FORTIFY_SOURCE") and commit 0ac569bf6a79 ("ARM: 8834/1: Fix: kprobes:
> optimized kprobes illegal instruction").
>
> arch/arm/include/asm/kprobes.h effectively declares
> the target type of the optprobe_template_entry assembly label as a u32,
> which leads memcpy()'s __builtin_object_size() call to determine that
> the pointed-to object is of size four. In practical terms the symbol is
> used as a handle for the optimised probe assembly template that is at
> least 96 bytes in size. The symbol's use despite its type blows up the
> memcpy() in ARM's arch_prepare_optimized_kprobe() with a false-positive
> fortify_panic() when it should instead copy the optimised probe template
> into place.
>
> As mentioned, a couple of attempts have been made to address the issue
> by casting a pointer to optprobe_template_entry before providing it to
> memcpy(), however gccs such as Ubuntu 20.04's arm-linux-gnueabi-gcc
> 9.3.0 (Ubuntu 9.3.0-10ubuntu1) see through these efforts.
>
> Squash the false-positive by aliasing the template assembly with a new
> symbol 'arm_optprobe_template'; declare it as a function object and
> pass the function object as the argument to memcpy() such that
> __builtin_object_size() cannot immediately determine the object size.
>
> Fixes: e46daee53bb5 ("ARM: 8806/1: kprobes: Fix false positive with FORTIFY_SOURCE")
> Fixes: 0ac569bf6a79 ("ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction")
> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
> ---
> arch/arm/include/asm/kprobes.h | 7 +++++++
> arch/arm/probes/kprobes/opt-arm.c | 4 +++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h
> index 213607a1f45c..94db8bf25f9c 100644
> --- a/arch/arm/include/asm/kprobes.h
> +++ b/arch/arm/include/asm/kprobes.h
> @@ -43,6 +43,13 @@ int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
> int kprobe_exceptions_notify(struct notifier_block *self,
> unsigned long val, void *data);
>
> +/*
> + * The optprobe template buffer is not anything that should be called directly,
> + * however describe it as a function to give ourselves a handle to it that
> + * bypasses CONFIG_FORTIFY_SOURCE=y sanity checks in memcpy().
> + */
> +extern __visible void arm_optprobe_template(void);
Does this really need to be globally visible to anything that happens
to include this header?
While we may abhor "extern" declarations and prototypes in .c files, it
seems to me to be entirely reasonable for this to live in opt-arm.c and
remove the .global for this symbol, thereby making this symbol local to
opt-arm.c
> +
> /* optinsn template addresses */
> extern __visible kprobe_opcode_t optprobe_template_entry;
> extern __visible kprobe_opcode_t optprobe_template_val;
> diff --git a/arch/arm/probes/kprobes/opt-arm.c b/arch/arm/probes/kprobes/opt-arm.c
> index 7a449df0b359..59133d59616a 100644
> --- a/arch/arm/probes/kprobes/opt-arm.c
> +++ b/arch/arm/probes/kprobes/opt-arm.c
> @@ -31,6 +31,8 @@
> * to the stack cost of the instruction.
> */
> asm (
> + ".global arm_optprobe_template\n"
> + "arm_optprobe_template:\n"
> ".global optprobe_template_entry\n"
> "optprobe_template_entry:\n"
> ".global optprobe_template_sub_sp\n"
> @@ -234,7 +236,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or
> }
>
> /* Copy arch-dep-instance from template. */
> - memcpy(code, (unsigned long *)&optprobe_template_entry,
> + memcpy(code, arm_optprobe_template,
> TMPL_END_IDX * sizeof(kprobe_opcode_t));
>
> /* Adjust buffer according to instruction. */
> --
> 2.25.1
>
>
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH 1/2] ARM: dts: marvell: drop i2c timeout-ms property
From: Gregory CLEMENT @ 2020-05-17 16:02 UTC (permalink / raw)
To: Baruch Siach, Jason Cooper, Andrew Lunn, Sebastian Hesselbarth
Cc: Baruch Siach, linux-arm-kernel
In-Reply-To: <21ba4c9abd5e411ba936ead8f043c5a7e490d530.1588134636.git.baruch@tkos.co.il>
Hello Baruch,
> The timeout-ms property for i2c master nodes is undocumented, and as
> never been supported. Drop it.
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Applied on mvebu/dt
Thanks,
Gregory
> ---
> arch/arm/boot/dts/armada-370-xp.dtsi | 2 --
> arch/arm/boot/dts/armada-375.dtsi | 2 --
> arch/arm/boot/dts/armada-38x.dtsi | 2 --
> arch/arm/boot/dts/armada-39x.dtsi | 4 ----
> arch/arm/boot/dts/dove.dtsi | 1 -
> 5 files changed, 11 deletions(-)
>
> diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
> index c15f5e92f97f..0b8c2a64b36f 100644
> --- a/arch/arm/boot/dts/armada-370-xp.dtsi
> +++ b/arch/arm/boot/dts/armada-370-xp.dtsi
> @@ -114,7 +114,6 @@ i2c0: i2c@11000 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <31>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> @@ -124,7 +123,6 @@ i2c1: i2c@11100 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <32>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> diff --git a/arch/arm/boot/dts/armada-375.dtsi b/arch/arm/boot/dts/armada-375.dtsi
> index 2932a29ae272..9805e507c695 100644
> --- a/arch/arm/boot/dts/armada-375.dtsi
> +++ b/arch/arm/boot/dts/armada-375.dtsi
> @@ -236,7 +236,6 @@ i2c0: i2c@11000 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> @@ -247,7 +246,6 @@ i2c1: i2c@11100 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> diff --git a/arch/arm/boot/dts/armada-38x.dtsi b/arch/arm/boot/dts/armada-38x.dtsi
> index e038abc0c6b4..348116501aa2 100644
> --- a/arch/arm/boot/dts/armada-38x.dtsi
> +++ b/arch/arm/boot/dts/armada-38x.dtsi
> @@ -153,7 +153,6 @@ i2c0: i2c@11000 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> @@ -164,7 +163,6 @@ i2c1: i2c@11100 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> diff --git a/arch/arm/boot/dts/armada-39x.dtsi b/arch/arm/boot/dts/armada-39x.dtsi
> index b1b86934c688..e0b7c2099831 100644
> --- a/arch/arm/boot/dts/armada-39x.dtsi
> +++ b/arch/arm/boot/dts/armada-39x.dtsi
> @@ -108,7 +108,6 @@ i2c0: i2c@11000 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> @@ -119,7 +118,6 @@ i2c1: i2c@11100 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> @@ -130,7 +128,6 @@ i2c2: i2c@11200 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> @@ -141,7 +138,6 @@ i2c3: i2c@11300 {
> #address-cells = <1>;
> #size-cells = <0>;
> interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
> - timeout-ms = <1000>;
> clocks = <&coreclk 0>;
> status = "disabled";
> };
> diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
> index 3081b04e8c08..a551fabae851 100644
> --- a/arch/arm/boot/dts/dove.dtsi
> +++ b/arch/arm/boot/dts/dove.dtsi
> @@ -175,7 +175,6 @@ i2c: i2c@11000 {
> #size-cells = <0>;
> interrupts = <11>;
> clock-frequency = <400000>;
> - timeout-ms = <1000>;
> clocks = <&core_clk 0>;
> status = "okay";
> };
> --
> 2.26.2
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH 2/2] arm64: dts: add uDPU i2c bus recovery
From: Gregory CLEMENT @ 2020-05-17 16:10 UTC (permalink / raw)
To: Russell King, linux-i2c
Cc: Andrew Lunn, Jason Cooper, devicetree, Vladimir Vid, Rob Herring,
linux-arm-kernel, Sebastian Hesselbarth
In-Reply-To: <E1jWGXd-0000Z7-1n@rmk-PC.armlinux.org.uk>
Hi Russell,
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Applied on mvebu/dt64
Thanks,
Gregory
> ---
> .../boot/dts/marvell/armada-3720-uDPU.dts | 22 +++++++++++++++++--
> 1 file changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
> index 7eb6c1796cef..95d46e8d081c 100644
> --- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
> +++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
> @@ -117,18 +117,36 @@
> };
> };
>
> +&pinctrl_nb {
> + i2c1_recovery_pins: i2c1-recovery-pins {
> + groups = "i2c1";
> + function = "gpio";
> + };
> +
> + i2c2_recovery_pins: i2c2-recovery-pins {
> + groups = "i2c2";
> + function = "gpio";
> + };
> +};
> +
> &i2c0 {
> status = "okay";
> - pinctrl-names = "default";
> + pinctrl-names = "default", "recovery";
> pinctrl-0 = <&i2c1_pins>;
> + pinctrl-1 = <&i2c1_recovery_pins>;
> /delete-property/mrvl,i2c-fast-mode;
> + scl-gpios = <&gpionb 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> + sda-gpios = <&gpionb 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> };
>
> &i2c1 {
> status = "okay";
> - pinctrl-names = "default";
> + pinctrl-names = "default", "recovery";
> pinctrl-0 = <&i2c2_pins>;
> + pinctrl-1 = <&i2c2_recovery_pins>;
> /delete-property/mrvl,i2c-fast-mode;
> + scl-gpios = <&gpionb 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> + sda-gpios = <&gpionb 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
>
> lm75@48 {
> status = "okay";
> --
> 2.20.1
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: clarify maintenance of ARM Dove drivers
From: Gregory CLEMENT @ 2020-05-17 16:23 UTC (permalink / raw)
To: Lukas Bulwahn, Russell King, Jason Cooper, Andrew Lunn,
Sebastian Hesselbarth
Cc: Joe Perches, Lukas Bulwahn, kernel-janitors, linux-kernel,
linux-arm-kernel
In-Reply-To: <20200328134304.7317-1-lukas.bulwahn@gmail.com>
Hi Lukas,
> Commit 44e259ac909f ("ARM: dove: create a proper PMU driver for power
> domains, PMU IRQs and resets") introduced new drivers for the ARM Dove SOC,
> but did not add those drivers to the existing entry ARM/Marvell
> Dove/MV78xx0/Orion SOC support in MAINTAINERS. Hence, these drivers were
> considered to be part of "THE REST".
>
> Clarify now that these drivers are maintained by the ARM/Marvell
> Dove/MV78xx0/Orion SOC support maintainers.
> Also order the T: entry to the
> place it belongs to, while at it.
In 5.7-rc1 Linus took care of it, so I removed this part ofthe commit
log.
>
> This was identified with a small script that finds all files only belonging
> to "THE REST" according to the current MAINTAINERS file, and I acted upon
> its output.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Applied on mvebu/arm
Thanks,
Gregory
> ---
> applies cleanly on current master and on next-20200327
>
> MAINTAINERS | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 8b8abe756ae0..38fff0374082 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1979,6 +1979,7 @@ M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> M: Gregory Clement <gregory.clement@bootlin.com>
> L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
> S: Maintained
> +T: git git://git.infradead.org/linux-mvebu.git
> F: Documentation/devicetree/bindings/soc/dove/
> F: arch/arm/mach-dove/
> F: arch/arm/mach-mv78xx0/
> @@ -1986,7 +1987,7 @@ F: arch/arm/mach-orion5x/
> F: arch/arm/plat-orion/
> F: arch/arm/boot/dts/dove*
> F: arch/arm/boot/dts/orion5x*
> -T: git git://git.infradead.org/linux-mvebu.git
> +F: drivers/soc/dove/
>
> ARM/Marvell Kirkwood and Armada 370, 375, 38x, 39x, XP, 3700, 7K/8K, CN9130 SOC support
> M: Jason Cooper <jason@lakedaemon.net>
> --
> 2.17.1
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH v3] ARM: dts: kirkwood: Add Check Point L-50 board
From: Gregory CLEMENT @ 2020-05-17 16:27 UTC (permalink / raw)
To: Pawel Dembicki
Cc: Andrew Lunn, Jason Cooper, devicetree, linux-kernel, Rob Herring,
Pawel Dembicki, linux-arm-kernel, Sebastian Hesselbarth
In-Reply-To: <20200422150007.29119-1-paweldembicki@gmail.com>
Hello Pawel,
> This patch adds dts for the Check Point L-50 from 600/1100 series
> routers.
>
> Specification:
> -CPU: Marvell Kirkwood 88F6821 1200MHz
> -RAM: 512MB
> -Flash: NAND 512MB
> -WiFi: mPCIe card based on Atheros AR9287 b/g/n
> -WAN: 1 Gigabit Port (Marvell 88E1116R PHY)
> -LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+4))
> -USB: 2x USB2.0
> -Express card slot
> -SD card slot
> -Serial console: RJ-45 115200 8n1
> -Unsupported DSL
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
I've missed there was a v3, so I replaced the v2 patch by this patch.
Gregory
> ---
> Changes in v3:
> - fix typo and code style issues pointed by OpenWrt guys
> Changes in v2:
> - none
>
> arch/arm/boot/dts/Makefile | 1 +
> arch/arm/boot/dts/kirkwood-l-50.dts | 438 ++++++++++++++++++++++++++++
> 2 files changed, 439 insertions(+)
> create mode 100644 arch/arm/boot/dts/kirkwood-l-50.dts
>
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index e8dd99201397..eba030b3ba69 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -279,6 +279,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
> kirkwood-iomega_ix2_200.dtb \
> kirkwood-is2.dtb \
> kirkwood-km_kirkwood.dtb \
> + kirkwood-l-50.dtb \
> kirkwood-laplug.dtb \
> kirkwood-linkstation-lsqvl.dtb \
> kirkwood-linkstation-lsvl.dtb \
> diff --git a/arch/arm/boot/dts/kirkwood-l-50.dts b/arch/arm/boot/dts/kirkwood-l-50.dts
> new file mode 100644
> index 000000000000..0d81c43a6a73
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-l-50.dts
> @@ -0,0 +1,438 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Check Point L-50 Board Description
> + * Copyright 2020 Pawel Dembicki <paweldembicki@gmail.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "kirkwood.dtsi"
> +#include "kirkwood-6281.dtsi"
> +
> +/ {
> + model = "Check Point L-50";
> + compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood";
> +
> + memory {
> + device_type = "memory";
> + reg = <0x00000000 0x20000000>;
> + };
> +
> + chosen {
> + bootargs = "console=ttyS0,115200n8";
> + stdout-path = &uart0;
> + };
> +
> + ocp@f1000000 {
> + pinctrl: pin-controller@10000 {
> + pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>;
> + pinctrl-names = "default";
> +
> + pmx_sysrst: pmx-sysrst {
> + marvell,pins = "mpp6";
> + marvell,function = "sysrst";
> + };
> +
> + pmx_button29: pmx_button29 {
> + marvell,pins = "mpp29";
> + marvell,function = "gpio";
> + };
> +
> + pmx_led38: pmx_led38 {
> + marvell,pins = "mpp38";
> + marvell,function = "gpio";
> + };
> +
> + pmx_sdio_cd: pmx-sdio-cd {
> + marvell,pins = "mpp46";
> + marvell,function = "gpio";
> + };
> + };
> +
> + serial@12000 {
> + status = "okay";
> + };
> +
> + mvsdio@90000 {
> + status = "okay";
> + cd-gpios = <&gpio1 14 9>;
> + };
> +
> + i2c@11000 {
> + status = "okay";
> + clock-frequency = <400000>;
> +
> + gpio2: gpio-expander@20{
> + #gpio-cells = <2>;
> + #interrupt-cells = <2>;
> + compatible = "semtech,sx1505q";
> + reg = <0x20>;
> +
> + gpio-controller;
> + };
> +
> + /* Three GPIOs from 0x21 exp. are undescribed in dts:
> + * 1: DSL module reset (active low)
> + * 5: mPCIE reset (active low)
> + * 6: Express card reset (active low)
> + */
> + gpio3: gpio-expander@21{
> + #gpio-cells = <2>;
> + #interrupt-cells = <2>;
> + compatible = "semtech,sx1505q";
> + reg = <0x21>;
> +
> + gpio-controller;
> + };
> +
> + rtc@30 {
> + compatible = "s35390a";
> + reg = <0x30>;
> + };
> + };
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + status_green {
> + label = "l-50:green:status";
> + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
> + };
> +
> + status_red {
> + label = "l-50:red:status";
> + gpios = <&gpio3 2 GPIO_ACTIVE_LOW>;
> + };
> +
> + wifi {
> + label = "l-50:green:wifi";
> + gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "phy0tpt";
> + };
> +
> + internet_green {
> + label = "l-50:green:internet";
> + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
> + };
> +
> + internet_red {
> + label = "l-50:red:internet";
> + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
> + };
> +
> + usb1_green {
> + label = "l-50:green:usb1";
> + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "usbport";
> + trigger-sources = <&hub_port3>;
> + };
> +
> + usb1_red {
> + label = "l-50:red:usb1";
> + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
> + };
> +
> + usb2_green {
> + label = "l-50:green:usb2";
> + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "usbport";
> + trigger-sources = <&hub_port1>;
> + };
> +
> + usb2_red {
> + label = "l-50:red:usb2";
> + gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
> + };
> + };
> +
> + usb2_pwr {
> + compatible = "regulator-fixed";
> + regulator-name = "usb2_pwr";
> +
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + gpio = <&gpio3 3 GPIO_ACTIVE_LOW>;
> + regulator-always-on;
> + };
> +
> + usb1_pwr {
> + compatible = "regulator-fixed";
> + regulator-name = "usb1_pwr";
> +
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + gpio = <&gpio3 4 GPIO_ACTIVE_LOW>;
> + regulator-always-on;
> + };
> +
> + mpcie_pwr {
> + compatible = "regulator-fixed";
> + regulator-name = "mpcie_pwr";
> +
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>;
> + enable-active-high;
> + regulator-always-on;
> + };
> +
> + express_card_pwr {
> + compatible = "regulator-fixed";
> + regulator-name = "express_card_pwr";
> +
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>;
> + enable-active-high;
> + regulator-always-on;
> + };
> +
> + keys {
> + compatible = "gpio-keys";
> +
> + factory_defaults {
> + label = "factory_defaults";
> + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
> + linux,code = <KEY_RESTART>;
> + };
> + };
> +};
> +
> +&mdio {
> + status = "okay";
> +
> + ethphy8: ethernet-phy@8 {
> + reg = <0x08>;
> + };
> +
> + switch0: switch@10 {
> + compatible = "marvell,mv88e6085";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0x10>;
> + dsa,member = <0 0>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + label = "lan5";
> + };
> +
> + port@1 {
> + reg = <1>;
> + label = "lan1";
> + };
> +
> + port@2 {
> + reg = <2>;
> + label = "lan6";
> + };
> +
> + port@3 {
> + reg = <3>;
> + label = "lan2";
> + };
> +
> + port@4 {
> + reg = <4>;
> + label = "lan7";
> + };
> +
> + switch0port5: port@5 {
> + reg = <5>;
> + phy-mode = "rgmii-txid";
> + link = <&switch1port5>;
> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + };
> + };
> +
> + port@6 {
> + reg = <6>;
> + label = "cpu";
> + phy-mode = "rgmii-id";
> + ethernet = <ð1port>;
> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + };
> + };
> + };
> + };
> +
> + switch@11 {
> + compatible = "marvell,mv88e6085";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0x11>;
> + dsa,member = <0 1>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + label = "lan3";
> + };
> +
> + port@1 {
> + reg = <1>;
> + label = "lan8";
> + };
> +
> + port@2 {
> + reg = <2>;
> + label = "lan4";
> + };
> +
> + port@3 {
> + reg = <3>;
> + label = "dmz";
> + };
> +
> + switch1port5: port@5 {
> + reg = <5>;
> + phy-mode = "rgmii-txid";
> + link = <&switch0port5>;
> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + };
> + };
> +
> + port@6 {
> + reg = <6>;
> + label = "dsl";
> + fixed-link {
> + speed = <100>;
> + full-duplex;
> + };
> + };
> + };
> + };
> +};
> +
> +ð0 {
> + status = "okay";
> + ethernet0-port@0 {
> + phy-handle = <ðphy8>;
> + };
> +};
> +
> +ð1 {
> + status = "okay";
> + ethernet1-port@0 {
> + speed = <1000>;
> + duplex = <1>;
> + };
> +};
> +
> +&nand {
> + status = "okay";
> + pinctrl-0 = <&pmx_nand>;
> + pinctrl-names = "default";
> +
> + partition@0 {
> + label = "u-boot";
> + reg = <0x00000000 0x000c0000>;
> + };
> +
> + partition@a0000 {
> + label = "bootldr-env";
> + reg = <0x000c0000 0x00040000>;
> + };
> +
> + partition@100000 {
> + label = "kernel-1";
> + reg = <0x00100000 0x00800000>;
> + };
> +
> + partition@900000 {
> + label = "rootfs-1";
> + reg = <0x00900000 0x07100000>;
> + };
> +
> + partition@7a00000 {
> + label = "kernel-2";
> + reg = <0x07a00000 0x00800000>;
> + };
> +
> + partition@8200000 {
> + label = "rootfs-2";
> + reg = <0x08200000 0x07100000>;
> + };
> +
> + partition@f300000 {
> + label = "default_sw";
> + reg = <0x0f300000 0x07900000>;
> + };
> +
> + partition@16c00000 {
> + label = "logs";
> + reg = <0x16c00000 0x01800000>;
> + };
> +
> + partition@18400000 {
> + label = "preset_cfg";
> + reg = <0x18400000 0x00100000>;
> + };
> +
> + partition@18500000 {
> + label = "adsl";
> + reg = <0x18500000 0x00100000>;
> + };
> +
> + partition@18600000 {
> + label = "storage";
> + reg = <0x18600000 0x07a00000>;
> + };
> +};
> +
> +&rtc {
> + status = "disabled";
> +};
> +
> +&pciec {
> + status = "okay";
> +};
> +
> +&pcie0 {
> + status = "okay";
> +};
> +
> +&sata_phy0 {
> + status = "disabled";
> +};
> +
> +&sata_phy1 {
> + status = "disabled";
> +};
> +
> +&usb0 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + status = "okay";
> +
> + port@1 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <1>;
> + #trigger-source-cells = <0>;
> +
> + hub_port1: port@1 {
> + reg = <1>;
> + #trigger-source-cells = <0>;
> + };
> +
> + hub_port3: port@3 {
> + reg = <3>;
> + #trigger-source-cells = <0>;
> + };
> + };
> +};
> --
> 2.20.1
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
From: André Przywara @ 2020-05-17 16:42 UTC (permalink / raw)
To: Amit Tomer
Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel
In-Reply-To: <CABHD4K9yjUGuo0w-RfhdZQJm3Wtj6bU2H4DXcp4Jjp=e0fFeyA@mail.gmail.com>
On 17/05/2020 12:56, Amit Tomer wrote:
> Hi,
>
>> So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
>> to the binding, but leaving the driver alone for now.
>
> But if we leave this new string from driver , there would be DT
> validation issue.
I don't understand what this has to do with the driver, but I asked
above to also change the binding, allowing this compatible string
combination.
Cheers,
Andre
> Are we okay with it ?
>
> Thanks
> -Amit
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH] ARM: dts: kirkwood: ReadyNAS NV+v2: Add LCD panel
From: Gregory CLEMENT @ 2020-05-17 16:52 UTC (permalink / raw)
To: Brian J. Tarricone, linux-arm-kernel
Cc: andrew, Brian J. Tarricone, jason, sebastian.hesselbarth
In-Reply-To: <20200425192820.2499185-1-brian@tarricone.org>
Hi Brian,
> The NV+ v2 has a WH1602 LCD panel (which is just a rebranded HD44780),
> similar to the Netgear RN104, just with different GPIO assignments.
>
> Signed-off-by: Brian J. Tarricone <brian@tarricone.org>
Applied on mvebu/dt
Thanks,
Gregory
> ---
> .../boot/dts/kirkwood-netgear_readynas_nv+_v2.dts | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/arch/arm/boot/dts/kirkwood-netgear_readynas_nv+_v2.dts b/arch/arm/boot/dts/kirkwood-netgear_readynas_nv+_v2.dts
> index 8cc8550242ef..b13aee570804 100644
> --- a/arch/arm/boot/dts/kirkwood-netgear_readynas_nv+_v2.dts
> +++ b/arch/arm/boot/dts/kirkwood-netgear_readynas_nv+_v2.dts
> @@ -113,6 +113,20 @@ sata@80000 { /* Connected to Marvell 88SM4140 SATA port multiplier */
> };
> };
>
> + auxdisplay {
> + compatible = "hit,hd44780";
> + data-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>,
> + <&gpio1 1 GPIO_ACTIVE_HIGH>,
> + <&gpio1 3 GPIO_ACTIVE_HIGH>,
> + <&gpio1 17 GPIO_ACTIVE_HIGH>;
> + enable-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
> + rs-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
> + rw-gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
> + backlight-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
> + display-height-chars = <2>;
> + display-width-chars = <16>;
> + };
> +
> gpio-leds {
> compatible = "gpio-leds";
> pinctrl-0 = < &pmx_led_blue_power &pmx_led_blue_backup
> --
> 2.26.2
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH mvebu-dt64] arm64: dts: armada-3720-turris-mox: forbid SDR104 on SDIO for FCC purposes
From: Gregory CLEMENT @ 2020-05-17 16:56 UTC (permalink / raw)
To: Marek Behún; +Cc: SoC Team, arm-soc, Linux ARM, Marek Behún
In-Reply-To: <20200430231144.17350-1-marek.behun@nic.cz>
Hi Marek,
> Use sdhci-caps-mask to forbid SDR104 mode on the SDIO capable SDHCI
> controller. Without this the device cannot pass electromagnetic
> interference certifications.
>
> Fixes: 7109d817db2e ("arm64: dts: marvell: add DTS for Turris Mox")
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Applied on mvebu/dt64
Thanks,
Gregory
> ---
> arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
> index bb42d1e6a4e9..47fee66c70cb 100644
> --- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
> +++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
> @@ -179,6 +179,8 @@ &sdhci1 {
> marvell,pad-type = "sd";
> vqmmc-supply = <&vsdio_reg>;
> mmc-pwrseq = <&sdhci1_pwrseq>;
> + /* forbid SDR104 for FCC purposes */
> + sdhci-caps-mask = <0x2 0x0>;
> status = "okay";
> };
>
> --
> 2.24.1
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH mvebu-dt64] arm64: dts: armada-3720-turris-mox: fix SFP binding
From: Gregory CLEMENT @ 2020-05-17 16:58 UTC (permalink / raw)
To: Marek Behún; +Cc: SoC Team, arm-soc, Linux ARM, Marek Behún
In-Reply-To: <20200506192916.29853-1-marek.behun@nic.cz>
Marek Behún <marek.behun@nic.cz> writes:
> The sfp compatible should be 'sff,sfp', not 'sff,sfp+'. We used patched
> kernel where the latter was working.
>
> Fixes: 7109d817db2e ("arm64: dts: marvell: add DTS for Turris Mox")
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Applied on mvebu/dt64
Thanks,
Gregory
> ---
> arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
> index bb42d1e6a4e9..6a2ec6625880 100644
> --- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
> +++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
> @@ -95,7 +95,7 @@ sdhci1_pwrseq: sdhci1-pwrseq {
> };
>
> sfp: sfp {
> - compatible = "sff,sfp+";
> + compatible = "sff,sfp";
> i2c-bus = <&i2c0>;
> los-gpio = <&moxtet_sfp 0 GPIO_ACTIVE_HIGH>;
> tx-fault-gpio = <&moxtet_sfp 1 GPIO_ACTIVE_HIGH>;
> --
> 2.24.1
>
--
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
From: Amit Tomer @ 2020-05-17 17:12 UTC (permalink / raw)
To: André Przywara
Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel
In-Reply-To: <2cd3cdaf-826e-9d12-9fd4-9f7e2a517ecd@arm.com>
> I don't understand what this has to do with the driver, but I asked
> above to also change the binding, allowing this compatible string
> combination.
if we add these two strings "actions,s700-mmc", "actions,owl-mmc" to dts file
and leave the driver as it. Wouldn't this be mismatch(as driver only
has "actions,owl-mmc"
and DTS has two strings).
Shouldn't that be concerned about ?
Thanks
-Amit
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH V3 10/15] arch/kmap: Define kmap_atomic_prot() for all arch's
From: Guenter Roeck @ 2020-05-17 17:37 UTC (permalink / raw)
To: ira.weiny
Cc: Peter Zijlstra, Benjamin Herrenschmidt, Dave Hansen, dri-devel,
linux-mips, James E.J. Bottomley, Max Filippov, Paul Mackerras,
H. Peter Anvin, sparclinux, Dan Williams, Helge Deller, x86,
linux-csky, Christoph Hellwig, Ingo Molnar, linux-snps-arc,
linux-xtensa, Borislav Petkov, Al Viro, Andy Lutomirski,
Thomas Gleixner, linux-arm-kernel, Chris Zankel,
Thomas Bogendoerfer, linux-parisc, linux-kernel, Christian Koenig,
Andrew Morton, linuxppc-dev, David S. Miller
In-Reply-To: <20200507150004.1423069-11-ira.weiny@intel.com>
Hi,
On Thu, May 07, 2020 at 07:59:58AM -0700, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
>
> To support kmap_atomic_prot(), all architectures need to support
> protections passed to their kmap_atomic_high() function. Pass
> protections into kmap_atomic_high() and change the name to
> kmap_atomic_high_prot() to match.
>
> Then define kmap_atomic_prot() as a core function which calls
> kmap_atomic_high_prot() when needed.
>
> Finally, redefine kmap_atomic() as a wrapper of kmap_atomic_prot() with
> the default kmap_prot exported by the architectures.
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
This patch causes a variety of crashes whem booting powerpc images in qemu.
There are lots of warnings such as:
WARNING: CPU: 0 PID: 0 at lib/locking-selftest.c:743 irqsafe1_hard_spin_12+0x50/0xb0
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.7.0-rc5-next-20200515 #1
NIP: c0660c7c LR: c0660c44 CTR: c0660c2c
REGS: c1223e68 TRAP: 0700 Tainted: G W (5.7.0-rc5-next-20200515)
MSR: 00021000 <CE,ME> CR: 28000224 XER: 20000000
GPR00: c0669c78 c1223f20 c113d560 c0660c44 00000000 00000001 c1223ea8 00000001
GPR08: 00000000 00000001 0000fffc ffffffff 88000222 00000000 00000000 00000000
GPR16: 00000000 00000000 00000000 00000000 c0000000 00000000 00000000 c1125084
GPR24: c1125084 c1230000 c1879538 fffffffc 00000001 00000000 c1011afc c1230000
NIP [c0660c7c] irqsafe1_hard_spin_12+0x50/0xb0
LR [c0660c44] irqsafe1_hard_spin_12+0x18/0xb0
Call Trace:
[c1223f20] [c1880000] megasas_mgmt_info+0xee4/0x1008 (unreliable)
[c1223f40] [c0669c78] dotest+0x38/0x550
[c1223f70] [c066aa4c] locking_selftest+0x8bc/0x1d54
[c1223fa0] [c10e0bc8] start_kernel+0x3ec/0x510
[c1223ff0] [c00003a0] set_ivor+0x118/0x154
Instruction dump:
81420000 38e80001 3d4a0001 2c080000 91420000 90e20488 40820008 91020470
81290000 5529031e 7d290034 5529d97e <0f090000> 3fe0c11c 3bff3964 3bff00ac
irq event stamp: 588
hardirqs last enabled at (587): [<c00b9fe4>] vprintk_emit+0x1b4/0x33c
hardirqs last disabled at (588): [<c0660c44>] irqsafe1_hard_spin_12+0x18/0xb0
softirqs last enabled at (0): [<00000000>] 0x0
softirqs last disabled at (0): [<00000000>] 0x0
---[ end trace b18fe9e172f99d03 ]---
This is followed by:
BUG: sleeping function called from invalid context at lib/mpi/mpi-pow.c:245
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 14, name: cryptomgr_test
INFO: lockdep is turned off.
CPU: 0 PID: 14 Comm: cryptomgr_test Tainted: G W 5.7.0-rc5-next-20200515 #1
Call Trace:
[ce221b58] [c008755c] ___might_sleep+0x280/0x2a8 (unreliable)
[ce221b78] [c06bc524] mpi_powm+0x634/0xc50
[ce221c38] [c05eafdc] rsa_dec+0x88/0x134
[ce221c78] [c05f3b40] test_akcipher_one+0x678/0x804
[ce221dc8] [c05f3d7c] alg_test_akcipher+0xb0/0x130
[ce221df8] [c05ee674] alg_test.part.0+0xb4/0x458
[ce221ed8] [c05ed2b0] cryptomgr_test+0x30/0x50
[ce221ef8] [c007cd74] kthread+0x134/0x170
[ce221f38] [c001433c] ret_from_kernel_thread+0x14/0x1c
Kernel panic - not syncing: Aiee, killing interrupt handler!
CPU: 0 PID: 14 Comm: cryptomgr_test Tainted: G W 5.7.0-rc5-next-20200515 #1
Call Trace:
[ce221e08] [c00530fc] panic+0x148/0x34c (unreliable)
[ce221e68] [c0056460] do_exit+0xac0/0xb40
[ce221eb8] [c00f5be8] find_kallsyms_symbol_value+0x0/0x128
[ce221ed8] [c05ed2d0] crypto_alg_put+0x0/0x70
[ce221ef8] [c007cd74] kthread+0x134/0x170
[ce221f38] [c001433c] ret_from_kernel_thread+0x14/0x1c
Bisect log is attached. The patch can not easily be reverted since
it results in compile errors.
Note that similar failures are seen with sparc32 images. Those bisect
to a different patch, but reverting that patch doesn't fix the problem.
The failure pattern (warnings followed by a crash in cryptomgr_test)
is the same.
Guenter
---
# bad: [bdecf38f228bcca73b31ada98b5b7ba1215eb9c9] Add linux-next specific files for 20200515
# good: [2ef96a5bb12be62ef75b5828c0aab838ebb29cb8] Linux 5.7-rc5
git bisect start 'HEAD' 'v5.7-rc5'
# good: [3674d7aa7a8e61d993886c2fb7c896c5ef85e988] Merge remote-tracking branch 'crypto/master'
git bisect good 3674d7aa7a8e61d993886c2fb7c896c5ef85e988
# good: [87f6f21783522e6d62127cf33ae5e95f50874beb] Merge remote-tracking branch 'spi/for-next'
git bisect good 87f6f21783522e6d62127cf33ae5e95f50874beb
# good: [5c428e8277d5d97c85126387d4e00aa5adde4400] Merge remote-tracking branch 'staging/staging-next'
git bisect good 5c428e8277d5d97c85126387d4e00aa5adde4400
# good: [f68de67ed934e7bdef4799fd7777c86f33f14982] Merge remote-tracking branch 'hyperv/hyperv-next'
git bisect good f68de67ed934e7bdef4799fd7777c86f33f14982
# bad: [54acd2dc52b069da59639eea0d0c92726f32fb01] mm/memblock: fix a typo in comment "implict"->"implicit"
git bisect bad 54acd2dc52b069da59639eea0d0c92726f32fb01
# good: [784a17aa58a529b84f7cc50f351ed4acf3bd11f3] mm: remove the pgprot argument to __vmalloc
git bisect good 784a17aa58a529b84f7cc50f351ed4acf3bd11f3
# good: [6cd8137ff37e9a37aee2d2a8889c8beb8eab192f] khugepaged: replace the usage of system(3) in the test
git bisect good 6cd8137ff37e9a37aee2d2a8889c8beb8eab192f
# bad: [6987da379826ed01b8a1cf046b67cc8cc10117cc] sparc: remove unnecessary includes
git bisect bad 6987da379826ed01b8a1cf046b67cc8cc10117cc
# good: [bc17b545388f64c09e83e367898e28f60277c584] mm/hugetlb: define a generic fallback for is_hugepage_only_range()
git bisect good bc17b545388f64c09e83e367898e28f60277c584
# good: [9b5aa5b43f957f03a1f4a9aff5f7924e2ebbc011] arch-kmap_atomic-consolidate-duplicate-code-checkpatch-fixes
git bisect good 9b5aa5b43f957f03a1f4a9aff5f7924e2ebbc011
# bad: [89194ba5ee31567eeee9c81101b334c8e3248198] arch/kmap: define kmap_atomic_prot() for all arch's
git bisect bad 89194ba5ee31567eeee9c81101b334c8e3248198
# good: [022785d2bea99f8bc2a37b7b6c525eea26f6ac59] arch-kunmap_atomic-consolidate-duplicate-code-checkpatch-fixes
git bisect good 022785d2bea99f8bc2a37b7b6c525eea26f6ac59
# good: [a13c2f39e3f0519ddee57d26cc66ec70e3546106] arch/kmap: don't hard code kmap_prot values
git bisect good a13c2f39e3f0519ddee57d26cc66ec70e3546106
# first bad commit: [89194ba5ee31567eeee9c81101b334c8e3248198] arch/kmap: define kmap_atomic_prot() for all arch's
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
From: André Przywara @ 2020-05-17 21:30 UTC (permalink / raw)
To: Amit Tomer
Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel
In-Reply-To: <CABHD4K-OaQ4Vf_+dg9FMR97ocLeUkDswyEnChPV=H=VcbyUhkg@mail.gmail.com>
On 17/05/2020 18:12, Amit Tomer wrote:
>> I don't understand what this has to do with the driver, but I asked
>> above to also change the binding, allowing this compatible string
>> combination.
> if we add these two strings "actions,s700-mmc", "actions,owl-mmc" to dts file
> and leave the driver as it. Wouldn't this be mismatch(as driver only
> has "actions,owl-mmc"
> and DTS has two strings).
>
> Shouldn't that be concerned about ?
I recommend reading the DT spec, chapter 2.3.1 "compatible":
https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf
Cheers,
Andre
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH] ARM: kprobes: Avoid fortify_panic() when copying optprobe template
From: Kees Cook @ 2020-05-17 21:48 UTC (permalink / raw)
To: Andrew Jeffery
Cc: linux-kernel, linux, mathieu.desnoyers, mhiramat, labbott,
linux-arm-kernel
In-Reply-To: <20200517153959.293224-1-andrew@aj.id.au>
On Mon, May 18, 2020 at 01:09:59AM +0930, Andrew Jeffery wrote:
> As mentioned, a couple of attempts have been made to address the issue
> by casting a pointer to optprobe_template_entry before providing it to
> memcpy(), however gccs such as Ubuntu 20.04's arm-linux-gnueabi-gcc
> 9.3.0 (Ubuntu 9.3.0-10ubuntu1) see through these efforts.
Ah, dang. :P
How about converting them all to unsized arrays, which would also allow
the code to drop the "&" everywhere, I think. This is untested:
diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h
index 213607a1f45c..e26a278d301a 100644
--- a/arch/arm/include/asm/kprobes.h
+++ b/arch/arm/include/asm/kprobes.h
@@ -44,20 +44,20 @@ int kprobe_exceptions_notify(struct notifier_block *self,
unsigned long val, void *data);
/* optinsn template addresses */
-extern __visible kprobe_opcode_t optprobe_template_entry;
-extern __visible kprobe_opcode_t optprobe_template_val;
-extern __visible kprobe_opcode_t optprobe_template_call;
-extern __visible kprobe_opcode_t optprobe_template_end;
-extern __visible kprobe_opcode_t optprobe_template_sub_sp;
-extern __visible kprobe_opcode_t optprobe_template_add_sp;
-extern __visible kprobe_opcode_t optprobe_template_restore_begin;
-extern __visible kprobe_opcode_t optprobe_template_restore_orig_insn;
-extern __visible kprobe_opcode_t optprobe_template_restore_end;
+extern __visible kprobe_opcode_t optprobe_template_entry[];
+extern __visible kprobe_opcode_t optprobe_template_val[];
+extern __visible kprobe_opcode_t optprobe_template_call[];
+extern __visible kprobe_opcode_t optprobe_template_end[];
+extern __visible kprobe_opcode_t optprobe_template_sub_sp[];
+extern __visible kprobe_opcode_t optprobe_template_add_sp[];
+extern __visible kprobe_opcode_t optprobe_template_restore_begin[];
+extern __visible kprobe_opcode_t optprobe_template_restore_orig_insn[];
+extern __visible kprobe_opcode_t optprobe_template_restore_end[];
#define MAX_OPTIMIZED_LENGTH 4
#define MAX_OPTINSN_SIZE \
- ((unsigned long)&optprobe_template_end - \
- (unsigned long)&optprobe_template_entry)
+ ((unsigned long)optprobe_template_end - \
+ (unsigned long)optprobe_template_entry)
#define RELATIVEJUMP_SIZE 4
struct arch_optimized_insn {
diff --git a/arch/arm/probes/kprobes/opt-arm.c b/arch/arm/probes/kprobes/opt-arm.c
index 7a449df0b359..c78180172120 100644
--- a/arch/arm/probes/kprobes/opt-arm.c
+++ b/arch/arm/probes/kprobes/opt-arm.c
@@ -85,21 +85,21 @@ asm (
"optprobe_template_end:\n");
#define TMPL_VAL_IDX \
- ((unsigned long *)&optprobe_template_val - (unsigned long *)&optprobe_template_entry)
+ ((unsigned long *)optprobe_template_val - (unsigned long *)optprobe_template_entry)
#define TMPL_CALL_IDX \
- ((unsigned long *)&optprobe_template_call - (unsigned long *)&optprobe_template_entry)
+ ((unsigned long *)optprobe_template_call - (unsigned long *)optprobe_template_entry)
#define TMPL_END_IDX \
- ((unsigned long *)&optprobe_template_end - (unsigned long *)&optprobe_template_entry)
+ ((unsigned long *)optprobe_template_end - (unsigned long *)optprobe_template_entry)
#define TMPL_ADD_SP \
- ((unsigned long *)&optprobe_template_add_sp - (unsigned long *)&optprobe_template_entry)
+ ((unsigned long *)optprobe_template_add_sp - (unsigned long *)optprobe_template_entry)
#define TMPL_SUB_SP \
- ((unsigned long *)&optprobe_template_sub_sp - (unsigned long *)&optprobe_template_entry)
+ ((unsigned long *)optprobe_template_sub_sp - (unsigned long *)optprobe_template_entry)
#define TMPL_RESTORE_BEGIN \
- ((unsigned long *)&optprobe_template_restore_begin - (unsigned long *)&optprobe_template_entry)
+ ((unsigned long *)optprobe_template_restore_begin - (unsigned long *)optprobe_template_entry)
#define TMPL_RESTORE_ORIGN_INSN \
- ((unsigned long *)&optprobe_template_restore_orig_insn - (unsigned long *)&optprobe_template_entry)
+ ((unsigned long *)optprobe_template_restore_orig_insn - (unsigned long *)optprobe_template_entry)
#define TMPL_RESTORE_END \
- ((unsigned long *)&optprobe_template_restore_end - (unsigned long *)&optprobe_template_entry)
+ ((unsigned long *)optprobe_template_restore_end - (unsigned long *)optprobe_template_entry)
/*
* ARM can always optimize an instruction when using ARM ISA, except
@@ -234,7 +234,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or
}
/* Copy arch-dep-instance from template. */
- memcpy(code, (unsigned long *)&optprobe_template_entry,
+ memcpy(code, (unsigned long *)optprobe_template_entry,
TMPL_END_IDX * sizeof(kprobe_opcode_t));
/* Adjust buffer according to instruction. */
--
Kees Cook
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
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