* [PATCH v1 3/3] kvm: svm: Use the hardware provided GPA instead of page walk
From: Brijesh Singh @ 2016-11-14 22:16 UTC (permalink / raw)
To: kvm
Cc: Thomas.Lendacky, brijesh.singh, rkrcmar, joro, x86, linux-kernel,
mingo, hpa, pbonzini, tglx, bp
In-Reply-To: <147916172660.16347.15695649975899246333.stgit@brijesh-build-machine>
From: Tom Lendacky <thomas.lendacky@amd.com>
When a guest causes a NPF which requires emulation, KVM sometimes walks
the guest page tables to translate the GVA to a GPA. This is unnecessary
most of the time on AMD hardware since the hardware provides the GPA in
EXITINFO2.
The only exception cases involve string operations involving rep or
operations that use two memory locations. With rep, the GPA will only be
the value of the initial NPF and with dual memory locations we won't know
which memory address was translated into EXITINFO2.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
---
arch/x86/include/asm/kvm_emulate.h | 3 +++
arch/x86/include/asm/kvm_host.h | 3 +++
arch/x86/kvm/svm.c | 9 ++++++++-
arch/x86/kvm/x86.c | 17 ++++++++++++++++-
4 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index e9cd7be..2d1ac09 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -344,6 +344,9 @@ struct x86_emulate_ctxt {
struct read_cache mem_read;
};
+/* String operation identifier (matches the definition in emulate.c) */
+#define CTXT_STRING_OP (1 << 13)
+
/* Repeat String Operation Prefix */
#define REPE_PREFIX 0xf3
#define REPNE_PREFIX 0xf2
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 77cb3f9..fd5b1c8 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -668,6 +668,9 @@ struct kvm_vcpu_arch {
int pending_ioapic_eoi;
int pending_external_vector;
+
+ /* GPA available (AMD only) */
+ bool gpa_available;
};
struct kvm_lpage_info {
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 5e64e656..b442c5a 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -275,6 +275,9 @@ static int avic;
module_param(avic, int, S_IRUGO);
#endif
+/* EXITINFO2 contains valid GPA */
+static bool gpa_avail = true;
+
/* AVIC VM ID bit masks and lock */
static DECLARE_BITMAP(avic_vm_id_bitmap, AVIC_VM_ID_NR);
static DEFINE_SPINLOCK(avic_vm_id_lock);
@@ -1055,8 +1058,10 @@ static __init int svm_hardware_setup(void)
goto err;
}
- if (!boot_cpu_has(X86_FEATURE_NPT))
+ if (!boot_cpu_has(X86_FEATURE_NPT)) {
npt_enabled = false;
+ gpa_avail = false;
+ }
if (npt_enabled && !npt) {
printk(KERN_INFO "kvm: Nested Paging disabled\n");
@@ -4192,6 +4197,8 @@ static int handle_exit(struct kvm_vcpu *vcpu)
vcpu->arch.cr0 = svm->vmcb->save.cr0;
if (npt_enabled)
vcpu->arch.cr3 = svm->vmcb->save.cr3;
+ if (gpa_avail)
+ vcpu->arch.gpa_available = (exit_code == SVM_EXIT_NPF);
if (unlikely(svm->nested.exit_required)) {
nested_svm_vmexit(svm);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index d02aeff..c290794 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4420,7 +4420,19 @@ static int vcpu_mmio_gva_to_gpa(struct kvm_vcpu *vcpu, unsigned long gva,
return 1;
}
- *gpa = vcpu->arch.walk_mmu->gva_to_gpa(vcpu, gva, access, exception);
+ /*
+ * If the exit was due to a NPF we may already have a GPA.
+ * If the GPA is present, use it to avoid the GVA to GPA table
+ * walk. Note, this cannot be used on string operations since
+ * string operation using rep will only have the initial GPA
+ * from when the NPF occurred.
+ */
+ if (vcpu->arch.gpa_available &&
+ !(vcpu->arch.emulate_ctxt.d & CTXT_STRING_OP))
+ *gpa = exception->address;
+ else
+ *gpa = vcpu->arch.walk_mmu->gva_to_gpa(vcpu, gva, access,
+ exception);
if (*gpa == UNMAPPED_GVA)
return -1;
@@ -5542,6 +5554,9 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu,
}
restart:
+ /* Save the faulting GPA (cr2) in the address field */
+ ctxt->exception.address = cr2;
+
r = x86_emulate_insn(ctxt);
if (r == EMULATION_INTERCEPTED)
^ permalink raw reply related
* [PATCH v1 2/3] kvm: svm: Add kvm_fast_pio_in support
From: Brijesh Singh @ 2016-11-14 22:15 UTC (permalink / raw)
To: kvm
Cc: Thomas.Lendacky, brijesh.singh, rkrcmar, joro, x86, linux-kernel,
mingo, hpa, pbonzini, tglx, bp
In-Reply-To: <147916172660.16347.15695649975899246333.stgit@brijesh-build-machine>
From: Tom Lendacky <thomas.lendacky@amd.com>
Update the I/O interception support to add the kvm_fast_pio_in function
to speed up the in instruction similar to the out instruction.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/svm.c | 5 +++--
arch/x86/kvm/x86.c | 43 +++++++++++++++++++++++++++++++++++++++
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index da07e17..77cb3f9 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1133,6 +1133,7 @@ int kvm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr);
struct x86_emulate_ctxt;
int kvm_fast_pio_out(struct kvm_vcpu *vcpu, int size, unsigned short port);
+int kvm_fast_pio_in(struct kvm_vcpu *vcpu, int size, unsigned short port);
void kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
int kvm_emulate_halt(struct kvm_vcpu *vcpu);
int kvm_vcpu_halt(struct kvm_vcpu *vcpu);
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 4e462bb..5e64e656 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -2270,7 +2270,7 @@ static int io_interception(struct vcpu_svm *svm)
++svm->vcpu.stat.io_exits;
string = (io_info & SVM_IOIO_STR_MASK) != 0;
in = (io_info & SVM_IOIO_TYPE_MASK) != 0;
- if (string || in)
+ if (string)
return emulate_instruction(vcpu, 0) == EMULATE_DONE;
port = io_info >> 16;
@@ -2278,7 +2278,8 @@ static int io_interception(struct vcpu_svm *svm)
svm->next_rip = svm->vmcb->control.exit_info_2;
skip_emulated_instruction(&svm->vcpu);
- return kvm_fast_pio_out(vcpu, size, port);
+ return in ? kvm_fast_pio_in(vcpu, size, port)
+ : kvm_fast_pio_out(vcpu, size, port);
}
static int nmi_interception(struct vcpu_svm *svm)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 3017de0..d02aeff 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5617,6 +5617,49 @@ int kvm_fast_pio_out(struct kvm_vcpu *vcpu, int size, unsigned short port)
}
EXPORT_SYMBOL_GPL(kvm_fast_pio_out);
+static int complete_fast_pio_in(struct kvm_vcpu *vcpu)
+{
+ unsigned long val;
+
+ /* We should only ever be called with arch.pio.count equal to 1 */
+ BUG_ON(vcpu->arch.pio.count != 1);
+
+ /* For size less than 4 we merge, else we zero extend */
+ val = (vcpu->arch.pio.size < 4) ? kvm_register_read(vcpu, VCPU_REGS_RAX)
+ : 0;
+
+ /*
+ * Since vcpu->arch.pio.count == 1 let emulator_pio_in_emulated perform
+ * the copy and tracing
+ */
+ emulator_pio_in_emulated(&vcpu->arch.emulate_ctxt, vcpu->arch.pio.size,
+ vcpu->arch.pio.port, &val, 1);
+ kvm_register_write(vcpu, VCPU_REGS_RAX, val);
+
+ return 1;
+}
+
+int kvm_fast_pio_in(struct kvm_vcpu *vcpu, int size, unsigned short port)
+{
+ unsigned long val;
+ int ret;
+
+ /* For size less than 4 we merge, else we zero extend */
+ val = (size < 4) ? kvm_register_read(vcpu, VCPU_REGS_RAX) : 0;
+
+ ret = emulator_pio_in_emulated(&vcpu->arch.emulate_ctxt, size, port,
+ &val, 1);
+ if (ret) {
+ kvm_register_write(vcpu, VCPU_REGS_RAX, val);
+ return ret;
+ }
+
+ vcpu->arch.complete_userspace_io = complete_fast_pio_in;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(kvm_fast_pio_in);
+
static int kvmclock_cpu_down_prep(unsigned int cpu)
{
__this_cpu_write(cpu_tsc_khz, 0);
^ permalink raw reply related
* [PATCH v1 0/3] x86: SVM: add additional SVM NPF error and use HW GPA
From: Brijesh Singh @ 2016-11-14 22:15 UTC (permalink / raw)
To: kvm
Cc: Thomas.Lendacky, brijesh.singh, rkrcmar, joro, x86, linux-kernel,
mingo, hpa, pbonzini, tglx, bp
(resending, forgot to add Tom Lendacky and Borislav Petkov in CC list)
This patch series is taken from SEV RFC series [1]. These patches do not
depend on the SEV feature and can be reviewed and merged on their own.
- Add support for additional SVM NFP error codes
- Add kvm_fast_pio_in support
- Use the hardware provided GPA instead of page walk
[1] http://marc.info/?l=linux-mm&m=147190814023863&w=2
Tom Lendacky (3):
kvm: svm: Add support for additional SVM NPF error codes
kvm: svm: Add kvm_fast_pio_in support
kvm: svm: Use the hardware provided GPA instead of page walk
arch/x86/include/asm/kvm_emulate.h | 3 ++
arch/x86/include/asm/kvm_host.h | 15 ++++++++-
arch/x86/kvm/mmu.c | 20 +++++++++++-
arch/x86/kvm/svm.c | 16 +++++++---
arch/x86/kvm/x86.c | 60 +++++++++++++++++++++++++++++++++++-
5 files changed, 106 insertions(+), 8 deletions(-)
--
Brijesh Singh
^ permalink raw reply
* ✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm/dp/i915: Fix DP link rate math (rev2)
From: Patchwork @ 2016-11-14 22:15 UTC (permalink / raw)
To: Pandiyan, Dhinakaran; +Cc: intel-gfx
In-Reply-To: <1479159735-29364-1-git-send-email-dhinakaran.pandiyan@intel.com>
== Series Details ==
Series: series starting with [v2,1/2] drm/dp/i915: Fix DP link rate math (rev2)
URL : https://patchwork.freedesktop.org/series/15305/
State : success
== Summary ==
Series 15305v2 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/15305/revisions/2/mbox/
fi-bdw-5557u total:244 pass:229 dwarn:0 dfail:0 fail:0 skip:15
fi-bsw-n3050 total:244 pass:204 dwarn:0 dfail:0 fail:0 skip:40
fi-bxt-t5700 total:244 pass:216 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-j1900 total:244 pass:216 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-n2820 total:244 pass:212 dwarn:0 dfail:0 fail:0 skip:32
fi-hsw-4770 total:244 pass:224 dwarn:0 dfail:0 fail:0 skip:20
fi-hsw-4770r total:244 pass:224 dwarn:0 dfail:0 fail:0 skip:20
fi-ilk-650 total:244 pass:191 dwarn:0 dfail:0 fail:0 skip:53
fi-ivb-3520m total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-ivb-3770 total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-kbl-7200u total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-skl-6260u total:244 pass:230 dwarn:0 dfail:0 fail:0 skip:14
fi-skl-6700hq total:244 pass:223 dwarn:0 dfail:0 fail:0 skip:21
fi-snb-2520m total:244 pass:212 dwarn:0 dfail:0 fail:0 skip:32
fi-snb-2600 total:244 pass:211 dwarn:0 dfail:0 fail:0 skip:33
2f21978cfd8984c79e4cbd77ce63d9f73fe226ef drm-intel-nightly: 2016y-11m-14d-21h-23m-10s UTC integration manifest
feb0aee drm/dp/i915: Fix DP link rate math
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2990/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: Long delays creating a netns after deleting one (possibly RCU related)
From: Eric W. Biederman @ 2016-11-14 22:12 UTC (permalink / raw)
To: Paul E. McKenney
Cc: Cong Wang, Rolf Neugebauer, LKML, Linux Kernel Network Developers,
Justin Cormack, Ian Campbell, netdev, Eric Dumazet
In-Reply-To: <20161114181425.GN4127@linux.vnet.ibm.com>
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com> writes:
> On Mon, Nov 14, 2016 at 09:44:35AM -0800, Cong Wang wrote:
>> On Mon, Nov 14, 2016 at 8:24 AM, Paul E. McKenney
>> <paulmck@linux.vnet.ibm.com> wrote:
>> > On Sun, Nov 13, 2016 at 10:47:01PM -0800, Cong Wang wrote:
>> >> On Fri, Nov 11, 2016 at 4:55 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> >> > On Fri, Nov 11, 2016 at 4:23 PM, Paul E. McKenney
>> >> > <paulmck@linux.vnet.ibm.com> wrote:
>> >> >>
>> >> >> Ah! This net_mutex is different than RTNL. Should synchronize_net() be
>> >> >> modified to check for net_mutex being held in addition to the current
>> >> >> checks for RTNL being held?
>> >> >>
>> >> >
>> >> > Good point!
>> >> >
>> >> > Like commit be3fc413da9eb17cce0991f214ab0, checking
>> >> > for net_mutex for this case seems to be an optimization, I assume
>> >> > synchronize_rcu_expedited() and synchronize_rcu() have the same
>> >> > behavior...
>> >>
>> >> Thinking a bit more, I think commit be3fc413da9eb17cce0991f
>> >> gets wrong on rtnl_is_locked(), the lock could be locked by other
>> >> process not by the current one, therefore it should be
>> >> lockdep_rtnl_is_held() which, however, is defined only when LOCKDEP
>> >> is enabled... Sigh.
>> >>
>> >> I don't see any better way than letting callers decide if they want the
>> >> expedited version or not, but this requires changes of all callers of
>> >> synchronize_net(). Hm.
>> >
>> > I must confess that I don't understand how it would help to use an
>> > expedited grace period when some other process is holding RTNL.
>> > In contrast, I do well understand how it helps when the current process
>> > is holding RTNL.
>>
>> Yeah, this is exactly my point. And same for ASSERT_RTNL() which checks
>> rtnl_is_locked(), clearly we need to assert "it is held by the current process"
>> rather than "it is locked by whatever process".
>>
>> But given *_is_held() is always defined by LOCKDEP, so we probably need
>> mutex to provide such a helper directly, mutex->owner is not always defined
>> either. :-/
>
> There is always the option of making acquisition and release set a per-task
> variable that can be tested. (Where did I put that asbestos suit, anyway?)
>
> Thanx, Paul
synchronize_rcu_expidited is not enough if you have multiple network
devices in play.
Looking at the code it comes down to this commit, and it appears there
is a promise add rcu grace period combining by Eric Dumazet.
Eric since people are hitting noticable stalls because of the rcu grace
period taking a long time do you think you could look at this code path
a bit more?
commit 93d05d4a320cb16712bb3d57a9658f395d8cecb9
Author: Eric Dumazet <edumazet@google.com>
Date: Wed Nov 18 06:31:03 2015 -0800
net: provide generic busy polling to all NAPI drivers
NAPI drivers no longer need to observe a particular protocol
to benefit from busy polling (CONFIG_NET_RX_BUSY_POLL=y)
napi_hash_add() and napi_hash_del() are automatically called
from core networking stack, respectively from
netif_napi_add() and netif_napi_del()
This patch depends on free_netdev() and netif_napi_del() being
called from process context, which seems to be the norm.
Drivers might still prefer to call napi_hash_del() on their
own, since they might combine all the rcu grace periods into
a single one, knowing their NAPI structures lifetime, while
core networking stack has no idea of a possible combining.
Once this patch proves to not bring serious regressions,
we will cleanup drivers to either remove napi_hash_del()
or provide appropriate rcu grace periods combining.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric
^ permalink raw reply
* Re: [PATCH 1/2] libselinux, libsemanage: fall back to gcc in exception.sh
From: William Roberts @ 2016-11-14 22:15 UTC (permalink / raw)
To: Nicolas Iooss; +Cc: selinux@tycho.nsa.gov
In-Reply-To: <20161114215712.18962-1-nicolas.iooss@m4x.org>
For a more long term solution, why not just give swig a header file
(you can ifdef on SWIG for anything to omit), or write the interface
file by hand. I ended up using a hybrid approach for one my projects
(the build system is a mess):
https://bitbucket.org/miniat/0x1-miniat/src/f84cb76ab0fbe645ee9c48d30221b29283745778/vm/src/miniat_python.i?at=master&fileviewer=file-view-default
On Mon, Nov 14, 2016 at 1:57 PM, Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
> clang does not support -aux-info option. When exception.sh is run with
> CC=clang, use gcc to build selinuxswig_python_exception.i and
> semanageswig_python_exception.i.
>
> This does not solve the issue of building libselinux and libsemanage
> Python wrappers on a system without gcc. However parsing the result of
> "gcc -aux-info" is easier than parsing the header files so stay with
> this command at least for now.
>
> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
> ---
> libselinux/src/exception.sh | 6 +++++-
> libsemanage/src/exception.sh | 6 +++++-
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/libselinux/src/exception.sh b/libselinux/src/exception.sh
> index a58bf3f45778..a3ff83235ced 100755
> --- a/libselinux/src/exception.sh
> +++ b/libselinux/src/exception.sh
> @@ -15,6 +15,10 @@ echo "
> ;;
> esac
> }
> -${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/selinux/selinux.h
> +if ! ${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/selinux/selinux.h
> +then
> + # clang does not support -aux-info so fall back to gcc
> + gcc -x c -c -I../include - -aux-info temp.aux < ../include/selinux/selinux.h
> +fi
> for i in `awk '/<stdin>.*extern int/ { print $6 }' temp.aux`; do except $i ; done
> rm -f -- temp.aux -.o
> diff --git a/libsemanage/src/exception.sh b/libsemanage/src/exception.sh
> index d18959cbe85d..a4095f4f8ba6 100644
> --- a/libsemanage/src/exception.sh
> +++ b/libsemanage/src/exception.sh
> @@ -9,6 +9,10 @@ echo "
> }
> "
> }
> -${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h
> +if ! ${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h
> +then
> + # clang does not support -aux-info so fall back to gcc
> + gcc -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h
> +fi
> for i in `awk '/extern int/ { print $6 }' temp.aux`; do except $i ; done
> rm -f -- temp.aux -.o
> --
> 2.10.2
>
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov.
--
Respectfully,
William C Roberts
^ permalink raw reply
* Re: [PATCH 1/2] staging: iio: ad7606: replace range/range_available with corresponding scale
From: Jonathan Cameron @ 2016-11-14 22:15 UTC (permalink / raw)
To: Lars-Peter Clausen, Linus Walleij, Jonathan Cameron
Cc: Eva Rachel Retuya, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Hennerich, Hartmut Knaack,
Peter Meerwald, Greg KH
In-Reply-To: <b59ff168-c82e-26ed-9192-a491d97c5d6d@metafoo.de>
On 14 November 2016 18:53:28 GMT+00:00, Lars-Peter Clausen <lars@metafoo.de> wrote:
>On 11/14/2016 05:58 PM, Linus Walleij wrote:
>> On Sat, Nov 12, 2016 at 3:24 PM, Jonathan Cameron <jic23@kernel.org>
>wrote:
>>
>>> Is it just me who thought, we need a fixed GPI like a fixed
>regulator?
Probably didn't help clarity that I described it as an input pin whereas it's kind of like having an
output pin whose state you can't change...
>>> Would allow this sort of fixed wiring to be simply defined.
>>>
>>> Linus, worth exploring?
>>
>> So if fixed regulator is for a voltage provider, this would be
>> pretty much the inverse: deciding for a voltage range by switching
>> a GPIO.
>
>It's about figuring out the setting of a "GPIO" that can't be changed
>from
>software.
>
>Devices sometimes, instead of a configuration bus like I2C or SPI, use
>simple input pins, that can either be set to high or low, to allow
>software
>the state of the device. The GPIO API is typically used to configure
>these pins.
>
>This works fine as long as the pin is connected to a GPIO. But
>sometimes the
>system designer decides that a settings does not need to be
>configurable, in
>this case the pin will be tied to logic low or high directly on the PCB
>without any GPIO controller being involved.
>
>Sometimes a driver wants to know how the pin is wired up so it can
>report to
>userspace this part runs in the following mode and the mode can't be
>changed. In a sense it is like a reverse GPIO hog.
>
>Considering that this is a common usecase the question was how this can
>be
>implemented in a driver independent way to avoid code duplication and
>slightly different variations of what is effectively the same DT/ACPI
>binding.
>
>E.g. lets say for a configurable pin you use
>
> range-gpio = <&gpio ...>;
>
>and for a static pin
>
> range-gpio-fixed = <1>;
>
>Or something similar.
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
^ permalink raw reply
* Re: [PATCH 1/2] staging: iio: ad7606: replace range/range_available with corresponding scale
From: Jonathan Cameron @ 2016-11-14 22:15 UTC (permalink / raw)
To: Lars-Peter Clausen, Linus Walleij, Jonathan Cameron
Cc: Eva Rachel Retuya, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, Michael Hennerich, Hartmut Knaack,
Peter Meerwald, Greg KH
In-Reply-To: <b59ff168-c82e-26ed-9192-a491d97c5d6d@metafoo.de>
On 14 November 2016 18:53:28 GMT+00:00, Lars-Peter Clausen <lars@metafoo.de> wrote:
>On 11/14/2016 05:58 PM, Linus Walleij wrote:
>> On Sat, Nov 12, 2016 at 3:24 PM, Jonathan Cameron <jic23@kernel.org>
>wrote:
>>
>>> Is it just me who thought, we need a fixed GPI like a fixed
>regulator?
Probably didn't help clarity that I described it as an input pin whereas it's kind of like having an
output pin whose state you can't change...
>>> Would allow this sort of fixed wiring to be simply defined.
>>>
>>> Linus, worth exploring?
>>
>> So if fixed regulator is for a voltage provider, this would be
>> pretty much the inverse: deciding for a voltage range by switching
>> a GPIO.
>
>It's about figuring out the setting of a "GPIO" that can't be changed
>from
>software.
>
>Devices sometimes, instead of a configuration bus like I2C or SPI, use
>simple input pins, that can either be set to high or low, to allow
>software
>the state of the device. The GPIO API is typically used to configure
>these pins.
>
>This works fine as long as the pin is connected to a GPIO. But
>sometimes the
>system designer decides that a settings does not need to be
>configurable, in
>this case the pin will be tied to logic low or high directly on the PCB
>without any GPIO controller being involved.
>
>Sometimes a driver wants to know how the pin is wired up so it can
>report to
>userspace this part runs in the following mode and the mode can't be
>changed. In a sense it is like a reverse GPIO hog.
>
>Considering that this is a common usecase the question was how this can
>be
>implemented in a driver independent way to avoid code duplication and
>slightly different variations of what is effectively the same DT/ACPI
>binding.
>
>E.g. lets say for a configurable pin you use
>
> range-gpio = <&gpio ...>;
>
>and for a static pin
>
> range-gpio-fixed = <1>;
>
>Or something similar.
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
^ permalink raw reply
* [U-Boot] [ANN] U-Boot v2016.11 is released
From: Wolfgang Denk @ 2016-11-14 22:15 UTC (permalink / raw)
To: u-boot
In-Reply-To: <CAD6G_RTFpFmFWVOtdkeRm_LA1nQgMxtSQSnbToyd_6Y8_icSiw@mail.gmail.com>
Dear Jagan,
In message <CAD6G_RTFpFmFWVOtdkeRm_LA1nQgMxtSQSnbToyd_6Y8_icSiw@mail.gmail.com> you wrote:
>
> Unfortunately "Amarula Solutions" is not listed in Employers list [1]
> for this I sent a domain-map mail to Wolfgang Denk during MW, any edit
> for this?
Where should it show up?
You sent me an entry for a
www.amarulasolutions.com -> Amarula Solutions
mapping, which I did add to the u-boot-config/domain-map used for
building this report. AFAICT, there is no single commit log
containing "www.amarulasolutions.com".
The git log from v2016.09 through v2016.11 shows author entries for
two mail addresses containing anything similar:
jagan at amarulasolutions.com
michael at amarulasolutions.com
But neither of them matches "www.amarulasolutions.com", so there are
no credits generated.
I was surprised about the "www" part in your domain mapping, but this
is what you sent me, so I added it. Please let me know if you think
this should be changed.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have a theory that it's impossible to prove anything, but I can't
prove it.
^ permalink raw reply
* Re: [PATCH v4 1/3] bus: simple-pm: add support to pm clocks
From: Bjorn Helgaas @ 2016-11-14 22:14 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: svarbanov, linux-pci, bhelgaas, robh+dt, linux-arm-msm,
devicetree, Geert Uytterhoeven, Kevin Hilman, Simon Horman
In-Reply-To: <1479122155-13393-2-git-send-email-srinivas.kandagatla@linaro.org>
[+cc Geert, Kevin, Simon]
On Mon, Nov 14, 2016 at 11:15:53AM +0000, Srinivas Kandagatla wrote:
> This patch adds support to pm clocks via device tree, so that the clocks
> can be turned on and off during runtime pm. This patch is required for
> Qualcomm msm8996 pcie controller which sits on a bus with its own
> power-domain and clocks.
>
> Without this patch the clock associated with the bus are never turned on.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
I don't see a formal maintainer for drivers/bus/simple-pm-bus.c, but I'd
like an ack or at least a review from Geert or Simon.
> ---
> drivers/bus/simple-pm-bus.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c
> index c5eb46c..63b7e8c 100644
> --- a/drivers/bus/simple-pm-bus.c
> +++ b/drivers/bus/simple-pm-bus.c
> @@ -11,6 +11,7 @@
> #include <linux/module.h>
> #include <linux/of_platform.h>
> #include <linux/platform_device.h>
> +#include <linux/pm_clock.h>
> #include <linux/pm_runtime.h>
>
>
> @@ -22,17 +23,26 @@ static int simple_pm_bus_probe(struct platform_device *pdev)
>
> pm_runtime_enable(&pdev->dev);
>
> - if (np)
> + if (np) {
> + of_pm_clk_add_clks(&pdev->dev);
> of_platform_populate(np, NULL, NULL, &pdev->dev);
> + }
>
> return 0;
> }
>
> +static const struct dev_pm_ops simple_pm_bus_pm_ops = {
> + SET_RUNTIME_PM_OPS(pm_clk_suspend,
> + pm_clk_resume, NULL)
> +};
> +
> static int simple_pm_bus_remove(struct platform_device *pdev)
> {
> dev_dbg(&pdev->dev, "%s\n", __func__);
>
> pm_runtime_disable(&pdev->dev);
> + pm_clk_destroy(&pdev->dev);
> +
> return 0;
> }
>
> @@ -48,6 +58,7 @@ static struct platform_driver simple_pm_bus_driver = {
> .driver = {
> .name = "simple-pm-bus",
> .of_match_table = simple_pm_bus_of_match,
> + .pm = &simple_pm_bus_pm_ops,
> },
> };
>
> --
> 2.10.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH v1 2/2] kexec: Support -S paramter to return whether the kexec payload is loaded.
From: Konrad Rzeszutek Wilk @ 2016-11-14 22:12 UTC (permalink / raw)
To: david.vrabel, xen-devel, kexec
Cc: elena.ufimtseva, daniel.kiper, Konrad Rzeszutek Wilk
In-Reply-To: <1479161573-12671-1-git-send-email-konrad.wilk@oracle.com>
Instead of the scripts having to poke at various fields we can
provide that functionality via the -S parameter.
Returns 0 if the payload is loaded. Can be used in combination
with -l or -p to get the state of the proper kexec image.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
v0: First version (internal product).
v1: Posted on kexec mailing list. Changed -s to -S
CC: kexec@lists.infradead.org
CC: xen-devel@lists.xenproject.org
CC: Daniel Kiper <daniel.kiper@oracle.com>
---
kexec/kexec-xen.c | 20 ++++++++++++++++++
kexec/kexec.8 | 5 +++++
kexec/kexec.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
kexec/kexec.h | 5 ++++-
4 files changed, 85 insertions(+), 6 deletions(-)
diff --git a/kexec/kexec-xen.c b/kexec/kexec-xen.c
index 24a4191..5a1e9d2 100644
--- a/kexec/kexec-xen.c
+++ b/kexec/kexec-xen.c
@@ -105,6 +105,26 @@ int xen_kexec_unload(uint64_t kexec_flags)
return ret;
}
+int xen_kexec_status(uint64_t kexec_flags)
+{
+ xc_interface *xch;
+ uint8_t type;
+ int ret;
+
+ xch = xc_interface_open(NULL, NULL, 0);
+ if (!xch)
+ return -1;
+
+ type = (kexec_flags & KEXEC_ON_CRASH) ? KEXEC_TYPE_CRASH
+ : KEXEC_TYPE_DEFAULT;
+
+ ret = xc_kexec_status(xch, type);
+
+ xc_interface_close(xch);
+
+ return ret;
+}
+
void xen_kexec_exec(void)
{
xc_interface *xch;
diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 4d0c1d1..02f4ccf 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -107,6 +107,11 @@ command:
.B \-d\ (\-\-debug)
Enable debugging messages.
.TP
+.B \-D\ (\-\-status)
+Return 0 if the type (by default crash) is loaded. Can be used in conjuction
+with -l or -p to toggle the type. Note it will
+.BR not\ load\ the\ kernel.
+.TP
.B \-e\ (\-\-exec)
Run the currently loaded kernel. Note that it will reboot into the loaded kernel without calling shutdown(8).
.TP
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 500e5a9..bc72688 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -855,6 +855,32 @@ static int k_unload (unsigned long kexec_flags)
return result;
}
+static int kexec_loaded(void);
+static int __kexec_loaded(const char *f);
+
+static int k_status(unsigned long kexec_flags)
+{
+ int result;
+ long native_arch;
+
+ /* set the arch */
+ native_arch = physical_arch();
+ if (native_arch < 0) {
+ return -1;
+ }
+ kexec_flags |= native_arch;
+
+ if (xen_present())
+ result = xen_kexec_status(kexec_flags);
+ else {
+ if (kexec_flags & KEXEC_ON_CRASH)
+ result = __kexec_loaded("/sys/kernel/kexec_crash_loaded");
+ else
+ result = kexec_loaded();
+ }
+ return result;
+}
+
/*
* Start a reboot.
*/
@@ -890,8 +916,6 @@ static int my_exec(void)
return -1;
}
-static int kexec_loaded(void);
-
static int load_jump_back_helper_image(unsigned long kexec_flags, void *entry)
{
int result;
@@ -970,6 +994,7 @@ void usage(void)
" to original kernel.\n"
" -s, --kexec-file-syscall Use file based syscall for kexec operation\n"
" -d, --debug Enable debugging to help spot a failure.\n"
+ " -S, --status Return 0 if the type (by default crash) is loaded.\n"
"\n"
"Supported kernel file types and options: \n");
for (i = 0; i < file_types; i++) {
@@ -981,7 +1006,7 @@ void usage(void)
printf("\n");
}
-static int kexec_loaded(void)
+static int __kexec_loaded(const char *file)
{
long ret = -1;
FILE *fp;
@@ -992,7 +1017,7 @@ static int kexec_loaded(void)
if (xen_present())
return 1;
- fp = fopen("/sys/kernel/kexec_loaded", "r");
+ fp = fopen(file, "r");
if (fp == NULL)
return -1;
@@ -1015,6 +1040,12 @@ static int kexec_loaded(void)
return (int)ret;
}
+static int kexec_loaded(void)
+{
+ return __kexec_loaded("/sys/kernel/kexec_loaded");
+}
+
+
/*
* Remove parameter from a kernel command line. Helper function by get_command_line().
*/
@@ -1204,6 +1235,7 @@ int main(int argc, char *argv[])
int do_unload = 0;
int do_reuse_initrd = 0;
int do_kexec_file_syscall = 0;
+ int do_status = 0;
void *entry = 0;
char *type = 0;
char *endptr;
@@ -1345,6 +1377,9 @@ int main(int argc, char *argv[])
case OPT_KEXEC_FILE_SYSCALL:
/* We already parsed it. Nothing to do. */
break;
+ case OPT_STATUS:
+ do_status = 1;
+ break;
default:
break;
}
@@ -1355,6 +1390,20 @@ int main(int argc, char *argv[])
if (skip_sync)
do_sync = 0;
+ if (do_status) {
+ if (kexec_flags == 0)
+ kexec_flags = KEXEC_ON_CRASH;
+ do_load = 0;
+ do_reuse_initrd = 0;
+ do_unload = 0;
+ do_load = 0;
+ do_shutdown = 0;
+ do_sync = 0;
+ do_ifdown = 0;
+ do_exec = 0;
+ do_load_jump_back_helper = 0;
+ }
+
if (do_load && (kexec_flags & KEXEC_ON_CRASH) &&
!is_crashkernel_mem_reserved()) {
die("Memory for crashkernel is not reserved\n"
@@ -1392,7 +1441,9 @@ int main(int argc, char *argv[])
check_reuse_initrd();
arch_reuse_initrd();
}
-
+ if (do_status) {
+ result = k_status(kexec_flags);
+ }
if (do_unload) {
if (do_kexec_file_syscall)
result = kexec_file_unload(kexec_file_flags);
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 9194f1c..2b06f59 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -219,6 +219,7 @@ extern int file_types;
#define OPT_TYPE 't'
#define OPT_PANIC 'p'
#define OPT_KEXEC_FILE_SYSCALL 's'
+#define OPT_STATUS 'S'
#define OPT_MEM_MIN 256
#define OPT_MEM_MAX 257
#define OPT_REUSE_INITRD 258
@@ -245,8 +246,9 @@ extern int file_types;
{ "reuseinitrd", 0, 0, OPT_REUSE_INITRD }, \
{ "kexec-file-syscall", 0, 0, OPT_KEXEC_FILE_SYSCALL }, \
{ "debug", 0, 0, OPT_DEBUG }, \
+ { "status", 0, 0, OPT_STATUS }, \
-#define KEXEC_OPT_STR "h?vdfxyluet:ps"
+#define KEXEC_OPT_STR "h?vdfxyluet:psS"
extern void dbgprint_mem_range(const char *prefix, struct memory_range *mr, int nr_mr);
extern void die(const char *fmt, ...)
@@ -311,5 +313,6 @@ int xen_present(void);
int xen_kexec_load(struct kexec_info *info);
int xen_kexec_unload(uint64_t kexec_flags);
void xen_kexec_exec(void);
+int xen_kexec_status(uint64_t kexec_flags);
#endif /* KEXEC_H */
--
2.5.5
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related
* [PATCH v1] Add in kexec -S for status, and add new Xen hypercall to support this.
From: Konrad Rzeszutek Wilk @ 2016-11-14 22:12 UTC (permalink / raw)
To: david.vrabel, xen-devel, kexec; +Cc: elena.ufimtseva, daniel.kiper
Heya!
I am cross-posting on two mailing lists:
xen-devel@lists.xenproject.org
kexec@lists.infradead.org
as it may be easier to review and provide input then me going back and forth.
Anyhow the patches are to help with the various distro's poking in
/sys/../kexec to figure out whether an kexec image is loaded.
This can be done using the -S parameter now with the patch #2.
Also I add an hypercall to Xen so that if kexec is running under Xen
the same information can be retrieved (see patch #1).
Thanks!
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply
* [PATCH v1 1/2] xen/kexec: Find out whether an kexec type is loaded.
From: Konrad Rzeszutek Wilk @ 2016-11-14 22:12 UTC (permalink / raw)
To: david.vrabel, xen-devel, kexec
Cc: elena.ufimtseva, daniel.kiper, Konrad Rzeszutek Wilk
In-Reply-To: <1479161573-12671-1-git-send-email-konrad.wilk@oracle.com>
The tools that use kexec are asynchronous in nature and do
not keep state changes. As such provide an hypercall to find
out whether an image has been loaded for either type.
Note: No need to modify XSM as it has one size fits all
check and does not check for subcommands.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
v0: Internal version.
v1: Dropped Reviewed-by, posting on xen-devel.
CC: Elena Ufimtseva <elena.ufimtseva@oracle.com>
CC: Daniel Kiper <daniel.kiper@oracle.com>
---
tools/libxc/include/xenctrl.h | 8 ++++++++
tools/libxc/xc_kexec.c | 27 +++++++++++++++++++++++++++
xen/common/kexec.c | 25 +++++++++++++++++++++++++
xen/include/public/kexec.h | 11 +++++++++++
4 files changed, 71 insertions(+)
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 2c83544..aa5d798 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2574,6 +2574,14 @@ int xc_kexec_load(xc_interface *xch, uint8_t type, uint16_t arch,
*/
int xc_kexec_unload(xc_interface *xch, int type);
+/*
+ * Find out whether the image has been succesfully loaded.
+ *
+ * The can be either KEXEC_TYPE_DEFAULT or KEXEC_TYPE_CRASH.
+ * If zero is returned that means the image is loaded for the type.
+ */
+int xc_kexec_status(xc_interface *xch, int type);
+
typedef xenpf_resource_entry_t xc_resource_entry_t;
/*
diff --git a/tools/libxc/xc_kexec.c b/tools/libxc/xc_kexec.c
index 1cceb5d..95d36ff 100644
--- a/tools/libxc/xc_kexec.c
+++ b/tools/libxc/xc_kexec.c
@@ -126,3 +126,30 @@ out:
return ret;
}
+
+int xc_kexec_status(xc_interface *xch, int type)
+{
+ DECLARE_HYPERCALL;
+ DECLARE_HYPERCALL_BUFFER(xen_kexec_status_t, status);
+ int ret = -1;
+
+ status = xc_hypercall_buffer_alloc(xch, status, sizeof(*status));
+ if ( status == NULL )
+ {
+ PERROR("Count not alloc buffer for kexec status hypercall");
+ goto out;
+ }
+
+ status->type = type;
+
+ hypercall.op = __HYPERVISOR_kexec_op;
+ hypercall.arg[0] = KEXEC_CMD_kexec_status;
+ hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(status);
+
+ ret = do_xen_hypercall(xch, &hypercall);
+
+out:
+ xc_hypercall_buffer_free(xch, status);
+
+ return ret;
+}
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index c83d48f..1148f85 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1169,6 +1169,28 @@ static int kexec_unload(XEN_GUEST_HANDLE_PARAM(void) uarg)
return kexec_do_unload(&unload);
}
+static int kexec_status(XEN_GUEST_HANDLE_PARAM(void) uarg)
+{
+ xen_kexec_status_t status;
+ int base, bit, pos;
+
+ if ( unlikely(copy_from_guest(&status, uarg, 1)) )
+ return -EFAULT;
+
+ if ( test_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags) )
+ return -EBUSY;
+
+ if ( kexec_load_get_bits(status.type, &base, &bit) )
+ return -EINVAL;
+
+ pos = (test_bit(bit, &kexec_flags) != 0);
+
+ if ( !test_bit(base + pos, &kexec_flags) )
+ return -ENOENT;
+
+ return 0;
+}
+
static int do_kexec_op_internal(unsigned long op,
XEN_GUEST_HANDLE_PARAM(void) uarg,
bool_t compat)
@@ -1208,6 +1230,9 @@ static int do_kexec_op_internal(unsigned long op,
case KEXEC_CMD_kexec_unload:
ret = kexec_unload(uarg);
break;
+ case KEXEC_CMD_kexec_status:
+ ret = kexec_status(uarg);
+ break;
}
return ret;
diff --git a/xen/include/public/kexec.h b/xen/include/public/kexec.h
index a6a0a88..29dcb5d 100644
--- a/xen/include/public/kexec.h
+++ b/xen/include/public/kexec.h
@@ -227,6 +227,17 @@ typedef struct xen_kexec_unload {
} xen_kexec_unload_t;
DEFINE_XEN_GUEST_HANDLE(xen_kexec_unload_t);
+/*
+ * Figure out whether we have an image loaded. An return value of
+ * zero indicates success while XEN_ENODEV implies no image loaded.
+ *
+ * Type must be one of KEXEC_TYPE_DEFAULT or KEXEC_TYPE_CRASH.
+ */
+#define KEXEC_CMD_kexec_status 6
+typedef struct xen_kexec_status {
+ uint8_t type;
+} xen_kexec_status_t;
+DEFINE_XEN_GUEST_HANDLE(xen_kexec_status_t);
#else /* __XEN_INTERFACE_VERSION__ < 0x00040400 */
#define KEXEC_CMD_kexec_load KEXEC_CMD_kexec_load_v1
--
2.5.5
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related
* Re: powerpc-ieee1275 and grub-mkfont dependency
From: Aaro Koskinen @ 2016-11-14 22:13 UTC (permalink / raw)
To: The development of GNU GRUB
Cc: Vladimir 'φ-coder/phcoder' Serbinenko
In-Reply-To: <CAA91j0URv_T8k39D-Z45ZdScvrwBE35_enJvioHU43acqc28uQ@mail.gmail.com>
Hi,
On Thu, Nov 10, 2016 at 04:53:23PM +0300, Andrei Borzenkov wrote:
> I do not like it, sorry. If this platform supports framebuffer we
> should build grub with framebuffer. If you do not (want to) use it -
> fine, nobody forces you to do it. But on this path we get
> proliferation of slightly different incompatible binaries in the wild.
What's then the point of having --disable-grub-mkfont (or any
--disable/enable-* option)?
A.
^ permalink raw reply
* [PATCH v1 2/2] kexec: Support -S paramter to return whether the kexec payload is loaded.
From: Konrad Rzeszutek Wilk @ 2016-11-14 22:12 UTC (permalink / raw)
To: david.vrabel, xen-devel, kexec
Cc: elena.ufimtseva, daniel.kiper, Konrad Rzeszutek Wilk
In-Reply-To: <1479161573-12671-1-git-send-email-konrad.wilk@oracle.com>
Instead of the scripts having to poke at various fields we can
provide that functionality via the -S parameter.
Returns 0 if the payload is loaded. Can be used in combination
with -l or -p to get the state of the proper kexec image.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
v0: First version (internal product).
v1: Posted on kexec mailing list. Changed -s to -S
CC: kexec@lists.infradead.org
CC: xen-devel@lists.xenproject.org
CC: Daniel Kiper <daniel.kiper@oracle.com>
---
kexec/kexec-xen.c | 20 ++++++++++++++++++
kexec/kexec.8 | 5 +++++
kexec/kexec.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
kexec/kexec.h | 5 ++++-
4 files changed, 85 insertions(+), 6 deletions(-)
diff --git a/kexec/kexec-xen.c b/kexec/kexec-xen.c
index 24a4191..5a1e9d2 100644
--- a/kexec/kexec-xen.c
+++ b/kexec/kexec-xen.c
@@ -105,6 +105,26 @@ int xen_kexec_unload(uint64_t kexec_flags)
return ret;
}
+int xen_kexec_status(uint64_t kexec_flags)
+{
+ xc_interface *xch;
+ uint8_t type;
+ int ret;
+
+ xch = xc_interface_open(NULL, NULL, 0);
+ if (!xch)
+ return -1;
+
+ type = (kexec_flags & KEXEC_ON_CRASH) ? KEXEC_TYPE_CRASH
+ : KEXEC_TYPE_DEFAULT;
+
+ ret = xc_kexec_status(xch, type);
+
+ xc_interface_close(xch);
+
+ return ret;
+}
+
void xen_kexec_exec(void)
{
xc_interface *xch;
diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 4d0c1d1..02f4ccf 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -107,6 +107,11 @@ command:
.B \-d\ (\-\-debug)
Enable debugging messages.
.TP
+.B \-D\ (\-\-status)
+Return 0 if the type (by default crash) is loaded. Can be used in conjuction
+with -l or -p to toggle the type. Note it will
+.BR not\ load\ the\ kernel.
+.TP
.B \-e\ (\-\-exec)
Run the currently loaded kernel. Note that it will reboot into the loaded kernel without calling shutdown(8).
.TP
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 500e5a9..bc72688 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -855,6 +855,32 @@ static int k_unload (unsigned long kexec_flags)
return result;
}
+static int kexec_loaded(void);
+static int __kexec_loaded(const char *f);
+
+static int k_status(unsigned long kexec_flags)
+{
+ int result;
+ long native_arch;
+
+ /* set the arch */
+ native_arch = physical_arch();
+ if (native_arch < 0) {
+ return -1;
+ }
+ kexec_flags |= native_arch;
+
+ if (xen_present())
+ result = xen_kexec_status(kexec_flags);
+ else {
+ if (kexec_flags & KEXEC_ON_CRASH)
+ result = __kexec_loaded("/sys/kernel/kexec_crash_loaded");
+ else
+ result = kexec_loaded();
+ }
+ return result;
+}
+
/*
* Start a reboot.
*/
@@ -890,8 +916,6 @@ static int my_exec(void)
return -1;
}
-static int kexec_loaded(void);
-
static int load_jump_back_helper_image(unsigned long kexec_flags, void *entry)
{
int result;
@@ -970,6 +994,7 @@ void usage(void)
" to original kernel.\n"
" -s, --kexec-file-syscall Use file based syscall for kexec operation\n"
" -d, --debug Enable debugging to help spot a failure.\n"
+ " -S, --status Return 0 if the type (by default crash) is loaded.\n"
"\n"
"Supported kernel file types and options: \n");
for (i = 0; i < file_types; i++) {
@@ -981,7 +1006,7 @@ void usage(void)
printf("\n");
}
-static int kexec_loaded(void)
+static int __kexec_loaded(const char *file)
{
long ret = -1;
FILE *fp;
@@ -992,7 +1017,7 @@ static int kexec_loaded(void)
if (xen_present())
return 1;
- fp = fopen("/sys/kernel/kexec_loaded", "r");
+ fp = fopen(file, "r");
if (fp == NULL)
return -1;
@@ -1015,6 +1040,12 @@ static int kexec_loaded(void)
return (int)ret;
}
+static int kexec_loaded(void)
+{
+ return __kexec_loaded("/sys/kernel/kexec_loaded");
+}
+
+
/*
* Remove parameter from a kernel command line. Helper function by get_command_line().
*/
@@ -1204,6 +1235,7 @@ int main(int argc, char *argv[])
int do_unload = 0;
int do_reuse_initrd = 0;
int do_kexec_file_syscall = 0;
+ int do_status = 0;
void *entry = 0;
char *type = 0;
char *endptr;
@@ -1345,6 +1377,9 @@ int main(int argc, char *argv[])
case OPT_KEXEC_FILE_SYSCALL:
/* We already parsed it. Nothing to do. */
break;
+ case OPT_STATUS:
+ do_status = 1;
+ break;
default:
break;
}
@@ -1355,6 +1390,20 @@ int main(int argc, char *argv[])
if (skip_sync)
do_sync = 0;
+ if (do_status) {
+ if (kexec_flags == 0)
+ kexec_flags = KEXEC_ON_CRASH;
+ do_load = 0;
+ do_reuse_initrd = 0;
+ do_unload = 0;
+ do_load = 0;
+ do_shutdown = 0;
+ do_sync = 0;
+ do_ifdown = 0;
+ do_exec = 0;
+ do_load_jump_back_helper = 0;
+ }
+
if (do_load && (kexec_flags & KEXEC_ON_CRASH) &&
!is_crashkernel_mem_reserved()) {
die("Memory for crashkernel is not reserved\n"
@@ -1392,7 +1441,9 @@ int main(int argc, char *argv[])
check_reuse_initrd();
arch_reuse_initrd();
}
-
+ if (do_status) {
+ result = k_status(kexec_flags);
+ }
if (do_unload) {
if (do_kexec_file_syscall)
result = kexec_file_unload(kexec_file_flags);
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 9194f1c..2b06f59 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -219,6 +219,7 @@ extern int file_types;
#define OPT_TYPE 't'
#define OPT_PANIC 'p'
#define OPT_KEXEC_FILE_SYSCALL 's'
+#define OPT_STATUS 'S'
#define OPT_MEM_MIN 256
#define OPT_MEM_MAX 257
#define OPT_REUSE_INITRD 258
@@ -245,8 +246,9 @@ extern int file_types;
{ "reuseinitrd", 0, 0, OPT_REUSE_INITRD }, \
{ "kexec-file-syscall", 0, 0, OPT_KEXEC_FILE_SYSCALL }, \
{ "debug", 0, 0, OPT_DEBUG }, \
+ { "status", 0, 0, OPT_STATUS }, \
-#define KEXEC_OPT_STR "h?vdfxyluet:ps"
+#define KEXEC_OPT_STR "h?vdfxyluet:psS"
extern void dbgprint_mem_range(const char *prefix, struct memory_range *mr, int nr_mr);
extern void die(const char *fmt, ...)
@@ -311,5 +313,6 @@ int xen_present(void);
int xen_kexec_load(struct kexec_info *info);
int xen_kexec_unload(uint64_t kexec_flags);
void xen_kexec_exec(void);
+int xen_kexec_status(uint64_t kexec_flags);
#endif /* KEXEC_H */
--
2.5.5
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related
* [PATCH v1 1/2] xen/kexec: Find out whether an kexec type is loaded.
From: Konrad Rzeszutek Wilk @ 2016-11-14 22:12 UTC (permalink / raw)
To: david.vrabel, xen-devel, kexec
Cc: elena.ufimtseva, daniel.kiper, Konrad Rzeszutek Wilk
In-Reply-To: <1479161573-12671-1-git-send-email-konrad.wilk@oracle.com>
The tools that use kexec are asynchronous in nature and do
not keep state changes. As such provide an hypercall to find
out whether an image has been loaded for either type.
Note: No need to modify XSM as it has one size fits all
check and does not check for subcommands.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
v0: Internal version.
v1: Dropped Reviewed-by, posting on xen-devel.
CC: Elena Ufimtseva <elena.ufimtseva@oracle.com>
CC: Daniel Kiper <daniel.kiper@oracle.com>
---
tools/libxc/include/xenctrl.h | 8 ++++++++
tools/libxc/xc_kexec.c | 27 +++++++++++++++++++++++++++
xen/common/kexec.c | 25 +++++++++++++++++++++++++
xen/include/public/kexec.h | 11 +++++++++++
4 files changed, 71 insertions(+)
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 2c83544..aa5d798 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -2574,6 +2574,14 @@ int xc_kexec_load(xc_interface *xch, uint8_t type, uint16_t arch,
*/
int xc_kexec_unload(xc_interface *xch, int type);
+/*
+ * Find out whether the image has been succesfully loaded.
+ *
+ * The can be either KEXEC_TYPE_DEFAULT or KEXEC_TYPE_CRASH.
+ * If zero is returned that means the image is loaded for the type.
+ */
+int xc_kexec_status(xc_interface *xch, int type);
+
typedef xenpf_resource_entry_t xc_resource_entry_t;
/*
diff --git a/tools/libxc/xc_kexec.c b/tools/libxc/xc_kexec.c
index 1cceb5d..95d36ff 100644
--- a/tools/libxc/xc_kexec.c
+++ b/tools/libxc/xc_kexec.c
@@ -126,3 +126,30 @@ out:
return ret;
}
+
+int xc_kexec_status(xc_interface *xch, int type)
+{
+ DECLARE_HYPERCALL;
+ DECLARE_HYPERCALL_BUFFER(xen_kexec_status_t, status);
+ int ret = -1;
+
+ status = xc_hypercall_buffer_alloc(xch, status, sizeof(*status));
+ if ( status == NULL )
+ {
+ PERROR("Count not alloc buffer for kexec status hypercall");
+ goto out;
+ }
+
+ status->type = type;
+
+ hypercall.op = __HYPERVISOR_kexec_op;
+ hypercall.arg[0] = KEXEC_CMD_kexec_status;
+ hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(status);
+
+ ret = do_xen_hypercall(xch, &hypercall);
+
+out:
+ xc_hypercall_buffer_free(xch, status);
+
+ return ret;
+}
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index c83d48f..1148f85 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1169,6 +1169,28 @@ static int kexec_unload(XEN_GUEST_HANDLE_PARAM(void) uarg)
return kexec_do_unload(&unload);
}
+static int kexec_status(XEN_GUEST_HANDLE_PARAM(void) uarg)
+{
+ xen_kexec_status_t status;
+ int base, bit, pos;
+
+ if ( unlikely(copy_from_guest(&status, uarg, 1)) )
+ return -EFAULT;
+
+ if ( test_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags) )
+ return -EBUSY;
+
+ if ( kexec_load_get_bits(status.type, &base, &bit) )
+ return -EINVAL;
+
+ pos = (test_bit(bit, &kexec_flags) != 0);
+
+ if ( !test_bit(base + pos, &kexec_flags) )
+ return -ENOENT;
+
+ return 0;
+}
+
static int do_kexec_op_internal(unsigned long op,
XEN_GUEST_HANDLE_PARAM(void) uarg,
bool_t compat)
@@ -1208,6 +1230,9 @@ static int do_kexec_op_internal(unsigned long op,
case KEXEC_CMD_kexec_unload:
ret = kexec_unload(uarg);
break;
+ case KEXEC_CMD_kexec_status:
+ ret = kexec_status(uarg);
+ break;
}
return ret;
diff --git a/xen/include/public/kexec.h b/xen/include/public/kexec.h
index a6a0a88..29dcb5d 100644
--- a/xen/include/public/kexec.h
+++ b/xen/include/public/kexec.h
@@ -227,6 +227,17 @@ typedef struct xen_kexec_unload {
} xen_kexec_unload_t;
DEFINE_XEN_GUEST_HANDLE(xen_kexec_unload_t);
+/*
+ * Figure out whether we have an image loaded. An return value of
+ * zero indicates success while XEN_ENODEV implies no image loaded.
+ *
+ * Type must be one of KEXEC_TYPE_DEFAULT or KEXEC_TYPE_CRASH.
+ */
+#define KEXEC_CMD_kexec_status 6
+typedef struct xen_kexec_status {
+ uint8_t type;
+} xen_kexec_status_t;
+DEFINE_XEN_GUEST_HANDLE(xen_kexec_status_t);
#else /* __XEN_INTERFACE_VERSION__ < 0x00040400 */
#define KEXEC_CMD_kexec_load KEXEC_CMD_kexec_load_v1
--
2.5.5
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related
* [PATCH v1] Add in kexec -S for status, and add new Xen hypercall to support this.
From: Konrad Rzeszutek Wilk @ 2016-11-14 22:12 UTC (permalink / raw)
To: david.vrabel, xen-devel, kexec; +Cc: elena.ufimtseva, daniel.kiper
Heya!
I am cross-posting on two mailing lists:
xen-devel@lists.xenproject.org
kexec@lists.infradead.org
as it may be easier to review and provide input then me going back and forth.
Anyhow the patches are to help with the various distro's poking in
/sys/../kexec to figure out whether an kexec image is loaded.
This can be done using the -S parameter now with the patch #2.
Also I add an hypercall to Xen so that if kexec is running under Xen
the same information can be retrieved (see patch #1).
Thanks!
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply
* [PATCH] cmem: add special handling for dra72x variant
From: Denys Dmytriyenko @ 2016-11-14 22:13 UTC (permalink / raw)
To: meta-ti
From: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
recipes-kernel/linux/cmem.inc | 7 +++++-
recipes-kernel/linux/files/dra7xx/cmem-dra72x.dtsi | 29 ++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
create mode 100644 recipes-kernel/linux/files/dra7xx/cmem-dra72x.dtsi
diff --git a/recipes-kernel/linux/cmem.inc b/recipes-kernel/linux/cmem.inc
index b60909c..d4edc60 100644
--- a/recipes-kernel/linux/cmem.inc
+++ b/recipes-kernel/linux/cmem.inc
@@ -4,17 +4,22 @@
CMEM_MACHINE = "${MACHINE}"
CMEM_MACHINE_am57xx-evm = "am571x am572x"
CMEM_MACHINE_am57xx-hs-evm = "am571x am572x"
+CMEM_MACHINE_dra7xx-evm = "dra72x dra74x"
+CMEM_MACHINE_dra7xx-hs-evm = "dra72x dra74x"
# Set cmem.dtsi per machine or machine variant
CMEM_DTSI = "cmem.dtsi"
CMEM_DTSI_am571x = "cmem-am571x.dtsi"
+CMEM_DTSI_dra72x = "cmem-dra72x.dtsi"
# Split device trees between variants
CMEM_DEVICETREE = "${KERNEL_DEVICETREE}"
CMEM_DEVICETREE_am571x = "am571x-idk.dtb am571x-idk-lcd-osd.dtb am571x-idk-lcd-osd101t2587.dtb"
CMEM_DEVICETREE_am572x = "am57xx-beagle-x15.dtb am57xx-beagle-x15-revb1.dtb am57xx-evm.dtb am57xx-evm-reva3.dtb am572x-idk.dtb \
am572x-idk-lcd-osd.dtb am572x-idk-lcd-osd101t2587.dtb"
-
+CMEM_DEVICETREE_dra72x = "dra72-evm.dtb dra72-evm-lcd-lg.dtb dra72-evm-lcd-osd.dtb dra72-evm-lcd-osd101t2587.dtb \
+ dra72-evm-revc.dtb dra72-evm-revc-lcd-osd101t2045.dtb dra72-evm-revc-lcd-osd101t2587.dtb"
+CMEM_DEVICETREE_dra74x = "dra7-evm.dtb dra7-evm-lcd-lg.dtb dra7-evm-lcd-osd.dtb dra7-evm-lcd-osd101t2587.dtb"
# Flag to enable CMEM injection
RESERVE_CMEM ?= "0"
diff --git a/recipes-kernel/linux/files/dra7xx/cmem-dra72x.dtsi b/recipes-kernel/linux/files/dra7xx/cmem-dra72x.dtsi
new file mode 100644
index 0000000..ebd6129
--- /dev/null
+++ b/recipes-kernel/linux/files/dra7xx/cmem-dra72x.dtsi
@@ -0,0 +1,29 @@
+/ {
+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ cmem_block_mem_0: cmem_block_mem@a0000000 {
+ reg = <0x0 0xa0000000 0x0 0x0c000000>;
+ no-map;
+ status = "okay";
+ };
+ };
+
+ cmem {
+ compatible = "ti,cmem";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ #pool-size-cells = <2>;
+
+ status = "okay";
+
+ cmem_block_0: cmem_block@0 {
+ reg = <0>;
+ memory-region = <&cmem_block_mem_0>;
+ cmem-buf-pools = <1 0x0 0x0c000000>;
+ };
+ };
+};
--
2.7.4
^ permalink raw reply related
* blk-mq: preparation of the ground for BFQ inclusion
From: Paolo Valente @ 2016-11-14 22:13 UTC (permalink / raw)
To: Jens Axboe
Cc: Linus Walleij, Mark Brown, Ulf Hansson, Omar Sandoval, Jan Kara,
Bart Van Assche, linux-block, Christoph Hellwig
Hi Jens,
have you had time to look into the first extensions/changes required?
Any time plan?
Thanks,
Paolo
^ permalink raw reply
* Re: [PATCH] cpufreq: intel_pstate: Synchronize sysfs limits
From: Rafael J. Wysocki @ 2016-11-14 22:11 UTC (permalink / raw)
To: Srinivas Pandruvada
Cc: Rafael J. Wysocki, Len Brown, Rafael J. Wysocki, Linux PM
In-Reply-To: <1479161257.6544.33.camel@linux.intel.com>
On Mon, Nov 14, 2016 at 11:07 PM, Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
> On Mon, 2016-11-14 at 02:04 +0100, Rafael J. Wysocki wrote:
>> On Sat, Nov 12, 2016 at 1:11 AM, Srinivas Pandruvada
>>
> [...]
>> + get_online_cpus();
>> > + for_each_online_cpu(cpu) {
>> > + if (all_cpu_data[cpu])
>> > + cpufreq_update_policy(cpu);
>>
>> cpufreq_update_policy() calls cpufreq_cpu_get() to get the policy
>> anyway which does the requisite policy existence check (although it
>> is
>> a bit racy now, but that's a bug in there that we should not have to
>> work around here), so it should be sufficient to do this
>> for_each_possible_cpu() without additional locking.
>>
> I will change in the next patch set.
Wait, wait, there's a better way I think, but I'll need to send a
patch to explain what I mean. :-) Will do that shortly.
Thanks,
Rafael
^ permalink raw reply
* qed, qedi patchset submission
From: Arun Easi @ 2016-11-14 21:53 UTC (permalink / raw)
To: Martin K. Petersen, David Miller, linux-scsi, netdev
Hi Martin, David,
This is regarding the submission of the recent patch series we have posted
to linux-scsi and netdev:
[PATCH v2 0/6] Add QLogic FastLinQ iSCSI (qedi) driver.
[PATCH v2 1/6] qed: Add support for hardware offloaded iSCSI.
[PATCH v2 2/6] qed: Add iSCSI out of order packet handling.
[PATCH v2 3/6] qedi: Add QLogic FastLinQ offload iSCSI driver framework.
[PATCH v2 4/6] qedi: Add LL2 iSCSI interface for offload iSCSI.
[PATCH v2 5/6] qedi: Add support for iSCSI session management.
[PATCH v2 6/6] qedi: Add support for data path.
Patches 1 & 2 are "qed" module patches that goes under
drivers/net/ethernet/qlogic/qed/ and include/linux/qed/ directory.
- These are the iSCSI enablement changes to the common "qed"
module. There is no dependency for these patches and so
can go independently.
Patches 3, 4, 5 & 6 are the qedi patches that is aimed towards
drivers/scsi/qedi/ directory.
- These are the core qedi changes and is dependent on the
qed changes (invokes qed_XXX functions).
As qed sits in the net tree, the patches are usually submitted via netdev.
Do you have any preference or thoughts on how the "qed" patches be
approached? Just as a reference, our rdma driver "qedr" went through
something similar[1], and eventually "qed" patches were taken by David
in the net tree and "qedr", in the rdma tree (obviously) by Doug L.
Hi David,
For the "qed" enablement sent with the v2 series, we did not prefix the
qed patches with "[PATCH net-next]" prefix, so netdev folks may have
failed to notice/review that, sorry about that. We will send the next (v3)
series with that corrected.
Right now, we are basing the "qed" patches on top of latest net + net-next
tree. FYI, I tried a test merge of net-next/master + qed patches with
"net/master" and I see no conflict in qed.
Regards,
-Arun
[1] http://marc.info/?l=linux-rdma&m=147509152719831&w=2
^ permalink raw reply
* Re: [PATCH v2] cpufreq: conservative: Decrease frequency faster when the update deferred
From: Rafael J. Wysocki @ 2016-11-14 22:09 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Stratos Karafotis, Rafael J. Wysocki, Viresh Kumar,
linux-pm@vger.kernel.org, LKML
In-Reply-To: <CAJZ5v0hO2T41qkPNETqJv7yfJ-=V34gqr_gEy7bNxg83e5HB+g@mail.gmail.com>
On Mon, Nov 14, 2016 at 10:59 PM, Rafael J. Wysocki <rafael@kernel.org> wrote:
> On Mon, Nov 14, 2016 at 10:46 PM, Stratos Karafotis
> <stratosk@semaphore.gr> wrote:
>>
>>
>> On 14/11/2016 10:44 μμ, Rafael J. Wysocki wrote:
>>> On Sat, Nov 12, 2016 at 10:04 PM, Stratos Karafotis
>>> <stratosk@semaphore.gr> wrote:
>>>> Conservative governor changes the CPU frequency in steps.
>>>> That means that if a CPU runs at max frequency, it will need several
>>>> sampling periods to return to min frequency when the workload
>>>> is finished.
>>>>
>>>> If the update function that calculates the load and target frequency
>>>> is deferred, the governor might need even more time to decrease the
>>>> frequency.
>>>>
>>>> This may have impact to power consumption and after all conservative
>>>> should decrease the frequency if there is no workload at every sampling
>>>> rate.
>>>>
>>>> To resolve the above issue calculate the number of sampling periods
>>>> that the update is deferred. Considering that for each sampling period
>>>> conservative should drop the frequency by a freq_step because the
>>>> CPU was idle apply the proper subtraction to requested frequency.
>>>>
>>>> Below, the kernel trace with and without this patch. First an
>>>> intensive workload is applied on a specific CPU. Then the workload
>>>> is removed and the CPU goes to idle.
>>>>
>>>> WITHOUT
>>>>
>>>> <idle>-0 [007] dN.. 620.329153: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.350857: cpu_frequency: state=1700000 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.370856: cpu_frequency: state=1900000 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.390854: cpu_frequency: state=2100000 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.411853: cpu_frequency: state=2200000 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.432854: cpu_frequency: state=2400000 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.453854: cpu_frequency: state=2600000 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.494856: cpu_frequency: state=2900000 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.515856: cpu_frequency: state=3100000 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.536858: cpu_frequency: state=3300000 cpu_id=7
>>>> kworker/7:2-556 [007] .... 620.557857: cpu_frequency: state=3401000 cpu_id=7
>>>> <idle>-0 [007] d... 669.591363: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 669.591939: cpu_idle: state=4294967295 cpu_id=7
>>>> <idle>-0 [007] d... 669.591980: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] dN.. 669.591989: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 670.201224: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 670.221975: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 670.222016: cpu_frequency: state=3300000 cpu_id=7
>>>> <idle>-0 [007] d... 670.222026: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 670.234964: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 670.801251: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 671.236046: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 671.236073: cpu_frequency: state=3100000 cpu_id=7
>>>> <idle>-0 [007] d... 671.236112: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 671.393437: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 671.401277: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 671.404083: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 671.404111: cpu_frequency: state=2900000 cpu_id=7
>>>> <idle>-0 [007] d... 671.404125: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 671.404974: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 671.501180: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 671.995414: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 671.995459: cpu_frequency: state=2800000 cpu_id=7
>>>> <idle>-0 [007] d... 671.995469: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 671.996287: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 672.001305: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 672.078374: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 672.078410: cpu_frequency: state=2600000 cpu_id=7
>>>> <idle>-0 [007] d... 672.078419: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 672.158020: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 672.158040: cpu_frequency: state=2400000 cpu_id=7
>>>> <idle>-0 [007] d... 672.158044: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 672.160038: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 672.234557: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 672.237121: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 672.237174: cpu_frequency: state=2100000 cpu_id=7
>>>> <idle>-0 [007] d... 672.237186: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 672.237778: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 672.267902: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 672.269860: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 672.269906: cpu_frequency: state=1900000 cpu_id=7
>>>> <idle>-0 [007] d... 672.269914: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 672.271902: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 672.751342: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 672.823056: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-556 [007] .... 672.823095: cpu_frequency: state=1600000 cpu_id=7
>>>>
>>>> WITH
>>>>
>>>> <idle>-0 [007] dN.. 4380.928009: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4380.949767: cpu_frequency: state=2000000 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4380.969765: cpu_frequency: state=2200000 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4381.009766: cpu_frequency: state=2500000 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4381.029767: cpu_frequency: state=2600000 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4381.049769: cpu_frequency: state=2800000 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4381.069769: cpu_frequency: state=3000000 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4381.089771: cpu_frequency: state=3100000 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4381.109772: cpu_frequency: state=3400000 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4381.129773: cpu_frequency: state=3401000 cpu_id=7
>>>> <idle>-0 [007] d... 4428.226159: cpu_idle: state=1 cpu_id=7
>>>> <idle>-0 [007] d... 4428.226176: cpu_idle: state=4294967295 cpu_id=7
>>>> <idle>-0 [007] d... 4428.226181: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 4428.227177: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 4428.551640: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 4428.649239: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4428.649268: cpu_frequency: state=2800000 cpu_id=7
>>>> <idle>-0 [007] d... 4428.649278: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 4428.689856: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 4428.799542: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 4428.801683: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4428.801748: cpu_frequency: state=1700000 cpu_id=7
>>>> <idle>-0 [007] d... 4428.801761: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 4428.806545: cpu_idle: state=4294967295 cpu_id=7
>>>> ...
>>>> <idle>-0 [007] d... 4429.051880: cpu_idle: state=4 cpu_id=7
>>>> <idle>-0 [007] d... 4429.086240: cpu_idle: state=4294967295 cpu_id=7
>>>> kworker/7:2-399 [007] .... 4429.086293: cpu_frequency: state=1600000 cpu_id=7
>>>>
>>>> Without the patch the CPU dropped to min frequency after 3.2s
>>>> With the patch applied the CPU dropped to min frequency after 0.86s
>>>>
>>>> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
>>>> ---
>>>> v1 -> v2
>>>> - Use correct terminology in change log
>>>> - Change the member variable name from 'deferred_periods' to 'idle_periods'
>>>> - Fix format issue
>>>>
>>>> drivers/cpufreq/cpufreq_conservative.c | 14 +++++++++++++-
>>>> drivers/cpufreq/cpufreq_governor.c | 18 +++++++++++++-----
>>>> drivers/cpufreq/cpufreq_governor.h | 1 +
>>>> 3 files changed, 27 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
>>>> index fa5ece3..d787772 100644
>>>> --- a/drivers/cpufreq/cpufreq_conservative.c
>>>> +++ b/drivers/cpufreq/cpufreq_conservative.c
>>>> @@ -73,7 +73,19 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy)
>>>> */
>>>> if (cs_tuners->freq_step == 0)
>>>> goto out;
>>>> -
>>>> + /*
>>>> + * Decrease requested_freq for each idle period that we didn't
>>>> + * update the frequency
>>>> + */
>>>> + if (policy_dbs->idle_periods < UINT_MAX) {
>>>> + unsigned int freq_target = policy_dbs->idle_periods *
>>>> + get_freq_target(cs_tuners, policy);
>>>> + if (requested_freq > freq_target)
>>>> + requested_freq -= freq_target;
>>>> + else
>>>> + requested_freq = policy->min;
>>>> + policy_dbs->idle_periods = UINT_MAX;
>>>> + }
>>>> /*
>>>> * If requested_freq is out of range, it is likely that the limits
>>>> * changed in the meantime, so fall back to current frequency in that
>>>> diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
>>>> index 3729474..1bc7137 100644
>>>> --- a/drivers/cpufreq/cpufreq_governor.c
>>>> +++ b/drivers/cpufreq/cpufreq_governor.c
>>>> @@ -117,7 +117,7 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
>>>> struct policy_dbs_info *policy_dbs = policy->governor_data;
>>>> struct dbs_data *dbs_data = policy_dbs->dbs_data;
>>>> unsigned int ignore_nice = dbs_data->ignore_nice_load;
>>>> - unsigned int max_load = 0;
>>>> + unsigned int max_load = 0, idle_periods = UINT_MAX;
>>>> unsigned int sampling_rate, io_busy, j;
>>>>
>>>> /*
>>>> @@ -163,8 +163,12 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
>>>> * calls, so the previous load value can be used then.
>>>> */
>>>> load = j_cdbs->prev_load;
>>>> - } else if (unlikely(time_elapsed > 2 * sampling_rate &&
>>>> - j_cdbs->prev_load)) {
>>>> + } else if (unlikely(time_elapsed > 2 * sampling_rate)) {
>>>> + unsigned int periods = time_elapsed / sampling_rate;
>>>> +
>>>> + if (periods < idle_periods)
>>>> + idle_periods = periods;
>>>> +
>>>> /*
>>>> * If the CPU had gone completely idle and a task has
>>>> * just woken up on this CPU now, it would be unfair to
>>>> @@ -189,8 +193,10 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
>>>> * 'time_elapsed' (as compared to the sampling rate)
>>>> * indicates this scenario.
>>>> */
>>>> - load = j_cdbs->prev_load;
>>>> - j_cdbs->prev_load = 0;
>>>> + if (j_cdbs->prev_load) {
>>>> + load = j_cdbs->prev_load;
>>>> + j_cdbs->prev_load = 0;
>>>> + }
>>>> } else {
>>>> if (time_elapsed >= idle_time) {
>>>> load = 100 * (time_elapsed - idle_time) / time_elapsed;
>>>> @@ -218,6 +224,8 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
>>>> if (load > max_load)
>>>> max_load = load;
>>>> }
>>>> + policy_dbs->idle_periods = idle_periods;
>>>> +
>>>> return max_load;
>>>> }
>>>> EXPORT_SYMBOL_GPL(dbs_update);
>>>
>>> I have a murky suspicion that the changes in dbs_update() are going to
>>> break something. I need to recall what it was, though.
>>
>> The only change in dbs_update() is the calculation of 'idle_periods'.
>> If I don't miss something I left current functionality untouched.
>
> Well, not quite. The else branch may now trigger when
> j_cdbs->prev_load is zero too which it didn't do before, AFAICS.
What I mean is that the "if else" never triggers when
j_cdbs->prev_load is zero before the change, but that changes, so the
"else" branch will not cover the "j_cdbs->prev_load equal to zero"
case any more. I'm not sure how much that matters ATM, though.
Sent too quickly, sorry.
Thanks,
Rafael
^ permalink raw reply
* Re: [PATCH] net/phy/vitesse: Configure RGMII skew on VSC8601, if needed
From: Alex @ 2016-11-14 21:54 UTC (permalink / raw)
To: Florian Fainelli, David Miller; +Cc: gokhan, netdev, linux-kernel
In-Reply-To: <d567c69f-6b57-7083-9090-df01fb140e36@gmail.com>
On 11/14/2016 01:25 PM, Florian Fainelli wrote:
> On 11/14/2016 01:18 PM, David Miller wrote:
>> From: Alexandru Gagniuc <alex.g@adaptrum.com>
>> Date: Sat, 12 Nov 2016 15:32:13 -0800
>>
>>> + if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
>>> + ret = vsc8601_add_skew(phydev);
>>
>> I think you should use phy_interface_is_rgmii() here.
>>
>
> This would include all RGMII modes, here I think the intent is to check
> for PHY_INTERFACE_MODE_RGMII_ID and PHY_INTERFACE_MODE_RGMII_TXID (or
> RXID),
That is correct.
> Alexandru, what direction does the skew settings apply to?
It applies a skew in both TX and RX directions.
Alex
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2016-11-14 22:08 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) Fix off by one wrt. indexing when dumping /proc/net/route entries, from
Alexander Duyck.
2) Fix lockdep splats in iwlwifi, from Johannes Berg.
3) Cure panic when inserting certain netfilter rules when NFT_SET_HASH
is disabled, from Liping Zhang.
4) Memory leak when nft_expr_clone() fails, also from Liping Zhang.
5) Disable UFO when path will apply IPSEC tranformations, from Jakub
Sitnicki.
6) Don't bogusly double cwnd in dctcp module, from Florian Westphal.
7) skb_checksum_help() should never actually use the value "0" for
the resulting checksum, that has a special meaning, use CSUM_MANGLED_0
instead. From Eric Dumazet.
8) Per-tx/rx queue statistic strings are wrong in qed driver, fix from
Yuval MIntz.
9) Fix SCTP reference counting of associations and transports in
sctp_diag. From Xin Long.
10) When we hit ip6tunnel_xmit() we could have come from an ipv4
path in a previous layer or similar, so explicitly clear the
ipv6 control block in the skb. From Eli Cooper.
11) Fix bogus sleeping inside of inet_wait_for_connect(), from WANG
Cong.
12) Correct deivce ID of T6 adapter in cxgb4 driver, from Hariprasad
Shenai.
13) Fix potential access past the end of the skb page frag array in
tcp_sendmsg(). From Eric Dumazet.
14) 'skb' can legitimately be NULL in inet{,6}_exact_dif_match(). Fix
from David Ahern.
15) Don't return an error in tcp_sendmsg() if we wronte any bytes
successfully, from Eric Dumazet.
16) Extraneous unlocks in netlink_diag_dump(), we removed the locking
but forgot to purge these unlock calls. From Eric Dumazet.
17) Fix memory leak in error path of __genl_register_family(). We
leak the attrbuf, from WANG Cong.
18) cgroupstats netlink policy table is mis-sized, from WANG Cong.
19) Several XDP bug fixes in mlx5, from Saeed Mahameed.
20) Fix several device refcount leaks in network drivers, from Johan
Hovold.
21) icmp6_send() should use skb dst device not skb->dev to determine
L3 routing domain. From David Ahern.
22) ip_vs_genl_family sets maxattr incorrectly, from WANG Cong.
23) We leak new macvlan port in some cases of maclan_common_netlink()
errors. Fix from Gao Feng.
24) Similar to the icmp6_send() fix, icmp_route_lookup() should determine
L3 routing domain using skb_dst(skb)->dev not skb->dev. Also
from David Ahern.
25) Several fixes for route offloading and FIB notification handling
in mlxsw driver, from Jiri Pirko.
26) Properly cap __skb_flow_dissect()'s return value, from Eric
Dumazet.
27) Fix long standing regression in ipv4 redirect handling,
wrt. validating the new neighbour's reachability. From
Stephen Suryaputra Lin.
28) If sk_filter() trims the packet excessively, handle it reasonably
in tcp input instead of exploding. From Eric Dumazet.
29) Fix handling of napi hash state when copying channels in sfc
driver, from Bert Kenward.
Please pull, thanks a lot!
The following changes since commit 2a26d99b251b8625d27aed14e97fc10707a3a81f:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2016-10-29 20:33:20 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
for you to fetch changes up to ac571de999e14b87890cb960ad6f03fbdde6abc8:
mlxsw: spectrum_router: Flush FIB tables during fini (2016-11-14 16:45:16 -0500)
----------------------------------------------------------------
Alexander Duyck (1):
fib_trie: Correct /proc/net/route off by one error
Allan Chou (1):
Net Driver: Add Cypress GX3 VID=04b4 PID=3610.
Andy Gospodarek (1):
bgmac: stop clearing DMA receive control register right after it is set
Arkadi Sharshevsky (1):
mlxsw: spectrum_router: Correctly dump neighbour activity
Arnd Bergmann (3):
brcmfmac: avoid maybe-uninitialized warning in brcmf_cfg80211_start_ap
netfilter: ip_vs_sync: fix bogus maybe-uninitialized warning
vxlan: hide unused local variable
Baoquan He (2):
Revert "bnx2: Reset device during driver initialization"
bnx2: Wait for in-flight DMA to complete at probe stage
Baruch Siach (1):
net: bpqether.h: remove if_ether.h guard
Benjamin Poirier (1):
bna: Add synchronization for tx ring.
Bert Kenward (1):
sfc: clear napi_hash state when copying channels
Christophe Jaillet (1):
net/mlx5: Simplify a test
Colin Ian King (2):
net: ethernet: ixp4xx_eth: fix spelling mistake in debug message
ps3_gelic: fix spelling mistake in debug message
Daniel Borkmann (2):
bpf: fix htab map destruction when extra reserve is in use
bpf: fix map not being uncharged during map creation failure
David Ahern (4):
net: tcp: check skb is non-NULL for exact match on lookups
net: icmp6_send should use dst dev to determine L3 domain
net: icmp_route_lookup should use rt dev to determine L3 domain
net: tcp response should set oif only if it is L3 master
David S. Miller (14):
Merge tag 'wireless-drivers-for-davem-2016-10-30' of git://git.kernel.org/.../kvalo/wireless-drivers
Merge branch 'sctp-hold-transport-fixes'
Merge tag 'linux-can-fixes-for-4.9-20161031' of git://git.kernel.org/.../mkl/linux-can
Merge branch 'xgene-coalescing-bugs'
Merge branch 'mlx5-fixes'
Merge branch 'phy-ref-leaks'
Merge branch 'qcom-emac-pause'
Merge git://git.kernel.org/.../pablo/nf
Merge branch 'qed-fixes'
Merge branch 'mlxsw-fixes'
Merge branch 'fix-bpf_redirect'
Merge branch 'bnxt_en-fixes'
Merge branch 'mlxsw-fixes'
Merge branch 'bnx2-kdump-fix'
Dongli Zhang (2):
xen-netfront: do not cast grant table reference to signed short
xen-netfront: cast grant table reference first to type int
Eli Cooper (2):
ip6_tunnel: Clear IP6CB in ip6tunnel_xmit()
ip6_udp_tunnel: remove unused IPCB related codes
Eric Dumazet (12):
net: clear sk_err_soft in sk_clone_lock()
net: mangle zero checksum in skb_checksum_help()
tcp: fix potential memory corruption
tcp: fix return value for partial writes
dccp: do not release listeners too soon
dccp: do not send reset to already closed sockets
dccp: fix out of bound access in dccp_v4_err()
netlink: netlink_diag_dump() runs without locks
ipv6: dccp: fix out of bound access in dccp_v6_err()
ipv6: dccp: add missing bind_conflict to dccp_ipv6_mapped
net: __skb_flow_dissect() must cap its return value
tcp: take care of truncations done by sk_filter()
Fabian Mewes (1):
Documentation: networking: dsa: Update tagging protocols
Florian Fainelli (1):
net: stmmac: Fix lack of link transition for fixed PHYs
Florian Westphal (5):
netfilter: conntrack: avoid excess memory allocation
dctcp: avoid bogus doubling of cwnd after loss
netfilter: connmark: ignore skbs with magic untracked conntrack objects
netfilter: conntrack: fix CT target for UNSPEC helpers
netfilter: conntrack: refine gc worker heuristics
Gao Feng (1):
driver: macvlan: Destroy new macvlan port if macvlan_common_newlink failed.
Guenter Roeck (1):
r8152: Fix error path in open function
Guilherme G. Piccoli (1):
ehea: fix operation state report
Haim Dreyfuss (1):
iwlwifi: mvm: comply with fw_restart mod param on suspend
Hariprasad Shenai (1):
cxgb4: correct device ID of T6 adapter
Huy Nguyen (1):
net/mlx5: Fix invalid pointer reference when prof_sel parameter is invalid
Ido Schimmel (2):
mlxsw: spectrum: Fix incorrect reuse of MID entries
mlxsw: spectrum_router: Flush FIB tables during fini
Isaac Boukris (1):
unix: escape all null bytes in abstract unix domain socket
Iyappan Subramanian (2):
drivers: net: xgene: fix: Disable coalescing on v1 hardware
drivers: net: xgene: fix: Coalescing values for v2 hardware
Jakub Sitnicki (1):
ipv6: Don't use ufo handling on later transformed packets
Jiri Pirko (2):
mlxsw: spectrum_router: Fix handling of neighbour structure
mlxsw: spectrum_router: Ignore FIB notification events for non-init namespaces
Johan Hovold (4):
phy: fix device reference leaks
net: ethernet: ti: cpsw: fix device and of_node leaks
net: ethernet: ti: davinci_emac: fix device reference leak
net: hns: fix device reference leaks
Johannes Berg (1):
iwlwifi: pcie: mark command queue lock with separate lockdep class
John Allen (1):
ibmvnic: Start completion queue negotiation at server-provided optimum values
John W. Linville (1):
netfilter: nf_tables: fix type mismatch with error return from nft_parse_u32_check
Kalle Valo (1):
Merge tag 'iwlwifi-for-kalle-2015-10-25' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Lance Richardson (2):
ipv4: allow local fragmentation in ip_finish_output_gso()
ipv4: update comment to document GSO fragmentation cases.
Liping Zhang (6):
netfilter: nft_dynset: fix panic if NFT_SET_HASH is not enabled
netfilter: nf_tables: fix *leak* when expr clone fail
netfilter: nf_tables: fix race when create new element in dynset
netfilter: nf_tables: destroy the set if fail to add transaction
netfilter: nft_dup: do not use sreg_dev if the user doesn't specify it
netfilter: nf_tables: fix oops when inserting an element into a verdict map
Luca Coelho (4):
iwlwifi: mvm: use ssize_t for len in iwl_debugfs_mem_read()
iwlwifi: mvm: fix d3_test with unified D0/D3 images
iwlwifi: pcie: fix SPLC structure parsing
iwlwifi: mvm: fix netdetect starting/stopping for unified images
Lukas Resch (1):
can: sja1000: plx_pci: Add support for Moxa CAN devices
Maciej Żenczykowski (1):
net-ipv6: on device mtu change do not add mtu to mtu-less routes
Marcelo Ricardo Leitner (1):
sctp: assign assoc_id earlier in __sctp_connect
Mark Lord (1):
r8152: Fix broken RX checksums.
Martin KaFai Lau (2):
bpf: Fix bpf_redirect to an ipip/ip6tnl dev
bpf: Add test for bpf_redirect to ipip/ip6tnl
Mathias Krause (1):
rtnl: reset calcit fptr in rtnl_unregister()
Michael Chan (2):
bnxt_en: Fix ring arithmetic in bnxt_setup_tc().
bnxt_en: Fix VF virtual link state.
Michael S. Tsirkin (1):
virtio-net: drop legacy features in virtio 1 mode
Mike Frysinger (1):
Revert "include/uapi/linux/atm_zatm.h: include linux/time.h"
Mintz, Yuval (2):
qede: Fix statistics' strings for Tx/Rx queues
qede: Correctly map aggregation replacement pages
Oliver Hartkopp (1):
can: bcm: fix warning in bcm_connect/proc_register
Or Gerlitz (3):
net/mlx5e: Disallow changing name-space for VF representors
net/mlx5e: Handle matching on vlan priority for offloaded TC rules
net/mlx5: E-Switch, Set the actions for offloaded rules properly
Rafał Miłecki (1):
net: bgmac: fix reversed checks for clock control flag
Ram Amrani (2):
qed: configure ll2 RoCE v1/v2 flavor correctly
qed: Correct rdma params configuration
Russell King (1):
net: mv643xx_eth: ensure coalesce settings survive read-modify-write
Saeed Mahameed (3):
MAINTAINERS: Update MELLANOX MLX5 core VPI driver maintainers
net/mlx5e: Fix XDP error path of mlx5e_open_channel()
net/mlx5e: Re-arrange XDP SQ/CQ creation
Sara Sharon (1):
iwlwifi: mvm: wake the wait queue when the RX sync counter is zero
Soheil Hassas Yeganeh (1):
sock: fix sendmmsg for partial sendmsg
Stephen Suryaputra Lin (1):
ipv4: use new_gw for redirect neigh lookup
Tariq Toukan (1):
Revert "net/mlx4_en: Fix panic during reboot"
Thomas Falcon (2):
ibmvnic: Unmap ibmvnic_statistics structure
ibmvnic: Fix size of debugfs name buffer
Timur Tabi (3):
net: qcom/emac: use correct value for SGMII_LN_UCDR_SO_GAIN_MODE0
net: qcom/emac: configure the external phy to allow pause frames
net: qcom/emac: enable flow control if requested
Ulrich Weber (1):
netfilter: nf_conntrack_sip: extend request line validation
WANG Cong (4):
inet: fix sleeping inside inet_wait_for_connect()
genetlink: fix a memory leak on error path
taskstats: fix the length of cgroupstats_cmd_get_policy
ipvs: use IPVS_CMD_ATTR_MAX for family.maxattr
Xin Long (5):
ipv6: add mtu lock check in __ip6_rt_update_pmtu
sctp: hold transport instead of assoc in sctp_diag
sctp: return back transport in __sctp_rcv_init_lookup
sctp: hold transport instead of assoc when lookup assoc in rx path
sctp: change sk state only when it has assocs in sctp_shutdown
Yotam Gigi (1):
mlxsw: spectrum: Fix refcount bug on span entries
Documentation/networking/dsa/dsa.txt | 3 +-
MAINTAINERS | 1 +
drivers/net/can/sja1000/plx_pci.c | 18 ++++++++++
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 12 -------
drivers/net/ethernet/apm/xgene/xgene_enet_hw.h | 2 ++
drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 3 +-
drivers/net/ethernet/apm/xgene/xgene_enet_ring2.c | 12 ++++---
drivers/net/ethernet/broadcom/bgmac.c | 9 +++--
drivers/net/ethernet/broadcom/bnx2.c | 48 +++++++++++++++++++-------
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 11 +++---
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 4 +--
drivers/net/ethernet/brocade/bna/bnad.c | 4 +--
drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h | 2 +-
drivers/net/ethernet/hisilicon/hns/hnae.c | 8 ++++-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 ++
drivers/net/ethernet/ibm/ibmvnic.c | 10 +++---
drivers/net/ethernet/marvell/mv643xx_eth.c | 2 ++
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 1 -
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 31 +++++++++--------
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 5 ++-
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 3 +-
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 5 +--
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 ++-
drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 2 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 134 ++++++++++++++++++++++++++++++++++++----------------------------------
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 14 ++++----
drivers/net/ethernet/qlogic/qed/qed_hsi.h | 3 --
drivers/net/ethernet/qlogic/qed/qed_ll2.c | 1 +
drivers/net/ethernet/qlogic/qed/qed_main.c | 17 +++++----
drivers/net/ethernet/qlogic/qede/qede_ethtool.c | 25 +++++++++-----
drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +-
drivers/net/ethernet/qualcomm/emac/emac-mac.c | 15 +++++---
drivers/net/ethernet/qualcomm/emac/emac-sgmii.c | 2 +-
drivers/net/ethernet/sfc/efx.c | 3 ++
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++
drivers/net/ethernet/ti/cpsw-phy-sel.c | 3 ++
drivers/net/ethernet/ti/davinci_emac.c | 10 +++---
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 2 +-
drivers/net/ethernet/xscale/ixp4xx_eth.c | 3 +-
drivers/net/macvlan.c | 31 ++++++++++++-----
drivers/net/phy/phy_device.c | 2 ++
drivers/net/usb/ax88179_178a.c | 17 +++++++++
drivers/net/usb/r8152.c | 21 ++++++-----
drivers/net/virtio_net.c | 30 ++++++++++------
drivers/net/vxlan.c | 4 ++-
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 49 ++++++++++++++++++++------
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 4 +--
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 3 +-
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 3 +-
drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 33 ++++++++++++++----
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 79 +++++++++++++++++++++++++-----------------
drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 8 +++++
drivers/net/xen-netfront.c | 4 +--
include/linux/ipv6.h | 2 +-
include/linux/netdevice.h | 15 ++++++++
include/net/ip.h | 3 +-
include/net/ip6_tunnel.h | 1 +
include/net/netfilter/nf_conntrack_labels.h | 3 +-
include/net/netfilter/nf_tables.h | 8 +++--
include/net/sctp/sctp.h | 2 +-
include/net/sock.h | 4 +--
include/net/tcp.h | 3 +-
include/uapi/linux/atm_zatm.h | 1 -
include/uapi/linux/bpqether.h | 2 --
kernel/bpf/hashtab.c | 3 +-
kernel/bpf/syscall.c | 4 ++-
kernel/taskstats.c | 6 +++-
net/can/bcm.c | 32 ++++++++++++-----
net/core/dev.c | 19 ++++------
net/core/filter.c | 68 +++++++++++++++++++++++++++++++-----
net/core/flow_dissector.c | 11 ++++--
net/core/rtnetlink.c | 1 +
net/core/sock.c | 6 ++--
net/dccp/ipv4.c | 16 +++++----
net/dccp/ipv6.c | 19 +++++-----
net/dccp/proto.c | 4 +++
net/ipv4/af_inet.c | 9 +++--
net/ipv4/fib_trie.c | 21 +++++------
net/ipv4/icmp.c | 4 +--
net/ipv4/ip_forward.c | 2 +-
net/ipv4/ip_output.c | 25 ++++++++------
net/ipv4/ip_tunnel_core.c | 11 ------
net/ipv4/ipmr.c | 2 +-
net/ipv4/netfilter/nft_dup_ipv4.c | 6 ++--
net/ipv4/route.c | 4 ++-
net/ipv4/tcp.c | 4 +--
net/ipv4/tcp_dctcp.c | 13 ++++++-
net/ipv4/tcp_ipv4.c | 19 +++++++++-
net/ipv6/icmp.c | 2 +-
net/ipv6/ip6_output.c | 2 +-
net/ipv6/ip6_udp_tunnel.c | 3 --
net/ipv6/netfilter/nft_dup_ipv6.c | 6 ++--
net/ipv6/route.c | 4 +++
net/ipv6/tcp_ipv6.c | 14 +++++---
net/netfilter/ipvs/ip_vs_ctl.c | 2 +-
net/netfilter/ipvs/ip_vs_sync.c | 7 ++--
net/netfilter/nf_conntrack_core.c | 49 +++++++++++++++++++++-----
net/netfilter/nf_conntrack_helper.c | 11 ++++--
net/netfilter/nf_conntrack_sip.c | 5 ++-
net/netfilter/nf_tables_api.c | 18 ++++++----
net/netfilter/nft_dynset.c | 19 ++++++----
net/netfilter/nft_set_hash.c | 19 +++++++---
net/netfilter/nft_set_rbtree.c | 2 +-
net/netfilter/xt_connmark.c | 4 +--
net/netlink/diag.c | 5 +--
net/netlink/genetlink.c | 4 ++-
net/sctp/input.c | 35 +++++++++----------
net/sctp/ipv6.c | 2 +-
net/sctp/socket.c | 27 +++++++--------
net/socket.c | 2 ++
net/unix/af_unix.c | 3 +-
samples/bpf/Makefile | 4 +++
samples/bpf/tc_l2_redirect.sh | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
samples/bpf/tc_l2_redirect_kern.c | 236 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
samples/bpf/tc_l2_redirect_user.c | 73 +++++++++++++++++++++++++++++++++++++++
120 files changed, 1358 insertions(+), 465 deletions(-)
create mode 100755 samples/bpf/tc_l2_redirect.sh
create mode 100644 samples/bpf/tc_l2_redirect_kern.c
create mode 100644 samples/bpf/tc_l2_redirect_user.c
^ permalink raw reply
* Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs
From: Tony Lindgren @ 2016-11-14 22:08 UTC (permalink / raw)
To: Linus Walleij
Cc: Haojian Zhuang, Masahiro Yamada, Grygorii Strashko,
Nishanth Menon, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Linux-OMAP
In-Reply-To: <20161114205243.GU7138@atomide.com>
* Tony Lindgren <tony@atomide.com> [161114 12:54]:
> * Tony Lindgren <tony@atomide.com> [161111 12:27]:
> > * Linus Walleij <linus.walleij@linaro.org> [161111 12:17]:
> > > On Tue, Oct 25, 2016 at 11:02 PM, Tony Lindgren <tony@atomide.com> wrote:
> > > > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > >
> > > I don't see why this is necessary?
> >
> > It's needed because the pin controller driver has not yet
> > finished it's probe at this point. We end up calling functions
> > in the device driver where no struct pinctrl_dev is yet known
> > to the driver. Asking a device driver to do something before
> > it's probe is done does not quite follow the Linux driver model :)
> >
> > > The hogging was placed inside pinctrl_register() so that any hogs
> > > would be taken before it returns, so nothing else can take it
> > > before the controller itself has the first chance. This semantic
> > > needs to be preserved I think.
> > >
> > > > + schedule_delayed_work(&pctldev->hog_work,
> > > > + msecs_to_jiffies(100));
> > >
> > > If we arbitrarily delay, something else can go in and take the
> > > pins used by the hogs before the pinctrl core? That is what
> > > we want to avoid.
> > >
> > > Hm, 100ms seems arbitrarily chosen BTW. Can it be 1 ms?
> > > 1 ns?
> >
> > Yeah well seems like it should not matter but the race we need
> > to remove somehow.
> >
> > > I'm pretty sure that whatever it is that needs to happen before
> > > the hog work runs can race with this delayed work under
> > > some circumstances (such as slow external expanders
> > > on i2c). It should be impossible for that to happen
> > > and I don't think it is?
> >
> > Yes it's totally possible even with delay set to 0.
> >
> > Maybe we could add some trigger on the first consumer request
> > and if that does not happen use the timer?
>
> Below is what I came up with for removing the race for hogs. We
> can do it by not registering the pctldev until in the deferred
> work, does that seem OK to you?
Oops, that does not yet work, will have to look into it more.
Regards,
Tony
^ 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.