Due to missing initialization of wait queue
issues reported on customer builds. This patch
adds the missing wait queue initialization code.
Change-Id: I2150d94bfec74b26842aac4fbd0e2e44af3b9943
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Use runtime PM calls to enable/disbale clocks
while accessing the registers using debugfs
interface.
Change-Id: Iba0de406a485a215aa9a882fc6f84eb3daebfb10
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Add support for the same spi controller to be programmed
by the CPU and other execution environments rather than the
controller hw being owned by only one ee.
Change-Id: Id6560b9cb09ddf59045fdf48c713d14c5c013145
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
When runtime_resume fails to resume due to
failed gpio_request call,Suspend state does not
updated and thus wait queue initialization
is not happen,accessing the same causes kernel
crash. This patch corrects this.
CRs-Fixed: 650143
Change-Id: I330af805577f457a43b1afa9f47db13ed33acb3e
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Prevent spi transfers from being grouped together.
Grouping multiple transfers together causes invalid
write then read transactions. This patch prevents
the transactions from being grouped and ensures the
chipselect toggles appropriately.
CRs-Fixed: 661007
Change-Id: I1962cc95fde196295f37c64ecd54e490a7285bc4
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
Reduce the pinctrl overhead in the msm spi driver code.
Change-Id: I19854ecdcd4230bfda946c773bc39909508c0891
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
ice40 bridge chip driver uses delay_usecs option, due to which this message
floods the dmesg logs. So change it's logging level to dev_dbg.
CRs-Fixed: 655184
Change-Id: I3b7016237322763002209b9fc021f0af0f7af687
Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
When transfer speed exceeds the maximum supported frequency,
cur_msg is not initialized, Thus accessing the same cause kernel
crash. This patch corrects this.
CRs-Fixed: 647032
Change-Id: Ic0487a6b8859040f57c085fdcd78093480e64d49
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Spi doesn't handle multiple xfer per message scenario
(eg:Rd->Wr or Wr->Rd) correctly and spi request
stuck indefinetly in while loop when total byte count
is not 0.
increment both(rx,tx) references so next bam
transaction will be queued correctly. Flush the
bam pipes after each transactions.
CRs-Fixed: 637693
Change-Id: I455df38be2f9687b1eb2a704466f6974dfb83a22
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
The following commits have been reverted from this merge, as they are
known to introduce new bugs and are currently incompatible with our
audio implementation. Investigation of these commits is ongoing, and
they are expected to be brought in at a later time:
86e6de7 ALSA: compress: fix drain calls blocking other compress functions (v6)
16442d4 ALSA: compress: fix drain calls blocking other compress functions
This merge commit also includes a change in block, necessary for
compilation. Upstream has modified elevator_init_fn to prevent race
conditions, requring updates to row_init_queue and test_init_queue.
* commit 'v3.10.28': (1964 commits)
Linux 3.10.28
ARM: 7938/1: OMAP4/highbank: Flush L2 cache before disabling
drm/i915: Don't grab crtc mutexes in intel_modeset_gem_init()
serial: amba-pl011: use port lock to guard control register access
mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL
md/raid5: Fix possible confusion when multiple write errors occur.
md/raid10: fix two bugs in handling of known-bad-blocks.
md/raid10: fix bug when raid10 recovery fails to recover a block.
md: fix problem when adding device to read-only array with bitmap.
drm/i915: fix DDI PLLs HW state readout code
nilfs2: fix segctor bug that causes file system corruption
thp: fix copy_page_rep GPF by testing is_huge_zero_pmd once only
ftrace/x86: Load ftrace_ops in parameter not the variable holding it
SELinux: Fix possible NULL pointer dereference in selinux_inode_permission()
writeback: Fix data corruption on NFS
hwmon: (coretemp) Fix truncated name of alarm attributes
vfs: In d_path don't call d_dname on a mount point
staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq()
staging: comedi: addi_apci_1032: fix subdevice type/flags bug
mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully
GFS2: Increase i_writecount during gfs2_setattr_chown
perf/x86/amd/ibs: Fix waking up from S3 for AMD family 10h
perf scripting perl: Fix build error on Fedora 12
ARM: 7815/1: kexec: offline non panic CPUs on Kdump panic
Linux 3.10.27
sched: Guarantee new group-entities always have weight
sched: Fix hrtimer_cancel()/rq->lock deadlock
sched: Fix cfs_bandwidth misuse of hrtimer_expires_remaining
sched: Fix race on toggling cfs_bandwidth_used
x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround
netfilter: nf_nat: fix access to uninitialized buffer in IRC NAT helper
SCSI: sd: Reduce buffer size for vpd request
intel_pstate: Add X86_FEATURE_APERFMPERF to cpu match parameters.
mac80211: move "bufferable MMPDU" check to fix AP mode scan
ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS
ACPI / TPM: fix memory leak when walking ACPI namespace
mfd: rtsx_pcr: Disable interrupts before cancelling delayed works
clk: exynos5250: fix sysmmu_mfc{l,r} gate clocks
clk: samsung: exynos5250: Add CLK_IGNORE_UNUSED flag for the sysreg clock
clk: samsung: exynos4: Correct SRC_MFC register
clk: clk-divider: fix divisor > 255 bug
ahci: add PCI ID for Marvell 88SE9170 SATA controller
parisc: Ensure full cache coherency for kmap/kunmap
drm/nouveau/bios: make jump conditional
ARM: shmobile: mackerel: Fix coherent DMA mask
ARM: shmobile: armadillo: Fix coherent DMA mask
ARM: shmobile: kzm9g: Fix coherent DMA mask
ARM: dts: exynos5250: Fix MDMA0 clock number
ARM: fix "bad mode in ... handler" message for undefined instructions
ARM: fix footbridge clockevent device
net: Loosen constraints for recalculating checksum in skb_segment()
bridge: use spin_lock_bh() in br_multicast_set_hash_max
netpoll: Fix missing TXQ unlock and and OOPS.
net: llc: fix use after free in llc_ui_recvmsg
virtio-net: fix refill races during restore
virtio_net: don't leak memory or block when too many frags
virtio-net: make all RX paths handle errors consistently
virtio_net: fix error handling for mergeable buffers
vlan: Fix header ops passthru when doing TX VLAN offload.
net: rose: restore old recvmsg behavior
rds: prevent dereference of a NULL device
ipv6: always set the new created dst's from in ip6_rt_copy
net: fec: fix potential use after free
hamradio/yam: fix info leak in ioctl
drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl()
net: inet_diag: zero out uninitialized idiag_{src,dst} fields
ip_gre: fix msg_name parsing for recvfrom/recvmsg
net: unix: allow bind to fail on mutex lock
ipv6: fix illegal mac_header comparison on 32bit
netvsc: don't flush peers notifying work during setting mtu
tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0
net: unix: allow set_peek_off to fail
net: drop_monitor: fix the value of maxattr
ipv6: don't count addrconf generated routes against gc limit
packet: fix send path when running with proto == 0
virtio: delete napi structures from netdev before releasing memory
macvtap: signal truncated packets
tun: update file current position
macvtap: update file current position
macvtap: Do not double-count received packets
rds: prevent BUG_ON triggered on congestion update to loopback
net: do not pretend FRAGLIST support
IPv6: Fixed support for blackhole and prohibit routes
HID: Revert "Revert "HID: Fix logitech-dj: missing Unifying device issue""
gpio-rcar: R-Car GPIO IRQ share interrupt
clocksource: em_sti: Set cpu_possible_mask to fix SMP broadcast
irqchip: renesas-irqc: Fix irqc_probe error handling
Linux 3.10.26
sh: add EXPORT_SYMBOL(min_low_pfn) and EXPORT_SYMBOL(max_low_pfn) to sh_ksyms_32.c
ext4: fix bigalloc regression
arm64: Use Normal NonCacheable memory for writecombine
arm64: Do not flush the D-cache for anonymous pages
arm64: Avoid cache flushing in flush_dcache_page()
ARM: KVM: arch_timers: zero CNTVOFF upon return to host
ARM: hyp: initialize CNTVOFF to zero
clocksource: arch_timer: use virtual counters
arm64: Remove unused cpu_name ascii in arch/arm64/mm/proc.S
arm64: dts: Reserve the memory used for secondary CPU release address
arm64: check for number of arguments in syscall_get/set_arguments()
arm64: fix possible invalid FPSIMD initialization state
...
Change-Id: Ia0e5d71b536ab49ec3a1179d59238c05bdd03106
Signed-off-by: Ian Maund <imaund@codeaurora.org>
commit 61d1cf163c8653934cc8cd5d0b2a562d0990c265 upstream.
The 'ath79_spi_setup_cs' function initializes the chip
select line of a given SPI device in order to make sure
that the device is inactive.
If the SPI_CS_HIGH bit is set for a given device, it
means that the CS line of that device is active HIGH
so it must be set to LOW initially. In case of GPIO
CS lines, the 'ath79_spi_setup_cs' function does the
opposite of that due to the wrong GPIO flags.
Fix the code to use the correct GPIO flags.
Reported-by: Ronald Wahl <ronald.wahl@raritan.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As part of pinctrl frame work migration, add support
for chip select GPIO configuration using pinctrl frame work.
Now SPI driver supports both pinctrl frame work as
well as GPIO mux to configure chip select GPIO's.
CRs-Fixed: 621109
Change-Id: Id4aa58f9e2d2ae667719c6c600fb35b88b0f5b77
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Chip select GPIO can be free during the suspend.
Duplicate chip select free causing RX SPI data
Corruption recently reported from customers, this
Patch corrects this.
CRs-Fixed: 626641
Change-Id: Ib80516b6d43c7185586a8815c4430446a9e31ce0
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Bam parameter variable types for physical address
and handles are defined incorrectly for 64 bit bam.
Correct the variable types.
CRs-Fixed: 622639
Change-Id: Ia886406dd4a43b6f2eaa584a7deb717da5618e81
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
commit 1f802f8249a0da536877842c43c7204064c4de8b upstream.
This reverts commit e120cc0dcf2880a4c5c0a6cb27b655600a1cfa1d.
It causes a NULL pointer dereference with drivers using the generic
spi_transfer_one_message(), which always calls
spi_finalize_current_message(), which zeroes master->cur_msg.
Drivers implementing transfer_one_message() theirselves must always call
spi_finalize_current_message(), even if the transfer failed:
* @transfer_one_message: the subsystem calls the driver to transfer a single
* message while queuing transfers that arrive in the meantime. When the
* driver is finished with this message, it must call
* spi_finalize_current_message() so the subsystem can issue the next
* transfer
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
During multiple transfers, currently SPI
driver imposes check for read/write length,
If read/write length is greater than FIFO size
the transaction are failing due to this check.
This patch removes this check to successfully
transfer the data during multiple transfers of
size greater than FIFO size.
CRs-Fixed: 592431
Change-Id: I5e24744155d585811a280a213f8d7f298027cd5b
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
commit e120cc0dcf2880a4c5c0a6cb27b655600a1cfa1d upstream.
This corrects a problem in spi_pump_messages() that leads to an spi
message hanging forever when a call to transfer_one_message() fails.
This failure occurs in my MCP2210 driver when the cs_change bit is set
on the last transfer in a message, an operation which the hardware does
not support.
Rationale
Since the transfer_one_message() returns an int, we must presume that it
may fail. If transfer_one_message() should never fail, it should return
void. Thus, calls to transfer_one_message() should properly manage a
failure.
Fixes: ffbbdd2132 (spi: create a message queueing infrastructure)
Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 86b3bde003e6bf60ccb9c09b4115b8a2f533974c upstream.
The spi command must include the full message length including any
prepended writes, else transfers larger than 256 bytes will be
incomplete.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
After the last architecture switched to generic hard irqs the config
options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code
for !CONFIG_GENERIC_HARDIRQS can be removed.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Git-commit: 0244ad004a54e39308d495fee0a2e637f8b5c317
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[imaund@codeaurora.org: resolve merge conflicts]
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Merge support needed for the ARM64 8916 target into msm-3.10.
* origin/tmp-b7dbbd5: (289 commits)
arm: add pdev_archdata for dma_mask
thermal: tsens: fix compilation warning
msm: sps: remove sps header file
defconfig: arm64: msm: enable gpio sysfs reporting
arm64: Align CMA sizes to PAGE_SIZE
msm: ipa: add 64-bit support for IPA
defconfig: msm: Enable IPC Router and QMI kernel interface
msm: kgsl: Implement ioctl_rb_issueibcmds for compat
msm: rndis_ipa: add support for 64 bit
msm: ecm_ipa: add support for 64 bit
ARM: dts: msm: Add SPI clocks for QUP1 on plutonium.
ARM: dts: msm: Configure SPI on plutonium QUP1.
msm: ipa: set dma mask of IPA device
msm: ipa: add support for compat_ioctl
msm: ipa: move out of mach tree
arm: dts: msm8916: Change property for CMA regions
arm64: Change type of dma_{alloc,free}_from_contiguous
msm: kgsl: manage active count for perfcounter read compat ioctl
ion: msm: Add custom compat ioctl
ion: Add custom_compat_ioctl
...
Conflicts:
arch/arm/mach-msm/Kconfig
drivers/platform/msm/ipa/teth_bridge.c
Change-Id: I2e5ebfd104d72a91191fef6de33e107399c17938
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Make spi_qsd architecture independent by removing
references to mach-msm directory and not assuming
a particular pointer size.
Change-Id: Ie4ccb6ee24b694ba52476a89285c77d7c547502b
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
Data Mover is no longer supported on hardware and removed as dead
code.
Change-Id: Icfbf30e709f7d1ed0ece0eb9c31e4ddb42ac9d5f
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>
Message queue is scheduled to process
SPI messages during system suspend
state which leads to crash.
This patch make sure all the messages
in queue are processed before system
suspends.
CRs-Fixed: 593658
Change-Id: I722f24fcee4a1d2bbfee4341c8bc6c36ff9e1ec8
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
As part of pinctrl frame work migration, add support
for GPIO configuration using pinctrl frame work.
Now SPI driver supports both pinctrl frame work as
well as GPIO mux to configure GPIO's.
CRs-Fixed: 554189
Change-Id: Ie4232e181705e8c352079fdec882ff4b59bf074f
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Currently SPI driver is queuing a single BAM descriptor
at a time. The BAM engine supports queuing of multiple
transfer descriptors.
Add support to spi driver to queue multiple descriptors.
CRs-Fixed: 546346
Change-Id: Iaee9b3b362832262b75e46e19ad18552d037620b
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
QUP_IRQ complete is triggered before dmov_rx callback.
Which will initiate SPI to start next transfer, due to
this earlier DMOV_CMD is blocked and results in kernel panic.
Current Implementation make sure that transfer complete waits
For DMOV callback only in case of aligned lengths ,This patch
ensures transfer trigger only after DMOV RX call back for
unaligned length also.
CRs-Fixed: 583126
Change-Id: I306a705d0eaf0eac33b2dbf335992254351cce20
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
The code paths using remote mutexes are inactive. Remove the dead code.
Change-Id: I99bec429cb18f4b4eb317ccd0ddea807afdd849f
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Currently msm_spi_process_message is freeing Chip
Select GPIO only when error occurs instead of
freeing it for every transfer. This patch releases
Chip select GPIO for each transfer complete.
CRs-Fixed: 579737
Change-Id: I3f24fda283714ee8422e42b297f9c10dc3367b65
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Add support to use new message queue feature provided
by SPI core framework. It is having benefits of saving
code space and getting the benefits of improvements
implemented in the core. User can set the priority
of message queue at compile time.
CRs-Fixed: 458268
Change-Id: I3f3a70b20ed6f2c8ceb9c27d616c5ba19acb422c
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
During probe Chip select gpio's valid field is set to non-zero.
This is causing gpio free to get called for not-used gpios
during runtime suspend.
CRs-Fixed: 525743
Change-Id: Ib0de417d640f30908ad11650b584833dac286646
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Rather than failing the probe function on DMA
initialiation error, this patch just disables DMA
mode and logs an error. The driver continues to
function in FIFO mode.
Change-Id: Ib2532e3497192e1ef7efa02d2dff855826ad6091
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
The HW is not mandating the use of input first in bam mode,
therefore, that statement is removed.
CRs-Fixed: 519665
Change-Id: I7c5bbe8a71ea5b8a0e25efdea585251c7c4d4d14
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Sometimes system suspend is initiated before runtime
PM's auto-suspend delay expires and causing devices to
not suspended runtime. As part of system suspend if
device is not suspended runtime then clocks and gpios
are manages by system suspend.
If spi client does initiate transaction request immediately
after system resume then spi doesn't resume run-time
immediately as spi controller's device state is not in
'suspended state'.
Keep device's runtime PM status to suspended during
system suspend.
CRs-Fixed: 512718
Change-Id: I5c0cb39c0b91782d8686c1b3da81125169ccf9be
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
When reading values from the device tree, the error
check on BAM producer pipe must be negated.
Change-Id: Ia766cabdde47390c5a3c79b1c98a704e695fc571
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Redirection on a NULL pointer leads to a system crash.
Here we verify pointers which potentially may be NULL
before a redirection.
Change-Id: I72b856e52f63b13e517c28d8dbb04e1f333f8065
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
BAM pipes must be flushed when a transfer timeout
leaving dangling descriptors.
Change-Id: I29fbd2a98964bff5496630a165b3cd0a3f1f2d08
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>