Commit graph

495002 commits

Author SHA1 Message Date
Arnd Bergmann
7ebdfaa52d Fixes for 3.19
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJUoD2fAAoJEOa/DcumaUyE3XwQAKf2Jo0m0YyFYSNkN9tu1JAX
 jpqhI/wTXwpvQCIGt1pexLc21/mpPGlmXMvppf+Qc/NiM6OWT3b3lkTfoVTSNrRW
 k841CuBIjFe+03TF3L7L836eGiccjMtQIMDKG8D9ndK8ZV5gGRpJCtOp1oPfrwAQ
 uZmidH4NzyURH1v8CrfIFKksNwDAdb0KKCWC0xibpR5TrhPyJVo3Z60umjch7U8U
 476/5JRU6w8IMzEfQU9/yamxEQGpCTxOsoqTvpsG5nqC45YFh8SCHdTi6v8E6jrY
 kvBh2AwgBsH5oi1VQ4JotsageMgA4h5k+jsMIfm1wqWgTWNtMuDU8mSHvRFN8nRY
 6pi9G5KYLPZnGBNHUB+7g6MqPDBFHKh/xQw2lyWtGnVwbavXVE/gCeo3mhwmmyZR
 2hhCiD1knExoHVueb+akDzNqnaTkjQjr1rXY4leq2PoLuLYlSDKor6PiAJ/tHq4r
 LhYCzVpTFmQuRC5alczrD0aHCb927IHpimKax2TuzGO/YiuefdgKo/StNAWwANYJ
 yGasVwRp5ew/sWhCgbykl+5wYnp3xoy+BMFzxyDiX4h4aeTzXfa4ii1QzEKmVbyh
 CyfVIlA30Lz4wf9zK7zUyV6kYu9d11Co5uctwulXSWsX/pKVYbmxuoHo9FSnZ36c
 KrFz6J6sYzF87FWXRh4H
 =5CnD
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-fixes-3.19' of git://git.infradead.org/linux-mvebu into fixes

Pull "Fixes for 3.19" from Andrew Lunn:

Jason is taking a back seat this cycle and i'm doing all the patch
wrangling for mvebu.

* tag 'mvebu-fixes-3.19' of git://git.infradead.org/linux-mvebu:
  ARM: mvebu: Fix pinctrl configuration for Armada 370 DB

