Quantcast
Channel: Serverphorums.com - Linux Kernel
Viewing all 24115 articles
Browse latest View live

Linux 4.1 released (no replies)

$
0
0
So after a *very* quiet week after the 4.1-rc8 release, the final 4.1
release is now out.

I'm not sure if it was quiet because there really were no problems
(knock wood), or if people decided to be considerate of my vacation,
but whatever the reason, I appreciate it. It's not like the 4.1
release cycle was particularly painful, and let's hope that the extra
week of letting it sit makes for a great release. Which wouldn't be a
bad thing, considering that 4.1 will also be a LTS release.

Anyway, since rc8 we've had truly small changes, mainly some final
driver fixups (HDA sound, drm, scsi target, crypto) and a couple of
small misc fixes. The appended shortlog is probably one of the
shortest ones ever. I'm not complaining.

And this obviously means that the merge window for 4.2 is open.

Linus

---

Adam Jackson (1):
drm/mgag200: Reject non-character-cell-aligned mode widths

Andrew Morton (1):
revert "cpumask: don't perform while loop in cpumask_next_and()"

Boris Brezillon (2):
clk: at91: pll: fix input range validity check
clk: at91: fix PERIPHERAL_MAX_SHIFT definition

Chris Wilson (1):
drm/i915: Always reset vma->ggtt_view.pages cache on unbinding

Dave Airlie (1):
drm/radeon: don't probe MST on hw we don't support it on

Hugh Dickins (1):
mm: shmem_zero_setup skip security check and lockdep conflict with XFS

Hui Wang (1):
ALSA: hda - adding a DAC/pin preference map for a HP Envy TS machine

Jani Nikula (1):
Revert "drm/i915: Don't skip request retirement if the active
list is empty"

Linus Torvalds (1):
Linux 4.1

Mauro Carvalho Chehab (1):
Kconfig: disable Media Controller for DVB

Michel Dänzer (1):
drm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING query

Nicholas Mc Guire (1):
ALSA: mips: let SND_SGI_O2 select SND_PCM

Nicolas Ferre (2):
clk: at91: trivial: typo in peripheral clock description
clk: at91: fix h32mx prototype inclusion in pmc header

Radim Krčmář (1):
KVM: x86: fix lapic.timer_mode on restore

Sagi Grimberg (3):
iser-target: Fix variable-length response error completion
iser-target: release stale iser connections
iser-target: Fix possible use-after-free

Steve Cornelius (2):
crypto: caam - improve initalization for context state saves
crypto: caam - fix RNG buffer cache alignment

Steven Rostedt (1):
tracing: Have filter check for balanced ops

Takashi Iwai (3):
ALSA: hda - Fix audio crackles on Dell Latitude E7x40
ALSA: hda - Fix noisy outputs on Dell XPS13 (2015 model)
ALSA: hda - Fix unused label skip_i915

Wolfram Sang (1):
i2c: slave: fix the example how to instantiate from userspace
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[RFC PATCH v2] packet: remove handling of tx_ring (no replies)

$
0
0
v1 = replace if()/BUG with BUG_ON() for tx_ring.

v2 = remove handling of tx_ring in prb_setup_retire_blk_timer
for TPACKET_V3 because init_prb_bdqc is called only for NULL tx_ring
and thus prb_setup_retire_blk_timer for NULL tx_ring only.

And also in funciton init_prb_bdqc there is no usage of tx_ring.
Thus removing tx_ring from init_prb_bdqc.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Suggested-by: Frans Klaver <fransklaver@gmail.com>
---
net/packet/af_packet.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index fd51641..aeafcf0 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -543,15 +543,11 @@ static void prb_init_blk_timer(struct packet_sock *po,
pkc->retire_blk_timer.expires = jiffies;
}

-static void prb_setup_retire_blk_timer(struct packet_sock *po, int tx_ring)
+static void prb_setup_retire_blk_timer(struct packet_sock *po)
{
struct tpacket_kbdq_core *pkc;

- if (tx_ring)
- BUG();
-
- pkc = tx_ring ? GET_PBDQC_FROM_RB(&po->tx_ring) :
- GET_PBDQC_FROM_RB(&po->rx_ring);
+ pkc = GET_PBDQC_FROM_RB(&po->rx_ring);
prb_init_blk_timer(po, pkc, prb_retire_rx_blk_timer_expired);
}

@@ -607,7 +603,7 @@ static void prb_init_ft_ops(struct tpacket_kbdq_core *p1,
static void init_prb_bdqc(struct packet_sock *po,
struct packet_ring_buffer *rb,
struct pgv *pg_vec,
- union tpacket_req_u *req_u, int tx_ring)
+ union tpacket_req_u *req_u)
{
struct tpacket_kbdq_core *p1 = GET_PBDQC_FROM_RB(rb);
struct tpacket_block_desc *pbd;
@@ -634,7 +630,7 @@ static void init_prb_bdqc(struct packet_sock *po,

p1->max_frame_len = p1->kblk_size - BLK_PLUS_PRIV(p1->blk_sizeof_priv);
prb_init_ft_ops(p1, req_u);
- prb_setup_retire_blk_timer(po, tx_ring);
+ prb_setup_retire_blk_timer(po);
prb_open_block(p1, pbd);
}

@@ -4001,7 +3997,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
* it above but just being paranoid
*/
if (!tx_ring)
- init_prb_bdqc(po, rb, pg_vec, req_u, tx_ring);
+ init_prb_bdqc(po, rb, pg_vec, req_u);
break;
default:
break;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH v2 1/6] Staging: comedi: dmm32at: Simplify a trivial if-return sequence (5 replies)

$
0
0
From: Abdul Hussain <habdul@visteon.com>

This patch simplify a trivial if-return sequence. Possibly combine with
a preceding function call.

Signed-off-by: Abdul Hussain <habdul@visteon.com>
---
drivers/staging/comedi/drivers/dmm32at.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c
index bb2883c..958c0d4 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -607,11 +607,7 @@ static int dmm32at_attach(struct comedi_device *dev,

/* Digital I/O subdevice */
s = &dev->subdevices[2];
- ret = subdev_8255_init(dev, s, dmm32at_8255_io, DMM32AT_8255_IOBASE);
- if (ret)
- return ret;
-
- return 0;
+ return subdev_8255_init(dev, s, dmm32at_8255_io, DMM32AT_8255_IOBASE);
}

