* [PATCH v2 1/3] coresight: tmc: Make memory width mask computation into a function
From: Mathieu Poirier @ 2019-08-26 19:46 UTC (permalink / raw)
To: suzuki.poulose, leo.yan, mike.leach
Cc: alexander.shishkin, yabinc, linux-kernel, linux-arm-kernel
In-Reply-To: <20190826194605.3791-1-mathieu.poirier@linaro.org>
Make the computation of a memory mask representing the width of the memory
bus into a function so that it can be re-used by the ETR driver.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
.../hwtracing/coresight/coresight-tmc-etf.c | 23 ++-------------
drivers/hwtracing/coresight/coresight-tmc.c | 28 +++++++++++++++++++
drivers/hwtracing/coresight/coresight-tmc.h | 1 +
3 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c
index 23b7ff00af5c..807416b75ecc 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etf.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c
@@ -479,30 +479,11 @@ static unsigned long tmc_update_etf_buffer(struct coresight_device *csdev,
* traces.
*/
if (!buf->snapshot && to_read > handle->size) {
- u32 mask = 0;
-
- /*
- * The value written to RRP must be byte-address aligned to
- * the width of the trace memory databus _and_ to a frame
- * boundary (16 byte), whichever is the biggest. For example,
- * for 32-bit, 64-bit and 128-bit wide trace memory, the four
- * LSBs must be 0s. For 256-bit wide trace memory, the five
- * LSBs must be 0s.
- */
- switch (drvdata->memwidth) {
- case TMC_MEM_INTF_WIDTH_32BITS:
- case TMC_MEM_INTF_WIDTH_64BITS:
- case TMC_MEM_INTF_WIDTH_128BITS:
- mask = GENMASK(31, 4);
- break;
- case TMC_MEM_INTF_WIDTH_256BITS:
- mask = GENMASK(31, 5);
- break;
- }
+ u32 mask = tmc_get_memwidth_mask(drvdata);
/*
* Make sure the new size is aligned in accordance with the
- * requirement explained above.
+ * requirement explained in function tmc_get_memwidth_mask().
*/
to_read = handle->size & mask;
/* Move the RAM read pointer up */
diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c
index 3055bf8e2236..1cf82fa58289 100644
--- a/drivers/hwtracing/coresight/coresight-tmc.c
+++ b/drivers/hwtracing/coresight/coresight-tmc.c
@@ -70,6 +70,34 @@ void tmc_disable_hw(struct tmc_drvdata *drvdata)
writel_relaxed(0x0, drvdata->base + TMC_CTL);
}
+u32 tmc_get_memwidth_mask(struct tmc_drvdata *drvdata)
+{
+ u32 mask = 0;
+
+ /*
+ * When moving RRP or an offset address forward, the new values must
+ * be byte-address aligned to the width of the trace memory databus
+ * _and_ to a frame boundary (16 byte), whichever is the biggest. For
+ * example, for 32-bit, 64-bit and 128-bit wide trace memory, the four
+ * LSBs must be 0s. For 256-bit wide trace memory, the five LSBs must
+ * be 0s.
+ */
+ switch (drvdata->memwidth) {
+ case TMC_MEM_INTF_WIDTH_32BITS:
+ /* fallthrough */
+ case TMC_MEM_INTF_WIDTH_64BITS:
+ /* fallthrough */
+ case TMC_MEM_INTF_WIDTH_128BITS:
+ mask = GENMASK(31, 4);
+ break;
+ case TMC_MEM_INTF_WIDTH_256BITS:
+ mask = GENMASK(31, 5);
+ break;
+ }
+
+ return mask;
+}
+
static int tmc_read_prepare(struct tmc_drvdata *drvdata)
{
int ret = 0;
diff --git a/drivers/hwtracing/coresight/coresight-tmc.h b/drivers/hwtracing/coresight/coresight-tmc.h
index 9dbcdf453e22..71de978575f3 100644
--- a/drivers/hwtracing/coresight/coresight-tmc.h
+++ b/drivers/hwtracing/coresight/coresight-tmc.h
@@ -255,6 +255,7 @@ void tmc_wait_for_tmcready(struct tmc_drvdata *drvdata);
void tmc_flush_and_stop(struct tmc_drvdata *drvdata);
void tmc_enable_hw(struct tmc_drvdata *drvdata);
void tmc_disable_hw(struct tmc_drvdata *drvdata);
+u32 tmc_get_memwidth_mask(struct tmc_drvdata *drvdata);
/* ETB/ETF functions */
int tmc_read_prepare_etb(struct tmc_drvdata *drvdata);
--
2.17.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
* [PATCH v2 0/3] coresight: Add barrier packet when moving offset forward
From: Mathieu Poirier @ 2019-08-26 19:46 UTC (permalink / raw)
To: suzuki.poulose, leo.yan, mike.leach
Cc: alexander.shishkin, yabinc, linux-kernel, linux-arm-kernel
This set builds on top of an original patch by Yabin Cui[1] that deals with
cases where the ETR buffer it bigger than the space available in the perf
ring buffer. The work herein complements Yabin's by inserting barrier
packets after the head of the memory buffer has been moved forward in order
for the trace decoder to still synchronise with the trace stream.
Applies cleanly to the coresight next branch.
Thanks,
Mathieu
[1]. https://lkml.org/lkml/2019/8/14/1336
New to V2:
- Added Yabin's Tested-by.
- Addressed Leo's comment about extending the solution to the sysfs
interface.
- Split the work in 3 patches rather than 2.
Mathieu Poirier (3):
coresight: tmc: Make memory width mask computation into a function
coresight: tmc-etr: Decouple buffer sync and barrier packet insertion
coresight: tmc-etr: Add barrier packets when moving offset forward
.../hwtracing/coresight/coresight-tmc-etf.c | 23 +--------
.../hwtracing/coresight/coresight-tmc-etr.c | 47 ++++++++++++++-----
drivers/hwtracing/coresight/coresight-tmc.c | 28 +++++++++++
drivers/hwtracing/coresight/coresight-tmc.h | 1 +
4 files changed, 67 insertions(+), 32 deletions(-)
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [RFC PATCH 0/7] Unify SMP stop generic logic to common code
From: Cristian Marussi @ 2019-08-26 19:33 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-arch, mark.rutland, peterz, catalin.marinas, linux-kernel,
takahiro.akashi, james.morse, hidehiro.kawai.ez, tglx, will,
dave.martin, linux-arm-kernel
In-Reply-To: <20190826153401.GB9591@infradead.org>
Hi Christoph
thanks for the review.
On 8/26/19 4:34 PM, Christoph Hellwig wrote:
> On Fri, Aug 23, 2019 at 12:57:13PM +0100, Cristian Marussi wrote:
>> An architecture willing to rely on this SMP common logic has to define its
>> own helpers and set CONFIG_ARCH_USE_COMMON_SMP_STOP=y.
>> The series wire this up for arm64.
>>
>> Behaviour is not changed for architectures not adopting this new common
>> logic.
>
> Seens like this common code only covers arm64. I think we should
> generally have at least two users for common code.
>
Yes absolutely, but this RFC was an attempt at first to explore if this
approach was deemed sensible upstream or not, so I wired up only arm64 for now.
Thanks
Cristian
_______________________________________________
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 00/15] Improvements and fixes for mxsfb DRM driver
From: Leonard Crestez @ 2019-08-26 19:19 UTC (permalink / raw)
To: Stefan Agner, Robert Chiras
Cc: Marek Vasut, Mark Rutland, Pengutronix Kernel Team,
devicetree@vger.kernel.org, David Airlie, Fabio Estevam,
Guido Günther, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, Rob Herring, dl-linux-imx,
Daniel Vetter, Shawn Guo, Sascha Hauer,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <3bd35686e046048d35cd4987567a13cf@agner.ch>
On 26.08.2019 17:35, Stefan Agner wrote:
> On 2019-08-26 14:05, Guido Günther wrote:
>> Hi,
>> On Wed, Aug 21, 2019 at 01:15:40PM +0300, Robert Chiras wrote:
>>> This patch-set improves the use of eLCDIF block on iMX 8 SoCs (like 8MQ, 8MM
>>> and 8QXP). Following, are the new features added and fixes from this
>>> patch-set:
>>
>> I've applied this whole series on top of my NWL work and it looks good
>> with a DSI panel. Applying the whole series also fixes an issue where
>> after unblank the output was sometimes shifted about half a screen width
>> to the right (which didn't happen with DCSS). So at least from the parts
>> I could test:
>>
>> Tested-by: Guido Günther <agx@sigxcpu.org>
>>
>> for the whole thing.
>
> Thanks for testing! What SoC did you use? I think it would be good to
> also give this a try on i.MX 7 or i.MX 6ULL before merging.
I did a quick test on imx6sx-sdb and it seems that [PATCH 07/15]
"drm/mxsfb: Fix the vblank events" causes a hang on boot, even without a
panel.
If I revert that particular patch it seems to be fine: the new pixel
formats seem to work in modetest (checked with sii,43wvf1g panel).
--
Regards,
Leonard
_______________________________________________
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 0/6] Allow kexec reboot for GICv3 and device tree
From: Marc Zyngier @ 2019-08-26 19:13 UTC (permalink / raw)
To: Pavel Tatashin
Cc: sashal, mark.rutland, vladimir.murzin, kexec, jmorris,
linux-kernel, james.morse, linux-arm-kernel
In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com>
On Mon, 26 Aug 2019 15:00:50 -0400
Pavel Tatashin <pasha.tatashin@soleen.com> wrote:
> Marc Zyngier added the support for kexec and GICv3 for EFI based systems.
> However, it is still not possible todo on systems with device trees.
>
> Here is EFI fixes from Marc:
> https://lore.kernel.org/lkml/20180921195954.21574-1-marc.zyngier@arm.com
>
> For Device Tree variant: lets allow reserve a memory region in interrupt
> controller node, and use this property to allocate interrupt tables.
There is no such thing as a "device tree variant". As long as your
bootloader implements EFI, everything will work correctly, whether
you're using DT, ACPI, or the anything else.
This already works today, without any need to add anything to the
kernel (I have systems using EDK II and u-boot, both implementing EFI,
and I'm able to kexec without any issue). If your bootloader doesn't
support EFI, here's a good opportunity to implement it!
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH v1 5/6] rqchip/gic-v3-its: move reset pending table outside of allocator
From: Pavel Tatashin @ 2019-08-26 19:00 UTC (permalink / raw)
To: pasha.tatashin, jmorris, sashal, kexec, linux-kernel,
linux-arm-kernel, marc.zyngier, james.morse, vladimir.murzin,
mark.rutland
In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com>
Allow to use reserved memory for interrupt controller tables.
Currently, it is not possible to do kexec reboots without possible memory
corruption using device tree and GICv3 interrupt controller.
GICv3 can be configured once during boot, and location of tables cannot
be changed thereafter.
The fix is to allow to reserve memory region in interrupt controller device
property, and use it to do allocations.
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
---
drivers/irqchip/irq-gic-v3-its.c | 82 ++++++++++++++++++++++++++++----
1 file changed, 72 insertions(+), 10 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index d5f3508ca11f..aeda8760cc4e 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -47,6 +47,54 @@
static u32 lpi_id_bits;
+/*
+ * Describes reserved memory region in interrupt controller.
+ * The memory reserved: [pa_start, pa_end)
+ */
+struct of_resv {
+ unsigned long pa_start;
+ unsigned long pa_end;
+};
+
+static struct page __init *get_of_page(struct of_resv *resv, unsigned long size)
+{
+ unsigned long pa = ALIGN(resv->pa_start, size);
+ unsigned long pa_next = pa + size;
+
+ /* Check if there is enough memory reserved to do another allocation */
+ if (pa_next > resv->pa_end)
+ return NULL;
+
+ resv->pa_start = pa_next;
+ memset(phys_to_virt(pa), 0, size);
+
+ return phys_to_page(pa);
+}
+
+/*
+ * Memory controller might have a reserved memory region to be used for table
+ * allocations. This is a requirement for kexec reboots.
+ */
+static void __init its_of_mem_region(struct device_node *node,
+ struct of_resv **resv,
+ struct of_resv *resv_buf)
+{
+ struct device_node *np = of_parse_phandle(node, "memory-region", 0);
+ struct resource mem_res;
+
+ if (!np)
+ return;
+
+ if (of_address_to_resource(np, 0, &mem_res)) {
+ pr_warn("%pOF: address to resource failed\n", np);
+ return;
+ }
+
+ resv_buf->pa_start = mem_res.start;
+ resv_buf->pa_end = mem_res.start + resource_size(&mem_res);
+ *resv = resv_buf;
+}
+
/*
* We allocate memory for PROPBASE to cover 2 ^ lpi_id_bits LPIs to
* deal with (one configuration byte per interrupt). PENDBASE has to
@@ -1665,7 +1713,7 @@ static int gic_reserve_range(phys_addr_t addr, unsigned long size)
return 0;
}
-static int __init its_setup_lpi_prop_table(void)
+static int __init its_setup_lpi_prop_table(struct of_resv *resv)
{
if (gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED) {
unsigned long pa;
@@ -1676,7 +1724,10 @@ static int __init its_setup_lpi_prop_table(void)
lpi_id_bits = (val & GICR_PROPBASER_IDBITS_MASK) + 1;
pa = val & GENMASK_ULL(51, 12);
- va = memremap(pa, LPI_PROPBASE_SZ, MEMREMAP_WB);
+ if (resv)
+ va = phys_to_virt(pa);
+ else
+ va = memremap(pa, LPI_PROPBASE_SZ, MEMREMAP_WB);
gic_rdists->prop_table_pa = pa;
gic_rdists->prop_table_va = va;
} else {
@@ -1685,7 +1736,10 @@ static int __init its_setup_lpi_prop_table(void)
lpi_id_bits = min_t(u32,
GICD_TYPER_ID_BITS(gic_rdists->gicd_typer),
ITS_MAX_LPI_NRBITS);
- page = its_allocate_prop_table(GFP_NOWAIT);
+ if (resv)
+ page = get_of_page(resv, LPI_PROPBASE_SZ);
+ else
+ page = its_allocate_prop_table(GFP_NOWAIT);
if (!page) {
pr_err("Failed to allocate PROPBASE\n");
return -ENOMEM;
@@ -2009,7 +2063,8 @@ static void its_free_pending_table(struct page *pt)
/*
* Booting with kdump and LPIs enabled is generally fine. Any other
- * case is wrong in the absence of firmware/EFI support.
+ * case is wrong in the absence of firmware/EFI support or reserve-memory
+ * in device tree for interrupt controller.
*/
static bool enabled_lpis_allowed(void)
{
@@ -2023,7 +2078,7 @@ static bool enabled_lpis_allowed(void)
return gic_check_reserved_range(addr, LPI_PROPBASE_SZ);
}
-static int __init allocate_lpi_tables(void)
+static int __init allocate_lpi_tables(struct of_resv *resv)
{
u64 val;
int err, cpu;
@@ -2039,7 +2094,7 @@ static int __init allocate_lpi_tables(void)
pr_info("GICv3: Using preallocated redistributor tables\n");
}
- err = its_setup_lpi_prop_table();
+ err = its_setup_lpi_prop_table(resv);
if (err)
return err;
@@ -2051,7 +2106,10 @@ static int __init allocate_lpi_tables(void)
for_each_possible_cpu(cpu) {
struct page *pend_page;
- pend_page = its_allocate_pending_table(GFP_NOWAIT);
+ if (resv)
+ pend_page = get_of_page(resv, LPI_PENDBASE_SZ);
+ else
+ pend_page = its_allocate_pending_table(GFP_NOWAIT);
if (!pend_page) {
pr_err("Failed to allocate PENDBASE for CPU%d\n", cpu);
return -ENOMEM;
@@ -3957,16 +4015,20 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists,
struct irq_domain *parent_domain)
{
struct device_node *of_node;
+ struct of_resv resv_buf;
+ struct of_resv *resv = NULL;
struct its_node *its;
bool has_v4 = false;
int err;
its_parent = parent_domain;
of_node = to_of_node(handle);
- if (of_node)
+ if (of_node) {
its_of_probe(of_node);
- else
+ its_of_mem_region(of_node, &resv, &resv_buf);
+ } else {
its_acpi_probe();
+ }
if (list_empty(&its_nodes)) {
pr_warn("ITS: No ITS available, not enabling LPIs\n");
@@ -3975,7 +4037,7 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists,
gic_rdists = rdists;
- err = allocate_lpi_tables();
+ err = allocate_lpi_tables(resv);
if (err)
return err;
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH v1 6/6] dt-bindings: interrupt-controller: add optional memory-region
From: Pavel Tatashin @ 2019-08-26 19:00 UTC (permalink / raw)
To: pasha.tatashin, jmorris, sashal, kexec, linux-kernel,
linux-arm-kernel, marc.zyngier, james.morse, vladimir.murzin,
mark.rutland
In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com>
Allow pre-reserve memory in device tree that can be used in interrupt
controller tabes. This memory is required when kexec functionality is needed
with GICv3 controler and device trees.
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
---
.../bindings/interrupt-controller/arm,gic-v3.yaml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml b/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml
index c34df35a25fc..7640aaa97302 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml
@@ -102,6 +102,13 @@ properties:
- $ref: /schemas/types.yaml#/definitions/uint32
- maximum: 4096 # Should be enough?
+ memory-region:
+ description:
+ Memory used to allocate property and pending tables.
+ Required if kexec functionality is needed.
+ allOf:
+ - $ref: /schemas/types.yaml#/definitions/uint64
+
msi-controller:
description:
Only present if the Message Based Interrupt functionnality is
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH v1 4/6] rqchip/gic-v3-its: move reset pending table outside of allocator
From: Pavel Tatashin @ 2019-08-26 19:00 UTC (permalink / raw)
To: pasha.tatashin, jmorris, sashal, kexec, linux-kernel,
linux-arm-kernel, marc.zyngier, james.morse, vladimir.murzin,
mark.rutland
In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com>
Again, in preparation of adding a new allocator, move the reset function
outside of the current allocator.
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
---
drivers/irqchip/irq-gic-v3-its.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 124e2cb890cd..d5f3508ca11f 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1999,15 +1999,7 @@ static void gic_reset_pending_table(void *va)
static struct page *its_allocate_pending_table(gfp_t gfp_flags)
{
- struct page *pend_page;
-
- pend_page = alloc_pages(gfp_flags, get_order(LPI_PENDBASE_SZ));
- if (!pend_page)
- return NULL;
-
- gic_reset_pending_table(page_address(pend_page));
-
- return pend_page;
+ return alloc_pages(gfp_flags, get_order(LPI_PENDBASE_SZ));
}
static void its_free_pending_table(struct page *pt)
@@ -2064,6 +2056,7 @@ static int __init allocate_lpi_tables(void)
pr_err("Failed to allocate PENDBASE for CPU%d\n", cpu);
return -ENOMEM;
}
+ gic_reset_pending_table(page_address(pend_page));
gic_data_rdist_cpu(cpu)->pend_page = pend_page;
}
@@ -3007,6 +3000,7 @@ static int its_vpe_init(struct its_vpe *vpe)
its_vpe_id_free(vpe_id);
return -ENOMEM;
}
+ gic_reset_pending_table(page_address(vpt_page));
if (!its_alloc_vpe_table(vpe_id)) {
its_vpe_id_free(vpe_id);
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH v1 3/6] rqchip/gic-v3-its: add reset pending table function
From: Pavel Tatashin @ 2019-08-26 19:00 UTC (permalink / raw)
To: pasha.tatashin, jmorris, sashal, kexec, linux-kernel,
linux-arm-kernel, marc.zyngier, james.morse, vladimir.murzin,
mark.rutland
In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com>
Add function that is similar to gic_reset_prop_table but for pending
table.
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
---
drivers/irqchip/irq-gic-v3-its.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 656b6c6e1bf8..124e2cb890cd 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1989,17 +1989,23 @@ static int its_alloc_collections(struct its_node *its)
return 0;
}
+static void gic_reset_pending_table(void *va)
+{
+ memset(va, 0, LPI_PENDBASE_SZ);
+
+ /* Make sure the GIC will observe the zero-ed page */
+ gic_flush_dcache_to_poc(va, LPI_PENDBASE_SZ);
+}
+
static struct page *its_allocate_pending_table(gfp_t gfp_flags)
{
struct page *pend_page;
- pend_page = alloc_pages(gfp_flags | __GFP_ZERO,
- get_order(LPI_PENDBASE_SZ));
+ pend_page = alloc_pages(gfp_flags, get_order(LPI_PENDBASE_SZ));
if (!pend_page)
return NULL;
- /* Make sure the GIC will observe the zero-ed page */
- gic_flush_dcache_to_poc(page_address(pend_page), LPI_PENDBASE_SZ);
+ gic_reset_pending_table(page_address(pend_page));
return pend_page;
}
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH v1 2/6] rqchip/gic-v3-its: use temporary va / pa variables
From: Pavel Tatashin @ 2019-08-26 19:00 UTC (permalink / raw)
To: pasha.tatashin, jmorris, sashal, kexec, linux-kernel,
linux-arm-kernel, marc.zyngier, james.morse, vladimir.murzin,
mark.rutland
In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com>
This is a cleanup, that will help later when a variant that does not
require memremap is added.
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
---
drivers/irqchip/irq-gic-v3-its.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index ada18748ed1c..656b6c6e1bf8 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1668,15 +1668,17 @@ static int gic_reserve_range(phys_addr_t addr, unsigned long size)
static int __init its_setup_lpi_prop_table(void)
{
if (gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED) {
+ unsigned long pa;
u64 val;
+ void *va;
val = gicr_read_propbaser(gic_data_rdist_rd_base() + GICR_PROPBASER);
lpi_id_bits = (val & GICR_PROPBASER_IDBITS_MASK) + 1;
- gic_rdists->prop_table_pa = val & GENMASK_ULL(51, 12);
- gic_rdists->prop_table_va = memremap(gic_rdists->prop_table_pa,
- LPI_PROPBASE_SZ,
- MEMREMAP_WB);
+ pa = val & GENMASK_ULL(51, 12);
+ va = memremap(pa, LPI_PROPBASE_SZ, MEMREMAP_WB);
+ gic_rdists->prop_table_pa = pa;
+ gic_rdists->prop_table_va = va;
} else {
struct page *page;
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH v1 1/6] rqchip/gic-v3-its: reset prop table outside of allocation
From: Pavel Tatashin @ 2019-08-26 19:00 UTC (permalink / raw)
To: pasha.tatashin, jmorris, sashal, kexec, linux-kernel,
linux-arm-kernel, marc.zyngier, james.morse, vladimir.murzin,
mark.rutland
In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com>
In preparation of adding another variant of allocation, move
the resetting outside of the current allocator.
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
---
drivers/irqchip/irq-gic-v3-its.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 1b5c3672aea2..ada18748ed1c 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1621,15 +1621,7 @@ static void gic_reset_prop_table(void *va)
static struct page *its_allocate_prop_table(gfp_t gfp_flags)
{
- struct page *prop_page;
-
- prop_page = alloc_pages(gfp_flags, get_order(LPI_PROPBASE_SZ));
- if (!prop_page)
- return NULL;
-
- gic_reset_prop_table(page_address(prop_page));
-
- return prop_page;
+ return alloc_pages(gfp_flags, get_order(LPI_PROPBASE_SZ));
}
static void its_free_prop_table(struct page *prop_page)
@@ -1685,7 +1677,6 @@ static int __init its_setup_lpi_prop_table(void)
gic_rdists->prop_table_va = memremap(gic_rdists->prop_table_pa,
LPI_PROPBASE_SZ,
MEMREMAP_WB);
- gic_reset_prop_table(gic_rdists->prop_table_va);
} else {
struct page *page;
@@ -1703,6 +1694,7 @@ static int __init its_setup_lpi_prop_table(void)
WARN_ON(gic_reserve_range(gic_rdists->prop_table_pa,
LPI_PROPBASE_SZ));
}
+ gic_reset_prop_table(gic_rdists->prop_table_va);
pr_info("GICv3: using LPI property table @%pa\n",
&gic_rdists->prop_table_pa);
@@ -3079,6 +3071,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
its_lpi_free(bitmap, base, nr_ids);
return -ENOMEM;
}
+ gic_reset_prop_table(page_address(vprop_page));
vm->db_bitmap = bitmap;
vm->db_lpi_base = base;
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH v1 0/6] Allow kexec reboot for GICv3 and device tree
From: Pavel Tatashin @ 2019-08-26 19:00 UTC (permalink / raw)
To: pasha.tatashin, jmorris, sashal, kexec, linux-kernel,
linux-arm-kernel, marc.zyngier, james.morse, vladimir.murzin,
mark.rutland
Marc Zyngier added the support for kexec and GICv3 for EFI based systems.
However, it is still not possible todo on systems with device trees.
Here is EFI fixes from Marc:
https://lore.kernel.org/lkml/20180921195954.21574-1-marc.zyngier@arm.com
For Device Tree variant: lets allow reserve a memory region in interrupt
controller node, and use this property to allocate interrupt tables.
This way we are safe during kexec, as these page tables are going to stay
the same after kexec.
Pavel Tatashin (6):
rqchip/gic-v3-its: reset prop table outside of allocation
rqchip/gic-v3-its: use temporary va / pa variables
rqchip/gic-v3-its: add reset pending table function
rqchip/gic-v3-its: move reset pending table outside of allocator
rqchip/gic-v3-its: move reset pending table outside of allocator
dt-bindings: interrupt-controller: add optional memory-region
.../interrupt-controller/arm,gic-v3.yaml | 7 +
drivers/irqchip/irq-gic-v3-its.c | 121 +++++++++++++-----
2 files changed, 96 insertions(+), 32 deletions(-)
--
2.23.0
_______________________________________________
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 8/8] media: cedrus: Add support for V4L2_DEC_CMD_FLUSH
From: Boris Brezillon @ 2019-08-26 18:55 UTC (permalink / raw)
To: Jernej Skrabec
Cc: devel, acourbot, pawel, jonas, gregkh, wens, mripard, tfiga,
paul.kocialkowski, kyungmin.park, linux-media, linux-arm-kernel,
hverkuil-cisco, mchehab, ezequiel, linux-kernel, m.szyprowski
In-Reply-To: <20190822194500.2071-9-jernej.skrabec@siol.net>
On Thu, 22 Aug 2019 21:45:00 +0200
Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> This command is useful for explicitly flushing last decoded frame.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> .../staging/media/sunxi/cedrus/cedrus_video.c | 34 +++++++++++++++++++
> 1 file changed, 34 insertions(+)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> index 5153b2bba21e..9eae69d5741c 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> @@ -331,6 +331,37 @@ static int cedrus_s_fmt_vid_out(struct file *file, void *priv,
> return 0;
> }
>
> +static int cedrus_try_decoder_cmd(struct file *file, void *fh,
> + struct v4l2_decoder_cmd *dc)
> +{
> + if (dc->cmd != V4L2_DEC_CMD_FLUSH)
> + return -EINVAL;
> +
> + return 0;
> +}
> +
> +static int cedrus_decoder_cmd(struct file *file, void *fh,
> + struct v4l2_decoder_cmd *dc)
> +{
> + struct cedrus_ctx *ctx = cedrus_file2ctx(file);
> + struct vb2_v4l2_buffer *out_vb, *cap_vb;
> + int ret;
> +
> + ret = cedrus_try_decoder_cmd(file, fh, dc);
> + if (ret < 0)
> + return ret;
Not directly related to this patch, but it seems most drivers
implementing ->vdioc_decoder_cmd() call ->vidioc_try_decoder_cmd()
internally to make sure the cmd is supported. Maybe something
we could automate at the v4l2-ioctl.c level.
_______________________________________________
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 0/2] coresight: Add barrier packet when moving offset forward
From: Yabin Cui @ 2019-08-26 18:52 UTC (permalink / raw)
To: Mathieu Poirier, Suzuki K Poulose, leo.yan
Cc: alexander.shishkin, Yabin Cui, linux-arm-kernel, mike.leach,
linux-kernel
In-Reply-To: <CANLsYkxC-4UZcVKoTQiJ2PsDxwuriFoAwqdbM39EC1G3nwwAHg@mail.gmail.com>
> Can I add your Tested-by ?
Yes. I just sent a tested-by reply, but not sure if it works. I am not very familar
with linux kernel review system.
_______________________________________________
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 5/8] media: cedrus: Detect first slice of a frame
From: Jernej Škrabec @ 2019-08-26 18:47 UTC (permalink / raw)
To: Boris Brezillon
Cc: devel, acourbot, pawel, jonas, gregkh, wens, mripard, tfiga,
paul.kocialkowski, kyungmin.park, linux-media, linux-arm-kernel,
hverkuil-cisco, mchehab, ezequiel, linux-kernel, m.szyprowski
In-Reply-To: <20190826202831.311c7c20@collabora.com>
Dne ponedeljek, 26. avgust 2019 ob 20:28:31 CEST je Boris Brezillon
napisal(a):
> Hi Jernej,
>
> On Thu, 22 Aug 2019 21:44:57 +0200
>
> Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> > When codec supports multiple slices in one frame, VPU has to know when
> > first slice of each frame is being processed, presumably to correctly
> > clear/set data in auxiliary buffers.
> >
> > Add first_slice field to cedrus_run structure and set it according to
> > timestamps of capture and output buffers. If timestamps are different,
> > it's first slice and viceversa.
> >
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> > ---
> >
> > drivers/staging/media/sunxi/cedrus/cedrus.h | 1 +
> > drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 2 ++
> > 2 files changed, 3 insertions(+)
> >
> > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h
> > b/drivers/staging/media/sunxi/cedrus/cedrus.h index
> > 2f017a651848..32cb38e541c6 100644
> > --- a/drivers/staging/media/sunxi/cedrus/cedrus.h
> > +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h
> > @@ -70,6 +70,7 @@ struct cedrus_mpeg2_run {
> >
> > struct cedrus_run {
> >
> > struct vb2_v4l2_buffer *src;
> > struct vb2_v4l2_buffer *dst;
> >
> > + bool first_slice;
> >
> > union {
> >
> > struct cedrus_h264_run h264;
> >
> > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> > b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c index
> > 56ca4c9ad01c..d7b54accfe83 100644
> > --- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> > @@ -31,6 +31,8 @@ void cedrus_device_run(void *priv)
> >
> > run.src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
> > run.dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
> >
> > + run.first_slice =
> > + run.src->vb2_buf.timestamp != run.dst-
>vb2_buf.timestamp;
>
> Can't we use slice->first_mb_in_slice to determine if a slice is the
> first? I'd expect ->first_mb_in_slice to be 0 (unless we decide to
> support ASO).
I'm not sure if that is always the case, I would have to check the standard.
Anyway, this method of comparing timestamps was suggested to me a while ago
when we were discussing details on a way forward for multi-slice decoding. I
highly doubt someone would decode slices in mixed order (from different frames)
in same instance.
I can change that in next version if ->first_mb_in_slice == 0 is always true
for the first slice.
Best regards,
Jernej
>
> > /* Apply request(s) controls if needed. */
> > src_req = run.src->vb2_buf.req_obj.req;
_______________________________________________
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 7/8] media: cedrus: Add support for holding capture buffer
From: Boris Brezillon @ 2019-08-26 18:38 UTC (permalink / raw)
To: Jernej Skrabec
Cc: devel, acourbot, pawel, jonas, gregkh, wens, mripard, tfiga,
paul.kocialkowski, kyungmin.park, linux-media, linux-arm-kernel,
hverkuil-cisco, mchehab, ezequiel, linux-kernel, m.szyprowski
In-Reply-To: <20190822194500.2071-8-jernej.skrabec@siol.net>
On Thu, 22 Aug 2019 21:44:59 +0200
Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> When frame contains multiple slices and driver works in slice mode, it's
> more efficient to hold capture buffer in queue until all slices of a
> same frame are decoded.
>
> Add support for that to Cedrus driver by exposing and implementing
> V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF capability.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 9 +++++++++
> drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 8 +++++---
> drivers/staging/media/sunxi/cedrus/cedrus_video.c | 1 +
> 3 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> index d7b54accfe83..68462b99750e 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> @@ -31,6 +31,14 @@ void cedrus_device_run(void *priv)
>
> run.src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
> run.dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
> +
> + if (v4l2_m2m_release_capture_buf(run.src, run.dst)) {
> + v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
> + v4l2_m2m_buf_done(run.dst, VB2_BUF_STATE_DONE);
> + run.dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
> + }
> + run.dst->is_held = run.src->flags & V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF;
> +
> run.first_slice =
> run.src->vb2_buf.timestamp != run.dst->vb2_buf.timestamp;
>
> @@ -46,6 +54,7 @@ void cedrus_device_run(void *priv)
> V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS);
> run.mpeg2.quantization = cedrus_find_control_data(ctx,
> V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION);
> + run.dst->is_held = false;
> break;
>
> case V4L2_PIX_FMT_H264_SLICE:
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> index a942cd9bed57..99fedec80224 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> @@ -122,7 +122,7 @@ static irqreturn_t cedrus_irq(int irq, void *data)
> dev->dec_ops[ctx->current_codec]->irq_clear(ctx);
>
> src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
> - dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
> + dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
>
> if (!src_buf || !dst_buf) {
> v4l2_err(&dev->v4l2_dev,
> @@ -136,8 +136,10 @@ static irqreturn_t cedrus_irq(int irq, void *data)
> state = VB2_BUF_STATE_DONE;
>
> v4l2_m2m_buf_done(src_buf, state);
> - v4l2_m2m_buf_done(dst_buf, state);
> -
> + if (!dst_buf->is_held) {
> + v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
> + v4l2_m2m_buf_done(dst_buf, state);
> + }
> v4l2_m2m_job_finish(ctx->dev->m2m_dev, ctx->fh.m2m_ctx);
>
> return IRQ_HANDLED;
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> index eeee3efd247b..5153b2bba21e 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> @@ -515,6 +515,7 @@ int cedrus_queue_init(void *priv, struct vb2_queue *src_vq,
> src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
> src_vq->io_modes = VB2_MMAP | VB2_DMABUF;
> src_vq->drv_priv = ctx;
> + src_vq->subsystem_flags = VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF;
> src_vq->buf_struct_size = sizeof(struct cedrus_buffer);
> src_vq->min_buffers_needed = 1;
> src_vq->ops = &cedrus_qops;
_______________________________________________
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/8] videodev2.h: add V4L2_DEC_CMD_FLUSH
From: Boris Brezillon @ 2019-08-26 18:30 UTC (permalink / raw)
To: Jernej Skrabec
Cc: devel, acourbot, pawel, jonas, gregkh, wens, mripard, tfiga,
paul.kocialkowski, kyungmin.park, linux-media, linux-arm-kernel,
hverkuil-cisco, mchehab, ezequiel, linux-kernel, m.szyprowski
In-Reply-To: <20190822194500.2071-3-jernej.skrabec@siol.net>
On Thu, 22 Aug 2019 21:44:54 +0200
Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>
> Add this new V4L2_DEC_CMD_FLUSH decoder command and document it.
>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst | 11 ++++++++++-
> Documentation/media/videodev2.h.rst.exceptions | 1 +
> include/uapi/linux/videodev2.h | 1 +
> 3 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst
> index 57f0066f4cff..0bffef6058f7 100644
> --- a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst
> +++ b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst
> @@ -208,7 +208,16 @@ introduced in Linux 3.3. They are, however, mandatory for stateful mem2mem decod
> been started yet, the driver will return an ``EPERM`` error code. When
> the decoder is already running, this command does nothing. No
> flags are defined for this command.
> -
> + * - ``V4L2_DEC_CMD_FLUSH``
> + - 4
> + - Flush any held capture buffers. Only valid for stateless decoders,
> + and only if ``V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF`` was set.
> + This command is typically used when the application reached the
> + end of the stream and the last output buffer had the
> + ``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent
> + dequeueing the last capture buffer containing the last decoded frame.
> + So this command can be used to explicitly flush that last decoded
> + frame.
>
> Return Value
> ============
> diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions
> index adeb6b7a15cb..a79028e4d929 100644
> --- a/Documentation/media/videodev2.h.rst.exceptions
> +++ b/Documentation/media/videodev2.h.rst.exceptions
> @@ -434,6 +434,7 @@ replace define V4L2_DEC_CMD_START decoder-cmds
> replace define V4L2_DEC_CMD_STOP decoder-cmds
> replace define V4L2_DEC_CMD_PAUSE decoder-cmds
> replace define V4L2_DEC_CMD_RESUME decoder-cmds
> +replace define V4L2_DEC_CMD_FLUSH decoder-cmds
>
> replace define V4L2_DEC_CMD_START_MUTE_AUDIO decoder-cmds
> replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 4fa9f543742d..91a79e16089c 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -1978,6 +1978,7 @@ struct v4l2_encoder_cmd {
> #define V4L2_DEC_CMD_STOP (1)
> #define V4L2_DEC_CMD_PAUSE (2)
> #define V4L2_DEC_CMD_RESUME (3)
> +#define V4L2_DEC_CMD_FLUSH (4)
>
> /* Flags for V4L2_DEC_CMD_START */
> #define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)
_______________________________________________
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 5/8] media: cedrus: Detect first slice of a frame
From: Boris Brezillon @ 2019-08-26 18:28 UTC (permalink / raw)
To: Jernej Skrabec
Cc: devel, acourbot, pawel, jonas, gregkh, wens, mripard, tfiga,
paul.kocialkowski, kyungmin.park, linux-media, linux-arm-kernel,
hverkuil-cisco, mchehab, ezequiel, linux-kernel, m.szyprowski
In-Reply-To: <20190822194500.2071-6-jernej.skrabec@siol.net>
Hi Jernej,
On Thu, 22 Aug 2019 21:44:57 +0200
Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> When codec supports multiple slices in one frame, VPU has to know when
> first slice of each frame is being processed, presumably to correctly
> clear/set data in auxiliary buffers.
>
> Add first_slice field to cedrus_run structure and set it according to
> timestamps of capture and output buffers. If timestamps are different,
> it's first slice and viceversa.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> ---
> drivers/staging/media/sunxi/cedrus/cedrus.h | 1 +
> drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h
> index 2f017a651848..32cb38e541c6 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus.h
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h
> @@ -70,6 +70,7 @@ struct cedrus_mpeg2_run {
> struct cedrus_run {
> struct vb2_v4l2_buffer *src;
> struct vb2_v4l2_buffer *dst;
> + bool first_slice;
>
> union {
> struct cedrus_h264_run h264;
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> index 56ca4c9ad01c..d7b54accfe83 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> @@ -31,6 +31,8 @@ void cedrus_device_run(void *priv)
>
> run.src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
> run.dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
> + run.first_slice =
> + run.src->vb2_buf.timestamp != run.dst->vb2_buf.timestamp;
Can't we use slice->first_mb_in_slice to determine if a slice is the
first? I'd expect ->first_mb_in_slice to be 0 (unless we decide to
support ASO).
>
> /* Apply request(s) controls if needed. */
> src_req = run.src->vb2_buf.req_obj.req;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* qcom: build issue in Linux 5.3-rc6 with CONFIG_XEN=y
From: Stefan Wahren @ 2019-08-26 18:08 UTC (permalink / raw)
To: Bjorn Andersson, Avaneesh Kumar Dwivedi, Andy Gross
Cc: linux-arm-msm, linux-arm-kernel
Hi,
i tried to cross compile arm/multi_v7_defconfig with CONFIG_XEN=y with Linux 5.3-rc6 and i'm getting this:
drivers/firmware/qcom_scm.c: In function ‘qcom_scm_assign_mem’:
drivers/firmware/qcom_scm.c:460:47: error: passing argument 3 of ‘dma_alloc_coherent’ from incompatible pointer type [-Werror=incompatible-pointer-types]
ptr = dma_alloc_coherent(__scm->dev, ptr_sz, &ptr_phys, GFP_KERNEL);
^
In file included from drivers/firmware/qcom_scm.c:12:0:
./include/linux/dma-mapping.h:636:21: note: expected ‘dma_addr_t * {aka long long unsigned int *}’ but argument is of type ‘phys_addr_t * {aka unsigned int *}’
static inline void *dma_alloc_coherent(struct device *dev, size_t size,
^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:280: die Regel für Ziel „drivers/firmware/qcom_scm.o“ scheiterte
make[2]: *** [drivers/firmware/qcom_scm.o] Fehler 1
scripts/Makefile.build:497: die Regel für Ziel „drivers/firmware“ scheiterte
Luckily there is already a patch to fix this in linux-next:
firmware: qcom_scm: Use proper types for dma mappings
I hope someone can take care of this.
Regards
Stefan
_______________________________________________
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: imx: Drop imx_anatop_init()
From: Andrey Smirnov @ 2019-08-26 18:08 UTC (permalink / raw)
To: Shawn Guo
Cc: Aisheng Dong, Peter Chen, linux-kernel@vger.kernel.org,
dl-linux-imx, Leonard Crestez, Fabio Estevam, Chris Healy,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <20190824183108.GA14936@X250>
On Sat, Aug 24, 2019 at 11:31 AM Shawn Guo <shawnguo@kernel.org> wrote:
>
> On Thu, Aug 22, 2019 at 05:33:13PM +0000, Leonard Crestez wrote:
> > On 31.07.2019 21:01, Andrey Smirnov wrote:
> > > With commit b5bbe2235361 ("usb: phy: mxs: Disable external charger
> > > detect in mxs_phy_hw_init()") in tree all of the necessary charger
> > > setup is done by the USB PHY driver which covers all of the affected
> > > i.MX6 SoCs.
> > >
> > > NOTE: Imx_anatop_init() was also called for i.MX7D, but looking at its
> > > datasheet it appears to have a different USB PHY IP block, so
> > > executing i.MX6 charger disable configuration seems unnecessary.
> > >
> > > -void __init imx_anatop_init(void)
> > > -{
> > > - anatop = syscon_regmap_lookup_by_compatible("fsl,imx6q-anatop");
> > > - if (IS_ERR(anatop)) {
> > > - pr_err("%s: failed to find imx6q-anatop regmap!\n", __func__);
> > > - return;
> > > - }
> >
> > This patch breaks suspend on imx6 in linux-next because the "anatop"
> > regmap is no longer initialized. This was found via bisect but
> > no_console_suspend prints a helpful stack anyway:
> >
> > (regmap_read) from [<c01226e4>] (imx_anatop_enable_weak2p5+0x28/0x70)
> > (imx_anatop_enable_weak2p5) from [<c0122744>]
> > (imx_anatop_pre_suspend+0x18/0x64)
> > (imx_anatop_pre_suspend) from [<c0124434>] (imx6q_pm_enter+0x60/0x16c)
> > (imx6q_pm_enter) from [<c018c8a4>] (suspend_devices_and_enter+0x7d4/0xcbc)
> > (suspend_devices_and_enter) from [<c018d544>] (pm_suspend+0x7b8/0x904)
> > (pm_suspend) from [<c018b1b4>] (state_store+0x68/0xc8)
>
> I dropped it from my branch for now. Thanks for reporting!
>
OK, it sounds like I can submit a v2 that only removes
imx_anatop_usb_chrg_detect_disable() and keeps imx_anatop_init()
intact.
Thanks,
Andrey Smirnov
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH v6 3/3] ASoC: sun4i-i2s: Adjust LRCLK width
From: codekipper @ 2019-08-26 18:07 UTC (permalink / raw)
To: mripard, wens, linux-sunxi
Cc: alsa-devel, Marcus Cooper, lgirdwood, linux-kernel, be17068,
broonie, linux-arm-kernel
In-Reply-To: <20190826180734.15801-1-codekipper@gmail.com>
From: Marcus Cooper <codekipper@gmail.com>
Some codecs such as i2s based HDMI audio and the Pine64 DAC require
a different amount of bit clocks per frame than what is calculated
by the sample width. Use the values obtained by the tdm slot bindings
to adjust the LRCLK width accordingly.
Signed-off-by: Marcus Cooper <codekipper@gmail.com>
---
sound/soc/sunxi/sun4i-i2s.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 056a299c03fb..0965a97c96e5 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -455,7 +455,10 @@ static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s,
break;
case SND_SOC_DAIFMT_I2S:
- lrck_period = params_physical_width(params);
+ if (i2s->slot_width)
+ lrck_period = i2s->slot_width;
+ else
+ lrck_period = params_physical_width(params);
break;
default:
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH v6 2/3] ASoC: sun4i-i2s: Add regmap field to sign extend sample
From: codekipper @ 2019-08-26 18:07 UTC (permalink / raw)
To: mripard, wens, linux-sunxi
Cc: alsa-devel, Marcus Cooper, lgirdwood, linux-kernel, be17068,
broonie, linux-arm-kernel
In-Reply-To: <20190826180734.15801-1-codekipper@gmail.com>
From: Marcus Cooper <codekipper@gmail.com>
On the newer SoCs such as the H3 and A64 this is set by default
to transfer a 0 after each sample in each slot. However the A10
and A20 SoCs that this driver was developed on had a default
setting where it padded the audio gain with zeros.
This isn't a problem whilst we have only support for 16bit audio
but with larger sample resolution rates in the pipeline then SEXT
bits should be cleared so that they also pad at the LSB. Without
this the audio gets distorted.
Signed-off-by: Marcus Cooper <codekipper@gmail.com>
---
sound/soc/sunxi/sun4i-i2s.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 34575a8aa9f6..056a299c03fb 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -135,6 +135,7 @@ struct sun4i_i2s;
* @field_clkdiv_mclk_en: regmap field to enable mclk output.
* @field_fmt_wss: regmap field to set word select size.
* @field_fmt_sr: regmap field to set sample resolution.
+ * @field_fmt_sext: regmap field to set the sign extension.
*/
struct sun4i_i2s_quirks {
bool has_reset;
@@ -145,6 +146,7 @@ struct sun4i_i2s_quirks {
struct reg_field field_clkdiv_mclk_en;
struct reg_field field_fmt_wss;
struct reg_field field_fmt_sr;
+ struct reg_field field_fmt_sext;
const struct sun4i_i2s_clk_div *bclk_dividers;
unsigned int num_bclk_dividers;
@@ -177,6 +179,7 @@ struct sun4i_i2s {
struct regmap_field *field_clkdiv_mclk_en;
struct regmap_field *field_fmt_wss;
struct regmap_field *field_fmt_sr;
+ struct regmap_field *field_fmt_sext;
const struct sun4i_i2s_quirks *variant;
};
@@ -354,6 +357,10 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai,
regmap_field_write(i2s->field_clkdiv_mclk_en, 1);
+
+ /* Set sign extension to pad out LSB with 0 */
+ regmap_field_write(i2s->field_fmt_sext, 0);
+
return 0;
}
@@ -1073,6 +1080,7 @@ static const struct sun4i_i2s_quirks sun4i_a10_i2s_quirks = {
.mclk_dividers = sun4i_i2s_mclk_div,
.num_mclk_dividers = ARRAY_SIZE(sun4i_i2s_mclk_div),
.get_bclk_parent_rate = sun4i_i2s_get_bclk_parent_rate,
+ .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
.get_sr = sun4i_i2s_get_sr,
.get_wss = sun4i_i2s_get_wss,
.set_chan_cfg = sun4i_i2s_set_chan_cfg,
@@ -1091,6 +1099,7 @@ static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = {
.mclk_dividers = sun4i_i2s_mclk_div,
.num_mclk_dividers = ARRAY_SIZE(sun4i_i2s_mclk_div),
.get_bclk_parent_rate = sun4i_i2s_get_bclk_parent_rate,
+ .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
.get_sr = sun4i_i2s_get_sr,
.get_wss = sun4i_i2s_get_wss,
.set_chan_cfg = sun4i_i2s_set_chan_cfg,
@@ -1109,6 +1118,7 @@ static const struct sun4i_i2s_quirks sun8i_a83t_i2s_quirks = {
.mclk_dividers = sun8i_i2s_clk_div,
.num_mclk_dividers = ARRAY_SIZE(sun8i_i2s_clk_div),
.get_bclk_parent_rate = sun8i_i2s_get_bclk_parent_rate,
+ .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 4, 5),
.get_sr = sun8i_i2s_get_sr_wss,
.get_wss = sun8i_i2s_get_sr_wss,
.set_chan_cfg = sun8i_i2s_set_chan_cfg,
@@ -1127,6 +1137,7 @@ static const struct sun4i_i2s_quirks sun50i_a64_codec_i2s_quirks = {
.mclk_dividers = sun4i_i2s_mclk_div,
.num_mclk_dividers = ARRAY_SIZE(sun4i_i2s_mclk_div),
.get_bclk_parent_rate = sun4i_i2s_get_bclk_parent_rate,
+ .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
.get_sr = sun4i_i2s_get_sr,
.get_wss = sun4i_i2s_get_wss,
.set_chan_cfg = sun4i_i2s_set_chan_cfg,
@@ -1154,6 +1165,12 @@ static int sun4i_i2s_init_regmap_fields(struct device *dev,
if (IS_ERR(i2s->field_fmt_sr))
return PTR_ERR(i2s->field_fmt_sr);
+ i2s->field_fmt_sext =
+ devm_regmap_field_alloc(dev, i2s->regmap,
+ i2s->variant->field_fmt_sext);
+ if (IS_ERR(i2s->field_fmt_sext))
+ return PTR_ERR(i2s->field_fmt_sext);
+
return 0;
}
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH v6 1/3] ASoC: sun4i-i2s: incorrect regmap for A83T
From: codekipper @ 2019-08-26 18:07 UTC (permalink / raw)
To: mripard, wens, linux-sunxi
Cc: alsa-devel, Marcus Cooper, lgirdwood, linux-kernel, be17068,
broonie, linux-arm-kernel
In-Reply-To: <20190826180734.15801-1-codekipper@gmail.com>
From: Marcus Cooper <codekipper@gmail.com>
The regmap configuration is set up for the legacy block on the
A83T whereas it uses the new block with a larger register map.
Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Signed-off-by: Marcus Cooper <codekipper@gmail.com>
---
sound/soc/sunxi/sun4i-i2s.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 57bf2a33753e..34575a8aa9f6 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -1100,7 +1100,7 @@ static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = {
static const struct sun4i_i2s_quirks sun8i_a83t_i2s_quirks = {
.has_reset = true,
.reg_offset_txdata = SUN8I_I2S_FIFO_TX_REG,
- .sun4i_i2s_regmap = &sun4i_i2s_regmap_config,
+ .sun4i_i2s_regmap = &sun8i_i2s_regmap_config,
.field_clkdiv_mclk_en = REG_FIELD(SUN4I_I2S_CLK_DIV_REG, 8, 8),
.field_fmt_wss = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 2),
.field_fmt_sr = REG_FIELD(SUN4I_I2S_FMT0_REG, 4, 6),
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* [PATCH v6 0/3] ASoC: sun4i-i2s: Updates to the driver
From: codekipper @ 2019-08-26 18:07 UTC (permalink / raw)
To: mripard, wens, linux-sunxi
Cc: alsa-devel, Marcus Cooper, lgirdwood, linux-kernel, be17068,
broonie, linux-arm-kernel
From: Marcus Cooper <codekipper@gmail.com>
Hi All,
here is a patch series to add some improvements to the sun4i-i2s driver
which is enough to get HDMI audio working on the A83T, A64, H3 and
H5 platforms.
I've dropped a lot of the functionality that was presented earlier in favour
of getting initial HDMI audio delivered. H6 and multi-channel HDMI will
follow shortly.
My test branch for this can be found at
https://github.com/codekipper/linux-sunxi/commits/upstream-i2s , I've been
using a Pine64 to test with; validating the new SoC block with HDMI audio
and ensuring that I've not broken the old block by making sure that the audio
codec still works.
BR,
CK
---
v6 changes compared to v5 are:
- removed patches for multi-channel and H6 HDMI audio.
- removed patch for 20, 24 and 32 bit (will push support for just 20 and 24bit)
- ditched tdm patches as support has already been added.
- added fix for A83T reg map.
v5 changes compared to v4 are:
- removed delivered patches.
- Added more details to commit messages.
- replaced some reg fields with function calls.
- Added DSP_A and DSP_B support for H3 and later SoCs.
- Added support for the Allwinner H6.
v4 changes compared to v3 are:
- Moved patches around so that the more controversial of patches are
at the top of the stack.
- Added more details to commit messages.
- Fixed 20bit audio PCM format to use 4 bytes.
- Reduced number of flags used to indicate a new SoC.
v3 changes compared to v2 are:
- added back slave mode changes
- added back the use of tdm properties
- changes to regmap and caching
- removed loopback functionality
- fixes to the channel offset mask
v2 changes compared to v1 are:
- removed slave mode changes which didn't set mclk and bclk div.
- removed use of tdm and now use a dedicated property.
- fix commit message to better explain reason for sign extending
- add divider calculations for newer SoCs.
- add support for multi-lane i2s data output.
- add support for 20, 24 and 32 bit samples.
- add loopback property so blocks can be tested without a codec.
---
Marcus Cooper (3):
ASoC: sun4i-i2s: incorrect regmap for A83T
ASoC: sun4i-i2s: Add regmap field to sign extend sample
ASoC: sun4i-i2s: Adjust LRCLK width
sound/soc/sunxi/sun4i-i2s.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
--
2.23.0
_______________________________________________
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: vf610-zii-scu4-aib: Drop "rs485-rts-delay" property
From: Andrey Smirnov @ 2019-08-26 18:05 UTC (permalink / raw)
To: Shawn Guo; +Cc: Fabio Estevam, Chris Healy, linux-arm-kernel, linux-kernel
In-Reply-To: <20190824190903.GC16308@X250.getinternet.no>
On Sat, Aug 24, 2019 at 12:09 PM Shawn Guo <shawnguo@kernel.org> wrote:
>
> On Mon, Aug 19, 2019 at 08:13:01PM -0700, Andrey Smirnov wrote:
> > LPUART driver does not support specifying "rs485-rts-delay"
> > property. Drop it.
>
> If so, we need to fix bindings/serial/fsl-lpuart.txt in the meantime?
>
Yeah, good point. Will submit a separate patch for that.
Thanks,
Andrey Smirnov
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox