NVMe: Use kzalloc instead of kmalloc+memset

Use kzalloc instead of kmalloc and a susbsequent memset.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Vishal Verma <vishal.l.verma@linux.intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
NVMe: Restructure MSI / MSI-X setup

The current code copies 'nr_io_queues' into 'q_count', modifies
'nr_io_queues' during MSI-X setup, then resets 'nr_io_queues' for
MSI setup.  Instead, copy 'nr_io_queues' into 'vecs' and modify 'vecs'
during both MSI-X and MSI setup.

This lets us simplify the for-loops that set up MSI-X and MSI, and opens
the possibility of using more I/O queues than we have interrupt vectors,
should future benchmarking prove that to be a useful feature.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
NVMe: Disk IO statistics

Add io stats accounting for bio requests so nvme block devices show
useful disk stats.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
NVMe: Return correct value from interrupt handler

The interrupt handler currently reports whether it found any new
completion queue entries.  If the completion queue is primarily being
processed by a method other than the interrupt handler, it may return
IRQ_NONE so often that Linux thinks that the interrupt is being falsely
triggered.

To solve this problem, report whether any completion queue entries have
been seen since the last interrupt was received for this queue.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
NVMe: Remove "process_cq did something" message

I was originally intending to log the fact that the kthread had done
some work since it might help us find interrupt handling problems, but
that hasn't been done yet, and spamming the logs with this message is
just rude.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
NVMe: Call nvme_process_cq from submission path

Since we have the queue locked, it makes sense to check if there are
any completion queue entries on the queue before we release the lock.
If there are, it may save an interrupt and reduce latency for the I/Os
that happened to complete.  This happens fairly often for some workloads.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
rpm-pkg: add %post section to create initramfs and grub hooks

/sbin/installkernel is used to insure grub hooks are
inserted and the initramfs is created on the
target system.

The invokation installkernel will work with any
kernel as long as:
- /sbin/installkernel exists
- the kernel and sysem map files are readable

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
rpm-pkg: install firmware files in kernel relative directory

Prior to this patch, firmware files were being installed
in /lib/firmware with a potential conflict with already
installed kernels.

firmware files are now installed in /lib/firmware/<release>
and packaged with the rest of the modules.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
rpm-pkg: add generation of kernel-devel

Change the spec file to generate a kernel-devel module
allowing for compilation of external kernel modules.

This patch requires a new minimum RPM level of 4.0.3.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
deb-pkg: use KCONFIG_CONFIG instead of .config file directly

Signed-off-by: Anisse Astier <anisse@astier.eu>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Michal Marek <mmarek@suse.cz>
deb-pkg: split debug symbols in their own package

This can reduce almost 3 times the size of the linux-image package,
while keeping the debug symbols available for this particular build, in
their own package.

This mimics the way kernels are built in debian, ubuntu, or with
make-kpkg, and comes at the price of a small slowdown in the building of
packages.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Cc: Ben Hutchings <ben@decadent.org.uk>
Acked-by: maximilian attems <max@stro.at>
Signed-off-by: Michal Marek <mmarek@suse.cz>
deb-pkg: fix installed image path on parisc, mips and powerpc

Signed-off-by: Anisse Astier <anisse@astier.eu>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Michal Marek <mmarek@suse.cz>
deb-pkg: add a hook argument to match debian hooks parameters

We now provide the installed image path to the kernel hooks.

This should allow the package to better integrate with debian hooks, and
should not be too disruptive of hooks supporting only one parameter.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: maximilian attems <max@stro.at>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts: remove unused function in sortextable.c

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Acked-by: David Daney <david.daney@cavium.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
mfd: Add TPS659038 documentation under Palmas

Add TPS659038 Device Tree documentation.

Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: J Keerthy <j-keerthy@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
mfd: s2mps11: Add device tree support

This patch adds DT compatible string for s2mps11 and binding documentation.

Reviewed-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
mfd: Fix for DA9055 driver initialization

This patch clears all the events received while powering up DA9055.

While powering up DA9055, both power sequencer and gpio events are received.
These events remain uncleared after boot up, due to which further event handling
also fails. DA9055 has three event registers. The event register bits are set
to '1' on receiving an event. The events can be cleared on writing a '1' to
the set bit, which would then clear that bit to '0'. After applying this patch
we have a clean state after boot up.

Signed-off-by: Ankur Raina <Ankur.Raina@kpitcummins.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
mfd: Update DA9055 i2c device id name

DA9055 is a combination of pmic and codec. This patch updates the DA9055 i2c
device id name to match the standard naming convention followed for such chips.

Signed-off-by: Ankur Raina <Ankur.Raina@kpitcummins.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
mfd: sec: Add register cache for interrupt mask registers

The performance of regmap-irq is improved if the interrupt mask registers
can be cached since it does read/modify/update cycles so start using the
register cache infrastructure for those registers. We should use this more
widely but I don't have a datasheet and this is a nice, conservative
starting point.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
mfd: twl6040: Remove support for legacy (pdata) mode

TWL6040 is used only with OMAP4/5 SoCs and they can only boot in in DT mode.
The support for pdata/legacy boot can be removed.

Add TODO comment to the header file that all pdata struct can be removed in
the next merge window (after the sub driver updates are in).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>