cascardo/linux.git
7 years agonet_sched: do not broadcast RTM_GETTFILTER result
Eric Dumazet [Mon, 10 Oct 2016 03:25:55 +0000 (20:25 -0700)]
net_sched: do not broadcast RTM_GETTFILTER result

There are two ways to get tc filters from kernel to user space.

1) Full dump (tc_dump_tfilter())
2) RTM_GETTFILTER to get one precise filter, reducing overhead.

The second operation is unfortunately broadcasting its result,
polluting "tc monitor" users.

This patch makes sure only the requester gets the result, using
netlink_unicast() instead of rtnetlink_send()

Jamal cooked an iproute2 patch to implement "tc filter get" operation,
but other user space libraries already use RTM_GETTFILTER when a single
filter is queried, instead of dumping all filters.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agocpufreq: conservative: Fix next frequency selection
Rafael J. Wysocki [Wed, 12 Oct 2016 19:47:03 +0000 (21:47 +0200)]
cpufreq: conservative: Fix next frequency selection

Commit d352cf47d93e (cpufreq: conservative: Do not use transition
notifications) overlooked the case when the "frequency step" used
by the conservative governor is small relative to the distances
between the available frequencies and broke the algorithm by
using policy->cur instead of the previously requested frequency
when computing the next one.

As a result, the governor may not be able to go outside of a narrow
range between two consecutive available frequencies.

Fix the problem by making the governor save the previously requested
frequency and select the next one relative that value (unless it is
out of range, in which case policy->cur will be used instead).

Fixes: d352cf47d93e (cpufreq: conservative: Do not use transition notifications)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=177171
Reported-and-tested-by: Aleksey Rybalkin <aleksey@rybalkin.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 4.8+ <stable@vger.kernel.org> # 4.8+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 years agoMerge branch 'fst-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux...
Chris Mason [Wed, 12 Oct 2016 20:16:00 +0000 (13:16 -0700)]
Merge branch 'fst-fixes' of git://git./linux/kernel/git/kdave/linux into for-linus-4.9

Signed-off-by: Chris Mason <clm@fb.com>
7 years agoacpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT
Joe Perches [Wed, 12 Oct 2016 18:50:34 +0000 (11:50 -0700)]
acpi_os_vprintf: Use printk_get_level() to avoid unnecessary KERN_CONT

acpi_os_vprintf currently always uses a KERN_CONT prefix which may be
followed immediately by a proper KERN_<LEVEL>.  Check if the buffer
already has a KERN_<LEVEL> at the start of the buffer and avoid the
unnecessary KERN_CONT.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 years agoACPI / PAD: don't register acpi_pad driver if running as Xen dom0
Juergen Gross [Wed, 12 Oct 2016 11:11:45 +0000 (13:11 +0200)]
ACPI / PAD: don't register acpi_pad driver if running as Xen dom0

When running as Xen dom0 a special processor_aggregator driver is
needed.  Don't register the standard driver in this case.

Without that check an error message:

"Error: Driver 'processor_aggregator' is already registered,
aborting..."

will be displayed.

Signed-off-by: Juergen Gross <jgross@suse.com>
[ rjw: Minor fixups ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 years agocpufreq: skip invalid entries when searching the frequency
Aaro Koskinen [Wed, 12 Oct 2016 03:15:05 +0000 (08:45 +0530)]
cpufreq: skip invalid entries when searching the frequency

Skip invalid entries when searching the frequency. This fixes cpufreq
at least on loongson2 MIPS board.

Fixes: da0c6dc00c69 (cpufreq: Handle sorted frequency tables more efficiently)
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 4.8+ <stable@vger.kernel.org> # 4.8+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 years agocpufreq: intel_pstate: Fix struct pstate_adjust_policy kerneldoc
Rafael J. Wysocki [Tue, 11 Oct 2016 21:07:38 +0000 (23:07 +0200)]
cpufreq: intel_pstate: Fix struct pstate_adjust_policy kerneldoc

It looks like the name of struct pstate_adjust_policy was updated
without updating its kerneldoc comment accordingly, so fix that
mistake.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 years agocpufreq: intel_pstate: Proportional algorithm for Atom
Rafael J. Wysocki [Thu, 6 Oct 2016 12:07:51 +0000 (14:07 +0200)]
cpufreq: intel_pstate: Proportional algorithm for Atom

The PID algorithm used by the intel_pstate driver tends to drive
performance to the minimum for workloads with utilization below the
setpoint, which is undesirable, so replace it with a modified
"proportional" algorithm on Atom.

The new algorithm will set the new P-state to be 1.25 times the
available maximum times the (frequency-invariant) utilization during
the previous sampling period except when the target P-state computed
this way is lower than the average P-state during the previous
sampling period.  In the latter case, it will increase the target by
50% of the difference between it and the average P-state to prevent
performance from dropping down too fast in some cases.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
7 years agoMerge tag 'pwm/for-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry...
Linus Torvalds [Wed, 12 Oct 2016 18:11:05 +0000 (11:11 -0700)]
Merge tag 'pwm/for-4.9-rc1' of git://git./linux/kernel/git/thierry.reding/linux-pwm

Pull pwm updates from Thierry Reding:
 "This set of changes contains support for PWM signal capture in the STi
  driver as well as support for the PWM controller found on Meson SoCs.
  There's also support added for the MediaTek MT2701 and SunXi H3 to the
  existing drivers.

  Other than that there's a fair set of miscellaneous cleanups and fixes
  across the board"

* tag 'pwm/for-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (24 commits)
  pwm: meson: Handle unknown ID values
  pwm: sti: Take the opportunity to conduct a little house keeping
  pwm: sti: It's now valid for number of PWM channels to be zero
  pwm: sti: Add PWM capture callback
  pwm: sti: Add support for PWM capture interrupts
  pwm: sti: Initialise PWM capture device data
  pwm: sti: Supply PWM Capture clock handling
  pwm: sti: Supply PWM capture register addresses and bit locations
  pwm: sti: Only request clock rate when needed
  pwm: sti: Reorganise register names in preparation for new functionality
  pwm: sti: Rename channel => device
  dt-bindings: pwm: sti: Update DT bindings for capture support
  pwm: lpc-18xx: use pwm_set_chip_data
  pwm: sunxi: Add H3 support
  pwm: Add support for Meson PWM Controller
  dt-bindings: pwm: Add bindings for Meson PWM Controller
  pwm: samsung: Fix to use lowest div for large enough modulation bits
  pwm: pwm-tipwmss: Remove all runtime PM gets/puts
  pwm: cros-ec: Add __packed to prevent padding
  pwm: Add MediaTek MT2701 display PWM driver support
  ...

7 years agoALSA: line6: fix a crash in line6_hwdep_write()
Dan Carpenter [Wed, 12 Oct 2016 06:21:40 +0000 (09:21 +0300)]
ALSA: line6: fix a crash in line6_hwdep_write()

The error checking here is messed up so we could end up dereferencing
-EFAULT.

Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: seq: fix passing wrong pointer in function call of compatibility layer
Takashi Sakamoto [Wed, 12 Oct 2016 00:05:50 +0000 (09:05 +0900)]
ALSA: seq: fix passing wrong pointer in function call of compatibility layer

This commit is a fix for Linux 4.9-rc1.

In former commit, a function call of compatibility layer for ALSA sequencer
core was obsoleted by an alternative. Although, the alternative gets a
pointer to kernel stack due to mis-programming. As a result, ALSA sequencer
core unexpectedly refers over kernel stack.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 8ce8eb601c71 ("ALSA: seq: add an alternative way to handle ioctl requests")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: hda - Fix a failure of micmute led when having multi adcs
Hui Wang [Tue, 11 Oct 2016 02:48:58 +0000 (10:48 +0800)]
ALSA: hda - Fix a failure of micmute led when having multi adcs

On a Dell laptop, there is no global adcs for all input devices, so
the input devices use the different adc, as a result, dyn_adc_switch
is set to true.

In this situation, it is safe to control the micmute led according to
user's choice of muting/unmuting the current input device, since only
current input device path is active, while other input device paths
are inactive and powered down.

Fixes: 00ef99408b6c ('ALSA: hda - add mic mute led hook for dell machines')
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Wed, 12 Oct 2016 18:05:23 +0000 (11:05 -0700)]
Merge branch 'next' of git://git./linux/kernel/git/rzhang/linux

Pull thermal managament updates from Zhang Rui:

 - Enhance thermal "userspace" governor to export the reason when a
   thermal event is triggered and delivered to user space. From Srinivas
   Pandruvada

 - Introduce a single TSENS thermal driver for the different versions of
   the TSENS IP that exist, on different qcom msm/apq SoCs'. Support for
   msm8916, msm8960, msm8974 and msm8996 families is also added. From
   Rajendra Nayak

 - Introduce hardware-tracked trip points support to the device tree
   thermal sensor framework. The framework supports an arbitrary number
   of trip points. Whenever the current temperature is changed, the trip
   points immediately below and above the current temperature are found,
   driver callback is invoked to program the hardware to get notified
   when either of the two trip points are triggered. Hardware-tracked
   trip points support for rockchip thermal driver is also added at the
   same time. From Sascha Hauer, Caesar Wang

 - Introduce a new thermal driver, which enables TMU (Thermal Monitor
   Unit) on QorIQ platform. From Jia Hongtao

 - Introduce a new thermal driver for Maxim MAX77620. From Laxman
   Dewangan

 - Introduce a new thermal driver for Intel platforms using WhiskeyCove
   PMIC. From Bin Gao

 - Add mt2701 chip support to MTK thermal driver. From Dawei Chien

 - Enhance Tegra thermal driver to enable soctherm node and set
   "critical", "hot" trips, for Tegra124, Tegra132, Tegra210. From Wei
   Ni

 - Add resume support for tango thermal driver. From Marc Gonzalez

 - several small fixes and improvements for rockchip, qcom, imx, rcar,
   mtk thermal drivers and thermal core code. From Caesar Wang, Keerthy,
   Rocky Hao, Wei Yongjun, Peter Robinson, Bui Duc Phuc, Axel Lin, Hugh
   Kang

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (48 commits)
  thermal: int3403: Process trip change notification
  thermal: int340x: New Interface to read trip and notify
  thermal: user_space gov: Add additional information in uevent
  thermal: Enhance thermal_zone_device_update for events
  arm64: tegra: set hot trips for Tegra210
  arm64: tegra: set critical trips for Tegra210
  arm64: tegra: add soctherm node for Tegra210
  arm64: tegra: set hot trips for Tegra132
  arm64: tegra: set critical trips for Tegra132
  arm64: tegra: use tegra132-soctherm for Tegra132
  arm: tegra: set hot trips for Tegra124
  arm: tegra: set critical trips for Tegra124
  thermal: tegra: add hw-throttle for Tegra132
  thermal: tegra: add hw-throttle function
  of: Add bindings of hw throttle for Tegra soctherm
  thermal: mtk_thermal: Check return value of devm_thermal_zone_of_sensor_register
  thermal: Add Mediatek thermal driver for mt2701.
  dt-bindings: thermal: Add binding document for Mediatek thermal controller
  thermal: max77620: Add thermal driver for reporting junction temp
  thermal: max77620: Add DT binding doc for thermal driver
  ...

7 years agoMerge tag 'fbdev-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux
Linus Torvalds [Wed, 12 Oct 2016 18:01:37 +0000 (11:01 -0700)]
Merge tag 'fbdev-4.9' of git://git./linux/kernel/git/tomba/linux

Pull fbdev updates from Tomi Valkeinen:
 "Main changes:

   - amba-cldc: DT backlight support, Nomadik support, Versatile
     improvements, fixes

   - efifb: fix fbcon RGB565 palette

   - exynos: remove unused DSI driver"

* tag 'fbdev-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (42 commits)
  video: smscufx: remove unused variable
  matroxfb: fix size of memcpy
  fbdev: ssd1307fb: fix a possible NULL dereference
  fbdev: ssd1307fb: constify the device_info pointer
  simplefb: Disable and release clocks and regulators in destroy callback
  video: fbdev: constify fb_fix_screeninfo and fb_var_screeninfo structures
  matroxfb: constify local structures
  video: fbdev: i810: add in missing white space in error message text
  video: fbdev: add missing \n at end of printk error message
  ARM: exynos_defconfig: Remove old non-working MIPI driver
  video: fbdev: exynos: Remove old non-working MIPI driver
  omapfb: fix return value check in dsi_bind()
  MAINTAINERS: update fbdev entries
  video: fbdev: offb: Call pci_enable_device() before using the PCI VGA device
  fbdev: vfb: simplify memory management
  fbdev: vfb: add option for video mode
  fbdev: vfb: add description to module parameters
  video: fbdev: intelfb: remove impossible condition
  fb: adv7393: off by one in probe function
  video: fbdev: pxafb: add missing of_node_put() in of_get_pxafb_mode_info()
  ...

7 years agoDisable the __builtin_return_address() warning globally after all
Linus Torvalds [Wed, 12 Oct 2016 17:23:41 +0000 (10:23 -0700)]
Disable the __builtin_return_address() warning globally after all

This affectively reverts commit 377ccbb48373 ("Makefile: Mute warning
for __builtin_return_address(>0) for tracing only") because it turns out
that it really isn't tracing only - it's all over the tree.

We already also had the warning disabled separately for mm/usercopy.c
(which this commit also removes), and it turns out that we will also
want to disable it for get_lock_parent_ip(), that is used for at least
TRACE_IRQFLAGS.  Which (when enabled) ends up being all over the tree.

Steven Rostedt had a patch that tried to limit it to just the config
options that actually triggered this, but quite frankly, the extra
complexity and abstraction just isn't worth it.  We have never actually
had a case where the warning is actually useful, so let's just disable
it globally and not worry about it.

Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7 years agoSMB3: Add mount parameter to allow user to override max credits
Steve French [Fri, 23 Sep 2016 05:44:16 +0000 (00:44 -0500)]
SMB3: Add mount parameter to allow user to override max credits

Add mount option "max_credits" to allow setting maximum SMB3
credits to any value from 10 to 64000 (default is 32000).
This can be useful to workaround servers with problems allocating
credits, or to throttle the client to use smaller amount of
simultaneous i/o or to workaround server performance issues.

Also adds a cap, so that even if the server granted us more than
65000 credits due to a server bug, we would not use that many.

Signed-off-by: Steve French <steve.french@primarydata.com>
7 years agofs/cifs: reopen persistent handles on reconnect
Steve French [Fri, 23 Sep 2016 00:23:56 +0000 (19:23 -0500)]
fs/cifs: reopen persistent handles on reconnect

Continuous Availability features like persistent handles
require that clients reconnect their open files, not
just the sessions, soon after the network connection comes
back up, otherwise the server will throw away the state
(byte range locks, leases, deny modes) on those handles
after a timeout.

Add code to reconnect handles when use_persistent set
(e.g. Continuous Availability shares) after tree reconnect.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>
Signed-off-by: Steve French <smfrench@gmail.com>
7 years agoClarify locking of cifs file and tcon structures and make more granular
Steve French [Thu, 22 Sep 2016 23:58:16 +0000 (18:58 -0500)]
Clarify locking of cifs file and tcon structures and make more granular

Remove the global file_list_lock to simplify cifs/smb3 locking and
have spinlocks that more closely match the information they are
protecting.

Add new tcon->open_file_lock and file->file_info_lock spinlocks.
Locks continue to follow a heirachy,
cifs_socket --> cifs_ses --> cifs_tcon --> cifs_file
where global tcp_ses_lock still protects socket and cifs_ses, while the
the newer locks protect the lower level structure's information
(tcon and cifs_file respectively).

CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <steve.french@primarydata.com>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>
7 years agoFix regression which breaks DFS mounting
Sachin Prabhu [Tue, 6 Sep 2016 12:22:34 +0000 (13:22 +0100)]
Fix regression which breaks DFS mounting

Patch a6b5058 results in -EREMOTE returned by is_path_accessible() in
cifs_mount() to be ignored which breaks DFS mounting.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <smfrench@gmail.com>
7 years agofs/cifs: keep guid when assigning fid to fileinfo
Aurelien Aptel [Thu, 22 Sep 2016 05:38:50 +0000 (07:38 +0200)]
fs/cifs: keep guid when assigning fid to fileinfo

When we open a durable handle we give a Globally Unique
Identifier (GUID) to the server which we must keep for later reference
e.g. when reopening persistent handles on reconnection.

Without this the GUID generated for a new persistent handle was lost and
16 zero bytes were used instead on re-opening.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <smfrench@gmail.com>
7 years agoSMB3: GUIDs should be constructed as random but valid uuids
Steve French [Thu, 22 Sep 2016 05:39:34 +0000 (00:39 -0500)]
SMB3: GUIDs should be constructed as random but valid uuids

GUIDs although random, and 16 bytes, need to be generated as
proper uuids.

Signed-off-by: Steve French <steve.french@primarydata.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Reported-by: David Goebels <davidgoe@microsoft.com>
CC: Stable <stable@vger.kernel.org>
7 years agoSet previous session id correctly on SMB3 reconnect
Steve French [Wed, 21 Sep 2016 03:56:13 +0000 (22:56 -0500)]
Set previous session id correctly on SMB3 reconnect

Signed-off-by: Steve French <steve.french@primarydata.com>
CC: Stable <stable@vger.kernel.org>
Reported-by: David Goebel <davidgoe@microsoft.com>
7 years agocifs: Limit the overall credit acquired
Ross Lagerwall [Tue, 20 Sep 2016 12:37:13 +0000 (13:37 +0100)]
cifs: Limit the overall credit acquired

The kernel client requests 2 credits for many operations even though
they only use 1 credit (presumably to build up a buffer of credit).
Some servers seem to give the client as much credit as is requested.  In
this case, the amount of credit the client has continues increasing to
the point where (server->credits * MAX_BUFFER_SIZE) overflows in
smb2_wait_mtu_credits().

Fix this by throttling the credit requests if an set limit is reached.
For async requests where the credit charge may be > 1, request as much
credit as what is charged.
The limit is chosen somewhat arbitrarily. The Windows client
defaults to 128 credits, the Windows server allows clients up to
512 credits (or 8192 for Windows 2016), and the NetApp server
(and at least one other) does not limit clients at all.
Choose a high enough value such that the client shouldn't limit
performance.

This behavior was seen with a NetApp filer (NetApp Release 9.0RC2).

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <smfrench@gmail.com>
7 years agoDisplay number of credits available
Steve French [Tue, 20 Sep 2016 03:06:35 +0000 (22:06 -0500)]
Display number of credits available

In debugging smb3, it is useful to display the number
of credits available, so we can see when the server has not granted
sufficient operations for the client to make progress, or alternatively
the client has requested too many credits (as we saw in a recent bug)
so we can compare with the number of credits the server thinks
we have.

Add a /proc/fs/cifs/DebugData line to display the client view
on how many credits are available.

Signed-off-by: Steve French <steve.french@primarydata.com>
Reported-by: Germano Percossi <germano.percossi@citrix.com>
CC: Stable <stable@vger.kernel.org>
7 years agoAdd way to query creation time of file via cifs xattr
Steve French [Tue, 20 Sep 2016 08:05:57 +0000 (03:05 -0500)]
Add way to query creation time of file via cifs xattr

Add parsing for new pseudo-xattr user.cifs.creationtime file
attribute to allow backup and test applications to view
birth time of file on cifs/smb3 mounts.

Signed-off-by: Steve French <steve.french@primarydata.com>
7 years agoAdd way to query file attributes via cifs xattr
Steve French [Mon, 19 Sep 2016 16:14:06 +0000 (11:14 -0500)]
Add way to query file attributes via cifs xattr

Add parsing for new pseudo-xattr user.cifs.dosattrib file attribute
so tools can recognize what kind of file it is, and verify if common
SMB3 attributes (system, hidden, archive, sparse, indexed etc.) are
set.

Signed-off-by: Steve French <steve.french@primarydata.com>
Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org>
7 years agoMerge branches 'pci/host-armada', 'pci/host-artpec', 'pci/host-dra7xx', 'pci/host...
Bjorn Helgaas [Wed, 12 Oct 2016 16:15:06 +0000 (11:15 -0500)]
Merge branches 'pci/host-armada', 'pci/host-artpec', 'pci/host-dra7xx', 'pci/host-exynos', 'pci/host-hisi', 'pci/host-imx6', 'pci/host-keystone', 'pci/host-layerscape', 'pci/host-qcom' and 'pci/host-spear' into next

* pci/host-armada:
  MAINTAINERS: Add maintainer for the PCIe Marvell Armada 8K driver
  PCI: armada: Reorder struct armada8k_pcie
  PCI: armada: Pass device-specific struct to internal functions
  PCI: armada: Use generic DesignWare accessors
  PCI: armada: Remove redundant struct armada8k_pcie.base
  PCI: armada: Add local base pointer
  PCI: armada: Remove unused platform data

* pci/host-artpec:
  PCI: artpec6: Add resource name comments
  PCI: artpec6: Pass device-specific struct to internal functions
  PCI: artpec6: Remove unnecessary artpec6_pcie_link_up()
  PCI: artpec6: Use generic DesignWare accessors
  PCI: artpec6: Add register accessors
  PCI: artpec6: Remove unused platform data
  PCI: artpec6: Add local struct device pointers

* pci/host-dra7xx:
  PCI: dra7xx: Reorder struct dra7xx_pcie
  PCI: dra7xx: Move struct pcie_port setup to probe function
  PCI: dra7xx: Pass device-specific struct to internal functions
  PCI: dra7xx: Use generic DesignWare accessors
  PCI: dra7xx: Set drvdata at end of probe function
  PCI: dra7xx: Remove redundant struct device pointer from dra7xx_pcie
  PCI: dra7xx: Add local struct device pointers

* pci/host-exynos:
  PCI: exynos: Reorder struct exynos_pcie
  PCI: exynos: Pass device-specific struct to internal functions
  PCI: exynos: Name private struct pointer "exynos_pcie" consistently
  PCI: exynos: Uninline register accessors
  PCI: exynos: Add local struct device pointers

* pci/host-hisi:
  PCI: hisi: Reorder struct hisi_pcie
  PCI: hisi: Pass device-specific struct to internal functions
  PCI: hisi: Include register block base in PCIE_SYS_STATE4 address
  PCI: hisi: Use generic DesignWare accessors
  PCI: hisi: Remove redundant struct hisi_pcie.reg_base
  PCI: hisi: Name private struct pointer "hisi_pcie" consistently
  PCI: hisi: Remove unused platform data
  PCI: hisi: Add local struct device pointers

* pci/host-imx6:
  PCI: imx6: Remove unused return values
  PCI: imx6: Reorder struct imx6_pcie
  PCI: imx6: Use generic DesignWare accessors
  PCI: imx6: Pass device-specific struct to internal functions
  PCI: imx6: Pass struct imx6_pcie to PHY accessors
  PCI: imx6: Removed unused struct imx6_pcie.mem_base
  PCI: imx6: Remove redundant of_node pointer
  PCI: imx6: Add local struct device pointers

* pci/host-keystone:
  PCI: keystone: Reorder struct keystone_pcie
  PCI: keystone: Add app register accessors
  PCI: keystone: Pass keystone_pcie, not va_app_base, to DBI functions
  PCI: keystone: Pass keystone_pcie, not address, to IRQ functions
  PCI: keystone: Use generic DesignWare accessors
  PCI: keystone: Add local struct device pointers

* pci/host-layerscape:
  PCI: layerscape: Reorder struct ls_pcie
  PCI: layerscape: Remove unused ls_add_pcie_port() platform_device arg
  PCI: layerscape: Move struct pcie_port setup to probe function
  PCI: layerscape: Pass device-specific struct to internal functions
  PCI: layerscape: Remove redundant struct ls_pcie.dbi
  PCI: layerscape: Remove unused platform data
  PCI: layerscape: Add local struct device pointers

* pci/host-qcom:
  PCI: qcom: Reorder struct qcom_pcie
  PCI: qcom: Remove redundant struct qcom_pcie.dev
  PCI: qcom: Remove redundant struct qcom_pcie.dbi
  PCI: qcom: Remove unused platform data

* pci/host-spear:
  PCI: spear: Clean up struct device usage
  PCI: spear: Reorder struct spear13xx_pcie
  PCI: spear: Pass device-specific struct to internal functions
  PCI: spear: Remove unused constants

7 years agoMerge branch 'pci/host-designware' into next
Bjorn Helgaas [Wed, 12 Oct 2016 16:14:58 +0000 (11:14 -0500)]
Merge branch 'pci/host-designware' into next

* pci/host-designware:
  PCI: designware-plat: Remove unused platform data
  PCI: designware-plat: Add local struct device pointers
  PCI: designware-plat: Remove redundant dw_plat_pcie.mem_base
  PCI: designware: Swap order of dw_pcie_writel_unroll() reg/val arguments
  PCI: designware: Uninline register accessors
  PCI: designware: Export dw_pcie_readl_rc(), dw_pcie_writel_rc()
  PCI: designware: Swap order of dw_pcie_writel_rc() reg/val arguments
  PCI: designware: Simplify pcie_host_ops.readl_rc() and .writel_rc() interfaces
  PCI: designware: Simplify dw_pcie_readl_unroll(), dw_pcie_writel_unroll()
  PCI: designware: Rename dw_pcie_valid_config() to dw_pcie_valid_device()

7 years agoMerge branches 'pci/host-aardvark', 'pci/host-altera', 'pci/host-iproc', 'pci/host...
Bjorn Helgaas [Wed, 12 Oct 2016 16:14:44 +0000 (11:14 -0500)]
Merge branches 'pci/host-aardvark', 'pci/host-altera', 'pci/host-iproc', 'pci/host-mvebu', 'pci/host-rcar', 'pci/host-rockchip', 'pci/host-tegra', 'pci/host-xgene' and 'pci/host-xilinx' into next

* pci/host-aardvark:
  MAINTAINERS: Add DT binding to the Aardvark PCIe driver maintainer
  PCI: aardvark: Remove unused platform data
  PCI: aardvark: Add local struct device pointers

* pci/host-altera:
  PCI: altera: Simplify TLP_CFG_DW1 usage
  PCI: altera: Simplify TLB_CFG_DW0 usage
  PCI: altera: Rename altera_pcie_valid_config() to altera_pcie_valid_device()
  PCI: altera: Remove redundant platform_get_resource() return value check
  PCI: altera: Remove unused platform data
  PCI: altera: Add local struct device pointers

* pci/host-iproc:
  PCI: iproc: Hard-code PCIe capability offset instead of searching
  PCI: iproc: Remove redundant null pointer checking
  PCI: iproc: Validate CSR base in BCMA setup code
  PCI: iproc: Set drvdata at end of probe function
  PCI: iproc: Add local struct device pointers

* pci/host-mvebu:
  PCI: mvebu: Use existing of_node pointer
  PCI: mvebu: Add local struct device pointers

* pci/host-rcar:
  PCI: rcar-gen2: Add local struct device pointers
  PCI: rcar: Remove DRV_NAME macro
  PCI: rcar: Remove unused rcar_pcie_get_resources() platform_device arg
  PCI: rcar: Remove unused platform data
  PCI: rcar: Add local struct device pointers

* pci/host-rockchip:
  PCI: rockchip: Indent "if" statement body
  PCI: rockchip: Remove unused platform data

* pci/host-tegra:
  PCI: tegra: Remove unused platform data
  PCI: tegra: Add local struct device pointers
  PCI: tegra: Fix argument order in tegra_pcie_phy_disable()

* pci/host-xgene:
  PCI: xgene: Add register accessors
  PCI: xgene: Pass struct xgene_pcie_port to setup functions
  PCI: xgene: Remove unused platform data
  PCI: xgene: Add local struct device pointers

* pci/host-xilinx:
  PCI: xilinx-nwl: Remove unused platform data
  PCI: xilinx-nwl: Add local struct device pointers
  PCI: xilinx: Removed unused xilinx_pcie_assign_msi() argument
  PCI: xilinx: Remove unused platform data
  PCI: xilinx: Add local struct device pointers

7 years agoMAINTAINERS: Add maintainer for the PCIe Marvell Armada 8K driver
Thomas Petazzoni [Fri, 7 Oct 2016 20:30:30 +0000 (22:30 +0200)]
MAINTAINERS: Add maintainer for the PCIe Marvell Armada 8K driver

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoMAINTAINERS: Add DT binding to the Aardvark PCIe driver maintainer
Thomas Petazzoni [Fri, 7 Oct 2016 20:30:31 +0000 (22:30 +0200)]
MAINTAINERS: Add DT binding to the Aardvark PCIe driver maintainer

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoMIPS: ptrace: Fix regs_return_value for kernel context
Marcin Nowakowski [Wed, 12 Oct 2016 07:32:56 +0000 (09:32 +0200)]
MIPS: ptrace: Fix regs_return_value for kernel context

Currently regs_return_value always negates reg[2] if it determines
the syscall has failed, but when called in kernel context this check is
invalid and may result in returning a wrong value.

This fixes errors reported by CONFIG_KPROBES_SANITY_TEST

Fixes: d7e7528bcd45 ("Audit: push audit success and retcode into arch ptrace.h")
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org # 3.3+
Patchwork: https://patchwork.linux-mips.org/patch/14381/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
7 years agoPCI: rockchip: Indent "if" statement body
Dan Carpenter [Wed, 12 Oct 2016 12:14:09 +0000 (07:14 -0500)]
PCI: rockchip: Indent "if" statement body

Body of an "if" statement wasn't indented.  Add a tab.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agortc: rv8803: set VDETOFF and SWOFF via device tree
Oleksij Rempel [Wed, 29 Jun 2016 14:40:01 +0000 (16:40 +0200)]
rtc: rv8803: set VDETOFF and SWOFF via device tree

There might be designs where the power supply circuit is designed
in a way that VDETOFF and SWOFF is required to be set. Otherwise the
RTC detects a power loss. Add a device tree interface for this.

Signed-off-by: Carsten Resch <Carsten.Resch@de.bosch.com>
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel@de.bosch.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
7 years agodt/bindings: Add bindings for Micro Crystal rv8803
Oleksij Rempel [Wed, 29 Jun 2016 14:40:00 +0000 (16:40 +0200)]
dt/bindings: Add bindings for Micro Crystal rv8803

... and Epson RX8900 real time clock

Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel@de.bosch.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
7 years agodevicetree: Add Micro Crystal AG vendor id
Oleksij Rempel [Wed, 29 Jun 2016 14:39:59 +0000 (16:39 +0200)]
devicetree: Add Micro Crystal AG vendor id

Add Micro Crystal AG vendor id

Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel@de.bosch.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
7 years agoplatform/x86: intel_pmc_core: avoid boot time warning for !CONFIG_DEBUGFS_FS
Arnd Bergmann [Mon, 10 Oct 2016 11:12:58 +0000 (13:12 +0200)]
platform/x86: intel_pmc_core: avoid boot time warning for !CONFIG_DEBUGFS_FS

While looking at a patch that introduced a compile-time warning
"‘pmc_core_dev_state_get’ defined but not used" (I sent a patch
for debugfs to fix it), I noticed that the same patch caused
it in intel_pmc_core also introduced a bogus run-time warning:
"PMC Core: debugfs register failed".

The problem is the IS_ERR_OR_NULL() check that as usual gets
things wrong: when CONFIG_DEBUGFS_FS is disabled,
debugfs_create_dir() fails with an error code, and we don't
need to warn about it, unlike the case in which it returns
NULL.

This reverts the driver to the previous state of not warning
about CONFIG_DEBUGFS_FS being disabled. I chose not to
restore the driver to making a runtime error in debugfs
fatal in pmc_core_probe().

Fixes: df2294fb6428 ("intel_pmc_core: Convert to DEFINE_DEBUGFS_ATTRIBUTE")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
7 years agoMerge branch 'parisc-4.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
Linus Torvalds [Wed, 12 Oct 2016 06:59:07 +0000 (23:59 -0700)]
Merge branch 'parisc-4.9-2' of git://git./linux/kernel/git/deller/parisc-linux

Pull parisc fixes from Helge Deller:
 "Some final updates and fixes for this merge window for the parisc
  architecture. Changes include:

   - Fix boot problems with new memblock allocator on rp3410 machine

   - Increase initial kernel mapping size for 32- and 64-bit kernels,
     this allows to boot bigger kernels which have many modules built-in

   - Fix kernel layout regarding __gp and move exception table into RO
     section

   - Show trap names in crashes, use extable.h header instead of
     module.h"

* 'parisc-4.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Show trap name in kernel crash
  parisc: Zero-initialize newly alloced memblock
  parisc: Move exception table into read-only section
  parisc: Fix kernel memory layout regarding position of __gp
  parisc: Increase initial kernel mapping size
  parisc: Migrate exception table users off module.h and onto extable.h

7 years agoMerge branch 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Wed, 12 Oct 2016 06:38:39 +0000 (23:38 -0700)]
Merge branch 'work.uaccess2' of git://git./linux/kernel/git/viro/vfs

