* Re: [PATCH v7 12/17] ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()
From: Jacob Keller @ 2016-11-08 23:54 UTC (permalink / raw)
To: Karthik Nayak; +Cc: Git mailing list
In-Reply-To: <20161108201211.25213-13-Karthik.188@gmail.com>
On Tue, Nov 8, 2016 at 12:12 PM, Karthik Nayak <karthik.188@gmail.com> wrote:
> From: Karthik Nayak <karthik.188@gmail.com>
>
> Use the recently introduced refname_atom_parser_internal() within
> remote_ref_atom_parser(), this provides a common base for all the ref
> printing atoms, allowing %(upstream) and %(push) to also use the
> ':strip' option.
>
> The atoms '%(push)' and '%(upstream)' will retain the ':track' and
> ':trackshort' atom modifiers to themselves as they have no meaning in
> context to the '%(refname)' and '%(symref)' atoms.
>
> Update the documentation and tests to reflect the same.
>
Nice. Good to have all this become common.
> Signed-off-by: Karthik Nayak <Karthik.188@gmail.com>
> ---
> Documentation/git-for-each-ref.txt | 27 ++++++++++++++-------------
> ref-filter.c | 26 +++++++++++++++-----------
> t/t6300-for-each-ref.sh | 2 ++
> 3 files changed, 31 insertions(+), 24 deletions(-)
>
> diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
> index a669a32..600b703 100644
> --- a/Documentation/git-for-each-ref.txt
> +++ b/Documentation/git-for-each-ref.txt
> @@ -114,21 +114,22 @@ objectname::
>
> upstream::
> The name of a local ref which can be considered ``upstream''
> - from the displayed ref. Respects `:short` in the same way as
> - `refname` above. Additionally respects `:track` to show
> - "[ahead N, behind M]" and `:trackshort` to show the terse
> - version: ">" (ahead), "<" (behind), "<>" (ahead and behind),
> - or "=" (in sync). `:track` also prints "[gone]" whenever
> - unknown upstream ref is encountered. Append `:track,nobracket`
> - to show tracking information without brackets (i.e "ahead N,
> - behind M"). Has no effect if the ref does not have tracking
> - information associated with it.
> + from the displayed ref. Respects `:short` and `:strip` in the
> + same way as `refname` above. Additionally respects `:track`
> + to show "[ahead N, behind M]" and `:trackshort` to show the
> + terse version: ">" (ahead), "<" (behind), "<>" (ahead and
> + behind), or "=" (in sync). `:track` also prints "[gone]"
> + whenever unknown upstream ref is encountered. Append
> + `:track,nobracket` to show tracking information without
> + brackets (i.e "ahead N, behind M"). Has no effect if the ref
> + does not have tracking information associated with it.
>
> push::
> - The name of a local ref which represents the `@{push}` location
> - for the displayed ref. Respects `:short`, `:track`, and
> - `:trackshort` options as `upstream` does. Produces an empty
> - string if no `@{push}` ref is configured.
> + The name of a local ref which represents the `@{push}`
> + location for the displayed ref. Respects `:short`, `:strip`,
> + `:track`, and `:trackshort` options as `upstream`
> + does. Produces an empty string if no `@{push}` ref is
> + configured.
>
> HEAD::
> '*' if HEAD matches current ref (the checked out branch), ' '
> diff --git a/ref-filter.c b/ref-filter.c
> index f1d27b5..7d3d3a6 100644
> --- a/ref-filter.c
> +++ b/ref-filter.c
> @@ -52,7 +52,8 @@ static struct used_atom {
> char color[COLOR_MAXLEN];
> struct align align;
> struct {
> - enum { RR_NORMAL, RR_SHORTEN, RR_TRACK, RR_TRACKSHORT } option;
> + enum { RR_REF, RR_TRACK, RR_TRACKSHORT } option;
> + struct refname_atom refname;
> unsigned int nobracket: 1;
> } remote_ref;
> struct {
> @@ -102,7 +103,9 @@ static void remote_ref_atom_parser(struct used_atom *atom, const char *arg)
> int i;
>
> if (!arg) {
> - atom->u.remote_ref.option = RR_NORMAL;
> + atom->u.remote_ref.option = RR_REF;
> + refname_atom_parser_internal(&atom->u.remote_ref.refname,
> + arg, atom->name);
> return;
> }
>
> @@ -112,16 +115,17 @@ static void remote_ref_atom_parser(struct used_atom *atom, const char *arg)
> for (i = 0; i < params.nr; i++) {
> const char *s = params.items[i].string;
>
> - if (!strcmp(s, "short"))
> - atom->u.remote_ref.option = RR_SHORTEN;
> - else if (!strcmp(s, "track"))
> + if (!strcmp(s, "track"))
> atom->u.remote_ref.option = RR_TRACK;
> else if (!strcmp(s, "trackshort"))
> atom->u.remote_ref.option = RR_TRACKSHORT;
> else if (!strcmp(s, "nobracket"))
> atom->u.remote_ref.nobracket = 1;
> - else
> - die(_("unrecognized format: %%(%s)"), atom->name);
> + else {
> + atom->u.remote_ref.option = RR_REF;
> + refname_atom_parser_internal(&atom->u.remote_ref.refname,
> + arg, atom->name);
> + }
> }
>
> string_list_clear(¶ms, 0);
> @@ -1100,8 +1104,8 @@ static void fill_remote_ref_details(struct used_atom *atom, const char *refname,
> struct branch *branch, const char **s)
> {
> int num_ours, num_theirs;
> - if (atom->u.remote_ref.option == RR_SHORTEN)
> - *s = shorten_unambiguous_ref(refname, warn_ambiguous_refs);
> + if (atom->u.remote_ref.option == RR_REF)
> + *s = show_ref(&atom->u.remote_ref.refname, refname);
> else if (atom->u.remote_ref.option == RR_TRACK) {
> if (stat_tracking_info(branch, &num_ours,
> &num_theirs, NULL)) {
> @@ -1133,8 +1137,8 @@ static void fill_remote_ref_details(struct used_atom *atom, const char *refname,
> *s = ">";
> else
> *s = "<>";
> - } else /* RR_NORMAL */
> - *s = refname;
> + } else
> + die("BUG: unhandled RR_* enum");
> }
>
> char *get_head_description(void)
> diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
> index 3d28234..7ca0a12 100755
> --- a/t/t6300-for-each-ref.sh
> +++ b/t/t6300-for-each-ref.sh
> @@ -55,8 +55,10 @@ test_atom head refname:strip=1 heads/master
> test_atom head refname:strip=2 master
> test_atom head upstream refs/remotes/origin/master
> test_atom head upstream:short origin/master
> +test_atom head upstream:strip=2 origin/master
> test_atom head push refs/remotes/myfork/master
> test_atom head push:short myfork/master
> +test_atom head push:strip=1 remotes/myfork/master
> test_atom head objecttype commit
> test_atom head objectsize 171
> test_atom head objectname $(git rev-parse refs/heads/master)
> --
> 2.10.2
>
^ permalink raw reply
* Re: [RFC PATCH 12/24] ARM: vGICv3: introduce basic ITS emulation bits
From: Stefano Stabellini @ 2016-11-08 23:54 UTC (permalink / raw)
To: Andre Przywara; +Cc: xen-devel, Julien Grall, Stefano Stabellini
In-Reply-To: <20160928182457.12433-13-andre.przywara@arm.com>
On Wed, 28 Sep 2016, Andre Przywara wrote:
> Create a new file to hold the emulation code for the ITS widget.
> For now we emulate the memory mapped ITS registers and provide a stub
> to introduce the ITS command handling framework (but without actually
> emulating any commands at this time).
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
> xen/arch/arm/Makefile | 1 +
> xen/arch/arm/vgic-its.c | 378 ++++++++++++++++++++++++++++++++++++++
> xen/arch/arm/vgic-v3.c | 9 -
> xen/include/asm-arm/gic_v3_defs.h | 19 ++
> 4 files changed, 398 insertions(+), 9 deletions(-)
> create mode 100644 xen/arch/arm/vgic-its.c
>
> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
> index c2c4daa..cb0201f 100644
> --- a/xen/arch/arm/Makefile
> +++ b/xen/arch/arm/Makefile
> @@ -44,6 +44,7 @@ obj-y += traps.o
> obj-y += vgic.o
> obj-y += vgic-v2.o
> obj-$(CONFIG_ARM_64) += vgic-v3.o
> +obj-$(CONFIG_HAS_ITS) += vgic-its.o
> obj-y += vm_event.o
> obj-y += vtimer.o
> obj-y += vpsci.o
> diff --git a/xen/arch/arm/vgic-its.c b/xen/arch/arm/vgic-its.c
> new file mode 100644
> index 0000000..875b992
> --- /dev/null
> +++ b/xen/arch/arm/vgic-its.c
> @@ -0,0 +1,378 @@
> +/*
> + * xen/arch/arm/vgic-its.c
> + *
> + * ARM Interrupt Translation Service (ITS) emulation
> + *
> + * Andre Przywara <andre.przywara@arm.com>
> + * Copyright (c) 2016 ARM Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * 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.
> + */
> +
> +#include <xen/bitops.h>
> +#include <xen/config.h>
> +#include <xen/domain_page.h>
> +#include <xen/lib.h>
> +#include <xen/init.h>
> +#include <xen/softirq.h>
> +#include <xen/irq.h>
> +#include <xen/sched.h>
> +#include <xen/sizes.h>
> +#include <asm/current.h>
> +#include <asm/mmio.h>
> +#include <asm/gic_v3_defs.h>
> +#include <asm/gic-its.h>
> +#include <asm/vgic.h>
> +#include <asm/vgic-emul.h>
> +
> +/* Data structure to describe a virtual ITS */
> +struct virt_its {
> + struct domain *d;
> + struct host_its *hw_its;
> + spinlock_t vcmd_lock; /* protects the virtual command buffer */
> + uint64_t cbaser;
> + uint64_t *cmdbuf;
> + int cwriter;
> + int creadr;
> + spinlock_t its_lock; /* protects the collection and device tables */
> + uint64_t baser0, baser1;
> + uint16_t *coll_table;
> + int max_collections;
> + uint64_t *dev_table;
> + int max_devices;
> + bool enabled;
> +};
> +
> +/* An Interrupt Translation Table Entry: this is indexed by a
> + * DeviceID/EventID pair and is located in guest memory.
> + */
> +struct vits_itte
> +{
> + uint64_t hlpi:24;
> + uint64_t vlpi:24;
> + uint64_t collection:16;
> +};
> +
> +/**************************************
> + * Functions that handle ITS commands *
> + **************************************/
> +
> +static uint64_t its_cmd_mask_field(uint64_t *its_cmd,
> + int word, int shift, int size)
> +{
> + return (le64_to_cpu(its_cmd[word]) >> shift) & (BIT(size) - 1);
> +}
> +
> +#define its_cmd_get_command(cmd) its_cmd_mask_field(cmd, 0, 0, 8)
> +#define its_cmd_get_deviceid(cmd) its_cmd_mask_field(cmd, 0, 32, 32)
> +#define its_cmd_get_size(cmd) its_cmd_mask_field(cmd, 1, 0, 5)
> +#define its_cmd_get_id(cmd) its_cmd_mask_field(cmd, 1, 0, 32)
> +#define its_cmd_get_physical_id(cmd) its_cmd_mask_field(cmd, 1, 32, 32)
> +#define its_cmd_get_collection(cmd) its_cmd_mask_field(cmd, 2, 0, 16)
> +#define its_cmd_get_target_addr(cmd) its_cmd_mask_field(cmd, 2, 16, 32)
> +#define its_cmd_get_validbit(cmd) its_cmd_mask_field(cmd, 2, 63, 1)
> +
> +#define ITS_CMD_BUFFER_SIZE(baser) ((((baser) & 0xff) + 1) << 12)
> +
> +static int vgic_its_handle_cmds(struct domain *d, struct virt_its *its,
> + uint32_t writer)
> +{
> + uint64_t *cmdptr;
> +
> + if ( !its->cmdbuf )
> + return -1;
> +
> + if ( writer >= ITS_CMD_BUFFER_SIZE(its->cbaser) )
> + return -1;
> +
> + spin_lock(&its->vcmd_lock);
> +
> + while ( its->creadr != writer )
> + {
> + cmdptr = its->cmdbuf + (its->creadr / sizeof(*its->cmdbuf));
> +
> + switch (its_cmd_get_command(cmdptr))
> + {
> + case GITS_CMD_SYNC:
> + /* We handle ITS commands synchronously, so we ignore SYNC. */
> + break;
indentation
> + default:
> + gdprintk(XENLOG_G_WARNING, "ITS: unhandled ITS command %ld\n",
> + its_cmd_get_command(cmdptr));
> + break;
> + }
> +
> + its->creadr += ITS_CMD_SIZE;
> + if ( its->creadr == ITS_CMD_BUFFER_SIZE(its->cbaser) )
> + its->creadr = 0;
> + }
> + its->cwriter = writer;
> +
> + spin_unlock(&its->vcmd_lock);
> +
> + return 0;
> +}
> +
> +/*****************************
> + * ITS registers read access *
> + *****************************/
> +
> +/* The physical address is encoded slightly differently depending on
> + * the used page size: the highest four bits are stored in the lowest
> + * four bits of the field for 64K pages.
> + */
> +static paddr_t get_baser_phys_addr(uint64_t reg)
> +{
> + if ( reg & BIT(9) )
> + return (reg & GENMASK(47, 16)) | ((reg & GENMASK(15, 12)) << 36);
> + else
> + return reg & GENMASK(47, 12);
> +}
I would simplify the code by supporting only one page size, maybe 4K.
> +
> +static int vgic_v3_its_mmio_read(struct vcpu *v, mmio_info_t *info,
> + register_t *r, void *priv)
> +{
> + struct virt_its *its = priv;
> +
> + switch ( info->gpa & 0xffff )
> + {
> + case VREG32(GITS_CTLR):
> + if ( info->dabt.size != DABT_WORD ) goto bad_width;
> + *r = vgic_reg32_extract(its->enabled | BIT(31), info);
> + break;
indentation
> + case VREG32(GITS_IIDR):
> + if ( info->dabt.size != DABT_WORD ) goto bad_width;
> + *r = vgic_reg32_extract(GITS_IIDR_VALUE, info);
> + break;
> + case VREG64(GITS_TYPER):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> + *r = vgic_reg64_extract(0x1eff1, info);
please #define 0x1eff1
> + break;
> + case VREG64(GITS_CBASER):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> + *r = vgic_reg64_extract(its->cbaser, info);
> + break;
> + case VREG64(GITS_CWRITER):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> + *r = vgic_reg64_extract(its->cwriter, info);
> + break;
> + case VREG64(GITS_CREADR):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> + *r = vgic_reg64_extract(its->creadr, info);
> + break;
> + case VREG64(GITS_BASER0):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> + *r = vgic_reg64_extract(its->baser0, info);
> + break;
> + case VREG64(GITS_BASER1):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> + *r = vgic_reg64_extract(its->baser1, info);
> + break;
> + case VRANGE64(GITS_BASER2, GITS_BASER7):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> + *r = vgic_reg64_extract(0, info);
> + break;
I notice that this patch lacks the code to initialize the vits registers
to sensible defaults. For example, who initializes the entry size
(52:48) of GITS_BASER?
> + case VREG32(GICD_PIDR2):
> + if ( info->dabt.size != DABT_WORD ) goto bad_width;
> + *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info);
> + break;
> + }
> +
> + return 1;
> +
> +bad_width:
> + domain_crash_synchronous();
> +
> + return 0;
> +}
> +
> +/******************************
> + * ITS registers write access *
> + ******************************/
> +
> +static int its_baser_table_size(uint64_t baser)
> +{
> + int page_size = 0;
> +
> + switch ( (baser >> 8) & 3 )
> + {
> + case 0: page_size = SZ_4K; break;
> + case 1: page_size = SZ_16K; break;
> + case 2:
> + case 3: page_size = SZ_64K; break;
> + }
> +
> + return page_size * ((baser & GENMASK(7, 0)) + 1);
> +}
> +
> +static int its_baser_nr_entries(uint64_t baser)
> +{
> + int entry_size = ((baser & GENMASK(52, 48)) >> 48) + 1;
> +
> + return its_baser_table_size(baser) / entry_size;
> +}
> +
> +static int vgic_v3_its_mmio_write(struct vcpu *v, mmio_info_t *info,
> + register_t r, void *priv)
> +{
> + struct domain *d = v->domain;
> + struct virt_its *its = priv;
> + uint64_t reg;
> + uint32_t ctlr;
> +
> + switch ( info->gpa & 0xffff )
> + {
> + case VREG32(GITS_CTLR):
> + ctlr = its->enabled ? GITS_CTLR_ENABLE : 0;
> + if ( info->dabt.size != DABT_WORD ) goto bad_width;
> + vgic_reg32_update(&ctlr, r, info);
> + its->enabled = ctlr & GITS_CTLR_ENABLE;
> + /* TODO: trigger something ... */
indentation
> + return 1;
> + case VREG32(GITS_IIDR):
> + goto write_ignore_32;
> + case VREG32(GITS_TYPER):
> + goto write_ignore_32;
> + case VREG64(GITS_CBASER):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> +
> + /* Changing base registers with the ITS enabled is UNPREDICTABLE. */
> + if ( its->enabled )
It is worth printing an error (gdprintk).
> + return 1;
> +
> + reg = its->cbaser;
> + vgic_reg64_update(®, r, info);
> + /* TODO: sanitise! */
Yeah, we really need to do that :-)
> + its->cbaser = reg;
> +
> + if ( reg & BIT(63) )
> + {
> + its->cmdbuf = map_guest_pages(d, reg & GENMASK(51, 12), 1);
This is only one page, there is no need to use the vmap.
> + }
> + else
> + {
> + unmap_guest_pages(its->cmdbuf, 1);
> + its->cmdbuf = NULL;
> + }
> +
> + return 1;
indentation
> + case VREG64(GITS_CWRITER):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> + reg = its->cwriter;
> + vgic_reg64_update(®, r, info);
> + vgic_its_handle_cmds(d, its, reg);
> + return 1;
> + case VREG64(GITS_CREADR):
> + goto write_ignore_64;
> + case VREG64(GITS_BASER0):
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> +
> + /* Changing base registers with the ITS enabled is UNPREDICTABLE. */
> + if ( its->enabled )
please add a warning
> + return 1;
> +
> + reg = its->baser0;
> + vgic_reg64_update(®, r, info);
> +
> + reg &= ~GITS_BASER_RO_MASK;
> + reg |= (sizeof(uint64_t) - 1) << GITS_BASER_ENTRY_SIZE_SHIFT;
> + reg |= GITS_BASER_TYPE_DEVICE << GITS_BASER_TYPE_SHIFT;
Why not | with its->baser0?
> + /* TODO: sanitise! */
Indeed
> + /* TODO: locking(?) */
vITS stuff can be modified concurrently by two or more vCPUs, so
anything that changes a shared state accessible by multiple vCPUs need a
lock.
> + if ( reg & GITS_BASER_VALID )
> + {
> + its->dev_table = map_guest_pages(d,
> + get_baser_phys_addr(reg),
> + its_baser_table_size(reg) >> PAGE_SHIFT);
> + its->max_devices = its_baser_nr_entries(reg);
> + memset(its->dev_table, 0, its->max_devices * sizeof(uint64_t));
> + }
> + else
> + {
> + unmap_guest_pages(its->dev_table,
> + its_baser_table_size(reg) >> PAGE_SHIFT);
> + its->max_devices = 0;
> + }
> +
> + its->baser0 = reg;
> + return 1;
> + case VREG64(GITS_BASER1):
We need to be able to share this code with the GITS_BASER0 case above
> + if ( info->dabt.size < DABT_WORD ) goto bad_width;
> +
> + /* Changing base registers with the ITS enabled is UNPREDICTABLE. */
> + if ( its->enabled )
> + return 1;
> +
> + reg = its->baser1;
> + vgic_reg64_update(®, r, info);
> + reg &= ~GITS_BASER_RO_MASK;
> + reg |= (sizeof(uint16_t) - 1) << GITS_BASER_ENTRY_SIZE_SHIFT;
> + reg |= GITS_BASER_TYPE_COLLECTION << GITS_BASER_TYPE_SHIFT;
> + /* TODO: sanitise! */
> +
> + /* TODO: sort out locking */
> + /* TODO: repeated calls: free old mapping */
> + if ( reg & GITS_BASER_VALID )
> + {
> + its->coll_table = map_guest_pages(d, get_baser_phys_addr(reg),
> + its_baser_table_size(reg) >> PAGE_SHIFT);
> + its->max_collections = its_baser_nr_entries(reg);
> + memset(its->coll_table, 0xff,
> + its->max_collections * sizeof(uint16_t));
> + }
> + else
> + {
> + unmap_guest_pages(its->coll_table,
> + its_baser_table_size(reg) >> PAGE_SHIFT);
> + its->max_collections = 0;
> + }
> + its->baser1 = reg;
> + return 1;
> + case VRANGE64(GITS_BASER2, GITS_BASER7):
> + goto write_ignore_64;
> + default:
> + gdprintk(XENLOG_G_WARNING, "ITS: unhandled ITS register 0x%lx\n",
> + info->gpa & 0xffff);
> + return 0;
> + }
> +
> + return 1;
> +
> +write_ignore_64:
> + if ( ! vgic_reg64_check_access(info->dabt) ) goto bad_width;
> + return 1;
> +
> +write_ignore_32:
> + if ( info->dabt.size != DABT_WORD ) goto bad_width;
> + return 1;
> +
> +bad_width:
> + printk(XENLOG_G_ERR "%pv vGICR: bad read width %d r%d offset %#08lx\n",
> + v, info->dabt.size, info->dabt.reg, info->gpa & 0xffff);
> +
> + domain_crash_synchronous();
> +
> + return 0;
> +}
> +
> +static const struct mmio_handler_ops vgic_its_mmio_handler = {
> + .read = vgic_v3_its_mmio_read,
> + .write = vgic_v3_its_mmio_write,
> +};
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
> index 8fe8386..aa53a1e 100644
> --- a/xen/arch/arm/vgic-v3.c
> +++ b/xen/arch/arm/vgic-v3.c
> @@ -158,15 +158,6 @@ static void vgic_store_irouter(struct domain *d, struct vgic_irq_rank *rank,
> rank->vcpu[offset] = new_vcpu->vcpu_id;
> }
>
> -static inline bool vgic_reg64_check_access(struct hsr_dabt dabt)
> -{
> - /*
> - * 64 bits registers can be accessible using 32-bit and 64-bit unless
> - * stated otherwise (See 8.1.3 ARM IHI 0069A).
> - */
> - return ( dabt.size == DABT_DOUBLE_WORD || dabt.size == DABT_WORD );
> -}
> -
> static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
> uint32_t gicr_reg,
> register_t *r)
> diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
> index da5fb77..6a91f5b 100644
> --- a/xen/include/asm-arm/gic_v3_defs.h
> +++ b/xen/include/asm-arm/gic_v3_defs.h
> @@ -147,6 +147,16 @@
> #define LPI_PROP_RES1 (1 << 1)
> #define LPI_PROP_ENABLED (1 << 0)
>
> +/*
> + * PIDR2: Only bits[7:4] are not implementation defined. We are
> + * emulating a GICv3 ([7:4] = 0x3).
> + *
> + * We don't emulate a specific registers scheme so implement the others
> + * bits as RES0 as recommended by the spec (see 8.1.13 in ARM IHI 0069A).
> + */
> +#define GICV3_GICD_PIDR2 0x30
> +#define GICV3_GICR_PIDR2 GICV3_GICD_PIDR2
> +
> #define GICH_VMCR_EOI (1 << 9)
> #define GICH_VMCR_VENG1 (1 << 1)
>
> @@ -190,6 +200,15 @@ struct rdist_region {
> bool single_rdist;
> };
>
> +/*
> + * 64 bits registers can be accessible using 32-bit and 64-bit unless
> + * stated otherwise (See 8.1.3 ARM IHI 0069A).
> + */
> +static inline bool vgic_reg64_check_access(struct hsr_dabt dabt)
> +{
> + return ( dabt.size == DABT_DOUBLE_WORD || dabt.size == DABT_WORD );
> +}
> +
> #endif /* __ASM_ARM_GIC_V3_DEFS_H__ */
>
> /*
> --
> 2.9.0
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply
* Re: [PATCH v7 11/17] ref-filter: introduce symref_atom_parser() and refname_atom_parser()
From: Jacob Keller @ 2016-11-08 23:52 UTC (permalink / raw)
To: Karthik Nayak; +Cc: Git mailing list
In-Reply-To: <20161108201211.25213-12-Karthik.188@gmail.com>
On Tue, Nov 8, 2016 at 12:12 PM, Karthik Nayak <karthik.188@gmail.com> wrote:
> From: Karthik Nayak <karthik.188@gmail.com>
>
> Using refname_atom_parser_internal(), introduce symref_atom_parser() and
> refname_atom_parser() which will parse the atoms %(symref) and
> %(refname) respectively. Store the parsed information into the
> 'used_atom' structure based on the modifiers used along with the atoms.
>
> Now the '%(symref)' atom supports the ':strip' atom modifier. Update the
> Documentation and tests to reflect this.
>
One minor nit is that the first part is actually identical so I wonder
if it's worth having two separate functions?
Thanks,
Jake
> Helped-by: Jeff King <peff@peff.net>
> Signed-off-by: Karthik Nayak <Karthik.188@gmail.com>
> ---
> Documentation/git-for-each-ref.txt | 5 +++
> ref-filter.c | 78 ++++++++++++++++++++++----------------
> t/t6300-for-each-ref.sh | 9 +++++
> 3 files changed, 59 insertions(+), 33 deletions(-)
>
> diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
> index 3953431..a669a32 100644
> --- a/Documentation/git-for-each-ref.txt
> +++ b/Documentation/git-for-each-ref.txt
> @@ -166,6 +166,11 @@ if::
> the value between the %(if:...) and %(then) atoms with the
> given string.
>
> +symref::
> + The ref which the given symbolic ref refers to. If not a
> + symbolic ref, nothing is printed. Respects the `:short` and
> + `:strip` options in the same way as `refname` above.
> +
> In addition to the above, for commit and tag objects, the header
> field names (`tree`, `parent`, `object`, `type`, and `tag`) can
> be used to specify the value in the header field.
> diff --git a/ref-filter.c b/ref-filter.c
> index aad537d..f1d27b5 100644
> --- a/ref-filter.c
> +++ b/ref-filter.c
> @@ -176,6 +176,16 @@ static void objectname_atom_parser(struct used_atom *atom, const char *arg)
> die(_("unrecognized %%(objectname) argument: %s"), arg);
> }
>
> +static void symref_atom_parser(struct used_atom *atom, const char *arg)
> +{
> + return refname_atom_parser_internal(&atom->u.refname, arg, atom->name);
> +}
> +
> +static void refname_atom_parser(struct used_atom *atom, const char *arg)
> +{
> + return refname_atom_parser_internal(&atom->u.refname, arg, atom->name);
> +}
> +
What's the reasoning for using separate functions here if they are
exactly identical except for name? Do we intend to add separate
options for this? I don't really have a problem with separate
functions here since it helps avoid confusion but they are identical
otherwise...
> static align_type parse_align_position(const char *s)
> {
> if (!strcmp(s, "right"))
> @@ -244,7 +254,7 @@ static struct {
> cmp_type cmp_type;
> void (*parser)(struct used_atom *atom, const char *arg);
> } valid_atom[] = {
> - { "refname" },
> + { "refname" , FIELD_STR, refname_atom_parser },
> { "objecttype" },
> { "objectsize", FIELD_ULONG },
> { "objectname", FIELD_STR, objectname_atom_parser },
> @@ -273,7 +283,7 @@ static struct {
> { "contents", FIELD_STR, contents_atom_parser },
> { "upstream", FIELD_STR, remote_ref_atom_parser },
> { "push", FIELD_STR, remote_ref_atom_parser },
> - { "symref" },
> + { "symref", FIELD_STR, symref_atom_parser },
> { "flag" },
> { "HEAD" },
> { "color", FIELD_STR, color_atom_parser },
> @@ -1058,21 +1068,16 @@ static inline char *copy_advance(char *dst, const char *src)
> return dst;
> }
>
> -static const char *strip_ref_components(const char *refname, const char *nr_arg)
> +static const char *strip_ref_components(const char *refname, unsigned int len)
> {
> - char *end;
> - long nr = strtol(nr_arg, &end, 10);
> - long remaining = nr;
> + long remaining = len;
> const char *start = refname;
>
> - if (nr < 1 || *end != '\0')
> - die(_(":strip= requires a positive integer argument"));
> -
> while (remaining) {
> switch (*start++) {
> case '\0':
> - die(_("ref '%s' does not have %ld components to :strip"),
> - refname, nr);
> + die(_("ref '%s' does not have %ud components to :strip"),
> + refname, len);
> case '/':
> remaining--;
> break;
> @@ -1081,6 +1086,16 @@ static const char *strip_ref_components(const char *refname, const char *nr_arg)
> return start;
> }
>
> +static const char *show_ref(struct refname_atom *atom, const char *refname)
> +{
> + if (atom->option == R_SHORT)
> + return shorten_unambiguous_ref(refname, warn_ambiguous_refs);
> + else if (atom->option == R_STRIP)
> + return strip_ref_components(refname, atom->strip);
> + else
> + return refname;
> +}
> +
> static void fill_remote_ref_details(struct used_atom *atom, const char *refname,
> struct branch *branch, const char **s)
> {
> @@ -1153,6 +1168,21 @@ char *get_head_description(void)
> return strbuf_detach(&desc, NULL);
> }
>
> +static const char *get_symref(struct used_atom *atom, struct ref_array_item *ref)
> +{
> + if (!ref->symref)
> + return "";
> + else
> + return show_ref(&atom->u.refname, ref->symref);
> +}
> +
> +static const char *get_refname(struct used_atom *atom, struct ref_array_item *ref)
> +{
> + if (ref->kind & FILTER_REFS_DETACHED_HEAD)
> + return get_head_description();
> + return show_ref(&atom->u.refname, ref->refname);
> +}
> +
> /*
> * Parse the object referred by ref, and grab needed value.
> */
> @@ -1181,7 +1211,6 @@ static void populate_value(struct ref_array_item *ref)
> struct atom_value *v = &ref->value[i];
> int deref = 0;
> const char *refname;
> - const char *formatp;
> struct branch *branch = NULL;
>
> v->handler = append_atom;
> @@ -1192,12 +1221,10 @@ static void populate_value(struct ref_array_item *ref)
> name++;
> }
>
> - if (starts_with(name, "refname")) {
> - refname = ref->refname;
> - if (ref->kind & FILTER_REFS_DETACHED_HEAD)
> - refname = get_head_description();
> - } else if (starts_with(name, "symref"))
> - refname = ref->symref ? ref->symref : "";
> + if (starts_with(name, "refname"))
> + refname = get_refname(atom, ref);
> + else if (starts_with(name, "symref"))
> + refname = get_symref(atom, ref);
> else if (starts_with(name, "upstream")) {
> const char *branch_name;
> /* only local branches may have an upstream */
> @@ -1273,21 +1300,6 @@ static void populate_value(struct ref_array_item *ref)
> } else
> continue;
>
> - formatp = strchr(name, ':');
> - if (formatp) {
> - const char *arg;
> -
> - formatp++;
> - if (!strcmp(formatp, "short"))
> - refname = shorten_unambiguous_ref(refname,
> - warn_ambiguous_refs);
> - else if (skip_prefix(formatp, "strip=", &arg))
> - refname = strip_ref_components(refname, arg);
> - else
> - die(_("unknown %.*s format %s"),
> - (int)(formatp - name), name, formatp);
> - }
> -
> if (!deref)
> v->s = refname;
> else
> diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
> index b06ea1c..3d28234 100755
> --- a/t/t6300-for-each-ref.sh
> +++ b/t/t6300-for-each-ref.sh
> @@ -589,4 +589,13 @@ test_expect_success 'Verify usage of %(symref:short) atom' '
> test_cmp expected actual
> '
>
> +cat >expected <<EOF
> +master
> +EOF
> +
> +test_expect_success 'Verify usage of %(symref:strip) atom' '
> + git for-each-ref --format="%(symref:strip=2)" refs/heads/sym > actual &&
> + test_cmp expected actual
> +'
> +
> test_done
> --
> 2.10.2
>
^ permalink raw reply
* Re: [PATCH v3 1/2] memcg: Prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB
From: Christoph Lameter @ 2016-11-08 23:51 UTC (permalink / raw)
To: Andrew Morton
Cc: Thomas Garnier, Pekka Enberg, David Rientjes, Joonsoo Kim,
Linux-MM, LKML, Greg Thelen, Vladimir Davydov, Michal Hocko
In-Reply-To: <20161107144931.edcf151a04f1af6d230b8a8a@linux-foundation.org>
On Mon, 7 Nov 2016, Andrew Morton wrote:
> > I will add more details and send another round.
>
> Please simply send the additional changelog text in this thread -
> processing an entire v4 patch just for a changelog fiddle is rather
> heavyweight.
I think this patch is good for future cleanup. We have had a case here
where an internal flag was passed to kmem_cache_create that caused issues
later. This should not happen. We need to guard against this in the
future.
Acked-by: Christoph Lameter <cl@linux.com>
^ permalink raw reply
* Re: [PATCH v3 1/2] memcg: Prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB
From: Christoph Lameter @ 2016-11-08 23:51 UTC (permalink / raw)
To: Andrew Morton
Cc: Thomas Garnier, Pekka Enberg, David Rientjes, Joonsoo Kim,
Linux-MM, LKML, Greg Thelen, Vladimir Davydov, Michal Hocko
In-Reply-To: <20161107144931.edcf151a04f1af6d230b8a8a@linux-foundation.org>
On Mon, 7 Nov 2016, Andrew Morton wrote:
> > I will add more details and send another round.
>
> Please simply send the additional changelog text in this thread -
> processing an entire v4 patch just for a changelog fiddle is rather
> heavyweight.
I think this patch is good for future cleanup. We have had a case here
where an internal flag was passed to kmem_cache_create that caused issues
later. This should not happen. We need to guard against this in the
future.
Acked-by: Christoph Lameter <cl@linux.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [RESEND][PATCH v4] cgroup: Use CAP_SYS_RESOURCE to allow a process to migrate other tasks between cgroups
From: Andy Lutomirski @ 2016-11-08 23:51 UTC (permalink / raw)
To: John Stultz, Alexei Starovoitov, Mickaël Salaün,
Daniel Mack, David S. Miller, kafai, fw, Harald Hoyer,
Network Development, Sargun Dhillon, Pablo Neira Ayuso
Cc: lkml, Tejun Heo, Li Zefan, Jonathan Corbet,
open list:CONTROL GROUP (CGROUP), Android Kernel Team,
Rom Lemarchand, Colin Cross, Dmitry Shmidt, Todd Kjos,
Christian Poetzsch, Amit Pundir, Dmitry Torokhov, Kees Cook,
Serge E . Hallyn, Linux API
In-Reply-To: <1478647728-30357-1-git-send-email-john.stultz@linaro.org>
On Tue, Nov 8, 2016 at 3:28 PM, John Stultz <john.stultz@linaro.org> wrote:
> This patch adds logic to allows a process to migrate other tasks
> between cgroups if they have CAP_SYS_RESOURCE.
>
> In Android (where this feature originated), the ActivityManager tracks
> various application states (TOP_APP, FOREGROUND, BACKGROUND, SYSTEM,
> etc), and then as applications change states, the SchedPolicy logic
> will migrate the application tasks between different cgroups used
> to control the different application states (for example, there is a
> background cpuset cgroup which can limit background tasks to stay
> on one low-power cpu, and the bg_non_interactive cpuctrl cgroup can
> then further limit those background tasks to a small percentage of
> that one cpu's cpu time).
>
> However, for security reasons, Android doesn't want to make the
> system_server (the process that runs the ActivityManager and
> SchedPolicy logic), run as root. So in the Android common.git
> kernel, they have some logic to allow cgroups to loosen their
> permissions so CAP_SYS_NICE tasks can migrate other tasks between
> cgroups.
>
> I feel the approach taken there overloads CAP_SYS_NICE a bit much
> for non-android environments.
>
> So this patch, as suggested by Michael Kerrisk, simply adds a
> check for CAP_SYS_RESOURCE.
>
> I've tested this with AOSP master, and this seems to work well
> as Zygote and system_server already use CAP_SYS_RESOURCE. I've
> also submitted patches against the android-4.4 kernel to change
> it to use CAP_SYS_RESOURCE, and the Android developers just merged
> it.
>
I hate to say it, but I think I may see a problem. Current
developments are afoot to make cgroups do more than resource control.
For example, there's Landlock and there's Daniel's ingress/egress
filter thing. Current cgroup controllers can mostly just DoS their
controlled processes. These new controllers (or controller-like
things) can exfiltrate data and change semantics.
Does anyone have a security model in mind for these controllers and
the cgroups that they're attached to? I'm reasonably confident that
CAP_SYS_RESOURCE is not the answer...
^ permalink raw reply
* RE: [PATCH v2 1/2] Staging: fsl-mc: include: mc-bus: Kernel type 's16' preferred over 'int16_t'
From: Stuart Yoder @ 2016-11-08 23:51 UTC (permalink / raw)
To: Shiva Kerdel
Cc: gregkh@linuxfoundation.org, German.Rivera@freescale.com,
German Rivera, treding@nvidia.com, itai.katz@nxp.com, Nipun Gupta,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org
In-Reply-To: <20161108154214.16243-1-shiva@exdev.nl>
> -----Original Message-----
> From: Shiva Kerdel [mailto:shiva@exdev.nl]
> Sent: Tuesday, November 08, 2016 9:42 AM
> To: Stuart Yoder <stuart.yoder@nxp.com>
> Cc: gregkh@linuxfoundation.org; German.Rivera@freescale.com; German Rivera <german.rivera@nxp.com>;
> treding@nvidia.com; itai.katz@nxp.com; Nipun Gupta <nipun.gupta@nxp.com>; linux-kernel@vger.kernel.org;
> devel@driverdev.osuosl.org; Shiva Kerdel <shiva@exdev.nl>
> Subject: [PATCH v2 1/2] Staging: fsl-mc: include: mc-bus: Kernel type 's16' preferred over 'int16_t'
>
> Follow the kernel type preferrences of using 's16' over 'int16_t'.
>
> Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
> ---
> drivers/staging/fsl-mc/include/mc-bus.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/fsl-mc/include/mc-bus.h b/drivers/staging/fsl-mc/include/mc-bus.h
> index e915574..c7cad87 100644
> --- a/drivers/staging/fsl-mc/include/mc-bus.h
> +++ b/drivers/staging/fsl-mc/include/mc-bus.h
> @@ -42,8 +42,8 @@ struct msi_domain_info;
> */
> struct fsl_mc_resource_pool {
> enum fsl_mc_pool_type type;
> - int16_t max_count;
> - int16_t free_count;
> + s16 max_count;
> + s16 free_count;
> struct mutex mutex; /* serializes access to free_list */
> struct list_head free_list;
> struct fsl_mc_bus *mc_bus;
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
^ permalink raw reply
* Re: [PATCH 2/4] ath10k: Add support to update btcoex priority value via nl80211
From: kbuild test robot @ 2016-11-08 23:49 UTC (permalink / raw)
To: c_traja; +Cc: tamizhchelvam, linux-wireless, kbuild-all, ath10k
In-Reply-To: <1478617354-28146-3-git-send-email-c_traja@qti.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 8521 bytes --]
Hi Tamizh,
[auto build test ERROR on ath6kl/ath-next]
[cannot apply to v4.9-rc4 next-20161108]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/c_traja-qti-qualcomm-com/ath10k-Add-support-for-BTCOEX-feature/20161109-043718
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa
All error/warnings (new ones prefixed by >>):
>> drivers/net/wireless/ath/ath10k/mac.c:7508:35: warning: 'struct cfg80211_btcoex_priority' declared inside parameter list
ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
^
>> drivers/net/wireless/ath/ath10k/mac.c:7508:35: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_get_btcoex_prio':
>> drivers/net/wireless/ath/ath10k/mac.c:7512:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_be_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7513:18: error: 'WIPHY_WLAN_BE_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BE_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7513:18: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/wireless/ath/ath10k/mac.c:7515:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_bk_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7516:18: error: 'WIPHY_WLAN_BK_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BK_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7518:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_vi_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7519:18: error: 'WIPHY_WLAN_VI_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_VI_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7521:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_vo_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7522:18: error: 'WIPHY_WLAN_VO_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_VO_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7524:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_beacon_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7525:18: error: 'WIPHY_WLAN_BEACON_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BEACON_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7527:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_mgmt_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7528:18: error: 'WIPHY_WLAN_MGMT_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_MGMT_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c: At top level:
drivers/net/wireless/ath/ath10k/mac.c:7534:11: warning: 'struct cfg80211_btcoex_priority' declared inside parameter list
struct cfg80211_btcoex_priority *btcoex_priority)
^
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_op_set_btcoex_priority':
>> drivers/net/wireless/ath/ath10k/mac.c:7553:16: warning: passing argument 1 of 'ath10k_mac_get_btcoex_prio' from incompatible pointer type
btcoex_prio = ath10k_mac_get_btcoex_prio(btcoex_priority);
^
drivers/net/wireless/ath/ath10k/mac.c:7508:1: note: expected 'struct cfg80211_btcoex_priority *' but argument is of type 'struct cfg80211_btcoex_priority *'
ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
^
drivers/net/wireless/ath/ath10k/mac.c: At top level:
drivers/net/wireless/ath/ath10k/mac.c:7611:2: error: unknown field 'set_btcoex' specified in initializer
.set_btcoex = ath10k_mac_op_set_btcoex,
^
drivers/net/wireless/ath/ath10k/mac.c:7611:2: warning: initialization from incompatible pointer type
drivers/net/wireless/ath/ath10k/mac.c:7611:2: warning: (near initialization for 'ath10k_ops.reconfig_complete')
drivers/net/wireless/ath/ath10k/mac.c:7612:2: error: unknown field 'set_btcoex_priority' specified in initializer
.set_btcoex_priority = ath10k_mac_op_set_btcoex_priority,
^
drivers/net/wireless/ath/ath10k/mac.c:7612:2: warning: initialization from incompatible pointer type
drivers/net/wireless/ath/ath10k/mac.c:7612:2: warning: (near initialization for 'ath10k_ops.ipv6_addr_change')
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_register':
drivers/net/wireless/ath/ath10k/mac.c:8203:16: error: 'struct wiphy' has no member named 'btcoex_support_flags'
ar->hw->wiphy->btcoex_support_flags =
^
drivers/net/wireless/ath/ath10k/mac.c:8204:4: error: 'WIPHY_WLAN_BE_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BE_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8205:4: error: 'WIPHY_WLAN_BK_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BK_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8206:4: error: 'WIPHY_WLAN_VI_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_VI_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8207:4: error: 'WIPHY_WLAN_VO_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_VO_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8208:4: error: 'WIPHY_WLAN_BEACON_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BEACON_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8209:4: error: 'WIPHY_WLAN_MGMT_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_MGMT_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:8211:20: error: 'struct wiphy' has no member named 'btcoex_support_flags'
ar->hw->wiphy->btcoex_support_flags);
^
vim +7512 drivers/net/wireless/ath/ath10k/mac.c
7502 mutex_unlock(&ar->conf_mutex);
7503
7504 return ret;
7505 }
7506
7507 u32
> 7508 ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
7509 {
7510 u32 btcoex_prio = 0;
7511
> 7512 if (btcoex_priority->wlan_be_preferred)
7513 btcoex_prio |= WIPHY_WLAN_BE_PREFERRED;
7514
7515 if (btcoex_priority->wlan_bk_preferred)
7516 btcoex_prio |= WIPHY_WLAN_BK_PREFERRED;
7517
7518 if (btcoex_priority->wlan_vi_preferred)
7519 btcoex_prio |= WIPHY_WLAN_VI_PREFERRED;
7520
7521 if (btcoex_priority->wlan_vo_preferred)
7522 btcoex_prio |= WIPHY_WLAN_VO_PREFERRED;
7523
7524 if (btcoex_priority->wlan_beacon_preferred)
7525 btcoex_prio |= WIPHY_WLAN_BEACON_PREFERRED;
7526
7527 if (btcoex_priority->wlan_mgmt_preferred)
> 7528 btcoex_prio |= WIPHY_WLAN_MGMT_PREFERRED;
7529
7530 return btcoex_prio;
7531 }
7532
7533 static int ath10k_mac_op_set_btcoex_priority(struct ieee80211_hw *hw,
7534 struct cfg80211_btcoex_priority *btcoex_priority)
7535 {
7536 u32 btcoex_prio;
7537 struct ath10k *ar = hw->priv;
7538 int ret;
7539
7540 if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags))) {
7541 ret = -EINVAL;
7542 goto exit;
7543 }
7544
7545 mutex_lock(&ar->conf_mutex);
7546
7547 if (ar->state != ATH10K_STATE_ON &&
7548 ar->state != ATH10K_STATE_RESTARTED) {
7549 ret = -ENETDOWN;
7550 goto exit;
7551 }
7552
> 7553 btcoex_prio = ath10k_mac_get_btcoex_prio(btcoex_priority);
7554
7555 if (btcoex_prio > 0x3f)
7556 return -E2BIG;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 46112 bytes --]
[-- Attachment #3: Type: text/plain, Size: 146 bytes --]
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply
* [U-Boot] U-Boot overlaps BSS and initrd on arm64
From: Will Deacon @ 2016-11-08 23:50 UTC (permalink / raw)
To: u-boot
In-Reply-To: <20161108194730.GF6637@bill-the-cat>
On Tue, Nov 08, 2016 at 02:47:30PM -0500, Tom Rini wrote:
> On Tue, Nov 08, 2016 at 07:34:34PM +0000, Will Deacon wrote:
> > On Tue, Nov 08, 2016 at 01:04:40PM -0500, Tom Rini wrote:
> > > On Tue, Nov 08, 2016 at 06:01:42PM +0000, Will Deacon wrote:
> > > > On Tue, Nov 08, 2016 at 12:51:44PM -0500, Tom Rini wrote:
> > > > > On Tue, Nov 08, 2016 at 09:41:13AM -0800, Dmitry Vyukov wrote:
> > > > > > Hello,
> > > > > >
> > > > > > We've got a boot problem on arm64 devices. Here is boot log:
> > > > > > https://storage.kernelci.org/mainline/v4.9-rc4/arm64-defconfig+CONFIG_KASAN=y/lab-baylibre-seattle/boot-juno-r2.txt
> > > > > > https://kernelci.org/boot/id/581ece5a59b514e448f03bd7/
> > > > > >
> > > > > > Here is some debugging that Andrey and Mark did:
> > > > > >
> > > > > > On Tue, Nov 8, 2016 at 2:00 AM, Andrey Ryabinin wrote:
> > > > > > > I've looked at juno-r2: https://kernelci.org/boot/id/581ece5a59b514e448f03bd7/
> > > > > > > So we have
> > > > > > > Dtb address 0x81f00000
> > > > > > > Load address 0x80000000
> > > > > > > Which gives us 31Mb for kernel.
> > > > > > >
> > > > > > > It says that Kernel image is 24.62 MiB, but that's without BSS.
> > > > > > > If bss is big enough it might overwrite dtb.
> > > > > > > And indeed, build details -
> > > > > > > https://kernelci.org/build/id/581e850959b514e564f03bdc/
> > > > > > > shows that bss is 8.5 Mb which is enough to overlap with dtb.
> > > > > >
> > > > > > On Tue, Nov 8, 2016 at 3:21 AM, Mark Rutland wrote:
> > > > > > > FWIW, since v3.17 we've had an image_size field in the arm64 Image
> > > > > > > header which describes the "real" size of the Image, BSS included. See
> > > > > > > [1,2].
> > > > > > > It should be possible to modify U-Boot to use that to automatically
> > > > > > > place the DTB and initrd at non-clashing locations (or at least to
> > > > > > > expose the value somehow).
> > > > > > > I had assumed U-Boot already did that, but it doesn't seem to be the
> > > > > > > case.
> > > > >
> > > > > Yes, we've supported the image_size field since v2016.07 and that board
> > > > > is running v2016.01. Unfortunately the booting.txt changes that added
> > > > > the image_size field weren't publicized widely so we didn't see it until
> > > > > someone else ran into the problem you're describing.
> > > >
> > > > Hmm, that's a good point. If you like, I could add something to that file
> > > > asking for all changes to CC the u-boot list? We should probably do the
> > > > same for edk2.
> > >
> > > That would be nice, sure. I was even thinking that something like the
> > > cross-distro or boot-architecture lists that linaro runs would have had
> > > this info go by as well. Thanks!
> >
> > D'oh, the u-boot list seems to be subscriber-only, so I'm not going to make
> > a whole lot of friends if I ask kernel devs to add it to cc.
>
> Ah yes. So boot-architecture is probably best.
This list: https://lists.linaro.org/pipermail/boot-architecture/ ?
I was about to point out that there have only been 11 posts there in the last
four months, but then I saw the "2015" part :/
Will
^ permalink raw reply
* Re: [PATCH v4 1/5] arm64: perf: Basic uncore counter support for Cavium ThunderX SOC
From: Will Deacon @ 2016-11-08 23:50 UTC (permalink / raw)
To: Jan Glauber; +Cc: Mark Rutland, linux-kernel, linux-arm-kernel
In-Reply-To: <73173d6ad2430eead5e9da40564a90a60961b6d9.1477741719.git.jglauber@cavium.com>
Hi Jan,
Thanks for posting an updated series. I have a few minor comments, which
we can hopefully address in time for 4.10.
Also, have you run the perf fuzzer with this series applied?
https://github.com/deater/perf_event_tests
(build the tests and look under the fuzzer/ directory for the tool)
On Sat, Oct 29, 2016 at 01:55:29PM +0200, Jan Glauber wrote:
> Provide "uncore" facilities for different non-CPU performance
> counter units.
>
> The uncore PMUs can be found under /sys/bus/event_source/devices.
> All counters are exported via sysfs in the corresponding events
> files under the PMU directory so the perf tool can list the event names.
>
> There are some points that are special in this implementation:
>
> 1) The PMU detection relies on PCI device detection. If a
> matching PCI device is found the PMU is created. The code can deal
> with multiple units of the same type, e.g. more than one memory
> controller.
>
> 2) Counters are summarized across different units of the same type
> on one NUMA node but not across NUMA nodes.
> For instance L2C TAD 0..7 are presented as a single counter
> (adding the values from TAD 0 to 7). Although losing the ability
> to read a single value the merged values are easier to use.
>
> 3) The counters are not CPU related. A random CPU is picked regardless
> of the NUMA node. There is a small performance penalty for accessing
> counters on a remote note but reading a performance counter is a
> slow operation anyway.
>
> Signed-off-by: Jan Glauber <jglauber@cavium.com>
> ---
> drivers/perf/Kconfig | 13 ++
> drivers/perf/Makefile | 1 +
> drivers/perf/uncore/Makefile | 1 +
> drivers/perf/uncore/uncore_cavium.c | 351 ++++++++++++++++++++++++++++++++++++
> drivers/perf/uncore/uncore_cavium.h | 71 ++++++++
We already have "uncore" PMUs under drivers/perf, so I'd prefer that we
renamed this a bit to reflect better what's going on. How about:
drivers/perf/cavium/
and then
drivers/perf/cavium/uncore_thunder.[ch]
?
> include/linux/cpuhotplug.h | 1 +
> 6 files changed, 438 insertions(+)
> create mode 100644 drivers/perf/uncore/Makefile
> create mode 100644 drivers/perf/uncore/uncore_cavium.c
> create mode 100644 drivers/perf/uncore/uncore_cavium.h
>
> diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
> index 4d5c5f9..3266c87 100644
> --- a/drivers/perf/Kconfig
> +++ b/drivers/perf/Kconfig
> @@ -19,4 +19,17 @@ config XGENE_PMU
> help
> Say y if you want to use APM X-Gene SoC performance monitors.
>
> +config UNCORE_PMU
> + bool
This isn't needed.
> +
> +config UNCORE_PMU_CAVIUM
> + depends on PERF_EVENTS && NUMA && ARM64
> + bool "Cavium uncore PMU support"
Please mentioned Thunder somewhere, since that's the SoC being supported.
> + select UNCORE_PMU
> + default y
> + help
> + Say y if you want to access performance counters of subsystems
> + on a Cavium SOC like cache controller, memory controller or
> + processor interconnect.
> +
> endmenu
> diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile
> index b116e98..d6c02c9 100644
> --- a/drivers/perf/Makefile
> +++ b/drivers/perf/Makefile
> @@ -1,2 +1,3 @@
> obj-$(CONFIG_ARM_PMU) += arm_pmu.o
> obj-$(CONFIG_XGENE_PMU) += xgene_pmu.o
> +obj-y += uncore/
> diff --git a/drivers/perf/uncore/Makefile b/drivers/perf/uncore/Makefile
> new file mode 100644
> index 0000000..6130e18
> --- /dev/null
> +++ b/drivers/perf/uncore/Makefile
> @@ -0,0 +1 @@
> +obj-$(CONFIG_UNCORE_PMU_CAVIUM) += uncore_cavium.o
> diff --git a/drivers/perf/uncore/uncore_cavium.c b/drivers/perf/uncore/uncore_cavium.c
> new file mode 100644
> index 0000000..a7b4277
> --- /dev/null
> +++ b/drivers/perf/uncore/uncore_cavium.c
> @@ -0,0 +1,351 @@
> +/*
> + * Cavium Thunder uncore PMU support.
> + *
> + * Copyright (C) 2015,2016 Cavium Inc.
> + * Author: Jan Glauber <jan.glauber@cavium.com>
> + */
> +
> +#include <linux/cpufeature.h>
> +#include <linux/numa.h>
> +#include <linux/slab.h>
> +
> +#include "uncore_cavium.h"
> +
> +/*
> + * Some notes about the various counters supported by this "uncore" PMU
> + * and the design:
> + *
> + * All counters are 64 bit long.
> + * There are no overflow interrupts.
> + * Counters are summarized per node/socket.
> + * Most devices appear as separate PCI devices per socket with the exception
> + * of OCX TLK which appears as one PCI device per socket and contains several
> + * units with counters that are merged.
> + * Some counters are selected via a control register (L2C TAD) and read by
> + * a number of counter registers, others (L2C CBC, LMC & OCX TLK) have
> + * one dedicated counter per event.
> + * Some counters are not stoppable (L2C CBC & LMC).
> + * Some counters are read-only (LMC).
> + * All counters belong to PCI devices, the devices may have additional
> + * drivers but we assume we are the only user of the counter registers.
> + * We map the whole PCI BAR so we must be careful to forbid access to
> + * addresses that contain neither counters nor counter control registers.
> + */
> +
> +void thunder_uncore_read(struct perf_event *event)
> +{
Rather than have a bunch of global symbols that are called from the
individual drivers, why don't you pass a struct of function pointers to
their respective init functions and keep the internals private?
> + struct thunder_uncore *uncore = to_uncore(event->pmu);
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + struct thunder_uncore_unit *unit;
> + u64 prev, delta, new = 0;
> +
> + node = get_node(hwc->config, uncore);
> +
> + /* read counter values from all units on the node */
> + list_for_each_entry(unit, &node->unit_list, entry)
> + new += readq(hwc->event_base + unit->map);
> +
> + prev = local64_read(&hwc->prev_count);
> + local64_set(&hwc->prev_count, new);
> + delta = new - prev;
> + local64_add(delta, &event->count);
> +}
> +
> +int thunder_uncore_add(struct perf_event *event, int flags, u64 config_base,
> + u64 event_base)
> +{
> + struct thunder_uncore *uncore = to_uncore(event->pmu);
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + int id;
> +
> + node = get_node(hwc->config, uncore);
> + id = get_id(hwc->config);
> +
> + if (!cmpxchg(&node->events[id], NULL, event))
> + hwc->idx = id;
Does this need to be a full-fat cmpxchg? Who are you racing with?
> +
> + if (hwc->idx == -1)
> + return -EBUSY;
This would be much clearer as an else statement after the cmpxchg.
> +
> + hwc->config_base = config_base;
> + hwc->event_base = event_base;
> + hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
> +
> + if (flags & PERF_EF_START)
> + uncore->pmu.start(event, PERF_EF_RELOAD);
> +
> + return 0;
> +}
> +
> +void thunder_uncore_del(struct perf_event *event, int flags)
> +{
> + struct thunder_uncore *uncore = to_uncore(event->pmu);
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + int i;
> +
> + event->pmu->stop(event, PERF_EF_UPDATE);
> +
> + /*
> + * For programmable counters we need to check where we installed it.
> + * To keep this function generic always test the more complicated
> + * case (free running counters won't need the loop).
> + */
> + node = get_node(hwc->config, uncore);
> + for (i = 0; i < node->num_counters; i++) {
> + if (cmpxchg(&node->events[i], event, NULL) == event)
> + break;
> + }
> + hwc->idx = -1;
> +}
> +
> +void thunder_uncore_start(struct perf_event *event, int flags)
> +{
> + struct thunder_uncore *uncore = to_uncore(event->pmu);
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + struct thunder_uncore_unit *unit;
> + u64 new = 0;
> +
> + /* read counter values from all units on the node */
> + node = get_node(hwc->config, uncore);
> + list_for_each_entry(unit, &node->unit_list, entry)
> + new += readq(hwc->event_base + unit->map);
> + local64_set(&hwc->prev_count, new);
> +
> + hwc->state = 0;
> + perf_event_update_userpage(event);
> +}
> +
> +void thunder_uncore_stop(struct perf_event *event, int flags)
> +{
> + struct hw_perf_event *hwc = &event->hw;
> +
> + hwc->state |= PERF_HES_STOPPED;
> +
> + if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) {
> + thunder_uncore_read(event);
> + hwc->state |= PERF_HES_UPTODATE;
> + }
> +}
> +
> +int thunder_uncore_event_init(struct perf_event *event)
> +{
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + struct thunder_uncore *uncore;
> +
> + if (event->attr.type != event->pmu->type)
> + return -ENOENT;
> +
> + /* we do not support sampling */
> + if (is_sampling_event(event))
> + return -EINVAL;
> +
> + /* counters do not have these bits */
> + if (event->attr.exclude_user ||
> + event->attr.exclude_kernel ||
> + event->attr.exclude_host ||
> + event->attr.exclude_guest ||
> + event->attr.exclude_hv ||
> + event->attr.exclude_idle)
> + return -EINVAL;
> +
> + uncore = to_uncore(event->pmu);
> + if (!uncore)
> + return -ENODEV;
> + if (!uncore->event_valid(event->attr.config & UNCORE_EVENT_ID_MASK))
> + return -EINVAL;
> +
> + /* check NUMA node */
> + node = get_node(event->attr.config, uncore);
> + if (!node) {
> + pr_debug("Invalid NUMA node selected\n");
> + return -EINVAL;
> + }
> +
> + hwc->config = event->attr.config;
> + hwc->idx = -1;
> + return 0;
> +}
> +
> +static ssize_t thunder_uncore_attr_show_cpumask(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct pmu *pmu = dev_get_drvdata(dev);
> + struct thunder_uncore *uncore =
> + container_of(pmu, struct thunder_uncore, pmu);
> +
> + return cpumap_print_to_pagebuf(true, buf, &uncore->active_mask);
> +}
> +static DEVICE_ATTR(cpumask, S_IRUGO, thunder_uncore_attr_show_cpumask, NULL);
> +
> +static struct attribute *thunder_uncore_attrs[] = {
> + &dev_attr_cpumask.attr,
> + NULL,
> +};
> +
> +struct attribute_group thunder_uncore_attr_group = {
> + .attrs = thunder_uncore_attrs,
> +};
> +
> +ssize_t thunder_events_sysfs_show(struct device *dev,
> + struct device_attribute *attr,
> + char *page)
> +{
> + struct perf_pmu_events_attr *pmu_attr =
> + container_of(attr, struct perf_pmu_events_attr, attr);
> +
> + if (pmu_attr->event_str)
> + return sprintf(page, "%s", pmu_attr->event_str);
> +
> + return 0;
> +}
> +
> +/* node attribute depending on number of NUMA nodes */
> +static ssize_t node_show(struct device *dev, struct device_attribute *attr,
> + char *page)
> +{
> + if (NODES_SHIFT)
> + return sprintf(page, "config:16-%d\n", 16 + NODES_SHIFT - 1);
If NODES_SHIFT is 1, you'll end up with "config:16-16", which might confuse
userspace.
> + else
> + return sprintf(page, "config:16\n");
> +}
> +
> +struct device_attribute format_attr_node = __ATTR_RO(node);
> +
> +/*
> + * Thunder uncore events are independent from CPUs. Provide a cpumask
> + * nevertheless to prevent perf from adding the event per-cpu and just
> + * set the mask to one online CPU. Use the same cpumask for all uncore
> + * devices.
> + *
> + * There is a performance penalty for accessing a device from a CPU on
> + * another socket, but we do not care (yet).
> + */
> +static int thunder_uncore_offline_cpu(unsigned int old_cpu, struct hlist_node *node)
> +{
> + struct thunder_uncore *uncore = hlist_entry_safe(node, struct thunder_uncore, node);
Why _safe?
> + int new_cpu;
> +
> + if (!cpumask_test_and_clear_cpu(old_cpu, &uncore->active_mask))
> + return 0;
> + new_cpu = cpumask_any_but(cpu_online_mask, old_cpu);
> + if (new_cpu >= nr_cpu_ids)
> + return 0;
> + perf_pmu_migrate_context(&uncore->pmu, old_cpu, new_cpu);
> + cpumask_set_cpu(new_cpu, &uncore->active_mask);
> + return 0;
> +}
> +
> +static struct thunder_uncore_node * __init alloc_node(struct thunder_uncore *uncore,
> + int node_id, int counters)
> +{
> + struct thunder_uncore_node *node;
> +
> + node = kzalloc(sizeof(*node), GFP_KERNEL);
> + if (!node)
> + return NULL;
> + node->num_counters = counters;
> + INIT_LIST_HEAD(&node->unit_list);
> + return node;
> +}
> +
> +int __init thunder_uncore_setup(struct thunder_uncore *uncore, int device_id,
> + struct pmu *pmu, int counters)
> +{
> + unsigned int vendor_id = PCI_VENDOR_ID_CAVIUM;
> + struct thunder_uncore_unit *unit, *tmp;
> + struct thunder_uncore_node *node;
> + struct pci_dev *pdev = NULL;
> + int ret, node_id, found = 0;
> +
> + /* detect PCI devices */
> + while ((pdev = pci_get_device(vendor_id, device_id, pdev))) {
Redundant brackets?
> + if (!pdev)
> + break;
Redundant check?
> + node_id = dev_to_node(&pdev->dev);
> +
> + /* allocate node if necessary */
> + if (!uncore->nodes[node_id])
> + uncore->nodes[node_id] = alloc_node(uncore, node_id, counters);
> +
> + node = uncore->nodes[node_id];
> + if (!node) {
> + ret = -ENOMEM;
> + goto fail;
> + }
> +
> + unit = kzalloc(sizeof(*unit), GFP_KERNEL);
> + if (!unit) {
> + ret = -ENOMEM;
> + goto fail;
> + }
> +
> + unit->pdev = pdev;
> + unit->map = ioremap(pci_resource_start(pdev, 0),
> + pci_resource_len(pdev, 0));
> + list_add(&unit->entry, &node->unit_list);
> + node->nr_units++;
> + found++;
> + }
> +
> + if (!found)
> + return -ENODEV;
> +
> + cpuhp_state_add_instance_nocalls(CPUHP_AP_UNCORE_CAVIUM_ONLINE,
> + &uncore->node);
> +
> + /*
> + * perf PMU is CPU dependent in difference to our uncore devices.
> + * Just pick a CPU and migrate away if it goes offline.
> + */
> + cpumask_set_cpu(smp_processor_id(), &uncore->active_mask);
> +
> + uncore->pmu = *pmu;
> + ret = perf_pmu_register(&uncore->pmu, uncore->pmu.name, -1);
> + if (ret)
> + goto fail;
> +
> + return 0;
> +
> +fail:
> + node_id = 0;
> + while (uncore->nodes[node_id]) {
> + node = uncore->nodes[node_id];
> +
> + list_for_each_entry_safe(unit, tmp, &node->unit_list, entry) {
Why do you need the _safe variant?
Will
^ permalink raw reply
* [PATCH v4 1/5] arm64: perf: Basic uncore counter support for Cavium ThunderX SOC
From: Will Deacon @ 2016-11-08 23:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <73173d6ad2430eead5e9da40564a90a60961b6d9.1477741719.git.jglauber@cavium.com>
Hi Jan,
Thanks for posting an updated series. I have a few minor comments, which
we can hopefully address in time for 4.10.
Also, have you run the perf fuzzer with this series applied?
https://github.com/deater/perf_event_tests
(build the tests and look under the fuzzer/ directory for the tool)
On Sat, Oct 29, 2016 at 01:55:29PM +0200, Jan Glauber wrote:
> Provide "uncore" facilities for different non-CPU performance
> counter units.
>
> The uncore PMUs can be found under /sys/bus/event_source/devices.
> All counters are exported via sysfs in the corresponding events
> files under the PMU directory so the perf tool can list the event names.
>
> There are some points that are special in this implementation:
>
> 1) The PMU detection relies on PCI device detection. If a
> matching PCI device is found the PMU is created. The code can deal
> with multiple units of the same type, e.g. more than one memory
> controller.
>
> 2) Counters are summarized across different units of the same type
> on one NUMA node but not across NUMA nodes.
> For instance L2C TAD 0..7 are presented as a single counter
> (adding the values from TAD 0 to 7). Although losing the ability
> to read a single value the merged values are easier to use.
>
> 3) The counters are not CPU related. A random CPU is picked regardless
> of the NUMA node. There is a small performance penalty for accessing
> counters on a remote note but reading a performance counter is a
> slow operation anyway.
>
> Signed-off-by: Jan Glauber <jglauber@cavium.com>
> ---
> drivers/perf/Kconfig | 13 ++
> drivers/perf/Makefile | 1 +
> drivers/perf/uncore/Makefile | 1 +
> drivers/perf/uncore/uncore_cavium.c | 351 ++++++++++++++++++++++++++++++++++++
> drivers/perf/uncore/uncore_cavium.h | 71 ++++++++
We already have "uncore" PMUs under drivers/perf, so I'd prefer that we
renamed this a bit to reflect better what's going on. How about:
drivers/perf/cavium/
and then
drivers/perf/cavium/uncore_thunder.[ch]
?
> include/linux/cpuhotplug.h | 1 +
> 6 files changed, 438 insertions(+)
> create mode 100644 drivers/perf/uncore/Makefile
> create mode 100644 drivers/perf/uncore/uncore_cavium.c
> create mode 100644 drivers/perf/uncore/uncore_cavium.h
>
> diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
> index 4d5c5f9..3266c87 100644
> --- a/drivers/perf/Kconfig
> +++ b/drivers/perf/Kconfig
> @@ -19,4 +19,17 @@ config XGENE_PMU
> help
> Say y if you want to use APM X-Gene SoC performance monitors.
>
> +config UNCORE_PMU
> + bool
This isn't needed.
> +
> +config UNCORE_PMU_CAVIUM
> + depends on PERF_EVENTS && NUMA && ARM64
> + bool "Cavium uncore PMU support"
Please mentioned Thunder somewhere, since that's the SoC being supported.
> + select UNCORE_PMU
> + default y
> + help
> + Say y if you want to access performance counters of subsystems
> + on a Cavium SOC like cache controller, memory controller or
> + processor interconnect.
> +
> endmenu
> diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile
> index b116e98..d6c02c9 100644
> --- a/drivers/perf/Makefile
> +++ b/drivers/perf/Makefile
> @@ -1,2 +1,3 @@
> obj-$(CONFIG_ARM_PMU) += arm_pmu.o
> obj-$(CONFIG_XGENE_PMU) += xgene_pmu.o
> +obj-y += uncore/
> diff --git a/drivers/perf/uncore/Makefile b/drivers/perf/uncore/Makefile
> new file mode 100644
> index 0000000..6130e18
> --- /dev/null
> +++ b/drivers/perf/uncore/Makefile
> @@ -0,0 +1 @@
> +obj-$(CONFIG_UNCORE_PMU_CAVIUM) += uncore_cavium.o
> diff --git a/drivers/perf/uncore/uncore_cavium.c b/drivers/perf/uncore/uncore_cavium.c
> new file mode 100644
> index 0000000..a7b4277
> --- /dev/null
> +++ b/drivers/perf/uncore/uncore_cavium.c
> @@ -0,0 +1,351 @@
> +/*
> + * Cavium Thunder uncore PMU support.
> + *
> + * Copyright (C) 2015,2016 Cavium Inc.
> + * Author: Jan Glauber <jan.glauber@cavium.com>
> + */
> +
> +#include <linux/cpufeature.h>
> +#include <linux/numa.h>
> +#include <linux/slab.h>
> +
> +#include "uncore_cavium.h"
> +
> +/*
> + * Some notes about the various counters supported by this "uncore" PMU
> + * and the design:
> + *
> + * All counters are 64 bit long.
> + * There are no overflow interrupts.
> + * Counters are summarized per node/socket.
> + * Most devices appear as separate PCI devices per socket with the exception
> + * of OCX TLK which appears as one PCI device per socket and contains several
> + * units with counters that are merged.
> + * Some counters are selected via a control register (L2C TAD) and read by
> + * a number of counter registers, others (L2C CBC, LMC & OCX TLK) have
> + * one dedicated counter per event.
> + * Some counters are not stoppable (L2C CBC & LMC).
> + * Some counters are read-only (LMC).
> + * All counters belong to PCI devices, the devices may have additional
> + * drivers but we assume we are the only user of the counter registers.
> + * We map the whole PCI BAR so we must be careful to forbid access to
> + * addresses that contain neither counters nor counter control registers.
> + */
> +
> +void thunder_uncore_read(struct perf_event *event)
> +{
Rather than have a bunch of global symbols that are called from the
individual drivers, why don't you pass a struct of function pointers to
their respective init functions and keep the internals private?
> + struct thunder_uncore *uncore = to_uncore(event->pmu);
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + struct thunder_uncore_unit *unit;
> + u64 prev, delta, new = 0;
> +
> + node = get_node(hwc->config, uncore);
> +
> + /* read counter values from all units on the node */
> + list_for_each_entry(unit, &node->unit_list, entry)
> + new += readq(hwc->event_base + unit->map);
> +
> + prev = local64_read(&hwc->prev_count);
> + local64_set(&hwc->prev_count, new);
> + delta = new - prev;
> + local64_add(delta, &event->count);
> +}
> +
> +int thunder_uncore_add(struct perf_event *event, int flags, u64 config_base,
> + u64 event_base)
> +{
> + struct thunder_uncore *uncore = to_uncore(event->pmu);
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + int id;
> +
> + node = get_node(hwc->config, uncore);
> + id = get_id(hwc->config);
> +
> + if (!cmpxchg(&node->events[id], NULL, event))
> + hwc->idx = id;
Does this need to be a full-fat cmpxchg? Who are you racing with?
> +
> + if (hwc->idx == -1)
> + return -EBUSY;
This would be much clearer as an else statement after the cmpxchg.
> +
> + hwc->config_base = config_base;
> + hwc->event_base = event_base;
> + hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
> +
> + if (flags & PERF_EF_START)
> + uncore->pmu.start(event, PERF_EF_RELOAD);
> +
> + return 0;
> +}
> +
> +void thunder_uncore_del(struct perf_event *event, int flags)
> +{
> + struct thunder_uncore *uncore = to_uncore(event->pmu);
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + int i;
> +
> + event->pmu->stop(event, PERF_EF_UPDATE);
> +
> + /*
> + * For programmable counters we need to check where we installed it.
> + * To keep this function generic always test the more complicated
> + * case (free running counters won't need the loop).
> + */
> + node = get_node(hwc->config, uncore);
> + for (i = 0; i < node->num_counters; i++) {
> + if (cmpxchg(&node->events[i], event, NULL) == event)
> + break;
> + }
> + hwc->idx = -1;
> +}
> +
> +void thunder_uncore_start(struct perf_event *event, int flags)
> +{
> + struct thunder_uncore *uncore = to_uncore(event->pmu);
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + struct thunder_uncore_unit *unit;
> + u64 new = 0;
> +
> + /* read counter values from all units on the node */
> + node = get_node(hwc->config, uncore);
> + list_for_each_entry(unit, &node->unit_list, entry)
> + new += readq(hwc->event_base + unit->map);
> + local64_set(&hwc->prev_count, new);
> +
> + hwc->state = 0;
> + perf_event_update_userpage(event);
> +}
> +
> +void thunder_uncore_stop(struct perf_event *event, int flags)
> +{
> + struct hw_perf_event *hwc = &event->hw;
> +
> + hwc->state |= PERF_HES_STOPPED;
> +
> + if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) {
> + thunder_uncore_read(event);
> + hwc->state |= PERF_HES_UPTODATE;
> + }
> +}
> +
> +int thunder_uncore_event_init(struct perf_event *event)
> +{
> + struct hw_perf_event *hwc = &event->hw;
> + struct thunder_uncore_node *node;
> + struct thunder_uncore *uncore;
> +
> + if (event->attr.type != event->pmu->type)
> + return -ENOENT;
> +
> + /* we do not support sampling */
> + if (is_sampling_event(event))
> + return -EINVAL;
> +
> + /* counters do not have these bits */
> + if (event->attr.exclude_user ||
> + event->attr.exclude_kernel ||
> + event->attr.exclude_host ||
> + event->attr.exclude_guest ||
> + event->attr.exclude_hv ||
> + event->attr.exclude_idle)
> + return -EINVAL;
> +
> + uncore = to_uncore(event->pmu);
> + if (!uncore)
> + return -ENODEV;
> + if (!uncore->event_valid(event->attr.config & UNCORE_EVENT_ID_MASK))
> + return -EINVAL;
> +
> + /* check NUMA node */
> + node = get_node(event->attr.config, uncore);
> + if (!node) {
> + pr_debug("Invalid NUMA node selected\n");
> + return -EINVAL;
> + }
> +
> + hwc->config = event->attr.config;
> + hwc->idx = -1;
> + return 0;
> +}
> +
> +static ssize_t thunder_uncore_attr_show_cpumask(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct pmu *pmu = dev_get_drvdata(dev);
> + struct thunder_uncore *uncore =
> + container_of(pmu, struct thunder_uncore, pmu);
> +
> + return cpumap_print_to_pagebuf(true, buf, &uncore->active_mask);
> +}
> +static DEVICE_ATTR(cpumask, S_IRUGO, thunder_uncore_attr_show_cpumask, NULL);
> +
> +static struct attribute *thunder_uncore_attrs[] = {
> + &dev_attr_cpumask.attr,
> + NULL,
> +};
> +
> +struct attribute_group thunder_uncore_attr_group = {
> + .attrs = thunder_uncore_attrs,
> +};
> +
> +ssize_t thunder_events_sysfs_show(struct device *dev,
> + struct device_attribute *attr,
> + char *page)
> +{
> + struct perf_pmu_events_attr *pmu_attr =
> + container_of(attr, struct perf_pmu_events_attr, attr);
> +
> + if (pmu_attr->event_str)
> + return sprintf(page, "%s", pmu_attr->event_str);
> +
> + return 0;
> +}
> +
> +/* node attribute depending on number of NUMA nodes */
> +static ssize_t node_show(struct device *dev, struct device_attribute *attr,
> + char *page)
> +{
> + if (NODES_SHIFT)
> + return sprintf(page, "config:16-%d\n", 16 + NODES_SHIFT - 1);
If NODES_SHIFT is 1, you'll end up with "config:16-16", which might confuse
userspace.
> + else
> + return sprintf(page, "config:16\n");
> +}
> +
> +struct device_attribute format_attr_node = __ATTR_RO(node);
> +
> +/*
> + * Thunder uncore events are independent from CPUs. Provide a cpumask
> + * nevertheless to prevent perf from adding the event per-cpu and just
> + * set the mask to one online CPU. Use the same cpumask for all uncore
> + * devices.
> + *
> + * There is a performance penalty for accessing a device from a CPU on
> + * another socket, but we do not care (yet).
> + */
> +static int thunder_uncore_offline_cpu(unsigned int old_cpu, struct hlist_node *node)
> +{
> + struct thunder_uncore *uncore = hlist_entry_safe(node, struct thunder_uncore, node);
Why _safe?
> + int new_cpu;
> +
> + if (!cpumask_test_and_clear_cpu(old_cpu, &uncore->active_mask))
> + return 0;
> + new_cpu = cpumask_any_but(cpu_online_mask, old_cpu);
> + if (new_cpu >= nr_cpu_ids)
> + return 0;
> + perf_pmu_migrate_context(&uncore->pmu, old_cpu, new_cpu);
> + cpumask_set_cpu(new_cpu, &uncore->active_mask);
> + return 0;
> +}
> +
> +static struct thunder_uncore_node * __init alloc_node(struct thunder_uncore *uncore,
> + int node_id, int counters)
> +{
> + struct thunder_uncore_node *node;
> +
> + node = kzalloc(sizeof(*node), GFP_KERNEL);
> + if (!node)
> + return NULL;
> + node->num_counters = counters;
> + INIT_LIST_HEAD(&node->unit_list);
> + return node;
> +}
> +
> +int __init thunder_uncore_setup(struct thunder_uncore *uncore, int device_id,
> + struct pmu *pmu, int counters)
> +{
> + unsigned int vendor_id = PCI_VENDOR_ID_CAVIUM;
> + struct thunder_uncore_unit *unit, *tmp;
> + struct thunder_uncore_node *node;
> + struct pci_dev *pdev = NULL;
> + int ret, node_id, found = 0;
> +
> + /* detect PCI devices */
> + while ((pdev = pci_get_device(vendor_id, device_id, pdev))) {
Redundant brackets?
> + if (!pdev)
> + break;
Redundant check?
> + node_id = dev_to_node(&pdev->dev);
> +
> + /* allocate node if necessary */
> + if (!uncore->nodes[node_id])
> + uncore->nodes[node_id] = alloc_node(uncore, node_id, counters);
> +
> + node = uncore->nodes[node_id];
> + if (!node) {
> + ret = -ENOMEM;
> + goto fail;
> + }
> +
> + unit = kzalloc(sizeof(*unit), GFP_KERNEL);
> + if (!unit) {
> + ret = -ENOMEM;
> + goto fail;
> + }
> +
> + unit->pdev = pdev;
> + unit->map = ioremap(pci_resource_start(pdev, 0),
> + pci_resource_len(pdev, 0));
> + list_add(&unit->entry, &node->unit_list);
> + node->nr_units++;
> + found++;
> + }
> +
> + if (!found)
> + return -ENODEV;
> +
> + cpuhp_state_add_instance_nocalls(CPUHP_AP_UNCORE_CAVIUM_ONLINE,
> + &uncore->node);
> +
> + /*
> + * perf PMU is CPU dependent in difference to our uncore devices.
> + * Just pick a CPU and migrate away if it goes offline.
> + */
> + cpumask_set_cpu(smp_processor_id(), &uncore->active_mask);
> +
> + uncore->pmu = *pmu;
> + ret = perf_pmu_register(&uncore->pmu, uncore->pmu.name, -1);
> + if (ret)
> + goto fail;
> +
> + return 0;
> +
> +fail:
> + node_id = 0;
> + while (uncore->nodes[node_id]) {
> + node = uncore->nodes[node_id];
> +
> + list_for_each_entry_safe(unit, tmp, &node->unit_list, entry) {
Why do you need the _safe variant?
Will
^ permalink raw reply
* Re: [PATCH v2 3/6] qedi: Add QLogic FastLinQ offload iSCSI driver framework.
From: Martin K. Petersen @ 2016-11-08 23:49 UTC (permalink / raw)
To: Arun Easi
Cc: kbuild test robot, Manish Rangankar, kbuild-all,
Martin K. Petersen, James Bottomley, lduncan, cleech, linux-scsi,
netdev, QLogic-Storage-Upstream, Yuval Mintz
In-Reply-To: <alpine.LRH.2.00.1611081129440.28058@mvluser05.qlc.com>
>>>>> "Arun" == Arun Easi <arun.easi@cavium.com> writes:
Arun,
Arun> qedi is the new iSCSI driver, which we are trying to submit, for
Arun> our 41000 series CNA. This patch series were broken up into
Arun> logical blocks for review purpose, but were not made to compile
Arun> individually. It is our impression that this is acceptable for
Arun> SCSI and all the initial "qedi" patches will be squashed and
Arun> committed as a single commit. Please let us know if we are
Arun> mistaken, and if so, we will post another series with this taken
Arun> care of.
It's fine to post the patches split up to ease the review process. But
whatever we commit must obviously be bisectable.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply
* Re: [PATCH 2/4] ath10k: Add support to update btcoex priority value via nl80211
From: kbuild test robot @ 2016-11-08 23:49 UTC (permalink / raw)
To: c_traja; +Cc: kbuild-all, ath10k, linux-wireless, tamizhchelvam, Tamizh chelvam
In-Reply-To: <1478617354-28146-3-git-send-email-c_traja@qti.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 8521 bytes --]
Hi Tamizh,
[auto build test ERROR on ath6kl/ath-next]
[cannot apply to v4.9-rc4 next-20161108]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/c_traja-qti-qualcomm-com/ath10k-Add-support-for-BTCOEX-feature/20161109-043718
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa
All error/warnings (new ones prefixed by >>):
>> drivers/net/wireless/ath/ath10k/mac.c:7508:35: warning: 'struct cfg80211_btcoex_priority' declared inside parameter list
ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
^
>> drivers/net/wireless/ath/ath10k/mac.c:7508:35: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_get_btcoex_prio':
>> drivers/net/wireless/ath/ath10k/mac.c:7512:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_be_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7513:18: error: 'WIPHY_WLAN_BE_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BE_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7513:18: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/wireless/ath/ath10k/mac.c:7515:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_bk_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7516:18: error: 'WIPHY_WLAN_BK_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BK_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7518:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_vi_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7519:18: error: 'WIPHY_WLAN_VI_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_VI_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7521:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_vo_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7522:18: error: 'WIPHY_WLAN_VO_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_VO_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7524:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_beacon_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7525:18: error: 'WIPHY_WLAN_BEACON_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_BEACON_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:7527:21: error: dereferencing pointer to incomplete type
if (btcoex_priority->wlan_mgmt_preferred)
^
drivers/net/wireless/ath/ath10k/mac.c:7528:18: error: 'WIPHY_WLAN_MGMT_PREFERRED' undeclared (first use in this function)
btcoex_prio |= WIPHY_WLAN_MGMT_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c: At top level:
drivers/net/wireless/ath/ath10k/mac.c:7534:11: warning: 'struct cfg80211_btcoex_priority' declared inside parameter list
struct cfg80211_btcoex_priority *btcoex_priority)
^
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_op_set_btcoex_priority':
>> drivers/net/wireless/ath/ath10k/mac.c:7553:16: warning: passing argument 1 of 'ath10k_mac_get_btcoex_prio' from incompatible pointer type
btcoex_prio = ath10k_mac_get_btcoex_prio(btcoex_priority);
^
drivers/net/wireless/ath/ath10k/mac.c:7508:1: note: expected 'struct cfg80211_btcoex_priority *' but argument is of type 'struct cfg80211_btcoex_priority *'
ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
^
drivers/net/wireless/ath/ath10k/mac.c: At top level:
drivers/net/wireless/ath/ath10k/mac.c:7611:2: error: unknown field 'set_btcoex' specified in initializer
.set_btcoex = ath10k_mac_op_set_btcoex,
^
drivers/net/wireless/ath/ath10k/mac.c:7611:2: warning: initialization from incompatible pointer type
drivers/net/wireless/ath/ath10k/mac.c:7611:2: warning: (near initialization for 'ath10k_ops.reconfig_complete')
drivers/net/wireless/ath/ath10k/mac.c:7612:2: error: unknown field 'set_btcoex_priority' specified in initializer
.set_btcoex_priority = ath10k_mac_op_set_btcoex_priority,
^
drivers/net/wireless/ath/ath10k/mac.c:7612:2: warning: initialization from incompatible pointer type
drivers/net/wireless/ath/ath10k/mac.c:7612:2: warning: (near initialization for 'ath10k_ops.ipv6_addr_change')
drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_register':
drivers/net/wireless/ath/ath10k/mac.c:8203:16: error: 'struct wiphy' has no member named 'btcoex_support_flags'
ar->hw->wiphy->btcoex_support_flags =
^
drivers/net/wireless/ath/ath10k/mac.c:8204:4: error: 'WIPHY_WLAN_BE_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BE_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8205:4: error: 'WIPHY_WLAN_BK_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BK_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8206:4: error: 'WIPHY_WLAN_VI_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_VI_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8207:4: error: 'WIPHY_WLAN_VO_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_VO_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8208:4: error: 'WIPHY_WLAN_BEACON_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_BEACON_PREFERRED |
^
drivers/net/wireless/ath/ath10k/mac.c:8209:4: error: 'WIPHY_WLAN_MGMT_PREFERRED' undeclared (first use in this function)
WIPHY_WLAN_MGMT_PREFERRED;
^
drivers/net/wireless/ath/ath10k/mac.c:8211:20: error: 'struct wiphy' has no member named 'btcoex_support_flags'
ar->hw->wiphy->btcoex_support_flags);
^
vim +7512 drivers/net/wireless/ath/ath10k/mac.c
7502 mutex_unlock(&ar->conf_mutex);
7503
7504 return ret;
7505 }
7506
7507 u32
> 7508 ath10k_mac_get_btcoex_prio(struct cfg80211_btcoex_priority *btcoex_priority)
7509 {
7510 u32 btcoex_prio = 0;
7511
> 7512 if (btcoex_priority->wlan_be_preferred)
7513 btcoex_prio |= WIPHY_WLAN_BE_PREFERRED;
7514
7515 if (btcoex_priority->wlan_bk_preferred)
7516 btcoex_prio |= WIPHY_WLAN_BK_PREFERRED;
7517
7518 if (btcoex_priority->wlan_vi_preferred)
7519 btcoex_prio |= WIPHY_WLAN_VI_PREFERRED;
7520
7521 if (btcoex_priority->wlan_vo_preferred)
7522 btcoex_prio |= WIPHY_WLAN_VO_PREFERRED;
7523
7524 if (btcoex_priority->wlan_beacon_preferred)
7525 btcoex_prio |= WIPHY_WLAN_BEACON_PREFERRED;
7526
7527 if (btcoex_priority->wlan_mgmt_preferred)
> 7528 btcoex_prio |= WIPHY_WLAN_MGMT_PREFERRED;
7529
7530 return btcoex_prio;
7531 }
7532
7533 static int ath10k_mac_op_set_btcoex_priority(struct ieee80211_hw *hw,
7534 struct cfg80211_btcoex_priority *btcoex_priority)
7535 {
7536 u32 btcoex_prio;
7537 struct ath10k *ar = hw->priv;
7538 int ret;
7539
7540 if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags))) {
7541 ret = -EINVAL;
7542 goto exit;
7543 }
7544
7545 mutex_lock(&ar->conf_mutex);
7546
7547 if (ar->state != ATH10K_STATE_ON &&
7548 ar->state != ATH10K_STATE_RESTARTED) {
7549 ret = -ENETDOWN;
7550 goto exit;
7551 }
7552
> 7553 btcoex_prio = ath10k_mac_get_btcoex_prio(btcoex_priority);
7554
7555 if (btcoex_prio > 0x3f)
7556 return -E2BIG;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 46112 bytes --]
^ permalink raw reply
* Re: [PATCH v2 3/6] qedi: Add QLogic FastLinQ offload iSCSI driver framework.
From: Martin K. Petersen @ 2016-11-08 23:49 UTC (permalink / raw)
To: Arun Easi
Cc: kbuild test robot, Manish Rangankar, kbuild-all,
Martin K. Petersen, James Bottomley, lduncan, cleech, linux-scsi,
netdev, QLogic-Storage-Upstream, Yuval Mintz
In-Reply-To: <alpine.LRH.2.00.1611081129440.28058@mvluser05.qlc.com>
>>>>> "Arun" == Arun Easi <arun.easi@cavium.com> writes:
Arun,
Arun> qedi is the new iSCSI driver, which we are trying to submit, for
Arun> our 41000 series CNA. This patch series were broken up into
Arun> logical blocks for review purpose, but were not made to compile
Arun> individually. It is our impression that this is acceptable for
Arun> SCSI and all the initial "qedi" patches will be squashed and
Arun> committed as a single commit. Please let us know if we are
Arun> mistaken, and if so, we will post another series with this taken
Arun> care of.
It's fine to post the patches split up to ease the review process. But
whatever we commit must obviously be bisectable.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply
* [PATCH] crypto: dh - Consistenly return negative error codes
From: Mat Martineau @ 2016-11-08 23:48 UTC (permalink / raw)
To: linux-crypto, herbert; +Cc: Mat Martineau, salvatore.benedetto
Fix the single instance where a positive EINVAL was returned.
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---
crypto/dh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/dh.c b/crypto/dh.c
index 9d19360..ddcb528 100644
--- a/crypto/dh.c
+++ b/crypto/dh.c
@@ -118,7 +118,7 @@ static int dh_compute_value(struct kpp_request *req)
if (req->src) {
base = mpi_read_raw_from_sgl(req->src, req->src_len);
if (!base) {
- ret = EINVAL;
+ ret = -EINVAL;
goto err_free_val;
}
} else {
--
2.10.2
^ permalink raw reply related
* Re: [PATCH 0/4] musb fixes for v4.9-rc cycle
From: Tony Lindgren @ 2016-11-08 23:47 UTC (permalink / raw)
To: Ladislav Michl
Cc: Bin Liu, Boris Brezillon, Greg Kroah-Hartman, Andreas Kemnade,
Felipe Balbi, George Cherian, Kishon Vijay Abraham I,
Ivaylo Dimitrov, Johan Hovold, Laurent Pinchart, Sergei Shtylyov,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161108233934.GA25005-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
* Ladislav Michl <ladis-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org> [161108 16:40]:
> On Tue, Nov 08, 2016 at 04:16:37PM -0700, Tony Lindgren wrote:
> > * Ladislav Michl <ladis-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org> [161108 15:52]:
> > > On Tue, Nov 08, 2016 at 03:05:30PM -0700, Tony Lindgren wrote:
> > > > OK. The patch below still works for me with musb_core.c
> > > > autosuspend_delay set to 100. Also works with it set to 10.
> > > >
> > > > Note that we had two timeouts without this.. Can you try
> > > > playing with the timeout in musb_core.c and see if that
> > > > helps?
> > >
> > >
> > > This patch works for me, also with autosuspend_delay set to 10.
> >
> > Oh so to confirm, the $subject series patches + this one only fixes
> > your issue? So no more revert needed?
>
> Right. Revert is no more needed.
OK good to hear!
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v7 09/17] ref-filter: make "%(symref)" atom work with the ':short' modifier
From: Jacob Keller @ 2016-11-08 23:46 UTC (permalink / raw)
To: Karthik Nayak; +Cc: Git mailing list
In-Reply-To: <20161108201211.25213-10-Karthik.188@gmail.com>
On Tue, Nov 8, 2016 at 12:12 PM, Karthik Nayak <karthik.188@gmail.com> wrote:
> From: Karthik Nayak <karthik.188@gmail.com>
>
> The "%(symref)" atom doesn't work when used with the ':short' modifier
> because we strictly match only 'symref' for setting the 'need_symref'
> indicator. Fix this by using comparing with valid_atom rather than used_atom.
>
Makes sense.
> Add tests for %(symref) and %(symref:short) while we're here.
>
Nice to see more tests around this.
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Karthik Nayak <Karthik.188@gmail.com>
> ---
> ref-filter.c | 2 +-
> t/t6300-for-each-ref.sh | 24 ++++++++++++++++++++++++
> 2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/ref-filter.c b/ref-filter.c
> index 4d7e414..5666814 100644
> --- a/ref-filter.c
> +++ b/ref-filter.c
> @@ -338,7 +338,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
> valid_atom[i].parser(&used_atom[at], arg);
> if (*atom == '*')
> need_tagged = 1;
> - if (!strcmp(used_atom[at].name, "symref"))
> + if (!strcmp(valid_atom[i].name, "symref"))
> need_symref = 1;
> return at;
> }
> diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
> index 2c5f177..b06ea1c 100755
> --- a/t/t6300-for-each-ref.sh
> +++ b/t/t6300-for-each-ref.sh
> @@ -38,6 +38,7 @@ test_atom() {
> case "$1" in
> head) ref=refs/heads/master ;;
> tag) ref=refs/tags/testtag ;;
> + sym) ref=refs/heads/sym ;;
> *) ref=$1 ;;
> esac
> printf '%s\n' "$3" >expected
> @@ -565,4 +566,27 @@ test_expect_success 'Verify sort with multiple keys' '
> refs/tags/bogo refs/tags/master > actual &&
> test_cmp expected actual
> '
> +
> +test_expect_success 'Add symbolic ref for the following tests' '
> + git symbolic-ref refs/heads/sym refs/heads/master
> +'
> +
> +cat >expected <<EOF
> +refs/heads/master
> +EOF
> +
> +test_expect_success 'Verify usage of %(symref) atom' '
> + git for-each-ref --format="%(symref)" refs/heads/sym > actual &&
> + test_cmp expected actual
> +'
> +
> +cat >expected <<EOF
> +heads/master
> +EOF
> +
> +test_expect_success 'Verify usage of %(symref:short) atom' '
> + git for-each-ref --format="%(symref:short)" refs/heads/sym > actual &&
> + test_cmp expected actual
> +'
> +
> test_done
> --
> 2.10.2
>
^ permalink raw reply
* Re: [PATCH] MIPS: fix duplicate define
From: kbuild test robot @ 2016-11-08 23:46 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: kbuild-all, Ralf Baechle, Paul Burton, linux-kernel, linux-mips,
Sudip Mukherjee
In-Reply-To: <1478641415-6986-1-git-send-email-sudipm.mukherjee@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5703 bytes --]
Hi Sudip,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.9-rc4 next-20161108]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Sudip-Mukherjee/MIPS-fix-duplicate-define/20161109-054643
config: mips-jz4740 (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=mips
All error/warnings (new ones prefixed by >>):
In file included from arch/mips/include/asm/mach-ip22/spaces.h:25:0,
from arch/mips/include/asm/addrspace.h:13,
from arch/mips/include/asm/barrier.h:11,
from arch/mips/include/asm/bitops.h:18,
from include/linux/bitops.h:36,
from include/linux/kernel.h:10,
from include/linux/sched.h:17,
from arch/mips/kernel/asm-offsets.c:13:
arch/mips/include/asm/page.h: In function '___pa':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
>> arch/mips/include/asm/page.h:190:13: note: in expansion of macro 'PAGE_OFFSET'
return x - PAGE_OFFSET + PHYS_OFFSET;
^~~~~~~~~~~
arch/mips/include/asm/mach-generic/spaces.h:93:23: note: each undeclared identifier is reported only once for each function it appears in
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
>> arch/mips/include/asm/page.h:190:13: note: in expansion of macro 'PAGE_OFFSET'
return x - PAGE_OFFSET + PHYS_OFFSET;
^~~~~~~~~~~
arch/mips/include/asm/io.h: In function 'phys_to_virt':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
>> arch/mips/include/asm/io.h:138:28: note: in expansion of macro 'PAGE_OFFSET'
return (void *)(address + PAGE_OFFSET - PHYS_OFFSET);
^~~~~~~~~~~
arch/mips/include/asm/io.h: In function 'isa_virt_to_bus':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
arch/mips/include/asm/io.h:146:34: note: in expansion of macro 'PAGE_OFFSET'
return (unsigned long)address - PAGE_OFFSET;
^~~~~~~~~~~
arch/mips/include/asm/io.h: In function 'isa_bus_to_virt':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
arch/mips/include/asm/io.h:151:28: note: in expansion of macro 'PAGE_OFFSET'
return (void *)(address + PAGE_OFFSET);
^~~~~~~~~~~
include/linux/mm.h: In function 'lowmem_page_address':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
arch/mips/include/asm/page.h:193:49: note: in expansion of macro 'PAGE_OFFSET'
#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
^~~~~~~~~~~
>> include/linux/mm.h:76:25: note: in expansion of macro '__va'
#define page_to_virt(x) __va(PFN_PHYS(page_to_pfn(x)))
^~~~
>> include/linux/mm.h:1005:9: note: in expansion of macro 'page_to_virt'
return page_to_virt(page);
^~~~~~~~~~~~
make[2]: *** [arch/mips/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [sub-make] Error 2
vim +/CAC_BASE +93 arch/mips/include/asm/mach-generic/spaces.h
875d43e7 include/asm-mips/mach-generic/spaces.h Ralf Baechle 2005-09-03 87 #endif /* CONFIG_64BIT */
^1da177e include/asm-mips/mach-generic/spaces.h Linus Torvalds 2005-04-16 88
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 89 /*
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 90 * This handles the memory map.
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 91 */
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 92 #ifndef PAGE_OFFSET
db385015 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 @93 #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 94 #endif
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 95
565b60de arch/mips/include/asm/mach-generic/spaces.h Kevin Cernekee 2010-09-07 96 #ifndef FIXADDR_TOP
:::::: The code at line 93 was first introduced by commit
:::::: db38501511a7513ec4f0ae9922d847c135cf3c78 [MIPS] Make PAGE_OFFSET aware of PHYS_OFFSET
:::::: TO: Franck Bui-Huu <fbuihuu@gmail.com>
:::::: CC: Ralf Baechle <ralf@linux-mips.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 19122 bytes --]
^ permalink raw reply
* Re: [PATCH] MIPS: fix duplicate define
From: kbuild test robot @ 2016-11-08 23:46 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: kbuild-all, Ralf Baechle, Paul Burton, linux-kernel, linux-mips
In-Reply-To: <1478641415-6986-1-git-send-email-sudipm.mukherjee@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5703 bytes --]
Hi Sudip,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.9-rc4 next-20161108]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Sudip-Mukherjee/MIPS-fix-duplicate-define/20161109-054643
config: mips-jz4740 (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=mips
All error/warnings (new ones prefixed by >>):
In file included from arch/mips/include/asm/mach-ip22/spaces.h:25:0,
from arch/mips/include/asm/addrspace.h:13,
from arch/mips/include/asm/barrier.h:11,
from arch/mips/include/asm/bitops.h:18,
from include/linux/bitops.h:36,
from include/linux/kernel.h:10,
from include/linux/sched.h:17,
from arch/mips/kernel/asm-offsets.c:13:
arch/mips/include/asm/page.h: In function '___pa':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
>> arch/mips/include/asm/page.h:190:13: note: in expansion of macro 'PAGE_OFFSET'
return x - PAGE_OFFSET + PHYS_OFFSET;
^~~~~~~~~~~
arch/mips/include/asm/mach-generic/spaces.h:93:23: note: each undeclared identifier is reported only once for each function it appears in
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
>> arch/mips/include/asm/page.h:190:13: note: in expansion of macro 'PAGE_OFFSET'
return x - PAGE_OFFSET + PHYS_OFFSET;
^~~~~~~~~~~
arch/mips/include/asm/io.h: In function 'phys_to_virt':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
>> arch/mips/include/asm/io.h:138:28: note: in expansion of macro 'PAGE_OFFSET'
return (void *)(address + PAGE_OFFSET - PHYS_OFFSET);
^~~~~~~~~~~
arch/mips/include/asm/io.h: In function 'isa_virt_to_bus':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
arch/mips/include/asm/io.h:146:34: note: in expansion of macro 'PAGE_OFFSET'
return (unsigned long)address - PAGE_OFFSET;
^~~~~~~~~~~
arch/mips/include/asm/io.h: In function 'isa_bus_to_virt':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
arch/mips/include/asm/io.h:151:28: note: in expansion of macro 'PAGE_OFFSET'
return (void *)(address + PAGE_OFFSET);
^~~~~~~~~~~
include/linux/mm.h: In function 'lowmem_page_address':
>> arch/mips/include/asm/mach-generic/spaces.h:93:23: error: 'CAC_BASE' undeclared (first use in this function)
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
^
arch/mips/include/asm/page.h:193:49: note: in expansion of macro 'PAGE_OFFSET'
#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
^~~~~~~~~~~
>> include/linux/mm.h:76:25: note: in expansion of macro '__va'
#define page_to_virt(x) __va(PFN_PHYS(page_to_pfn(x)))
^~~~
>> include/linux/mm.h:1005:9: note: in expansion of macro 'page_to_virt'
return page_to_virt(page);
^~~~~~~~~~~~
make[2]: *** [arch/mips/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [sub-make] Error 2
vim +/CAC_BASE +93 arch/mips/include/asm/mach-generic/spaces.h
875d43e7 include/asm-mips/mach-generic/spaces.h Ralf Baechle 2005-09-03 87 #endif /* CONFIG_64BIT */
^1da177e include/asm-mips/mach-generic/spaces.h Linus Torvalds 2005-04-16 88
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 89 /*
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 90 * This handles the memory map.
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 91 */
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 92 #ifndef PAGE_OFFSET
db385015 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 @93 #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 94 #endif
c4612c85 include/asm-mips/mach-generic/spaces.h Franck Bui-Huu 2007-06-04 95
565b60de arch/mips/include/asm/mach-generic/spaces.h Kevin Cernekee 2010-09-07 96 #ifndef FIXADDR_TOP
:::::: The code at line 93 was first introduced by commit
:::::: db38501511a7513ec4f0ae9922d847c135cf3c78 [MIPS] Make PAGE_OFFSET aware of PHYS_OFFSET
:::::: TO: Franck Bui-Huu <fbuihuu@gmail.com>
:::::: CC: Ralf Baechle <ralf@linux-mips.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 19122 bytes --]
^ permalink raw reply
* Re: Ordering problems with 3ware controller
From: Martin K. Petersen @ 2016-11-08 23:45 UTC (permalink / raw)
To: Paul Menzel; +Cc: linux-scsi, Adam Radford
In-Reply-To: <a41b4bab-edb7-34ab-eb76-7ff4d6e3f677@molgen.mpg.de>
>>>>> "Paul" == Paul Menzel <pmenzel@molgen.mpg.de> writes:
Paul,
Paul> Updating from Linux 4.4.X to Linux 4.8.4, we noticed that the
Paul> 3ware devices under `/dev` – `/dev/twa0`, `/dev/twa1`, … – map to
Paul> the controllers differently.
Paul> This unfortunately breaks quite a lot of our scripts, as we depend
Paul> on the fact that the first controller is also in the front.
It's not the 3ware drivers since they have not been updated in a long
time (since way before 4.4).
Linux does not provide device discovery ordering guarantees. You need to
fix your scripts to use UUIDs, filesystem labels, or DM devices to get
stable naming.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply
* [PATCH] rtc: fix typos in Kconfig
From: Alexandre Belloni @ 2016-11-08 23:45 UTC (permalink / raw)
To: Alessandro Zummo; +Cc: rtc-linux, linux-kernel, Alexandre Belloni
s/buillt/built/g
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
drivers/rtc/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 24b0778f6e28..ab55f35019fc 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1565,7 +1565,7 @@ config RTC_DRV_LPC24XX
NXP LPC178x/18xx/408x/43xx devices.
If you have one of the devices above enable this driver to use
- the hardware RTC. This driver can also be buillt as a module. If
+ the hardware RTC. This driver can also be built as a module. If
so, the module will be called rtc-lpc24xx.
config RTC_DRV_LPC32XX
@@ -1574,7 +1574,7 @@ config RTC_DRV_LPC32XX
help
This enables support for the NXP RTC in the LPC32XX
- This driver can also be buillt as a module. If so, the module
+ This driver can also be built as a module. If so, the module
will be called rtc-lpc32xx.
config RTC_DRV_PM8XXX
--
2.10.2
^ permalink raw reply related
* [rtc-linux] [PATCH] rtc: fix typos in Kconfig
From: Alexandre Belloni @ 2016-11-08 23:45 UTC (permalink / raw)
To: Alessandro Zummo; +Cc: rtc-linux, linux-kernel, Alexandre Belloni
s/buillt/built/g
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
drivers/rtc/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 24b0778f6e28..ab55f35019fc 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1565,7 +1565,7 @@ config RTC_DRV_LPC24XX
NXP LPC178x/18xx/408x/43xx devices.
If you have one of the devices above enable this driver to use
- the hardware RTC. This driver can also be buillt as a module. If
+ the hardware RTC. This driver can also be built as a module. If
so, the module will be called rtc-lpc24xx.
config RTC_DRV_LPC32XX
@@ -1574,7 +1574,7 @@ config RTC_DRV_LPC32XX
help
This enables support for the NXP RTC in the LPC32XX
- This driver can also be buillt as a module. If so, the module
+ This driver can also be built as a module. If so, the module
will be called rtc-lpc32xx.
config RTC_DRV_PM8XXX
--
2.10.2
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related
* Re: [PATCH v7 08/17] ref-filter: add support for %(upstream:track,nobracket)
From: Jacob Keller @ 2016-11-08 23:45 UTC (permalink / raw)
To: Karthik Nayak; +Cc: Git mailing list
In-Reply-To: <20161108201211.25213-9-Karthik.188@gmail.com>
On Tue, Nov 8, 2016 at 12:12 PM, Karthik Nayak <karthik.188@gmail.com> wrote:
> From: Karthik Nayak <karthik.188@gmail.com>
>
> Add support for %(upstream:track,nobracket) which will print the
> tracking information without the brackets (i.e. "ahead N, behind M").
> This is needed when we port branch.c to use ref-filter's printing APIs.
>
Makes sense. Seems a bit weird that we have the brackets normally
rather than adding them as an option, but I think this is ok. We don't
want to change all previous uses in this case.
My only suggestion here would be to add code so that the options die()
when we use nobracket along with trackshort or without track. This
ensures that the nobracket option only applies to track mode?
> Add test and documentation for the same.
>
> Mentored-by: Christian Couder <christian.couder@gmail.com>
> Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
> Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
> ---
> Documentation/git-for-each-ref.txt | 8 +++--
> ref-filter.c | 67 +++++++++++++++++++++++++-------------
> t/t6300-for-each-ref.sh | 2 ++
> 3 files changed, 51 insertions(+), 26 deletions(-)
>
> diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
> index fd365eb..3953431 100644
> --- a/Documentation/git-for-each-ref.txt
> +++ b/Documentation/git-for-each-ref.txt
> @@ -118,9 +118,11 @@ upstream::
> `refname` above. Additionally respects `:track` to show
> "[ahead N, behind M]" and `:trackshort` to show the terse
> version: ">" (ahead), "<" (behind), "<>" (ahead and behind),
> - or "=" (in sync). Has no effect if the ref does not have
> - tracking information associated with it. `:track` also prints
> - "[gone]" whenever unknown upstream ref is encountered.
> + or "=" (in sync). `:track` also prints "[gone]" whenever
> + unknown upstream ref is encountered. Append `:track,nobracket`
> + to show tracking information without brackets (i.e "ahead N,
> + behind M"). Has no effect if the ref does not have tracking
> + information associated with it.
>
Ok so my comment on the previous patch is fixed here, the new wording
makes it much more clear that [gone] is not the same thing as no
information. So I don't think we should bother changing the previous
patch in the series. This might want to document that nobracket works
even without track, even if it doesn't actually do anything? Or make
the code more strict in that we die() if the values are put together
that make no sense?
> push::
> The name of a local ref which represents the `@{push}` location
> diff --git a/ref-filter.c b/ref-filter.c
> index 6d51b80..4d7e414 100644
> --- a/ref-filter.c
> +++ b/ref-filter.c
> @@ -46,8 +46,10 @@ static struct used_atom {
> union {
> char color[COLOR_MAXLEN];
> struct align align;
> - enum { RR_NORMAL, RR_SHORTEN, RR_TRACK, RR_TRACKSHORT }
> - remote_ref;
> + struct {
> + enum { RR_NORMAL, RR_SHORTEN, RR_TRACK, RR_TRACKSHORT } option;
> + unsigned int nobracket: 1;
> + } remote_ref;
> struct {
> enum { C_BARE, C_BODY, C_BODY_DEP, C_LINES, C_SIG, C_SUB } option;
> unsigned int nlines;
> @@ -75,16 +77,33 @@ static void color_atom_parser(struct used_atom *atom, const char *color_value)
>
> static void remote_ref_atom_parser(struct used_atom *atom, const char *arg)
> {
> - if (!arg)
> - atom->u.remote_ref = RR_NORMAL;
> - else if (!strcmp(arg, "short"))
> - atom->u.remote_ref = RR_SHORTEN;
> - else if (!strcmp(arg, "track"))
> - atom->u.remote_ref = RR_TRACK;
> - else if (!strcmp(arg, "trackshort"))
> - atom->u.remote_ref = RR_TRACKSHORT;
> - else
> - die(_("unrecognized format: %%(%s)"), atom->name);
> + struct string_list params = STRING_LIST_INIT_DUP;
> + int i;
> +
> + if (!arg) {
> + atom->u.remote_ref.option = RR_NORMAL;
> + return;
> + }
> +
> + atom->u.remote_ref.nobracket = 0;
> + string_list_split(¶ms, arg, ',', -1);
> +
> + for (i = 0; i < params.nr; i++) {
> + const char *s = params.items[i].string;
> +
> + if (!strcmp(s, "short"))
> + atom->u.remote_ref.option = RR_SHORTEN;
> + else if (!strcmp(s, "track"))
Should we add die()s here to disallow setting the remote_ref option
multiple times? Otherwise, we should document that the last one wins?
Not sure it's really a big deal here, but we could do it to ensure
consistency for options which don't make sense together?
> + atom->u.remote_ref.option = RR_TRACK;
> + else if (!strcmp(s, "trackshort"))
> + atom->u.remote_ref.option = RR_TRACKSHORT;
> + else if (!strcmp(s, "nobracket"))
> + atom->u.remote_ref.nobracket = 1;
> + else
> + die(_("unrecognized format: %%(%s)"), atom->name);
> + }
> +
> + string_list_clear(¶ms, 0);
> }
>
> static void body_atom_parser(struct used_atom *atom, const char *arg)
> @@ -1045,25 +1064,27 @@ static void fill_remote_ref_details(struct used_atom *atom, const char *refname,
> struct branch *branch, const char **s)
> {
> int num_ours, num_theirs;
> - if (atom->u.remote_ref == RR_SHORTEN)
> + if (atom->u.remote_ref.option == RR_SHORTEN)
> *s = shorten_unambiguous_ref(refname, warn_ambiguous_refs);
> - else if (atom->u.remote_ref == RR_TRACK) {
> + else if (atom->u.remote_ref.option == RR_TRACK) {
> if (stat_tracking_info(branch, &num_ours,
> &num_theirs, NULL)) {
> - *s = "[gone]";
> - return;
> - }
> -
> - if (!num_ours && !num_theirs)
> + *s = xstrdup("gone");
> + } else if (!num_ours && !num_theirs)
> *s = "";
> else if (!num_ours)
> - *s = xstrfmt("[behind %d]", num_theirs);
> + *s = xstrfmt("behind %d", num_theirs);
> else if (!num_theirs)
> - *s = xstrfmt("[ahead %d]", num_ours);
> + *s = xstrfmt("ahead %d", num_ours);
> else
> - *s = xstrfmt("[ahead %d, behind %d]",
> + *s = xstrfmt("ahead %d, behind %d",
> num_ours, num_theirs);
> - } else if (atom->u.remote_ref == RR_TRACKSHORT) {
> + if (!atom->u.remote_ref.nobracket && *s[0]) {
> + const char *to_free = *s;
> + *s = xstrfmt("[%s]", *s);
> + free((void *)to_free);
> + }
> + } else if (atom->u.remote_ref.option == RR_TRACKSHORT) {
> if (stat_tracking_info(branch, &num_ours,
> &num_theirs, NULL))
> return;
> diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
> index a92b36f..2c5f177 100755
> --- a/t/t6300-for-each-ref.sh
> +++ b/t/t6300-for-each-ref.sh
> @@ -372,6 +372,8 @@ test_expect_success 'setup for upstream:track[short]' '
>
> test_atom head upstream:track '[ahead 1]'
> test_atom head upstream:trackshort '>'
> +test_atom head upstream:track,nobracket 'ahead 1'
> +test_atom head upstream:nobracket,track 'ahead 1'
> test_atom head push:track '[ahead 1]'
> test_atom head push:trackshort '>'
>
> --
> 2.10.2
>
^ permalink raw reply
* Re: [PATCH] Avoid that SCSI device removal through sysfs triggers a deadlock
From: James Bottomley @ 2016-11-08 23:44 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Bart Van Assche, Martin K. Petersen, Greg Kroah-Hartman,
Hannes Reinecke, Johannes Thumshirn, Sagi Grimberg,
linux-scsi@vger.kernel.org
In-Reply-To: <87oa1pvl8f.fsf@xmission.com>
On Tue, 2016-11-08 at 13:13 -0600, Eric W. Biederman wrote:
> James Bottomley <jejb@linux.vnet.ibm.com> writes:
>
> > On Tue, 2016-11-08 at 08:52 -0800, Bart Van Assche wrote:
> > > On 11/08/2016 07:28 AM, James Bottomley wrote:
> > > > On Mon, 2016-11-07 at 16:32 -0800, Bart Van Assche wrote:
> > > > > diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
> > > > > index cf4c636..44ec536 100644
> > > > > --- a/fs/kernfs/dir.c
> > > > > +++ b/fs/kernfs/dir.c
> > > > > @@ -1410,7 +1410,7 @@ int kernfs_remove_by_name_ns(struct
> > > > > kernfs_node
> > > > > *parent, const char *name,
> > > > > mutex_lock(&kernfs_mutex);
> > > > >
> > > > > kn = kernfs_find_ns(parent, name, ns);
> > > > > - if (kn)
> > > > > + if (kn && !(kn->flags & KERNFS_SUICIDED))
> > > >
> > > > Actually, wrong flag, you need KERNFS_SUICIDAL. The reason is
> > > > that
> > > > kernfs_mutex is actually dropped half way through
> > > > __kernfs_remove,
> > > > so KERNFS_SUICIDED is not set atomically with this mutex.
> > >
> > > Hello James,
> > >
> > > Sorry but what you wrote is not correct.
> >
> > I think you agree it is dropped. I don't need to add the bit about
> > the reacquisition because the race is mediated by the first
> > acquisition not the second one, if you mediate on KERNFS_SUICIDAL,
> > you only need to worry about this because the mediation is in the
> > first acquisition. If you mediate on KERNFS_SUICIDED, you need to
> > explain that the final thing that means the race can't happen is
> > the unbreak in the sysfs delete path re-acquiring s_active ... the
> > explanation of what's going on and why gets about 2x more complex.
>
> Is it really the dropping of the lock that is causing this?
> I don't see that when I read those traces.
No, it's an ABBA lock inversion that causes this. The traces are
somewhat dense, but they say it here:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(s_active#336);
lock(&shost->scan_mutex);
lock(s_active#336);
lock(&shost->scan_mutex);
*** DEADLOCK ***
The detailed explanation of this is here:
http://marc.info/?l=linux-scsi&m=147855187425596
The fix is ensuring that the CPU1 thread doesn't get into taking
s_active if CPU0 already has it using the KERNFS_SUICIDED/AL flag as an
indicator.
James
^ permalink raw reply
* Re: [PATCH] sched/rt: RT_RUNTIME_GREED sched feature
From: Christoph Lameter @ 2016-11-08 23:42 UTC (permalink / raw)
To: Steven Rostedt
Cc: Daniel Bristot de Oliveira, Daniel Bristot de Oliveira,
Ingo Molnar, Peter Zijlstra, linux-rt-users, LKML
In-Reply-To: <20161107151617.486b1b42@gandalf.local.home>
On Mon, 7 Nov 2016, Steven Rostedt wrote:
> On Mon, 7 Nov 2016 21:06:50 +0100
> Daniel Bristot de Oliveira <daniel@bristot.me> wrote:
>
> > The throttling allowed the kworker to run, but once the kworker went to
> > sleep, the RT tasks started to work again. In the previous behavior,
> > the system would either go idle, or the kworker would starve because
> > the runtime become infinity for RR tasks.
>
> I'm confused? Are you saying that RR tasks don't get throttled in the
> current code? That sounds like a bug to me.
Good. Thats what I wanted to hear after all these justifications that the
system is just behaving as designed.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.