static struct comedi_driver dmm32at_driver = {
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[GIT PULL] Power management and ACPI updates for v4.2-rc1 (no replies)

$
0
0
Hi Linus,

Please pull from

git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
pm+acpi-4.2-rc1

to receive power management and ACPI material for v4.2-rc1 with
top-most commit d461003574ebc862c2dae70c9e1ab32b1bf2cda1

Merge branch 'pm-cpuidle'

on top of commit 0f57d86787d8b1076ea8f9cbdddda2a46d534a27

Linux 4.1-rc8

The rework of backlight interface selection API from Hans de Goede
stands out from the number of commits and the number of affected
places perspective. The cpufreq core fixes from Viresh Kumar are
quite significant too as far as the number of commits goes and
because they should reduce CPU online/offline overhead quite a bit
in the majority of cases.

From the new featues point of view, the ACPICA update (to upstream
revision 20150515) adding support for new ACPI 6 material to ACPICA
is the one that matters the most as some new significant features
will be based on it going forward. Also included is an update of the
ACPI device power management core to follow ACPI 6 (which in turn
reflects the Windows' device PM implementation), a PM core extension
to support wakeup interrupts in a more generic way and support for
the ACPI _CCA device configuration object.

The rest is mostly fixes and cleanups all over and some documentation
updates, including new DT bindings for Operating Performance Points.

There is one fix for a regression introduced in the 4.1 cycle, but it
adds quite a number of lines of code, it wasn't really ready before
Thursday and you were on vacation, so I refrained from pushing it
on the last minute for 4.1.

Specifics:

- ACPICA update to upstream revision 20150515 including basic
support for ACPI 6 features: new ACPI tables introduced by
ACPI 6 (STAO, XENV, WPBT, NFIT, IORT), changes related to the
other tables (DTRM, FADT, LPIT, MADT), new predefined names
(_BTH, _CR3, _DSD, _LPI, _MTL, _PRR, _RDI, _RST, _TFP, _TSN),
fixes and cleanups (Bob Moore, Lv Zheng).

- ACPI device power management core code update to follow ACPI 6
which reflects the ACPI device power management implementation
in Windows (Rafael J Wysocki).

- Rework of the backlight interface selection logic to reduce the
number of kernel command line options and improve the handling
of DMI quirks that may be involved in that and to make the
code generally more straightforward (Hans de Goede).

- Fixes for the ACPI Embedded Controller (EC) driver related to
the handling of EC transactions (Lv Zheng).

- Fix for a regression related to the ACPI resources management
and resulting from a recent change of ACPI initialization code
ordering (Rafael J Wysocki).

- Fix for a system initialization regression related to ACPI
introduced during the 3.14 cycle and caused by running the
code that switches the platform over to the ACPI mode too
early in the initialization sequence (Rafael J Wysocki).

- Support for the ACPI _CCA device configuration object related
to DMA cache coherence (Suravee Suthikulpanit).

- ACPI/APEI fixes and cleanups (Jiri Kosina, Borislav Petkov).

- ACPI battery driver cleanups (Luis Henriques, Mathias Krause).

- ACPI processor driver cleanups (Hanjun Guo).

- Cleanups and documentation update related to the ACPI device
properties interface based on _DSD (Rafael J Wysocki).

- ACPI device power management fixes (Rafael J Wysocki).

- Assorted cleanups related to ACPI (Dominik Brodowski. Fabian
Frederick, Lorenzo Pieralisi, Mathias Krause, Rafael J Wysocki).

- Fix for a long-standing issue causing General Protection Faults
to be generated occasionally on return to user space after resume
from ACPI-based suspend-to-RAM on 32-bit x86 (Ingo Molnar).

- Fix to make the suspend core code return -EBUSY consistently in
all cases when system suspend is aborted due to wakeup detection
(Ruchi Kandoi).

- Support for automated device wakeup IRQ handling allowing drivers
to make their PM support more starightforward (Tony Lindgren).

- New tracepoints for suspend-to-idle tracing and rework of the
prepare/complete callbacks tracing in the PM core (Todd E Brandt,
Rafael J Wysocki).

- Wakeup sources framework enhancements (Jin Qian).

- New macro for noirq system PM callbacks (Grygorii Strashko).

- Assorted cleanups related to system suspend (Rafael J Wysocki).

- cpuidle core cleanups to make the code more efficient (Rafael J
Wysocki).

- powernv/pseries cpuidle driver update (Shilpasri G Bhat).

- cpufreq core fixes related to CPU online/offline that should
reduce the overhead of these operations quite a bit, unless the
CPU in question is physically going away (Viresh Kumar, Saravana
Kannan).

- Serialization of cpufreq governor callbacks to avoid race
conditions in some cases (Viresh Kumar).

- intel_pstate driver fixes and cleanups (Doug Smythies, Prarit
Bhargava, Joe Konno).

- cpufreq driver (arm_big_little, cpufreq-dt, qoriq) updates (Sudeep
Holla, Felipe Balbi, Tang Yuantian).

- Assorted cleanups in cpufreq drivers and core (Shailendra Verma,
Fabian Frederick, Wang Long).

- New Device Tree bindings for representing Operating Performance
Points (Viresh Kumar).

- Updates for the common clock operations support code in the PM
core (Rajendra Nayak, Geert Uytterhoeven).

- PM domains core code update (Geert Uytterhoeven).

- Intel Knights Landing support for the RAPL (Running Average Power
Limit) power capping driver (Dasaratharaman Chandramouli).

- Fixes related to the floor frequency setting on Atom SoCs in the
RAPL power capping driver (Ajay Thomas).

- Runtime PM framework documentation update (Ben Dooks).

- cpupower tool fix (Herton R Krzesinski).

Thanks!


---------------

Ajay Thomas (1):
powercap / RAPL: Floor frequency setting in Atom SoC

Ben Dooks (1):
PM / runtime: add note about re-calling in during device probe()

Bob Moore (16):
ACPICA: Additional dragon_fly BSD support.
ACPICA: ACPI 6.0: Add support for STAO table.
ACPICA: ACPI 6.0: Add support for new predefined names.
ACPICA: ACPI 6.0: Add support for XENV table.
ACPICA: Parser: Move a couple externals to the proper header.
ACPICA: iASL: Enhance detection of non-ascii or corrupted input files.
ACPICA: ACPI 6.0: Add support for WPBT table.
ACPICA: ACPI 6.0: Add changes for FADT table.
ACPICA: ACPI 6.0: Add changes for LPIT table.
ACPICA: ACPI 6.0: Add changes for MADT table.
ACPICA: iASL/disassembler - fix possible fault for -e option.
ACPICA: acpi_help: Add option to display all known/supported ACPI tables.
ACPICA: ACPI 6.0: Add support for NFIT table.
ACPICA: Update version to 20150515.
ACPICA: acpihelp: Update for new NFIT table GUIDs.
ACPICA: Fix for ill-formed GUID strings for NFIT tables.

Borislav Petkov (4):
GHES: Carve out error queueing in a separate function
GHES: Carve out the panic functionality
GHES: Panic right after detection
GHES: Elliminate double-loop in the NMI handler

Dasaratharaman Chandramouli (1):
powercap / RAPL: Support Knights Landing

Dominik Brodowski (2):
ACPI / osl: use same type for acpi_predefined_names values as in
definition
ACPI: fix kernel-parameters ordering in Documentation

Doug Smythies (3):
intel_pstate: Add tsc collection and keep previous target pstate
intel_pstate: change some inconsistent debug information
intel_pstate: Force setting target pstate when required

Fabian Frederick (4):
cpufreq: pxa: replace typedef pxa_freqs_t by structure
cpufreq: pxa: make pxa_freqs arrays const
PNP / ACPI: use u8 instead of int in acpi_resource_extended_irq context
PNP / ACPI: use unsigned int in pnpacpi_encode_resources()

Felipe Balbi (1):
cpufreq: dt: allow driver to boot automatically

Geert Uytterhoeven (3):
PM / clk: Fix clock error check in __pm_clk_add()
PM / Domains: Skip timings during syscore suspend/resume
PM / clk: Print acquired clock name in addition to con_id

Grygorii Strashko (4):
PM / sleep: Add macro to define common noirq system PM callbacks
bus: omap_l3_noc: add missed callbacks for suspend-to-disk
ARM: omap-device: use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS
leds / PM: fix hibernation on arm when gpio-led used with CPU led trigger

Hanjun Guo (8):
ACPI / processor: Introduce invalid_logical_cpuid()
Xen / ACPI / processor: use invalid_logical_cpuid()
Xen / ACPI / processor: Remove unneeded NULL check
ACPI / processor: remove cpu_index in acpi_processor_get_info()
ACPI / processor: remove phys_id in acpi_processor_get_info()
ACPI / processor: return specific error instead of -1
ACPI / processor: Introduce invalid_phys_cpuid()
ACPI / PCI: remove stale list_head in struct acpi_prt_entry

Hans de Goede (37):
ACPI / video: Add enable_native_backlight quirk for MacbookPro12,1
ACPI / video: Add a parameter to not register the backlight
sysfs interface
apple_gmux: Use acpi_video_unregister_backlight instead of
acpi_video_unregister
asus-wmi: Use acpi_video_unregister_backlight instead of
acpi_video_unregister
samsung-laptop: Use acpi_video_unregister_backlight instead of
acpi_video_unregister
apple-gmux: Stop using acpi_video_dmi_demote_vendor()
acpi-video-detect: Remove the unused
acpi_video_dmi_demote_vendor() function
acpi-video-detect: Make acpi_video_get_capabilities a private function
acpi-video-detect: Move acpi_is_video_device() to acpi/scan.c
acpi-video-detect: Move acpi_osi_is_win8 to osl.c
acpi-video-detect: video: Make video_detect code part of the video module
acpi-video-detect: Rewrite backlight interface selection logic
acpi-video-detect: Unregister acpi_video backlight when dmi
quirks are added
drm: i915: Port to new backlight interface selection API
ACPI / video: Port to new backlight interface selection API
ACPI / video: Move backlight notifier to video_detect.c
ACPI / video: Move dmi_check_system from module_init to
acpi_video_register
ACPI / video: Fix acpi_video _register vs _unregister_backlight race
acer-wmi: Port to new backlight interface selection API
apple-gmux: Port to new backlight interface selection API
asus-laptop: Port to new backlight interface selection API
asus-wmi: Port to new backlight interface selection API
compal-laptop: Port to new backlight interface selection API
dell-laptop: Port to new backlight interface selection API
dell-wmi: Port to new backlight interface selection API
eeepc-laptop: Port to new backlight interface selection API
fujitsu-laptop: Port to new backlight interface selection API
ideapad-laptop: Port to new backlight interface selection API
intel-oaktrail: Port to new backlight interface selection API
msi-laptop: Port to new backlight interface selection API
msi-wmi: Port to new backlight interface selection API
samsung-laptop: Port to new backlight interface selection API
sony-laptop: Port to new backlight interface selection API
thinkpad-acpi: Port to new backlight interface selection API
toshiba-acpi: Port to new backlight interface selection API
acpi-video-detect: Remove old API
ACPI / video: Make acpi_video_unregister_backlight() private

Herton R. Krzesinski (1):
cpupower: mperf monitor: fix output in MAX_FREQ_SYSFS mode

Ingo Molnar (1):
x86: Load __USER_DS into DS/ES after resume

Jin Qian (2):
PM / wakeup: validate wakeup source before activating it.
PM / wakeup: add a dummy wakeup_source to record statistics

Jiri Kosina (1):
GHES: Make NMI handler have a single reader

Joe Konno (1):
intel_pstate: set BYT MSR with wrmsrl_on_cpu()

Lorenzo Pieralisi (1):
ACPI / proc: make ACPI_PROCFS_POWER X86 only

Luis Henriques (3):
ACPI / battery: abort initialization earlier if acpi_disabled
ACPI / battery: drop useless return statements
ACPI / battery: ensure acpi_battery_init() has finish

Lv Zheng (17):
ACPI / EC: Update acpi_ec_is_gpe_raised() with new GPE status flag.
ACPI / EC: Remove storming threashold enlarging quirk.
ACPI / EC: Remove irqs_disabled() check.
ACPI / EC: Fix and clean up register access guarding logics.
ACPI / EC: Add module params for polling modes.
ACPI / EC: Remove non-root-caused busy polling quirks.
ACPICA: Divergence: Remove redundant definitions.
ACPICA: Dispatcher: Fix a resource leak issue in
acpi_ds_auto_serialize_method().
ACPICA: Hardware: Fix a resource leak issue in acpi_hw_build_pci_list().
ACPICA: ACPI 6.0: Add ACPI_SUB_PTR().
ACPICA: ACPI 6.0: Add support for IORT table.
ACPICA: ACPI 6.0: Add changes for DRTM table.
ACPI / EC: Cleanup transaction state transition.
ACPI / EC: Convert event handling work queue into loop style.
ACPI / EC: Add event clearing variation support.
ACPI / EC: Fix EC_FLAGS_QUERY_HANDSHAKE platforms using new
event clearing timing.
ACPI / EC: Fix a code coverity issue when QR_EC transactions are failed.

Mathias Krause (10):
ACPI / video: constify ACPI and DMI id tables
ACPI / AC: constify DMI system id table
ACPI / battery: constify the offset tables
ACPI / battery: minor tweaks to acpi_battery_units()
ACPI / battery: mark DMI table as __initconst
ACPI / LPSS: constify device descriptors
ACPI / HED: constify ACPI device ids
ACPI / processor: constify DMI system id table
ACPI / scan: constify ACPI device ids
ACPI: Constify ACPI device IDs in documentation

Prarit Bhargava (1):
intel_pstate: Fix overflow in busy_scaled due to long delay

Rafael J. Wysocki (21):
sched / idle: Move the default idle call code to a separate function
cpuidle: Check the sign of index in cpuidle_reflect()
sched / idle: Eliminate the "reflect" check from cpuidle_idle_call()
ACPI / property: Refine consistency check for PRP0001
ACPI / PM: Drop stale comment from acpi_power_transition()
cpuidle: Fix the kerneldoc comment for cpuidle_enter_state()
PM / sleep: Refine diagnostic messages in enter_state()
PM / sleep: Fix symbol name in a comment in kernel/power/main.c
sched / idle: Call idle_set_state() from cpuidle_enter_state()
sched / idle: Call default_idle_call() from cpuidle_enter_state()
cpuidle: Select a different state on tick_broadcast_enter() failures
PM / tick: Add tracepoints for suspend-to-idle diagnostics
ACPI / PM: Rework device power management to follow ACPI 6
PM / sleep: Make suspend-to-idle-specific code depend on CONFIG_SUSPEND
ACPI / property: Define a symbol for PRP0001
ACPI / PM: Turn power resources on and off in the right order
during resume
cpuidle: Do not use CPUIDLE_DRIVER_STATE_START in cpuidle.c
ACPI / PM: Add missing pm_generic_complete() invocation
ACPI / init: Switch over platform to the ACPI mode later
ACPI / PNP: Avoid conflicting resource reservations
ACPI / enumeration: Document the rules regarding the PRP0001 device ID

Rajendra Nayak (5):
PM / clock_ops: Provide default runtime ops to users
arm: keystone: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
arm: omap1: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
arm: davinci: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS
drivers: sh: remove boilerplate code and use USE_PM_CLK_RUNTIME_OPS

Ruchi Kandoi (1):
PM / sleep: Return -EBUSY from suspend_enter() on wakeup detection

Saravana Kannan (1):
cpufreq: Track cpu managing sysfs kobjects separately

Shailendra Verma (3):
cpufreq: Fix for typos in two comments
cpufreq: nforce2: Fix typo in comment to function nforce2_init()
cpufreq: gx-suspmod: Fix two typos in two comments

Shilpasri G Bhat (1):
cpuidle: powernv/pseries: Auto-promotion of snooze to deeper idle state

Sudeep Holla (3):
cpufreq: arm_big_little: check if the frequency is set correctly
cpufreq: arm_big_little: remove unused cpu-cluster.<n> clock name
cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE

Suthikulpanit, Suravee (7):
ACPI / scan: Parse _CCA and setup device coherency
arm64 : Introduce support for ACPI _CCA object
device property: Introduces device_dma_is_coherent()
crypto: ccp - Unify coherency checking logic with device_dma_is_coherent()
amd-xgbe: Unify coherency checking logic with device_dma_is_coherent()
megaraid_sas: fix TRUE and FALSE re-define build error
ufs: fix TRUE and FALSE re-define build error

Tang Yuantian (1):
cpufreq: qoriq: optimize the CPU frequency switching time

Todd E Brandt (1):
PM / sleep: trace_device_pm_callback coverage in dpm_prepare/complete

Tony Lindgren (3):
PM / Runtime: Update last_busy in rpm_resume
PM / Wakeirq: Add automated device wake IRQ handling
PM / wakeirq: Fix typo in prototype for dev_pm_set_dedicated_wake_irq

Viresh Kumar (23):
cpufreq: Add doc style comment about cpufreq_cpu_{get|put}()
cpufreq: Merge __cpufreq_add_dev() and cpufreq_add_dev()
cpufreq: Throw warning when we try to get policy for an invalid CPU
cpufreq: Keep a single path for adding managed CPUs
cpufreq: Clear policy->cpus even for the last CPU
cpufreq: Create for_each_{in}active_policy()
cpufreq: Don't clear cpufreq_cpu_data and policy list for
inactive policies
cpufreq: Get rid of cpufreq_cpu_data_fallback
cpufreq: Don't traverse all active policies to find policy for a cpu
cpufreq: Manage governor usage history with 'policy->last_governor'
cpufreq: Mark policy->governor = NULL for inactive policies
cpufreq: Don't allow updating inactive policies from sysfs
cpufreq: Stop migrating sysfs files on hotplug
cpufreq: Initialize policy->kobj while allocating policy
cpufreq: Call cpufreq_policy_put_kobj() from cpufreq_policy_free()
cpufreq: Restart governor as soon as possible
cpufreq: Remove cpufreq_update_policy()
cpufreq: governor: register notifier from cs_init()
cpufreq: governor: split cpufreq_governor_dbs()
cpufreq: governor: Serialize governor callbacks
PM / OPP: Add new bindings to address shortcomings of existing bindings
PM / OPP: Allow multiple OPP tables to be passed via DT
PM / OPP: Add binding for 'opp-suspend'

Wang Long (1):
Documentation: cpufreq: delete duplicate description of sysfs
interface 'scaling_driver'

---------------

Documentation/acpi/enumeration.txt | 57 +-
Documentation/cpu-freq/user-guide.txt | 2 -
Documentation/devicetree/bindings/power/opp.txt | 448 +++++++++++++++-
Documentation/kernel-parameters.txt | 62 +--
Documentation/power/runtime_pm.txt | 6 +
arch/arm/mach-davinci/pm_domain.c | 32 +-
arch/arm/mach-keystone/pm_domain.c | 33 +-
arch/arm/mach-omap1/pm_bus.c | 37 +-
arch/arm/mach-omap2/omap_device.c | 7 +-
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/dma-mapping.h | 18 +-
arch/arm64/mm/dma-mapping.c | 92 ++++
arch/x86/kernel/acpi/wakeup_32.S | 6 +-
drivers/acpi/Kconfig | 5 +-
drivers/acpi/Makefile | 5 +-
drivers/acpi/ac.c | 2 +-
drivers/acpi/acpi_lpss.c | 22 +-
drivers/acpi/acpi_platform.c | 2 +-
drivers/acpi/acpi_processor.c | 20 +-
drivers/acpi/{video.c => acpi_video.c} | 283 ++--------
drivers/acpi/acpica/acdebug.h | 4 +-
drivers/acpi/acpica/aclocal.h | 15 +
drivers/acpi/acpica/acparser.h | 3 +
drivers/acpi/acpica/acpredef.h | 45 +-
drivers/acpi/acpica/acutils.h | 2 +-
drivers/acpi/acpica/dsmethod.c | 5 +-
drivers/acpi/acpica/hwpci.c | 9 +-
drivers/acpi/acpica/nsprepkg.c | 13 +
drivers/acpi/acpica/nsrepair.c | 2 +-
drivers/acpi/acpica/psopinfo.c | 3 -
drivers/acpi/acpica/utfileio.c | 9 +-
drivers/acpi/acpica/uthex.c | 4 +-
drivers/acpi/acpica/utxferror.c | 11 +-
drivers/acpi/apei/ghes.c | 108 ++--
drivers/acpi/battery.c | 48 +-
drivers/acpi/bus.c | 56 +-
drivers/acpi/device_pm.c | 98 ++--
drivers/acpi/ec.c | 357 +++++++++----
drivers/acpi/fan.c | 5 +-
drivers/acpi/glue.c | 5 +
drivers/acpi/hed.c | 2 +-
drivers/acpi/internal.h | 11 +-
drivers/acpi/osl.c | 14 +-
drivers/acpi/pci_irq.c | 1 -
drivers/acpi/power.c | 45 +-
drivers/acpi/processor_core.c | 10 +-
drivers/acpi/processor_idle.c | 2 +-
drivers/acpi/processor_pdc.c | 5 +-
drivers/acpi/property.c | 54 +-
drivers/acpi/resource.c | 160 ++++++
drivers/acpi/scan.c | 147 ++++--
drivers/acpi/utils.c | 15 +
drivers/acpi/video_detect.c | 409 ++++++++-------
drivers/base/power/Makefile | 2 +-
drivers/base/power/clock_ops.c | 43 +-
drivers/base/power/domain.c | 42 +-
drivers/base/power/main.c | 14 +-
drivers/base/power/power.h | 48 ++
drivers/base/power/runtime.c | 6 +
drivers/base/power/wakeirq.c | 273 ++++++++++
drivers/base/power/wakeup.c | 146 ++++++
drivers/base/property.c | 14 +
drivers/bus/omap_l3_noc.c | 4 +-
drivers/cpufreq/Kconfig.arm | 2 +-
drivers/cpufreq/arm_big_little.c | 40 +-
drivers/cpufreq/cpufreq-dt.c | 1 +
drivers/cpufreq/cpufreq-nforce2.c | 2 +-
drivers/cpufreq/cpufreq.c | 573 ++++++++++++---------
drivers/cpufreq/cpufreq_conservative.c | 28 +-
drivers/cpufreq/cpufreq_governor.c | 345 +++++++------
drivers/cpufreq/cpufreq_governor.h | 16 +-
drivers/cpufreq/cpufreq_ondemand.c | 6 +-
drivers/cpufreq/gx-suspmod.c | 4 +-
drivers/cpufreq/intel_pstate.c | 72 +--
drivers/cpufreq/pxa2xx-cpufreq.c | 20 +-
drivers/cpufreq/qoriq-cpufreq.c | 32 +-
drivers/cpuidle/cpuidle-powernv.c | 12 +
drivers/cpuidle/cpuidle-pseries.c | 11 +
drivers/cpuidle/cpuidle.c | 40 +-
drivers/cpuidle/governors/menu.c | 4 +-
drivers/crypto/ccp/ccp-platform.c | 60 +--
drivers/gpu/drm/i915/intel_opregion.c | 12 +-
drivers/leds/led-class.c | 7 +-
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 27 +-
drivers/pci/pci-acpi.c | 2 +-
drivers/platform/x86/Kconfig | 21 +-
drivers/platform/x86/acer-wmi.c | 10 +-
drivers/platform/x86/apple-gmux.c | 4 +-
drivers/platform/x86/asus-laptop.c | 6 +-
drivers/platform/x86/asus-wmi.c | 15 +-
drivers/platform/x86/compal-laptop.c | 4 +-
drivers/platform/x86/dell-laptop.c | 8 +-
drivers/platform/x86/dell-wmi.c | 3 +-
drivers/platform/x86/eeepc-laptop.c | 5 +-
drivers/platform/x86/fujitsu-laptop.c | 6 +-
drivers/platform/x86/ideapad-laptop.c | 3 +-
drivers/platform/x86/intel_oaktrail.c | 7 +-
drivers/platform/x86/msi-laptop.c | 6 +-
drivers/platform/x86/msi-wmi.c | 4 +-
drivers/platform/x86/samsung-laptop.c | 27 +-
drivers/platform/x86/sony-laptop.c | 7 +-
drivers/platform/x86/thinkpad_acpi.c | 5 +-
drivers/platform/x86/toshiba_acpi.c | 7 +-
drivers/pnp/pnpacpi/rsparser.c | 10 +-
drivers/pnp/system.c | 35 +-
drivers/powercap/intel_rapl.c | 51 +-
drivers/scsi/megaraid/megaraid_sas_fp.c | 8 +
drivers/scsi/ufs/unipro.h | 8 +
drivers/sh/pm_runtime.c | 47 +-
drivers/xen/xen-acpi-cpuhotplug.c | 12 +-
include/acpi/acpi_bus.h | 41 +-
include/acpi/acpiosxf.h | 2 +-
include/acpi/acpixf.h | 2 +-
include/acpi/actbl.h | 17 +-
include/acpi/actbl1.h | 176 ++++++-
include/acpi/actbl2.h | 146 +++++-
include/acpi/actbl3.h | 88 +++-
include/acpi/actypes.h | 6 +-
include/acpi/acuuid.h | 89 ++++
include/acpi/platform/acenv.h | 3 +
include/acpi/platform/acenvex.h | 3 +
include/acpi/video.h | 21 +-
include/linux/acpi.h | 69 ++-
include/linux/cpufreq.h | 5 +-
include/linux/cpuidle.h | 20 +-
include/linux/pm.h | 14 +
include/linux/pm_clock.h | 10 +
include/linux/pm_wakeirq.h | 51 ++
include/linux/pm_wakeup.h | 9 +
include/linux/property.h | 2 +
include/linux/tick.h | 12 +-
include/trace/events/power.h | 25 +-
init/main.c | 1 +
kernel/power/main.c | 2 +-
kernel/power/suspend.c | 8 +-
kernel/sched/idle.c | 114 ++--
kernel/time/tick-common.c | 17 +-
.../cpupower/utils/idle_monitor/mperf_monitor.c | 5 +-
138 files changed, 4095 insertions(+), 1907 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH v2] trace/events: add chip name and hwirq to irq entry tracepoint (no replies)

$
0
0
Add chip name and hw-irq number to the trace_irq_handler_entry()
tracepoint. When tracing interrupt events the chip-name and hw-irq
numbers are stable and known in advance. This makes them a better
choice as a filtering criteria for the trace buffer dump. On the
flipside, the os-irq numbers are dynamically allocated which makes
them difficult to use for the same purpose.

Dump messages will look like:
....irq_handler_entry: irq=22 name=msm_serial0 domain=GIC hwirq=140

Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: Ankit Gupta <ankgupta@codeaurora.org>
---
Changes since V1:
- added reviewed by Andy Gross
---
include/trace/events/irq.h | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index 3608beb..5370075 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -23,6 +23,17 @@ struct softirq_action;
softirq_name(HRTIMER), \
softirq_name(RCU))

+
+#define show_chip_name(irq) \
+ (irq_get_irq_data(irq) \
+ ? irq_get_irq_data(irq)->chip->name \
+ : "NULL")
+
+#define show_hwirq(irq) \
+ (irq_get_irq_data(irq) \
+ ? irq_get_irq_data(irq)->hwirq \
+ : -ENODEV)
+
/**
* irq_handler_entry - called immediately before the irq action handler
* @irq: irq number
@@ -50,7 +61,9 @@ TRACE_EVENT(irq_handler_entry,
__assign_str(name, action->name);
),

- TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))
+ TP_printk("irq=%d name=%s chip_name=%s hwirq=%ld", __entry->irq,
+ __get_str(name), show_chip_name(__entry->irq),
+ show_hwirq(__entry->irq))
);

/**
--
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH v6 0/9] Add simple NVMEM Framework via regmap. (10 replies)

$
0
0
Thankyou all for providing inputs and comments on previous versions of this
patchset. Here is the v6 of the patchset addressing all the issues raised as
part of previous versions review.

This patchset adds a new simple NVMEM framework to kernel, and it is tested
with various drivers like "QCOM thermal sensors", "QCOM cpr driver",
"begal bone cape manager" and few more on the way.

Greg KH,
Is it possible to take these patches via your tree Or do you think it
should go via ARM-SOC tree?

Up until now, NVMEM drivers like eeprom were stored in drivers/misc, where they
all had to duplicate pretty much the same code to register a sysfs file, allow
in-kernel users to access the content of the devices they were driving, etc.

This was also a problem as far as other in-kernel users were involved, since
the solutions used were pretty much different from on driver to another, there
was a rather big abstraction leak.

Introduction of this framework aims at solving this. It also introduces DT
representation for consumer devices to go get the data they require (MAC
Addresses, SoC/Revision ID, part numbers, and so on) from the NVMEMs.

After learning few things about QCOM qfprom and other eeprom/efuses, which
has packed fields at bit level. Which makes it important to add support to
such memories. This version adds support to this type of non volatile
memories by adding support to bit level nvmem-cells.

Having regmap interface to this framework would give much better
abstraction for nvmems on different buses.

patch 1-4 Introduces the NVMEM framework.
Patch 5-6 Adds Qualcomm specific qfprom driver.
Patch 7 migrates an existing driver to nvmem framework.
Patch 8 adds entry in MAINTAINERS.

Its also possible to migrate other nvmem drivers to this framework.

Providers APIs:
nvmem_register/unregister();

Consumers APIs:
Cell based apis for both DT/Non-DT:
nvmem_cell_get()/nvmem_cell_put();
devm_nvmem_cell_get()/devm_nvmem_cell_put();
of_nvmem_cell_get()
nvmem_cell_read()/nvmem_cell_write();

Raw byte access apis for both DT/non-DT.
nvmem_device_get()/nvmem_device_put()
devm_nvmem_device_get()/nvmem_device_put()
of_nvmem_device_get()

nvmem_device_read()/nvmem_device_write();
nvmem_device_cell_read()/nvmem_device_cell_write();

Device Tree:

/* Provider */
qfprom: qfprom@00700000 {
...

/* Data cells */
tsens_calibration: calib@404 {
reg = <0x404 0x10>;
};

tsens_calibration_bckp: calib_bckp@504 {
reg = <0x504 0x11>;
bit-offset = 6;
nbits = 128;
};

pvs_version: pvs-version@6 {
reg = <0x6 0x2>
bit-offset = 7;
nbits = 2;
};

speed_bin: speed-bin@c{
reg = <0xc 0x1>;
bit-offset = 2;
nbits = 3;

};
...
};

userspace interface: binary file in /sys/class/nvmem/*/nvmem

ex:
hexdump /sys/class/nvmem/qfprom0/nvmem

0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
00000a0 db10 2240 0000 e000 0c00 0c00 0000 0c00
0000000 0000 0000 0000 0000 0000 0000 0000 0000
....
*
0001000

Changes since v5(https://lkml.org/lkml/2015/5/21/643)
* skipped regmap patches which are already merged by Mark.
* Fixed lot of style related comments by Stephen.
* Fixed sunxi driver.
* added devm_* variants requested by Stephen.
* added of_* variants requested by Pantelis Antoniou
* added read_only options for non-dt drivers.
* added basic how-to doc.

Changes since v4(https://lkml.org/lkml/2015/3/30/725)
* rename eeprom to nvmem suggested by Matt Porter
* added bit level support to nvmem cells, if not framework is
not usable for qcom platforms.
* removed ternary operator shortcut suggested by Mark B.
* unified consumer/provider apis for both DT and non-DT.
* added name support for cell.
* added bit level bindings.
* added read-only support suggested by Matt Porter and others.
* added new nvmem_device based consumer apis.

Changes since v3(https://lkml.org/lkml/2015/3/24/1066)
* simplified logic in bin_attr_eeprom_read/write spotted by Mark Brown.
* moved from using regmap_bulk_read/write to regmap_raw_read/write
spotted by Mark Brown
* Fixed return error codes for the dummy wrappers spotted by Sascha Hauer
* Fixed various error code checks in core spotted by Sascha Hauer.
* Simplified consumer bindings suggested by Sascha Hauer.
* Added eeprom-mmio helper functions.

Changes since v2(https://lkml.org/lkml/2015/3/13/168)
* Fixed error handling in eeprom_register spotted by Mark Brown
* Added new regmap_get_max_register() and regmap_get_reg_stride().
* Fixed module build errors reported by kbuild robot.
* recycle the ids when eeprom provider is released.

Changes since v1(https://lkml.org/lkml/2015/3/5/153)
* Fix various Licencing issues spotted by Paul Bolle and Mark Brown
* Allow eeprom core to build as module spotted by Paul Bolle.
* Fix various kconfig issues spotted by Paul Bolle.
* remove unessary atomic varible spotted by Mark Brown.
* Few cleanups and common up some of the code in core.
* Add qfprom bindings.

Changes since RFC(https://lkml.org/lkml/2015/2/19/307)
* Fix documentation and error checks in read/write spotted by Andrew Lunn
* Kconfig fix suggested by Stephen Boyd.
* Add module owner suggested by Stephen Boyd and others.
* Fix unsafe handling of eeprom in unregister spotted by Russell and Mark Brown.
* seperate bindings patch as suggested by Rob.
* Add MAINTAINERS as suggested by Rob.
* Added support to allow reading eeprom for things like serial number which
* canbe scatters across.
* Added eeprom data using reg property suggested by Sascha and Stephen.
* Added non-DT support.
* Move kerneldoc to the src files spotted by Mark Brown.
* Remove local list and do eeprom lookup by using class_find_device()


Thanks,
srini

Maxime Ripard (1):
nvmem: sunxi: Move the SID driver to the nvmem framework

Srinivas Kandagatla (8):
nvmem: Add a simple NVMEM framework for nvmem providers
nvmem: Add a simple NVMEM framework for consumers
nvmem: Add nvmem_device based consumer apis.
nvmem: Add bindings for simple nvmem framework
Documentation: nvmem: add nvmem api level and how-to doc
nvmem: qfprom: Add Qualcomm QFPROM support.
nvmem: qfprom: Add bindings for qfprom
nvmem: Add to MAINTAINERS for nvmem framework

Documentation/ABI/testing/sysfs-driver-sunxi-sid | 22 -
.../bindings/misc/allwinner,sunxi-sid.txt | 17 -
.../bindings/nvmem/allwinner,sunxi-sid.txt | 21 +
Documentation/devicetree/bindings/nvmem/nvmem.txt | 85 ++
Documentation/devicetree/bindings/nvmem/qfprom.txt | 35 +
Documentation/nvmem/nvmem.txt | 151 +++
MAINTAINERS | 9 +
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/misc/eeprom/Kconfig | 13 -
drivers/misc/eeprom/Makefile | 1 -
drivers/misc/eeprom/sunxi_sid.c | 156 ---
drivers/nvmem/Kconfig | 36 +
drivers/nvmem/Makefile | 12 +
drivers/nvmem/core.c | 1069 ++++++++++++++++++++
drivers/nvmem/qfprom.c | 89 ++
drivers/nvmem/sunxi-sid.c | 160 +++
include/linux/nvmem-consumer.h | 154 +++
include/linux/nvmem-provider.h | 48 +
19 files changed, 1872 insertions(+), 209 deletions(-)
delete mode 100644 Documentation/ABI/testing/sysfs-driver-sunxi-sid
delete mode 100644 Documentation/devicetree/bindings/misc/allwinner,sunxi-sid.txt
create mode 100644 Documentation/devicetree/bindings/nvmem/allwinner,sunxi-sid.txt
create mode 100644 Documentation/devicetree/bindings/nvmem/nvmem.txt
create mode 100644 Documentation/devicetree/bindings/nvmem/qfprom.txt
create mode 100644 Documentation/nvmem/nvmem.txt
delete mode 100644 drivers/misc/eeprom/sunxi_sid.c
create mode 100644 drivers/nvmem/Kconfig
create mode 100644 drivers/nvmem/Makefile
create mode 100644 drivers/nvmem/core.c
create mode 100644 drivers/nvmem/qfprom.c
create mode 100644 drivers/nvmem/sunxi-sid.c
create mode 100644 include/linux/nvmem-consumer.h
create mode 100644 include/linux/nvmem-provider.h

--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH v4] hexdump: fix for non-aligned buffers (no replies)

$
0
0
An hexdump with a buf not aligned to the groupsize causes
non-naturally-aligned memory accesses. This was causing a kernel panic on
the processor BlackFin BF527, when such an unaligned buffer was fed by the
function ubifs_scanned_corruption in fs/ubifs/scan.c .

To fix this, if the buffer is not aligned to groupsize in a platform which
does not define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS, then change the
groupsize to 1, so alignment is no longer a problem.
This behavior is coherent with the way the function currently deals with
inappropriate parameter combinations, which is to fall back to safe
"defaults", even if that means changing the output format and the implicit
access patterns that could have been expected.

Signed-off-by: Horacio Mijail Antón Quiles <hmijail@gmail.com>
---
Changes in v4:
- Really corrected patch format issues! (per Joe Perches')

Changes in v3:
- Corrected patch format issues (per Joe Perches' indication)
- Changed git's mail header to avoid encoding issues

Changes in v2:
- Changed from ad-hoc calculation to IS_ALIGNED() for readability (per
Joe Perches' indication)
- Made the explanation clearer (aligned vs naturally aligned)

---
lib/hexdump.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/lib/hexdump.c b/lib/hexdump.c
index 7ea0969..a3bd5d5 100644
--- a/lib/hexdump.c
+++ b/lib/hexdump.c
@@ -124,6 +124,11 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize,
if ((len % groupsize) != 0) /* no mixed size output */
groupsize = 1;