Pull uaccess.h prepwork from Al Viro:
 "Preparations to tree-wide switch to use of linux/uaccess.h (which,
  obviously, will allow to start unifying stuff for real). The last step
  there, ie

    PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>'
    sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \
            `git grep -l "$PATT"|grep -v ^include/linux/uaccess.h`

  is not taken here - I would prefer to do it once just before or just
  after -rc1.  However, everything should be ready for it"

* 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  remove a stray reference to asm/uaccess.h in docs
  sparc64: separate extable_64.h, switch elf_64.h to it
  score: separate extable.h, switch module.h to it
  mips: separate extable.h, switch module.h to it
  x86: separate extable.h, switch sections.h to it
  remove stray include of asm/uaccess.h from cacheflush.h
  mn10300: remove a bogus processor.h->uaccess.h include
  xtensa: split uaccess.h into C and asm sides
  bonding: quit messing with IOCTL
  kill __kernel_ds_p off
  mn10300: finish verify_area() off
  frv: move HAVE_ARCH_UNMAPPED_AREA to pgtable.h
  exceptions: detritus removal

7 years agostrparser: Propagate correct error code in strp_recv()
Geert Uytterhoeven [Thu, 6 Oct 2016 13:41:49 +0000 (15:41 +0200)]
strparser: Propagate correct error code in strp_recv()

