deliverable/linux.git
8 years agompt3sas: Refcount fw_events and fix unsafe list usage
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:31 +0000 (17:30 +0530)] 
mpt3sas: Refcount fw_events and fix unsafe list usage

The fw_event_work struct is concurrently referenced at shutdown. Add a
refcount to protect it and refactor the code to use it.

Additionally, refactor _scsih_fw_event_cleanup_queue() such that it no
longer iterates over the list without holding the lock since
_firmware_event_work() concurrently deletes items from the list.

This patch is ported from commit 008549f6e8a1 ("mpt2sas: Refcount
fw_events and fix unsafe list usage"). These changes are also required
for mpt3sas.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: Refcount sas_device objects and fix unsafe list usage
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:30 +0000 (17:30 +0530)] 
mpt3sas: Refcount sas_device objects and fix unsafe list usage

sas_device objects can be referenced concurrently throughout the driver.
We need a way to make sure threads can't delete them out from under each
other. This patch adds the refcount and refactors the code to use it.

Additionally, we cannot iterate over the sas_device_list without holding
the lock or we risk corrupting random memory if items are added or
deleted as we iterate. This patch refactors _scsih_probe_sas() to use
the sas_device_list in a safe way.

This patch is ported from the following mpt2sas driver commit
d224fe0d6097 ("mpt2sas: Refcount sas_device objects and fix unsafe list
usage").

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: sysfs attribute to report Backup Rail Monitor Status
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:29 +0000 (17:30 +0530)] 
mpt3sas: sysfs attribute to report Backup Rail Monitor Status

A new sysfs shost attribute called "BMR_status" is implemented to report
Backup Rail Monitor status.

This attribute is located in:

        /sys/class/scsi_host/host#/BMR_status

When reading this adapter attribute, the driver will output the state of
GPIO[24]. It returns "0" if BMR is healthy and "1" for failure.

If it returns an empty string then it means that there was an error
while obtaining the BMR status. Check dmesg for what error has occurred.

This sysfs shost attribute is mainly for WarpDrive controllers.

This commit is a port of 6c265660c262 ("mpt2sas: Provide sysfs attribute
to report Backup Rail Monitor Status").

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: Ported WarpDrive product SSS6200 support
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:28 +0000 (17:30 +0530)] 
mpt3sas: Ported WarpDrive product SSS6200 support

Ported the following list of WarpDrive-specific patches:

1. commit 0bdccdb0a090ad8dc5f851cad5e843244c410ee8 ("mpt2sas: WarpDrive
   New product SSS6200 support added")

2. commit 82a452581230b3ffc9d6475dffdb2568497b5fec ("mpt2sas: WarpDrive
   Infinite command retries due to wrong scsi command entry in MPI
   message")

3. commit ba96bd0b1d4a4e11f23671e1f375a5c8f46b0fe7 ("mpt2sas: Support
   for greater than 2TB capacity WarpDrive")

4. commit 4da7af9494b2f98a1503a2634059300c3e4615e6 ("mpt2sas: Do not
   retry a timed out direct IO for Warpdrive")

5. commit daeaa9df92bd742f4e6d4d6039d689277a8e31bd ("mpt2sas: Avoid type
   casting for direct I/O commands").

Also set the mpt2_ioctl_iocinfo adapter_type to:

1. MPT3_IOCTL_INTERFACE_SAS3 for Gen3 HBAs

2. MPT2_IOCTL_INTERFACE_SAS2_SSS6200 for Warp Drive

3. MPT2_IOCTL_INTERFACE_SAS2  for other Gen2 HBAs

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: fix for driver fails EEH, recovery from injected pci bus error
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:27 +0000 (17:30 +0530)] 
mpt3sas: fix for driver fails EEH, recovery from injected pci bus error

This patch stops the driver to invoke kthread (which remove the dead
ioc) for some time while EEH recovery has started.

This patch is a port of commit b4730fb6e54a ("mpt2sas: fix for driver
fails EEH, recovery from injected pci bus error")'.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: Manage MSI-X vectors according to HBA device type
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:26 +0000 (17:30 +0530)] 
mpt3sas: Manage MSI-X vectors according to HBA device type

1. Do not enable MSI-X vectors for SAS2008 B0 controllers

2. Enable a single MSI-X vector for the following controller:

   a. SAS2004
   b. SAS2008
   c. SAS2008_1
   d. SAS2008_2
   e. SAS2008_3
   f. SAS2116_1
   g. SAS2116_2

3. Enable Combined Reply Post Queue Support (i.e. 96 MSI-X vectors)
   for Gen3 Invader/Fury C0 and above revision HBAs

4. Enable Combined Reply Post Queue Support (i.e. 96 MSI-X vectors)
   for all Intruder and Cutlass HBAs

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: Don't send PHYDISK_HIDDEN RAID action request on SAS2 HBAs
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:25 +0000 (17:30 +0530)] 
mpt3sas: Don't send PHYDISK_HIDDEN RAID action request on SAS2 HBAs

Avoid sending PHYDISK_HIDDEN RAID action requests to SAS2 controllers
since they don't support it.

Also enable fast_path only for SAS3 HBAs.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: Build MPI SGL LIST on GEN2 HBAs and IEEE SGL LIST on GEN3 HBAs
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:24 +0000 (17:30 +0530)] 
mpt3sas: Build MPI SGL LIST on GEN2 HBAs and IEEE SGL LIST on GEN3 HBAs

Gen2 HBAs use MPI scatter-gather lists whereas Gen3 HBAs use IEEE
scatter-gather lists. Modify the common code part in such a way that it
will build IEEE SGL tables for Gen3 HBAs and MPI SGL tables for Gen2
HBAs.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt2sas, mpt3sas: Remove SCSI_MPTXSAS_LOGGING entry from Kconfig
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:23 +0000 (17:30 +0530)] 
mpt2sas, mpt3sas: Remove SCSI_MPTXSAS_LOGGING entry from Kconfig

Currently there is a logging level option provided for each of our
drivers in the kernel configuration utility. Users can enable this
option to get more verbose information. By default it is enabled.

Only when this option is enabled will the functions which display the
required information get compiled in.

As we are merging the both drivers we can no longer provide this
configuration option. Remove the SCSI_MPTXSAS_LOGGING entry from Kconfig
and unconditionally enable logging (by removing the #ifdef
CONFIG_SCSI_MPT3SAS_LOGGING preprocessor check conditions) so that all
functions which are defined to display more verbose information get
compiled in.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: Define 'hba_mpi_version_belonged' IOC variable
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:22 +0000 (17:30 +0530)] 
mpt3sas: Define 'hba_mpi_version_belonged' IOC variable