Also update to Linux 3.19-rc1, which this was based on.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2014-12-30 15:27:20 +01:00
Paul Moore
fcf22d8267 audit: create private file name copies when auditing inodes
Unfortunately, while commit 4a928436 ("audit: correctly record file
names with different path name types") fixed a problem where we were
not recording filenames, it created a new problem by attempting to use
these file names after they had been freed.  This patch resolves the
issue by creating a copy of the filename which the audit subsystem
frees after it is done with the string.

At some point it would be nice to resolve this issue with refcounts,
or something similar, instead of having to allocate/copy strings, but
that is almost surely beyond the scope of a -rcX patch so we'll defer
that for later.  On the plus side, only audit users should be impacted
by the string copying.

Reported-by: Toralf Foerster <toralf.foerster@gmx.de>
Signed-off-by: Paul Moore <pmoore@redhat.com>
2014-12-30 09:26:21 -05:00
Anil Chintalapati (achintal)
efc7a28838 fnic: IOMMU Fault occurs when IO and abort IO is out of order
When I/O is aborted by mid-layer, fnic FW will complete the I/O before
completing the abort task. In some cases abort request is completed before
the I/O, which could lead to inconsistent driver and firmware states.
In this case firmware reset would clear the inconsistent state.

Signed-off-by: Anil Chintalapati <achintal@cisco.com>
Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com>
Signed-off-by: Hiral Shah <hishah@cisco.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-12-30 13:31:45 +01:00
Martin K. Petersen
e461338b6c sd: tweak discard heuristics to work around QEMU SCSI issue
7985090aa0 changed the discard heuristics to give preference to the
WRITE SAME commands that (unlike UNMAP) guarantee deterministic results.

Ming Lei discovered that QEMU SCSI's WRITE SAME implementation
internally relied on limits that were only communicated for the UNMAP
case. And therefore discard commands backed by WRITE SAME would fail.

Tweak the heuristics so we still pick UNMAP in the LBPRZ=0 case and only
prefer the WRITE SAME variants if the device has the LBPRZ flag set.

Reported-by: Ming Lei <ming.lei@canonical.com>
Tested-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-12-30 13:30:38 +01:00
Doug Anderson
f2dd028c26 pinctrl: rockchip: Fix enable/disable/mask/unmask
The Rockchip pinctrl driver was only implementing the "mask" and
"unmask" operations though the hardware actually has two distinct
things: enable/disable and mask/unmask.  It was implementing the
"mask" operations as a hardware enable/disable and always leaving all
interrupts unmasked.

I believe that the old system had some downsides, specifically:
- (Untested) if an interrupt went off while interrupts were "masked"
  it would be lost.  Now it will be kept track of.
- If someone wanted to change an interrupt back into a GPIO (is such a
  thing sensible?) by calling irq_disable() it wouldn't actually take
  effect.  That's because Linux does some extra optimizations when
  there's no true "disable" function: it does a lazy mask.

Let's actually implement enable/disable/mask/unmask properly.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-12-30 13:17:27 +01:00
Doug Anderson
68bda47c57 pinctrl: rockchip: Handle wakeup pins
The rockchip pinctrl driver was using irq_gc_set_wake() as its
implementation of irq_set_wake() but was totally ignoring everything
that irq_gc_set_wake() did (which is to upkeep gc->wake_active).

Let's fix that by setting gc->wake_active as GPIO_INTEN at suspend
time and restoring GPIO_INTEN at resume time.

NOTE a few quirks when thinking about this patch:
- Rockchip pinctrl hardware supports both "disable/enable" and
  "mask/unmask".  Right now we only use "disable/enable" and present
  those to Linux as "mask/unmask".  This should be OK because
  enable/disable is optional and Linux will implement it in terms of
  mask/unmask.  At the moment we always tell hardware all interrupts
  are unmasked (the boot default).
- At suspend time Linux tries to call "disable" on all interrupts and
  also enables wakeup on all wakeup interrupts.  One would think that
  since "disable" is implemented as "mask" when "disable" isn't
  provided and that since we were ignoring gc->wake_active that
  nothing would have woken us up.  That's not the case since Linux
  "optimizes" things and just leaves interrutps unmasked, assuming it
  could mask them later when they go off.  That meant that at suspend
  time all interrupts were actually being left enabled.

With this patch random non-wakeup interrupts no longer wake the system
up.  Wakeup interrupts still wake the system up.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-12-30 13:17:27 +01:00
Tomi Valkeinen
a32442d4f8 OMAPDSS: SDI: fix output port_num
After the commit ef691ff48b (OMAPDSS: DT: Get source endpoint by
matching reg-id) we look for the SDI output using the port number.
However, the SDI driver doesn't set the port number, which causes the
SDI display to not initialize.

Fix this by setting the SDI port number to 1. We use a hardcoded value,
as SDI was used only on OMAP3 and it's always port number 1 there.

Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-12-30 11:18:30 +02:00
Tomi Valkeinen
30ea9c5218 video/fbdev: fix defio's fsync
fb_deferred_io_fsync() returns the value of schedule_delayed_work() as
an error code, but schedule_delayed_work() does not return an error. It
returns true/false depending on whether the work was already queued.

Fix this by ignoring the return value of schedule_delayed_work().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: stable@vger.kernel.org
2014-12-30 11:18:30 +02:00
Linus Torvalds
5faa0154fe Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fixes from Steve French:
 "A set of three minor cifs fixes"

* 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: make new inode cache when file type is different
  Fix signed/unsigned pointer warning
  Convert MessageID in smb2_hdr to LE
2014-12-29 21:09:57 -08:00
Linus Torvalds
b9d4a35f0a Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull UDF & isofs fixes from Jan Kara:
 "A couple of UDF fixes of handling of corrupted media and one iso9660
  fix of the same"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  udf: Reduce repeated dereferences
  udf: Check component length before reading it
  udf: Check path length when reading symlink
  udf: Verify symlink size before loading it
  udf: Verify i_size when loading inode
  isofs: Fix unchecked printing of ER records
2014-12-29 20:43:10 -08:00
Linus Torvalds
df90dcd100 Power management and ACPI material for 3.19-rc3
- Fix for a potential NULL pointer dereference in the cpufreq
    core due to an initialization race condition (Ethan Zhao).
 
  - Fixes for abuse of the OPP (Operating Performance Points) API
    related to RCU and other minor issues in the OPP library and
    the cpufreq-dt driver (Dmitry Torokhov).
 
  - cpuidle governors cleanup making them measure idle duration in
    a better way without using the CPUIDLE_FLAG_TIME_INVALID flag
    which allows that flag to be dropped from the ACPI cpuidle driver
    and from the core too (Len Brown).
 
  - New ACPI backlight blacklist entries for Samsung machines
    without a working native backlight interface that need to
    use the ACPI backlight instead (Aaron Lu).
 
  - New CPU IDs of future Intel Xeon CPUs for the Intel RAPL power
    capping driver (Jacob Pan).
 
  - Generic power domains framework modification to export the
    of_genpd_get_from_provider() function to modular drivers that
    will allow future driver modifications to be based on the mainline
    (Amit Daniel Kachhap).
 
  - Two fixes for the cpupower tool (Michal Privoznik, Prarit Bhargava).
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJUoccdAAoJEILEb/54YlRxP9IQAJIAz5RSRQpv50nq+oMLER/S
 G4FrVRgELYNTCvujlsgTydSa2IP/G4bPfa7zMquIs69j0L4/65z5aDAMNfHMiNQy
 6ZC1Vey7mS+A91pdhhkI3MZ9GIu/HIBnXdhhzQaVOTFG+X8Ro+9WZva6fzgqhw3p
 hhtjdNkiURoul+uGL0/tk/Ia228gn0Evw+DiPxH+6TyuR2Nzuolc1mKBqE4n948l
 e99U3SPqT2/fH4otYKXKgz60NldRu9EjBtjSanLRlSEHw8NXI/fbaQJ/YUPL8qnT
 gfvm694nhU7lERG4jhKMIdx2ubeMpjyRLbgDu+8XmAyMUik9nHfFG5wC04V6vSP5
 0JgJyFfXT0HjcvHf1EyFZ5zvqy5FrRUV81E0MXz1Yi14E/MiBvUyNz+ThTQ+7VYT
 MIdFcqo7hSOjXFjMU6orkxGWqJQpKz2I4BBuQikvCnHQxkevscRS8G0SpxLp6nyD
 dFBQBZgztZc0FbqlQINszPOa7FXwL042nk9+YobEyE9i3v7lC8zMwNtAav76LSTd
 Z0/OivQziIwyNxIjrNkTXGnqhxXwKGMQ/JOywaswos7MdnCS2B9sRgn9zCZZ0JSs
 Z59gAli3A0/qv7YiWy8jxEkL8uqeNu1PCmiwlVuEl15/p+C9w+t4iFJi9DiGFXiF
 sJOZmy1GcmQCGr9m+qA0
 =CYBE
 -----END PGP SIGNATURE-----

Merge tag 'pm+acpi-3.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management and ACPI material from Rafael J Wysocki:
 "These are fixes (operating performance points library, cpufreq-dt
  driver, cpufreq core, ACPI backlight, cpupower tool), cleanups
  (cpuidle), new processor IDs for the RAPL (Running Average Power
  Limit) power capping driver, and a modification of the generic power
  domains framework allowing modular drivers to call one of its helper
  functions.

  Specifics:

   - Fix for a potential NULL pointer dereference in the cpufreq core
     due to an initialization race condition (Ethan Zhao).

   - Fixes for abuse of the OPP (Operating Performance Points) API
     related to RCU and other minor issues in the OPP library and the
     cpufreq-dt driver (Dmitry Torokhov).

   - cpuidle governors cleanup making them measure idle duration in a
     better way without using the CPUIDLE_FLAG_TIME_INVALID flag which
     allows that flag to be dropped from the ACPI cpuidle driver and
     from the core too (Len Brown).

   - New ACPI backlight blacklist entries for Samsung machines without a
     working native backlight interface that need to use the ACPI
     backlight instead (Aaron Lu).

   - New CPU IDs of future Intel Xeon CPUs for the Intel RAPL power
     capping driver (Jacob Pan).

   - Generic power domains framework modification to export the
     of_genpd_get_from_provider() function to modular drivers that will
     allow future driver modifications to be based on the mainline (Amit
     Daniel Kachhap).

   - Two fixes for the cpupower tool (Michal Privoznik, Prarit
     Bhargava)"