With m68k-linux-gnu-gcc-4.1:

    net/strparser/strparser.c: In function â€˜strp_recv’:
    net/strparser/strparser.c:98: warning: â€˜err’ may be used uninitialized in this function

Pass "len" (which is an error code when negative) instead of the
uninitialized "err" variable to fix this.

Fixes: 43a0c6751a322847 ("strparser: Stream parser for messages")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoPCI: hisi: Reorder struct hisi_pcie
Bjorn Helgaas [Thu, 6 Oct 2016 18:34:24 +0000 (13:34 -0500)]
PCI: hisi: Reorder struct hisi_pcie

Reorder struct hisi_pcie to put generic fields first.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: hisi: Pass device-specific struct to internal functions
Bjorn Helgaas [Thu, 6 Oct 2016 18:34:23 +0000 (13:34 -0500)]
PCI: hisi: Pass device-specific struct to internal functions

Only interfaces used from outside the driver, e.g., those called by the
DesignWare core, need to accept pointers to the generic struct pcie_port.
Internal interfaces can accept pointers to the device-specific struct,
which makes them more straightforward.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: hisi: Include register block base in PCIE_SYS_STATE4 address
Bjorn Helgaas [Thu, 6 Oct 2016 18:34:24 +0000 (13:34 -0500)]
PCI: hisi: Include register block base in PCIE_SYS_STATE4 address

Include the PCIE_HIP06_CTRL_OFF block base in the PCIE_SYS_STATE4 register
address so reads of PCIE_SYS_STATE4 don't have to mention both.  No
functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: dra7xx: Reorder struct dra7xx_pcie
Bjorn Helgaas [Thu, 6 Oct 2016 18:33:06 +0000 (13:33 -0500)]
PCI: dra7xx: Reorder struct dra7xx_pcie

Reorder struct dra7xx_pcie to put generic fields first.  No functional
change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: xilinx-nwl: Remove unused platform data
Bjorn Helgaas [Thu, 6 Oct 2016 18:44:43 +0000 (13:44 -0500)]
PCI: xilinx-nwl: Remove unused platform data

The xilinx-nwl driver never uses the platform drvdata pointer, so don't
bother setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: xilinx-nwl: Add local struct device pointers
Bjorn Helgaas [Thu, 6 Oct 2016 18:44:43 +0000 (13:44 -0500)]
PCI: xilinx-nwl: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: xilinx: Removed unused xilinx_pcie_assign_msi() argument
Bjorn Helgaas [Tue, 11 Oct 2016 16:36:49 +0000 (11:36 -0500)]
PCI: xilinx: Removed unused xilinx_pcie_assign_msi() argument

xilinx_pcie_assign_msi() doesn't use the struct xilinx_pcie_port pointer
passed to it, so remove the argument completely.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: xilinx: Remove unused platform data
Bjorn Helgaas [Thu, 6 Oct 2016 18:44:42 +0000 (13:44 -0500)]
PCI: xilinx: Remove unused platform data

The xilinx driver never uses the platform drvdata pointer, so don't
bother setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: xilinx: Add local struct device pointers
Bjorn Helgaas [Thu, 6 Oct 2016 18:44:42 +0000 (13:44 -0500)]
PCI: xilinx: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: xgene: Add register accessors
Bjorn Helgaas [Thu, 6 Oct 2016 18:43:42 +0000 (13:43 -0500)]
PCI: xgene: Add register accessors

Add device-specific register accessors for consistency across host drivers.
No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: xgene: Pass struct xgene_pcie_port to setup functions
Bjorn Helgaas [Thu, 6 Oct 2016 18:43:41 +0000 (13:43 -0500)]
PCI: xgene: Pass struct xgene_pcie_port to setup functions

Pass the struct xgene_pcie_port pointer, not addresses, to setup functions.
This enables future simplifications.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: xgene: Remove unused platform data
Bjorn Helgaas [Thu, 6 Oct 2016 18:43:42 +0000 (13:43 -0500)]
PCI: xgene: Remove unused platform data

The xgene driver never uses the platform drvdata pointer, so don't
bother setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: tegra: Remove unused platform data
Bjorn Helgaas [Thu, 6 Oct 2016 18:43:04 +0000 (13:43 -0500)]
PCI: tegra: Remove unused platform data

The tegra driver never uses the platform drvdata pointer, so don't
bother setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: tegra: Add local struct device pointers
Bjorn Helgaas [Thu, 6 Oct 2016 18:43:04 +0000 (13:43 -0500)]
PCI: tegra: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: tegra: Fix argument order in tegra_pcie_phy_disable()
Bjorn Helgaas [Wed, 5 Oct 2016 21:04:13 +0000 (16:04 -0500)]
PCI: tegra: Fix argument order in tegra_pcie_phy_disable()

The tegra_pcie_phy_disable() path called pads_writel() with arguments in
the wrong order.  Swap them to be the "value, offset" order expected by
pads_writel().

Fixes: 6fe7c187e026 ("PCI: tegra: Support per-lane PHYs")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Thierry Reding <treding@nvidia.com>
CC: stable@vger.kernel.org # v4.7+
7 years agoPCI: rockchip: Remove unused platform data
Bjorn Helgaas [Thu, 6 Oct 2016 18:41:24 +0000 (13:41 -0500)]
PCI: rockchip: Remove unused platform data