1. Use 'hba_mpi_version_belonged' IOC varable to uniquely identify each
individual generation driver functionality at runtime.

2. Declare global variable 'driver_name' and use this variable while
reserving PCI regions and while allocating the IRQs.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt2sas: Remove .c and .h files from mpt2sas driver
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:21 +0000 (17:30 +0530)] 
mpt2sas: Remove .c and .h files from mpt2sas driver

Remove .c and .h files which are no longer needed from mpt2sas
driver. We are reusing this code from mpt3sas.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agoMerge branch 'pm-tools'
Rafael J. Wysocki [Wed, 11 Nov 2015 23:22:56 +0000 (00:22 +0100)] 
Merge branch 'pm-tools'

* pm-tools:
  Creating a common structure initialization pattern for struct option
  cpupower: Enable disabled Cstates if they are below max latency
  cpupower: Remove debug message when using cpupower idle-set -D switch
  cpupower: cpupower monitor reports uninitialized values for offline cpus
  tools/power turbostat: bugfix: print MAX_NON_TURBO_RATIO
  tools/power turbostat: simplify Bzy_MHz calculation

8 years agoMerge branch 'pm-domains'
Rafael J. Wysocki [Wed, 11 Nov 2015 23:22:50 +0000 (00:22 +0100)] 
Merge branch 'pm-domains'

* pm-domains:
  PM / Domains: Allocate memory outside domain locks
  PM / Domains: Remove dev->driver check for runtime PM

8 years agompt2sas: Move Gen2 HBA's device registration to a separate file
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:20 +0000 (17:30 +0530)] 
mpt2sas: Move Gen2 HBA's device registration to a separate file

1. Create a mpt2sas_module.c file for mpt2sas where GEN2 HBA devices
register with PCI, SML, IOCTL subsystems.

2. Updated the Makefile to use the object files from mpt3sas folder.

3. Defined a compilation flag SCSI_MPT2SAS which can be used to not
include those sections of code from mpt3sas driver which are not
required for mpt2sas driver.

4. Inherited automatic diag buffer feature from mpt3sas driver.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: Move Gen3 HBA's device registration to a separate file
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:19 +0000 (17:30 +0530)] 
mpt3sas: Move Gen3 HBA's device registration to a separate file

Created a mpt3sas_module.c file for mpt3sas driver where it can register
SAS3 HBA devices with PCI, SML, IOCTL subsystems. Also removed the
corresponding interfaces from mpt3sas_scsih.c file.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt3sas: Added mpt2sas driver definitions
Sreekanth Reddy [Wed, 11 Nov 2015 12:00:18 +0000 (17:30 +0530)] 
mpt3sas: Added mpt2sas driver definitions

1. Added mpt2sas driver related macros in mpt3sas header files

2. Made scsi host's, raid class', pci's, ioctl's callback functions
global so that both drivers can use them.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agompt2sas: Use mpi headers from mpt3sas
Christoph Hellwig [Wed, 11 Nov 2015 12:00:17 +0000 (17:30 +0530)] 
mpt2sas: Use mpi headers from mpt3sas

Use a single set of the hardware description headers instead of having
them in the source tree twice.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
8 years agotools include: Add compiler.h to list.h
Arnaldo Carvalho de Melo [Wed, 11 Nov 2015 15:54:42 +0000 (12:54 -0300)] 
tools include: Add compiler.h to list.h