* tag 'pm+acpi-3.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / video: Add some Samsung models to disable_native_backlight list
  tools / cpupower: Fix no idle state information return value
  tools / cpupower: Correctly detect if running as root
  cpufreq: fix a NULL pointer dereference in __cpufreq_governor()
  cpufreq-dt: defer probing if OPP table is not ready
  PM / OPP: take RCU lock in dev_pm_opp_get_opp_count
  PM / OPP: fix warning in of_free_opp_table()
  PM / OPP: add some lockdep annotations
  powercap / RAPL: add IDs for future Xeon CPUs
  PM / Domains: Export of_genpd_get_from_provider function
  cpuidle / ACPI: remove unused CPUIDLE_FLAG_TIME_INVALID
  cpuidle: ladder: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID
  cpuidle: menu: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID
2014-12-29 18:50:02 -08:00
David S. Miller
dc97a1a947 genetlink: A genl_bind() to an out-of-range multicast group should not WARN().
Users can request to bind to arbitrary multicast groups, so warning
when the requested group number is out of range is not appropriate.

And with the warning removed, and the 'err' variable properly given
an initial value, we can remove 'found' altogether.

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-29 16:31:49 -05:00
Linus Torvalds
346eef2fc0 spi: Fixes for v3.19
A few driver specific fixes here, the DMA burst size increase in the
 spfi driver is a fix to make the hardware happier in some situations.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUoX+AAAoJECTWi3JdVIfQnCUH+wezEX6JeLIW86WiCjHB5hE2
 oEhkp7MS/0qSasgguEQ/kDaov1p8hn3nnpY6t5H695L/MWN8sALBkOymbOhUyNGB
 hWOxpIJ31vdy4hauo/GvEQe9nsR8/AHeM3+e85qQWQKrUZgkDsmZckDy19WlFbdN
 sUuqmfzyAB2xImTmtkAhe2nia3XOoHsvwfZcKXQEyEl4HOQkazD/iC4JNOkP9l98
 NA3U9bFvL1PLD9r0E3A3Ly0LHW90f+DB+Ssuxxdh1CcCTLSxQc0VMnBbCslM0A13
 aiwINf+wFDnh/kx4aAlbmVnOq4JECOwURWmfxqldNmvbc8zuDx8xLdUhQ40CPlk=
 =xJxL
 -----END PGP SIGNATURE-----

Merge tag 'spi-v3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A few driver specific fixes here, the DMA burst size increase in the
  spfi driver is a fix to make the hardware happier in some situations"

* tag 'spi-v3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: img-spfi: Increase DMA burst size
  spi: img-spfi: Enable controller before starting TX DMA
  spi: sh-msiof: Add runtime PM lock in initializing
2014-12-29 13:30:50 -08:00
Linus Torvalds
034496f40d regulator: Fix for v3.19
One fix here, a fix for the voltage mapping on one of the s2mps11
 regulators which broke systems using it including apparently the Gear 2
 smartwatches.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUoX7vAAoJECTWi3JdVIfQtcEH/junzpSCOwIrI8NG9/ZF0xt5
 rLB1SlDxtiSPv6eFA+KXYYmO8VNjZ1g+NN1PoeSNgAK08YzG9IUHIqI1L1iDe2qG
 2vpPY++Rg5eWPY79Sa9oy/+2zmFmUh3t+Shv7p3WC1Q8GES4bD6dm/QVxykh16nW
 nDGYZN981THIHS9xPKsmvCbHMp6PknDZkqO9Umzflt7cYgzgFP8xTaTlb4vkwTza
 3ZjGnEMIe1ldkLGFEJmdsSMro07hKzVYk8e3auOK+gAMpO+QjpY8WxuarmpQBPLx
 GddKhfkox5HNUxm9jRp0jivgi8YXD4a1lXzwXpxSihax1Q/Q/v00yoJ6selRQXg=
 =/mpj
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull one regulator fix from Mark Brown:
 "One fix here, a fix for the voltage mapping on one of the s2mps11
  regulators which broke systems using it including apparently the
  Gear 2 smartwatches"