+ /* fall back to 1-byte groups if buf is not aligned to groupsize */
+ if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) &&
+ !IS_ALIGNED((uintptr_t)buf, groupsize))
+ groupsize = 1;
+
ngroups = len / groupsize;
ascii_column = rowsize * 2 + rowsize / groupsize + 1;

--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH 0/3] dwc2 patches to allow wakeup on Rockchip rk3288 (3 replies)

$
0
0
This series of patches, together with
https://patchwork.kernel.org/patch/6652341/ from Chris Zhong and a
dts change allow us to wake up from a USB device on rk3288 boards.
The patches were tested on rk3288-jerry in the chromeos-3.14 kernel.
The chromeos-3.14 kernel tested included a full set of dwc2 backports
from upstream, so this is expected to function upstream once we get
everything setup there.


Douglas Anderson (3):
USB: Export usb_wakeup_enabled_descendants()
Documentation: dt-bindings: Add snps,need-phy-for-wake for dwc2 USB
USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

Documentation/devicetree/bindings/usb/dwc2.txt | 4 +++
drivers/usb/core/hub.c | 7 ++--
drivers/usb/dwc2/core.h | 2 ++
drivers/usb/dwc2/platform.c | 45 ++++++++++++++++++++++++--
include/linux/usb/hcd.h | 5 +++
5 files changed, 58 insertions(+), 5 deletions(-)

--
2.4.3.573.g4eafbef

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[GIT PULL v2] SCSI updates for the 4.1+ merge window (no replies)

$
0
0
This is a resend of the original tree with the tag attached at original
commit c8806b6 snic: driver for Cisco SCSI HBA

---

This is the usual grab bag of driver updates (lpfc, hpsa,
megaraid_sas, cxgbi, be2iscsi) plus an assortment of minor updates.
There are also one new driver: the Cisco snic; the advansys driver has
been rewritten to get rid of the warning about converting it to the
DMA API, the tape statistics patch got in and finally, there's a
resuffle of SCSI header files to separate more cleanly initiator from
target mode (and better share the common definitions).

The patch is available here:

git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-misc

The Short Changelog is:

Bart Van Assche (6):
qla2xxx: Fix indentation
qla2xxx: Comment out unreachable code
target: Minimize SCSI header #include directives
target: Correct a comment
Move code that is used both by initiator and target drivers
Split SCSI header files

Brian King (1):
ipr: Increase default adapter init stage change timeout

Christoph Hellwig (9):
virtio_scsi: don't select CONFIG_BLK_DEV_INTEGRITY
megaraid_sas : swap whole register in megasas_register_aen
megaraid_sas : fix megasas_fire_cmd_fusion calling convention
megaraid_sas : add missing byte swaps to the sriov code
megaraid_sas : bytewise or should be done on native endian variables
megaraid_sas : move endianness conversion into caller of megasas_get_seq_num
megaraid_sas : add endianness conversions for all ones
megaraid_sas : add endianness annotations
megaraid_sas : add missing __iomem annotations

Dan Carpenter (2):
csiostor: fix an error code in csio_hw_init()
sd: fix an error return in probe()

Don Brace (2):
hpsa: change driver version
hpsa: add in new controller id

Hannes Reinecke (24):
scsi: Do not set cmd_per_lun to 1 in the host template
advansys: Update to version 3.5 and remove compilation warning
advansys: Remove call to dma_cache_sync()
advansys: use spin_lock_irqsave() in interrupt handler
advansys: Check for DMA mapping errors
advansys: Remove cmd_per_lun setting
advansys: Remove obsolete virtual memory mapping comment
advansys: Remove 'a_flag'
advansys: rename 'ASC_RQ_XX' to 'ADV_RQ_XX'
advansys: Remove CC_VERY_LONG_SG_LIST
advansys: Remove ASC_SCSI_REQ_Q
advansys: scsi_q1->data_addr is little endian
advansys: cleanup function return codes
advansys: Make AscIsrChipHalted() a void function
advansys: remove 'ERR' definition
advansys: Remove 'TRUE' and 'FALSE' definitions
advansys: use standard data types
advansys: use 'bool' instead of 'int'
advansys: Use dma_pool for sg elements
advansys: Use DMA-API for mapping request blocks
advansys: Use DMA-API for carrier buffer
advansys: use DMA-API for mapping sense buffer
advansys: use shared host tag map for command lookup
advansys: use host_reset

James Bottomley (2):
ips: remove pointless #warning
scsi_scan: fix queue depth initialisation problem

James Smart (24):
lpfc: Update version to 10.7.0.0 for upstream patch set.
lpfc: Fix to drop PLOGIs from fabric node till LOGO processing completes
lpfc: Fix scsi task management error message.
lpfc: Fix cq_id masking problem.
lpfc: Fix scsi prep dma buf error.
lpfc: Add support for using block multi-queue
lpfc: Devices are not discovered during takeaway/giveback testing
lpfc: Fix vport deletion failure.
lpfc: Check for active portpeerbeacon.
lpfc: Update driver version for upstream patch set 10.6.0.1.
lpfc: Change buffer pool empty message to miscellaneous category
lpfc: Fix incorrect log message reported for empty FCF record.
lpfc: Fix rport leak.
lpfc: Correct loss of RSCNs during array takeaway/giveback testing.
lpfc: Fix crash in vport_delete.
lpfc: Fix to remove IRQF_SHARED flag for MSI/MSI-X vectors.
lpfc: Fix discovery issue when changing from Pt2Pt to Fabric.
lpfc: Correct reporting of vport state on fdisc command failure.
lpfc: Add support for RDP ELS command.
lpfc: Fix ABORTs WQ selection in terminate_rport_io
lpfc: Correct reference counting of rport
lpfc: Add support for ELS LCB.
lpfc: Correct loss of target discovery after cable swap.
lpfc: The lpfc driver does not issue RFF_ID and RFT_ID in the correct sequence

Joe Handzik (3):
hpsa: add more ioaccel2 error handling, including underrun statuses.
hpsa: Get queue depth from identify physical bmic for physical disks.
hpsa: use ioaccel2 path to submit IOs to physical drives in HBA mode.

Johannes Thumshirn (1):
advansys: fix compilation errors and warnings when CONFIG_PCI is not set

John Soni Jose (6):
be2iscsi : Bump the driver version
be2iscsi : Logout of FW Boot Session
be2iscsi : Fix memory check before unmapping.
be2iscsi : Fix memory leak in the unload path
be2iscsi : Fix the PCI request region reserving.
be2iscsi : Fix the retry count for boot targets

Karen Xie (4):
cxgb4i: set the initial sequence number
cxgbi: update driver versions
cxgbi: update copyright to 2015
cxgbi: use per-connection link-speed dependent send/recv windows

Luis R. Rodriguez (1):
fusion: remove dead MTRR code

Narsimhulu Musini (1):
snic: driver for Cisco SCSI HBA

Nilesh Javali (1):
bnx2i: Fix call trace while device reset

Robert Elliott (18):
hpsa: propagate the error code in hpsa_kdump_soft_reset
hpsa: use scsi host_no as hpsa controller number
hpsa: add interrupt number to /proc/interrupts interrupt name
hpsa: create workqueue after the driver is ready for use
hpsa: fix try_soft_reset error handling
hpsa: cleanup for init_one step 2 in kdump
hpsa: skip free_irq calls if irqs are not allocated
hpsa: call pci_release_regions after pci_disable_device
hpsa: do not print ioaccel2 warning messages about unusual completions.
hpsa: clean up some error reporting output in abort handler
hpsa: clean up driver init
hpsa: correct return values from driver functions.
hpsa: do not check cmd_alloc return value - it cannnot return NULL
hpsa: refactor freeing of resources into more logical functions
hpsa: clean up error handling
hpsa: break hpsa_free_irqs_and_disable_msix into two functions
hpsa: print accurate SSD Smart Path Enabled status
hpsa: make function names consistent

Sagi Grimberg (1):
iscsi: Fix iscsi endpoints leak

Seymour, Shane M (1):
st: implement tape statistics

Stephen Boyd (1):
ufs-qcom: Switch dependency to ARCH_QCOM

Stephen Cameron (9):
hpsa: add support sending aborts to physical devices via the ioaccel2 path
hpsa: try resubmitting down raid path on task set full
hpsa: do not ignore return value of hpsa_register_scsi
hpsa: factor out hpsa_init_cmd function
hpsa: allow lockup detected to be viewed via sysfs
hpsa: hpsa decode sense data for io and tmf
hpsa: decrement h->commands_outstanding in fail_all_outstanding_cmds
hpsa: clean up aborts
hpsa: add masked physical devices into h->dev[] array

Stephen Rothwell (1):
target: explicitly include scsi_proto.h in target_core_fabric_lib.c

Sumit.Saxena@avagotech.com (10):
megaraid_sas : Modify return value of megasas_issue_blocked_cmd() and wait_and_poll() to consider command status returned by firmware
megaraid_sas : Support for Avago's Single server High Availability product
megaraid_sas : Add release date and update driver version
megaraid_sas : Modify driver's meta data to reflect Avago
megaraid_sas : Use Block layer tag support for internal command indexing
megaraid_sas : Enhanced few prints
megaraid_sas : Move controller's queue depth calculation in adapter specific function
megaraid_sas : Add separate functions for building sysPD IOs and non RW LDIOs
megaraid_sas : Add separate function for refiring MFI commands
megaraid_sas : Add separate function for setting up IRQs

Tej Parkash (1):
bnx2i: Fixed firmware assert, during target logout.

Tomas Henzl (5):
mptsas: fix depth param in scsi_track_queue_full
megaraid: fix irq setup process regression
hpsa: dont meddle with hw which isn't ours (cciss)
cciss: correct the non-resettable board list
cciss: remove duplicate entries from board_type struct

Webb Scales (10):
hpsa: cleanup reset
hpsa: use block layer tag for command allocation
hpsa: performance tweak for hpsa_scatter_gather()
hpsa: refactor and rework support for sending TEST_UNIT_READY
hpsa: don't return abort request until target is complete
hpsa: use helper routines for finishing commands
hpsa: add ioaccel sg chaining for the ioaccel2 path
hpsa: factor out hpsa_ioaccel_submit function
hpsa: rework controller command submission
hpsa: clean up host, channel, target, lun prints

Yaniv Gardi (10):
scsi: ufs-qcom: enable UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION
scsi: ufs: add quirk to handle broken UFS HCI version
scsi: ufs-qcom: enable UFSHCD_QUIRK_DME_PEER_ACCESS_AUTO_MODE quirk
scsi: ufs: introduce UFSHCD_QUIRK_DME_PEER_ACCESS_AUTO_MODE quirk
scsi: ufs-qcom: enable quirk to fix gear change to HS
scsi: ufs: introduce a broken PA_RXHSUNTERMCAP quirk
scsi: ufs-qcom: enable UFSHCD_QUIRK_BROKEN_LCC
scsi: ufs: provide a quirk to disable the LCC
scsi: ufs-qcom: don't enable interrupt aggregation
scsi: ufs: introduce the capability and quirk for interrupt aggregation

kbuild test robot (2):
megaraid_sas : megasas_complete_outstanding_ioctls() can be static
aacraid: aac_src_intr_message() can be static

and the diffstat:

Documentation/ABI/testing/sysfs-class-scsi_tape | 109 +
Documentation/scsi/st.txt | 59 +
Documentation/target/tcm_mod_builder.py | 7 +-
MAINTAINERS | 8 +
drivers/block/cciss.c | 27 +-
drivers/block/cciss_scsi.c | 1 -
drivers/firewire/sbp2.c | 1 -
drivers/infiniband/ulp/srpt/ib_srpt.c | 1 +
drivers/infiniband/ulp/srpt/ib_srpt.h | 2 +-
drivers/message/fusion/mptbase.c | 24 -
drivers/message/fusion/mptbase.h | 1 -
drivers/message/fusion/mptsas.c | 4 +-
drivers/s390/scsi/zfcp_scsi.c | 1 -
drivers/scsi/Kconfig | 20 +-
drivers/scsi/Makefile | 2 +
drivers/scsi/NCR53c406a.c | 1 -
drivers/scsi/a100u2w.c | 1 -
drivers/scsi/aacraid/src.c | 2 +-
drivers/scsi/advansys.c | 1474 +++++-------
drivers/scsi/aha152x.c | 1 -
drivers/scsi/aha1542.c | 1 -
drivers/scsi/aha1740.c | 1 -
drivers/scsi/aha1740.h | 1 -
drivers/scsi/aic94xx/aic94xx_init.c | 1 -
drivers/scsi/arm/arxescsi.c | 1 -
drivers/scsi/arm/cumana_2.c | 1 -
drivers/scsi/arm/eesox.c | 1 -
drivers/scsi/atp870u.c | 1 -
drivers/scsi/atp870u.h | 1 -
drivers/scsi/be2iscsi/be_cmds.c | 4 +
drivers/scsi/be2iscsi/be_cmds.h | 12 +
drivers/scsi/be2iscsi/be_main.c | 76 +-
drivers/scsi/be2iscsi/be_main.h | 6 +-
drivers/scsi/be2iscsi/be_mgmt.c | 69 +
drivers/scsi/be2iscsi/be_mgmt.h | 3 +
drivers/scsi/bnx2i/bnx2i_iscsi.c | 5 +-
drivers/scsi/csiostor/csio_hw.c | 1 +
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | 20 +-
drivers/scsi/cxgbi/cxgb3i/cxgb3i.h | 2 +-
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 52 +-
drivers/scsi/cxgbi/cxgb4i/cxgb4i.h | 4 +-
drivers/scsi/cxgbi/libcxgbi.c | 20 +-
drivers/scsi/cxgbi/libcxgbi.h | 6 +-
drivers/scsi/dpt_i2o.c | 1 -
drivers/scsi/fdomain.c | 1 -
drivers/scsi/hpsa.c | 2794 ++++++++++++++++-------
drivers/scsi/hpsa.h | 19 +-
drivers/scsi/hpsa_cmd.h | 34 +-
drivers/scsi/imm.c | 1 -
drivers/scsi/initio.c | 1 -
drivers/scsi/ipr.h | 2 +-
drivers/scsi/ips.c | 9 +-
drivers/scsi/isci/init.c | 1 -
drivers/scsi/lpfc/lpfc.h | 2 +
drivers/scsi/lpfc/lpfc_crtn.h | 2 +
drivers/scsi/lpfc/lpfc_disc.h | 4 +-
drivers/scsi/lpfc/lpfc_els.c | 733 +++++-
drivers/scsi/lpfc/lpfc_hbadisc.c | 181 +-
drivers/scsi/lpfc/lpfc_hw.h | 201 ++
drivers/scsi/lpfc/lpfc_hw4.h | 236 +-
drivers/scsi/lpfc/lpfc_init.c | 26 +-
drivers/scsi/lpfc/lpfc_mbox.c | 152 ++
drivers/scsi/lpfc/lpfc_nportdisc.c | 10 +-
drivers/scsi/lpfc/lpfc_scsi.c | 65 +-
drivers/scsi/lpfc/lpfc_scsi.h | 3 +
drivers/scsi/lpfc/lpfc_sli.c | 82 +-
drivers/scsi/lpfc/lpfc_sli4.h | 21 +
drivers/scsi/lpfc/lpfc_version.h | 2 +-
drivers/scsi/lpfc/lpfc_vport.c | 9 +-
drivers/scsi/mac53c94.c | 1 -
drivers/scsi/megaraid/megaraid_sas.h | 342 +--
drivers/scsi/megaraid/megaraid_sas_base.c | 739 +++---
drivers/scsi/megaraid/megaraid_sas_fp.c | 17 +-
drivers/scsi/megaraid/megaraid_sas_fusion.c | 554 +++--
drivers/scsi/megaraid/megaraid_sas_fusion.h | 281 ++-
drivers/scsi/mvsas/mv_init.c | 1 -
drivers/scsi/nsp32.c | 1 -
drivers/scsi/pcmcia/nsp_cs.c | 1 -
drivers/scsi/pcmcia/qlogic_stub.c | 1 -
drivers/scsi/pcmcia/sym53c500_cs.c | 1 -
drivers/scsi/pm8001/pm8001_init.c | 1 -
drivers/scsi/ppa.c | 1 -
drivers/scsi/ps3rom.c | 1 -
drivers/scsi/qla1280.c | 1 -
drivers/scsi/qla2xxx/qla_init.c | 2 +-
drivers/scsi/qla2xxx/qla_iocb.c | 8 +-
drivers/scsi/qla2xxx/qla_isr.c | 4 +-
drivers/scsi/qla2xxx/qla_nx.c | 2 +-
drivers/scsi/qla2xxx/qla_nx2.c | 13 +-
drivers/scsi/qla2xxx/qla_os.c | 7 +-
drivers/scsi/qla2xxx/qla_target.c | 16 +-
drivers/scsi/qlogicfas.c | 1 -
drivers/scsi/qlogicpti.c | 1 -
drivers/scsi/scsi.c | 46 -
drivers/scsi/scsi_common.c | 178 ++
drivers/scsi/scsi_error.c | 64 -
drivers/scsi/scsi_scan.c | 65 +-
drivers/scsi/scsi_transport_iscsi.c | 2 +
drivers/scsi/sd.c | 3 +-
drivers/scsi/snic/Makefile | 17 +
drivers/scsi/snic/cq_desc.h | 77 +
drivers/scsi/snic/cq_enet_desc.h | 38 +
drivers/scsi/snic/snic.h | 414 ++++
drivers/scsi/snic/snic_attrs.c | 77 +
drivers/scsi/snic/snic_ctl.c | 279 +++
drivers/scsi/snic/snic_debugfs.c | 560 +++++
drivers/scsi/snic/snic_disc.c | 551 +++++
drivers/scsi/snic/snic_disc.h | 124 +
drivers/scsi/snic/snic_fwint.h | 525 +++++
drivers/scsi/snic/snic_io.c | 518 +++++
drivers/scsi/snic/snic_io.h | 118 +
drivers/scsi/snic/snic_isr.c | 204 ++
drivers/scsi/snic/snic_main.c | 1044 +++++++++
drivers/scsi/snic/snic_res.c | 295 +++
drivers/scsi/snic/snic_res.h | 97 +
drivers/scsi/snic/snic_scsi.c | 2632 +++++++++++++++++++++
drivers/scsi/snic/snic_stats.h | 123 +
drivers/scsi/snic/snic_trc.c | 181 ++
drivers/scsi/snic/snic_trc.h | 121 +
drivers/scsi/snic/vnic_cq.c | 86 +
drivers/scsi/snic/vnic_cq.h | 110 +
drivers/scsi/snic/vnic_cq_fw.h | 62 +
drivers/scsi/snic/vnic_dev.c | 748 ++++++
drivers/scsi/snic/vnic_dev.h | 110 +
drivers/scsi/snic/vnic_devcmd.h | 270 +++
drivers/scsi/snic/vnic_intr.c | 59 +
drivers/scsi/snic/vnic_intr.h | 105 +
drivers/scsi/snic/vnic_resource.h | 68 +
drivers/scsi/snic/vnic_snic.h | 54 +
drivers/scsi/snic/vnic_stats.h | 68 +
drivers/scsi/snic/vnic_wq.c | 237 ++
drivers/scsi/snic/vnic_wq.h | 170 ++
drivers/scsi/snic/wq_enet_desc.h | 96 +
drivers/scsi/st.c | 272 ++-
drivers/scsi/st.h | 22 +
drivers/scsi/sym53c416.c | 1 -
drivers/scsi/ufs/Kconfig | 2 +-
drivers/scsi/ufs/ufs-qcom.c | 39 +-
drivers/scsi/ufs/ufshcd.c | 108 +-
drivers/scsi/ufs/ufshcd.h | 53 +-
drivers/scsi/ufs/ufshci.h | 8 +-
drivers/scsi/virtio_scsi.c | 11 +-
drivers/scsi/wd719x.c | 1 -
drivers/scsi/wd719x.h | 2 -
drivers/staging/rts5208/rtsx.c | 1 -
drivers/target/iscsi/iscsi_target.c | 2 +-
drivers/target/iscsi/iscsi_target_device.c | 1 -
drivers/target/iscsi/iscsi_target_tmr.c | 2 +-
drivers/target/sbp/sbp_target.c | 2 +-
drivers/target/target_core_alua.c | 3 +-
drivers/target/target_core_device.c | 4 +-
drivers/target/target_core_fabric_lib.c | 4 +-
drivers/target/target_core_file.c | 3 +-
drivers/target/target_core_iblock.c | 3 +-
drivers/target/target_core_pr.c | 3 +-
drivers/target/target_core_pscsi.c | 2 -
drivers/target/target_core_pscsi.h | 6 +-
drivers/target/target_core_rd.c | 3 +-
drivers/target/target_core_sbc.c | 2 +-
drivers/target/target_core_spc.c | 3 +-
drivers/target/target_core_stat.c | 3 -
drivers/target/target_core_tmr.c | 2 -
drivers/target/target_core_tpg.c | 3 +-
drivers/target/target_core_transport.c | 4 +-
drivers/target/target_core_ua.c | 3 +-
drivers/target/target_core_user.c | 5 +-
drivers/target/target_core_xcopy.c | 3 +-
drivers/target/tcm_fc/tfc_cmd.c | 4 -
drivers/target/tcm_fc/tfc_conf.c | 4 -
drivers/target/tcm_fc/tfc_io.c | 4 -
drivers/target/tcm_fc/tfc_sess.c | 4 -
drivers/usb/gadget/legacy/tcm_usb_gadget.c | 1 -
drivers/usb/gadget/legacy/tcm_usb_gadget.h | 1 -
drivers/usb/image/microtek.c | 1 -
drivers/usb/storage/scsiglue.c | 1 -
drivers/usb/storage/uas.c | 1 -
drivers/vhost/scsi.c | 3 +-
drivers/xen/xen-scsiback.c | 5 +-
include/linux/libata.h | 2 -
include/scsi/scsi.h | 291 +--
include/scsi/scsi_common.h | 64 +
include/scsi/scsi_device.h | 2 -
include/scsi/scsi_eh.h | 31 -
include/scsi/scsi_proto.h | 281 +++
include/target/iscsi/iscsi_target_core.h | 1 -
include/target/target_core_base.h | 15 +-
include/trace/events/target.h | 2 +-
187 files changed, 16789 insertions(+), 3735 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-class-scsi_tape
create mode 100644 drivers/scsi/scsi_common.c
create mode 100644 drivers/scsi/snic/Makefile
create mode 100644 drivers/scsi/snic/cq_desc.h
create mode 100644 drivers/scsi/snic/cq_enet_desc.h
create mode 100644 drivers/scsi/snic/snic.h
create mode 100644 drivers/scsi/snic/snic_attrs.c
create mode 100644 drivers/scsi/snic/snic_ctl.c
create mode 100644 drivers/scsi/snic/snic_debugfs.c
create mode 100644 drivers/scsi/snic/snic_disc.c
create mode 100644 drivers/scsi/snic/snic_disc.h
create mode 100644 drivers/scsi/snic/snic_fwint.h
create mode 100644 drivers/scsi/snic/snic_io.c
create mode 100644 drivers/scsi/snic/snic_io.h
create mode 100644 drivers/scsi/snic/snic_isr.c
create mode 100644 drivers/scsi/snic/snic_main.c
create mode 100644 drivers/scsi/snic/snic_res.c
create mode 100644 drivers/scsi/snic/snic_res.h
create mode 100644 drivers/scsi/snic/snic_scsi.c
create mode 100644 drivers/scsi/snic/snic_stats.h
create mode 100644 drivers/scsi/snic/snic_trc.c
create mode 100644 drivers/scsi/snic/snic_trc.h
create mode 100644 drivers/scsi/snic/vnic_cq.c
create mode 100644 drivers/scsi/snic/vnic_cq.h
create mode 100644 drivers/scsi/snic/vnic_cq_fw.h
create mode 100644 drivers/scsi/snic/vnic_dev.c
create mode 100644 drivers/scsi/snic/vnic_dev.h
create mode 100644 drivers/scsi/snic/vnic_devcmd.h
create mode 100644 drivers/scsi/snic/vnic_intr.c
create mode 100644 drivers/scsi/snic/vnic_intr.h
create mode 100644 drivers/scsi/snic/vnic_resource.h
create mode 100644 drivers/scsi/snic/vnic_snic.h
create mode 100644 drivers/scsi/snic/vnic_stats.h
create mode 100644 drivers/scsi/snic/vnic_wq.c
create mode 100644 drivers/scsi/snic/vnic_wq.h
create mode 100644 drivers/scsi/snic/wq_enet_desc.h
create mode 100644 include/scsi/scsi_common.h
create mode 100644 include/scsi/scsi_proto.h

James


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[RFC v5 PATCH 1/9] mm/hugetlb: add region_del() to delete a specific range of entries (no replies)

$
0
0
fallocate hole punch will want to remove a specific range of pages.
The existing region_truncate() routine deletes all region/reserve
map entries after a specified offset. region_del() will provide
this same functionality if the end of region is specified as -1.
Hence, region_del() can replace region_truncate().

Unlike region_truncate(), region_del() can return an error in the
rare case where it can not allocate memory for a region descriptor.
This ONLY happens in the case where an existing region must be split.
Current callers passing -1 as end of range will never experience
this error and do not need to deal with error handling. Future
callers of region_del() (such as fallocate hole punch) will need to
handle this error.

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
mm/hugetlb.c | 88 ++++++++++++++++++++++++++++++++++++++++++------------------
1 file changed, 62 insertions(+), 26 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a8c3087..3fc2359 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -385,43 +385,79 @@ out_nrg:
}

/*
- * Truncate the reserve map at index 'end'. Modify/truncate any
- * region which contains end. Delete any regions past end.
- * Return the number of huge pages removed from the map.
+ * Delete the specified range [f, t) from the reserve map. If the
+ * t parameter is -1, this indicates that ALL regions after f should
+ * be deleted. Locate the regions which intersect [f, t) and either
+ * trim, delete or split the existing regions.
+ *
+ * Returns the number of huge pages deleted from the reserve map.
+ * In the normal case, the return value is zero or more. In the
+ * case where a region must be split, a new region descriptor must
+ * be allocated. If the allocation fails, -ENOMEM will be returned.
+ * NOTE: If the parameter t == -1, then we will never split a region
+ * and possibly return -ENOMEM. Callers specifying t == -1 do not
+ * need to check for -ENOMEM error.
*/
-static long region_truncate(struct resv_map *resv, long end)
+static long region_del(struct resv_map *resv, long f, long t)
{
struct list_head *head = &resv->regions;
struct file_region *rg, *trg;
- long chg = 0;
+ struct file_region *nrg = NULL;
+ long del = 0;

+ if (t == -1)
+ t = LONG_MAX;
+retry:
spin_lock(&resv->lock);
- /* Locate the region we are either in or before. */
- list_for_each_entry(rg, head, link)
- if (end <= rg->to)
+ list_for_each_entry_safe(rg, trg, head, link) {
+ if (rg->to <= f)
+ continue;
+ if (rg->from >= t)
break;
- if (&rg->link == head)
- goto out;

- /* If we are in the middle of a region then adjust it. */
- if (end > rg->from) {
- chg = rg->to - end;
- rg->to = end;
- rg = list_entry(rg->link.next, typeof(*rg), link);
- }
+ if (f > rg->from && t < rg->to) { /* Must split region */
+ if (!nrg) {
+ spin_unlock(&resv->lock);
+ nrg = kmalloc(sizeof(*nrg), GFP_KERNEL);
+ if (!nrg)
+ return -ENOMEM;
+ goto retry;
+ }

- /* Drop any remaining regions. */
- list_for_each_entry_safe(rg, trg, rg->link.prev, link) {
- if (&rg->link == head)
+ del += t - f;
+
+ /* New entry for end of split region */
+ nrg->from = t;
+ nrg->to = rg->to;
+ INIT_LIST_HEAD(&nrg->link);
+
+ /* Original entry is trimmed */
+ rg->to = f;
+
+ list_add(&nrg->link, &rg->link);
+ nrg = NULL;
break;
- chg += rg->to - rg->from;
- list_del(&rg->link);
- kfree(rg);
+ }
+
+ if (f <= rg->from && t >= rg->to) { /* Remove entire region */
+ del += rg->to - rg->from;
+ list_del(&rg->link);
+ kfree(rg);
+ continue;
+ }
+
+ if (f <= rg->from) { /* Trim beginning of region */
+ del += t - rg->from;
+ rg->from = t;
+ } else { /* Trim end of region */
+ del += rg->to - f;
+ rg->to = f;
+ }
}

-out:
spin_unlock(&resv->lock);
- return chg;
+ kfree(nrg);
+ return del;
}

/*
@@ -559,7 +595,7 @@ void resv_map_release(struct kref *ref)
struct resv_map *resv_map = container_of(ref, struct resv_map, refs);

/* Clear out any active regions before we release the map. */
- region_truncate(resv_map, 0);
+ region_del(resv_map, 0, -1);
kfree(resv_map);
}

@@ -3740,7 +3776,7 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
long gbl_reserve;

if (resv_map)
- chg = region_truncate(resv_map, offset);
+ chg = region_del(resv_map, offset, -1);
spin_lock(&inode->i_lock);
inode->i_blocks -= (blocks_per_huge_page(h) * freed);
spin_unlock(&inode->i_lock);
--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[RFC v5 PATCH 2/9] mm/hugetlb: expose hugetlb fault mutex for use by fallocate (no replies)

$
0
0
hugetlb page faults are currently synchronized by the table of
mutexes (htlb_fault_mutex_table). fallocate code will need to
synchronize with the page fault code when it allocates or
deletes pages. Expose interfaces so that fallocate operations
can be synchronized with page faults. Minor name changes to
be more consistent with other global hugetlb symbols.

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
include/linux/hugetlb.h | 5 +++++
mm/hugetlb.c | 20 ++++++++++----------
2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 2050261..33c6b32 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -85,6 +85,11 @@ int dequeue_hwpoisoned_huge_page(struct page *page);
bool isolate_huge_page(struct page *page, struct list_head *list);
void putback_active_hugepage(struct page *page);
void free_huge_page(struct page *page);
+extern struct mutex *hugetlb_fault_mutex_table;
+u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
+ struct vm_area_struct *vma,
+ struct address_space *mapping,
+ pgoff_t idx, unsigned long address);

#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud);
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 3fc2359..9657cca 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -64,7 +64,7 @@ DEFINE_SPINLOCK(hugetlb_lock);
* prevent spurious OOMs when the hugepage pool is fully utilized.
*/
static int num_fault_mutexes;
-static struct mutex *htlb_fault_mutex_table ____cacheline_aligned_in_smp;
+struct mutex *hugetlb_fault_mutex_table ____cacheline_aligned_in_smp;

/* Forward declaration */
static int hugetlb_acct_memory(struct hstate *h, long delta);
@@ -2347,7 +2347,7 @@ static void __exit hugetlb_exit(void)
}

kobject_put(hugepages_kobj);
- kfree(htlb_fault_mutex_table);
+ kfree(hugetlb_fault_mutex_table);
}
module_exit(hugetlb_exit);

@@ -2380,12 +2380,12 @@ static int __init hugetlb_init(void)
#else
num_fault_mutexes = 1;
#endif
- htlb_fault_mutex_table =
+ hugetlb_fault_mutex_table =
kmalloc(sizeof(struct mutex) * num_fault_mutexes, GFP_KERNEL);
- BUG_ON(!htlb_fault_mutex_table);
+ BUG_ON(!hugetlb_fault_mutex_table);

for (i = 0; i < num_fault_mutexes; i++)
- mutex_init(&htlb_fault_mutex_table);
+ mutex_init(&hugetlb_fault_mutex_table);
return 0;
}
module_init(hugetlb_init);
@@ -3316,7 +3316,7 @@ backout_unlocked:
}

#ifdef CONFIG_SMP
-static u32 fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
+u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
struct vm_area_struct *vma,
struct address_space *mapping,
pgoff_t idx, unsigned long address)
@@ -3341,7 +3341,7 @@ static u32 fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
* For uniprocesor systems we always use a single mutex, so just
* return 0 and avoid the hashing overhead.
*/
-static u32 fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
+u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
struct vm_area_struct *vma,
struct address_space *mapping,
pgoff_t idx, unsigned long address)
@@ -3389,8 +3389,8 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
* get spurious allocation failures if two CPUs race to instantiate
* the same page in the page cache.
*/
- hash = fault_mutex_hash(h, mm, vma, mapping, idx, address);
- mutex_lock(&htlb_fault_mutex_table[hash]);
+ hash = hugetlb_fault_mutex_hash(h, mm, vma, mapping, idx, address);
+ mutex_lock(&hugetlb_fault_mutex_table[hash]);

entry = huge_ptep_get(ptep);
if (huge_pte_none(entry)) {
@@ -3473,7 +3473,7 @@ out_ptl:
put_page(pagecache_page);
}
out_mutex:
- mutex_unlock(&htlb_fault_mutex_table[hash]);
+ mutex_unlock(&hugetlb_fault_mutex_table[hash]);
/*
* Generally it's safe to hold refcount during waiting page lock. But
* here we just wait to defer the next page fault to avoid busy loop and
--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[RFC v5 PATCH 4/9] hugetlbfs: truncate_hugepages() takes a range of pages (no replies)

$
0
0
Modify truncate_hugepages() to take a range of pages (start, end)
instead of simply start. If an end value of -1 is passed, the
current "truncate" functionality is maintained. Existing callers
are modified to pass -1 as end of range. By keying off end == -1,
the routine behaves differently for truncate and hole punch.
Page removal is now synchronized with page allocation via faults
by using the fault mutex table. The hole punch case can experience
the rare region_del error and must handle accordingly.

Add the routine hugetlb_fix_reserve_counts to fix up reserve counts
in the case where region_del returns an error.

Since the routine handles more than just the truncate case, it is
renamed to remove_inode_hugepages(). To be consistent, the routine
truncate_huge_page() is renamed remove_huge_page().

Downstream of remove_inode_hugepages(), the routine
hugetlb_unreserve_pages() is also modified to take a range of pages.
hugetlb_unreserve_pages is modified to detect an error from
region_del and pass it back to the caller.

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
fs/hugetlbfs/inode.c | 98 ++++++++++++++++++++++++++++++++++++++++++++-----
include/linux/hugetlb.h | 4 +-
mm/hugetlb.c | 40 ++++++++++++++++++--
3 files changed, 128 insertions(+), 14 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index e9d4c8d..160d58d4 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -318,26 +318,61 @@ static int hugetlbfs_write_end(struct file *file, struct address_space *mapping,
return -EINVAL;
}

-static void truncate_huge_page(struct page *page)
+static void remove_huge_page(struct page *page)
{
ClearPageDirty(page);
ClearPageUptodate(page);
delete_from_page_cache(page);
}

-static void truncate_hugepages(struct inode *inode, loff_t lstart)
+
+/*
+ * remove_inode_hugepages handles two distinct cases: truncation and hole
+ * punch. There are subtle differences in operation for each case.
+
+ * truncation is indicated by end of range being -1
+ * In this case, we first scan the range and release found pages.
+ * After releasing pages, hugetlb_unreserve_pages cleans up region/reserv
+ * maps and global counts.
+ * hole punch is indicated if end is not -1
+ * In the hole punch case we scan the range and release found pages.
+ * Only when releasing a page is the associated region/reserv map
+ * deleted. The region/reserv map for ranges without associated
+ * pages are not modified.
+ * Note: If the passed end of range value is beyond the end of file, but
+ * not -1 this routine still performs a hole punch operation.
+ */
+static void remove_inode_hugepages(struct inode *inode, loff_t lstart,
+ loff_t lend)
{
struct hstate *h = hstate_inode(inode);
struct address_space *mapping = &inode->i_data;
const pgoff_t start = lstart >> huge_page_shift(h);
+ const pgoff_t end = lend >> huge_page_shift(h);
+ struct vm_area_struct pseudo_vma;
struct pagevec pvec;
pgoff_t next;
int i, freed = 0;
+ long lookup_nr = PAGEVEC_SIZE;
+ bool truncate_op = (lend == -1);

+ memset(&pseudo_vma, 0, sizeof(struct vm_area_struct));
+ pseudo_vma.vm_flags = (VM_HUGETLB | VM_MAYSHARE | VM_SHARED);
pagevec_init(&pvec, 0);
next = start;
- while (1) {
- if (!pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) {
+ while (next < end) {
+ /*
+ * Make sure to never grab more pages that we
+ * might possibly need.
+ */
+ if (end - next < lookup_nr)
+ lookup_nr = end - next;
+
+ /*
+ * This pagevec_lookup() may return pages past 'end',
+ * so we must check for page->index > end.
+ */
+ if (!pagevec_lookup(&pvec, mapping, next, lookup_nr)) {
if (next == start)
break;
next = start;
@@ -346,26 +381,69 @@ static void truncate_hugepages(struct inode *inode, loff_t lstart)

for (i = 0; i < pagevec_count(&pvec); ++i) {
struct page *page = pvec.pages;
+ u32 hash;
+
+ hash = hugetlb_fault_mutex_hash(h, current->mm,
+ &pseudo_vma,
+ mapping, next, 0);
+ mutex_lock(&hugetlb_fault_mutex_table[hash]);

lock_page(page);
+ if (page->index >= end) {
+ unlock_page(page);
+ mutex_unlock(&hugetlb_fault_mutex_table[hash]);
+ next = end; /* we are done */
+ break;
+ }
+
+ /*
+ * If page is mapped, it was faulted in after being
+ * unmapped. Do nothing in this race case. In the
+ * normal case page is not mapped.
+ */
+ if (!page_mapped(page)) {
+ bool rsv_on_error = !PagePrivate(page);
+ /*
+ * We must free the huge page and remove
+ * from page cache (remove_huge_page) BEFORE
+ * removing the region/reserve map
+ * (hugetlb_unreserve_pages). In rare out
+ * of memory conditions, removal of the
+ * region/reserve map could fail. Before
+ * free'ing the page, note PagePrivate which
+ * is used in case of error.
+ */
+ remove_huge_page(page);
+ freed++;
+ if (!truncate_op) {
+ if (unlikely(hugetlb_unreserve_pages(
+ inode, next,
+ next + 1, 1)))
+ hugetlb_fix_reserve_counts(
+ inode, rsv_on_error);
+ }
+ }
+
if (page->index > next)
next = page->index;
+
++next;
- truncate_huge_page(page);
unlock_page(page);
- freed++;
+
+ mutex_unlock(&hugetlb_fault_mutex_table[hash]);
}
huge_pagevec_release(&pvec);
}
- BUG_ON(!lstart && mapping->nrpages);
- hugetlb_unreserve_pages(inode, start, freed);
+
+ if (truncate_op)
+ (void)hugetlb_unreserve_pages(inode, start, end, freed);
}

static void hugetlbfs_evict_inode(struct inode *inode)
{
struct resv_map *resv_map;

- truncate_hugepages(inode, 0);
+ remove_inode_hugepages(inode, 0, -1);
resv_map = (struct resv_map *)inode->i_mapping->private_data;
/* root inode doesn't have the resv_map, so we should check it */
if (resv_map)
@@ -422,7 +500,7 @@ static int hugetlb_vmtruncate(struct inode *inode, loff_t offset)
if (!RB_EMPTY_ROOT(&mapping->i_mmap))
hugetlb_vmdelete_list(&mapping->i_mmap, pgoff, 0);
i_mmap_unlock_write(mapping);
- truncate_hugepages(inode, offset);
+ remove_inode_hugepages(inode, offset, -1);
return 0;
}

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 33c6b32..e6ed378 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -80,11 +80,13 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
int hugetlb_reserve_pages(struct inode *inode, long from, long to,
struct vm_area_struct *vma,
vm_flags_t vm_flags);
-void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
+long hugetlb_unreserve_pages(struct inode *inode, long start, long end,
+ long freed);
int dequeue_hwpoisoned_huge_page(struct page *page);
bool isolate_huge_page(struct page *page, struct list_head *list);
void putback_active_hugepage(struct page *page);
void free_huge_page(struct page *page);
+void hugetlb_fix_reserve_counts(struct inode *inode, bool restore_reserve);
extern struct mutex *hugetlb_fault_mutex_table;
u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
struct vm_area_struct *vma,
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 9657cca..7cd4b67 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -461,6 +461,28 @@ retry:
}

/*
+ * A rare out of memory error was encountered which prevented removal of
+ * the reserve map region for a page. The huge page itself was free'ed
+ * and removed from the page cache. This routine will adjust the subpool
+ * usage count, and the global reserve count if needed. By incrementing
+ * these counts, the reserve map entry which could not be deleted will
+ * appear as a "reserved" entry instead of simply dangling with incorrect
+ * counts.
+ */
+void hugetlb_fix_reserve_counts(struct inode *inode, bool restore_reserve)
+{
+ struct hugepage_subpool *spool = subpool_inode(inode);
+ long rsv_adjust;
+
+ rsv_adjust = hugepage_subpool_get_pages(spool, 1);
+ if (restore_reserve && rsv_adjust) {
+ struct hstate *h = hstate_inode(inode);
+
+ hugetlb_acct_memory(h, 1);
+ }
+}
+
+/*
* Count and return the number of huge pages in the reserve map
* that intersect with the range [f, t).
*/
@@ -3767,7 +3789,8 @@ out_err:
return ret;
}

-void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
+long hugetlb_unreserve_pages(struct inode *inode, long start, long end,
+ long freed)
{
struct hstate *h = hstate_inode(inode);
struct resv_map *resv_map = inode_resv_map(inode);
@@ -3775,8 +3798,17 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
struct hugepage_subpool *spool = subpool_inode(inode);
long gbl_reserve;

- if (resv_map)
- chg = region_del(resv_map, offset, -1);
+ if (resv_map) {
+ chg = region_del(resv_map, start, end);
+ /*
+ * region_del() can fail in the rare case where a region
+ * must be split and another region descriptor can not be
+ * allocated. If end == -1, it will not fail.
+ */
+ if (chg < 0)
+ return chg;
+ }
+
spin_lock(&inode->i_lock);
inode->i_blocks -= (blocks_per_huge_page(h) * freed);
spin_unlock(&inode->i_lock);
@@ -3787,6 +3819,8 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
*/
gbl_reserve = hugepage_subpool_put_pages(spool, (chg - freed));
hugetlb_acct_memory(h, -gbl_reserve);
+
+ return 0;
}

#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[RFC v5 PATCH 5/9] mm/hugetlb: vma_has_reserves() needs to handle fallocate hole punch (no replies)

$
0
0
In vma_has_reserves(), the current assumption is that reserves are
always present for shared mappings. However, this will not be the
case with fallocate hole punch. When punching a hole, the present
page will be deleted as well as the region/reserve map entry (and
hence any reservation). vma_has_reserves is passed "chg" which
indicates whether or not a region/reserve map is present. Use
this to determine if reserves are actually present or were removed
via hole punch.

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
mm/hugetlb.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 7cd4b67..9d2859f 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -692,9 +692,19 @@ static int vma_has_reserves(struct vm_area_struct *vma, long chg)
return 0;
}