The rockchip driver never uses the platform drvdata pointer, so don't
bother setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
7 years agoPCI: rcar-gen2: Add local struct device pointers
Bjorn Helgaas [Mon, 10 Oct 2016 20:04:14 +0000 (15:04 -0500)]
PCI: rcar-gen2: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
7 years agoPCI: rcar: Remove DRV_NAME macro
Bjorn Helgaas [Thu, 6 Oct 2016 18:40:28 +0000 (13:40 -0500)]
PCI: rcar: Remove DRV_NAME macro

The DRV_NAME macro is only used once, so there's no real advantage to
having the macro at all.  Remove it and use the "rcar-pcie" name directly
in the struct platform_driver.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
7 years agoPCI: rcar: Remove unused rcar_pcie_get_resources() platform_device arg
Bjorn Helgaas [Thu, 6 Oct 2016 18:40:27 +0000 (13:40 -0500)]
PCI: rcar: Remove unused rcar_pcie_get_resources() platform_device arg

rcar_pcie_get_resources() doesn't use the platform_device pointer passed to
it, so remove it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
7 years agoPCI: rcar: Remove unused platform data
Bjorn Helgaas [Thu, 6 Oct 2016 18:40:27 +0000 (13:40 -0500)]
PCI: rcar: Remove unused platform data

The rcar driver never uses the platform drvdata pointer, so don't bother
setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
7 years agoPCI: qcom: Reorder struct qcom_pcie
Bjorn Helgaas [Thu, 6 Oct 2016 18:39:37 +0000 (13:39 -0500)]
PCI: qcom: Reorder struct qcom_pcie

Reorder struct qcom_pcie to put generic fields first.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: qcom: Remove redundant struct qcom_pcie.dev
Bjorn Helgaas [Thu, 6 Oct 2016 18:39:37 +0000 (13:39 -0500)]
PCI: qcom: Remove redundant struct qcom_pcie.dev

Remove the struct qcom_pcie.dev member, which is a duplicate of the generic
pp.dev member.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: qcom: Remove redundant struct qcom_pcie.dbi
Bjorn Helgaas [Thu, 6 Oct 2016 18:39:37 +0000 (13:39 -0500)]
PCI: qcom: Remove redundant struct qcom_pcie.dbi

Remove the struct qcom_pcie.dbi member, which is a duplicate of the generic
pp.dbi_base member.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: qcom: Remove unused platform data
Bjorn Helgaas [Thu, 6 Oct 2016 18:39:38 +0000 (13:39 -0500)]
PCI: qcom: Remove unused platform data

The qcom driver never uses the platform drvdata pointer, so don't bother
setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: mvebu: Use existing of_node pointer
Bjorn Helgaas [Wed, 12 Oct 2016 04:19:05 +0000 (23:19 -0500)]
PCI: mvebu: Use existing of_node pointer

Use the existing "np" pointer instead of looking up dev->of_node again.  No
functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: mvebu: Add local struct device pointers
Bjorn Helgaas [Thu, 6 Oct 2016 18:38:58 +0000 (13:38 -0500)]
PCI: mvebu: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: layerscape: Reorder struct ls_pcie
Bjorn Helgaas [Thu, 6 Oct 2016 18:38:05 +0000 (13:38 -0500)]
PCI: layerscape: Reorder struct ls_pcie

Reorder struct ls_pcie to put generic fields first.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: layerscape: Remove unused ls_add_pcie_port() platform_device arg
Bjorn Helgaas [Thu, 6 Oct 2016 18:38:06 +0000 (13:38 -0500)]
PCI: layerscape: Remove unused ls_add_pcie_port() platform_device arg

ls_add_pcie_port() doesn't use the platform_device pointer passed to it, so
remove it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: layerscape: Move struct pcie_port setup to probe function
Bjorn Helgaas [Thu, 6 Oct 2016 18:38:06 +0000 (13:38 -0500)]
PCI: layerscape: Move struct pcie_port setup to probe function

Do the basic pcie_port setup in the probe function for consistency with
other drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: layerscape: Pass device-specific struct to internal functions
Bjorn Helgaas [Thu, 6 Oct 2016 18:38:05 +0000 (13:38 -0500)]
PCI: layerscape: Pass device-specific struct to internal functions

Only interfaces used from outside the driver, e.g., those called by the
DesignWare core, need to accept pointers to the generic struct pcie_port.
Internal interfaces can accept pointers to the device-specific struct,
which makes them more straightforward.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: layerscape: Remove redundant struct ls_pcie.dbi
Bjorn Helgaas [Thu, 6 Oct 2016 18:38:05 +0000 (13:38 -0500)]
PCI: layerscape: Remove redundant struct ls_pcie.dbi

Remove the struct ls_pcie.dbi member, which is a duplicate of the generic
pp.dbi_base member.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: layerscape: Remove unused platform data
Bjorn Helgaas [Wed, 12 Oct 2016 04:13:24 +0000 (23:13 -0500)]
PCI: layerscape: Remove unused platform data

The layerscape driver never uses the platform drvdata pointer, so don't
bother setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: layerscape: Add local struct device pointers
Bjorn Helgaas [Thu, 6 Oct 2016 18:38:05 +0000 (13:38 -0500)]
PCI: layerscape: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: keystone: Reorder struct keystone_pcie
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:57 +0000 (13:36 -0500)]
PCI: keystone: Reorder struct keystone_pcie

Reorder struct keystone_pcie to put generic fields first.  No functional
change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: keystone: Add app register accessors
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:57 +0000 (13:36 -0500)]
PCI: keystone: Add app register accessors

Add device-specific register accessors for consistency across host drivers.
No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: keystone: Pass keystone_pcie, not va_app_base, to DBI functions
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:57 +0000 (13:36 -0500)]
PCI: keystone: Pass keystone_pcie, not va_app_base, to DBI functions

Instead of passing ks_pcie->va_app_base to DBI mode functions,
pass the struct keystone_pcie.  This will allow them to use register
accessors.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: keystone: Pass keystone_pcie, not address, to IRQ functions
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:56 +0000 (13:36 -0500)]
PCI: keystone: Pass keystone_pcie, not address, to IRQ functions

Instead of passing the application register base to IRQ functions,
pass the struct keystone_pcie.  This will allow them to use register
accessors.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: keystone: Use generic DesignWare accessors
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:57 +0000 (13:36 -0500)]
PCI: keystone: Use generic DesignWare accessors

The dw_pcie_readl_rc() and dw_pcie_writel_rc() interfaces already add in
pp->dbi_base, so use those instead of doing it ourselves in the keystone
driver.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: keystone: Add local struct device pointers
Bjorn Helgaas [Wed, 12 Oct 2016 03:48:42 +0000 (22:48 -0500)]
PCI: keystone: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: iproc: Hard-code PCIe capability offset instead of searching
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:07 +0000 (13:36 -0500)]
PCI: iproc: Hard-code PCIe capability offset instead of searching