* tag 'regulator-v3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: s2mps11: Fix dw_mmc failure on Gear 2
2014-12-29 13:24:38 -08:00
Linus Torvalds
5e6c2c97c5 MMC core:
- Fix selection of buswidth for mmc hosts supporting 1-bit only.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUoV4KAAoJEP4mhCVzWIwprogQAJtdRmppCEy+FdWJbl1xoEfG
 NpJG8av+4X32fKyM6nxefBuSJw0J5dq5znEXAPtK8Eez5dU40a5AvGZZMN9SkY+v
 8tQYPry6nfU+xrnhdg40iZ9n6ZXjy5mgEzngB4WjJmePvZyymoHQCtH89gatcfKQ
 swTSCE+L6/wT0aloJhlTYldw+9YsuZhG+jNTRSMKWL7zZ5kml4VGRZcV+RdsJOce
 koAtdzVd3bVr+TKcF297y7aWucOVOa7MP59aOU8fI8RjD4Im3xvRckJ7rTOQygCI
 Vy3dYuy38ClCVV1uD5FlgAKrXD9oak620BxsChbtNdyW7OXOomc/8Q0Rz8uBylGo
 9N5kNb3c9RSxMD8LpCSXE3pnvCVyquqcrXCPMsDcvLeVpgSUpe9Tu3KOboMnoYly
 hodkBTDUxtez3s5W3rUBsfFob47KO/2ItQdzNAQxnHDjgb63ZVexK6SQ+UrimGGa
 jM7TacjuVzIYf2RUsABf2LP2pNISV/LwL6WV1AUS2MfESVHSHmir0Sj6BHpISDkF
 +qf9NV1r0IoaVloH9nzJQHS9Q7XQtLv8TRA3wQj2wOHMZ7evo3u5rjJSUUVY3a7G
 69afISLT3QTwnfnyhrLa0Bp/JmHLm/s8ELKlEPmllPc4lIy75fVFFZeRRuetDWF+
 1mgEr1kimazs2cXY1xaI
 =ncvX
 -----END PGP SIGNATURE-----

Merge tag 'mmc-v3.19-2' of git://git.linaro.org/people/ulf.hansson/mmc

Pull one MMC fix from Ulf Hansson:
 "MMC core:

   - Fix selection of buswidth for mmc hosts supporting 1-bit only"

* tag 'mmc-v3.19-2' of git://git.linaro.org/people/ulf.hansson/mmc:
  mmc: core: stop trying to switch width when only one bit is supported
2014-12-29 13:19:56 -08:00
Linus Torvalds
4c5d499503 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management updates from Zhang Rui:
 "First of all, the most important change is the thermal cpu cooling
  fixes.  The major fix here is to have proper sequencing between
  cpufreq layer and thermal cpu cooling registration.  A take away of
  this fix is an improvement in the thermal drivers code.  Thermal
  drivers that require cpu cooling do not need to check for cpufreq
  layer.  The requirement now is to propagate the error code, if any,
  while registering cpu cooling device.  Thanks to Viresh for
  implementing the required CPUfreq changes.

  Second, a new driver is introduced for int340x processor thermal
  device.  Given that int340x thermal is disabled by default, and this
  processor thermal device is only available on limited platforms, plus
  the driver does nothing but exposes some thermal limitation
  information for user space to use, thus I think it is safe to include
  it in this pull request after missing 3.19-rc2.

  Specifics:

   - Thermal cpu cooling fixes and cleanups.

   - introduce INT340X processor thermal reporting device driver.

   - several small fixes and cleanups for int340x thermal drivers"

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (43 commits)
  Thermal/int340x/int3403: Free acpi notification handler
  Thermal/int340x/processor_thermal: Fix memory leak
  Thermal/int340x/int3403: Fix memory leak
  thermal: int340x: Introduce processor reporting device
  thermal: int340x_thermal: drop owner assignment from platform_drivers
  thermal: drop owner assignment from platform_drivers
  thermal: cpu_cooling: document node in struct cpufreq_cooling_device
  thermal/powerclamp: add ids for future xeon cpus
  Thermal/int340x: Handle properly the case when _trt or _art acpi entry is missing
  thermal: cpu_cooling: return ERR_PTR() for !CPU_THERMAL or !THERMAL_OF
  thermal: cpu_cooling: small memory leak on error
  thermal: ti-soc-thermal: Do not print error message in the EPROBE_DEFER case
  thermal: db8500: Do not print error message in the EPROBE_DEFER case
  thermal: imx: Do not print error message in the EPROBE_DEFER case
  thermal: Fix cdev registration with THERMAL_NO_LIMIT on 64bit
  drivers: thermal: Remove ARCH_HAS_BANDGAP dependency for samsung
  thermal:core:fix: Check return code of the ->get_max_state() callback
  thermal: cpu_cooling: update copyright tags
  thermal: cpu_cooling: Use cpufreq_dev->freq_table for finding level/freq
  thermal: cpu_cooling: Store frequencies in descending order
  ...
