[PATCH 0/2] ALSA-Digigram VX222: Fine-tuning for four function implementations
From: Markus ElfringDate: Sat, 18 Nov 2017 21:27:50 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Adjust ten function calls together with a variable assignment Use common error handling code in two functions sound/pci/vx222/vx222.c | 53 + sound/pci/vx222/vx222_ops.c | 19 +--- 2 files changed, 41 insertions(+), 31 deletions(-) -- 2.15.0
[PATCH 0/2] ALSA-Digigram VX222: Fine-tuning for four function implementations
From: Markus Elfring Date: Sat, 18 Nov 2017 21:27:50 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Adjust ten function calls together with a variable assignment Use common error handling code in two functions sound/pci/vx222/vx222.c | 53 + sound/pci/vx222/vx222_ops.c | 19 +--- 2 files changed, 41 insertions(+), 31 deletions(-) -- 2.15.0
[PATCH] ARM: exynos: add machine description for ODROID-XU3/4
This patch is to add the machine descriptions for ODROID-XU3/4 boards in order to present the hardware name at /proc/cputinfo rather than "SAMSUNG EXYNOS (Flattened Device Tree)". An embedded open source project, such as DietPi, reads the hardware name to run different features. $ cat /proc/cpuinfo | grep Hardware Hardware: ODROID-XU4 Signed-off-by: Dongjin Kim--- arch/arm/mach-exynos/exynos.c | 28 1 file changed, 28 insertions(+) diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index c404c15ad07f..6197dbf9f48b 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -241,3 +241,31 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)") .dt_compat = exynos_dt_compat, .dt_fixup = exynos_dt_fixup, MACHINE_END + +#define ODROID_MACHINE_START(name, compat) \ + DT_MACHINE_START(EXYNOS5422_ODROID_##name, "ODROID-"#name) \ + .l2c_aux_val= 0x3c41, \ + .l2c_aux_mask = 0xc20f, \ + .smp= smp_ops(exynos_smp_ops), \ + .map_io = exynos_init_io, \ + .init_early = exynos_firmware_init, \ + .init_irq = exynos_init_irq, \ + .init_machine = exynos_dt_machine_init, \ + .init_late = exynos_init_late, \ + .dt_compat = compat, \ + .dt_fixup = exynos_dt_fixup, \ + MACHINE_END + +static char const *const exynos5422_odroidxu3_dt_compat[] __initconst = { + "hardkernel,odroid-xu3", + "hardkernel,odroid-xu3-lite", + NULL, +}; + +static char const *const exynos5422_odroidxu4_dt_compat[] __initconst = { + "hardkernel,odroid-xu4", + NULL, +}; + +ODROID_MACHINE_START(XU3, exynos5422_odroidxu3_dt_compat) +ODROID_MACHINE_START(XU4, exynos5422_odroidxu4_dt_compat) -- 2.11.0
[PATCH] ARM: exynos: add machine description for ODROID-XU3/4
This patch is to add the machine descriptions for ODROID-XU3/4 boards in order to present the hardware name at /proc/cputinfo rather than "SAMSUNG EXYNOS (Flattened Device Tree)". An embedded open source project, such as DietPi, reads the hardware name to run different features. $ cat /proc/cpuinfo | grep Hardware Hardware: ODROID-XU4 Signed-off-by: Dongjin Kim --- arch/arm/mach-exynos/exynos.c | 28 1 file changed, 28 insertions(+) diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index c404c15ad07f..6197dbf9f48b 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -241,3 +241,31 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)") .dt_compat = exynos_dt_compat, .dt_fixup = exynos_dt_fixup, MACHINE_END + +#define ODROID_MACHINE_START(name, compat) \ + DT_MACHINE_START(EXYNOS5422_ODROID_##name, "ODROID-"#name) \ + .l2c_aux_val= 0x3c41, \ + .l2c_aux_mask = 0xc20f, \ + .smp= smp_ops(exynos_smp_ops), \ + .map_io = exynos_init_io, \ + .init_early = exynos_firmware_init, \ + .init_irq = exynos_init_irq, \ + .init_machine = exynos_dt_machine_init, \ + .init_late = exynos_init_late, \ + .dt_compat = compat, \ + .dt_fixup = exynos_dt_fixup, \ + MACHINE_END + +static char const *const exynos5422_odroidxu3_dt_compat[] __initconst = { + "hardkernel,odroid-xu3", + "hardkernel,odroid-xu3-lite", + NULL, +}; + +static char const *const exynos5422_odroidxu4_dt_compat[] __initconst = { + "hardkernel,odroid-xu4", + NULL, +}; + +ODROID_MACHINE_START(XU3, exynos5422_odroidxu3_dt_compat) +ODROID_MACHINE_START(XU4, exynos5422_odroidxu4_dt_compat) -- 2.11.0
Re: [RFC v2] prctl: prctl(PR_SET_IDLE, PR_IDLE_MODE_KILLME), for stateless idle loops
On Fri, Nov 3, 2017 at 2:09 AM, Michal Hockowrote: > On Thu 02-11-17 23:35:44, Shawn Landden wrote: >> 16 bytes per process is kinda spendy, but I want to keep >> lru behavior, which mem_score_adj does not allow. When a supervisor, >> like Android's user input is keeping track this can be done in user-space. >> It could be pulled out of task_struct if an cross-indexing additional >> red-black tree is added to support pid-based lookup. > > This is still an abuse and the patch is wrong. We really do have an API > to use I fail to see why you do not use it. When I looked at wait_queue_head_t it was 20 bytes.
Re: [RFC v2] prctl: prctl(PR_SET_IDLE, PR_IDLE_MODE_KILLME), for stateless idle loops
On Fri, Nov 3, 2017 at 2:09 AM, Michal Hocko wrote: > On Thu 02-11-17 23:35:44, Shawn Landden wrote: >> 16 bytes per process is kinda spendy, but I want to keep >> lru behavior, which mem_score_adj does not allow. When a supervisor, >> like Android's user input is keeping track this can be done in user-space. >> It could be pulled out of task_struct if an cross-indexing additional >> red-black tree is added to support pid-based lookup. > > This is still an abuse and the patch is wrong. We really do have an API > to use I fail to see why you do not use it. When I looked at wait_queue_head_t it was 20 bytes.
Re: [GIT PULL] platform-drivers-x86 for 4.15-1
On Sat, Nov 18, 2017 at 10:37 AM, Linus Torvaldswrote: > > So I note that you seem to use the same summary script that Darren used. .. oh, and I note a *much* worse issue. You add new drivers and then default them to "on". THAT IS COMPLETELY UNACCEPTABLE. I don't know why I have to say this every single merge window, but let's do it one more time: As a developer, you think _your_ driver or feature is the most important thing ever, and you have the hardware. AND ALMOST NOBODY ELSE CARES. Read it and weep. Unless your hardware is completely ubiquitous, it damn well should not default to being defaulted everybody elses config. In particular, people who do "make oldconfig" clearly had a configuration _without_ your hardware and were happy with it, and want to keep it working. That's what "oldconfig" means. You don't say "hey, let's enable this piece of hardware that you don't have anyway, just to waste your time and disk and memory". So the things that merit "default y/m" are (a) you added a Kconfig option for something that used to always be built. Then it merits that "default y" exactly because "make oldconfig" should just work. (b) corollary of the above: if you add a new gatekeeping Kconfig option that hides/shows other Kconfig options (but doesn't generate any code of its own), it should be enabled by default, simply so that by default people will see those other options. (c) your driver itself defaults to off, but you then have sub-driver options for behavior or similar, where you can give sane defaults for people who _do_ have your hardware, and want the driver for it, and within those constraints the extended option makes sense (d) your piece of hardware or infrastructure really is something that everybody expects. If you have CONFIG_NET or CONFIG_BLOCK, you get to enable it by default. But something like CONFIG_DELL_SMBIOS sure as hell does not merit being default on. Not even if you have enabled WMI. EVERY SINGLE "default" line that got added by this branch was wrong. Stop doing this. It's a serious violation of peoples expectations. When I do "make oldconfig", I don't want some new random hardware support. Linus
Re: [GIT PULL] platform-drivers-x86 for 4.15-1
On Sat, Nov 18, 2017 at 10:37 AM, Linus Torvalds wrote: > > So I note that you seem to use the same summary script that Darren used. .. oh, and I note a *much* worse issue. You add new drivers and then default them to "on". THAT IS COMPLETELY UNACCEPTABLE. I don't know why I have to say this every single merge window, but let's do it one more time: As a developer, you think _your_ driver or feature is the most important thing ever, and you have the hardware. AND ALMOST NOBODY ELSE CARES. Read it and weep. Unless your hardware is completely ubiquitous, it damn well should not default to being defaulted everybody elses config. In particular, people who do "make oldconfig" clearly had a configuration _without_ your hardware and were happy with it, and want to keep it working. That's what "oldconfig" means. You don't say "hey, let's enable this piece of hardware that you don't have anyway, just to waste your time and disk and memory". So the things that merit "default y/m" are (a) you added a Kconfig option for something that used to always be built. Then it merits that "default y" exactly because "make oldconfig" should just work. (b) corollary of the above: if you add a new gatekeeping Kconfig option that hides/shows other Kconfig options (but doesn't generate any code of its own), it should be enabled by default, simply so that by default people will see those other options. (c) your driver itself defaults to off, but you then have sub-driver options for behavior or similar, where you can give sane defaults for people who _do_ have your hardware, and want the driver for it, and within those constraints the extended option makes sense (d) your piece of hardware or infrastructure really is something that everybody expects. If you have CONFIG_NET or CONFIG_BLOCK, you get to enable it by default. But something like CONFIG_DELL_SMBIOS sure as hell does not merit being default on. Not even if you have enabled WMI. EVERY SINGLE "default" line that got added by this branch was wrong. Stop doing this. It's a serious violation of peoples expectations. When I do "make oldconfig", I don't want some new random hardware support. Linus
seccomp() SECCOMP_RET_KILL_PROCESS text for man page
Hi Kees, I came up with the following text (patch below) to describe the SECCOMP_RET_KILL_PROCESS action that you added in 4.14. Does it look okay? SECCOMP_RET_KILL_PROCESS (since Linux 4.14) This value results in immediate termination of the process, with a core dump. The system call is not executed. By contrast with SECCOMP_RET_KILL_THREAD below, all threads in the thread group are terminated. (For a discussion of thread groups, see the description of the CLONE_THREAD flag in clone(2).) The process terminates as though killed by a SIGSYS signal. Even if a signal handler has been registered for SIGSYS, the handler will be ignored in this case and the process always terminates. To a parent process that is waiting on this process (using waitpid(2) or similar), the returned wstatus will indicate that its child was terminated as though by a SIGSYS signal. Cheers, Michael diff --git a/man2/seccomp.2 b/man2/seccomp.2 index 2e912940e..1b6bb2e51 100644 --- a/man2/seccomp.2 +++ b/man2/seccomp.2 @@ -399,6 +399,36 @@ returned by execution of all of the filters. In decreasing order of precedence, the values that may be returned by a seccomp filter are: .TP +.BR SECCOMP_RET_KILL_PROCESS " (since Linux 4.14)" +.\" commit 4d3b0b05aae9ee9ce0970dc4cc0fb3fad5e85945 +.\" commit 0466bdb99e8744bc9befa8d62a317f0fd7fd7421 +This value results in immediate termination of the process, +with a core dump. +The system call is not executed. +By contrast with +.BR SECCOMP_RET_KILL_THREAD +below, all threads in the thread group are terminated. +(For a discussion of thread groups, see the description of the +.BR CLONE_THREAD +flag in +.BR clone (2).) +.IP +The process terminates +.I "as though" +killed by a +.B SIGSYS +signal. +Even if a signal handler has been registered for +.BR SIGSYS , +the handler will be ignored in this case and the process always terminates. +To a parent process that is waiting on this process (using +.BR waitpid (2) +or similar), the returned +.I wstatus +will indicate that its child was terminated as though by a +.BR SIGSYS +signal. +.TP .BR SECCOMP_RET_KILL_THREAD " (or " SECCOMP_RET_KILL ) This value results in immediate termination of the thread that made the system call. -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/
seccomp() SECCOMP_RET_KILL_PROCESS text for man page
Hi Kees, I came up with the following text (patch below) to describe the SECCOMP_RET_KILL_PROCESS action that you added in 4.14. Does it look okay? SECCOMP_RET_KILL_PROCESS (since Linux 4.14) This value results in immediate termination of the process, with a core dump. The system call is not executed. By contrast with SECCOMP_RET_KILL_THREAD below, all threads in the thread group are terminated. (For a discussion of thread groups, see the description of the CLONE_THREAD flag in clone(2).) The process terminates as though killed by a SIGSYS signal. Even if a signal handler has been registered for SIGSYS, the handler will be ignored in this case and the process always terminates. To a parent process that is waiting on this process (using waitpid(2) or similar), the returned wstatus will indicate that its child was terminated as though by a SIGSYS signal. Cheers, Michael diff --git a/man2/seccomp.2 b/man2/seccomp.2 index 2e912940e..1b6bb2e51 100644 --- a/man2/seccomp.2 +++ b/man2/seccomp.2 @@ -399,6 +399,36 @@ returned by execution of all of the filters. In decreasing order of precedence, the values that may be returned by a seccomp filter are: .TP +.BR SECCOMP_RET_KILL_PROCESS " (since Linux 4.14)" +.\" commit 4d3b0b05aae9ee9ce0970dc4cc0fb3fad5e85945 +.\" commit 0466bdb99e8744bc9befa8d62a317f0fd7fd7421 +This value results in immediate termination of the process, +with a core dump. +The system call is not executed. +By contrast with +.BR SECCOMP_RET_KILL_THREAD +below, all threads in the thread group are terminated. +(For a discussion of thread groups, see the description of the +.BR CLONE_THREAD +flag in +.BR clone (2).) +.IP +The process terminates +.I "as though" +killed by a +.B SIGSYS +signal. +Even if a signal handler has been registered for +.BR SIGSYS , +the handler will be ignored in this case and the process always terminates. +To a parent process that is waiting on this process (using +.BR waitpid (2) +or similar), the returned +.I wstatus +will indicate that its child was terminated as though by a +.BR SIGSYS +signal. +.TP .BR SECCOMP_RET_KILL_THREAD " (or " SECCOMP_RET_KILL ) This value results in immediate termination of the thread that made the system call. -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/
Re: [PULL REQUEST] nfsd changes for 4.15
On Sat, Nov 18, 2017 at 10:40 AM, J. Bruce Fieldswrote: > Please pull nfsd changes for 4.15 from: Hmm. This had a tracepoint conflict with the nfs client pull. The resolution seems obvious and I did it, but I'd like people to review the end result but particularly also their workflows, because I don't think that conflict was reported anywhere and doesn't seem to exist in next-20171115. It certainly wasn't mentioned to me in either pull request. Were the nfs client changes not in next? Tssk. Linus
Re: [PULL REQUEST] nfsd changes for 4.15
On Sat, Nov 18, 2017 at 10:40 AM, J. Bruce Fields wrote: > Please pull nfsd changes for 4.15 from: Hmm. This had a tracepoint conflict with the nfs client pull. The resolution seems obvious and I did it, but I'd like people to review the end result but particularly also their workflows, because I don't think that conflict was reported anywhere and doesn't seem to exist in next-20171115. It certainly wasn't mentioned to me in either pull request. Were the nfs client changes not in next? Tssk. Linus
Re: [PATCH] NFSv4: Ensure gcc 4.4.4 can compile initialiser for "invalid_stateid"
On 11/18/2017 01:50 PM, Trond Myklebust wrote: gcc 4.4.4 is too old to have full C11 anonymous union support, so the current initialiser fails to compile. Reported-by: Boris OstrovskySigned-off-by: Trond Myklebust (compile-)Tested-by: Boris Ostrovsky --- fs/nfs/nfs4state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 980462d577ca..231b5ea2464a 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -71,8 +71,8 @@ const nfs4_stateid zero_stateid = { }; const nfs4_stateid invalid_stateid = { { - .seqid = cpu_to_be32(0xU), - .other = { 0 }, + /* Funky initialiser keeps older gcc versions happy */ + .data = { 0xff, 0xff, 0xff, 0xff, 0 }, }, .type = NFS4_INVALID_STATEID_TYPE, };
Re: [PATCH] NFSv4: Ensure gcc 4.4.4 can compile initialiser for "invalid_stateid"
On 11/18/2017 01:50 PM, Trond Myklebust wrote: gcc 4.4.4 is too old to have full C11 anonymous union support, so the current initialiser fails to compile. Reported-by: Boris Ostrovsky Signed-off-by: Trond Myklebust (compile-)Tested-by: Boris Ostrovsky --- fs/nfs/nfs4state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 980462d577ca..231b5ea2464a 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -71,8 +71,8 @@ const nfs4_stateid zero_stateid = { }; const nfs4_stateid invalid_stateid = { { - .seqid = cpu_to_be32(0xU), - .other = { 0 }, + /* Funky initialiser keeps older gcc versions happy */ + .data = { 0xff, 0xff, 0xff, 0xff, 0 }, }, .type = NFS4_INVALID_STATEID_TYPE, };
Re: [PATCH 05/10] x86: jailhouse: Set up timekeeping
On 2017-11-17 23:49, Thomas Gleixner wrote: > On Thu, 16 Nov 2017, Jan Kiszka wrote: >> Calibrate the TSC and, where necessary, the APIC timer against the >> TMTIMER. We need our own implementation as neither the PIC nor the HPET >> are available, and the standard calibration routines try to make use of >> them. > > Why is this needed at all? > > The host the frequency already. So this can be done w/o pmtimer and extra > calibration routine. The hypervisor does not have the frequencies. It will never use the APIC timer (it's owned by the guests), and it has no use case for the TSC so far. Only the root cell (the Linux that booted the system) has that data. Now we could - trust the root cell to provide the right values and export them during startup to the hypervisor and from there to the non-root cells. - calculate the frequencies once and store them in the hyperivsor config, just like other system-specific information, for re-export to the cells. But I don't think option 1 will be ok for all use cases. Maybe a combination of both, falling back to the root cell data if nothing is defined in the config. Let me think about this. Jan
Re: [PATCH 05/10] x86: jailhouse: Set up timekeeping
On 2017-11-17 23:49, Thomas Gleixner wrote: > On Thu, 16 Nov 2017, Jan Kiszka wrote: >> Calibrate the TSC and, where necessary, the APIC timer against the >> TMTIMER. We need our own implementation as neither the PIC nor the HPET >> are available, and the standard calibration routines try to make use of >> them. > > Why is this needed at all? > > The host the frequency already. So this can be done w/o pmtimer and extra > calibration routine. The hypervisor does not have the frequencies. It will never use the APIC timer (it's owned by the guests), and it has no use case for the TSC so far. Only the root cell (the Linux that booted the system) has that data. Now we could - trust the root cell to provide the right values and export them during startup to the hypervisor and from there to the non-root cells. - calculate the frequencies once and store them in the hyperivsor config, just like other system-specific information, for re-export to the cells. But I don't think option 1 will be ok for all use cases. Maybe a combination of both, falling back to the root cell data if nothing is defined in the config. Let me think about this. Jan
Re: [PATCH 02/10] x86: jailhouse: Add infrastructure for running in non-root cell
On 2017-11-17 22:54, Thomas Gleixner wrote: > On Thu, 16 Nov 2017, Jan Kiszka wrote: > >> +config JAILHOUSE_GUEST >> +bool "Jailhouse non-root cell support" >> +depends on PARAVIRT && X86_64 >> +---help--- >> + This option allows to run Linux as guest in a Jailhouse non-root >> + cell. You can leave this option disabled if you only want to start >> + Jailhouse and run Linux afterwards in the root cell. >> + >> + You likely also want to disable CONFIG_SUSPEND and CONFIG_SERIO to >> + avoid access to I/O resources that are usually not assigned to the >> + non-root cell. > > That should be prevented programatically. Theoretically, serio access could also be assigned to a non-root cell. But excluding SUSPEND may make sense unconditionally, will check again. > >> +#include >> +#include >> +#include >> +#include >> + >> +#define SETUP_JAILHOUSE 0x53484c4a /* "JLHS" */ >> + >> +#define SETUP_REQUIRED_VERSION 1 >> + >> +/* >> + * The boot loader is passing platform information via this >> Jailhouse-specific >> + * setup data structure. >> + */ >> +struct jailhouse_setup_data { >> +struct setup_data header; >> +u16 version; >> +u16 compatible_version; >> +u16 pm_timer_address; >> +u16 num_cpus; >> +u64 pci_mmconfig_base; >> +u8 standard_ioapic; >> +u8 cpu_ids[255]; > > Shouldn't this structure and SETUP_JAILHOUSE be defined in a header file > which can be exported to boot loaders? Something like arch/x86/include/uapi/asm/jailhouse_setup.h? Jan
Re: [PATCH 02/10] x86: jailhouse: Add infrastructure for running in non-root cell
On 2017-11-17 22:54, Thomas Gleixner wrote: > On Thu, 16 Nov 2017, Jan Kiszka wrote: > >> +config JAILHOUSE_GUEST >> +bool "Jailhouse non-root cell support" >> +depends on PARAVIRT && X86_64 >> +---help--- >> + This option allows to run Linux as guest in a Jailhouse non-root >> + cell. You can leave this option disabled if you only want to start >> + Jailhouse and run Linux afterwards in the root cell. >> + >> + You likely also want to disable CONFIG_SUSPEND and CONFIG_SERIO to >> + avoid access to I/O resources that are usually not assigned to the >> + non-root cell. > > That should be prevented programatically. Theoretically, serio access could also be assigned to a non-root cell. But excluding SUSPEND may make sense unconditionally, will check again. > >> +#include >> +#include >> +#include >> +#include >> + >> +#define SETUP_JAILHOUSE 0x53484c4a /* "JLHS" */ >> + >> +#define SETUP_REQUIRED_VERSION 1 >> + >> +/* >> + * The boot loader is passing platform information via this >> Jailhouse-specific >> + * setup data structure. >> + */ >> +struct jailhouse_setup_data { >> +struct setup_data header; >> +u16 version; >> +u16 compatible_version; >> +u16 pm_timer_address; >> +u16 num_cpus; >> +u64 pci_mmconfig_base; >> +u8 standard_ioapic; >> +u8 cpu_ids[255]; > > Shouldn't this structure and SETUP_JAILHOUSE be defined in a header file > which can be exported to boot loaders? Something like arch/x86/include/uapi/asm/jailhouse_setup.h? Jan
Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license
>This is neither the GPL-2.0 from >https://www.gnu.org/licenses/gpl-2.0.txt I think it should be the copy from COPYING, in fact, since that's the exact GPL 2.0 license the kernel is under. Library GPL is factually correct; Lesser GPL is a newer name for the same license, but COPYING retains the old name. I don't remember when the FSF moved from Temple place but indeed, the address, which is correct in COPYING, could be updated. Best Jonas Öberg Free Software Foundation Europe | jo...@fsfe.org Your support enables our work (fsfe.org/join)
Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license
>This is neither the GPL-2.0 from >https://www.gnu.org/licenses/gpl-2.0.txt I think it should be the copy from COPYING, in fact, since that's the exact GPL 2.0 license the kernel is under. Library GPL is factually correct; Lesser GPL is a newer name for the same license, but COPYING retains the old name. I don't remember when the FSF moved from Temple place but indeed, the address, which is correct in COPYING, could be updated. Best Jonas Öberg Free Software Foundation Europe | jo...@fsfe.org Your support enables our work (fsfe.org/join)
Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license
You may be confusing things because of a newer version. On Sat, Nov 18, 2017 at 11:03 AM, Charlemagne Lassewrote: > > That should be "GNU Lesser General Public" and not "GNU Library General > Public" That's just FSF revisionism. It used to be called "Library" over "Lesser", in the original GPL2. I suspect your other issues are similar "there's been different versions over time" things. the address being one of them. We've actually taken some of the FSF updates over the years ("19yy" -> "", and the address change) but the main COPYING file still calls the LGPL the "GNU Library General Public License". I refuse to change the original copyright wording due to idiotic internal FSF politics that tried to change history. Linus
[PATCH 3/3] ALSA: trident: Use common error handling code in snd_trident_mixer()
From: Markus ElfringDate: Sat, 18 Nov 2017 19:49:50 +0100 Adjust jump targets so that a bit of exception handling can be better reused at the end of this function. Signed-off-by: Markus Elfring --- sound/pci/trident/trident_main.c | 71 +++- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 9843a61a8ead..2cb5da02ad9b 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -2980,7 +2980,7 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) err = snd_ac97_bus(trident->card, 0, , NULL, >ac97_bus); if (err < 0) - goto __out; + goto free_control; memset(&_ac97, 0, sizeof(_ac97)); _ac97.private_data = trident; @@ -2992,12 +2992,12 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) if (trident->device == TRIDENT_DEVICE_ID_SI7018) { err = snd_trident_sis_reset(trident); if (err < 0) - goto __out; + goto free_control; if (retries-- > 0) goto __again; err = -EIO; } - goto __out; + goto free_control; } /* secondary codec? */ @@ -3025,12 +3025,12 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) kctl = snd_ctl_new1(_trident_vol_wave_control, trident); err = snd_ctl_add(card, kctl); if (err < 0) - goto __out; + goto free_control; kctl->put(kctl, uctl); kctl = snd_ctl_new1(_trident_vol_music_control, trident); err = snd_ctl_add(card, kctl); if (err < 0) - goto __out; + goto free_control; kctl->put(kctl, uctl); outl(trident->musicvol_wavevol = 0x, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL)); } else { @@ -3046,52 +3046,51 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) trident->ctl_vol = snd_ctl_new1(_trident_pcm_vol_control, trident); if (!trident->ctl_vol) - goto __nomem; + goto e_nomem; err = snd_ctl_add(card, trident->ctl_vol); if (err) - goto __out; + goto free_control; trident->ctl_pan = snd_ctl_new1(_trident_pcm_pan_control, trident); if (!trident->ctl_pan) - goto __nomem; + goto e_nomem; err = snd_ctl_add(card, trident->ctl_pan); if (err) - goto __out; + goto free_control; trident->ctl_rvol = snd_ctl_new1(_trident_pcm_rvol_control, trident); if (!trident->ctl_rvol) - goto __nomem; + goto e_nomem; err = snd_ctl_add(card, trident->ctl_rvol); if (err) - goto __out; + goto free_control; trident->ctl_cvol = snd_ctl_new1(_trident_pcm_cvol_control, trident); if (!trident->ctl_cvol) - goto __nomem; + goto e_nomem; err = snd_ctl_add(card, trident->ctl_cvol); if (err) - goto __out; + goto free_control; if (trident->device == TRIDENT_DEVICE_ID_NX) { kctl = snd_ctl_new1(_trident_ac97_rear_control, trident); err = snd_ctl_add(card, kctl); if (err < 0) - goto __out; + goto free_control; kctl->put(kctl, uctl); } if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { kctl = snd_ctl_new1(_trident_spdif_control, trident); - if (kctl == NULL) { - err = -ENOMEM; - goto __out; - } + if (!kctl) + goto e_nomem; + if (trident->ac97->ext_id & AC97_EI_SPDIF) kctl->id.index++; if (trident->ac97_sec && (trident->ac97_sec->ext_id & AC97_EI_SPDIF)) @@ -3099,51 +3098,47 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) idx = kctl->id.index; err = snd_ctl_add(card, kctl); if (err < 0) - goto __out; + goto free_control; kctl->put(kctl, uctl); kctl =
Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license
You may be confusing things because of a newer version. On Sat, Nov 18, 2017 at 11:03 AM, Charlemagne Lasse wrote: > > That should be "GNU Lesser General Public" and not "GNU Library General > Public" That's just FSF revisionism. It used to be called "Library" over "Lesser", in the original GPL2. I suspect your other issues are similar "there's been different versions over time" things. the address being one of them. We've actually taken some of the FSF updates over the years ("19yy" -> "", and the address change) but the main COPYING file still calls the LGPL the "GNU Library General Public License". I refuse to change the original copyright wording due to idiotic internal FSF politics that tried to change history. Linus
[PATCH 3/3] ALSA: trident: Use common error handling code in snd_trident_mixer()
From: Markus Elfring Date: Sat, 18 Nov 2017 19:49:50 +0100 Adjust jump targets so that a bit of exception handling can be better reused at the end of this function. Signed-off-by: Markus Elfring --- sound/pci/trident/trident_main.c | 71 +++- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 9843a61a8ead..2cb5da02ad9b 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -2980,7 +2980,7 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) err = snd_ac97_bus(trident->card, 0, , NULL, >ac97_bus); if (err < 0) - goto __out; + goto free_control; memset(&_ac97, 0, sizeof(_ac97)); _ac97.private_data = trident; @@ -2992,12 +2992,12 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) if (trident->device == TRIDENT_DEVICE_ID_SI7018) { err = snd_trident_sis_reset(trident); if (err < 0) - goto __out; + goto free_control; if (retries-- > 0) goto __again; err = -EIO; } - goto __out; + goto free_control; } /* secondary codec? */ @@ -3025,12 +3025,12 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) kctl = snd_ctl_new1(_trident_vol_wave_control, trident); err = snd_ctl_add(card, kctl); if (err < 0) - goto __out; + goto free_control; kctl->put(kctl, uctl); kctl = snd_ctl_new1(_trident_vol_music_control, trident); err = snd_ctl_add(card, kctl); if (err < 0) - goto __out; + goto free_control; kctl->put(kctl, uctl); outl(trident->musicvol_wavevol = 0x, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL)); } else { @@ -3046,52 +3046,51 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) trident->ctl_vol = snd_ctl_new1(_trident_pcm_vol_control, trident); if (!trident->ctl_vol) - goto __nomem; + goto e_nomem; err = snd_ctl_add(card, trident->ctl_vol); if (err) - goto __out; + goto free_control; trident->ctl_pan = snd_ctl_new1(_trident_pcm_pan_control, trident); if (!trident->ctl_pan) - goto __nomem; + goto e_nomem; err = snd_ctl_add(card, trident->ctl_pan); if (err) - goto __out; + goto free_control; trident->ctl_rvol = snd_ctl_new1(_trident_pcm_rvol_control, trident); if (!trident->ctl_rvol) - goto __nomem; + goto e_nomem; err = snd_ctl_add(card, trident->ctl_rvol); if (err) - goto __out; + goto free_control; trident->ctl_cvol = snd_ctl_new1(_trident_pcm_cvol_control, trident); if (!trident->ctl_cvol) - goto __nomem; + goto e_nomem; err = snd_ctl_add(card, trident->ctl_cvol); if (err) - goto __out; + goto free_control; if (trident->device == TRIDENT_DEVICE_ID_NX) { kctl = snd_ctl_new1(_trident_ac97_rear_control, trident); err = snd_ctl_add(card, kctl); if (err < 0) - goto __out; + goto free_control; kctl->put(kctl, uctl); } if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { kctl = snd_ctl_new1(_trident_spdif_control, trident); - if (kctl == NULL) { - err = -ENOMEM; - goto __out; - } + if (!kctl) + goto e_nomem; + if (trident->ac97->ext_id & AC97_EI_SPDIF) kctl->id.index++; if (trident->ac97_sec && (trident->ac97_sec->ext_id & AC97_EI_SPDIF)) @@ -3099,51 +3098,47 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) idx = kctl->id.index; err = snd_ctl_add(card, kctl); if (err < 0) - goto __out; + goto free_control; kctl->put(kctl, uctl); kctl = snd_ctl_new1(_trident_spdif_default, trident); - if (kctl
[PATCH 2/3] ALSA: trident: Use common error handling code in two functions
From: Markus ElfringDate: Sat, 18 Nov 2017 19:29:35 +0100 Add jump targets so that a bit of exception handling can be better reused at the end of these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- sound/pci/trident/trident.c | 54 +++- sound/pci/trident/trident_main.c | 41 +++--- 2 files changed, 47 insertions(+), 48 deletions(-) diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index fd35f7826845..830402c32395 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c @@ -100,10 +100,9 @@ static int snd_trident_probe(struct pci_dev *pci, == TRIDENT_DEVICE_ID_SI7018 ? 1 : 2, wavetable_size[dev], ); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; + card->private_data = trident; switch (trident->device) { @@ -130,47 +129,46 @@ static int snd_trident_probe(struct pci_dev *pci, card->shortname, trident->port, trident->irq); err = snd_trident_pcm(trident, pcm_dev++); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; + switch (trident->device) { case TRIDENT_DEVICE_ID_DX: case TRIDENT_DEVICE_ID_NX: err = snd_trident_foldback_pcm(trident, pcm_dev++); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; break; } if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { err = snd_trident_spdif_pcm(trident, pcm_dev++); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; } - if (trident->device != TRIDENT_DEVICE_ID_SI7018 && - (err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, - trident->midi_port, - MPU401_INFO_INTEGRATED | - MPU401_INFO_IRQ_HOOK, - -1, >rmidi)) < 0) { - snd_card_free(card); - return err; + + if (trident->device != TRIDENT_DEVICE_ID_SI7018) { + err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, + trident->midi_port, + MPU401_INFO_INTEGRATED | + MPU401_INFO_IRQ_HOOK, + -1, >rmidi); + if (err < 0) + goto free_card; } snd_trident_create_gameport(trident); err = snd_card_register(card); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; + pci_set_drvdata(pci, card); dev++; return 0; + +free_card: + snd_card_free(card); + return err; } static void snd_trident_remove(struct pci_dev *pci) diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 88d666cb3300..9843a61a8ead 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -3587,14 +3587,14 @@ int snd_trident_create(struct snd_card *card, dma_set_coherent_mask(>dev, DMA_BIT_MASK(30)) < 0) { dev_err(card->dev, "architecture does not support 30bit PCI busmaster DMA\n"); - pci_disable_device(pci); - return -ENXIO; + err = -ENXIO; + goto disable_device; } trident = kzalloc(sizeof(*trident), GFP_KERNEL); if (trident == NULL) { - pci_disable_device(pci); - return -ENOMEM; + err = -ENOMEM; + goto disable_device; } trident->device = (pci->vendor << 16) | pci->device; trident->card = card; @@ -3617,16 +3617,15 @@ int snd_trident_create(struct snd_card *card, err = pci_request_regions(pci, "Trident Audio"); if (err < 0) { kfree(trident); - pci_disable_device(pci); - return err; + goto disable_device; } trident->port = pci_resource_start(pci, 0); if (request_irq(pci->irq, snd_trident_interrupt, IRQF_SHARED,
[PATCH 2/3] ALSA: trident: Use common error handling code in two functions
From: Markus Elfring Date: Sat, 18 Nov 2017 19:29:35 +0100 Add jump targets so that a bit of exception handling can be better reused at the end of these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- sound/pci/trident/trident.c | 54 +++- sound/pci/trident/trident_main.c | 41 +++--- 2 files changed, 47 insertions(+), 48 deletions(-) diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index fd35f7826845..830402c32395 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c @@ -100,10 +100,9 @@ static int snd_trident_probe(struct pci_dev *pci, == TRIDENT_DEVICE_ID_SI7018 ? 1 : 2, wavetable_size[dev], ); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; + card->private_data = trident; switch (trident->device) { @@ -130,47 +129,46 @@ static int snd_trident_probe(struct pci_dev *pci, card->shortname, trident->port, trident->irq); err = snd_trident_pcm(trident, pcm_dev++); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; + switch (trident->device) { case TRIDENT_DEVICE_ID_DX: case TRIDENT_DEVICE_ID_NX: err = snd_trident_foldback_pcm(trident, pcm_dev++); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; break; } if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { err = snd_trident_spdif_pcm(trident, pcm_dev++); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; } - if (trident->device != TRIDENT_DEVICE_ID_SI7018 && - (err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, - trident->midi_port, - MPU401_INFO_INTEGRATED | - MPU401_INFO_IRQ_HOOK, - -1, >rmidi)) < 0) { - snd_card_free(card); - return err; + + if (trident->device != TRIDENT_DEVICE_ID_SI7018) { + err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, + trident->midi_port, + MPU401_INFO_INTEGRATED | + MPU401_INFO_IRQ_HOOK, + -1, >rmidi); + if (err < 0) + goto free_card; } snd_trident_create_gameport(trident); err = snd_card_register(card); - if (err < 0) { - snd_card_free(card); - return err; - } + if (err < 0) + goto free_card; + pci_set_drvdata(pci, card); dev++; return 0; + +free_card: + snd_card_free(card); + return err; } static void snd_trident_remove(struct pci_dev *pci) diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 88d666cb3300..9843a61a8ead 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -3587,14 +3587,14 @@ int snd_trident_create(struct snd_card *card, dma_set_coherent_mask(>dev, DMA_BIT_MASK(30)) < 0) { dev_err(card->dev, "architecture does not support 30bit PCI busmaster DMA\n"); - pci_disable_device(pci); - return -ENXIO; + err = -ENXIO; + goto disable_device; } trident = kzalloc(sizeof(*trident), GFP_KERNEL); if (trident == NULL) { - pci_disable_device(pci); - return -ENOMEM; + err = -ENOMEM; + goto disable_device; } trident->device = (pci->vendor << 16) | pci->device; trident->card = card; @@ -3617,16 +3617,15 @@ int snd_trident_create(struct snd_card *card, err = pci_request_regions(pci, "Trident Audio"); if (err < 0) { kfree(trident); - pci_disable_device(pci); - return err; + goto disable_device; } trident->port = pci_resource_start(pci, 0); if (request_irq(pci->irq, snd_trident_interrupt, IRQF_SHARED, KBUILD_MODNAME, trident)) {
[PATCH 1/3] ALSA: trident: Adjust 34 function calls together with a variable assignment
From: Markus ElfringDate: Sat, 18 Nov 2017 18:50:22 +0100 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix affected source code places. Signed-off-by: Markus Elfring --- sound/pci/trident/trident.c | 24 + sound/pci/trident/trident_main.c | 113 ++- 2 files changed, 90 insertions(+), 47 deletions(-) diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index cedf13b64803..fd35f7826845 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c @@ -94,11 +94,13 @@ static int snd_trident_probe(struct pci_dev *pci, if (err < 0) return err; - if ((err = snd_trident_create(card, pci, - pcm_channels[dev], - ((pci->vendor << 16) | pci->device) == TRIDENT_DEVICE_ID_SI7018 ? 1 : 2, - wavetable_size[dev], - )) < 0) { + err = snd_trident_create(card, pci, +pcm_channels[dev], +((pci->vendor << 16) | pci->device) +== TRIDENT_DEVICE_ID_SI7018 ? 1 : 2, +wavetable_size[dev], +); + if (err < 0) { snd_card_free(card); return err; } @@ -127,21 +129,24 @@ static int snd_trident_probe(struct pci_dev *pci, sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d", card->shortname, trident->port, trident->irq); - if ((err = snd_trident_pcm(trident, pcm_dev++)) < 0) { + err = snd_trident_pcm(trident, pcm_dev++); + if (err < 0) { snd_card_free(card); return err; } switch (trident->device) { case TRIDENT_DEVICE_ID_DX: case TRIDENT_DEVICE_ID_NX: - if ((err = snd_trident_foldback_pcm(trident, pcm_dev++)) < 0) { + err = snd_trident_foldback_pcm(trident, pcm_dev++); + if (err < 0) { snd_card_free(card); return err; } break; } if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { - if ((err = snd_trident_spdif_pcm(trident, pcm_dev++)) < 0) { + err = snd_trident_spdif_pcm(trident, pcm_dev++); + if (err < 0) { snd_card_free(card); return err; } @@ -158,7 +163,8 @@ static int snd_trident_probe(struct pci_dev *pci, snd_trident_create_gameport(trident); - if ((err = snd_card_register(card)) < 0) { + err = snd_card_register(card); + if (err < 0) { snd_card_free(card); return err; } diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index eabd84d9ffee..88d666cb3300 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -822,9 +822,10 @@ static int snd_trident_allocate_pcm_mem(struct snd_pcm_substream *substream, struct snd_trident *trident = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct snd_trident_voice *voice = runtime->private_data; - int err; + int err = snd_pcm_lib_malloc_pages(substream, + params_buffer_bytes(hw_params)); - if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) + if (err < 0) return err; if (trident->tlb.entries) { if (err > 0) { /* change */ @@ -1142,12 +1143,11 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream) static int snd_trident_si7018_capture_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { - int err; - - if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) - return err; + int err = snd_pcm_lib_malloc_pages(substream, + params_buffer_bytes(hw_params)); - return snd_trident_allocate_evoice(substream, hw_params); + return (err < 0) ? err : snd_trident_allocate_evoice(substream, +hw_params); } /*--- @@ -2174,9 +2174,10 @@ static const struct snd_pcm_ops snd_trident_spdif_7018_ops = { int snd_trident_pcm(struct snd_trident *trident, int device) { struct snd_pcm *pcm; - int err; + int err =
[PATCH 1/3] ALSA: trident: Adjust 34 function calls together with a variable assignment
From: Markus Elfring Date: Sat, 18 Nov 2017 18:50:22 +0100 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix affected source code places. Signed-off-by: Markus Elfring --- sound/pci/trident/trident.c | 24 + sound/pci/trident/trident_main.c | 113 ++- 2 files changed, 90 insertions(+), 47 deletions(-) diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index cedf13b64803..fd35f7826845 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c @@ -94,11 +94,13 @@ static int snd_trident_probe(struct pci_dev *pci, if (err < 0) return err; - if ((err = snd_trident_create(card, pci, - pcm_channels[dev], - ((pci->vendor << 16) | pci->device) == TRIDENT_DEVICE_ID_SI7018 ? 1 : 2, - wavetable_size[dev], - )) < 0) { + err = snd_trident_create(card, pci, +pcm_channels[dev], +((pci->vendor << 16) | pci->device) +== TRIDENT_DEVICE_ID_SI7018 ? 1 : 2, +wavetable_size[dev], +); + if (err < 0) { snd_card_free(card); return err; } @@ -127,21 +129,24 @@ static int snd_trident_probe(struct pci_dev *pci, sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d", card->shortname, trident->port, trident->irq); - if ((err = snd_trident_pcm(trident, pcm_dev++)) < 0) { + err = snd_trident_pcm(trident, pcm_dev++); + if (err < 0) { snd_card_free(card); return err; } switch (trident->device) { case TRIDENT_DEVICE_ID_DX: case TRIDENT_DEVICE_ID_NX: - if ((err = snd_trident_foldback_pcm(trident, pcm_dev++)) < 0) { + err = snd_trident_foldback_pcm(trident, pcm_dev++); + if (err < 0) { snd_card_free(card); return err; } break; } if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { - if ((err = snd_trident_spdif_pcm(trident, pcm_dev++)) < 0) { + err = snd_trident_spdif_pcm(trident, pcm_dev++); + if (err < 0) { snd_card_free(card); return err; } @@ -158,7 +163,8 @@ static int snd_trident_probe(struct pci_dev *pci, snd_trident_create_gameport(trident); - if ((err = snd_card_register(card)) < 0) { + err = snd_card_register(card); + if (err < 0) { snd_card_free(card); return err; } diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index eabd84d9ffee..88d666cb3300 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -822,9 +822,10 @@ static int snd_trident_allocate_pcm_mem(struct snd_pcm_substream *substream, struct snd_trident *trident = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct snd_trident_voice *voice = runtime->private_data; - int err; + int err = snd_pcm_lib_malloc_pages(substream, + params_buffer_bytes(hw_params)); - if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) + if (err < 0) return err; if (trident->tlb.entries) { if (err > 0) { /* change */ @@ -1142,12 +1143,11 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream) static int snd_trident_si7018_capture_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { - int err; - - if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) - return err; + int err = snd_pcm_lib_malloc_pages(substream, + params_buffer_bytes(hw_params)); - return snd_trident_allocate_evoice(substream, hw_params); + return (err < 0) ? err : snd_trident_allocate_evoice(substream, +hw_params); } /*--- @@ -2174,9 +2174,10 @@ static const struct snd_pcm_ops snd_trident_spdif_7018_ops = { int snd_trident_pcm(struct snd_trident *trident, int device) { struct snd_pcm *pcm; - int err; + int err = snd_pcm_new(trident->card, "trident_dx_nx", +
[PATCH 0/3] ALSA-Trident 4DWave: Fine-tuning for nine function implementations
From: Markus ElfringDate: Sat, 18 Nov 2017 19:50:12 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (3): Adjust 34 function calls together with a variable assignment Use common error handling code in two functions Use common error handling code in snd_trident_mixer() sound/pci/trident/trident.c | 68 ++-- sound/pci/trident/trident_main.c | 221 ++- 2 files changed, 163 insertions(+), 126 deletions(-) -- 2.15.0
[PATCH 0/3] ALSA-Trident 4DWave: Fine-tuning for nine function implementations
From: Markus Elfring Date: Sat, 18 Nov 2017 19:50:12 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (3): Adjust 34 function calls together with a variable assignment Use common error handling code in two functions Use common error handling code in snd_trident_mixer() sound/pci/trident/trident.c | 68 ++-- sound/pci/trident/trident_main.c | 221 ++- 2 files changed, 163 insertions(+), 126 deletions(-) -- 2.15.0
Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license
2017-11-18 20:03 GMT+01:00 Charlemagne Lasse: >> +Ty Coon, President of Vice >> + >> +This General Public License does not permit incorporating your program into >> +proprietary programs. If your program is a subroutine library, you may >> +consider it more useful to permit linking proprietary applications with the >> +library. If this is what you want to do, use the GNU Library General Public >> +License instead of this License. > > "Lesser Library General Public" and not "Library General Public License" I meant: "Lesser General Public License" and not "Library General Public License"
Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license
2017-11-18 20:03 GMT+01:00 Charlemagne Lasse : >> +Ty Coon, President of Vice >> + >> +This General Public License does not permit incorporating your program into >> +proprietary programs. If your program is a subroutine library, you may >> +consider it more useful to permit linking proprietary applications with the >> +library. If this is what you want to do, use the GNU Library General Public >> +License instead of this License. > > "Lesser Library General Public" and not "Library General Public License" I meant: "Lesser General Public License" and not "Library General Public License"
Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license
2017-11-16 19:33 GMT+01:00 Thomas Gleixner: > Add the full text of the GPL 2.0 license to the kernel tree. It was > copied directly from: > >https://spdx.org/licenses/GPL-2.0.html#licenseText > > Add the required tags for reference and tooling. > > Signed-off-by: Thomas Gleixner NACKed-by: Charlemagne Lasse This is neither the GPL-2.0 from https://www.gnu.org/licenses/gpl-2.0.txt (which you should have used) or https://spdx.org/licenses/GPL-2.0.html#licenseText Please download the correct ASCII version from gnu.org and add your SPDX info in front of it. But I have also added detailed info about non-whitespace changes in your patch. But I am sure that you will tell me again that I am only arguing in circles. > > --- > LICENSES/preferred/GPL-2.0 | 348 > + > 1 file changed, 348 insertions(+) > create mode 100644 LICENSES/GPL-2.0 This patch seems to have been modified by hand because the summary doesn't match the patch. > > --- /dev/null > +++ b/LICENSES/preferred/GPL-2.0 > +GNU GENERAL PUBLIC LICENSE > +Version 2, June 1991 > + > +Copyright (C) 1989, 1991 Free Software Foundation, Inc. That should be: "Inc.," and not "Inc." > + > +Everyone is permitted to copy and distribute verbatim copies > +of this license document, but changing it is not allowed. > + > +Preamble > + > +The licenses for most software are designed to take away your freedom to > +share and change it. By contrast, the GNU General Public License is > +intended to guarantee your freedom to share and change free software--to > +make sure the software is free for all its users. This General Public > +License applies to most of the Free Software Foundation's software and to > +any other program whose authors commit to using it. (Some other Free > +Software Foundation software is covered by the GNU Library General Public > +License instead.) You can apply it to your programs, too. That should be "GNU Lesser General Public" and not "GNU Library General Public" > +The precise terms and conditions for copying, distribution and modification > follow. > + > +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION "GNU GENERAL PUBLIC LICENSE" is missing before "TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION" > +To do so, attach the following notices to the program. It is safest to > +attach them to the start of each source file to most effectively convey the > +exclusion of warranty; and each file should have at least the "copyright" > +line and a pointer to where the full notice is found. > + > +One line to give the program's name and a brief idea of what it does. This should actually be: > +Copyright (C) > + > +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. > + > +You should have received a copy of the GNU General Public License along > +with this program; if not, write to the Free Software Foundation, Inc., > +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA This is the wrong address. It should actually be 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > +Yoyodyne, Inc., hereby disclaims all copyright interest in the program > +`Gnomovision' (which makes passes at compilers) written by James > +Hacker. > + > +signature of Ty Coon, 1 April 1989 This should actually be: , 1 April 1989 > +Ty Coon, President of Vice > + > +This General Public License does not permit incorporating your program into > +proprietary programs. If your program is a subroutine library, you may > +consider it more useful to permit linking proprietary applications with the > +library. If this is what you want to do, use the GNU Library General Public > +License instead of this License. "Lesser Library General Public" and not "Library General Public License"
Re: [patch V2 02/11] LICENSES: Add the GPL 2.0 license
2017-11-16 19:33 GMT+01:00 Thomas Gleixner : > Add the full text of the GPL 2.0 license to the kernel tree. It was > copied directly from: > >https://spdx.org/licenses/GPL-2.0.html#licenseText > > Add the required tags for reference and tooling. > > Signed-off-by: Thomas Gleixner NACKed-by: Charlemagne Lasse This is neither the GPL-2.0 from https://www.gnu.org/licenses/gpl-2.0.txt (which you should have used) or https://spdx.org/licenses/GPL-2.0.html#licenseText Please download the correct ASCII version from gnu.org and add your SPDX info in front of it. But I have also added detailed info about non-whitespace changes in your patch. But I am sure that you will tell me again that I am only arguing in circles. > > --- > LICENSES/preferred/GPL-2.0 | 348 > + > 1 file changed, 348 insertions(+) > create mode 100644 LICENSES/GPL-2.0 This patch seems to have been modified by hand because the summary doesn't match the patch. > > --- /dev/null > +++ b/LICENSES/preferred/GPL-2.0 > +GNU GENERAL PUBLIC LICENSE > +Version 2, June 1991 > + > +Copyright (C) 1989, 1991 Free Software Foundation, Inc. That should be: "Inc.," and not "Inc." > + > +Everyone is permitted to copy and distribute verbatim copies > +of this license document, but changing it is not allowed. > + > +Preamble > + > +The licenses for most software are designed to take away your freedom to > +share and change it. By contrast, the GNU General Public License is > +intended to guarantee your freedom to share and change free software--to > +make sure the software is free for all its users. This General Public > +License applies to most of the Free Software Foundation's software and to > +any other program whose authors commit to using it. (Some other Free > +Software Foundation software is covered by the GNU Library General Public > +License instead.) You can apply it to your programs, too. That should be "GNU Lesser General Public" and not "GNU Library General Public" > +The precise terms and conditions for copying, distribution and modification > follow. > + > +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION "GNU GENERAL PUBLIC LICENSE" is missing before "TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION" > +To do so, attach the following notices to the program. It is safest to > +attach them to the start of each source file to most effectively convey the > +exclusion of warranty; and each file should have at least the "copyright" > +line and a pointer to where the full notice is found. > + > +One line to give the program's name and a brief idea of what it does. This should actually be: > +Copyright (C) > + > +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. > + > +You should have received a copy of the GNU General Public License along > +with this program; if not, write to the Free Software Foundation, Inc., > +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA This is the wrong address. It should actually be 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > +Yoyodyne, Inc., hereby disclaims all copyright interest in the program > +`Gnomovision' (which makes passes at compilers) written by James > +Hacker. > + > +signature of Ty Coon, 1 April 1989 This should actually be: , 1 April 1989 > +Ty Coon, President of Vice > + > +This General Public License does not permit incorporating your program into > +proprietary programs. If your program is a subroutine library, you may > +consider it more useful to permit linking proprietary applications with the > +library. If this is what you want to do, use the GNU Library General Public > +License instead of this License. "Lesser Library General Public" and not "Library General Public License"
[PATCH] NFSv4: Ensure gcc 4.4.4 can compile initialiser for "invalid_stateid"
gcc 4.4.4 is too old to have full C11 anonymous union support, so the current initialiser fails to compile. Reported-by: Boris OstrovskySigned-off-by: Trond Myklebust --- fs/nfs/nfs4state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 980462d577ca..231b5ea2464a 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -71,8 +71,8 @@ const nfs4_stateid zero_stateid = { }; const nfs4_stateid invalid_stateid = { { - .seqid = cpu_to_be32(0xU), - .other = { 0 }, + /* Funky initialiser keeps older gcc versions happy */ + .data = { 0xff, 0xff, 0xff, 0xff, 0 }, }, .type = NFS4_INVALID_STATEID_TYPE, }; -- 2.14.3
[PATCH] NFSv4: Ensure gcc 4.4.4 can compile initialiser for "invalid_stateid"
gcc 4.4.4 is too old to have full C11 anonymous union support, so the current initialiser fails to compile. Reported-by: Boris Ostrovsky Signed-off-by: Trond Myklebust --- fs/nfs/nfs4state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 980462d577ca..231b5ea2464a 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -71,8 +71,8 @@ const nfs4_stateid zero_stateid = { }; const nfs4_stateid invalid_stateid = { { - .seqid = cpu_to_be32(0xU), - .other = { 0 }, + /* Funky initialiser keeps older gcc versions happy */ + .data = { 0xff, 0xff, 0xff, 0xff, 0 }, }, .type = NFS4_INVALID_STATEID_TYPE, }; -- 2.14.3
Re: [PATCH v2 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint
> On Nov 18, 2017, at 7:32 AM, Yafang Shaowrote: > > The TCP/IP transition from TCP_LISTEN to TCP_SYN_RECV and some other > transitions are not traced with tcp_set_state tracepoint. > > In order to trace the whole tcp lifespans, two helpers are introduced, > void __tcp_set_state(struct sock *sk, int state) > void __sk_state_store(struct sock *sk, int newstate) > > When do TCP/IP state transition, we should use these two helpers or use > tcp_set_state() other than assigning a value to sk_state directly. > > Signed-off-by: Yafang Shao > --- > include/net/tcp.h | 2 ++ > net/ipv4/inet_connection_sock.c | 6 +++--- > net/ipv4/inet_hashtables.c | 2 +- > net/ipv4/tcp.c | 12 > 4 files changed, 18 insertions(+), 4 deletions(-) > > diff --git a/include/net/tcp.h b/include/net/tcp.h > index 85ea578..4f2d015 100644 > --- a/include/net/tcp.h > +++ b/include/net/tcp.h > @@ -1247,6 +1247,8 @@ static inline bool tcp_checksum_complete(struct sk_buff > *skb) > "Close Wait","Last ACK","Listen","Closing" > }; > #endif > +void __sk_state_store(struct sock *sk, int newstate); > +void __tcp_set_state(struct sock *sk, int state); > void tcp_set_state(struct sock *sk, int state); > > void tcp_done(struct sock *sk); > diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c > index 4ca46dc..f3967f1 100644 > --- a/net/ipv4/inet_connection_sock.c > +++ b/net/ipv4/inet_connection_sock.c > @@ -783,7 +783,7 @@ struct sock *inet_csk_clone_lock(const struct sock *sk, > if (newsk) { > struct inet_connection_sock *newicsk = inet_csk(newsk); > > - newsk->sk_state = TCP_SYN_RECV; > + __tcp_set_state(newsk, TCP_SYN_RECV); > newicsk->icsk_bind_hash = NULL; > > inet_sk(newsk)->inet_dport = inet_rsk(req)->ir_rmt_port; > @@ -877,7 +877,7 @@ int inet_csk_listen_start(struct sock *sk, int backlog) >* It is OK, because this socket enters to hash table only >* after validation is complete. >*/ > - sk_state_store(sk, TCP_LISTEN); > + __sk_state_store(sk, TCP_LISTEN); > if (!sk->sk_prot->get_port(sk, inet->inet_num)) { > inet->inet_sport = htons(inet->inet_num); > > @@ -888,7 +888,7 @@ int inet_csk_listen_start(struct sock *sk, int backlog) > return 0; > } > > - sk->sk_state = TCP_CLOSE; > + __tcp_set_state(sk, TCP_CLOSE); > return err; > } > EXPORT_SYMBOL_GPL(inet_csk_listen_start); > diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c > index e7d15fb..72c15b6 100644 > --- a/net/ipv4/inet_hashtables.c > +++ b/net/ipv4/inet_hashtables.c > @@ -430,7 +430,7 @@ bool inet_ehash_nolisten(struct sock *sk, struct sock > *osk) > sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); > } else { > percpu_counter_inc(sk->sk_prot->orphan_count); > - sk->sk_state = TCP_CLOSE; > + __tcp_set_state(sk, TCP_CLOSE); > sock_set_flag(sk, SOCK_DEAD); > inet_csk_destroy_sock(sk); > } > diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c > index bf97317..2bc7e04 100644 > --- a/net/ipv4/tcp.c > +++ b/net/ipv4/tcp.c > @@ -2036,6 +2036,18 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, > size_t len, int nonblock, > } > EXPORT_SYMBOL(tcp_recvmsg); > > +void __sk_state_store(struct sock *sk, int newstate) > +{ > + trace_tcp_set_state(sk, sk->sk_state, newstate); > + sk_state_store(sk, newstate); > +} > + > +void __tcp_set_state(struct sock *sk, int state) > +{ > + trace_tcp_set_state(sk, sk->sk_state, state); > + sk->sk_state = state; > +} > + > void tcp_set_state(struct sock *sk, int state) > { > int oldstate = sk->sk_state; > -- > 1.8.3.1 > + Brendan
Re: [PATCH v2 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint
> On Nov 18, 2017, at 7:32 AM, Yafang Shao wrote: > > The TCP/IP transition from TCP_LISTEN to TCP_SYN_RECV and some other > transitions are not traced with tcp_set_state tracepoint. > > In order to trace the whole tcp lifespans, two helpers are introduced, > void __tcp_set_state(struct sock *sk, int state) > void __sk_state_store(struct sock *sk, int newstate) > > When do TCP/IP state transition, we should use these two helpers or use > tcp_set_state() other than assigning a value to sk_state directly. > > Signed-off-by: Yafang Shao > --- > include/net/tcp.h | 2 ++ > net/ipv4/inet_connection_sock.c | 6 +++--- > net/ipv4/inet_hashtables.c | 2 +- > net/ipv4/tcp.c | 12 > 4 files changed, 18 insertions(+), 4 deletions(-) > > diff --git a/include/net/tcp.h b/include/net/tcp.h > index 85ea578..4f2d015 100644 > --- a/include/net/tcp.h > +++ b/include/net/tcp.h > @@ -1247,6 +1247,8 @@ static inline bool tcp_checksum_complete(struct sk_buff > *skb) > "Close Wait","Last ACK","Listen","Closing" > }; > #endif > +void __sk_state_store(struct sock *sk, int newstate); > +void __tcp_set_state(struct sock *sk, int state); > void tcp_set_state(struct sock *sk, int state); > > void tcp_done(struct sock *sk); > diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c > index 4ca46dc..f3967f1 100644 > --- a/net/ipv4/inet_connection_sock.c > +++ b/net/ipv4/inet_connection_sock.c > @@ -783,7 +783,7 @@ struct sock *inet_csk_clone_lock(const struct sock *sk, > if (newsk) { > struct inet_connection_sock *newicsk = inet_csk(newsk); > > - newsk->sk_state = TCP_SYN_RECV; > + __tcp_set_state(newsk, TCP_SYN_RECV); > newicsk->icsk_bind_hash = NULL; > > inet_sk(newsk)->inet_dport = inet_rsk(req)->ir_rmt_port; > @@ -877,7 +877,7 @@ int inet_csk_listen_start(struct sock *sk, int backlog) >* It is OK, because this socket enters to hash table only >* after validation is complete. >*/ > - sk_state_store(sk, TCP_LISTEN); > + __sk_state_store(sk, TCP_LISTEN); > if (!sk->sk_prot->get_port(sk, inet->inet_num)) { > inet->inet_sport = htons(inet->inet_num); > > @@ -888,7 +888,7 @@ int inet_csk_listen_start(struct sock *sk, int backlog) > return 0; > } > > - sk->sk_state = TCP_CLOSE; > + __tcp_set_state(sk, TCP_CLOSE); > return err; > } > EXPORT_SYMBOL_GPL(inet_csk_listen_start); > diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c > index e7d15fb..72c15b6 100644 > --- a/net/ipv4/inet_hashtables.c > +++ b/net/ipv4/inet_hashtables.c > @@ -430,7 +430,7 @@ bool inet_ehash_nolisten(struct sock *sk, struct sock > *osk) > sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); > } else { > percpu_counter_inc(sk->sk_prot->orphan_count); > - sk->sk_state = TCP_CLOSE; > + __tcp_set_state(sk, TCP_CLOSE); > sock_set_flag(sk, SOCK_DEAD); > inet_csk_destroy_sock(sk); > } > diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c > index bf97317..2bc7e04 100644 > --- a/net/ipv4/tcp.c > +++ b/net/ipv4/tcp.c > @@ -2036,6 +2036,18 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, > size_t len, int nonblock, > } > EXPORT_SYMBOL(tcp_recvmsg); > > +void __sk_state_store(struct sock *sk, int newstate) > +{ > + trace_tcp_set_state(sk, sk->sk_state, newstate); > + sk_state_store(sk, newstate); > +} > + > +void __tcp_set_state(struct sock *sk, int state) > +{ > + trace_tcp_set_state(sk, sk->sk_state, state); > + sk->sk_state = state; > +} > + > void tcp_set_state(struct sock *sk, int state) > { > int oldstate = sk->sk_state; > -- > 1.8.3.1 > + Brendan
Re: Cannot boot with rootfs from eMMC if maxcpus=1
On 11/09/2017 08:14 AM, Richard Schmitt wrote: > Using a 4.9 kernel, trying to boot a kernel using an eMMC based rootfs will > result in a crash > > The message preceeding the crash is: > > [3.285566] VFS: Cannot open root device "mmcblk0p9" or > unknown-block(0,0): error -6 > [3.293338] Please append a correct "root=" boot option; here are the > available partitions: > > Our kernel boot args can be seen in the boot log but for easy reference are: > > root=/dev/mmcblk0p9 earlycon clk_ignore_unused cpuidle.off=1 DEBUG_MODE=y > siq_board_type=RP maxcpus=1 > > Note that we do specify root=/dev/mmcblk0p9. If I simply remove maxcpus=1 > from the kernel boot args, the system will boot up fine. > > Seems like there might be a race in bringing up the eMMC partitions prior to > mounting the rootfs but I don’t want to hypothesis any further. > > Any ideas? If you suspect a timing issue, an easy test would be to add to the kernel boot/command line either: rootwait or rootdelay=10 (in seconds) to see if that helps. or send email to linux-arm-ker...@lists.infradead.org ... -- ~Randy
Re: Cannot boot with rootfs from eMMC if maxcpus=1
On 11/09/2017 08:14 AM, Richard Schmitt wrote: > Using a 4.9 kernel, trying to boot a kernel using an eMMC based rootfs will > result in a crash > > The message preceeding the crash is: > > [3.285566] VFS: Cannot open root device "mmcblk0p9" or > unknown-block(0,0): error -6 > [3.293338] Please append a correct "root=" boot option; here are the > available partitions: > > Our kernel boot args can be seen in the boot log but for easy reference are: > > root=/dev/mmcblk0p9 earlycon clk_ignore_unused cpuidle.off=1 DEBUG_MODE=y > siq_board_type=RP maxcpus=1 > > Note that we do specify root=/dev/mmcblk0p9. If I simply remove maxcpus=1 > from the kernel boot args, the system will boot up fine. > > Seems like there might be a race in bringing up the eMMC partitions prior to > mounting the rootfs but I don’t want to hypothesis any further. > > Any ideas? If you suspect a timing issue, an easy test would be to add to the kernel boot/command line either: rootwait or rootdelay=10 (in seconds) to see if that helps. or send email to linux-arm-ker...@lists.infradead.org ... -- ~Randy
[PULL REQUEST] nfsd changes for 4.15
Please pull nfsd changes for 4.15 from: git://linux-nfs.org/~bfields/linux.git tags/nfsd-4.15 Lots of good bugfixes, including: - fix a number of races in the NFSv4+ state code. - fix some shutdown crashes in multiple-network-namespace cases. - relax our 4.1 session limits; if you've an artificially low limit to the number of 4.1 clients that can mount simultaneously, try upgrading. --b. Andrew Elble (1): nfsd: deal with revoked delegations appropriately Arnd Bergmann (1): nfds: avoid gettimeofday for nfssvc_boot time Chuck Lever (2): svcrdma: Preserve CB send buffer across retransmits svcrdma: Enqueue after setting XPT_CLOSE in completion handlers Colin Ian King (1): sunrcp: make function _svc_create_xprt static Corentin Labbe (3): nfs_common: fix build warning in grace.c nfs_common: move locks_in_grace comment at the right place nfs_common: convert int to bool Elena Reshetova (3): fs, nfsd: convert nfs4_stid.sc_count from atomic_t to refcount_t fs, nfsd: convert nfs4_cntl_odstate.co_odcount from atomic_t to refcount_t fs, nfsd: convert nfs4_file.fi_ref from atomic_t to refcount_t J. Bruce Fields (6): nfsd: remove unnecessary nofilehandle checks nfsd: increase DRC cache limit nfsd: give out fewer session slots as limit approaches nfsd4: fix cached replies to solo SEQUENCE compounds nfsd4: catch some false session retries rpc: remove some BUG()s Jérémy Lefaure (1): nfsd: use ARRAY_SIZE Trond Myklebust (2): SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status SUNRPC: Improve ordering of transport processing Vasily Averin (2): lockd: double unregister of inetaddr notifiers nfsd: use nfs->ns.inum as net ID fs/lockd/svc.c | 20 ++--- fs/nfs_common/grace.c | 24 +++--- fs/nfsd/fault_inject.c | 5 +- fs/nfsd/netns.h| 2 +- fs/nfsd/nfs3xdr.c | 10 ++- fs/nfsd/nfs4layouts.c | 4 +- fs/nfsd/nfs4proc.c | 19 ++--- fs/nfsd/nfs4state.c| 127 +++-- fs/nfsd/nfssvc.c | 4 +- fs/nfsd/state.h| 11 ++- fs/nfsd/xdr4.h | 13 ++- include/linux/fs.h | 4 +- include/linux/sunrpc/svc.h | 1 + include/trace/events/sunrpc.h | 17 ++-- net/sunrpc/auth_gss/svcauth_gss.c | 14 ++-- net/sunrpc/svc_xprt.c | 106 net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 6 +- net/sunrpc/xprtrdma/svc_rdma_transport.c | 11 ++- 18 files changed, 225 insertions(+), 173 deletions(-)
[PULL REQUEST] nfsd changes for 4.15
Please pull nfsd changes for 4.15 from: git://linux-nfs.org/~bfields/linux.git tags/nfsd-4.15 Lots of good bugfixes, including: - fix a number of races in the NFSv4+ state code. - fix some shutdown crashes in multiple-network-namespace cases. - relax our 4.1 session limits; if you've an artificially low limit to the number of 4.1 clients that can mount simultaneously, try upgrading. --b. Andrew Elble (1): nfsd: deal with revoked delegations appropriately Arnd Bergmann (1): nfds: avoid gettimeofday for nfssvc_boot time Chuck Lever (2): svcrdma: Preserve CB send buffer across retransmits svcrdma: Enqueue after setting XPT_CLOSE in completion handlers Colin Ian King (1): sunrcp: make function _svc_create_xprt static Corentin Labbe (3): nfs_common: fix build warning in grace.c nfs_common: move locks_in_grace comment at the right place nfs_common: convert int to bool Elena Reshetova (3): fs, nfsd: convert nfs4_stid.sc_count from atomic_t to refcount_t fs, nfsd: convert nfs4_cntl_odstate.co_odcount from atomic_t to refcount_t fs, nfsd: convert nfs4_file.fi_ref from atomic_t to refcount_t J. Bruce Fields (6): nfsd: remove unnecessary nofilehandle checks nfsd: increase DRC cache limit nfsd: give out fewer session slots as limit approaches nfsd4: fix cached replies to solo SEQUENCE compounds nfsd4: catch some false session retries rpc: remove some BUG()s Jérémy Lefaure (1): nfsd: use ARRAY_SIZE Trond Myklebust (2): SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status SUNRPC: Improve ordering of transport processing Vasily Averin (2): lockd: double unregister of inetaddr notifiers nfsd: use nfs->ns.inum as net ID fs/lockd/svc.c | 20 ++--- fs/nfs_common/grace.c | 24 +++--- fs/nfsd/fault_inject.c | 5 +- fs/nfsd/netns.h| 2 +- fs/nfsd/nfs3xdr.c | 10 ++- fs/nfsd/nfs4layouts.c | 4 +- fs/nfsd/nfs4proc.c | 19 ++--- fs/nfsd/nfs4state.c| 127 +++-- fs/nfsd/nfssvc.c | 4 +- fs/nfsd/state.h| 11 ++- fs/nfsd/xdr4.h | 13 ++- include/linux/fs.h | 4 +- include/linux/sunrpc/svc.h | 1 + include/trace/events/sunrpc.h | 17 ++-- net/sunrpc/auth_gss/svcauth_gss.c | 14 ++-- net/sunrpc/svc_xprt.c | 106 net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 6 +- net/sunrpc/xprtrdma/svc_rdma_transport.c | 11 ++- 18 files changed, 225 insertions(+), 173 deletions(-)
Re: [GIT PULL] platform-drivers-x86 for 4.15-1
On Sat, Nov 18, 2017 at 10:09 AM, Andy Shevchenkowrote: > > Here is the collected material against Platform Drivers x86 subsystem. > It's rather bit busy cycle for PDx86, mostly due to Dell SMBIOS driver > activity. So I note that you seem to use the same summary script that Darren used. Guys, the "merge summary" should be human-readable, not just a slightly munged version of "git shortlog" that has been sorted by first word. Feel free to use that munged version as a base-line, but don't just send me automated merge messages. The whole point of a summary is to summarize. And merge messages should be legible, not "this is all the details that you could have just used 'git shortlog' to get". When you can't even be bothered to fix up obvious issues like (a) "yeah, I just sorted things alphabetically without any human interaction": intel-wmi-thunderbolt: - Silence error cases MAINTAINERS: - Add entry for the PEAQ WMI hotkeys driver mlx-platform: - make a couple of structures static (b) "yeah, my summary script splits the overview at a colon, so when there is no colon it doesn't work": Add driver to force WMI Thunderbolt controller power status: - Add driver to force WMI Thunderbolt controller power status it's good that you have a fairly unified commit message model and can do these summaries, but it's bad when you then don't do much of any _human_ summary at all or even check the result for sanity. Linus
Re: [GIT PULL] platform-drivers-x86 for 4.15-1
On Sat, Nov 18, 2017 at 10:09 AM, Andy Shevchenko wrote: > > Here is the collected material against Platform Drivers x86 subsystem. > It's rather bit busy cycle for PDx86, mostly due to Dell SMBIOS driver > activity. So I note that you seem to use the same summary script that Darren used. Guys, the "merge summary" should be human-readable, not just a slightly munged version of "git shortlog" that has been sorted by first word. Feel free to use that munged version as a base-line, but don't just send me automated merge messages. The whole point of a summary is to summarize. And merge messages should be legible, not "this is all the details that you could have just used 'git shortlog' to get". When you can't even be bothered to fix up obvious issues like (a) "yeah, I just sorted things alphabetically without any human interaction": intel-wmi-thunderbolt: - Silence error cases MAINTAINERS: - Add entry for the PEAQ WMI hotkeys driver mlx-platform: - make a couple of structures static (b) "yeah, my summary script splits the overview at a colon, so when there is no colon it doesn't work": Add driver to force WMI Thunderbolt controller power status: - Add driver to force WMI Thunderbolt controller power status it's good that you have a fairly unified commit message model and can do these summaries, but it's bad when you then don't do much of any _human_ summary at all or even check the result for sanity. Linus
Re: [PATCH PREEMPT RT] rt-mutex: fix deadlock in device mapper
On Fri, 2017-11-17 at 15:57 +0100, Sebastian Siewior wrote: > On 2017-11-13 12:56:53 [-0500], Mikulas Patocka wrote: > > Hi > Hi, > > > I'm submitting this patch for the CONFIG_PREEMPT_RT patch. It fixes > > deadlocks in device mapper when real time preemption is used. > > applied, thank you. Below is my 2012 3.0-rt version of that for reference; at that time we were using slab, and slab_lock referenced below was a local_lock. The comment came from crash analysis of a deadlock I met before adding the (yeah, hacky) __migrate_disabled() blocker. At the time, that was not an optional hack, you WOULD deadlock if you ground disks to fine powder the way SUSE QA did. Pulling the plug before blocking cured the xfs/ext[34] IO deadlocks they griped about, but I had to add that hack to not trade their nasty IO deadlocks for the more mundane variety. So my question is: are we sure that in the here and now flush won't want any lock we may be holding? In days of yore, it most definitely would turn your box into a doorstop if you tried hard enough. Subject: rt: pull your plug before blocking Date: Wed Jul 18 14:43:15 CEST 2012 From: Mike GalbraithQueued IO can lead to IO deadlock should a task require wakeup from a task which is blocked on that queued IO. ext3: dbench1 queues a buffer, blocks on journal mutex, it's plug is not pulled. dbench2 mutex owner is waiting for kjournald, who is waiting for the buffer queued by dbench1. Game over. Signed-off-by: Mike Galbraith --- kernel/locking/rtmutex.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "rtmutex_common.h" @@ -930,8 +931,18 @@ static inline void rt_spin_lock_fastlock if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) rt_mutex_deadlock_account_lock(lock, current); - else + else { + /* +* We can't pull the plug if we're already holding a lock +* else we can deadlock. eg, if we're holding slab_lock, +* ksoftirqd can block while processing BLOCK_SOFTIRQ after +* having acquired q->queue_lock. If _we_ then block on +* that q->queue_lock while flushing our plug, deadlock. +*/ + if (__migrate_disabled(current) < 2 && blk_needs_flush_plug(current)) + blk_schedule_flush_plug(current); slowfn(lock); + } } static inline void rt_spin_lock_fastunlock(struct rt_mutex *lock, @@ -1892,9 +1903,12 @@ rt_mutex_fastlock(struct rt_mutex *lock, if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) { rt_mutex_deadlock_account_lock(lock, current); return 0; - } else + } else { + if (blk_needs_flush_plug(current)) + blk_schedule_flush_plug(current); return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK, ww_ctx); + } } static inline int
Re: [PATCH PREEMPT RT] rt-mutex: fix deadlock in device mapper
On Fri, 2017-11-17 at 15:57 +0100, Sebastian Siewior wrote: > On 2017-11-13 12:56:53 [-0500], Mikulas Patocka wrote: > > Hi > Hi, > > > I'm submitting this patch for the CONFIG_PREEMPT_RT patch. It fixes > > deadlocks in device mapper when real time preemption is used. > > applied, thank you. Below is my 2012 3.0-rt version of that for reference; at that time we were using slab, and slab_lock referenced below was a local_lock. The comment came from crash analysis of a deadlock I met before adding the (yeah, hacky) __migrate_disabled() blocker. At the time, that was not an optional hack, you WOULD deadlock if you ground disks to fine powder the way SUSE QA did. Pulling the plug before blocking cured the xfs/ext[34] IO deadlocks they griped about, but I had to add that hack to not trade their nasty IO deadlocks for the more mundane variety. So my question is: are we sure that in the here and now flush won't want any lock we may be holding? In days of yore, it most definitely would turn your box into a doorstop if you tried hard enough. Subject: rt: pull your plug before blocking Date: Wed Jul 18 14:43:15 CEST 2012 From: Mike Galbraith Queued IO can lead to IO deadlock should a task require wakeup from a task which is blocked on that queued IO. ext3: dbench1 queues a buffer, blocks on journal mutex, it's plug is not pulled. dbench2 mutex owner is waiting for kjournald, who is waiting for the buffer queued by dbench1. Game over. Signed-off-by: Mike Galbraith --- kernel/locking/rtmutex.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "rtmutex_common.h" @@ -930,8 +931,18 @@ static inline void rt_spin_lock_fastlock if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) rt_mutex_deadlock_account_lock(lock, current); - else + else { + /* +* We can't pull the plug if we're already holding a lock +* else we can deadlock. eg, if we're holding slab_lock, +* ksoftirqd can block while processing BLOCK_SOFTIRQ after +* having acquired q->queue_lock. If _we_ then block on +* that q->queue_lock while flushing our plug, deadlock. +*/ + if (__migrate_disabled(current) < 2 && blk_needs_flush_plug(current)) + blk_schedule_flush_plug(current); slowfn(lock); + } } static inline void rt_spin_lock_fastunlock(struct rt_mutex *lock, @@ -1892,9 +1903,12 @@ rt_mutex_fastlock(struct rt_mutex *lock, if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) { rt_mutex_deadlock_account_lock(lock, current); return 0; - } else + } else { + if (blk_needs_flush_plug(current)) + blk_schedule_flush_plug(current); return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK, ww_ctx); + } } static inline int
Re: [PATCH] input: remove unneeded DRIVER_LICENSE #defines
On Sat, Nov 18, 2017 at 11:27:24AM +0100, Greg Kroah-Hartman wrote: > On Fri, Nov 17, 2017 at 12:33:13PM -0800, Dmitry Torokhov wrote: > > On Fri, Nov 17, 2017 at 03:17:20PM +0100, Greg Kroah-Hartman wrote: > > > There is no need to #define the license of the driver, just put it in > > > the MODULE_LICENSE() line directly as a text string. > > > > > > This allows tools that check that the module license matches the source > > > code license to work properly, as there is no need to unwind the > > > unneeded dereference. For some of these drivers, the #define is just a > > > few lines above the MODULE_LICENSE() line, which is extra pointless. > > > > > > Cc: Dmitry Torokhov> > > Cc: Arvind Yadav > > > Reported-by: Philippe Ombredanne > > > Signed-off-by: Greg Kroah-Hartman > > > --- > > > drivers/input/misc/keyspan_remote.c | 3 +-- > > > drivers/input/tablet/acecad.c | 3 +-- > > > drivers/input/tablet/hanwang.c | 3 +-- > > > drivers/input/tablet/kbtab.c| 3 +-- > > > 4 files changed, 4 insertions(+), 8 deletions(-) > > > > > > diff --git a/drivers/input/misc/keyspan_remote.c > > > b/drivers/input/misc/keyspan_remote.c > > > index 77c47d6325fe..4f13b2f7bf4f 100644 > > > --- a/drivers/input/misc/keyspan_remote.c > > > +++ b/drivers/input/misc/keyspan_remote.c > > > @@ -20,7 +20,6 @@ > > > #define DRIVER_VERSION "v0.1" > > > #define DRIVER_AUTHOR"Michael Downey " > > > #define DRIVER_DESC "Driver for the USB Keyspan remote control." > > > -#define DRIVER_LICENSE "GPL" > > > > If we do this, can we also get rid of other DIRVER_* macros that are not > > useful? > > Please do, I got rid of all of the DRIVER_VERSION crap in the > drivers/usb/ tree a release or so ago, as they make no sense at all. > The other defines are also really silly and can be cleaned up too. > > Want me to do that for drivers/input/ for you? > That would be great, yes. Thanks. -- Dmitry
Re: Commit fcd8843c40 breaks old compilers
On 11/18/2017 01:12 PM, Trond Myklebust wrote: Sigh OK, how about something like the following then: { .data = { 0xff, 0xff, 0xff, 0xff, 0 }, } Yes, this does build. diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 54fd56d..daa6085 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -71,8 +71,7 @@ }; const nfs4_stateid invalid_stateid = { { - .seqid = cpu_to_be32(0xU), - .other = { 0 }, + .data = { 0xff, 0xff, 0xff, 0xff, 0 }, }, .type = NFS4_INVALID_STATEID_TYPE, }; -boris
Re: [PATCH] input: remove unneeded DRIVER_LICENSE #defines
On Sat, Nov 18, 2017 at 11:27:24AM +0100, Greg Kroah-Hartman wrote: > On Fri, Nov 17, 2017 at 12:33:13PM -0800, Dmitry Torokhov wrote: > > On Fri, Nov 17, 2017 at 03:17:20PM +0100, Greg Kroah-Hartman wrote: > > > There is no need to #define the license of the driver, just put it in > > > the MODULE_LICENSE() line directly as a text string. > > > > > > This allows tools that check that the module license matches the source > > > code license to work properly, as there is no need to unwind the > > > unneeded dereference. For some of these drivers, the #define is just a > > > few lines above the MODULE_LICENSE() line, which is extra pointless. > > > > > > Cc: Dmitry Torokhov > > > Cc: Arvind Yadav > > > Reported-by: Philippe Ombredanne > > > Signed-off-by: Greg Kroah-Hartman > > > --- > > > drivers/input/misc/keyspan_remote.c | 3 +-- > > > drivers/input/tablet/acecad.c | 3 +-- > > > drivers/input/tablet/hanwang.c | 3 +-- > > > drivers/input/tablet/kbtab.c| 3 +-- > > > 4 files changed, 4 insertions(+), 8 deletions(-) > > > > > > diff --git a/drivers/input/misc/keyspan_remote.c > > > b/drivers/input/misc/keyspan_remote.c > > > index 77c47d6325fe..4f13b2f7bf4f 100644 > > > --- a/drivers/input/misc/keyspan_remote.c > > > +++ b/drivers/input/misc/keyspan_remote.c > > > @@ -20,7 +20,6 @@ > > > #define DRIVER_VERSION "v0.1" > > > #define DRIVER_AUTHOR"Michael Downey " > > > #define DRIVER_DESC "Driver for the USB Keyspan remote control." > > > -#define DRIVER_LICENSE "GPL" > > > > If we do this, can we also get rid of other DIRVER_* macros that are not > > useful? > > Please do, I got rid of all of the DRIVER_VERSION crap in the > drivers/usb/ tree a release or so ago, as they make no sense at all. > The other defines are also really silly and can be cleaned up too. > > Want me to do that for drivers/input/ for you? > That would be great, yes. Thanks. -- Dmitry
Re: Commit fcd8843c40 breaks old compilers
On 11/18/2017 01:12 PM, Trond Myklebust wrote: Sigh OK, how about something like the following then: { .data = { 0xff, 0xff, 0xff, 0xff, 0 }, } Yes, this does build. diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 54fd56d..daa6085 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -71,8 +71,7 @@ }; const nfs4_stateid invalid_stateid = { { - .seqid = cpu_to_be32(0xU), - .other = { 0 }, + .data = { 0xff, 0xff, 0xff, 0xff, 0 }, }, .type = NFS4_INVALID_STATEID_TYPE, }; -boris
Re: [PATCH 01/10 v3] Input: ep93xx_keypad: Fix platform_get_irq's error checking
On Sat, Nov 18, 2017 at 04:25:08PM +0530, Arvind Yadav wrote: > The platform_get_irq() function returns negative if an error occurs. > zero or positive number on success. platform_get_irq() error checking > for zero is not correct. > > Signed-off-by: Arvind Yadav> --- > changes in v2: >Return keypad->irq insted of -ENXIO. > changes in v3 : >Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. > > drivers/input/keyboard/ep93xx_keypad.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/input/keyboard/ep93xx_keypad.c > b/drivers/input/keyboard/ep93xx_keypad.c > index f77b295..01788a7 100644 > --- a/drivers/input/keyboard/ep93xx_keypad.c > +++ b/drivers/input/keyboard/ep93xx_keypad.c > @@ -257,8 +257,8 @@ static int ep93xx_keypad_probe(struct platform_device > *pdev) > } > > keypad->irq = platform_get_irq(pdev, 0); > - if (!keypad->irq) { > - err = -ENXIO; > + if (keypad->irq <= 0) { > + err = keypad->irq; Argh, so what will happen if you return with keypad->irq == 0? Can you please stop and consider what exactly you are doing before churning patches like crazy? > goto failed_free; > } > > -- > 2.7.4 > Thanks. -- Dmitry
Re: [PATCH 01/10 v3] Input: ep93xx_keypad: Fix platform_get_irq's error checking
On Sat, Nov 18, 2017 at 04:25:08PM +0530, Arvind Yadav wrote: > The platform_get_irq() function returns negative if an error occurs. > zero or positive number on success. platform_get_irq() error checking > for zero is not correct. > > Signed-off-by: Arvind Yadav > --- > changes in v2: >Return keypad->irq insted of -ENXIO. > changes in v3 : >Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. > > drivers/input/keyboard/ep93xx_keypad.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/input/keyboard/ep93xx_keypad.c > b/drivers/input/keyboard/ep93xx_keypad.c > index f77b295..01788a7 100644 > --- a/drivers/input/keyboard/ep93xx_keypad.c > +++ b/drivers/input/keyboard/ep93xx_keypad.c > @@ -257,8 +257,8 @@ static int ep93xx_keypad_probe(struct platform_device > *pdev) > } > > keypad->irq = platform_get_irq(pdev, 0); > - if (!keypad->irq) { > - err = -ENXIO; > + if (keypad->irq <= 0) { > + err = keypad->irq; Argh, so what will happen if you return with keypad->irq == 0? Can you please stop and consider what exactly you are doing before churning patches like crazy? > goto failed_free; > } > > -- > 2.7.4 > Thanks. -- Dmitry
Re: [PATCH 5/10 v2] Input: cpcap-pwrbutton: Handle return value of platform_get_irq
On Sat, Nov 18, 2017 at 08:21:22AM +, Russell King - ARM Linux wrote: > On Sat, Nov 18, 2017 at 02:36:53AM +0530, Arvind Yadav wrote: > > platform_get_irq() can fail here and we must check its return value. > > The test should be <= 0, and you need to return an error code for the > 0 case. Instead of polluting the drivers with special handling of 0 vs negative error we should have platform_get_irq[_byname] return -EINVAL if it sees 0. Thanks. -- Dmitry
Re: [PATCH 5/10 v2] Input: cpcap-pwrbutton: Handle return value of platform_get_irq
On Sat, Nov 18, 2017 at 08:21:22AM +, Russell King - ARM Linux wrote: > On Sat, Nov 18, 2017 at 02:36:53AM +0530, Arvind Yadav wrote: > > platform_get_irq() can fail here and we must check its return value. > > The test should be <= 0, and you need to return an error code for the > 0 case. Instead of polluting the drivers with special handling of 0 vs negative error we should have platform_get_irq[_byname] return -EINVAL if it sees 0. Thanks. -- Dmitry
Re: mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info (crisv32 hang)
Hi, On Tue, Oct 03, 2017 at 06:29:49PM -0400, Nicolas Pitre wrote: > On Tue, 3 Oct 2017, Tejun Heo wrote: > > > On Tue, Oct 03, 2017 at 04:57:44PM -0400, Nicolas Pitre wrote: > > > This can be much smaller than a page on very small memory systems. > > > Always rounding up the size to a page is wasteful in that case, and > > > required alignment is smaller than the memblock default. Let's round > > > things up to a page size only when the actual size is >= page size, and > > > then it makes sense to page-align for a nicer allocation pattern. > > > > Isn't that a temporary area which gets freed later during boot? > > Hmmm... > > It may get freed through 3 different paths where 2 of them are error > paths. What looks like a non-error path is in pcpu_embed_first_chunk() > called from setup_per_cpu_areas(). But there are two versions of > setup_per_cpu_areas(): one for SMP and one for !SMP. And the !SMP case > never calls pcpu_free_alloc_info() currently. > > I'm not sure i understand that code fully, but maybe the following patch > could be a better fit: > > - >8 > Subject: [PATCH] percpu: don't forget to free the temporary struct > pcpu_alloc_info > > Unlike the SMP case, the !SMP case does not free the memory for struct > pcpu_alloc_info allocated in setup_per_cpu_areas(). And to give it a > chance of being reused by the page allocator later, align it to a page > boundary just like its size. > > Signed-off-by: Nicolas PitreThis patch causes my crisv32 qemu emulation to hang with no console output. > > diff --git a/mm/percpu.c b/mm/percpu.c > index 434844415d..caab63375b 100644 > --- a/mm/percpu.c > +++ b/mm/percpu.c > @@ -1416,7 +1416,7 @@ struct pcpu_alloc_info * __init > pcpu_alloc_alloc_info(int nr_groups, > __alignof__(ai->groups[0].cpu_map[0])); > ai_size = base_size + nr_units * sizeof(ai->groups[0].cpu_map[0]); > > - ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), 0); > + ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), PAGE_SIZE); > if (!ptr) > return NULL; > ai = ptr; > @@ -2295,6 +2295,7 @@ void __init setup_per_cpu_areas(void) > > if (pcpu_setup_first_chunk(ai, fc) < 0) > panic("Failed to initialize percpu areas."); > + pcpu_free_alloc_info(ai); This is the culprit. Everything works fine if I remove this line. No idea if the problem is here or in the cris core. Copying cris maintainers for input. Guenter
Re: mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info (crisv32 hang)
Hi, On Tue, Oct 03, 2017 at 06:29:49PM -0400, Nicolas Pitre wrote: > On Tue, 3 Oct 2017, Tejun Heo wrote: > > > On Tue, Oct 03, 2017 at 04:57:44PM -0400, Nicolas Pitre wrote: > > > This can be much smaller than a page on very small memory systems. > > > Always rounding up the size to a page is wasteful in that case, and > > > required alignment is smaller than the memblock default. Let's round > > > things up to a page size only when the actual size is >= page size, and > > > then it makes sense to page-align for a nicer allocation pattern. > > > > Isn't that a temporary area which gets freed later during boot? > > Hmmm... > > It may get freed through 3 different paths where 2 of them are error > paths. What looks like a non-error path is in pcpu_embed_first_chunk() > called from setup_per_cpu_areas(). But there are two versions of > setup_per_cpu_areas(): one for SMP and one for !SMP. And the !SMP case > never calls pcpu_free_alloc_info() currently. > > I'm not sure i understand that code fully, but maybe the following patch > could be a better fit: > > - >8 > Subject: [PATCH] percpu: don't forget to free the temporary struct > pcpu_alloc_info > > Unlike the SMP case, the !SMP case does not free the memory for struct > pcpu_alloc_info allocated in setup_per_cpu_areas(). And to give it a > chance of being reused by the page allocator later, align it to a page > boundary just like its size. > > Signed-off-by: Nicolas Pitre This patch causes my crisv32 qemu emulation to hang with no console output. > > diff --git a/mm/percpu.c b/mm/percpu.c > index 434844415d..caab63375b 100644 > --- a/mm/percpu.c > +++ b/mm/percpu.c > @@ -1416,7 +1416,7 @@ struct pcpu_alloc_info * __init > pcpu_alloc_alloc_info(int nr_groups, > __alignof__(ai->groups[0].cpu_map[0])); > ai_size = base_size + nr_units * sizeof(ai->groups[0].cpu_map[0]); > > - ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), 0); > + ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), PAGE_SIZE); > if (!ptr) > return NULL; > ai = ptr; > @@ -2295,6 +2295,7 @@ void __init setup_per_cpu_areas(void) > > if (pcpu_setup_first_chunk(ai, fc) < 0) > panic("Failed to initialize percpu areas."); > + pcpu_free_alloc_info(ai); This is the culprit. Everything works fine if I remove this line. No idea if the problem is here or in the cris core. Copying cris maintainers for input. Guenter
[GIT PULL] platform-drivers-x86 for 4.15-1
Hi Linus, Here is the collected material against Platform Drivers x86 subsystem. It's rather bit busy cycle for PDx86, mostly due to Dell SMBIOS driver activity. During merge it will get a conflict CONFLICT (content): Merge conflict in Documentation/admin-guide/thunderbolt.rst that is pretty straight forward to solve, i.e. we need all parts of documentation be in, where "Networking over Thunderbolt cable" is followed by "Forcing power" chapter. Thanks, With Best Regards, Andy Shevchenko The following changes since commit 0224d45c9d46401b6d7018a96cfe049c5da7d91c: i2c-cht-wc: Add device-properties for fusb302 integration (2017-10-27 15:51:51 +0200) are available in the Git repository at: git://git.infradead.org/linux-platform-drivers-x86.git tags/platform-drivers-x86-v4.15-1 for you to fetch changes up to aaa40965d2342137d756121993c395e2a7463a8d: platform/x86: silead_dmi: Add silead, home-button property to some tablets (2017-11-18 19:28:58 +0200) platform-drivers-x86 for v4.15-1 For this cycle we have quite an update for the Dell SMBIOS driver including WMI work to provide an interface for SMBIOS tokens via sysfs and WMI support for 2017+ Dell laptop models. SMM dispatcher code is split into a separate driver followed by a new WMI dispatcher. The latter provides a character device interface to user space. The pull request contains a merge of immutable branch from Wolfram Sang in order to apply a dependent fix to the Intel CherryTrail Battery Management driver. Other Intel drivers got a lot of cleanups. The Turbo Boost Max 3.0 support is added for Intel Skylake. Peaq WMI hotkeys driver gets its own maintainer and white list of supported models. Silead DMI is expanded to support few additional platforms. Tablet mode via GMMS ACPI method is added to support some ThinkPad tablets. Two commits appear here which were previously merged during the v4.14-rcX cycle: - d7ca5ebf2493 platform/x86: intel_pmc_ipc: Use devm_* calls in driver probe function - e3075fd6f80c platform/x86: intel_pmc_ipc: Use spin_lock to protect GCR updates Add driver to force WMI Thunderbolt controller power status: - Add driver to force WMI Thunderbolt controller power status asus-wmi: - Add lightbar led support dell-laptop: - Allocate buffer before rfkill use dell-smbios: - fix string overflow - Add filtering support - Introduce dispatcher for SMM calls - Add a sysfs interface for SMBIOS tokens - only run if proper oem string is detected - Prefix class/select with cmd_ - Add pr_fmt definition to driver dell-smbios-smm: - test for WSMT dell-smbios-wmi: - release mutex lock on WMI call failure - introduce userspace interface - Add new WMI dispatcher driver dell-smo8800: - remove redundant assignments to byte_data dell-wmi: - don't check length returned - clean up wmi descriptor check - increase severity of some failures - Do not match on descriptor GUID modalias - Label driver as handling notifications dell-*wmi*: - Relay failed initial probe to dependent drivers dell-wmi-descriptor: - check if memory was allocated - split WMI descriptor into it's own driver fujitsu-laptop: - Fix radio LED detection - Don't oops when FUJ02E3 is not presnt hp_accel: - Add quirk for HP ProBook 440 G4 hp-wmi: - Fix tablet mode detection for convertibles ideapad-laptop: - Add Lenovo Yoga 920-13IKB to no_hw_rfkill dmi list intel_cht_int33fe: - Update fusb302 type string, add properties - make a couple of local functions static - Work around BIOS bug on some devices intel-hid: - Power button suspend on Dell Latitude 7275 intel_ips: - Convert timers to use timer_setup() - Remove FSF address from GPL notice - Remove unneeded fields and label - Keep pointer to struct device - Use PCI_VDEVICE() macro - Switch to new PCI IRQ allocation API - Simplify error handling via devres API intel_pmc_ipc: - Revert Use MFD framework to create dependent devices - Use MFD framework to create dependent devices - Use spin_lock to protect GCR updates - Use devm_* calls in driver probe function intel_punit_ipc: - Fix resource ioremap warning intel_telemetry: - Remove useless default in Kconfig - Add needed inclusion - cleanup redundant headers - Fix typos - Fix load failure info intel_telemetry_debugfs: - Use standard ARRAY_SIZE() macro intel_turbo_max_3: - Add Skylake platform intel-wmi-thunderbolt: - Silence error cases MAINTAINERS: - Add entry for the PEAQ WMI hotkeys driver mlx-platform: - make a couple of structures static peaq_wmi: - Fix missing terminating entry for peaq_dmi_table peaq-wmi: - Remove unnecessary checks from peaq_wmi_exit - Add DMI check before binding to the WMI interface - Revert Blacklist Lenovo ideapad 700-15ISK - Blacklist Lenovo ideapad 700-15ISK silead_dmi: - Add silead, home-button property to some tablets - Add entry
[GIT PULL] platform-drivers-x86 for 4.15-1
Hi Linus, Here is the collected material against Platform Drivers x86 subsystem. It's rather bit busy cycle for PDx86, mostly due to Dell SMBIOS driver activity. During merge it will get a conflict CONFLICT (content): Merge conflict in Documentation/admin-guide/thunderbolt.rst that is pretty straight forward to solve, i.e. we need all parts of documentation be in, where "Networking over Thunderbolt cable" is followed by "Forcing power" chapter. Thanks, With Best Regards, Andy Shevchenko The following changes since commit 0224d45c9d46401b6d7018a96cfe049c5da7d91c: i2c-cht-wc: Add device-properties for fusb302 integration (2017-10-27 15:51:51 +0200) are available in the Git repository at: git://git.infradead.org/linux-platform-drivers-x86.git tags/platform-drivers-x86-v4.15-1 for you to fetch changes up to aaa40965d2342137d756121993c395e2a7463a8d: platform/x86: silead_dmi: Add silead, home-button property to some tablets (2017-11-18 19:28:58 +0200) platform-drivers-x86 for v4.15-1 For this cycle we have quite an update for the Dell SMBIOS driver including WMI work to provide an interface for SMBIOS tokens via sysfs and WMI support for 2017+ Dell laptop models. SMM dispatcher code is split into a separate driver followed by a new WMI dispatcher. The latter provides a character device interface to user space. The pull request contains a merge of immutable branch from Wolfram Sang in order to apply a dependent fix to the Intel CherryTrail Battery Management driver. Other Intel drivers got a lot of cleanups. The Turbo Boost Max 3.0 support is added for Intel Skylake. Peaq WMI hotkeys driver gets its own maintainer and white list of supported models. Silead DMI is expanded to support few additional platforms. Tablet mode via GMMS ACPI method is added to support some ThinkPad tablets. Two commits appear here which were previously merged during the v4.14-rcX cycle: - d7ca5ebf2493 platform/x86: intel_pmc_ipc: Use devm_* calls in driver probe function - e3075fd6f80c platform/x86: intel_pmc_ipc: Use spin_lock to protect GCR updates Add driver to force WMI Thunderbolt controller power status: - Add driver to force WMI Thunderbolt controller power status asus-wmi: - Add lightbar led support dell-laptop: - Allocate buffer before rfkill use dell-smbios: - fix string overflow - Add filtering support - Introduce dispatcher for SMM calls - Add a sysfs interface for SMBIOS tokens - only run if proper oem string is detected - Prefix class/select with cmd_ - Add pr_fmt definition to driver dell-smbios-smm: - test for WSMT dell-smbios-wmi: - release mutex lock on WMI call failure - introduce userspace interface - Add new WMI dispatcher driver dell-smo8800: - remove redundant assignments to byte_data dell-wmi: - don't check length returned - clean up wmi descriptor check - increase severity of some failures - Do not match on descriptor GUID modalias - Label driver as handling notifications dell-*wmi*: - Relay failed initial probe to dependent drivers dell-wmi-descriptor: - check if memory was allocated - split WMI descriptor into it's own driver fujitsu-laptop: - Fix radio LED detection - Don't oops when FUJ02E3 is not presnt hp_accel: - Add quirk for HP ProBook 440 G4 hp-wmi: - Fix tablet mode detection for convertibles ideapad-laptop: - Add Lenovo Yoga 920-13IKB to no_hw_rfkill dmi list intel_cht_int33fe: - Update fusb302 type string, add properties - make a couple of local functions static - Work around BIOS bug on some devices intel-hid: - Power button suspend on Dell Latitude 7275 intel_ips: - Convert timers to use timer_setup() - Remove FSF address from GPL notice - Remove unneeded fields and label - Keep pointer to struct device - Use PCI_VDEVICE() macro - Switch to new PCI IRQ allocation API - Simplify error handling via devres API intel_pmc_ipc: - Revert Use MFD framework to create dependent devices - Use MFD framework to create dependent devices - Use spin_lock to protect GCR updates - Use devm_* calls in driver probe function intel_punit_ipc: - Fix resource ioremap warning intel_telemetry: - Remove useless default in Kconfig - Add needed inclusion - cleanup redundant headers - Fix typos - Fix load failure info intel_telemetry_debugfs: - Use standard ARRAY_SIZE() macro intel_turbo_max_3: - Add Skylake platform intel-wmi-thunderbolt: - Silence error cases MAINTAINERS: - Add entry for the PEAQ WMI hotkeys driver mlx-platform: - make a couple of structures static peaq_wmi: - Fix missing terminating entry for peaq_dmi_table peaq-wmi: - Remove unnecessary checks from peaq_wmi_exit - Add DMI check before binding to the WMI interface - Revert Blacklist Lenovo ideapad 700-15ISK - Blacklist Lenovo ideapad 700-15ISK silead_dmi: - Add silead, home-button property to some tablets - Add entry
Re: [PATCH v18 5/6] vfio: ABI for mdev display dma-buf operation
On Sat, 18 Nov 2017 23:29:31 +0530 Kirti Wankhedewrote: > Extremely sorry for the delay. > This works for VFIO_GFX_PLANE_TYPE_REGION. Tested with local changes. > > Reviewed-by: Kirti Wankhede With that, Acked-by: Alex Williamson > On 11/18/2017 9:00 PM, Alex Williamson wrote: > > > > Kirti? > > > > On Wed, 15 Nov 2017 21:11:42 -0700 > > Alex Williamson wrote: > > > >> On Thu, 16 Nov 2017 11:21:56 +0800 > >> Zhenyu Wang wrote: > >> > >>> On 2017.11.15 11:48:42 -0700, Alex Williamson wrote: > On Wed, 15 Nov 2017 17:11:54 +0800 > Tina Zhang wrote: > > > Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user query and get > > a plane and its information. So far, two types of buffers are supported: > > buffers based on dma-buf and buffers based on region. > > > > This ioctl can be invoked with: > > 1) Either DMABUF or REGION flag. Vendor driver returns a plane_info > > successfully only when the specific kind of buffer is supported. > > 2) Flag PROBE. And at the same time either DMABUF or REGION must be set, > > so that vendor driver returns success only when the specific kind of > > buffer is supported. > > > > Add VFIO_DEVICE_GET_GFX_DMABUF ioctl command to let user get a specific > > dma-buf fd of an exposed MDEV buffer provided by dmabuf_id which was > > returned in VFIO_DEVICE_QUERY_GFX_PLANE ioctl command. > > > > The life cycle of an exposed MDEV buffer is handled by userspace and > > tracked by kernel space. The returned dmabuf_id in struct vfio_device_ > > query_gfx_plane can be a new id of a new exposed buffer or an old id of > > a re-exported buffer. Host user can check the value of dmabuf_id to see > > if it needs to create new resources according to the new exposed buffer > > or just re-use the existing resource related to the old buffer. > > > > v18: > > - update comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex) > > > > v17: > > - modify VFIO_DEVICE_GET_GFX_DMABUF interface. (Alex) > > > > v16: > > - add x_hot and y_hot fields. (Gerd) > > - add comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex) > > - rebase to 4.14.0-rc6. > > > > v15: > > - add a ioctl to get a dmabuf for a given dmabuf id. (Gerd) > > > > v14: > > - add PROBE, DMABUF and REGION flags. (Alex) > > > > v12: > > - add drm_format_mod back. (Gerd and Zhenyu) > > - add region_index. (Gerd) > > > > v11: > > - rename plane_type to drm_plane_type. (Gerd) > > - move fields of vfio_device_query_gfx_plane to > > vfio_device_gfx_plane_info. > > (Gerd) > > - remove drm_format_mod, start fields. (Daniel) > > - remove plane_id. > > > > v10: > > - refine the ABI API VFIO_DEVICE_QUERY_GFX_PLANE. (Alex) (Gerd) > > > > v3: > > - add a field gvt_plane_info in the drm_i915_gem_obj structure to save > > the decoded plane information to avoid look up while need the plane > > info. (Gerd) > > > > Signed-off-by: Tina Zhang > > Cc: Gerd Hoffmann > > Cc: Alex Williamson > > Cc: Daniel Vetter > > --- > > include/uapi/linux/vfio.h | 62 > > +++ > > 1 file changed, 62 insertions(+) > > > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > > index ae46105..5c1cca2 100644 > > --- a/include/uapi/linux/vfio.h > > +++ b/include/uapi/linux/vfio.h > > @@ -502,6 +502,68 @@ struct vfio_pci_hot_reset { > > > > #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13) > > > > +/** > > + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14, > > + *struct > > vfio_device_query_gfx_plane) > > + * > > + * Set the drm_plane_type and flags, then retrieve the gfx plane info. > > + * > > + * flags supported: > > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set > > + * to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no > > + * support for dma-buf. > > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set > > + * to ask if the mdev supports region. 0 on support, -EINVAL on no > > + * support for region. > > + * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set > > + * with each call to query the plane info. > > + * - Others are invalid and return -EINVAL. > > + * > > + * Note: > > + * 1. Plane could be disabled by guest. In that case, success will be > > + *returned with zero-initialized drm_format,
Re: [PATCH v18 5/6] vfio: ABI for mdev display dma-buf operation
On Sat, 18 Nov 2017 23:29:31 +0530 Kirti Wankhede wrote: > Extremely sorry for the delay. > This works for VFIO_GFX_PLANE_TYPE_REGION. Tested with local changes. > > Reviewed-by: Kirti Wankhede With that, Acked-by: Alex Williamson > On 11/18/2017 9:00 PM, Alex Williamson wrote: > > > > Kirti? > > > > On Wed, 15 Nov 2017 21:11:42 -0700 > > Alex Williamson wrote: > > > >> On Thu, 16 Nov 2017 11:21:56 +0800 > >> Zhenyu Wang wrote: > >> > >>> On 2017.11.15 11:48:42 -0700, Alex Williamson wrote: > On Wed, 15 Nov 2017 17:11:54 +0800 > Tina Zhang wrote: > > > Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user query and get > > a plane and its information. So far, two types of buffers are supported: > > buffers based on dma-buf and buffers based on region. > > > > This ioctl can be invoked with: > > 1) Either DMABUF or REGION flag. Vendor driver returns a plane_info > > successfully only when the specific kind of buffer is supported. > > 2) Flag PROBE. And at the same time either DMABUF or REGION must be set, > > so that vendor driver returns success only when the specific kind of > > buffer is supported. > > > > Add VFIO_DEVICE_GET_GFX_DMABUF ioctl command to let user get a specific > > dma-buf fd of an exposed MDEV buffer provided by dmabuf_id which was > > returned in VFIO_DEVICE_QUERY_GFX_PLANE ioctl command. > > > > The life cycle of an exposed MDEV buffer is handled by userspace and > > tracked by kernel space. The returned dmabuf_id in struct vfio_device_ > > query_gfx_plane can be a new id of a new exposed buffer or an old id of > > a re-exported buffer. Host user can check the value of dmabuf_id to see > > if it needs to create new resources according to the new exposed buffer > > or just re-use the existing resource related to the old buffer. > > > > v18: > > - update comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex) > > > > v17: > > - modify VFIO_DEVICE_GET_GFX_DMABUF interface. (Alex) > > > > v16: > > - add x_hot and y_hot fields. (Gerd) > > - add comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex) > > - rebase to 4.14.0-rc6. > > > > v15: > > - add a ioctl to get a dmabuf for a given dmabuf id. (Gerd) > > > > v14: > > - add PROBE, DMABUF and REGION flags. (Alex) > > > > v12: > > - add drm_format_mod back. (Gerd and Zhenyu) > > - add region_index. (Gerd) > > > > v11: > > - rename plane_type to drm_plane_type. (Gerd) > > - move fields of vfio_device_query_gfx_plane to > > vfio_device_gfx_plane_info. > > (Gerd) > > - remove drm_format_mod, start fields. (Daniel) > > - remove plane_id. > > > > v10: > > - refine the ABI API VFIO_DEVICE_QUERY_GFX_PLANE. (Alex) (Gerd) > > > > v3: > > - add a field gvt_plane_info in the drm_i915_gem_obj structure to save > > the decoded plane information to avoid look up while need the plane > > info. (Gerd) > > > > Signed-off-by: Tina Zhang > > Cc: Gerd Hoffmann > > Cc: Alex Williamson > > Cc: Daniel Vetter > > --- > > include/uapi/linux/vfio.h | 62 > > +++ > > 1 file changed, 62 insertions(+) > > > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > > index ae46105..5c1cca2 100644 > > --- a/include/uapi/linux/vfio.h > > +++ b/include/uapi/linux/vfio.h > > @@ -502,6 +502,68 @@ struct vfio_pci_hot_reset { > > > > #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13) > > > > +/** > > + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14, > > + *struct > > vfio_device_query_gfx_plane) > > + * > > + * Set the drm_plane_type and flags, then retrieve the gfx plane info. > > + * > > + * flags supported: > > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set > > + * to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no > > + * support for dma-buf. > > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set > > + * to ask if the mdev supports region. 0 on support, -EINVAL on no > > + * support for region. > > + * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set > > + * with each call to query the plane info. > > + * - Others are invalid and return -EINVAL. > > + * > > + * Note: > > + * 1. Plane could be disabled by guest. In that case, success will be > > + *returned with zero-initialized drm_format, size, width and height > > + *fields. > > + * 2. x_hot/y_hot is set to 0x if no hotspot information > > available > > + * > > + * Return: 0 on success, -errno on other failure. > > + */ > > +struct
Re: Commit fcd8843c40 breaks old compilers
On Sat, 2017-11-18 at 13:07 -0500, Boris Ostrovsky wrote: > > On 11/18/2017 12:39 PM, Trond Myklebust wrote: > > On Sat, 2017-11-18 at 12:19 -0500, Boris Ostrovsky wrote: > > > Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older > > > compilers which cannot process initializers for anonymous > > > structures: > > > > > > +const nfs4_stateid invalid_stateid = { > > > + { > > > + .seqid = cpu_to_be32(0xU), > > > + .other = { 0 }, > > > + }, > > > + .type = NFS4_INVALID_STATEID_TYPE, > > > +}; > > > > > > > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown > > > field > > > ‘seqid’ specified in initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing > > > braces > > > around initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near > > > initialization for ‘invalid_stateid..data’) > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow > > > in > > > implicit constant conversion > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown > > > field > > > ‘other’ specified in initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace > > > group > > > at end of initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near > > > initialization for ‘invalid_stateid.’) > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess > > > elements > > > in union initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near > > > initialization for ‘invalid_stateid.’) > > > make[4]: *** [fs/nfs/nfs4state.o] Error 1 > > > make[3]: *** [fs/nfs] Error 2 > > > > > > > > > FC-64gcc --version > > > gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2) > > > > > > > > > A similar bug was fixed by > > > e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 > > > but > > > I don't think the same approach can work here. > > > > > > I don't have any setups with gcc 4.4.4. What is it expecting here? > > Is > > it expecting an extra set of braces due to the anonymous "struct"? > > > > No, that won't work (at least I couldn't get it to work) because the > solution from e0714ec4f9e assumes that the anonymous struct is the > first > one in the enveloping struct. > > It worked only if I (this is a small C program with equivalent > structs): > > struct nfs4_stateid_struct { > union { > //char data[4]; > struct { > unsigned seqid; > char other[6]; > } __attribute__ ((packed)); > char data[4]; > }; > and then > > const nfs4_stateid invalid_stateid = { > { >{.seqid = 0xU, >.other = { 0 } }, > }, > .type = NFS4_INVALID_STATEID_TYPE, > }; > > If I keep data[4] where it is now I get compiler error > > an.c:35:20: error: field name not in record or union initializer > {.seqid = 0xU, > ^ > an.c:35:20: note: (near initialization for > 'invalid_stateid..data') > an.c:35:29: warning: overflow in implicit constant conversion [- > Woverflow] > {.seqid = 0xU, > ^~~ > an.c:36:19: error: field name not in record or union initializer > .other = { 0 } }, > ^ > an.c:36:19: note: (near initialization for > 'invalid_stateid..data') > an.c:36:19: warning: braces around scalar initializer > an.c:36:19: note: (near initialization for > 'invalid_stateid..data[1]') > > I don't know if you want to change public header file just to get > around > this problem. Sigh OK, how about something like the following then: { .data = { 0xff, 0xff, 0xff, 0xff, 0 }, } -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.mykleb...@primarydata.com
Re: Commit fcd8843c40 breaks old compilers
On Sat, 2017-11-18 at 13:07 -0500, Boris Ostrovsky wrote: > > On 11/18/2017 12:39 PM, Trond Myklebust wrote: > > On Sat, 2017-11-18 at 12:19 -0500, Boris Ostrovsky wrote: > > > Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older > > > compilers which cannot process initializers for anonymous > > > structures: > > > > > > +const nfs4_stateid invalid_stateid = { > > > + { > > > + .seqid = cpu_to_be32(0xU), > > > + .other = { 0 }, > > > + }, > > > + .type = NFS4_INVALID_STATEID_TYPE, > > > +}; > > > > > > > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown > > > field > > > ‘seqid’ specified in initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing > > > braces > > > around initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near > > > initialization for ‘invalid_stateid..data’) > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow > > > in > > > implicit constant conversion > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown > > > field > > > ‘other’ specified in initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace > > > group > > > at end of initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near > > > initialization for ‘invalid_stateid.’) > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess > > > elements > > > in union initializer > > > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near > > > initialization for ‘invalid_stateid.’) > > > make[4]: *** [fs/nfs/nfs4state.o] Error 1 > > > make[3]: *** [fs/nfs] Error 2 > > > > > > > > > FC-64 gcc --version > > > gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2) > > > > > > > > > A similar bug was fixed by > > > e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 > > > but > > > I don't think the same approach can work here. > > > > > > I don't have any setups with gcc 4.4.4. What is it expecting here? > > Is > > it expecting an extra set of braces due to the anonymous "struct"? > > > > No, that won't work (at least I couldn't get it to work) because the > solution from e0714ec4f9e assumes that the anonymous struct is the > first > one in the enveloping struct. > > It worked only if I (this is a small C program with equivalent > structs): > > struct nfs4_stateid_struct { > union { > //char data[4]; > struct { > unsigned seqid; > char other[6]; > } __attribute__ ((packed)); > char data[4]; > }; > and then > > const nfs4_stateid invalid_stateid = { > { >{.seqid = 0xU, >.other = { 0 } }, > }, > .type = NFS4_INVALID_STATEID_TYPE, > }; > > If I keep data[4] where it is now I get compiler error > > an.c:35:20: error: field name not in record or union initializer > {.seqid = 0xU, > ^ > an.c:35:20: note: (near initialization for > 'invalid_stateid..data') > an.c:35:29: warning: overflow in implicit constant conversion [- > Woverflow] > {.seqid = 0xU, > ^~~ > an.c:36:19: error: field name not in record or union initializer > .other = { 0 } }, > ^ > an.c:36:19: note: (near initialization for > 'invalid_stateid..data') > an.c:36:19: warning: braces around scalar initializer > an.c:36:19: note: (near initialization for > 'invalid_stateid..data[1]') > > I don't know if you want to change public header file just to get > around > this problem. Sigh OK, how about something like the following then: { .data = { 0xff, 0xff, 0xff, 0xff, 0 }, } -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.mykleb...@primarydata.com
Re: Commit fcd8843c40 breaks old compilers
On 11/18/2017 12:39 PM, Trond Myklebust wrote: On Sat, 2017-11-18 at 12:19 -0500, Boris Ostrovsky wrote: Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older compilers which cannot process initializers for anonymous structures: +const nfs4_stateid invalid_stateid = { + { + .seqid = cpu_to_be32(0xU), + .other = { 0 }, + }, + .type = NFS4_INVALID_STATEID_TYPE, +}; /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown field ‘seqid’ specified in initializer /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing braces around initializer /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near initialization for ‘invalid_stateid..data’) /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow in implicit constant conversion /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown field ‘other’ specified in initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace group at end of initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near initialization for ‘invalid_stateid.’) /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess elements in union initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near initialization for ‘invalid_stateid.’) make[4]: *** [fs/nfs/nfs4state.o] Error 1 make[3]: *** [fs/nfs] Error 2 FC-64gcc --version gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2) A similar bug was fixed by e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 but I don't think the same approach can work here. I don't have any setups with gcc 4.4.4. What is it expecting here? Is it expecting an extra set of braces due to the anonymous "struct"? No, that won't work (at least I couldn't get it to work) because the solution from e0714ec4f9e assumes that the anonymous struct is the first one in the enveloping struct. It worked only if I (this is a small C program with equivalent structs): struct nfs4_stateid_struct { union { //char data[4]; struct { unsigned seqid; char other[6]; } __attribute__ ((packed)); char data[4]; }; and then const nfs4_stateid invalid_stateid = { { {.seqid = 0xU, .other = { 0 } }, }, .type = NFS4_INVALID_STATEID_TYPE, }; If I keep data[4] where it is now I get compiler error an.c:35:20: error: field name not in record or union initializer {.seqid = 0xU, ^ an.c:35:20: note: (near initialization for 'invalid_stateid..data') an.c:35:29: warning: overflow in implicit constant conversion [-Woverflow] {.seqid = 0xU, ^~~ an.c:36:19: error: field name not in record or union initializer .other = { 0 } }, ^ an.c:36:19: note: (near initialization for 'invalid_stateid..data') an.c:36:19: warning: braces around scalar initializer an.c:36:19: note: (near initialization for 'invalid_stateid..data[1]') I don't know if you want to change public header file just to get around this problem. -boris
Re: Commit fcd8843c40 breaks old compilers
On 11/18/2017 12:39 PM, Trond Myklebust wrote: On Sat, 2017-11-18 at 12:19 -0500, Boris Ostrovsky wrote: Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older compilers which cannot process initializers for anonymous structures: +const nfs4_stateid invalid_stateid = { + { + .seqid = cpu_to_be32(0xU), + .other = { 0 }, + }, + .type = NFS4_INVALID_STATEID_TYPE, +}; /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown field ‘seqid’ specified in initializer /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing braces around initializer /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near initialization for ‘invalid_stateid..data’) /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow in implicit constant conversion /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown field ‘other’ specified in initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace group at end of initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near initialization for ‘invalid_stateid.’) /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess elements in union initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near initialization for ‘invalid_stateid.’) make[4]: *** [fs/nfs/nfs4state.o] Error 1 make[3]: *** [fs/nfs] Error 2 FC-64 gcc --version gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2) A similar bug was fixed by e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 but I don't think the same approach can work here. I don't have any setups with gcc 4.4.4. What is it expecting here? Is it expecting an extra set of braces due to the anonymous "struct"? No, that won't work (at least I couldn't get it to work) because the solution from e0714ec4f9e assumes that the anonymous struct is the first one in the enveloping struct. It worked only if I (this is a small C program with equivalent structs): struct nfs4_stateid_struct { union { //char data[4]; struct { unsigned seqid; char other[6]; } __attribute__ ((packed)); char data[4]; }; and then const nfs4_stateid invalid_stateid = { { {.seqid = 0xU, .other = { 0 } }, }, .type = NFS4_INVALID_STATEID_TYPE, }; If I keep data[4] where it is now I get compiler error an.c:35:20: error: field name not in record or union initializer {.seqid = 0xU, ^ an.c:35:20: note: (near initialization for 'invalid_stateid..data') an.c:35:29: warning: overflow in implicit constant conversion [-Woverflow] {.seqid = 0xU, ^~~ an.c:36:19: error: field name not in record or union initializer .other = { 0 } }, ^ an.c:36:19: note: (near initialization for 'invalid_stateid..data') an.c:36:19: warning: braces around scalar initializer an.c:36:19: note: (near initialization for 'invalid_stateid..data[1]') I don't know if you want to change public header file just to get around this problem. -boris
RFC: Copying Device Tree File into reserved area of VMLINUX before deployment
I noticed when checking out the OpenWRT support for the board that they have a method to avoid having to pass the device tree address to the kernel, and can thus boot device tree based kernels with U-boots that does not support device trees. Is this something that would be considered useful for including in mainstream: BACKGROUND: Trying to load a yocto kernel into a MIPS target (MT7620A based), and the U-Boot is more than stupid. Does not support the "run" command as an example. They modified the U-Boot MAGIC Word to complicate things. The U-Boot is not configured to use device tree files. The board runs a 2.6 kernel right now. Several attempts by me a and others to rebuild U-Boot according to the H/W vendors source code and build instructions results in a bricked unit. Bricked units cannot be recovered. Not my choice of H/W, so I cannot change it. === OPENWRT: I noticed when checking out the OpenWRT support for the board that they have a method to avoid having to pass the device tree address to the kernel, and can thus boot device tree based kernels with U-boots that does not support device trees. What they do is to reserve 16 kB of kernel space, and tag it with an ASCII string "OWRTDTB:". After the kernel and dtb is built, a utility "patch-dtb" will update the vmlinux binary, copying in the device tree file. === It would be useful to me, and I could of course patch the mainstream kernel, but first I would like to check if this is of interest for mainstream. I envisage the support would look something like: Kconfig. config MIPS select HAVE_IMAGE_DTB config HAVE_IMAGE_DTB bool if HAVE_IMAGE_DTB config IMAGE_DTB bool"Allocated space for DTB within image config DTB_SIZE int "DTB space (kB) config DTB_TAG string "DTB space tag" default "OWRTDTB:" endif Some Makefile obj-$(CONFIG_INCLUDE_DTB) += image_dtb.o image_dtb.S: .text .align 5 .ascii CONFIG_DTB_TAG EXPORT(__image_dtb) .fill DTB_SIZE * 1024 === arch/mips/xxx/of.c: #if defined(CONFIG_IMAGE_DTB) if () __dt_setup_arch(__dtb_start); else __dt_setup_arch(&__image_dtb); #else __dt_setup_arch(__dtb_start); #endif I imagine that if the support is enabled for a target, it should be possible to override it with a CMDLINE argument They do something similar for the CMDLINE; copying it into the vmlinux, to allow a smaller boot -- Best Regards Ulf Samuelsson
RFC: Copying Device Tree File into reserved area of VMLINUX before deployment
I noticed when checking out the OpenWRT support for the board that they have a method to avoid having to pass the device tree address to the kernel, and can thus boot device tree based kernels with U-boots that does not support device trees. Is this something that would be considered useful for including in mainstream: BACKGROUND: Trying to load a yocto kernel into a MIPS target (MT7620A based), and the U-Boot is more than stupid. Does not support the "run" command as an example. They modified the U-Boot MAGIC Word to complicate things. The U-Boot is not configured to use device tree files. The board runs a 2.6 kernel right now. Several attempts by me a and others to rebuild U-Boot according to the H/W vendors source code and build instructions results in a bricked unit. Bricked units cannot be recovered. Not my choice of H/W, so I cannot change it. === OPENWRT: I noticed when checking out the OpenWRT support for the board that they have a method to avoid having to pass the device tree address to the kernel, and can thus boot device tree based kernels with U-boots that does not support device trees. What they do is to reserve 16 kB of kernel space, and tag it with an ASCII string "OWRTDTB:". After the kernel and dtb is built, a utility "patch-dtb" will update the vmlinux binary, copying in the device tree file. === It would be useful to me, and I could of course patch the mainstream kernel, but first I would like to check if this is of interest for mainstream. I envisage the support would look something like: Kconfig. config MIPS select HAVE_IMAGE_DTB config HAVE_IMAGE_DTB bool if HAVE_IMAGE_DTB config IMAGE_DTB bool"Allocated space for DTB within image config DTB_SIZE int "DTB space (kB) config DTB_TAG string "DTB space tag" default "OWRTDTB:" endif Some Makefile obj-$(CONFIG_INCLUDE_DTB) += image_dtb.o image_dtb.S: .text .align 5 .ascii CONFIG_DTB_TAG EXPORT(__image_dtb) .fill DTB_SIZE * 1024 === arch/mips/xxx/of.c: #if defined(CONFIG_IMAGE_DTB) if () __dt_setup_arch(__dtb_start); else __dt_setup_arch(&__image_dtb); #else __dt_setup_arch(__dtb_start); #endif I imagine that if the support is enabled for a target, it should be possible to override it with a CMDLINE argument They do something similar for the CMDLINE; copying it into the vmlinux, to allow a smaller boot -- Best Regards Ulf Samuelsson
Re: [PATCH v18 5/6] vfio: ABI for mdev display dma-buf operation
Extremely sorry for the delay. This works for VFIO_GFX_PLANE_TYPE_REGION. Tested with local changes. Reviewed-by: Kirti WankhedeThanks, Kirti On 11/18/2017 9:00 PM, Alex Williamson wrote: > > Kirti? > > On Wed, 15 Nov 2017 21:11:42 -0700 > Alex Williamson wrote: > >> On Thu, 16 Nov 2017 11:21:56 +0800 >> Zhenyu Wang wrote: >> >>> On 2017.11.15 11:48:42 -0700, Alex Williamson wrote: On Wed, 15 Nov 2017 17:11:54 +0800 Tina Zhang wrote: > Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user query and get > a plane and its information. So far, two types of buffers are supported: > buffers based on dma-buf and buffers based on region. > > This ioctl can be invoked with: > 1) Either DMABUF or REGION flag. Vendor driver returns a plane_info > successfully only when the specific kind of buffer is supported. > 2) Flag PROBE. And at the same time either DMABUF or REGION must be set, > so that vendor driver returns success only when the specific kind of > buffer is supported. > > Add VFIO_DEVICE_GET_GFX_DMABUF ioctl command to let user get a specific > dma-buf fd of an exposed MDEV buffer provided by dmabuf_id which was > returned in VFIO_DEVICE_QUERY_GFX_PLANE ioctl command. > > The life cycle of an exposed MDEV buffer is handled by userspace and > tracked by kernel space. The returned dmabuf_id in struct vfio_device_ > query_gfx_plane can be a new id of a new exposed buffer or an old id of > a re-exported buffer. Host user can check the value of dmabuf_id to see > if it needs to create new resources according to the new exposed buffer > or just re-use the existing resource related to the old buffer. > > v18: > - update comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex) > > v17: > - modify VFIO_DEVICE_GET_GFX_DMABUF interface. (Alex) > > v16: > - add x_hot and y_hot fields. (Gerd) > - add comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex) > - rebase to 4.14.0-rc6. > > v15: > - add a ioctl to get a dmabuf for a given dmabuf id. (Gerd) > > v14: > - add PROBE, DMABUF and REGION flags. (Alex) > > v12: > - add drm_format_mod back. (Gerd and Zhenyu) > - add region_index. (Gerd) > > v11: > - rename plane_type to drm_plane_type. (Gerd) > - move fields of vfio_device_query_gfx_plane to > vfio_device_gfx_plane_info. > (Gerd) > - remove drm_format_mod, start fields. (Daniel) > - remove plane_id. > > v10: > - refine the ABI API VFIO_DEVICE_QUERY_GFX_PLANE. (Alex) (Gerd) > > v3: > - add a field gvt_plane_info in the drm_i915_gem_obj structure to save > the decoded plane information to avoid look up while need the plane > info. (Gerd) > > Signed-off-by: Tina Zhang > Cc: Gerd Hoffmann > Cc: Alex Williamson > Cc: Daniel Vetter > --- > include/uapi/linux/vfio.h | 62 > +++ > 1 file changed, 62 insertions(+) > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > index ae46105..5c1cca2 100644 > --- a/include/uapi/linux/vfio.h > +++ b/include/uapi/linux/vfio.h > @@ -502,6 +502,68 @@ struct vfio_pci_hot_reset { > > #define VFIO_DEVICE_PCI_HOT_RESET_IO(VFIO_TYPE, VFIO_BASE + 13) > > +/** > + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14, > + *struct vfio_device_query_gfx_plane) > + * > + * Set the drm_plane_type and flags, then retrieve the gfx plane info. > + * > + * flags supported: > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set > + * to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no > + * support for dma-buf. > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set > + * to ask if the mdev supports region. 0 on support, -EINVAL on no > + * support for region. > + * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set > + * with each call to query the plane info. > + * - Others are invalid and return -EINVAL. > + * > + * Note: > + * 1. Plane could be disabled by guest. In that case, success will be > + *returned with zero-initialized drm_format, size, width and height > + *fields. > + * 2. x_hot/y_hot is set to 0x if no hotspot information > available > + * > + * Return: 0 on success, -errno on other failure. > + */ > +struct vfio_device_gfx_plane_info { > + __u32 argsz; > + __u32 flags; > +#define VFIO_GFX_PLANE_TYPE_PROBE (1 << 0) > +#define
Re: [PATCH v18 5/6] vfio: ABI for mdev display dma-buf operation
Extremely sorry for the delay. This works for VFIO_GFX_PLANE_TYPE_REGION. Tested with local changes. Reviewed-by: Kirti Wankhede Thanks, Kirti On 11/18/2017 9:00 PM, Alex Williamson wrote: > > Kirti? > > On Wed, 15 Nov 2017 21:11:42 -0700 > Alex Williamson wrote: > >> On Thu, 16 Nov 2017 11:21:56 +0800 >> Zhenyu Wang wrote: >> >>> On 2017.11.15 11:48:42 -0700, Alex Williamson wrote: On Wed, 15 Nov 2017 17:11:54 +0800 Tina Zhang wrote: > Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user query and get > a plane and its information. So far, two types of buffers are supported: > buffers based on dma-buf and buffers based on region. > > This ioctl can be invoked with: > 1) Either DMABUF or REGION flag. Vendor driver returns a plane_info > successfully only when the specific kind of buffer is supported. > 2) Flag PROBE. And at the same time either DMABUF or REGION must be set, > so that vendor driver returns success only when the specific kind of > buffer is supported. > > Add VFIO_DEVICE_GET_GFX_DMABUF ioctl command to let user get a specific > dma-buf fd of an exposed MDEV buffer provided by dmabuf_id which was > returned in VFIO_DEVICE_QUERY_GFX_PLANE ioctl command. > > The life cycle of an exposed MDEV buffer is handled by userspace and > tracked by kernel space. The returned dmabuf_id in struct vfio_device_ > query_gfx_plane can be a new id of a new exposed buffer or an old id of > a re-exported buffer. Host user can check the value of dmabuf_id to see > if it needs to create new resources according to the new exposed buffer > or just re-use the existing resource related to the old buffer. > > v18: > - update comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex) > > v17: > - modify VFIO_DEVICE_GET_GFX_DMABUF interface. (Alex) > > v16: > - add x_hot and y_hot fields. (Gerd) > - add comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex) > - rebase to 4.14.0-rc6. > > v15: > - add a ioctl to get a dmabuf for a given dmabuf id. (Gerd) > > v14: > - add PROBE, DMABUF and REGION flags. (Alex) > > v12: > - add drm_format_mod back. (Gerd and Zhenyu) > - add region_index. (Gerd) > > v11: > - rename plane_type to drm_plane_type. (Gerd) > - move fields of vfio_device_query_gfx_plane to > vfio_device_gfx_plane_info. > (Gerd) > - remove drm_format_mod, start fields. (Daniel) > - remove plane_id. > > v10: > - refine the ABI API VFIO_DEVICE_QUERY_GFX_PLANE. (Alex) (Gerd) > > v3: > - add a field gvt_plane_info in the drm_i915_gem_obj structure to save > the decoded plane information to avoid look up while need the plane > info. (Gerd) > > Signed-off-by: Tina Zhang > Cc: Gerd Hoffmann > Cc: Alex Williamson > Cc: Daniel Vetter > --- > include/uapi/linux/vfio.h | 62 > +++ > 1 file changed, 62 insertions(+) > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > index ae46105..5c1cca2 100644 > --- a/include/uapi/linux/vfio.h > +++ b/include/uapi/linux/vfio.h > @@ -502,6 +502,68 @@ struct vfio_pci_hot_reset { > > #define VFIO_DEVICE_PCI_HOT_RESET_IO(VFIO_TYPE, VFIO_BASE + 13) > > +/** > + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14, > + *struct vfio_device_query_gfx_plane) > + * > + * Set the drm_plane_type and flags, then retrieve the gfx plane info. > + * > + * flags supported: > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set > + * to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no > + * support for dma-buf. > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set > + * to ask if the mdev supports region. 0 on support, -EINVAL on no > + * support for region. > + * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set > + * with each call to query the plane info. > + * - Others are invalid and return -EINVAL. > + * > + * Note: > + * 1. Plane could be disabled by guest. In that case, success will be > + *returned with zero-initialized drm_format, size, width and height > + *fields. > + * 2. x_hot/y_hot is set to 0x if no hotspot information > available > + * > + * Return: 0 on success, -errno on other failure. > + */ > +struct vfio_device_gfx_plane_info { > + __u32 argsz; > + __u32 flags; > +#define VFIO_GFX_PLANE_TYPE_PROBE (1 << 0) > +#define VFIO_GFX_PLANE_TYPE_DMABUF (1 << 1) > +#define VFIO_GFX_PLANE_TYPE_REGION (1 << 2) > + /* in */ > + __u32 drm_plane_type; /* type of plane: DRM_PLANE_TYPE_* */ > + /* out */ > + __u32
[PATCH] Staging: comedi: adl_pci9118.c : fixed code style issue
Removed uneccessary parantheses which were sorrounding two if-statements. Signed-off-by: Fabian Baumanis--- drivers/staging/comedi/drivers/adl_pci9118.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index 1cc9b7e..c77b994 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -946,8 +946,7 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) devpriv->ai_add_back = 0; if (devpriv->master) { devpriv->usedma = 1; - if ((cmd->flags & CMDF_WAKE_EOS) && - (cmd->scan_end_arg == 1)) { + if (cmd->flags & CMDF_WAKE_EOS && cmd->scan_end_arg == 1) { if (cmd->convert_src == TRIG_NOW) devpriv->ai_add_back = 1; if (cmd->convert_src == TRIG_TIMER) { -- 2.7.4
[PATCH] Staging: comedi: adl_pci9118.c : fixed code style issue
Removed uneccessary parantheses which were sorrounding two if-statements. Signed-off-by: Fabian Baumanis --- drivers/staging/comedi/drivers/adl_pci9118.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index 1cc9b7e..c77b994 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -946,8 +946,7 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) devpriv->ai_add_back = 0; if (devpriv->master) { devpriv->usedma = 1; - if ((cmd->flags & CMDF_WAKE_EOS) && - (cmd->scan_end_arg == 1)) { + if (cmd->flags & CMDF_WAKE_EOS && cmd->scan_end_arg == 1) { if (cmd->convert_src == TRIG_NOW) devpriv->ai_add_back = 1; if (cmd->convert_src == TRIG_TIMER) { -- 2.7.4
Re: Commit fcd8843c40 breaks old compilers
On Sat, 2017-11-18 at 12:19 -0500, Boris Ostrovsky wrote: > Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older > compilers which cannot process initializers for anonymous structures: > > +const nfs4_stateid invalid_stateid = { > + { > + .seqid = cpu_to_be32(0xU), > + .other = { 0 }, > + }, > + .type = NFS4_INVALID_STATEID_TYPE, > +}; > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown field > ‘seqid’ specified in initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing > braces > around initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near > initialization for ‘invalid_stateid..data’) > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow in > implicit constant conversion > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown field > ‘other’ specified in initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace > group > at end of initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near > initialization for ‘invalid_stateid.’) > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess > elements > in union initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near > initialization for ‘invalid_stateid.’) > make[4]: *** [fs/nfs/nfs4state.o] Error 1 > make[3]: *** [fs/nfs] Error 2 > > > FC-64gcc --version > gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2) > > > A similar bug was fixed by e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 > but > I don't think the same approach can work here. I don't have any setups with gcc 4.4.4. What is it expecting here? Is it expecting an extra set of braces due to the anonymous "struct"? -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.mykleb...@primarydata.com
Re: Commit fcd8843c40 breaks old compilers
On Sat, 2017-11-18 at 12:19 -0500, Boris Ostrovsky wrote: > Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older > compilers which cannot process initializers for anonymous structures: > > +const nfs4_stateid invalid_stateid = { > + { > + .seqid = cpu_to_be32(0xU), > + .other = { 0 }, > + }, > + .type = NFS4_INVALID_STATEID_TYPE, > +}; > > > /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown field > ‘seqid’ specified in initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing > braces > around initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near > initialization for ‘invalid_stateid..data’) > /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow in > implicit constant conversion > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown field > ‘other’ specified in initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace > group > at end of initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near > initialization for ‘invalid_stateid.’) > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess > elements > in union initializer > /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near > initialization for ‘invalid_stateid.’) > make[4]: *** [fs/nfs/nfs4state.o] Error 1 > make[3]: *** [fs/nfs] Error 2 > > > FC-64 gcc --version > gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2) > > > A similar bug was fixed by e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 > but > I don't think the same approach can work here. I don't have any setups with gcc 4.4.4. What is it expecting here? Is it expecting an extra set of braces due to the anonymous "struct"? -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.mykleb...@primarydata.com
Commit fcd8843c40 breaks old compilers
Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older compilers which cannot process initializers for anonymous structures: +const nfs4_stateid invalid_stateid = { + { + .seqid = cpu_to_be32(0xU), + .other = { 0 }, + }, + .type = NFS4_INVALID_STATEID_TYPE, +}; /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown field ‘seqid’ specified in initializer /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing braces around initializer /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near initialization for ‘invalid_stateid..data’) /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow in implicit constant conversion /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown field ‘other’ specified in initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace group at end of initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near initialization for ‘invalid_stateid.’) /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess elements in union initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near initialization for ‘invalid_stateid.’) make[4]: *** [fs/nfs/nfs4state.o] Error 1 make[3]: *** [fs/nfs] Error 2 FC-64gcc --version gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2) A similar bug was fixed by e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 but I don't think the same approach can work here. -boris
Commit fcd8843c40 breaks old compilers
Commit fcd8843c406b46433857ae45e5e9d84b01a7d20b breaks on older compilers which cannot process initializers for anonymous structures: +const nfs4_stateid invalid_stateid = { + { + .seqid = cpu_to_be32(0xU), + .other = { 0 }, + }, + .type = NFS4_INVALID_STATEID_TYPE, +}; /home/build/linux-linus/fs/nfs/nfs4state.c:74: error: unknown field ‘seqid’ specified in initializer /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: missing braces around initializer /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: (near initialization for ‘invalid_stateid..data’) /home/build/linux-linus/fs/nfs/nfs4state.c:74: warning: overflow in implicit constant conversion /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: unknown field ‘other’ specified in initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: extra brace group at end of initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: error: (near initialization for ‘invalid_stateid.’) /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: excess elements in union initializer /home/build/linux-linus/fs/nfs/nfs4state.c:75: warning: (near initialization for ‘invalid_stateid.’) make[4]: *** [fs/nfs/nfs4state.o] Error 1 make[3]: *** [fs/nfs] Error 2 FC-64 gcc --version gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2) A similar bug was fixed by e0714ec4f9efe7b86828b0dcc077fd8f5d8e5e91 but I don't think the same approach can work here. -boris
Re: [RFC PATCH 7/7] ASoC: Intel: boards: align/fix SKL/BXT/KBL Kconfigs
On Fri, 2017-11-17 at 18:02 -0600, Pierre-Louis Bossart wrote: > No reason why SND_SOC_INTEL_SST should be set here. > Also make sure same dependencies are used everywhere (only last one > has SPI > in addition) Regarding to my comment against previous patch... > config SND_SOC_INTEL_SKL_RT286_MACH > tristate "ASoC Audio driver for SKL with RT286 I2S mode" > - depends on X86 && ACPI && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Skylake -> No. > config SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH > tristate "ASoC Audio driver for SKL with NAU88L25 and SSM4567 > in I2S Mode" > - depends on X86_INTEL_LPSS && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Skylake -> No. > config SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH > tristate "ASoC Audio driver for SKL with NAU88L25 and > MAX98357A in I2S Mode" > - depends on X86_INTEL_LPSS && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Skylake -> No. > config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH > tristate "ASoC Audio driver for Broxton with DA7219 and > MAX98357A in I2S Mode" > - depends on X86 && ACPI && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Broxton -> No. > config SND_SOC_INTEL_BXT_RT298_MACH > tristate "ASoC Audio driver for Broxton with RT298 I2S mode" > - depends on X86 && ACPI && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Broxton -> No. > config SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH > tristate "ASoC Audio driver for KBL with RT5663 and MAX98927 > in I2S Mode" > - depends on X86_INTEL_LPSS && I2C > - select SND_SOC_INTEL_SST > + depends on X86_INTEL_LPSS && I2C && ACPI Kabylake -> No. > config SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH > tristate "ASoC Audio driver for KBL with RT5663, RT5514 and > MAX98927 in I2S Mode" > -depends on X86_INTEL_LPSS && I2C && SPI > -select SND_SOC_INTEL_SST > +depends on X86_INTEL_LPSS && I2C && SPI && ACPI Kabylake -> No. This patch WRT X86_INTEL_LPSS for selected SoCs does not make any sense. Perhaps you need to depend on MFD_INTEL_LPSS (Skylake and newer) instead. -- Andy ShevchenkoIntel Finland Oy
Re: [RFC PATCH 7/7] ASoC: Intel: boards: align/fix SKL/BXT/KBL Kconfigs
On Fri, 2017-11-17 at 18:02 -0600, Pierre-Louis Bossart wrote: > No reason why SND_SOC_INTEL_SST should be set here. > Also make sure same dependencies are used everywhere (only last one > has SPI > in addition) Regarding to my comment against previous patch... > config SND_SOC_INTEL_SKL_RT286_MACH > tristate "ASoC Audio driver for SKL with RT286 I2S mode" > - depends on X86 && ACPI && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Skylake -> No. > config SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH > tristate "ASoC Audio driver for SKL with NAU88L25 and SSM4567 > in I2S Mode" > - depends on X86_INTEL_LPSS && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Skylake -> No. > config SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH > tristate "ASoC Audio driver for SKL with NAU88L25 and > MAX98357A in I2S Mode" > - depends on X86_INTEL_LPSS && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Skylake -> No. > config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH > tristate "ASoC Audio driver for Broxton with DA7219 and > MAX98357A in I2S Mode" > - depends on X86 && ACPI && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Broxton -> No. > config SND_SOC_INTEL_BXT_RT298_MACH > tristate "ASoC Audio driver for Broxton with RT298 I2S mode" > - depends on X86 && ACPI && I2C > + depends on X86_INTEL_LPSS && I2C && ACPI Broxton -> No. > config SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH > tristate "ASoC Audio driver for KBL with RT5663 and MAX98927 > in I2S Mode" > - depends on X86_INTEL_LPSS && I2C > - select SND_SOC_INTEL_SST > + depends on X86_INTEL_LPSS && I2C && ACPI Kabylake -> No. > config SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH > tristate "ASoC Audio driver for KBL with RT5663, RT5514 and > MAX98927 in I2S Mode" > -depends on X86_INTEL_LPSS && I2C && SPI > -select SND_SOC_INTEL_SST > +depends on X86_INTEL_LPSS && I2C && SPI && ACPI Kabylake -> No. This patch WRT X86_INTEL_LPSS for selected SoCs does not make any sense. Perhaps you need to depend on MFD_INTEL_LPSS (Skylake and newer) instead. -- Andy Shevchenko Intel Finland Oy
Re: [RFC PATCH 6/7] ASoC: Intel: boards: align Kconfig configurations for HiFi2
On Fri, 2017-11-17 at 18:02 -0600, Pierre-Louis Bossart wrote: > Make sure all the configs are aligned > Also add the missing dependencies on SOC_ACPI stuff used to fix > DAI names based on HID. > > FIXME: not sure why X86_INTEL_LPSS is needed in a machine > driver config, should it be back to X86 everywhere? > X86_INTEL_LPSS makes sense only for Haswell, Broadwell, BayTrail and CherryTrail (more precisely for PCH inside those SoCs). Basically it enables few peripheral drivers in case they are enumerated via ACPI (SPI, I2C, UART, PWM, SDHCI) on SoCs listed above. Hope this would help how to deal with the option in ASoC case. -- Andy ShevchenkoIntel Finland Oy
Re: [RFC PATCH 6/7] ASoC: Intel: boards: align Kconfig configurations for HiFi2
On Fri, 2017-11-17 at 18:02 -0600, Pierre-Louis Bossart wrote: > Make sure all the configs are aligned > Also add the missing dependencies on SOC_ACPI stuff used to fix > DAI names based on HID. > > FIXME: not sure why X86_INTEL_LPSS is needed in a machine > driver config, should it be back to X86 everywhere? > X86_INTEL_LPSS makes sense only for Haswell, Broadwell, BayTrail and CherryTrail (more precisely for PCH inside those SoCs). Basically it enables few peripheral drivers in case they are enumerated via ACPI (SPI, I2C, UART, PWM, SDHCI) on SoCs listed above. Hope this would help how to deal with the option in ASoC case. -- Andy Shevchenko Intel Finland Oy
Re: [RFC PATCH 2/7] ASoC: Intel: Kconfig: Simplify-clarify ACPI/PCI dependencies
On Sat, 2017-11-18 at 18:53 +0200, Andy Shevchenko wrote: > On Fri, 2017-11-17 at 18:01 -0600, Pierre-Louis Bossart wrote: > > PCI/ACPI selections should not happen in Kconfig for machine > > drivers, > > move to SOC selections. > > > > Add distinction between PCI and ACPI HiFi2 platforms. > > > > The PCI-based > > platforms may be removed at some point since Medfield is not really > > supported by anyone > > This is rather true, > > > and there is no publicly available firmware for > > Merrifield. > > while this is not true. Intel Edison board is based on Merrifield SoC s/SoC/platform/ > and I'm sure people are able to make a sound out of it. > -- Andy ShevchenkoIntel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Re: [RFC PATCH 2/7] ASoC: Intel: Kconfig: Simplify-clarify ACPI/PCI dependencies
On Sat, 2017-11-18 at 18:53 +0200, Andy Shevchenko wrote: > On Fri, 2017-11-17 at 18:01 -0600, Pierre-Louis Bossart wrote: > > PCI/ACPI selections should not happen in Kconfig for machine > > drivers, > > move to SOC selections. > > > > Add distinction between PCI and ACPI HiFi2 platforms. > > > > The PCI-based > > platforms may be removed at some point since Medfield is not really > > supported by anyone > > This is rather true, > > > and there is no publicly available firmware for > > Merrifield. > > while this is not true. Intel Edison board is based on Merrifield SoC s/SoC/platform/ > and I'm sure people are able to make a sound out of it. > -- Andy Shevchenko Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Re: [RFC PATCH 2/7] ASoC: Intel: Kconfig: Simplify-clarify ACPI/PCI dependencies
On Fri, 2017-11-17 at 18:01 -0600, Pierre-Louis Bossart wrote: > PCI/ACPI selections should not happen in Kconfig for machine drivers, > move to SOC selections. > > Add distinction between PCI and ACPI HiFi2 platforms. > The PCI-based > platforms may be removed at some point since Medfield is not really > supported by anyone This is rather true, > and there is no publicly available firmware for > Merrifield. while this is not true. Intel Edison board is based on Merrifield SoC and I'm sure people are able to make a sound out of it. -- Andy ShevchenkoIntel Finland Oy
Re: [RFC PATCH 2/7] ASoC: Intel: Kconfig: Simplify-clarify ACPI/PCI dependencies
On Fri, 2017-11-17 at 18:01 -0600, Pierre-Louis Bossart wrote: > PCI/ACPI selections should not happen in Kconfig for machine drivers, > move to SOC selections. > > Add distinction between PCI and ACPI HiFi2 platforms. > The PCI-based > platforms may be removed at some point since Medfield is not really > supported by anyone This is rather true, > and there is no publicly available firmware for > Merrifield. while this is not true. Intel Edison board is based on Merrifield SoC and I'm sure people are able to make a sound out of it. -- Andy Shevchenko Intel Finland Oy
Re: [RFC PATCH 1/7] ASoC: Intel: Fix Kconfig
On Sat, 18 Nov 2017 01:01:56 +0100, Pierre-Louis Bossart wrote: > > +if SND_SOC_INTEL_BAYTRAIL > > config SND_SOC_INTEL_BYT_MAX98090_MACH > tristate "ASoC Audio driver for Intel Baytrail with MAX98090 codec" > + default n default=n is superfluous, can be dropped. > depends on X86_INTEL_LPSS && I2C > - depends on SND_SST_IPC_ACPI = n > - depends on SND_SOC_INTEL_BAYTRAIL > select SND_SOC_MAX98090 So the dependency on ND_SST_IPC_ACPI=n is removed here too, and I guess this will allow this machine driver built although it shouldn't be? thanks, Takashi
Re: [RFC PATCH 1/7] ASoC: Intel: Fix Kconfig
On Sat, 18 Nov 2017 01:01:56 +0100, Pierre-Louis Bossart wrote: > > +if SND_SOC_INTEL_BAYTRAIL > > config SND_SOC_INTEL_BYT_MAX98090_MACH > tristate "ASoC Audio driver for Intel Baytrail with MAX98090 codec" > + default n default=n is superfluous, can be dropped. > depends on X86_INTEL_LPSS && I2C > - depends on SND_SST_IPC_ACPI = n > - depends on SND_SOC_INTEL_BAYTRAIL > select SND_SOC_MAX98090 So the dependency on ND_SST_IPC_ACPI=n is removed here too, and I guess this will allow this machine driver built although it shouldn't be? thanks, Takashi
Re: [PATCH v2] iio: mma8452: replace license description with SPDX specifier
On Sat, Nov 18, 2017 at 4:53 PM, Jonathan Cameronwrote: > On Sat, 18 Nov 2017 10:10:11 +0100 > Martin Kepplinger wrote: > >> This replaces the custom license information text with the appropriate >> SPDX identifier. While the information here stays the same, it is easier >> to read. >> >> Signed-off-by: Martin Kepplinger >> Acked-by: Peter Meerwald-Stadler > > I'm not 100% sure the intent of the SPDX work is to remove > existing licence text. So far the big sets have only been > adding tags to files missing their licenses entirely... > > Anyone found any specific guidance on this? Jonathan: you might want to check the doc patches from tglx [1] as well as several related patches from greg k-h such as these [2] and his initial pull [3] To get a lot of details you can check all the recent SPDX-related posts too [4] [1] https://marc.info/?l=linux-kernel=151051532322831=2 [2] https://marc.info/?l=linux-kernel=151068111802610=2 [3] https://marc.info/?l=linux-kernel=150963579219623=2 [4] https://marc.info/?l=linux-kernel=2=1=spdx=b -- Cordially Philippe Ombredanne
Re: [PATCH v2] iio: mma8452: replace license description with SPDX specifier
On Sat, Nov 18, 2017 at 4:53 PM, Jonathan Cameron wrote: > On Sat, 18 Nov 2017 10:10:11 +0100 > Martin Kepplinger wrote: > >> This replaces the custom license information text with the appropriate >> SPDX identifier. While the information here stays the same, it is easier >> to read. >> >> Signed-off-by: Martin Kepplinger >> Acked-by: Peter Meerwald-Stadler > > I'm not 100% sure the intent of the SPDX work is to remove > existing licence text. So far the big sets have only been > adding tags to files missing their licenses entirely... > > Anyone found any specific guidance on this? Jonathan: you might want to check the doc patches from tglx [1] as well as several related patches from greg k-h such as these [2] and his initial pull [3] To get a lot of details you can check all the recent SPDX-related posts too [4] [1] https://marc.info/?l=linux-kernel=151051532322831=2 [2] https://marc.info/?l=linux-kernel=151068111802610=2 [3] https://marc.info/?l=linux-kernel=150963579219623=2 [4] https://marc.info/?l=linux-kernel=2=1=spdx=b -- Cordially Philippe Ombredanne
[PATCH] staging: comedi: ni_atmio: fix license warning.
Resolving license check warning for drivers/staging/comedi. Added the license definitions present in the rest of the module and made sure it's aligned with the license (GPL) in the comments for the affected file (ni_atmio.c). Original warning: WARNING: modpost: missing MODULE_LICENSE() in drivers/staging/comedi//drivers/ni_atmio.o see include/linux/module.h for more information. No longer present after change. Signed-off-by: Matthew Giassa--- drivers/staging/comedi/drivers/ni_atmio.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c index 2d62a8c..ae6ed96 100644 --- a/drivers/staging/comedi/drivers/ni_atmio.c +++ b/drivers/staging/comedi/drivers/ni_atmio.c @@ -361,3 +361,8 @@ static struct comedi_driver ni_atmio_driver = { .detach = ni_atmio_detach, }; module_comedi_driver(ni_atmio_driver); + +MODULE_AUTHOR("Comedi http://www.comedi.org;); +MODULE_DESCRIPTION("Comedi low-level driver"); +MODULE_LICENSE("GPL"); + -- 2.7.4
[PATCH] staging: comedi: ni_atmio: fix license warning.
Resolving license check warning for drivers/staging/comedi. Added the license definitions present in the rest of the module and made sure it's aligned with the license (GPL) in the comments for the affected file (ni_atmio.c). Original warning: WARNING: modpost: missing MODULE_LICENSE() in drivers/staging/comedi//drivers/ni_atmio.o see include/linux/module.h for more information. No longer present after change. Signed-off-by: Matthew Giassa --- drivers/staging/comedi/drivers/ni_atmio.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c index 2d62a8c..ae6ed96 100644 --- a/drivers/staging/comedi/drivers/ni_atmio.c +++ b/drivers/staging/comedi/drivers/ni_atmio.c @@ -361,3 +361,8 @@ static struct comedi_driver ni_atmio_driver = { .detach = ni_atmio_detach, }; module_comedi_driver(ni_atmio_driver); + +MODULE_AUTHOR("Comedi http://www.comedi.org;); +MODULE_DESCRIPTION("Comedi low-level driver"); +MODULE_LICENSE("GPL"); + -- 2.7.4
Re: [v4,3/3] hwmon: (w83773g) Add documentation
On Mon, Nov 13, 2017 at 11:27:34AM +0800, Lei YU wrote: > Add documentation for the w83773g driver. > > Signed-off-by: Lei YUApplied to hwmon-next. Thanks, Guenter
Re: [v4,3/3] hwmon: (w83773g) Add documentation
On Mon, Nov 13, 2017 at 11:27:34AM +0800, Lei YU wrote: > Add documentation for the w83773g driver. > > Signed-off-by: Lei YU Applied to hwmon-next. Thanks, Guenter
Re: [v4,2/3] drivers: hwmon: Add W83773G driver
On Mon, Nov 13, 2017 at 11:27:33AM +0800, Lei YU wrote: > Nuvoton W83773G is a hardware monitor IC providing one local > temperature and two remote temperature sensors. > > Signed-off-by: Lei YUApplied to hwmon-next. Thanks, Guenter > --- > v2: > - Rewrite the driver using regmap > - Add offset and update_interval > v3: > - Use devm_hwmon_device_register_with_info() with is_visible/read/write >functions. > v4: > - Fix review comments. > --- > drivers/hwmon/Kconfig | 10 ++ > drivers/hwmon/Makefile | 1 + > drivers/hwmon/w83773g.c | 329 > > 3 files changed, 340 insertions(+) > create mode 100644 drivers/hwmon/w83773g.c > > diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig > index d654314..11c6248 100644 > --- a/drivers/hwmon/Kconfig > +++ b/drivers/hwmon/Kconfig > @@ -1710,6 +1710,16 @@ config SENSORS_VT8231 > This driver can also be built as a module. If so, the module > will be called vt8231. > > +config SENSORS_W83773G > + tristate "Nuvoton W83773G" > + depends on I2C > + help > + If you say yes here you get support for the Nuvoton W83773G hardware > + monitoring chip. > + > + This driver can also be built as a module. If so, the module > + will be called w83773g. > + > config SENSORS_W83781D > tristate "Winbond W83781D, W83782D, W83783S, Asus AS99127F" > depends on I2C > diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile > index c84d978..0649ad8 100644 > --- a/drivers/hwmon/Makefile > +++ b/drivers/hwmon/Makefile > @@ -13,6 +13,7 @@ obj-$(CONFIG_SENSORS_ATK0110) += asus_atk0110.o > # asb100, then w83781d go first, as they can override other drivers' > addresses. > obj-$(CONFIG_SENSORS_ASB100) += asb100.o > obj-$(CONFIG_SENSORS_W83627HF) += w83627hf.o > +obj-$(CONFIG_SENSORS_W83773G)+= w83773g.o > obj-$(CONFIG_SENSORS_W83792D)+= w83792d.o > obj-$(CONFIG_SENSORS_W83793) += w83793.o > obj-$(CONFIG_SENSORS_W83795) += w83795.o > diff --git a/drivers/hwmon/w83773g.c b/drivers/hwmon/w83773g.c > new file mode 100644 > index 000..0b97c28 > --- /dev/null > +++ b/drivers/hwmon/w83773g.c > @@ -0,0 +1,329 @@ > +/* > + * Copyright (C) 2017 IBM Corp. > + * > + * 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. > + * > + * Driver for the Nuvoton W83773G SMBus temperature sensor IC. > + * Supported models: W83773G > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +/* W83773 has 3 channels */ > +#define W83773_CHANNELS 3 > + > +/* The W83773 registers */ > +#define W83773_CONVERSION_RATE_REG_READ 0x04 > +#define W83773_CONVERSION_RATE_REG_WRITE 0x0A > +#define W83773_MANUFACTURER_ID_REG 0xFE > +#define W83773_LOCAL_TEMP0x00 > + > +static const u8 W83773_STATUS[2] = { 0x02, 0x17 }; > + > +static const u8 W83773_TEMP_LSB[2] = { 0x10, 0x25 }; > +static const u8 W83773_TEMP_MSB[2] = { 0x01, 0x24 }; > + > +static const u8 W83773_OFFSET_LSB[2] = { 0x12, 0x16 }; > +static const u8 W83773_OFFSET_MSB[2] = { 0x11, 0x15 }; > + > +/* this is the number of sensors in the device */ > +static const struct i2c_device_id w83773_id[] = { > + { "w83773g" }, > + { } > +}; > + > +MODULE_DEVICE_TABLE(i2c, w83773_id); > + > +static const struct of_device_id w83773_of_match[] = { > + { > + .compatible = "nuvoton,w83773g" > + }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, w83773_of_match); > + > +static inline long temp_of_local(s8 reg) > +{ > + return reg * 1000; > +} > + > +static inline long temp_of_remote(s8 hb, u8 lb) > +{ > + return (hb << 3 | lb >> 5) * 125; > +} > + > +static int get_local_temp(struct regmap *regmap, long *val) > +{ > + unsigned int regval; > + int ret; > + > + ret = regmap_read(regmap, W83773_LOCAL_TEMP, ); > + if (ret < 0) > + return ret; > + > + *val = temp_of_local(regval); > + return 0; > +} > + > +static int get_remote_temp(struct regmap *regmap, int index, long *val) > +{ > + unsigned int regval_high; > + unsigned int regval_low; > + int ret; > + > + ret = regmap_read(regmap, W83773_TEMP_MSB[index], _high); > + if (ret < 0) > + return ret; > + > + ret = regmap_read(regmap, W83773_TEMP_LSB[index], _low); > + if (ret < 0) > + return ret; > + > + *val = temp_of_remote(regval_high, regval_low); > + return 0; > +} > + > +static int get_fault(struct regmap *regmap, int index, long *val) > +{ > + unsigned int regval; > + int ret; > + > + ret = regmap_read(regmap, W83773_STATUS[index], ); > + if (ret < 0)
Re: [v4,2/3] drivers: hwmon: Add W83773G driver
On Mon, Nov 13, 2017 at 11:27:33AM +0800, Lei YU wrote: > Nuvoton W83773G is a hardware monitor IC providing one local > temperature and two remote temperature sensors. > > Signed-off-by: Lei YU Applied to hwmon-next. Thanks, Guenter > --- > v2: > - Rewrite the driver using regmap > - Add offset and update_interval > v3: > - Use devm_hwmon_device_register_with_info() with is_visible/read/write >functions. > v4: > - Fix review comments. > --- > drivers/hwmon/Kconfig | 10 ++ > drivers/hwmon/Makefile | 1 + > drivers/hwmon/w83773g.c | 329 > > 3 files changed, 340 insertions(+) > create mode 100644 drivers/hwmon/w83773g.c > > diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig > index d654314..11c6248 100644 > --- a/drivers/hwmon/Kconfig > +++ b/drivers/hwmon/Kconfig > @@ -1710,6 +1710,16 @@ config SENSORS_VT8231 > This driver can also be built as a module. If so, the module > will be called vt8231. > > +config SENSORS_W83773G > + tristate "Nuvoton W83773G" > + depends on I2C > + help > + If you say yes here you get support for the Nuvoton W83773G hardware > + monitoring chip. > + > + This driver can also be built as a module. If so, the module > + will be called w83773g. > + > config SENSORS_W83781D > tristate "Winbond W83781D, W83782D, W83783S, Asus AS99127F" > depends on I2C > diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile > index c84d978..0649ad8 100644 > --- a/drivers/hwmon/Makefile > +++ b/drivers/hwmon/Makefile > @@ -13,6 +13,7 @@ obj-$(CONFIG_SENSORS_ATK0110) += asus_atk0110.o > # asb100, then w83781d go first, as they can override other drivers' > addresses. > obj-$(CONFIG_SENSORS_ASB100) += asb100.o > obj-$(CONFIG_SENSORS_W83627HF) += w83627hf.o > +obj-$(CONFIG_SENSORS_W83773G)+= w83773g.o > obj-$(CONFIG_SENSORS_W83792D)+= w83792d.o > obj-$(CONFIG_SENSORS_W83793) += w83793.o > obj-$(CONFIG_SENSORS_W83795) += w83795.o > diff --git a/drivers/hwmon/w83773g.c b/drivers/hwmon/w83773g.c > new file mode 100644 > index 000..0b97c28 > --- /dev/null > +++ b/drivers/hwmon/w83773g.c > @@ -0,0 +1,329 @@ > +/* > + * Copyright (C) 2017 IBM Corp. > + * > + * 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. > + * > + * Driver for the Nuvoton W83773G SMBus temperature sensor IC. > + * Supported models: W83773G > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +/* W83773 has 3 channels */ > +#define W83773_CHANNELS 3 > + > +/* The W83773 registers */ > +#define W83773_CONVERSION_RATE_REG_READ 0x04 > +#define W83773_CONVERSION_RATE_REG_WRITE 0x0A > +#define W83773_MANUFACTURER_ID_REG 0xFE > +#define W83773_LOCAL_TEMP0x00 > + > +static const u8 W83773_STATUS[2] = { 0x02, 0x17 }; > + > +static const u8 W83773_TEMP_LSB[2] = { 0x10, 0x25 }; > +static const u8 W83773_TEMP_MSB[2] = { 0x01, 0x24 }; > + > +static const u8 W83773_OFFSET_LSB[2] = { 0x12, 0x16 }; > +static const u8 W83773_OFFSET_MSB[2] = { 0x11, 0x15 }; > + > +/* this is the number of sensors in the device */ > +static const struct i2c_device_id w83773_id[] = { > + { "w83773g" }, > + { } > +}; > + > +MODULE_DEVICE_TABLE(i2c, w83773_id); > + > +static const struct of_device_id w83773_of_match[] = { > + { > + .compatible = "nuvoton,w83773g" > + }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, w83773_of_match); > + > +static inline long temp_of_local(s8 reg) > +{ > + return reg * 1000; > +} > + > +static inline long temp_of_remote(s8 hb, u8 lb) > +{ > + return (hb << 3 | lb >> 5) * 125; > +} > + > +static int get_local_temp(struct regmap *regmap, long *val) > +{ > + unsigned int regval; > + int ret; > + > + ret = regmap_read(regmap, W83773_LOCAL_TEMP, ); > + if (ret < 0) > + return ret; > + > + *val = temp_of_local(regval); > + return 0; > +} > + > +static int get_remote_temp(struct regmap *regmap, int index, long *val) > +{ > + unsigned int regval_high; > + unsigned int regval_low; > + int ret; > + > + ret = regmap_read(regmap, W83773_TEMP_MSB[index], _high); > + if (ret < 0) > + return ret; > + > + ret = regmap_read(regmap, W83773_TEMP_LSB[index], _low); > + if (ret < 0) > + return ret; > + > + *val = temp_of_remote(regval_high, regval_low); > + return 0; > +} > + > +static int get_fault(struct regmap *regmap, int index, long *val) > +{ > + unsigned int regval; > + int ret; > + > + ret = regmap_read(regmap, W83773_STATUS[index], ); > + if (ret < 0) > + return
Re: [PATCH v3 3/4] iio: adc: at91-sama5d2_adc: add support for DMA
On Wed, 15 Nov 2017 14:56:47 +0200 Eugen Hristevwrote: > Added support for DMA transfers. The implementation uses the user watermark > to decide whether DMA will be used or not. For watermark 1, DMA will not be > used. If watermark is bigger, DMA will be used. > Sysfs attributes are created to indicate whether the DMA is used, > with hwfifo_enabled, and the current DMA watermark is readable > in hwfifo_watermark. Minimum and maximum values are in hwfifo_watermark_min > and hwfifo_watermark_max. > > Signed-off-by: Eugen Hristev A tiny nitpick inline but otherwise looks fine to me. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > Changes in v3: > - Remove misleaded dev_info message when DMA was not enabled at probe > - Rebased patch on top of the > [PATCH] iio: adc: at91-sama5d2_adc: fix probe error on missing trigger > property > Which is already upstreamed in 4.14 > - Fixed the bug introduced in v2, with buffer size > - added extra check when enabling DMA, to have hw trigger present. > This is because now, we can have the driver with software trigger only (if no > hw trigger in device tree, start as software only) > > Changes in v2: > - No longer add last timestamp to all samples. Now, compute an interval > between samples w.r.t. start and end time of the transfer and number > of samples. Then distribute them each in the time interval. > - Add warning for conversion overrun. This helps user identify cases > when the watermark needs adjustment : the software is too slow in reading > data from the ADC. > - Protection around watermark is not needed, changing of the watermark > cannot be done while the buffer is enabled. When buffer is disabled, all > DMA resources are freed anyway. > - Added validation on trigger to be used by own device > - Best sample rate I could obtain using the low frequency clock was about > 4k samples/second, with a watermark of 100. To get up to 50k samples/second > the ADC frequency must be increased to max. > - Fixed computation of DMA buffer size > - Addressed other comments from mailing list review. Feedback is appreciated > > drivers/iio/adc/Kconfig| 1 + > drivers/iio/adc/at91-sama5d2_adc.c | 453 > +++-- > 2 files changed, 434 insertions(+), 20 deletions(-) > > diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig > index 1d13bf0..1a3a8e3 100644 > --- a/drivers/iio/adc/Kconfig > +++ b/drivers/iio/adc/Kconfig > @@ -158,6 +158,7 @@ config AT91_SAMA5D2_ADC > tristate "Atmel AT91 SAMA5D2 ADC" > depends on ARCH_AT91 || COMPILE_TEST > depends on HAS_IOMEM > + depends on HAS_DMA > select IIO_TRIGGERED_BUFFER > help > Say yes here to build support for Atmel SAMA5D2 ADC which is > diff --git a/drivers/iio/adc/at91-sama5d2_adc.c > b/drivers/iio/adc/at91-sama5d2_adc.c > index a70ef7f..11d34a8 100644 > --- a/drivers/iio/adc/at91-sama5d2_adc.c > +++ b/drivers/iio/adc/at91-sama5d2_adc.c > @@ -16,6 +16,8 @@ > > #include > #include > +#include > +#include > #include > #include > #include > @@ -100,6 +102,8 @@ > #define AT91_SAMA5D2_LCDR0x20 > /* Interrupt Enable Register */ > #define AT91_SAMA5D2_IER 0x24 > +/* Interrupt Enable Register - general overrun error */ > +#define AT91_SAMA5D2_IER_GOVRE BIT(25) > /* Interrupt Disable Register */ > #define AT91_SAMA5D2_IDR 0x28 > /* Interrupt Mask Register */ > @@ -167,13 +171,19 @@ > > /* > * Maximum number of bytes to hold conversion from all channels > - * plus the timestamp > + * without the timestamp. > */ > -#define AT91_BUFFER_MAX_BYTES ((AT91_SAMA5D2_SINGLE_CHAN_CNT + > \ > - AT91_SAMA5D2_DIFF_CHAN_CNT) * 2 + 8) > +#define AT91_BUFFER_MAX_CONVERSION_BYTES ((AT91_SAMA5D2_SINGLE_CHAN_CNT + \ > + AT91_SAMA5D2_DIFF_CHAN_CNT) * 2) > + > +/* This total must also include the timestamp */ > +#define AT91_BUFFER_MAX_BYTES (AT91_BUFFER_MAX_CONVERSION_BYTES + 8) > > #define AT91_BUFFER_MAX_HWORDS (AT91_BUFFER_MAX_BYTES / 2) > > +#define AT91_HWFIFO_MAX_SIZE_STR "128" > +#define AT91_HWFIFO_MAX_SIZE 128 > + > #define AT91_SAMA5D2_CHAN_SINGLE(num, addr) \ > { \ > .type = IIO_VOLTAGE,\ > @@ -228,6 +238,28 @@ struct at91_adc_trigger { > boolhw_trig; > }; > > +/** > + * at91_adc_dma - at91-sama5d2 dma information struct > + * @dma_chan:the dma channel acquired > + * @rx_buf: dma coherent allocated area > + * @rx_dma_buf: dma handler for the buffer > + * @phys_addr: physical address of the ADC base register > + * @buf_idx: index
Re: [PATCH v3 1/4] dt-bindings: iio: at91-sama5d2_adc: add optional dma property
On Wed, 15 Nov 2017 09:27:46 -0600 Rob Herringwrote: > On Wed, Nov 15, 2017 at 02:56:45PM +0200, Eugen Hristev wrote: > > Added property for DMA configuration of the device. > > > > Signed-off-by: Eugen Hristev > > --- > > Changes in v3: > > None, but we discussed on the ML about whether we should have "dma-names" > > present in the binding even if it's only one. > > The helpers in the kernel to retrieve the channel info rely on the > > presence of this property, so I am resending the patch based on this. > > If another solution is better, please advise and I can try it and > > resend the patch. > > Really the kernel APIs should accept a NULL name and return the DMA > channel when there is only one. This is how the clk_get API works for > example. > > > Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt | 7 +++ > > 1 file changed, 7 insertions(+) > > In any case, not really a big deal. > > Acked-by: Rob Herring Applied to the togreg branch of iio.git and pushed out as testing. Thanks, Jonathan > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 3/4] iio: adc: at91-sama5d2_adc: add support for DMA
On Wed, 15 Nov 2017 14:56:47 +0200 Eugen Hristev wrote: > Added support for DMA transfers. The implementation uses the user watermark > to decide whether DMA will be used or not. For watermark 1, DMA will not be > used. If watermark is bigger, DMA will be used. > Sysfs attributes are created to indicate whether the DMA is used, > with hwfifo_enabled, and the current DMA watermark is readable > in hwfifo_watermark. Minimum and maximum values are in hwfifo_watermark_min > and hwfifo_watermark_max. > > Signed-off-by: Eugen Hristev A tiny nitpick inline but otherwise looks fine to me. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > Changes in v3: > - Remove misleaded dev_info message when DMA was not enabled at probe > - Rebased patch on top of the > [PATCH] iio: adc: at91-sama5d2_adc: fix probe error on missing trigger > property > Which is already upstreamed in 4.14 > - Fixed the bug introduced in v2, with buffer size > - added extra check when enabling DMA, to have hw trigger present. > This is because now, we can have the driver with software trigger only (if no > hw trigger in device tree, start as software only) > > Changes in v2: > - No longer add last timestamp to all samples. Now, compute an interval > between samples w.r.t. start and end time of the transfer and number > of samples. Then distribute them each in the time interval. > - Add warning for conversion overrun. This helps user identify cases > when the watermark needs adjustment : the software is too slow in reading > data from the ADC. > - Protection around watermark is not needed, changing of the watermark > cannot be done while the buffer is enabled. When buffer is disabled, all > DMA resources are freed anyway. > - Added validation on trigger to be used by own device > - Best sample rate I could obtain using the low frequency clock was about > 4k samples/second, with a watermark of 100. To get up to 50k samples/second > the ADC frequency must be increased to max. > - Fixed computation of DMA buffer size > - Addressed other comments from mailing list review. Feedback is appreciated > > drivers/iio/adc/Kconfig| 1 + > drivers/iio/adc/at91-sama5d2_adc.c | 453 > +++-- > 2 files changed, 434 insertions(+), 20 deletions(-) > > diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig > index 1d13bf0..1a3a8e3 100644 > --- a/drivers/iio/adc/Kconfig > +++ b/drivers/iio/adc/Kconfig > @@ -158,6 +158,7 @@ config AT91_SAMA5D2_ADC > tristate "Atmel AT91 SAMA5D2 ADC" > depends on ARCH_AT91 || COMPILE_TEST > depends on HAS_IOMEM > + depends on HAS_DMA > select IIO_TRIGGERED_BUFFER > help > Say yes here to build support for Atmel SAMA5D2 ADC which is > diff --git a/drivers/iio/adc/at91-sama5d2_adc.c > b/drivers/iio/adc/at91-sama5d2_adc.c > index a70ef7f..11d34a8 100644 > --- a/drivers/iio/adc/at91-sama5d2_adc.c > +++ b/drivers/iio/adc/at91-sama5d2_adc.c > @@ -16,6 +16,8 @@ > > #include > #include > +#include > +#include > #include > #include > #include > @@ -100,6 +102,8 @@ > #define AT91_SAMA5D2_LCDR0x20 > /* Interrupt Enable Register */ > #define AT91_SAMA5D2_IER 0x24 > +/* Interrupt Enable Register - general overrun error */ > +#define AT91_SAMA5D2_IER_GOVRE BIT(25) > /* Interrupt Disable Register */ > #define AT91_SAMA5D2_IDR 0x28 > /* Interrupt Mask Register */ > @@ -167,13 +171,19 @@ > > /* > * Maximum number of bytes to hold conversion from all channels > - * plus the timestamp > + * without the timestamp. > */ > -#define AT91_BUFFER_MAX_BYTES ((AT91_SAMA5D2_SINGLE_CHAN_CNT + > \ > - AT91_SAMA5D2_DIFF_CHAN_CNT) * 2 + 8) > +#define AT91_BUFFER_MAX_CONVERSION_BYTES ((AT91_SAMA5D2_SINGLE_CHAN_CNT + \ > + AT91_SAMA5D2_DIFF_CHAN_CNT) * 2) > + > +/* This total must also include the timestamp */ > +#define AT91_BUFFER_MAX_BYTES (AT91_BUFFER_MAX_CONVERSION_BYTES + 8) > > #define AT91_BUFFER_MAX_HWORDS (AT91_BUFFER_MAX_BYTES / 2) > > +#define AT91_HWFIFO_MAX_SIZE_STR "128" > +#define AT91_HWFIFO_MAX_SIZE 128 > + > #define AT91_SAMA5D2_CHAN_SINGLE(num, addr) \ > { \ > .type = IIO_VOLTAGE,\ > @@ -228,6 +238,28 @@ struct at91_adc_trigger { > boolhw_trig; > }; > > +/** > + * at91_adc_dma - at91-sama5d2 dma information struct > + * @dma_chan:the dma channel acquired > + * @rx_buf: dma coherent allocated area > + * @rx_dma_buf: dma handler for the buffer > + * @phys_addr: physical address of the ADC base register > + * @buf_idx: index inside the dma buffer where reading was last done > + *
Re: [PATCH v3 1/4] dt-bindings: iio: at91-sama5d2_adc: add optional dma property
On Wed, 15 Nov 2017 09:27:46 -0600 Rob Herring wrote: > On Wed, Nov 15, 2017 at 02:56:45PM +0200, Eugen Hristev wrote: > > Added property for DMA configuration of the device. > > > > Signed-off-by: Eugen Hristev > > --- > > Changes in v3: > > None, but we discussed on the ML about whether we should have "dma-names" > > present in the binding even if it's only one. > > The helpers in the kernel to retrieve the channel info rely on the > > presence of this property, so I am resending the patch based on this. > > If another solution is better, please advise and I can try it and > > resend the patch. > > Really the kernel APIs should accept a NULL name and return the DMA > channel when there is only one. This is how the clk_get API works for > example. > > > Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt | 7 +++ > > 1 file changed, 7 insertions(+) > > In any case, not really a big deal. > > Acked-by: Rob Herring Applied to the togreg branch of iio.git and pushed out as testing. Thanks, Jonathan > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: A test of the philosophical impact.. Behaviour problems of "Gnu-Zealots" = Illegal Unix Rip.
Den 11/12/2017 11:53, skrev Ywe Cærlyn: Den 11/9/2017 11:55, skrev Ywe Cærlyn: Den 11/6/2017 19:13, skrev Ywe Cærlyn: Den 11/6/2017 11:00, skrev Ywe Cærlyn: Den 11/4/2017 23:53, skrev Ywe Cærlyn: Den 11/3/2017 07:46, skrev Ywe Cærlyn: Den 10/29/2017 17:21, skrev Ywe Cærlyn: Den 10/29/2017 17:00, skrev Ywe Cærlyn: Den 10/27/2017 23:28, skrev Ywe Cærlyn: Den 10/27/2017 23:01, skrev Ywe Cærlyn: Philosophical requantization of a (atm) theoretical linux distribution: Excellent Ubuntu, is a Good Linux, with a Minimal Jitter Kernel. An Available Source Operating System. Philosophical Lead: Ywe Cærlyn. Desktop Flavour: Customized Gnome Finetuned for fast reponsiveness, and smoothness in operation. Configuration of Kernel, for favoring short buffers, lowest latency, minimal jitter, minimal wasted CPU, max cpu utilization. Perfect scaling, from desktop to supercomputing. Redefined Internet, with the finest philosophy, and correct attitude. Call 999-Excellence for a trial CD... No that we don´t have yet, but how does it sound? Peace, Ywe Cærlyn. I have made a good logo aswell:http://xn--ywecrlyn-m0a.net/ExcellentUbuntu/ExcellentUbuntu.png I really believe in this, and what makes this just perfect: Everyone is their own newsservice, getting their views on for instance, youtube. And gets the income from this. Which makes a finely granulated internet economy. A test channel: https://www.youtube.com/channel/UCR3gmLVjHS5A702wo4bol_Q Peace, Ywe Cærlyn. With Linus Torvalds as patchmeister as usual, ofcourse. So considering this, and the finely granulated internet economics comes from this type of mindset, and with reintergration of it back, I would suggest changing the naming scheme of "open source", and "free software" to "Available Source". It is repeated a lot, and needs to have a corresponding name. (To not speak of avoiding uneccesary pointer variables in GNU code... ). This is also based on on my conclusion on philosophy research over 15 years, and that things need to be right. And even metaphysically. For Success. I also CC Richard Stallman on this, maybe GNU4.0 will make considerations for this. The hacker will now not only be free, but make money. ;) Peace. Mister GNU Richard Stallman replied me two times on this, since he did not mail LKML, I will restate them here, for the record. | |[[[ To any NSA and FBI agents reading my email: please consider ]]] |[[[ whether defending the US Constitution against all enemies, ]]] |[[[ foreign or domestic, requires you to follow Snowden's example. ]]]| | |It seems that you're making a new variant of GNU/Linux. If you call |it "something Linux", you are talking about our work but giving us |none of the credit. Please call it "something GNU/Linux" so as to |give us equal mention. | |See https://gnu.org/gnu/linux-and-gnu.html and |https://gnu.org/gnu/gnu-linux-faq.html, plus the history in |https://gnu.org/gnu/the-gnu-project.html. | |-- |Dr Richard Stallman |President, Free Software Foundation (gnu.org, fsf.org) |Internet Hall-of-Famer (internethalloffame.org) |Skype: No way! See stallman.org/skype.html. | And- | |[[[ To any NSA and FBI agents reading my email: please consider ]]] |[[[ whether defending the US Constitution against all enemies, ]]] |[[[ foreign or domestic, requires you to follow Snowden's example. ]]] | |"Available source" is too weak a criterion. Free software and open |source stand for categories of software that are nearly coterminous. |However, available source is a much weaker criterion and would |include programs that don't come anywhere near free. | |Also, the point of the free software movement is that users deserve |freedom. "Available source" doesn't even hint at this idea, |so it would not communicate what we want to say. | | |-- |Dr Richard Stallman |President, Free Software Foundation (gnu.org, fsf.org) |Internet Hall-of-Famer (internethalloffame.org) |Skype: No way! See stallman.org/skype.html. | Not even an acknowledgement on pointer variables from this self-appointed spokesman for hackers. Or indeed the larger issue of finegranulated internet economics. How shall an OS indeed succeed if it chokes its own success? To not speak of the paranoid insertions. Does he fear mountains shall fall on him, for GNU? Indeed GNU seems to be his qualifier and god, he slaves to. Or is gnu, a god to slave to, free software your food, and Richard Stallman its Jesusian son? Will it be up to others to make the decision? How much is this in conflict with pure hacking, from C64 asm, to PC C, and the original unix hacking? Have a Mindful Zen moment on this. As for my own experience, check out my Biit channel where I am going to go through highlights, and do DSP retrofits, remasters etc. For instance this track: https://www.youtube.com/watch?v=xMfWsx3JBUg Uses my own developed absolute minimal psychacoustically corrected phase plateau band EQ. Here I am even
Re: A test of the philosophical impact.. Behaviour problems of "Gnu-Zealots" = Illegal Unix Rip.
Den 11/12/2017 11:53, skrev Ywe Cærlyn: Den 11/9/2017 11:55, skrev Ywe Cærlyn: Den 11/6/2017 19:13, skrev Ywe Cærlyn: Den 11/6/2017 11:00, skrev Ywe Cærlyn: Den 11/4/2017 23:53, skrev Ywe Cærlyn: Den 11/3/2017 07:46, skrev Ywe Cærlyn: Den 10/29/2017 17:21, skrev Ywe Cærlyn: Den 10/29/2017 17:00, skrev Ywe Cærlyn: Den 10/27/2017 23:28, skrev Ywe Cærlyn: Den 10/27/2017 23:01, skrev Ywe Cærlyn: Philosophical requantization of a (atm) theoretical linux distribution: Excellent Ubuntu, is a Good Linux, with a Minimal Jitter Kernel. An Available Source Operating System. Philosophical Lead: Ywe Cærlyn. Desktop Flavour: Customized Gnome Finetuned for fast reponsiveness, and smoothness in operation. Configuration of Kernel, for favoring short buffers, lowest latency, minimal jitter, minimal wasted CPU, max cpu utilization. Perfect scaling, from desktop to supercomputing. Redefined Internet, with the finest philosophy, and correct attitude. Call 999-Excellence for a trial CD... No that we don´t have yet, but how does it sound? Peace, Ywe Cærlyn. I have made a good logo aswell:http://xn--ywecrlyn-m0a.net/ExcellentUbuntu/ExcellentUbuntu.png I really believe in this, and what makes this just perfect: Everyone is their own newsservice, getting their views on for instance, youtube. And gets the income from this. Which makes a finely granulated internet economy. A test channel: https://www.youtube.com/channel/UCR3gmLVjHS5A702wo4bol_Q Peace, Ywe Cærlyn. With Linus Torvalds as patchmeister as usual, ofcourse. So considering this, and the finely granulated internet economics comes from this type of mindset, and with reintergration of it back, I would suggest changing the naming scheme of "open source", and "free software" to "Available Source". It is repeated a lot, and needs to have a corresponding name. (To not speak of avoiding uneccesary pointer variables in GNU code... ). This is also based on on my conclusion on philosophy research over 15 years, and that things need to be right. And even metaphysically. For Success. I also CC Richard Stallman on this, maybe GNU4.0 will make considerations for this. The hacker will now not only be free, but make money. ;) Peace. Mister GNU Richard Stallman replied me two times on this, since he did not mail LKML, I will restate them here, for the record. | |[[[ To any NSA and FBI agents reading my email: please consider ]]] |[[[ whether defending the US Constitution against all enemies, ]]] |[[[ foreign or domestic, requires you to follow Snowden's example. ]]]| | |It seems that you're making a new variant of GNU/Linux. If you call |it "something Linux", you are talking about our work but giving us |none of the credit. Please call it "something GNU/Linux" so as to |give us equal mention. | |See https://gnu.org/gnu/linux-and-gnu.html and |https://gnu.org/gnu/gnu-linux-faq.html, plus the history in |https://gnu.org/gnu/the-gnu-project.html. | |-- |Dr Richard Stallman |President, Free Software Foundation (gnu.org, fsf.org) |Internet Hall-of-Famer (internethalloffame.org) |Skype: No way! See stallman.org/skype.html. | And- | |[[[ To any NSA and FBI agents reading my email: please consider ]]] |[[[ whether defending the US Constitution against all enemies, ]]] |[[[ foreign or domestic, requires you to follow Snowden's example. ]]] | |"Available source" is too weak a criterion. Free software and open |source stand for categories of software that are nearly coterminous. |However, available source is a much weaker criterion and would |include programs that don't come anywhere near free. | |Also, the point of the free software movement is that users deserve |freedom. "Available source" doesn't even hint at this idea, |so it would not communicate what we want to say. | | |-- |Dr Richard Stallman |President, Free Software Foundation (gnu.org, fsf.org) |Internet Hall-of-Famer (internethalloffame.org) |Skype: No way! See stallman.org/skype.html. | Not even an acknowledgement on pointer variables from this self-appointed spokesman for hackers. Or indeed the larger issue of finegranulated internet economics. How shall an OS indeed succeed if it chokes its own success? To not speak of the paranoid insertions. Does he fear mountains shall fall on him, for GNU? Indeed GNU seems to be his qualifier and god, he slaves to. Or is gnu, a god to slave to, free software your food, and Richard Stallman its Jesusian son? Will it be up to others to make the decision? How much is this in conflict with pure hacking, from C64 asm, to PC C, and the original unix hacking? Have a Mindful Zen moment on this. As for my own experience, check out my Biit channel where I am going to go through highlights, and do DSP retrofits, remasters etc. For instance this track: https://www.youtube.com/watch?v=xMfWsx3JBUg Uses my own developed absolute minimal psychacoustically corrected phase plateau band EQ. Here I am even
Re: [PATCH v2] iio: mma8452: replace license description with SPDX specifier
On Sat, 18 Nov 2017 10:10:11 +0100 Martin Kepplingerwrote: > This replaces the custom license information text with the appropriate > SPDX identifier. While the information here stays the same, it is easier > to read. > > Signed-off-by: Martin Kepplinger > Acked-by: Peter Meerwald-Stadler I'm not 100% sure the intent of the SPDX work is to remove existing licence text. So far the big sets have only been adding tags to files missing their licenses entirely... Anyone found any specific guidance on this? Jonathan > --- > > Sorry I had forgotten to add the mailing lists and got Peter's Ack > privately. -.- But thanks Peter for the quick response! > > Again, an Acked-by from Harinath would be good here too. > > thanks > > martin > > revision history > > v2: adds Peter's Acked-by and adds all mailing lists to CC > > > drivers/iio/accel/mma8452.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c > index bfd4bc806fc2..62c0d4646c16 100644 > --- a/drivers/iio/accel/mma8452.c > +++ b/drivers/iio/accel/mma8452.c > @@ -1,3 +1,4 @@ > +// SPDX-License-Identifier: GPL-2.0 > /* > * mma8452.c - Support for following Freescale / NXP 3-axis accelerometers: > * > @@ -13,9 +14,6 @@ > * Copyright 2015 Martin Kepplinger > * Copyright 2014 Peter Meerwald > * > - * This file is subject to the terms and conditions of version 2 of > - * the GNU General Public License. See the file COPYING in the main > - * directory of this archive for more details. > * > * TODO: orientation events > */
Re: [PATCH v2] iio: mma8452: replace license description with SPDX specifier
On Sat, 18 Nov 2017 10:10:11 +0100 Martin Kepplinger wrote: > This replaces the custom license information text with the appropriate > SPDX identifier. While the information here stays the same, it is easier > to read. > > Signed-off-by: Martin Kepplinger > Acked-by: Peter Meerwald-Stadler I'm not 100% sure the intent of the SPDX work is to remove existing licence text. So far the big sets have only been adding tags to files missing their licenses entirely... Anyone found any specific guidance on this? Jonathan > --- > > Sorry I had forgotten to add the mailing lists and got Peter's Ack > privately. -.- But thanks Peter for the quick response! > > Again, an Acked-by from Harinath would be good here too. > > thanks > > martin > > revision history > > v2: adds Peter's Acked-by and adds all mailing lists to CC > > > drivers/iio/accel/mma8452.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c > index bfd4bc806fc2..62c0d4646c16 100644 > --- a/drivers/iio/accel/mma8452.c > +++ b/drivers/iio/accel/mma8452.c > @@ -1,3 +1,4 @@ > +// SPDX-License-Identifier: GPL-2.0 > /* > * mma8452.c - Support for following Freescale / NXP 3-axis accelerometers: > * > @@ -13,9 +14,6 @@ > * Copyright 2015 Martin Kepplinger > * Copyright 2014 Peter Meerwald > * > - * This file is subject to the terms and conditions of version 2 of > - * the GNU General Public License. See the file COPYING in the main > - * directory of this archive for more details. > * > * TODO: orientation events > */