We know where the PCIe capability lives in the host bridge's config space;
in fact, we already hard-coded the offset of the Link Control 2 register.

The hard-coded Link Control 2 offset was 0xdc.  Link Control 2 is at offset
0x30 into the PCIe capability, so the capability itself must be at
0xdc - 0x30 = 0xac.

Hard-code the PCIe capability offset, which means we don't have to search
for it and we can use the standard definitions for registers within the
capability.

No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: iproc: Remove redundant null pointer checking
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:08 +0000 (13:36 -0500)]
PCI: iproc: Remove redundant null pointer checking

The callers never pass a null "pcie" pointer (they check for kzalloc
failure), so we don't need to check here.  The bus driver should never call
the probe function with a null ->dev pointer, so we don't need to check
that either.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: iproc: Validate CSR base in BCMA setup code
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:07 +0000 (13:36 -0500)]
PCI: iproc: Validate CSR base in BCMA setup code

Validate iproc_pcie->base for BCMA devices just like we already do for
platform devices in iproc_pcie_pltfm_probe().  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: iproc: Set drvdata at end of probe function
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:08 +0000 (13:36 -0500)]
PCI: iproc: Set drvdata at end of probe function

Set the drvdata pointer at the end of probe function for consistency with
other drivers.  We don't need the drvdata until after the probe completes,
and we don't need it at all if the probe fails.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: iproc: Add local struct device pointers
Bjorn Helgaas [Thu, 6 Oct 2016 18:36:08 +0000 (13:36 -0500)]
PCI: iproc: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: imx6: Remove unused return values
Bjorn Helgaas [Thu, 6 Oct 2016 18:35:17 +0000 (13:35 -0500)]
PCI: imx6: Remove unused return values

Remove unused return values.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: imx6: Reorder struct imx6_pcie
Bjorn Helgaas [Thu, 6 Oct 2016 18:35:17 +0000 (13:35 -0500)]
PCI: imx6: Reorder struct imx6_pcie

Reorder struct imx6_pcie to put generic fields first.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: imx6: Use generic DesignWare accessors
Bjorn Helgaas [Wed, 12 Oct 2016 03:18:26 +0000 (22:18 -0500)]
PCI: imx6: Use generic DesignWare accessors

The dw_pcie_readl_rc() and dw_pcie_writel_rc() interfaces already add in
pp->dbi_base, so use those instead of doing it ourselves in the imx6
driver.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: imx6: Pass device-specific struct to internal functions
Bjorn Helgaas [Wed, 12 Oct 2016 03:06:47 +0000 (22:06 -0500)]
PCI: imx6: Pass device-specific struct to internal functions

Only interfaces used from outside the driver, e.g., those called by the
DesignWare core, need to accept pointers to the generic struct pcie_port.
Internal interfaces can accept pointers to the device-specific struct,
which makes them more straightforward.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: imx6: Pass struct imx6_pcie to PHY accessors
Bjorn Helgaas [Wed, 12 Oct 2016 03:09:32 +0000 (22:09 -0500)]
PCI: imx6: Pass struct imx6_pcie to PHY accessors

Pass the struct imx6_pcie pointer, not dbi_base address, to PHY accessors.
This enables future simplifications.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: imx6: Removed unused struct imx6_pcie.mem_base
Bjorn Helgaas [Thu, 6 Oct 2016 18:35:17 +0000 (13:35 -0500)]
PCI: imx6: Removed unused struct imx6_pcie.mem_base

Removed the unused struct imx6_pcie.mem_base member.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: imx6: Remove redundant of_node pointer
Bjorn Helgaas [Thu, 6 Oct 2016 18:35:18 +0000 (13:35 -0500)]
PCI: imx6: Remove redundant of_node pointer

"np" and "node" are redundant copies of the of_node pointer.  Remove "np"
and use "node" instead.  Replace the "fsl,max-link-speed" use with "node"
as well.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: imx6: Add local struct device pointers
Bjorn Helgaas [Thu, 6 Oct 2016 18:35:18 +0000 (13:35 -0500)]
PCI: imx6: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: hisi: Use generic DesignWare accessors
Bjorn Helgaas [Thu, 6 Oct 2016 18:34:24 +0000 (13:34 -0500)]
PCI: hisi: Use generic DesignWare accessors

The dw_pcie_readl_rc() and dw_pcie_writel_rc() interfaces already add in
pp->dbi_base, so use those instead of doing it ourselves in the hisi
driver.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: hisi: Remove redundant struct hisi_pcie.reg_base
Bjorn Helgaas [Thu, 6 Oct 2016 18:34:23 +0000 (13:34 -0500)]
PCI: hisi: Remove redundant struct hisi_pcie.reg_base

Remove the struct hisi_pcie.reg_base member, which is a duplicate of the
generic pp.dbi_base member.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: hisi: Name private struct pointer "hisi_pcie" consistently
Bjorn Helgaas [Wed, 12 Oct 2016 02:40:32 +0000 (21:40 -0500)]
PCI: hisi: Name private struct pointer "hisi_pcie" consistently

Most struct hisi_pcie pointers are already called "hisi_pcie".  Change
the rest of them to match.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: hisi: Remove unused platform data
Bjorn Helgaas [Thu, 6 Oct 2016 18:34:25 +0000 (13:34 -0500)]
PCI: hisi: Remove unused platform data

The hisi driver never uses the platform drvdata pointer, so don't bother
setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: hisi: Add local struct device pointers
Bjorn Helgaas [Thu, 6 Oct 2016 18:34:25 +0000 (13:34 -0500)]
PCI: hisi: Add local struct device pointers

Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: exynos: Reorder struct exynos_pcie
Bjorn Helgaas [Thu, 6 Oct 2016 18:33:40 +0000 (13:33 -0500)]
PCI: exynos: Reorder struct exynos_pcie

Reorder struct exynos_pcie to put generic fields first.  No functional
change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: exynos: Pass device-specific struct to internal functions
Bjorn Helgaas [Thu, 6 Oct 2016 18:33:39 +0000 (13:33 -0500)]
PCI: exynos: Pass device-specific struct to internal functions

Only interfaces used from outside the driver, e.g., those called by the
DesignWare core, need to accept pointers to the generic struct pcie_port.
Internal interfaces can accept pointers to the device-specific struct,
which makes them more straightforward.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7 years agoPCI: exynos: Name private struct pointer "exynos_pcie" consistently
Bjorn Helgaas [Thu, 6 Oct 2016 18:33:39 +0000 (13:33 -0500)]
PCI: exynos: Name private struct pointer "exynos_pcie" consistently

Most struct exynos_pcie pointers are already called "exynos_pcie".  Change
the rest of them to match.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>