2014-12-29 13:13:41 -08:00
Michal Hocko
45f87de57f mm: get rid of radix tree gfp mask for pagecache_get_page
Commit 2457aec637 ("mm: non-atomically mark page accessed during page
cache allocation where possible") has added a separate parameter for
specifying gfp mask for radix tree allocations.

Not only this is less than optimal from the API point of view because it
is error prone, it is also buggy currently because
grab_cache_page_write_begin is using GFP_KERNEL for radix tree and if
fgp_flags doesn't contain FGP_NOFS (mostly controlled by fs by
AOP_FLAG_NOFS flag) but the mapping_gfp_mask has __GFP_FS cleared then
the radix tree allocation wouldn't obey the restriction and might
recurse into filesystem and cause deadlocks.  This is the case for most
filesystems unfortunately because only ext4 and gfs2 are using
AOP_FLAG_NOFS.

Let's simply remove radix_gfp_mask parameter because the allocation
context is same for both page cache and for the radix tree.  Just make
sure that the radix tree gets only the sane subset of the mask (e.g.  do
not pass __GFP_WRITE).

Long term it is more preferable to convert remaining users of
AOP_FLAG_NOFS to use mapping_gfp_mask instead and simplify this
interface even further.

Reported-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-12-29 12:45:45 -08:00
Rafael J. Wysocki
651c3293bf Merge branch 'acpi-video'
* acpi-video:
  ACPI / video: Add some Samsung models to disable_native_backlight list
2014-12-29 21:24:13 +01:00
Rafael J. Wysocki
4f2f277789 Merge branches 'pm-domains', 'powercap' and 'pm-tools'
* pm-domains:
  PM / Domains: Export of_genpd_get_from_provider function

* powercap:
  powercap / RAPL: add IDs for future Xeon CPUs

* pm-tools:
  tools / cpupower: Fix no idle state information return value
  tools / cpupower: Correctly detect if running as root
2014-12-29 21:24:00 +01:00
Rafael J. Wysocki
ff23ab2441 Merge branches 'pm-cpufreq' and 'pm-cpuidle'
* pm-cpufreq:
  cpufreq: fix a NULL pointer dereference in __cpufreq_governor()
  cpufreq-dt: defer probing if OPP table is not ready

* pm-cpuidle:
  cpuidle / ACPI: remove unused CPUIDLE_FLAG_TIME_INVALID
  cpuidle: ladder: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID
  cpuidle: menu: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID
2014-12-29 21:23:41 +01:00
Rafael J. Wysocki
e0288b0e9e Merge branch 'pm-opp'
* pm-opp:
  PM / OPP: take RCU lock in dev_pm_opp_get_opp_count
  PM / OPP: fix warning in of_free_opp_table()
  PM / OPP: add some lockdep annotations
2014-12-29 21:23:13 +01:00
Alexandre Belloni
1c2d26e379 mmc: core: stop trying to switch width when only one bit is supported
mmc_select_bus_width() will try to switch to MMC_BUS_WIDTH_4 even if
MMC_CAP_4_BIT_DATA and MMC_CAP_8_BIT_DATA are not set in host->caps.
Return as soon as possible when those flags are not set

Fixes: 577fb13199 (mmc: rework selection of bus speed mode)
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: <stable@vger.kernel.org> # 3.17
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-12-29 14:49:28 +01:00
Oded Gabbay
38c2adfb00 drm/radeon: Init amdkfd only if it was compiled
This patch changes the radeon_kfd_init(), which is used to initialize the
interface between radeon and amdkfd, so the interface will be initialized only
if amdkfd was build, either as module or inside the kernel image.

In the modules case, the symbol_request() will be used (same as old code). In
the in-image compilation case, a direct call to kgd2kfd_init() will be done.
For other cases, radeon_kfd_init() will just return false.

This patch is necessary because in case of the following specific
configuration: kernel 32-bit, no modules support, random kernel base and no
hibernation, the symbol_request() doesn't work as expected - it doesn't return
NULL if the symbol doesn't exists - which makes the kernel panic.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
2014-12-29 14:46:00 +02:00
Giedrius Statkevičius
2bacedada6 HID: Add a new id 0x501a for Genius MousePen i608X
New Genius MousePen i608X devices have a new id 0x501a instead of the
old 0x5011 so add a new #define with "_2" appended and change required
places.

The remaining two checkpatch warnings about line length
being over 80 characters are present in the original files too and this
patch was made in the same style (no line break).

Just adding a new id and changing the required places should make the
new device work without any issues according to the bug report in the
following url.

This patch was made according to and fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=67111

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-12-29 11:12:37 +01:00
Michael S. Tsirkin
5d9a07b0de vhost: relax used address alignment
virtio 1.0 only requires used address to be 4 byte aligned,
vhost required 8 bytes (size of vring_used_elem).
Fix up vhost to match that.

Additionally, while vhost correctly requires 8 byte
alignment for log, it's unconnected to used ring:
it's a consequence that log has u64 entries.
Tweak code to make that clearer.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-12-29 10:55:06 +02:00
Michael S. Tsirkin
b28e0506fa virtio_ring: document alignment requirements
Host needs to know vring element alignment requirements:
simply doing alignof on structures doesn't work reliably: on some
platforms gcc has alignof(uint32_t) == 2.

Add macros for alignment as specified in virtio 1.0 cs01,
export them to userspace as well.

Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-12-29 10:54:54 +02:00
Tomi Valkeinen
92b004d1aa video/logo: prevent use of logos after they have been freed
If the probe of an fb driver has been deferred due to missing
dependencies, and the probe is later ran when a module is loaded, the
fbdev framework will try to find a logo to use.

However, the logos are __initdata, and have already been freed. This
causes sometimes page faults, if the logo memory is not mapped,
sometimes other random crashes as the logo data is invalid, and
sometimes nothing, if the fbdev decides to reject the logo (e.g. the
random value depicting the logo's height is too big).

This patch adds a late_initcall function to mark the logos as freed. In
reality the logos are freed later, and fbdev probe may be ran between
this late_initcall and the freeing of the logos. In that case we will
miss drawing the logo, even if it would be possible.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: stable@vger.kernel.org
2014-12-29 10:06:55 +02:00
Dan Carpenter
811174f45f OMAPDSS: pll: NULL dereference in error handling
The regulator_disable() doesn't accept NULL pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-12-29 10:06:55 +02:00
Tomi Valkeinen
1616cf01a4 OMAPDSS: HDMI: remove double initializer entries
HDMI hardware parameters structs for OMAP4 and OMAP5 contained two
initializers for 'clkdco_max'. The first one was a remnant with wrong
value.

Remove the extra initializer entries.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-12-29 10:06:55 +02:00
Michael Ellerman
1be6f10f6f Revert "powerpc: Secondary CPUs must set cpu_callin_map after setting active and online"
This reverts commit 7c5c92ed56.

Although this did fix the bug it was aimed at, it also broke secondary
startup on platforms that use give/take_timebase(). Unfortunately we
didn't detect that while it was in next.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2014-12-29 15:51:51 +11:00
Hari Bathini
c1caae3de4 powerpc/kdump: Ignore failure in enabling big endian exception during crash
In LE kernel, we currently have a hack for kexec that resets the exception
endian before starting a new kernel as the kernel that is loaded could be a
big endian or a little endian kernel. In kdump case, resetting exception
endian fails when one or more cpus is disabled. But we can ignore the failure
and still go ahead, as in most cases crashkernel will be of same endianess
as primary kernel and reseting endianess is not even needed in those cases.
This patch adds a new inline function to say if this is kdump path. This
function is used at places where such a check is needed.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
[mpe: Rename to kdump_in_progress(), use bool, and edit comment]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2014-12-29 15:44:53 +11:00
Pranith Kumar
1e5d0fdb5b powerpc: Wire up sys_execveat() syscall
Wire up sys_execveat(). This passes the selftests for the system call.

Check success of execveat(3, '../execveat', 0)... [OK]
Check success of execveat(5, 'execveat', 0)... [OK]
Check success of execveat(6, 'execveat', 0)... [OK]
Check success of execveat(-100, '/home/pranith/linux/...ftests/exec/execveat', 0)... [OK]
Check success of execveat(99, '/home/pranith/linux/...ftests/exec/execveat', 0)... [OK]
Check success of execveat(8, '', 4096)... [OK]
Check success of execveat(17, '', 4096)... [OK]
Check success of execveat(9, '', 4096)... [OK]
Check success of execveat(14, '', 4096)... [OK]
Check success of execveat(14, '', 4096)... [OK]
Check success of execveat(15, '', 4096)... [OK]
Check failure of execveat(8, '', 0) with ENOENT... [OK]
Check failure of execveat(8, '(null)', 4096) with EFAULT... [OK]
Check success of execveat(5, 'execveat.symlink', 0)... [OK]
Check success of execveat(6, 'execveat.symlink', 0)... [OK]
Check success of execveat(-100, '/home/pranith/linux/...xec/execveat.symlink', 0)... [OK]
Check success of execveat(10, '', 4096)... [OK]
Check success of execveat(10, '', 4352)... [OK]
Check failure of execveat(5, 'execveat.symlink', 256) with ELOOP... [OK]
Check failure of execveat(6, 'execveat.symlink', 256) with ELOOP... [OK]
Check failure of execveat(-100, '/home/pranith/linux/tools/testing/selftests/exec/execveat.symlink', 256) with ELOOP... [OK]
Check success of execveat(3, '../script', 0)... [OK]
Check success of execveat(5, 'script', 0)... [OK]
Check success of execveat(6, 'script', 0)... [OK]
Check success of execveat(-100, '/home/pranith/linux/...elftests/exec/script', 0)... [OK]
Check success of execveat(13, '', 4096)... [OK]
Check success of execveat(13, '', 4352)... [OK]
Check failure of execveat(18, '', 4096) with ENOENT... [OK]
Check failure of execveat(7, 'script', 0) with ENOENT... [OK]
Check success of execveat(16, '', 4096)... [OK]
Check success of execveat(16, '', 4096)... [OK]
Check success of execveat(4, '../script', 0)... [OK]
Check success of execveat(4, 'script', 0)... [OK]
Check success of execveat(4, '../script', 0)... [OK]
Check failure of execveat(4, 'script', 0) with ENOENT... [OK]
Check failure of execveat(5, 'execveat', 65535) with EINVAL... [OK]
Check failure of execveat(5, 'no-such-file', 0) with ENOENT... [OK]
Check failure of execveat(6, 'no-such-file', 0) with ENOENT... [OK]
Check failure of execveat(-100, 'no-such-file', 0) with ENOENT... [OK]
Check failure of execveat(5, '', 4096) with EACCES... [OK]
Check failure of execveat(5, 'Makefile', 0) with EACCES... [OK]
Check failure of execveat(11, '', 4096) with EACCES... [OK]
Check failure of execveat(12, '', 4096) with EACCES... [OK]
Check failure of execveat(99, '', 4096) with EBADF... [OK]
Check failure of execveat(99, 'execveat', 0) with EBADF... [OK]
Check failure of execveat(8, 'execveat', 0) with ENOTDIR... [OK]
Invoke copy of 'execveat' via filename of length 4093:
Check success of execveat(19, '', 4096)... [OK]
Check success of execveat(5, 'xxxxxxxxxxxxxxxxxxxx...yyyyyyyyyyyyyyyyyyyy', 0)... [OK]
Invoke copy of 'script' via filename of length 4093:
Check success of execveat(20, '', 4096)... [OK]
/bin/sh: 0: Can't open /dev/fd/5/xxxxxxx(... a long line of x's and y's, 0)... [OK]
Check success of execveat(5, 'xxxxxxxxxxxxxxxxxxxx...yyyyyyyyyyyyyyyyyyyy', 0)... [OK]

Tested on a 32-bit powerpc system.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2014-12-29 15:44:53 +11:00
Linus Torvalds
b7392d2247 Linux 3.19-rc2 2014-12-28 16:49:37 -08:00
Linus Torvalds
2ea1e35ab1 The important fixes are for two bugs introduced by the merge window.
On top of this, add a couple of WARN_ONs and stop spamming dmesg on
 pretty much every boot of a virtual machine.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQEcBAABAgAGBQJUn8hXAAoJEL/70l94x66Dme4H/R/HA+Aswgzse8nx3pNiqStv
 e0BBeUHVJtxlOfnOlJGCWc1ef7uzKdvVWuqCmJwMDJDoLd/I8kF84E3AQS+zTJ/u
 Dlb+yjwjoFPbQwr8xfclcvYXZxJgleKQJcyBWKBxgMTnFdjgRfX7U0MzXZJ/gFzH
 mdHhLlNBU/On0l3A+dsKVgjtiuHZIQD0FraYs4qa2QajRGgDoHypzTmwh20XBmdx
 3l/zFnSFSbaCTckbKb0xYv22pZTMd/5qrxer05sl98nzrrrXIDhVSo0hbrNVqorv
 pDr+908XGvTOgVR1cvgkFn74INudiYjNyICGsue/ksmUPh9jz6hWic7sNeqYfcI=
 =ehkB
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull KVM fixes from Paolo Bonzini:
 "The important fixes are for two bugs introduced by the merge window.

  On top of this, add a couple of WARN_ONs and stop spamming dmesg on
  pretty much every boot of a virtual machine"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  kvm: warn on more invariant breakage
  kvm: fix sorting of memslots with base_gfn == 0
  kvm: x86: drop severity of "generation wraparound" message
  kvm: x86: vmx: reorder some msr writing
2014-12-28 13:08:08 -08:00
Linus Torvalds
9a6b871d98 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fix from Al Viro:
 "An embarrassing bug in lustre patches from this cycle ;-/"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  [regression] braino in "lustre: use is_root_inode()"
2014-12-28 13:02:27 -08:00
Sasha Levin
68d0cb49f8 amdkfd: actually allocate longs for the pasid bitmask
Commit "amdkfd: use sizeof(long) granularity for the pasid bitmask" calculated
the number of longs it will need, but ended up allocating that number of
bytes rather than longs.

Fix that silly error and allocate the amount of data really required.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
2014-12-28 11:44:37 -05:00
Paolo Bonzini
dbaff30940 kvm: warn on more invariant breakage
Modifying a non-existent slot is not allowed.  Also check that the
first loop doesn't move a deleted slot beyond the used part of
the mslots array.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-12-28 10:01:25 +01:00
Paolo Bonzini
efbeec7098 kvm: fix sorting of memslots with base_gfn == 0
Before commit 0e60b0799f (kvm: change memslot sorting rule from size
to GFN, 2014-12-01), the memslots' sorting key was npages, meaning
that a valid memslot couldn't have its sorting key equal to zero.
On the other hand, a valid memslot can have base_gfn == 0, and invalid
memslots are identified by base_gfn == npages == 0.

Because of this, commit 0e60b0799f broke the invariant that invalid
memslots are at the end of the mslots array.  When a memslot with
base_gfn == 0 was created, any invalid memslot before it were left
in place.

This can be fixed by changing the insertion to use a ">=" comparison
instead of "<=", but some care is needed to avoid breaking the case
of deleting a memslot; see the comment in update_memslots.

Thanks to Tiejun Chen for posting an initial patch for this bug.

Reported-by: Jamie Heilman <jamie@audible.transient.net>
Reported-by: Andy Lutomirski <luto@amacapital.net>
Tested-by: Jamie Heilman <jamie@audible.transient.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-12-28 10:01:17 +01:00
Nicholas Mc Guire
cceeb872d6 Input: hil_kbd - fix incorrect use of init_completion
The successive init_completion calls should be reinit_completion calls.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Acked-by: Helge Deller <deller@gmx.de>
Tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-12-27 20:43:35 -08:00
Linus Torvalds
29169f8230 sound fixes for 3.19-rc2
Just a couple of fixes for the new Intel Skylake HD-audio support.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUnsvzAAoJEGwxgFQ9KSmkyscQALX3t/bdeIOEQAnBZrdPZM7R
 1qcqRp8qKTpRdqGOE3RFRb/BoekmMg1OJcNFVNHgZigq3icZg3LZoZlizc1nedbc
 mxoNlhuq68y3tCFhnkAndxnI88zZV91A+Plp3JuBALAk0g4H4mksxf5oadqIkhY5
 6isK3mA92jfJaihr1waaczKgsjXl7SdPIv2stdVmJbR83llwC4QVSWEwgafVOv6t
 cgbVGWGuv//weYfewhjIPxGA8ZTapI4P/5qB1FghOMWY+l1K04IgvuVAP3mBJwPj
 Cvzb+HLS4eZWE4iNlLlgt+ETQae2Gc26jLNEUwPEXVQJJ9oHfoC5yB/63MvCVv55
 WrK7vfaG0jwXqc1fleBIhAx1JkF0glEnuq4m6mwjSB9d1TbhYOpiLMa+V3jpGPbn
 aaumnAsrH8gMSQHRDo53iHUd65UVHW3F0Lqo2uKPrf3j17IXhhGayzF7YCNxqZg2
 4BrpaN+Ido1Yzv/68+D6afZWBA96gezSC8IPuvf1Gv2hZe5qXajxOr20DnKUT5G4
 Ifgv5vYRpcdCv2issEC9qOJdNZZQ7UhWcX7UEpVJzMK+zFD6JGun52tZ/HhiGXym
 1YA4FP/xd1cqca56W38DCKxdcwl+1kPKZ4H8OfRoZwucqpScsEvv7DYm8UNIRY+k
 oBSDb9U9Ra/nBhijWlMO
 =EYsC
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Just a couple of fixes for the new Intel Skylake HD-audio support"

* tag 'sound-3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda_intel: apply the Seperate stream_tag for Skylake
  ALSA: hda_controller: Separate stream_tag for input and output streams.
2014-12-27 13:12:00 -08:00
Paolo Bonzini
a629df7ead kvm: x86: drop severity of "generation wraparound" message
Since most virtual machines raise this message once, it is a bit annoying.
Make it KERN_DEBUG severity.

Cc: stable@vger.kernel.org
Fixes: 7a2e8aaf0f
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-12-27 21:52:28 +01:00
Tiejun Chen
baa035227b kvm: x86: vmx: reorder some msr writing
The commit 34a1cd60d1, "x86: vmx: move some vmx setting from
vmx_init() to hardware_setup()", tried to refactor some codes
specific to vmx hardware setting into hardware_setup(), but some
msr writing should depend on our previous setting condition like
enable_apicv, enable_ept and so on.

Reported-by: Jamie Heilman <jamie@audible.transient.net>
Tested-by: Jamie Heilman <jamie@audible.transient.net>
Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-12-27 21:52:10 +01:00
Johannes Berg
023e2cfa36 netlink/genetlink: pass network namespace to bind/unbind
Netlink families can exist in multiple namespaces, and for the most
part multicast subscriptions are per network namespace. Thus it only
makes sense to have bind/unbind notifications per network namespace.

To achieve this, pass the network namespace of a given client socket
to the bind/unbind functions.

Also do this in generic netlink, and there also make sure that any
bind for multicast groups that only exist in init_net is rejected.
This isn't really a problem if it is accepted since a client in a
different namespace will never receive any notifications from such
a group, but it can confuse the family if not rejected (it's also
possible to silently (without telling the family) accept it, but it
would also have to be ignored on unbind so families that take any
kind of action on bind/unbind won't do unnecessary work for invalid
clients like that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-27 03:07:50 -05:00
Jia-Ju Bai
eb69c5bf82 ne2k-pci: Add pci_disable_device in error handling
For linux-3.18.0
The driver lacks pci_disable_device in error handling code of
ne2k_pci_init_one, so the device enabled by pci_enable_device is not
disabled when errors occur.
This patch fixes this problem.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-27 02:20:55 -05:00
Wengang Wang
a22a9e4141 bonding: change error message to debug message in __bond_release_one()
In __bond_release_one(), when the interface is not a slave or not a slave of
"this" master, it log error message.

The message actually should be a debug message matching what bond_enslave()
does.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Acked-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-27 02:20:55 -05:00
David S. Miller
24f626d343 Merge branch 'netlink_multicast'
Johannes Berg says:

====================
netlink/genetlink cleanups & multicast improvements

I'm looking at using the multicast group functionality in a way that would
benefit from knowing when there are subscribers to avoid collecting the
required data when there aren't any. During this I noticed that the unbind
for multicast groups doesn't actually work - it's never called when sockets
are closed. Luckily, nobody actually uses the functionality.

While looking at the code trying to find why it's not called and where the
multicast listeners are actually removed, I found the potential cleanup in
patch 3. Patch 2 also has a cleanup for a generic netlink API in this area.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-27 02:20:30 -05:00
Johannes Berg
c380d9a7af genetlink: pass multicast bind/unbind to families
In order to make the newly fixed multicast bind/unbind
functionality in generic netlink, pass them down to the
appropriate family.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-27 02:20:23 -05:00
Johannes Berg
7d68536bed netlink: call unbind when releasing socket
Currently, netlink_unbind() is only called when the socket
explicitly unbinds, which limits its usefulness (luckily
there are no users of it yet anyway.)

Call netlink_unbind() also when a socket is released, so it
becomes possible to track listeners with this callback and
without also implementing a netlink notifier (and checking
netlink_has_listeners() in there.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-27 02:20:23 -05:00
Johannes Berg
b10dcb3b94 netlink: update listeners directly when removing socket
The code is now confusing to read - first in one function down
(netlink_remove) any group subscriptions are implicitly removed
by calling __sk_del_bind_node(), but the subscriber database is
only updated far later by calling netlink_update_listeners().

Move the latter call to just after removal from the list so it
is easier to follow the code.

This also enables moving the locking inside the kernel-socket
conditional, which improves the normal socket destruction path.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-27 02:20:23 -05:00
Johannes Berg
f8403a2e47 genetlink: pass only network namespace to genl_has_listeners()
There's no point to force the caller to know about the internal
genl_sock to use inside struct net, just have them pass the network
namespace. This doesn't really change code generation since it's
an inline, but makes the caller less magic - there's never any
reason to pass another socket.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-27 02:20:23 -05:00