Re: [PATCH 1/4 v3] drm: Add support of ARC PGU display controller
On Fri, Mar 11, 2016 at 06:42:36PM +0300, Alexey Brodkin wrote: > ARC PGU could be found on some development boards from Synopsys. > This is a simple byte streamer that reads data from a framebuffer > and sends data to the single encoder. > > Signed-off-by: Alexey Brodkin > Cc: David Airlie > Cc: dri-de...@lists.freedesktop.org > Cc: linux-snps-arc@lists.infradead.org > Cc: Jose Abreu > --- > > Changes v2 -> v3: > * Improved failure path if arcpgu_connector wasn't allocated (thanks Jose). > * Fixed driver building as module (reported by 0-DAY kernel test > infrastruct.) > * Implemented uncached mapping of user-space FB pages. > > No changes v1 -> v2. > Bunch of comments below to update your driver to latest styles and best practices. Cheers, Daniel > drivers/gpu/drm/Kconfig| 2 + > drivers/gpu/drm/Makefile | 1 + > drivers/gpu/drm/arc/Kconfig| 10 ++ > drivers/gpu/drm/arc/Makefile | 2 + > drivers/gpu/drm/arc/arcpgu.h | 50 +++ > drivers/gpu/drm/arc/arcpgu_crtc.c | 274 > + > drivers/gpu/drm/arc/arcpgu_drv.c | 252 ++ > drivers/gpu/drm/arc/arcpgu_fbdev.c | 245 + > drivers/gpu/drm/arc/arcpgu_hdmi.c | 207 > drivers/gpu/drm/arc/arcpgu_regs.h | 36 + > 10 files changed, 1079 insertions(+) > create mode 100644 drivers/gpu/drm/arc/Kconfig > create mode 100644 drivers/gpu/drm/arc/Makefile > create mode 100644 drivers/gpu/drm/arc/arcpgu.h > create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c > create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c > create mode 100644 drivers/gpu/drm/arc/arcpgu_fbdev.c > create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c > create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h > > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > index f2a74d0..9e4f2f1 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -281,3 +281,5 @@ source "drivers/gpu/drm/imx/Kconfig" > source "drivers/gpu/drm/vc4/Kconfig" > > source "drivers/gpu/drm/etnaviv/Kconfig" > + > +source "drivers/gpu/drm/arc/Kconfig" > diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile > index 6eb94fc..c338d04 100644 > --- a/drivers/gpu/drm/Makefile > +++ b/drivers/gpu/drm/Makefile > @@ -78,3 +78,4 @@ obj-y += panel/ > obj-y+= bridge/ > obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/ > obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/ > +obj-$(CONFIG_DRM_ARCPGU)+= arc/ > diff --git a/drivers/gpu/drm/arc/Kconfig b/drivers/gpu/drm/arc/Kconfig > new file mode 100644 > index 000..f9a13b6 > --- /dev/null > +++ b/drivers/gpu/drm/arc/Kconfig > @@ -0,0 +1,10 @@ > +config DRM_ARCPGU > + tristate "ARC PGU" > + depends on DRM && OF > + select DRM_KMS_CMA_HELPER > + select DRM_KMS_FB_HELPER > + select DRM_KMS_HELPER > + help > + Choose this option if you have an ARC PGU controller. > + > + If M is selected the module will be called arcpgu. > diff --git a/drivers/gpu/drm/arc/Makefile b/drivers/gpu/drm/arc/Makefile > new file mode 100644 > index 000..736ee6f > --- /dev/null > +++ b/drivers/gpu/drm/arc/Makefile > @@ -0,0 +1,2 @@ > +arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_fbdev.o arcpgu_drv.o > +obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o > diff --git a/drivers/gpu/drm/arc/arcpgu.h b/drivers/gpu/drm/arc/arcpgu.h > new file mode 100644 > index 000..86574b6 > --- /dev/null > +++ b/drivers/gpu/drm/arc/arcpgu.h > @@ -0,0 +1,50 @@ > +/* > + * ARC PGU DRM driver. > + * > + * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com) > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + */ > + > +#ifndef _ARCPGU_H_ > +#define _ARCPGU_H_ > + > +struct arcpgu_drm_private { > + void __iomem*regs; > + struct clk *clk; > + struct drm_fbdev_cma*fbdev; > + struct drm_framebuffer *fb; > + struct list_headevent_list; > + struct drm_crtc crtc; > + struct drm_plane*plane; > +}; > + > +#define crtc_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, > crtc) > + > +static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu, > + unsigned int reg, u32 value) > +{ > + iowrite32(value, arcpgu->regs + reg); > +} > + > +static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu, > +unsigned int reg) > +{ > + return ioread32(arcpgu->regs + reg); > +} > + >
Re: [PATCH] mm: slub: Ensure that slab_unlock() is atomic
On Wednesday 09 March 2016 05:10 PM, Peter Zijlstra wrote: > --- > Subject: bitops: Do not default to __clear_bit() for __clear_bit_unlock() > > __clear_bit_unlock() is a special little snowflake. While it carries the > non-atomic '__' prefix, it is specifically documented to pair with > test_and_set_bit() and therefore should be 'somewhat' atomic. > > Therefore the generic implementation of __clear_bit_unlock() cannot use > the fully non-atomic __clear_bit() as a default. > > If an arch is able to do better; is must provide an implementation of > __clear_bit_unlock() itself. > > Specifically, this came up as a result of hackbench livelock'ing in > slab_lock() on ARC with SMP + SLUB + !LLSC. > > The issue was incorrect pairing of atomic ops. > > slab_lock() -> bit_spin_lock() -> test_and_set_bit() > slab_unlock() -> __bit_spin_unlock() -> __clear_bit() > > The non serializing __clear_bit() was getting "lost" > > 80543b8e: ld_s r2,[r13,0] <--- (A) Finds PG_locked is set > 80543b90: or r3,r2,1<--- (B) other core unlocks right here > 80543b94: st_s r3,[r13,0] <--- (C) sets PG_locked (overwrites > unlock) > > Fixes ARC STAR 9000817404 (and probably more). > > Cc: sta...@vger.kernel.org > Reported-by: Vineet Gupta > Tested-by: Vineet Gupta > Signed-off-by: Peter Zijlstra (Intel) Peter, I don't see this in linux-next yet. I'm hoping you will send it Linus' way for 4.6-rc1. Thx, -Vineet ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
kisskb: FAILED linux-next/axs101_defconfig/arcompact Mon Mar 14, 19:26
FAILED linux-next/axs101_defconfig/arcompact Mon Mar 14, 19:26 http://kisskb.ellerman.id.au/kisskb/buildresult/12633624/ Commit: Add linux-next specific files for 20160314 4342eec3c5a2402ca5de3d6e56f541fe1c5171e2 Compiler: arc-buildroot-linux-uclibc-gcc (Buildroot 2015.08.1) 4.8.4 Possible errors --- arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[3]: *** [net/ethernet/eth.o] Error 1 make[2]: *** [net/ethernet] Error 2 arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[3]: *** [drivers/of/device.o] Error 1 arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[2]: *** [lib/pci_iomap.o] Error 1 arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[2]: *** [lib/devres.o] Error 1 make[1]: *** [lib] Error 2 arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[3]: *** [net/core/dev.o] Error 1 arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[5]: *** [drivers/video/fbdev/core/fbmon.o] Error 1 arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[6]: *** [drivers/net/ethernet/stmicro/stmmac/stmmac_main.o] Error 1 make[5]: *** [drivers/net/ethernet/stmicro/stmmac] Error 2 make[4]: *** [drivers/net/ethernet/stmicro] Error 2 make[3]: *** [drivers/net/ethernet] Error 2 make[2]: *** [drivers/of] Error 2 make[4]: *** [drivers/video/fbdev/core] Error 2 make[3]: *** [drivers/video/fbdev] Error 2 arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[3]: *** [drivers/scsi/scsi_lib.o] Error 1 make[2]: *** [net/core] Error 2 make[1]: *** [net] Error 2 arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[4]: *** [drivers/usb/host/ehci-hcd.o] Error 1 make[3]: *** [drivers/usb/host] Error 2 arch/arc/include/asm/pci.h:13:40: fatal error: asm-generic/pci-dma-compat.h: No such file or directory make[4]: *** [drivers/usb/core/message.o] Error 1 make[2]: *** [drivers/net] Error 2 make[2]: *** [drivers/scsi] Error 2 make[2]: *** [drivers/video] Error 2 make[3]: *** [drivers/usb/core] Error 2 make[2]: *** [drivers/usb] Error 2 make[1]: *** [drivers] Error 2 make: *** [sub-make] Error 2 Possible warnings (91) -- drivers/pci/pcie/Kconfig:61:warning: choice value used outside its choice group drivers/pci/pcie/Kconfig:67:warning: choice value used outside its choice group drivers/pci/pcie/Kconfig:74:warning: choice value used outside its choice group drivers/pci/pcie/Kconfig:61:warning: choice value used outside its choice group drivers/pci/pcie/Kconfig:67:warning: choice value used outside its choice group drivers/pci/pcie/Kconfig:74:warning: choice value used outside its choice group :1310:2: warning: #warning syscall preadv2 not implemented [-Wcpp] :1313:2: warning: #warning syscall pwritev2 not implemented [-Wcpp] Warning (unit_address_vs_reg): Node /timer@0 has a unit name, but no reg property Warning (unit_address_vs_reg): Node /timer@1 has a unit name, but no reg property Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but no unit name Warning (unit_address_vs_reg): Node /cpu_card has a reg or ranges property, but no unit name Warning (unit_address_vs_reg): Node /cpu_card/arc700-intc@cpu has a unit name, but no reg property Warning (unit_address_vs_reg): Node /axs10x_mb has a reg or ranges property, but no unit name arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default] arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default] arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default] arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default] arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default] kernel/sysctl.c:1958:12: warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized] kernel/sched/core.c:3080:1: warning: control reaches end of non-void function [-Wreturn-type] arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default] kernel/sysctl.c:1958:12: warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized] arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default] arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default] kernel/time/posix-cpu-timers.c:787:21: war
Re: [PATCH 1/4 v3] drm: Add support of ARC PGU display controller
Hi Daniel, On Mon, 2016-03-14 at 08:00 +0100, Daniel Vetter wrote: > On Fri, Mar 11, 2016 at 06:42:36PM +0300, Alexey Brodkin wrote: > > > > ARC PGU could be found on some development boards from Synopsys. > > This is a simple byte streamer that reads data from a framebuffer > > and sends data to the single encoder. > > > > Signed-off-by: Alexey Brodkin > > Cc: David Airlie > > Cc: dri-de...@lists.freedesktop.org > > Cc: linux-snps-arc@lists.infradead.org > > Cc: Jose Abreu > > --- > > > > Changes v2 -> v3: > > * Improved failure path if arcpgu_connector wasn't allocated (thanks Jose). > > * Fixed driver building as module (reported by 0-DAY kernel test > > infrastruct.) > > * Implemented uncached mapping of user-space FB pages. > > > > No changes v1 -> v2. > > > Bunch of comments below to update your driver to latest styles and best > practices. > > Cheers, Daniel Thanks for doing that review! > > + > > +static void arc_pgu_crtc_atomic_flush(struct drm_crtc *crtc, > > + struct drm_crtc_state *state) > > +{ > > +} > > + > > +static bool arc_pgu_crtc_mode_fixup(struct drm_crtc *crtc, > > + const struct drm_display_mode *mode, > > + struct drm_display_mode *adjusted_mode) > > +{ > > + return true; > > +} > You can drop the above 2 dummy functions. Ok will do. > > > > + > > +static const struct drm_crtc_helper_funcs arc_pgu_crtc_helper_funcs = { > > + .mode_fixup = arc_pgu_crtc_mode_fixup, > > + .mode_set = drm_helper_crtc_mode_set, > > + .mode_set_base = drm_helper_crtc_mode_set_base, > > + .mode_set_nofb = arc_pgu_crtc_mode_set_nofb, > > + .enable = arc_pgu_crtc_enable, > > + .disable= arc_pgu_crtc_disable, > > + .prepare= arc_pgu_crtc_disable, > > + .commit = arc_pgu_crtc_enable, > > + .atomic_check = arc_pgu_crtc_atomic_check, > > + .atomic_begin = arc_pgu_crtc_atomic_begin, > > + .atomic_flush = arc_pgu_crtc_atomic_flush, > > +}; > > + > > +static int arc_pgu_plane_atomic_check(struct drm_plane *plane, > > + struct drm_plane_state *state) > > +{ > > + return 0; > > +} > You don't need dummy functions for this. Ditto. > > + > > +void arc_pgu_crtc_suspend(struct drm_crtc *crtc) > > +{ > > + arc_pgu_crtc_disable(crtc); > > +} > > + > > +void arc_pgu_crtc_resume(struct drm_crtc *crtc) > > +{ > > + arc_pgu_crtc_enable(crtc); > > +} > Please use the atomic suspend/resume helper that Thierry recently merged. > See the kerneldoc of drm_atomic_helper_suspend as a starting point for how > it works and how it's supposed to be used. Well looks like this is a reminder if dummy copy-paste. We don't support PM in that driver yet, so I'll remove both functions for now. > > +static int arcpgu_atomic_commit(struct drm_device *dev, > > + struct drm_atomic_state *state, bool async) > > +{ > > + return drm_atomic_helper_commit(dev, state, false); > Note that this isn't really async if you ever get around to implement > fence support or vblank support. Just fyi. Ok but for now should I leave it as it is? > > +static struct drm_driver arcpgu_drm_driver = { > > + .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | > > + DRIVER_ATOMIC, > > + .preclose = arcpgu_preclose, > > + .lastclose = arcpgu_lastclose, > > + .name = "drm-arcpgu", > > + .desc = "ARC PGU Controller", > > + .date = "20160219", > > + .major = 1, > > + .minor = 0, > > + .patchlevel = 0, > > + .fops = &arcpgu_drm_ops, > > + .load = arcpgu_load, > > + .unload = arcpgu_unload, > Load and unload hooks are deprecated (it's a classic midlayer mistake). > Please use drm_dev_alloc/register pairs directly instead, and put your > device setup code in-between. Similar for unloading. There's a bunch of > example drivers converted already. Ok I took "atmel-hlcdc" as example. And that's interesting. If I put my arcpgu_load() in between drm_dev_alloc() and drm_dev_register() then I'm getting this on the driver probe: -->8--- [drm] Initialized drm 1.1.0 20060810 arcpgu e0017000.pgu: arc_pgu ID: 0xabbabaab [ cut here ] WARNING: CPU: 0 PID: 1 at lib/kobject.c:244 kobject_add_internal+0x17c/0x498() kobject_add_internal failed for card0-HDMI-A-1 (error: -2 parent: card0) Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.5.0-rc3-01062-ga447822-dirty #17 Stack Trace: arc_unwind_core.constprop.1+0xa4/0x110 warn_slowpath_fmt+0x6e/0xfc kobject_add_internal+0x17c/0x498 kobject_add+0x98/0xe4 device_add+0xc6/0x734 device_create_with_groups+0x12a/0x144 drm_sysfs_connector_add+0x54/0xe8 arcpgu_drm_hdmi_init+0xd4/0x17c arcpgu_probe+0x138/0x24c platform_drv_probe+0x2e/0x6c really_probe+0x212/0x35c __driver_attach+0x90/0x94 bus_for_each_dev+0x46/0x80 bus_add_d
[PATCH] arc: use ezchip network driver
Since ezchip network driver was adapted to little endian architecture this patch provides the corresponding arch/arc/{boot/dts,configs}/ updates so we can switch over to this device-model/driver for OSCI platform. Signed-off-by: Lada Trimasova Cc: Alexey Brodkin Cc: Vineet Gupta : --- arch/arc/boot/dts/nsimosci.dts | 5 ++--- arch/arc/boot/dts/nsimosci_hs.dts | 5 ++--- arch/arc/boot/dts/nsimosci_hs_idu.dts | 5 ++--- arch/arc/configs/nsimosci_defconfig| 1 + arch/arc/configs/nsimosci_hs_defconfig | 1 + arch/arc/configs/nsimosci_hs_smp_defconfig | 1 + 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arc/boot/dts/nsimosci.dts b/arch/arc/boot/dts/nsimosci.dts index 1c169dc..d94b4ce 100644 --- a/arch/arc/boot/dts/nsimosci.dts +++ b/arch/arc/boot/dts/nsimosci.dts @@ -65,10 +65,9 @@ }; eth0: ethernet@f0003000 { - compatible = "snps,oscilan"; + compatible = "ezchip,nps-mgt-enet"; reg = <0xf0003000 0x44>; - interrupts = <7>, <8>; - interrupt-names = "rx", "tx"; + interrupts = <7>; }; }; }; diff --git a/arch/arc/boot/dts/nsimosci_hs.dts b/arch/arc/boot/dts/nsimosci_hs.dts index d64a96f..034a313 100644 --- a/arch/arc/boot/dts/nsimosci_hs.dts +++ b/arch/arc/boot/dts/nsimosci_hs.dts @@ -65,10 +65,9 @@ }; eth0: ethernet@f0003000 { - compatible = "snps,oscilan"; + compatible = "ezchip,nps-mgt-enet"; reg = <0xf0003000 0x44>; - interrupts = <25>, <26>; - interrupt-names = "rx", "tx"; + interrupts = <25>; }; arcpct0: pct { diff --git a/arch/arc/boot/dts/nsimosci_hs_idu.dts b/arch/arc/boot/dts/nsimosci_hs_idu.dts index f6bf0ca..8a1297e 100644 --- a/arch/arc/boot/dts/nsimosci_hs_idu.dts +++ b/arch/arc/boot/dts/nsimosci_hs_idu.dts @@ -85,11 +85,10 @@ }; eth0: ethernet@f0003000 { - compatible = "snps,oscilan"; + compatible = "ezchip,nps-mgt-enet"; reg = <0xf0003000 0x44>; interrupt-parent = <&idu_intc>; - interrupts = <1 2>, <2 2>; - interrupt-names = "rx", "tx"; + interrupts = <1 2>; }; arcpct0: pct { diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig index 646182e..97dfc30 100644 --- a/arch/arc/configs/nsimosci_defconfig +++ b/arch/arc/configs/nsimosci_defconfig @@ -27,6 +27,7 @@ CONFIG_ARC_PLAT_SIM=y CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci" # CONFIG_COMPACTION is not set CONFIG_NET=y +CONFIG_EZCHIP_NPS_MANAGEMENT_ENET=y CONFIG_PACKET=y CONFIG_UNIX=y CONFIG_UNIX_DIAG=y diff --git a/arch/arc/configs/nsimosci_hs_defconfig b/arch/arc/configs/nsimosci_hs_defconfig index ceca254..55e2892 100644 --- a/arch/arc/configs/nsimosci_hs_defconfig +++ b/arch/arc/configs/nsimosci_hs_defconfig @@ -28,6 +28,7 @@ CONFIG_ISA_ARCV2=y CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci_hs" # CONFIG_COMPACTION is not set CONFIG_NET=y +CONFIG_EZCHIP_NPS_MANAGEMENT_ENET=y CONFIG_PACKET=y CONFIG_UNIX=y CONFIG_UNIX_DIAG=y diff --git a/arch/arc/configs/nsimosci_hs_smp_defconfig b/arch/arc/configs/nsimosci_hs_smp_defconfig index 4b6da90..74a3e48 100644 --- a/arch/arc/configs/nsimosci_hs_smp_defconfig +++ b/arch/arc/configs/nsimosci_hs_smp_defconfig @@ -25,6 +25,7 @@ CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci_hs_idu" CONFIG_PREEMPT=y # CONFIG_COMPACTION is not set CONFIG_NET=y +CONFIG_EZCHIP_NPS_MANAGEMENT_ENET=y CONFIG_PACKET=y CONFIG_PACKET_DIAG=y CONFIG_UNIX=y -- 2.5.0 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc