ARM: dts: msm: SPI Modify SPI BAM physical memory size

SPI  driver does not map all spi bam memory space.
When  spi driver attempts to read from a register
by adding offset to  base address, that
address exceeds  memory area thus  data
abort happen.

This patch add the correct  size for SPI BAM
memory in DT file to map all the registers thus
avoid data abort.

CRs-Fixed: 562031
Change-Id: Ibd69176c5b8c90a15141b621beb27f2655770797
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
qup_i2c: Initialize I2C resource before registering.

Due to mismatch in sequence of initializing the
I2C resources  and registering device,  issues seen
while probing clients. This patch corrects the sequence.

CRs-Fixed: 581007
Change-Id: I98f0e73ce1ed1213409d5700f7a78e722e451ec0
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>

qup_i2c: Correct free memory call

Correct freeing of memory, which is allocated using
the devm prefixed API, to free it using devm_kfree rather
then kfree.

CRs-Fixed: 582597
Change-Id: If1aa9bcd86bb3a7d35adc5630ff19ad08bbdf762
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: dump gpio config on error

Dump the configuration of relevant GPIOs
on timeout error.

Change-Id: Iab5aa57befc146c232d12759990b0b8a23a68fe1
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: export qup_i2c_init_driver

Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: Ke Liu <keliu@codeaurora.org>

qup_i2c: improve PM functionality

Move system-PM functionality to noirq stage. Remove
the incorrect active-only clock path-voting setting.
Resolve synchronization of concurent transition of
system and runtime PM.

Change-Id: I2753557482da7a48a596e4b660165b4e2af0f854
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: support for configuarable noise rejection

allow to configure noise rejection value from device tree
which helps filter spikes in the i2c lines.

CRs-Fixed: 626250
Change-Id: If66132c8cc444294e4e6e275ece8b85108cf7abb
Signed-off-by: Ankit Gupta <ankgupta@codeaurora.org>

qup_i2c: Improve recovery from core and slave bad state

Unexpected noise, and/or unexpected behavior from a slave
may put the whole I2C bus in unworkable state. Clear I2C
bus state using HW command instead of bit-banging to avoid
assumption about GPIO recovery config.

Change-Id: I8d1d0002392f9ec9bc0db146aa0ce3e138334644
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
net/l2tp: don't fall back on UDP [get|set]sockopt

The l2tp [get|set]sockopt() code has fallen back to the UDP functions
for socket option levels != SOL_PPPOL2TP since day one, but that has
never actually worked, since the l2tp socket isn't an inet socket.

As David Miller points out:

  "If we wanted this to work, it'd have to look up the tunnel and then
   use tunnel->sk, but I wonder how useful that would be"

Since this can never have worked so nobody could possibly have depended
on that functionality, just remove the broken code and return -EINVAL.

Change-Id: Ia6c09487e92d1ee4e8d1d22a6273034b22272a2f
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: James Chapman <jchapman@katalix.com>
Acked-by: David Miller <davem@davemloft.net>
Cc: Phil Turnbull <phil.turnbull@oracle.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
spi_qsd: Fix SPI L2 Crash

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>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
ARM: dts: msm: SPI Modify SPI BAM physical memory size

SPI  driver does not map all spi bam memory space.
When  spi driver attempts to read from a register
by adding offset to  base address, that
address exceeds  memory area thus  data
abort happen.

This patch add the correct  size for SPI BAM
memory in DT file to map all the registers thus
avoid data abort.

CRs-Fixed: 562031
Change-Id: Ibd69176c5b8c90a15141b621beb27f2655770797
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
spi_qsd: Remove check for unaligned  length during input_irq

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>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
spi_qsd: Initialize wait queue

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>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>