list.h needs WRITE_ONCE() since 7f5f873c6a07 ("rculist: Use WRITE_ONCE()
when deleting from reader-visible list") add it before including the
kernel's list.h file.

This fixes builds of 'make perf-tar-src-pkg' perf tool tarball builds,
i.e. out of tree builds.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-e0rb8f7jwz0jn24ttyick9u6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
8 years agoperf probe: Verify parameters in two functions
Wang Nan [Fri, 6 Nov 2015 09:50:15 +0000 (09:50 +0000)] 
perf probe: Verify parameters in two functions

On kernel with only one out of CONFIG_KPROBE_EVENTS and
CONFIG_UPROBE_EVENTS enabled, 'perf probe -d' causes a segfault because
perf_del_probe_events() calls probe_file__get_events() with a negative
fd.

This patch fixes it by adding parameter validation at the entry of
probe_file__get_events() and probe_file__get_rawlist(). Since they are
both non-static public functions (in .h file), parameter verifying is
required.

v1 -> v2: Verify fd at the head of probe_file__get_rawlist() instead of
          checking at call site (suggested by Masami and Arnaldo at [1,2]).

[1] http://lkml.kernel.org/r/50399556C9727B4D88A595C8584AAB37526048E3@GSjpTKYDCembx32.service.hitachi.net
[2] http://lkml.kernel.org/r/20151105155830.GV13236@kernel.org

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1446803415-83382-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
8 years agoperf session: Add missing newlines to some pr_err() calls
Arnaldo Carvalho de Melo [Mon, 9 Nov 2015 20:12:03 +0000 (17:12 -0300)] 
perf session: Add missing newlines to some pr_err() calls

Before:

  [acme@zoo linux]$ perf evlist
  WARNING: The perf.data file's data size field is 0 which is unexpected.
  Was the 'perf record' command properly terminated?
  non matching sample_type[acme@zoo linux]$

After:

  [acme@zoo linux]$ perf evlist
  WARNING: The perf.data file's data size field is 0 which is unexpected.
  Was the 'perf record' command properly terminated?
  non matching sample_type
  [acme@zoo linux]$

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-wscok3a2s7yrj8156oc2r6qe@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
8 years agoperf annotate: Support full source file paths for srcline fix
Michael Petlan [Mon, 9 Nov 2015 15:33:31 +0000 (16:33 +0100)] 
perf annotate: Support full source file paths for srcline fix

The --full-paths option did not show the full source file paths in the 'perf
annotate' tool, because the value of the option was not propagated into the
related functions.

With this patch the value of the --full-paths option is known to the function
that composes the srcline string, so it prints the full path when necessary.

Committer Note:

This affects annotate when the --print-line option is used:

  # perf annotate -h 2>&1 | grep print-line
      -l, --print-line      print matching source lines (may be slow)

Looking just at the lines that should be affected by this change:

Before:

  # perf annotate --print-line --full-paths --stdio fput | grep '\.[ch]:[0-9]\+'
     94.44 atomic64_64.h:114
      5.56 file_table.c:265
   file_table.c:265    5.56 :   ffffffff81219a00:       callq  ffffffff81769360 <__fentry__>
   atomic64_64.h:114   94.44 :   ffffffff81219a05:       lock decq 0x38(%rdi)

After:

  # perf annotate --print-line --full-paths --stdio fput | grep '\.[ch]:[0-9]\+'
     94.44 /home/git/linux/arch/x86/include/asm/atomic64_64.h:114
      5.56 /home/git/linux/fs/file_table.c:265
   /home/git/linux/fs/file_table.c:265    5.56 :   ffffffff81219a00:       callq  ffffffff81769360 <__fentry__>
   /home/git/linux/arch/x86/include/asm/atomic64_64.h:114   94.44 :   ffffffff81219a05:       lock decq 0x38(%rdi)
  #

Signed-off-by: Michael Petlan <mpetlan@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://permalink.gmane.org/gmane.linux.kernel.perf.user/2365
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
8 years agoperf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore
Yunlong Song [Mon, 9 Nov 2015 03:10:03 +0000 (11:10 +0800)] 
perf test: Add llvm-src-base.c and llvm-src-kbuild.c to .gitignore

Commit b31de018a6284a25e0fdfeb028e724f8417ec3b1 ("perf test: Enhance the
LLVM test: update basic BPF test program") dynamically creates file
llvm-src-base.c during the perf building.

Similarly, the commit 7af3f3d55b80cce40ad94b6b8e173dccedaf25e6 ("perf
test: Enhance the LLVM tests: add kbuild test") dynamically creates file
llvm-src-kbuild.c during the perf building. Add them to .gitignore.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: b31de018a628 ("perf test: Enhance the LLVM test: update basic BPF test program")
Fixes: 7af3f3d55b80 ("perf test: Enhance the LLVM tests: add kbuild test")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
8 years agoMerge tag 'firewire-update' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
Linus Torvalds [Wed, 11 Nov 2015 18:21:34 +0000 (10:21 -0800)] 
Merge tag 'firewire-update' of git://git./linux/kernel/git/ieee1394/linux1394

Pull firewire fix from Stefan Richter:
 "Work around JMicron initialization quirk, which ffected isochronous
  transmission, e.g. audio via FFADO or ALSA"

* tag 'firewire-update' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
  firewire: ohci: fix JMicron JMB38x IT context discovery

8 years agoDocumentation: Add minimal Mutt config for using Gmail
Eddie Kovsky [Fri, 6 Nov 2015 06:25:35 +0000 (23:25 -0700)] 
Documentation: Add minimal Mutt config for using Gmail

This patch provides a minimal configuration to set up Mutt for
submitting plain text patches using Gmail.

Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>
Reviewed-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
8 years agoDocumentation: Add note on sending files directly with Mutt
Eddie Kovsky [Fri, 6 Nov 2015 06:23:01 +0000 (23:23 -0700)] 
Documentation: Add note on sending files directly with Mutt

Like 'git send-email', Mutt can also be used to send patches generated
with 'git format-patch'. This works regardless of the editor the
contributor has set up to use with Mutt.

Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>
Reviewed-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
8 years agoMerge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Wed, 11 Nov 2015 17:45:24 +0000 (09:45 -0800)] 
Merge branch 'for-linus-2' of git://git./linux/kernel/git/viro/vfs

Pull vfs update from Al Viro:

 - misc stable fixes

 - trivial kernel-doc and comment fixups

 - remove never-used block_page_mkwrite() wrapper function, and rename
   the function that is _actually_ used to not have double underscores.

* 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  fs: 9p: cache.h: Add #define of include guard
  vfs: remove stale comment in inode_operations
  vfs: remove unused wrapper block_page_mkwrite()
  binfmt_elf: Correct `arch_check_elf's description
  fs: fix writeback.c kernel-doc warnings
  fs: fix inode.c kernel-doc warning
  fs/pipe.c: return error code rather than 0 in pipe_write()
  fs/pipe.c: preserve alloc_file() error code
  binfmt_elf: Don't clobber passed executable's file header
  FS-Cache: Handle a write to the page immediately beyond the EOF marker
  cachefiles: perform test on s_blocksize when opening cache file.
  FS-Cache: Don't override netfs's primary_index if registering failed
  FS-Cache: Increase reference of parent after registering, netfs success
  debugfs: fix refcount imbalance in start_creating

8 years agoMerge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Wed, 11 Nov 2015 17:23:07 +0000 (09:23 -0800)] 
Merge branch 'linus' of git://git./linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "This fixes a bug in the algif_hash interface that may lead to crashes
  when used with certain algorithms such as HMAC"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: algif_hash - Only export and import on sockets with data

8 years agoMerge tag 'pwm/for-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry...
Linus Torvalds [Wed, 11 Nov 2015 17:16:10 +0000 (09:16 -0800)] 
Merge tag 'pwm/for-4.4-rc1' of git://git./linux/kernel/git/thierry.reding/linux-pwm

Pull pwm updates from Thierry Reding:
 "This round contains a couple of new drivers for the Marvell Berlin
  family of SoCs, various SoCs from Renesas and Broadcom as well as the
  backlight PWM present on MediaTek SoCs.

  Further existing drivers are extended to support a wider range of
  hardware.

  The remaining patches are minor fixes and cleanups across the board.

  Note that one of the patches included in this pull request is against
  arch/unicore32.  I've included it here because I couldn't get a
  response from Guan Xuetao and I consider the change low-risk.
  Equivalent patches have been merged and tested in Samsung and PXA
  trees.  The goal is to finally get rid of legacy code paths that have
  repeatedly been causing headaches"

* tag 'pwm/for-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (24 commits)
  pwm: sunxi: Fix whitespace issue
  pwm: sysfs: Make use of the DEVICE_ATTR_[RW][WO] macro's
  pwm: sysfs: Remove unnecessary temporary variable
  unicore32: nb0916: Use PWM lookup table
  pwm: pwm-rcar: Revise the device tree binding document about compatible
  pwm: Return -ENODEV if no PWM lookup match is found
  pwm: sun4i: Add support for PWM controller on sun5i SoCs
  pwm: Set enable state properly on failed call to enable
  pwm: lpss: Add support for runtime PM
  pwm: lpss: Add more Intel Broxton IDs
  pwm: lpss: Support all four PWMs on Intel Broxton
  pwm: lpss: Add support for multiple PWMs
  pwm-pca9685: enable ACPI device found on Galileo Gen2
  pwm: Add MediaTek display PWM driver support
  dt-bindings: pwm: Add MediaTek display PWM bindings
  pwm: tipwmss: Enable on TI DRA7x and AM437x
  pwm: atmel-hlcdc: add sama5d2 SoC support.
  pwm: Add Broadcom BCM7038 PWM controller support
  Documentation: dt: add Broadcom BCM7038 PWM controller binding
  pwm: Add support for R-Car PWM Timer
  ...

8 years agoDocumentation: dontdiff: remove media from dontdiff
Wang YanQing [Thu, 29 Oct 2015 17:15:39 +0000 (01:15 +0800)] 
Documentation: dontdiff: remove media from dontdiff

media will hide all the changes in drivers/media.

Signed-off-by: Wang YanQing <udknight@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
8 years agoDocumentation/SubmittingPatches: discuss In-Reply-To
Chris Metcalf [Thu, 5 Nov 2015 20:21:47 +0000 (15:21 -0500)] 
Documentation/SubmittingPatches: discuss In-Reply-To

Add a paragraph suggesting best practices for when to link patches
to previous LKML messages via In-Reply-To.

Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
[jc: moved the added text to a separate section]
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
8 years agoRemove email address from Documentation/filesystems/overlayfs.txt
NeilBrown [Sat, 7 Nov 2015 06:38:58 +0000 (17:38 +1100)] 
Remove email address from Documentation/filesystems/overlayfs.txt

I'm getting a surprising large number of questions about overlayfs sent
to me personally, rather than to a relevant mailing list.

So remove my email address from the documentation, and add a note
about looking in the MAINTAINERS file.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
8 years agocan-doc: Add missing semicolon to example
Stefan Tatschner [Mon, 9 Nov 2015 13:17:09 +0000 (14:17 +0100)] 
can-doc: Add missing semicolon to example

The example code for CAN_BCM,

connect(s, (struct sockaddr *)&addr, sizeof(addr))

lacks a semicolon at the end of the line. This patch adds that
missing semicolon to ensure that the given code snippet actually
compiles.

Signed-off-by: Stefan Tatschner <rumpelsepp@sevenbyte.org>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
8 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Wed, 11 Nov 2015 17:03:01 +0000 (09:03 -0800)] 
Merge branch 'next' of git://git./linux/kernel/git/rzhang/linux

Pull thermal updates from Zhang Rui:

 - Implement generic devfreq cooling mechanism through frequency
   reduction for devices using devfreq.  From Ørjan Eide and Javi
   Merino.

 - Introduce OMAP3 support on TI SoC thermal driver.  From Pavel Mack
   and Eduardo Valentin.

 - A bounch of small fixes on devfreq_cooling, Exynos, IMX, Armada, and
   Rockchip thermal drivers.

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (24 commits)
  thermal: exynos: Directly return 0 instead of using local ret variable
  thermal: exynos: Remove unneeded semicolon
  thermal: exynos: Use IS_ERR() because regulator cannot be NULL
  thermal: exynos: Fix first temperature read after registering sensor
  thermal: exynos: Fix unbalanced regulator disable on probe failure
  devfreq_cooling: return on allocation failure
  thermal: rockchip: support the sleep pinctrl state to avoid glitches in s2r
  dt-bindings: rockchip-thermal: Add the pinctrl states in this document
  thermal: devfreq_cooling: Make power a u64
  thermal: devfreq_cooling: use a thermal_cooling_device for register and unregister
  thermal: underflow bug in imx_set_trip_temp()
  thermal: armada: Fix possible overflow in the Armada 380 thermal sensor formula
  thermal: imx: register irq handler later in probe
  thermal: rockhip: fix setting thermal shutdown polarity
  thermal: rockchip: fix handling of invalid readings
  devfreq_cooling: add trace information
  thermal: Add devfreq cooling
  PM / OPP: get the voltage for all OPPs
  tools/thermal: tmon: use pkg-config also for CFLAGS
  linux/thermal.h: rename KELVIN_TO_CELSIUS to DECI_KELVIN_TO_CELSIUS
  ...

8 years agoblock: don't hardcode blk_qc_t -> tag mask
Jens Axboe [Wed, 11 Nov 2015 16:37:34 +0000 (09:37 -0700)] 
block: don't hardcode blk_qc_t -> tag mask

Use the shift/mask we use elsewhere.

Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agodax_io(): don't let non-error value escape via retval instead of EFAULT
Al Viro [Wed, 11 Nov 2015 02:42:49 +0000 (19:42 -0700)] 
dax_io(): don't let non-error value escape via retval instead of EFAULT

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agoblock: fix blk-core.c kernel-doc warning
Randy Dunlap [Sat, 31 Oct 2015 01:36:16 +0000 (18:36 -0700)] 
block: fix blk-core.c kernel-doc warning

Fix kernel-doc warning in blk-core.c:

Warning(..//block/blk-core.c:1549): No description found for parameter 'same_queue_rq'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agofs/block_dev.c: Remove WARN_ON() when inode writeback fails
Vivek Goyal [Mon, 9 Nov 2015 16:23:40 +0000 (09:23 -0700)] 
fs/block_dev.c: Remove WARN_ON() when inode writeback fails

If a block device is hot removed and later last reference to device
is put, we try to writeback the dirty inode. But device is gone and
that writeback fails.

Currently we do a WARN_ON() which does not seem to be the right thing.
Convert it to a ratelimited kernel warning.

Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
[jmoyer@redhat.com: get rid of unnecessary name initialization, 80 cols]
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agoNVMe: add support for Apple NVMe controller
Stephan Günther [Tue, 3 Nov 2015 23:49:45 +0000 (00:49 +0100)] 
NVMe: add support for Apple NVMe controller

Add PCI ID of Apple's NVMe controller.

Signed-off-by: Stephan Guenther <guenther@tum.de>
Signed-off-by: Maurice Leclaire <leclaire@in.tum.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agoNVMe: use split lo_hi_{read,write}q
Stephan Günther [Sun, 8 Nov 2015 01:07:02 +0000 (18:07 -0700)] 
NVMe: use split lo_hi_{read,write}q

Some controllers may require ordered split transfers even on 64bit
machines, e.g. Apple's NVMe controller as found in the MacBook8,1 and
MacBookAir7,1 (256/512GB models).

This patch enforces ordered split transfers on 64bit platforms, which
works around that issue for all controllers. As pointed out by Christoph
[1] there should be no performance impact due to that modification.

[1] http://lists.infradead.org/pipermail/linux-nvme/2015-November/002965.html

Signed-off-by: Stephan Guenther <guenther@tum.de>
Signed-off-by: Maurice Leclaire <leclaire@in.tum.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Updated by me to explicitly use lo_hi_read/writeq instead of playing
define tricks.

Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agoblk-mq: mark __blk_mq_complete_request() static
Jens Axboe [Thu, 5 Nov 2015 21:32:55 +0000 (14:32 -0700)] 
blk-mq: mark __blk_mq_complete_request() static

It's no longer used outside of blk-mq core.

Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agoMAINTAINERS: add reference to new linux-block list
Jens Axboe [Thu, 5 Nov 2015 20:29:25 +0000 (13:29 -0700)] 
MAINTAINERS: add reference to new linux-block list

In the past, I've resisted doing a non-lkml related block/storage
list. But we have more activity now than we previously did, and
ain't nobody got time to track and follow lkml.

So now linux-block@vger.kernel.org exists. Please CC your patches
related to block/storage here, and we'll have an easier time
tracking them.

Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agoNVMe: Increase the max transfer size when mdts is 0
Sathyavathi M [Thu, 5 Nov 2015 19:52:28 +0000 (12:52 -0700)] 
NVMe: Increase the max transfer size when mdts is 0

This patch address the issue when IO with 128KB from FIO is split into
two parts, 124KB and 4KB, due to max transfer size(127KB). This degrades
the device performance.

Signed-off-by: Sathyavathi M <sathya.m@samsung.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agobrd: Refuse improperly aligned discard requests
Jan Kara [Wed, 4 Nov 2015 16:13:39 +0000 (17:13 +0100)] 
brd: Refuse improperly aligned discard requests

Currently when improperly aligned discard request is submitted, we just
silently discard more / less data which results in filesystem corruption
in some cases. Refuse such misaligned requests.

Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agoALSA: hda/hdmi - apply Skylake fix-ups to Broxton display codec
Lu, Han [Wed, 11 Nov 2015 08:54:27 +0000 (16:54 +0800)] 
ALSA: hda/hdmi - apply Skylake fix-ups to Broxton display codec

Broxton and Skylake have the same behavior on display audio. So this patch
applys Skylake fix-ups to Broxton.

Signed-off-by: Lu, Han <han.lu@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoMIPS: BMIPS: Enable GZIP ramdisk and timed printks
Florian Fainelli [Fri, 16 Oct 2015 19:51:58 +0000 (12:51 -0700)] 
MIPS: BMIPS: Enable GZIP ramdisk and timed printks

Update bmips_be_defconfig and bmips_stb_defconfig to have GZIP ramdisk
support enabled by default as well was timed printks.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Kevin Cernekee <cernekee@gmail.com>
Reviewed-by: Dragan Stancevic <dragan.stancevic@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: blogic@openwrt.org
Cc: jogo@openwrt.org
Patchwork: https://patchwork.linux-mips.org/patch/11307/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoALSA: ctxfi: constify rsc ops structures
Julia Lawall [Sun, 8 Nov 2015 22:40:41 +0000 (23:40 +0100)] 
ALSA: ctxfi: constify rsc ops structures

The various rsc ops structures are never modified, so declare them as
const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoMIPS: Add xilfpga defconfig
Zubair Lutfullah Kakakhel [Mon, 26 Oct 2015 11:30:57 +0000 (11:30 +0000)] 
MIPS: Add xilfpga defconfig

Add defconfig for MIPSfpga

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: robh+dt@kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11363/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: xilfpga: Add mipsfpga platform code
Zubair Lutfullah Kakakhel [Mon, 26 Oct 2015 11:30:56 +0000 (11:30 +0000)] 
MIPS: xilfpga: Add mipsfpga platform code

The xilfpga platform will be DT only.

Add required platform code.
DT files have already been added separately.

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: robh+dt@kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11364/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: xilfpga: Add xilfpga device tree files.
Zubair Lutfullah Kakakhel [Mon, 26 Oct 2015 11:30:55 +0000 (11:30 +0000)] 
MIPS: xilfpga: Add xilfpga device tree files.

Add device tree files for the MIPSfpga platform.

See Documentation/devicetree/bindings/mips/img/xilfpga.txt
for details about MIPSfpga

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: robh+dt@kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11362/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agodt-bindings: MIPS: Document xilfpga bindings and boot style
Zubair Lutfullah Kakakhel [Mon, 26 Oct 2015 11:30:54 +0000 (11:30 +0000)] 
dt-bindings: MIPS: Document xilfpga bindings and boot style

Xilfpga boots only with device-tree. Document the required properties
and the unique boot style

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: robh+dt@kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11361/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Make MIPS_CMDLINE_DTB default
Jonas Gorski [Mon, 12 Oct 2015 11:13:03 +0000 (13:13 +0200)] 
MIPS: Make MIPS_CMDLINE_DTB default

Seval of-enabled machines (bmips, lantiq, xlp, pistachio, ralink) copied
the arguments from dtb to arcs_command_line to prevent the kernel from
overwriting them.

Since there is now an option to keep the dtb arguments, default to the
new option remove the "backup" to arcs_command_line in case of USE_OF is
enabled, except for those platforms that still take the bootloader
arguments or do not use any at all.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: John Crispin <blogic@openwrt.org>
Cc: Ganesan Ramalingam <ganesanr@broadcom.com>
Cc: Jayachandran C <jchandra@broadcom.com>
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: James Hartley <james.hartley@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/11285/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Make the kernel arguments from dtb available
Jonas Gorski [Mon, 12 Oct 2015 11:13:02 +0000 (13:13 +0200)] 
MIPS: Make the kernel arguments from dtb available

Similar to how arm allows using selecting between bootloader arguments,
dtb arguments and both, allow to select them on mips. But since we have
less control over the place of the dtb do not modify it but instead use
the boot_command_line for merging them.

The default is "use bootloader arguments" to keep the current behaviour
as default.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: John Crispin <blogic@openwrt.org>
Cc: Ganesan Ramalingam <ganesanr@broadcom.com>
Cc: Jayachandran C <jchandra@broadcom.com>
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: James Hartley <james.hartley@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/11284/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Use USE_OF as the guard for appended dtb
Jonas Gorski [Mon, 12 Oct 2015 11:13:01 +0000 (13:13 +0200)] 
MIPS: Use USE_OF as the guard for appended dtb

Since OF is now a user selectable symbol, the choice for appended dtb
support should only be visible when USE_OF is selected, as this
indicates actual machine support for device tree in MIPS.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: John Crispin <blogic@openwrt.org>
Cc: Ganesan Ramalingam <ganesanr@broadcom.com>
Cc: Jayachandran C <jchandra@broadcom.com>
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: James Hartley <james.hartley@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/11283/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BCM63XX: Use pr_* instead of printk
Gregory Fong [Wed, 14 Oct 2015 11:27:38 +0000 (04:27 -0700)] 
MIPS: BCM63XX: Use pr_* instead of printk

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: Joe Perches <joe@perches.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Nicolas Schichan <nschichan@freebox.fr>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11300/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Loongson: Cleanup CONFIG_LOONGSON_SUSPEND.
Huacai Chen [Wed, 7 Oct 2015 06:07:59 +0000 (14:07 +0800)] 
MIPS: Loongson: Cleanup CONFIG_LOONGSON_SUSPEND.

Now LOONGSON_CHIPCFG register definition doesn't depend on CPUFREQ any
more, so CPU_SUPPORTS_CPUFREQ is no longer needed for suspend/resume.
Remove CONFIG_LOONGSON_SUSPEND and use CONFIG_SUSPEND instead.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11274/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: lantiq: Disable xbar fpi burst mode
John Crispin [Thu, 5 Nov 2015 02:56:23 +0000 (03:56 +0100)] 
MIPS: lantiq: Disable xbar fpi burst mode

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11458/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: lantiq: Force the crossbar to big endian
John Crispin [Wed, 4 Nov 2015 12:14:15 +0000 (13:14 +0100)] 
MIPS: lantiq: Force the crossbar to big endian

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11450/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: lantiq: Initialize the USB core on boot
John Crispin [Wed, 4 Nov 2015 12:14:14 +0000 (13:14 +0100)] 
MIPS: lantiq: Initialize the USB core on boot

There is a DWC2 USB core in these SoCs. To make USB work we need to first
reset and power the state machine. These are SoC specific registers and
not part of the actual USB core.

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11449/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: lantiq: Return correct value for fpi clock on ar9
John Crispin [Wed, 4 Nov 2015 12:14:13 +0000 (13:14 +0100)] 
MIPS: lantiq: Return correct value for fpi clock on ar9

Some configurations of AR9 reported the incorrect speed for the fpi bus.

Signed-off-by: Ben Mulvihill <ben.mulvihill@gmail.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11448/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: ralink: Add missing clock on rt305x
John Crispin [Wed, 4 Nov 2015 10:50:14 +0000 (11:50 +0100)] 
MIPS: ralink: Add missing clock on rt305x

The rt305x support is missing a clock required by the ethernet driver.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11447/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: ralink: Put the pci bus into reset state before rebooting the SoC
John Crispin [Wed, 4 Nov 2015 10:50:13 +0000 (11:50 +0100)] 
MIPS: ralink: Put the pci bus into reset state before rebooting the SoC

Some pcie cards have problems after a reboot without this.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11446/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: ralink: Don't set pm_power_off
John Crispin [Wed, 4 Nov 2015 10:50:12 +0000 (11:50 +0100)] 
MIPS: ralink: Don't set pm_power_off

Setting pm_power_off is apprently wrong and makes drivers such as
gpio-poweroff not work.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11445/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: ralink: Remove check for CONFIG_PCI on non-PCI SoCs
John Crispin [Wed, 4 Nov 2015 10:50:11 +0000 (11:50 +0100)] 
MIPS: ralink: Remove check for CONFIG_PCI on non-PCI SoCs

The code currently panics if PCI is enabled but the SoC has no PCI bus.
This check is superfluous as the driver only loads if enabled in the
devicetree.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11444/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: ralink: Fix invalid tick count
John Crispin [Wed, 4 Nov 2015 10:50:10 +0000 (11:50 +0100)] 
MIPS: ralink: Fix invalid tick count

The current code adds the delta twice, which is obviously wrong.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11443/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: ralink: Add tty detection
John Crispin [Thu, 5 Nov 2015 02:59:58 +0000 (03:59 +0100)] 
MIPS: ralink: Add tty detection

MT7688 has several uarts that can be used for console. There are several
boards in the wild, that use ttyS1 or ttyS2. This patch applies a simply
autodetection routine to figure out which ttyS the bootloader used as
console. The uarts come up in 6 bit mode by default. The bootloader will
have set 8 bit mode on the console. Find that 8bit tty and use it.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11459/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: ralink: Fix usb issue during frequency scaling
John Crispin [Wed, 4 Nov 2015 10:50:08 +0000 (11:50 +0100)] 
MIPS: ralink: Fix usb issue during frequency scaling

If the USB HCD is running and the cpu is scaled too low, then the USB
stops working. Increase the idle speed of the core to fix this if the
kernel is built with USB support.

The "magic" values are taken from the Ralink SDK Kernel.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11441/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: ralink: Unify SoC id handling
John Crispin [Wed, 4 Nov 2015 10:50:07 +0000 (11:50 +0100)] 
MIPS: ralink: Unify SoC id handling

This makes detection a lot easier for audio, wifi, ... drivers.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11440/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: ralink: Add support for mt7688
John Crispin [Wed, 4 Nov 2015 10:50:06 +0000 (11:50 +0100)] 
MIPS: ralink: Add support for mt7688

MT7688 is similar tot he MT7628 but has a different wifi radio.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11439/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BMIPS: Add SATA/PHY nodes for bcm7362
Jaedon Shin [Tue, 27 Oct 2015 06:48:11 +0000 (15:48 +0900)] 
MIPS: BMIPS: Add SATA/PHY nodes for bcm7362

Add AHCI and PHY device nodes to MIPS-based BCM7362 set-top box
platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Dragan Stancevic <dragan.stancevic@gmail.com>
Cc: linux-ide@vger.kernel.org
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11379/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BMIPS: Add SATA/PHY nodes for bcm7346
Jaedon Shin [Tue, 27 Oct 2015 06:48:10 +0000 (15:48 +0900)] 
MIPS: BMIPS: Add SATA/PHY nodes for bcm7346

Add AHCI and PHY device nodes to MIPS-based BCM7346 set-top box
platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Dragan Stancevic <dragan.stancevic@gmail.com>
Cc: linux-ide@vger.kernel.org
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11378/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BMIPS: Add SATA/PHY nodes for bcm7425
Jaedon Shin [Tue, 27 Oct 2015 06:48:09 +0000 (15:48 +0900)] 
MIPS: BMIPS: Add SATA/PHY nodes for bcm7425

Add AHCI and PHY device nodes to MIPS-based BCM7425 set-top box
platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Dragan Stancevic <dragan.stancevic@gmail.com>
Cc: linux-ide@vger.kernel.org
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11377/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BMIPS: Add I2C node for bcm7362
Jaedon Shin [Wed, 21 Oct 2015 02:37:01 +0000 (11:37 +0900)] 
MIPS: BMIPS: Add I2C node for bcm7362

Add I2C device nodes to BMIPS based BCM7362 platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
Cc: linux-i2c@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11336/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BMIPS: Add I2C node for bcm7360
Jaedon Shin [Wed, 21 Oct 2015 02:37:00 +0000 (11:37 +0900)] 
MIPS: BMIPS: Add I2C node for bcm7360

Add I2C device nodes to BMIPS based BCM7360 platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
Cc: linux-i2c@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11335/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BMIPS: Add I2C node for bcm7358
Jaedon Shin [Wed, 21 Oct 2015 02:36:59 +0000 (11:36 +0900)] 
MIPS: BMIPS: Add I2C node for bcm7358

Add I2C device nodes to BMIPS based BCM7358 platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
Cc: linux-i2c@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11334/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BMIPS: Add I2C node for bcm7346
Jaedon Shin [Wed, 21 Oct 2015 02:36:58 +0000 (11:36 +0900)] 
MIPS: BMIPS: Add I2C node for bcm7346

Add I2C device nodes to BMIPS based BCM7346 platform.

Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
Cc: linux-i2c@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11333/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Fix check for return value of request_mem_region()
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:44 +0000 (23:37 +0100)] 
MIPS: Lantiq: Fix check for return value of request_mem_region()

request_mem_region() returns a pointer and not an integer with an error
value. A check for "< 0" on a pointer will cause problems, replace it
with not null checks instead. This was found with sparse.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11395/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add support for xRX220 SoC
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:43 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add support for xRX220 SoC

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11394/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add misc clocks
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:42 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add misc clocks

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11393/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add 1e103100.deu clock
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:41 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add 1e103100.deu clock

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11392/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add clock for mei driver
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:40 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add clock for mei driver

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11391/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add SoC detection for ar10 and grx390
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:39 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add SoC detection for ar10 and grx390

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11390/
Patchwork: https://patchwork.linux-mips.org/patch/11399/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add support for gphy firmware loading for ar10 and grx390
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:38 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add support for gphy firmware loading for ar10 and grx390

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11389/
Patchwork: https://patchwork.linux-mips.org/patch/11398/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add pmu bits for ar10 and grx390
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:37 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add pmu bits for ar10 and grx390

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11388/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add PMU bits for USB and SDIO devices
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:36 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add PMU bits for USB and SDIO devices

This adds the PUM bits for USB and SDIO devices

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11387/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Deactivate most of the devices by default
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:35 +0000 (23:37 +0100)] 
MIPS: Lantiq: Deactivate most of the devices by default

When the SoC starts up most of the devices should be deactivated by the
PMU, they should be activated when they get used by their drivers. Some
devices should not get deactivate at startup like the serial, register
them in a special way.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11386/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add clock detection for grx390 and ar10
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:34 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add clock detection for grx390 and ar10

This add detection of some clocks on the ar10 and grx390.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11385/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Fix pp32 clock on vr9
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:33 +0000 (23:37 +0100)] 
MIPS: Lantiq: Fix pp32 clock on vr9

The vendor code uses different clock values for this clock.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11384/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Rename CGU_SYS_VR9 register
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:32 +0000 (23:37 +0100)] 
MIPS: Lantiq: Rename CGU_SYS_VR9 register

This register is also used on other SoCs.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11383/
Patchwork: https://patchwork.linux-mips.org/patch/11397/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add support for setting PMU register on AR10 and GRX390
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:31 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add support for setting PMU register on AR10 and GRX390

This adds support for setting the PMU register on the AR10 and GRX390.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11382/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Lantiq: Add locking for PMU register and check status afterwards
Hauke Mehrtens [Wed, 28 Oct 2015 22:37:30 +0000 (23:37 +0100)] 
MIPS: Lantiq: Add locking for PMU register and check status afterwards

The PMU register are accessed in a non atomic way and they could be
accessed by different threads simultaneously, which could cause
problems this patch adds locking around the PMU registers. In
addition we now also wait till the PMU is actually deactivated.

[ralf@linux-mips.org: Fix spelling mistake in commit message as noticed
by Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>.]

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11381/
Patchwork: https://patchwork.linux-mips.org/patch/11396/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BCM47xx: Fetch board info directly in callback function
Rafał Miłecki [Mon, 26 Oct 2015 10:13:16 +0000 (11:13 +0100)] 
MIPS: BCM47xx: Fetch board info directly in callback function

This drops another symbol dependency between setup.c and sprom.c which
will allow us to make SPROM code a separated module (and share it with
ARM).
Patch tested on Linksys WRT300N V1.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11360/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BCM47xx: Fix some WARNINGs pointed in sprom.c by checkpatch.pl
Rafał Miłecki [Sun, 25 Oct 2015 21:16:48 +0000 (22:16 +0100)] 
MIPS: BCM47xx: Fix some WARNINGs pointed in sprom.c by checkpatch.pl

There are still few left:
1) Most of them about lines over 80 chars (increased readability exception)
2) Wrong parsing of preprocessor macros

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Patchwork: https://patchwork.linux-mips.org/patch/11356/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BCM47xx: Support on-SoC bus in SPROM reading function
Rafał Miłecki [Sun, 25 Oct 2015 21:16:47 +0000 (22:16 +0100)] 
MIPS: BCM47xx: Support on-SoC bus in SPROM reading function

To support (extract) SPROM on Broadcom ARM devices we should separate
SPROM code and make it a separated module. We won't want to export
bcm47xx_fill_sprom symbol so we should support SoC SPROM in the standard
fallback function and then modify ssb to use it.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11355/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: lantiq: add clk_round_rate()
Hauke Mehrtens [Sun, 25 Oct 2015 22:21:42 +0000 (23:21 +0100)] 
MIPS: lantiq: add clk_round_rate()

This adds a basic implementation of clk_round_rate()
The clk_round_rate() function is called by multiple drivers and
subsystems now and the lantiq clk driver is supposed to export this,
but doesn't do so, this causes linking problems like this one:
ERROR: "clk_round_rate" [drivers/media/v4l2-core/videodev.ko] undefined!

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: <stable@vger.kernel.org> # 4.1+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11358/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Add LATENCYTOP support
Aaro Koskinen [Fri, 23 Oct 2015 12:39:02 +0000 (15:39 +0300)] 
MIPS: Add LATENCYTOP support

Add LATENCYTOP support for MIPS. Tested on OCTEON.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11353/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: pci-rt3883: drop unneeded of_node_get
Julia Lawall [Sun, 25 Oct 2015 21:24:25 +0000 (22:24 +0100)] 
MIPS: pci-rt3883: drop unneeded of_node_get

for_each_child_of_node performs an of_node_get on each iteration, so no
of_node_get is needed on breaking out of the loop when the device_node
structure is saved in another variable.

A simplified semantic match that finds this problem is as follows
(http://coccinelle.lip6.fr):

// <smpl>
@@
expression root;
local idexpression child;
@@

 for_each_child_of_node(root, child) {
   ...
*  of_node_get(child)
   ...
   break;
 }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Patchwork: https://patchwork.linux-mips.org/patch/11357/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()
Alex Smith [Wed, 21 Oct 2015 08:57:44 +0000 (09:57 +0100)] 
MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()

Add user-mode implementations of gettimeofday() and clock_gettime() to
the VDSO. This is currently usable with 2 clocksources: the CP0 count
register, which is accessible to user-mode via RDHWR on R2 and later
cores, or the MIPS Global Interrupt Controller (GIC) timer, which
provides a "user-mode visible" section containing a mirror of its
counter registers. This section must be mapped into user memory, which
is done below the VDSO data page.

When a supported clocksource is not in use, the VDSO functions will
return -ENOSYS, which causes libc to fall back on the standard syscall
path.

When support for neither of these clocksources is compiled into the
kernel at all, the VDSO still provides clock_gettime(), as the coarse
realtime/monotonic clocks can still be implemented. However,
gettimeofday() is not provided in this case as nothing can be done
without a suitable clocksource. This causes the symbol lookup to fail
in libc and it will then always use the standard syscall path.

This patch includes a workaround for a bug in QEMU which results in
RDHWR on the CP0 count register always returning a constant (incorrect)
value. A fix for this has been submitted, and the workaround can be
removed after the fix has been in stable releases for a reasonable
amount of time.

A simple performance test which calls gettimeofday() 1000 times in a
loop and calculates the average execution time gives the following
results on a Malta + I6400 (running at 20MHz):

 - Syscall:    ~31000 ns
 - VDSO (GIC): ~15000 ns
 - VDSO (CP0): ~9500 ns

[markos.chandras@imgtec.com:
- Minor code re-arrangements in order for mappings to be made
in the order they appear to the process' address space.
- Move do_{monotonic, realtime} outside of the MIPS_CLOCK_VSYSCALL ifdef
- Use gic_get_usm_range so we can do the GIC mapping in the
arch/mips/kernel/vdso instead of the GIC irqchip driver]

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11338/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoirqchip: irq-mips-gic: Provide function to map GIC user section
Alex Smith [Mon, 12 Oct 2015 09:40:43 +0000 (10:40 +0100)] 
irqchip: irq-mips-gic: Provide function to map GIC user section

The GIC provides a "user-mode visible" section containing a mirror of
the counter registers which can be mapped into user memory. This will
be used by the VDSO time function implementations, so provide a
function to map it in.

When the GIC is not enabled in Kconfig a dummy inline version of this
function is provided, along with "#define gic_present 0", so that we
don't have to litter the VDSO code with ifdefs.

[markos.chandras@imgtec.com:
  - Move mapping code to arch/mips/kernel/vdso.c and use a resource
    type to get the GIC usermode information
  - Avoid renaming function arguments and use __gic_base_addr to hold
    the base GIC address prior to ioremap.]
[ralf@linux-mips.org: Fix up gic_get_usm_range() to compile and make inline
again.]

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Alex Smith <alex.smith@imgtec.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/11281/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Initial implementation of a VDSO
Alex Smith [Wed, 21 Oct 2015 08:54:38 +0000 (09:54 +0100)] 
MIPS: Initial implementation of a VDSO

Add an initial implementation of a proper (i.e. an ELF shared library)
VDSO. With this commit it does not export any symbols, it only replaces
the current signal return trampoline page. A later commit will add user
implementations of gettimeofday()/clock_gettime().

To support both new toolchains and old ones which don't generate ABI
flags section, we define its content manually and then use a tool
(genvdso) to patch up the section to have the correct name and type.
genvdso also extracts symbol offsets ({,rt_}sigreturn) needed by the
kernel, and generates a C file containing a "struct mips_vdso_image"
containing both the VDSO data and these offsets. This C file is
compiled into the kernel.

On 64-bit kernels we require a different VDSO for each supported ABI,
so we may build up to 3 different VDSOs. The VDSO to use is selected by
the mips_abi structure.

A kernel/user shared data page is created and mapped below the VDSO
image. This is currently empty, but will be used by the user time
function implementations which are added later.

[markos.chandras@imgtec.com:
- Add more comments
- Move abi detection in genvdso.h since it's the get_symbol function
that needs it.
- Add an R6 specific way to calculate the base address of VDSO in order
to avoid the branch instruction which affects performance.
- Do not patch .gnu.attributes since it's not needed for dynamic linking.
- Simplify Makefile a little bit.
- checkpatch fixes
- Restrict VDSO support for binutils < 2.25 for pre-R6
- Include atomic64.h for O32 variant on MIPS64]

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: Matthew Fortune <matthew.fortune@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11337/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: mpc30x_defconfig: Convert to use libata PATA drivers
Bartlomiej Zolnierkiewicz [Mon, 14 Sep 2015 15:51:56 +0000 (17:51 +0200)] 
MIPS: mpc30x_defconfig: Convert to use libata PATA drivers

IDE subsystem has been deprecated since 2009 and the majority
(if not all) of Linux distributions have switched to use
libata for ATA support exclusively.  However there are still
some users (mostly old or/and embedded non-x86 systems) that
have not converted from using IDE subsystem to libata PATA
drivers.  This doesn't seem to be good thing in the long-term
for Linux as while there is less and less PATA systems left
in use:

* testing efforts are divided between two subsystems

* having duplicate drivers for same hardware confuses users

This patch converts mpc30x_defconfig to use libata PATA
drivers.

PS This platform still uses "ide0=base[,ctl[,irq]]" hack in
its defconfig.  The hack itself has been removed in 2008 and
this platform should be converted to using PATA platform host
driver (pata_platform) instead.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-mips@linux-mips.org
Cc: linux-ide@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11141/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This page took 0.092697 seconds and 5 git commands to generate.