- /* Shared mappings always use reserves */
- if (vma->vm_flags & VM_MAYSHARE)
- return 1;
+ if (vma->vm_flags & VM_MAYSHARE) {
+ /*
+ * We know VM_NORESERVE is not set. Therefore, there SHOULD
+ * be a region map for all pages. The only situation where
+ * there is no region map is if a hole was punched via
+ * fallocate. In this case, there really are no reverves to
+ * use. This situation is indicated if chg != 0.
+ */
+ if (chg)
+ return 0;
+ else
+ return 1;
+ }

/*
* Only the process that called mmap() has reserves for
--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[RFC v5 PATCH 8/9] hugetlbfs: add hugetlbfs_fallocate() (no replies)

$
0
0
This is based on the shmem version, but it has diverged quite
a bit. We have no swap to worry about, nor the new file sealing.
Add synchronication via the fault mutex table to coordinate
page faults, fallocate allocation and fallocate hole punch.

What this allows us to do is move physical memory in and out of
a hugetlbfs file without having it mapped. This also gives us
the ability to support MADV_REMOVE since it is currently
implemented using fallocate(). MADV_REMOVE lets madvise() remove
pages from the middle of a hugetlbfs file, which wasn't possible
before.

hugetlbfs fallocate only operates on whole huge pages.

Based-on code-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
fs/hugetlbfs/inode.c | 158 +++++++++++++++++++++++++++++++++++++++++++++++-
include/linux/hugetlb.h | 3 +
mm/hugetlb.c | 2 +-
3 files changed, 161 insertions(+), 2 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 160d58d4..05b9d47 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -12,6 +12,7 @@
#include <linux/thread_info.h>
#include <asm/current.h>
#include <linux/sched.h> /* remove ASAP */
+#include <linux/falloc.h>
#include <linux/fs.h>
#include <linux/mount.h>
#include <linux/file.h>
@@ -504,6 +505,160 @@ static int hugetlb_vmtruncate(struct inode *inode, loff_t offset)
return 0;
}

+static long hugetlbfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
+{
+ struct hstate *h = hstate_inode(inode);
+ loff_t hpage_size = huge_page_size(h);
+ loff_t hole_start, hole_end;
+
+ /*
+ * For hole punch round up the beginning offset of the hole and
+ * round down the end.
+ */
+ hole_start = round_up(offset, hpage_size);
+ hole_end = round_down(offset + len, hpage_size);
+
+ if (hole_end > hole_start) {
+ struct address_space *mapping = inode->i_mapping;
+
+ mutex_lock(&inode->i_mutex);
+ i_mmap_lock_write(mapping);
+ if (!RB_EMPTY_ROOT(&mapping->i_mmap))
+ hugetlb_vmdelete_list(&mapping->i_mmap,
+ hole_start >> PAGE_SHIFT,
+ hole_end >> PAGE_SHIFT);
+ i_mmap_unlock_write(mapping);
+ remove_inode_hugepages(inode, hole_start, hole_end);
+ mutex_unlock(&inode->i_mutex);
+ }
+
+ return 0;
+}
+
+static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,
+ loff_t len)
+{
+ struct inode *inode = file_inode(file);
+ struct address_space *mapping = inode->i_mapping;
+ struct hstate *h = hstate_inode(inode);
+ struct vm_area_struct pseudo_vma;
+ struct mm_struct *mm = current->mm;
+ loff_t hpage_size = huge_page_size(h);
+ unsigned long hpage_shift = huge_page_shift(h);
+ pgoff_t start, index, end;
+ int error;
+ u32 hash;
+
+ if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
+ return -EOPNOTSUPP;
+
+ if (mode & FALLOC_FL_PUNCH_HOLE)
+ return hugetlbfs_punch_hole(inode, offset, len);
+
+ /*
+ * Default preallocate case.
+ * For this range, start is rounded down and end is rounded up
+ * as well as being converted to page offsets.
+ */
+ start = offset >> hpage_shift;
+ end = (offset + len + hpage_size - 1) >> hpage_shift;
+
+ mutex_lock(&inode->i_mutex);
+
+ /* We need to check rlimit even when FALLOC_FL_KEEP_SIZE */
+ error = inode_newsize_ok(inode, offset + len);
+ if (error)
+ goto out;
+
+ /*
+ * Initialize a pseudo vma that just contains the policy used
+ * when allocating the huge pages. The actual policy field
+ * (vm_policy) is determined based on the index in the loop below.
+ */
+ memset(&pseudo_vma, 0, sizeof(struct vm_area_struct));
+ pseudo_vma.vm_flags = (VM_HUGETLB | VM_MAYSHARE | VM_SHARED);
+ pseudo_vma.vm_file = file;
+
+ for (index = start; index < end; index++) {
+ /*
+ * This is supposed to be the vaddr where the page is being
+ * faulted in, but we have no vaddr here.
+ */
+ struct page *page;
+ unsigned long addr;
+ int avoid_reserve = 0;
+
+ cond_resched();
+
+ /*
+ * fallocate(2) manpage permits EINTR; we may have been
+ * interrupted because we are using up too much memory.
+ */
+ if (signal_pending(current)) {
+ error = -EINTR;
+ break;
+ }
+
+ /* Get policy based on index */
+ pseudo_vma.vm_policy =
+ mpol_shared_policy_lookup(&HUGETLBFS_I(inode)->policy,
+ index);
+
+ /* addr is the offset within the file (zero based) */
+ addr = index * hpage_size;
+
+ /* mutex taken here, fault path and hole punch */
+ hash = hugetlb_fault_mutex_hash(h, mm, &pseudo_vma, mapping,
+ index, addr);
+ mutex_lock(&hugetlb_fault_mutex_table[hash]);
+
+ /* See if already present in mapping to avoid alloc/free */
+ page = find_get_page(mapping, index);
+ if (page) {
+ put_page(page);
+ mutex_unlock(&hugetlb_fault_mutex_table[hash]);
+ mpol_cond_put(pseudo_vma.vm_policy);
+ continue;
+ }
+
+ /* Allocate page and add to page cache */
+ page = alloc_huge_page(&pseudo_vma, addr, avoid_reserve);
+ mpol_cond_put(pseudo_vma.vm_policy);
+ if (IS_ERR(page)) {
+ mutex_unlock(&hugetlb_fault_mutex_table[hash]);
+ error = PTR_ERR(page);
+ goto out;
+ }
+ clear_huge_page(page, addr, pages_per_huge_page(h));
+ __SetPageUptodate(page);
+ error = huge_add_to_page_cache(page, mapping, index);
+ if (unlikely(error)) {
+ put_page(page);
+ mutex_unlock(&hugetlb_fault_mutex_table[hash]);
+ goto out;
+ }
+
+ mutex_unlock(&hugetlb_fault_mutex_table[hash]);
+
+ /*
+ * page_put due to reference from alloc_huge_page()
+ * unlock_page because locked by add_to_page_cache()
+ */
+ put_page(page);
+ unlock_page(page);
+ }
+
+ if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size)
+ i_size_write(inode, offset + len);
+ inode->i_ctime = CURRENT_TIME;
+ spin_lock(&inode->i_lock);
+ inode->i_private = NULL;
+ spin_unlock(&inode->i_lock);
+out:
+ mutex_unlock(&inode->i_mutex);
+ return error;
+}
+
static int hugetlbfs_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
@@ -815,7 +970,8 @@ const struct file_operations hugetlbfs_file_operations = {
.mmap = hugetlbfs_file_mmap,
.fsync = noop_fsync,
.get_unmapped_area = hugetlb_get_unmapped_area,
- .llseek = default_llseek,
+ .llseek = default_llseek,
+ .fallocate = hugetlbfs_fallocate,
};

static const struct inode_operations hugetlbfs_dir_inode_operations = {
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 71a24a7..ad7da43 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -327,6 +327,8 @@ struct huge_bootmem_page {
#endif
};

+struct page *alloc_huge_page(struct vm_area_struct *vma,
+ unsigned long addr, int avoid_reserve);
struct page *alloc_huge_page_node(struct hstate *h, int nid);
struct page *alloc_huge_page_noerr(struct vm_area_struct *vma,
unsigned long addr, int avoid_reserve);
@@ -481,6 +483,7 @@ static inline bool hugepages_supported(void)

#else /* CONFIG_HUGETLB_PAGE */
struct hstate {};
+#define alloc_huge_page(v, a, r) NULL
#define alloc_huge_page_node(h, nid) NULL
#define alloc_huge_page_noerr(v, a, r) NULL
#define alloc_bootmem_huge_page(h) NULL
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 77712c8..d5c5bbd 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1594,7 +1594,7 @@ static long vma_commit_reservation(struct hstate *h,
return __vma_reservation_common(h, vma, addr, true);
}

-static struct page *alloc_huge_page(struct vm_area_struct *vma,
+struct page *alloc_huge_page(struct vm_area_struct *vma,
unsigned long addr, int avoid_reserve)
{
struct hugepage_subpool *spool = subpool_vma(vma);
--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[RFC v5 PATCH 0/9] hugetlbfs: add fallocate support (4 replies)

$
0
0
No major changes since last RFC. Externalized existing hugetlb
fault mutex code. Added more comments to alloc_huge_page reservation
handling as I could not come up with a good way to encapsulate.
libhugetlbfs test cases and man page updates will be included with
a later request for patch inclusion.

hugetlbfs is used today by applications that want a high degree of
control over huge page usage. Often, large hugetlbfs files are used
to map a large number huge pages into the application processes.
The applications know when page ranges within these large files will
no longer be used, and ideally would like to release them back to
the subpool or global pools for other uses. The fallocate() system
call provides an interface for preallocation and hole punching within
files. This patch set adds fallocate functionality to hugetlbfs.

RFC v5:
Simply made existing hugetlb fault mutex hash routine available for
use by fallocate.
Unable to come up with good reservation encapsulation routines for
alloc_huge_page, so attempted to comment better.
RFC v4:
Removed alloc_huge_page/hugetlb_reserve_pages race patches as already
in mmotm
Moved hugetlb_fix_reserve_counts in series as suggested by Naoya Horiguchi
Inline'ed hugetlb_fault_mutex routines as suggested by Davidlohr Bueso and
existing code changed to use new interfaces as suggested by Naoya
fallocate preallocation code cleaned up and made simpler
Modified alloc_huge_page to handle special case where allocation is
for a hole punched area with spool reserves
RFC v3:
Folded in patch for alloc_huge_page/hugetlb_reserve_pages race
in current code
fallocate allocation and hole punch is synchronized with page
faults via existing mutex table
hole punch uses existing hugetlb_vmtruncate_list instead of more
generic unmap_mapping_range for unmapping
Error handling for the case when region_del() fails
RFC v2:
Addressed alignment and error handling issues noticed by Hillf Danton
New region_del() routine for region tracking/resv_map of ranges
Fixed several issues found during more extensive testing
Error handling in region_del() when kmalloc() fails stills needs
to be addressed
madvise remove support remains

Mike Kravetz (9):
mm/hugetlb: add region_del() to delete a specific range of entries
mm/hugetlb: expose hugetlb fault mutex for use by fallocate
hugetlbfs: hugetlb_vmtruncate_list() needs to take a range to delete
hugetlbfs: truncate_hugepages() takes a range of pages
mm/hugetlb: vma_has_reserves() needs to handle fallocate hole punch
mm/hugetlb: alloc_huge_page handle areas hole punched by fallocate
hugetlbfs: New huge_add_to_page_cache helper routine
hugetlbfs: add hugetlbfs_fallocate()
mm: madvise allow remove operation for hugetlbfs

fs/hugetlbfs/inode.c | 281 ++++++++++++++++++++++++++++++++++++++++++++----
include/linux/hugetlb.h | 14 ++-
mm/hugetlb.c | 245 +++++++++++++++++++++++++++++------------
mm/madvise.c | 2 +-
4 files changed, 456 insertions(+), 86 deletions(-)

--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH] block: partition-generic: Catch alloc_part_info failure (no replies)

$
0
0
Make add_partition() return proper ERR_PTR if alloc_part_info() fails.
This ensures the caller of add_partition() can catch the error by IS_ERROR
macro.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
block/partition-generic.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/partition-generic.c b/block/partition-generic.c
index 0d9e5f9..94de205 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -309,8 +309,10 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,

if (info) {
struct partition_meta_info *pinfo = alloc_part_info(disk);
- if (!pinfo)
+ if (!pinfo) {
+ err = -ENOMEM;
goto out_free_stats;
+ }
memcpy(pinfo, info, sizeof(*info));
p->info = pinfo;
}
--
2.1.0



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[GIT PULL] HSI changes for 4.2 (no replies)

$
0
0
Hi Linus,

The following changes since commit b953c0d234bc72e8489d3bf51a276c5c4ec85345:

Linux 4.1 (2015-06-21 22:05:43 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi.git tags/hsi-for-4.2

for you to fetch changes up to f451e76f896922137f8316cb071ae2cab78091ad:

HSI: nokia-modem: use flags argument of devm_gpiod_get to set direction (2015-06-23 02:40:03 +0200)

----------------------------------------------------------------
HSI changes for the v4.2 series

* misc. fixes

----------------------------------------------------------------
Sebastian Reichel (2):
HSI: cmt_speech: fix timestamp interface
HSI: nokia-modem: Reduce missing driver message to debug level

Uwe Kleine-König (1):
HSI: nokia-modem: use flags argument of devm_gpiod_get to set direction

drivers/hsi/clients/cmt_speech.c | 9 +++++++--
drivers/hsi/clients/nokia-modem.c | 11 ++++-------
include/uapi/linux/hsi/cs-protocol.h | 16 +++++++++++-----
3 files changed, 22 insertions(+), 14 deletions(-)

-- Sebastian

[GIT PULL] power supply changes for 4.2 (no replies)

$
0
0
Hi Linus,

The following changes since commit e26081808edadfd257c6c9d81014e3b25e9a6118:

Linux 4.1-rc4 (2015-05-18 10:13:47 -0700)

are available in the git repository at:

git://git.infradead.org/battery-2.6.git tags/for-4.2

for you to fetch changes up to 43df61051ab9af985ec439ee9be9c299e7de34e8:

power_supply: Correct kerneldoc copy paste errors (2015-06-19 14:21:01 +0200)

----------------------------------------------------------------
power supply and reset changes for the v4.2 series

* New charger drivers: BQ24257, BQ25890, AXP288, RT9455
* MAX17042 battery: add health & temperature support
* BQ2415x charger: add ACPI support
* misc. fixes and cleanups

----------------------------------------------------------------
Anda-Maria Nicolae (7):
power_supply: bq2415x_charger: Fix coding style issues
power_supply: bq2415x_charger: Add ACPI support
of: Add vendor prefix for Richtek Technology Corporation
Documentation: devicetree: Add Richtek RT9455 bindings
power_supply: Add support for Richtek RT9455 battery charger
power_supply: rt9455_charger: Check if CONFIG_USB_PHY is enabled
power_supply: rt9455_charger: Fix error reported by static analysis tool

Bjorn Andersson (1):
power_supply: Correct kerneldoc copy paste errors

Frans Klaver (1):
sbs-battery: add option to always register battery

Hans de Goede (1):
power: Add devm_power_supply_get_by_phandle() helper function

Heiko Stübner (1):
power: reset: gpio-restart: increase priority slightly

Krzysztof Kozlowski (8):
power_supply: Fix NULL pointer dereference during bq27x00_battery probe
power_supply: Fix possible NULL pointer dereference on early uevent
power: axp288_fuel_gauge: Constify platform_device_id
power: at91-reset: Constify platform_device_id
power_supply: Use wrappers to avoid races when registering power supply
power_supply: charger-manager: Add parent for power supply
power_supply: sysfs: Bring back write to writeable properties
power_supply: max17042: Add OF support for setting thresholds

Laurentiu Palcu (4):
power_supply: Add TI BQ24257 charger driver
Documentation: devicetree: Add TI BQ25890 bindings
power_supply: Add support for TI BQ25890 charger chip
power_supply: bq25890: make chip_id int

Ramakrishna Pallala (2):
power: max17042_battery: add HEALTH and TEMP_* properties support
power: axp288_charger: axp288 charger driver

Takeshi Yoshimura (2):
power_supply: 88pm860x_charger: Do not call free_irq() twice
wm831x_power: Fix off-by-one at free_irq()

Thomas Elste (1):
power: bq24190_charger: Change first_time flag reset condition

Uwe Kleine-König (4):
power: reset: gpio-poweroff: let devm_gpiod_get set direction of gpio
power: reset: ltc2952: use _optional variant of devm_gpiod_get
power_supply: bq25890: use flags argument of devm_gpiod_get
power_supply: bq24257: use flags argument of devm_gpiod_get

Documentation/devicetree/bindings/power/bq24257.txt | 21 ++
Documentation/devicetree/bindings/power/bq25890.txt | 46 +++
Documentation/devicetree/bindings/power/rt9455_charger.txt | 48 +++
Documentation/devicetree/bindings/power_supply/max17042_battery.txt | 13 +
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
drivers/power/88pm860x_charger.c | 1 -
drivers/power/Kconfig | 28 ++
drivers/power/Makefile | 4 +
drivers/power/axp288_charger.c | 941 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/power/axp288_fuel_gauge.c | 2 +-
drivers/power/bq2415x_charger.c | 94 ++++--
drivers/power/bq24190_charger.c | 11 +-
drivers/power/bq24257_charger.c | 858 ++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/power/bq25890_charger.c | 994 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/power/charger-manager.c | 3 +-
drivers/power/max17042_battery.c | 199 +++++++++++-
drivers/power/power_supply_core.c | 106 ++++++-
drivers/power/power_supply_leds.c | 4 +-
drivers/power/power_supply_sysfs.c | 4 +-
drivers/power/reset/at91-reset.c | 2 +-
drivers/power/reset/gpio-poweroff.c | 25 +-
drivers/power/reset/gpio-restart.c | 2 +-
drivers/power/reset/ltc2952-poweroff.c | 7 +-
drivers/power/rt9455_charger.c | 1752 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/power/sbs-battery.c | 21 +-
drivers/power/wm831x_power.c | 1 +
include/linux/mfd/axp20x.h | 7 +
include/linux/power/max17042_battery.h | 4 +
include/linux/power_supply.h | 11 +
29 files changed, 5122 insertions(+), 88 deletions(-)
create mode 100644 Documentation/devicetree/bindings/power/bq24257.txt
create mode 100644 Documentation/devicetree/bindings/power/bq25890.txt
create mode 100644 Documentation/devicetree/bindings/power/rt9455_charger.txt
create mode 100644 drivers/power/axp288_charger.c
create mode 100644 drivers/power/bq24257_charger.c
create mode 100644 drivers/power/bq25890_charger.c
create mode 100644 drivers/power/rt9455_charger.c

-- Sebastian

linux-next: build failure after merge of the drm-exynos tree (1 reply)

$
0
0
Hi Inki,

After merging the drm-exynos tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/media/i2c/adv7604.o: In function `of_graph_get_endpoint_by_regs':
adv7604.c:(.text+0x586c): multiple definition of `of_graph_get_endpoint_by_regs'
drivers/media/i2c/adv7343.o:adv7343.c:(.text+0xa13): first defined here
drivers/media/platform/soc_camera/atmel-isi.o: In function `of_graph_get_endpoint_by_regs':
atmel-isi.c:(.text+0x1ec9): multiple definition of `of_graph_get_endpoint_by_regs'
drivers/media/platform/soc_camera/soc_camera.o:soc_camera.c:(.text+0x2ce3): first defined here
drivers/media/platform/soc_camera/rcar_vin.o: In function `of_graph_get_endpoint_by_regs':
rcar_vin.c:(.text+0x307c): multiple definition of `of_graph_get_endpoint_by_regs'
drivers/media/platform/soc_camera/soc_camera.o:soc_camera.c:(.text+0x2ce3): first defined here

Caused by commit:

a0f7001c18ca ("of: add helper for getting endpoint node of specific identifiers")

I have used the drm-exynos from next-20150622 for today.

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au

[PATCH] USB: atm: cxacru: fix blank line after declaration (no replies)

$
0
0
Fixed a coding style issue. Adds blank lines after declarations.

Signed-off-by: Aaron Raimist <aaronraimist@riseup.net>
---
drivers/usb/atm/cxacru.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 813d4d3..1173f9c 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -270,6 +270,7 @@ static ssize_t cxacru_sysfs_showattr_dB(s16 value, char *buf)
static ssize_t cxacru_sysfs_showattr_bool(u32 value, char *buf)
{
static char *str[] = { "no", "yes" };
+
if (unlikely(value >= ARRAY_SIZE(str)))
return snprintf(buf, PAGE_SIZE, "%u\n", value);
return snprintf(buf, PAGE_SIZE, "%s\n", str[value]);
@@ -278,6 +279,7 @@ static ssize_t cxacru_sysfs_showattr_bool(u32 value, char *buf)
static ssize_t cxacru_sysfs_showattr_LINK(u32 value, char *buf)
{
static char *str[] = { NULL, "not connected", "connected", "lost" };
+
if (unlikely(value >= ARRAY_SIZE(str) || str[value] == NULL))
return snprintf(buf, PAGE_SIZE, "%u\n", value);
return snprintf(buf, PAGE_SIZE, "%s\n", str[value]);
@@ -702,6 +704,7 @@ static int cxacru_cm_get_array(struct cxacru_data *instance, enum cxacru_cm_requ
len = ret / 4;
for (offb = 0; offb < len; ) {
int l = le32_to_cpu(buf[offb++]);
+
if (l < 0 || l > stride || l > (len - offb) / 2) {
if (printk_ratelimit())
usb_err(instance->usbatm, "invalid data length from cm %#x: %d\n",
@@ -732,6 +735,7 @@ cleanup:
static int cxacru_card_status(struct cxacru_data *instance)
{
int ret = cxacru_cm(instance, CM_REQUEST_CARD_GET_STATUS, NULL, 0, NULL, 0);
+
if (ret < 0) { /* firmware not loaded */
usb_dbg(instance->usbatm, "cxacru_adsl_start: CARD_GET_STATUS returned %d\n", ret);
return ret;
@@ -945,6 +949,7 @@ static int cxacru_fw(struct usb_device *usb_dev, enum cxacru_fw_request fw,
offb = offd = 0;
do {
int l = min_t(int, stride, size - offd);
+
buf[offb++] = fw;
buf[offb++] = l;
buf[offb++] = code1;
@@ -1091,8 +1096,8 @@ static int cxacru_heavy_init(struct usbatm_data *usbatm_instance,
{
const struct firmware *fw, *bp;
struct cxacru_data *instance = usbatm_instance->driver_data;
-
int ret = cxacru_find_firmware(instance, "fw", &fw);
+
if (ret) {
usb_warn(usbatm_instance, "firmware (cxacru-fw.bin) unavailable (system misconfigured?)\n");
return ret;
--
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
Viewing all 24115 articles
Browse latest View live




Latest Images