summaryrefslogtreecommitdiff
path: root/drivers/staging
AgeCommit message (Collapse)Author
2018-08-24MLK-16910 ion: fixed KASAN issueSong Bing
Fixed KASAN issue. KASAN: use-after-free in mxc_custom_ioctl Signed-off-by: Song Bing <bing.song@nxp.com>
2018-08-24MLK-16776 staging: typec: tcpci: use vbus from partner for EXTCON_USBLi Jun
Change to use the vbus from partner to notify EXTCON_USB. This is to work around the case of source only typec port connecting to Host PC via a Rp fixed cable. Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16697 staging: typec: tcpci: add notfication for device attachLi Jun
Some usb device driver can't know the connect and disconnect to host if the vbus is always on, if use typec we can rely on cc line status to know that, so add a notification to let controller driver know device attach and detach from host. Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16285-2 staging: typec: tcpci: add optional reset pin supportPeter Chen
Some USB3 differential channel switch chips need to do reset before functional, we add this support here. Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16285-1 staging: typec: tcpci: move request interrupt to the end of probePeter Chen
The tcpci_irq may visit tcpci->port if unexpected interrupt occurs (eg, board design issue causes GPIO status is incorrect) and cause NULL pointer dereference issue. Besides, delete clear TCPC_ALERT and TCPC_ALERT_MASK code which are already done at tcpci_init. Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16298-1 staging: typec: make super speed signal mux select configurableLi Jun
Instead of fixed pull up super speed mux selection gpio for cc1, use GPIO_ACTIVE_HIGH/LOW to map the CC1/CC2 orientation via gpiod api, So for ss-sel-gpios: GPIO_ACTIVE_HIGH: CC1 <--> GPIO high GPIO_ACTIVE_LOW : CC1 <--> GPIO low Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-44 staging: typec: tcpm: set data role after src detachLi Jun
As the default data role is device mode if the port is not host, so set the port data role to be device mode after src detach, this is to fix the issue of port data role still kept to be host while the port is open. Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-43 staging: typec: tcpci: add extcon for data role switchLi Jun
Use extcon device for dual role switch on typec port. Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-37 staging: typec: Power swap force discharge for sourceLi Jun
VBus off only means the vbus falls to be below 4v, we can use vbus force discharge and vbus low alarm to go forward. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-36 staging: typec: wait for cc change on ERROR_RECOVERYLi Jun
We should wait at least tErrorRecovery before move to unattached state. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-35 staging: typec: Move to SRC_ATTACHED if condition is metLi Jun
If the other end is trying to be a sink and not driving vbus, we should move to SRC_ATTACHED directly. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-34 staging: typec: Support cc changes on RP pull-up valueLi Jun
CC line changes on souce side RP value is permitted per standard, in this case we should move to SNK_ATTACH_WAIT. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-33 staging: typec: Do not switch to unattached state for BISTLi Jun
If we received unsupported BIST command, we should by pass it and ready to accept following command for test, not unconditionly to set the port to be unattached state and terminate the test. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-32 staging: typec: refine source to sink swap handlingLi Jun
To early start sink power after source turn off vbus, move the set power role after vbus is turned off in PR_SWAP_SRC_SNK_SOURCE_OFF, also per spec, we should do error recovery if the sink side does not turn on vbus in PD_T_PS_SOURCE_ON. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-31 staging: typec: Set to unattached state if souce disconnectedLi Jun
In SNK_HARD_RESET_SINK_ON, if the source disconnected, we should set state to be unattached state intead of startup sink. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-30 staging: typec: Reset hard_reset_count to be 0 after send ↵Li Jun
source cap Per standard, we should clear the hard reset count to be 0 after souce sent the source cap. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-29 staging: typec: tcpm: Don't reset message id after soft resetLi Jun
If the power source sent soft reset and the other end accepted, we should not reset the message id as it was already updated by pd_transmit when handling the soft reset. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-28 staging: typec: tcpci: Populate config from dtLi Jun
Instead of static config, use dt to pass basic PD config for below settings: - Source pdo list - Sink pdo list - Max sink voltage - Max sink current - Sink operating power - TypeC port type - TypeC port preferred role Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-27 staging: typec: add super speed signal mux selectionLi Jun
According to the polarity of cc line, we need to do USB3 signal mux selection if it's controlled by software. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-26 staging: typec: tcpm: update PD timingLi Jun
This patch is to update several PD timings for PD compliance, all those timing definitions should be configurable via user config, this can be improved later, for now I just update its values in PD spec defined range. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-25 staging: typec: tcpm: correct the PD_T_SENDER_RESPONSE valueLi Jun
Per PD spec, the sender response should be in a small range 24~30ms, so correct the PD_T_SENDER_RESPONSE to be 25. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-24 staging: typec: tcpm: use hrtimer for send responseLi Jun
As the sender response timer have very small margin(25~30ms), so use a hrtimer to handle it. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-23 staging: typec: tcpm: Do soft reset for unexpected get sink capLi Jun
A source or sink should receive the get_sink_cap message when in SRC_RDY or SNK_RDY, if the port receives a get sink capability request before ready, which means there is message sync error, we should do soft reset to recover from it, instead of sending a reject message. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-22 staging: typec: tcpm: split operations of power swap from sink ↵Li Jun
to source Add one more state:PR_SWAP_SNK_SRC_ASSERT_RP, as the next state of PR_SWAP_SNK_SRC_SINK_OFF, it will turn on vbus and wait the vbus is really on and then send the PS_RDY to the other side. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-21 staging: typec: tcpm: handle pd message send failureLi Jun
If the PD message send failed, we need to do soft reset, further if soft reset failed, we have to start a hard reset. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-20 staging: typec: Add bist test mode supportLi Jun
BIST(Built In Self-Test – Power Delivery testing mechanism for the PHY Layer), see PD 3.0 spec 5.9 Built in Self-Test (BIST), is added to support BIST message handling in PD compliance test. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-19 staging: typec: tcpci: Only touch target bit when enable vconnLi Jun
We need a read and then write back to avoid touch any other bits when enable or disable vconn. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-18 staging: typec: handle unexpected vbus from sinkLi Jun
Power source detected the attachment of sink, will firstly check the vbus level to make sure power sink isn't sourcing vbus(< 600mv) before going forward, otherwise it will terminate the session and go to SRC_UNATTACHED state, this is required by PD compliance. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-17 staging: typec: tcpm: optimise cc toggling for drp portLi Jun
We should only enable drp auto toggling when unattached, so add one more parameter; when attached, we set the cc line state according to the other end cc status. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-16: staging: typec: tcpm: tcpm init sequence updateLi Jun
Force an error recovery is not a good way to handle all cases and may break the case of power up with typec already connected. Also the tcpc init should start after tcpm init setup is done, as tcpc init will turn on HW event alert so may generate events immediately and drive tcpm state machine go forward, so move it at the end of tcpm_init. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-15: staging: typec: tcpci: Enable vbus force dischargeLi Jun
Enable vbus low voltage alert and do force discharge, this can aid turn off vbus quickly. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-14: staging: typec: tcpci: handle fault eventLi Jun
We need clear any fault alerts to make tcpci controller to recover from fault. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-13: staging: typec: tcpci: handle rx buffer overflow eventLi Jun
Add rx buffer overflow event handling. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-12: staging: typec: tcpci: clear pending events before request irqLi Jun
Clear all possible pending events before request irq. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-11 staging: typec: only clear alert events for enabled irqLi Jun
Uncondtionaly clear all events may impact the typec controller state machine, so save the enabled irq and only clear alert events for enabled irq. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24MLK-16013-10 staging: typec: add vbus detection for power sinkLi Jun
Typec port controller may need enable vbus detection to detect the vbus from power source. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-24staging: typec: Type-C Port Controller Interface driver (tcpci)Guenter Roeck
The port controller interface driver interconnects the Type-C Port Manager with a Type-C Port Controller Interface (TCPCI) compliant port controller. Signed-off-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 74e656d6b0551999194b5ab1e45ff8b1e82b898e)
2018-08-24staging: typec: USB Type-C Port Manager (tcpm)Guenter Roeck
This driver implements the USB Type-C Power Delivery state machine for both source and sink ports. Alternate mode support is not fully implemented. The driver attaches to the USB Type-C class code implemented in the following patches. usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY usb: USB Type-C connector class This driver only implements the state machine. Lower level drivers are responsible for - Reporting VBUS status and activating VBUS - Setting CC lines and providing CC line status - Setting line polarity - Activating and deactivating VCONN - Setting the current limit - Activating and deactivating PD message transfers - Sending and receiving PD messages The driver provides both a functional API as well as callbacks for lower level drivers. Signed-off-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit f0690a25a140b853b1842fa80faf828601bb47e8)
2018-08-24MLK-15954:[i.MX8MQ/ION]: Add ioctrl for 32 bit applicationZhou Peng-B04994
Implement compat_ioctl for 32bit application Signed-off-by: Zhou Peng-B04994 <eagle.zhou@nxp.com>
2018-08-24Revert "MLK-15356-2:[i.MX8MQ/Hantro] Add support for android platform"Octavian Purdila
This reverts commit b5d7e2af70d25568835a813a95032998194bc262 as it breaks the build on imx6/7. Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
2018-08-24MLK-15356-2:[i.MX8MQ/Hantro] Add support for android platformZhou Peng-B04994
Add compat ioctl for 32 bit application Signed-off-by: Zhou Peng-B04994 <eagle.zhou@nxp.com>
2018-08-24MLK-15138-1 ion: enable mxc ion on i.mx8Song Bing
Enable mxc ion on i.mx8. Signed-off-by: Song Bing <bing.song@nxp.com>
2018-08-24MLK-13561 ion: Enable mxc ion driverSong Bing
Enable mxc ion driver. ion driver can allocate physical continuous memory and can convert to physical address from DMA FD and virtual address if the memory is physical continuous. Signed-off-by: Song Bing bing.song@nxp.com
2018-08-03staging: lustre: ldlm: free resource when ldlm_lock_create() fails.NeilBrown
[ Upstream commit d8caf662b4aeeb2ac83ac0b22e40db88e9360c77 ] ldlm_lock_create() gets a resource, but don't put it on all failure paths. It should. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-03staging: lustre: llite: correct removexattr detectionJames Simmons
[ Upstream commit 1b60f6dfa38403ff7c4d0b4b7ecdb810f9789a2a ] In ll_xattr_set_common() detect the removexattr() case correctly by testing for a NULL value as well as XATTR_REPLACE. Signed-off-by: John L. Hammond <john.hammond@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10787 Reviewed-on: https://review.whamcloud.com/ Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-03staging: lustre: o2iblnd: fix race at kiblnd_connect_peerDoug Oucahrek
[ Upstream commit cf04968efe341b9b1c30a527e5dd61b2af9c43d2 ] cmid will be destroyed at OFED if kiblnd_cm_callback return error. if error happen before the end of kiblnd_connect_peer, it will touch destroyed cmid and fail as (o2iblnd_cb.c:1315:kiblnd_connect_peer()) ASSERTION( cmid->device != ((void *)0) ) failed: Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10015 Reviewed-by: Alexey Lyashkov <c17817@cray.com> Reviewed-by: Doug Oucharek <dougso@me.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Doug Oucharek <dougso@me.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11staging: comedi: quatech_daqp_cs: fix no-op loop daqp_ao_insn_write()Dan Carpenter
commit 1376b0a2160319125c3a2822e8c09bd283cd8141 upstream. There is a '>' vs '<' typo so this loop is a no-op. Fixes: d35dcc89fc93 ("staging: comedi: quatech_daqp_cs: fix daqp_ao_insn_write()") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11staging: android: ion: Return an ERR_PTR in ion_map_kernelLaura Abbott
commit 0a2bc00341dcfcc793c0dbf4f8d43adf60458b05 upstream. The expected return value from ion_map_kernel is an ERR_PTR. The error path for a vmalloc failure currently just returns NULL, triggering a warning in ion_buffer_kmap_get. Encode the vmalloc failure as an ERR_PTR. Reported-by: syzbot+55b1d9f811650de944c6@syzkaller.appspotmail.com Signed-off-by: Laura Abbott <labbott@redhat.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-16staging: android: ion: Switch to pr_warn_once in ion_buffer_destroyLaura Abbott
commit 45ad559a29629cb1c64ee636563c69b71524f077 upstream. Syzbot reported yet another warning with Ion: WARNING: CPU: 0 PID: 1467 at drivers/staging/android/ion/ion.c:122 ion_buffer_destroy+0xd4/0x190 drivers/staging/android/ion/ion.c:122 Kernel panic - not syncing: panic_on_warn set ... This is catching that a buffer was freed with an existing kernel mapping still present. This can be easily be triggered from userspace by calling DMA_BUF_SYNC_START without calling DMA_BUF_SYNC_END. Switch to a single pr_warn_once to indicate the error without being disruptive. Reported-by: syzbot+cd8bcd40cb049efa2770@syzkaller.appspotmail.com Reported-by: syzbot <syzkaller@googlegroups.com> Signed-off-by: Laura Abbott <labbott@redhat.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30irqchip/gic-v3: Ignore disabled ITS nodesStephen Boyd
[ Upstream commit 95a2562590c2f64a0398183f978d5cf3db6d0284 ] On some platforms there's an ITS available but it's not enabled because reading or writing the registers is denied by the firmware. In fact, reading or writing them will cause the system to reset. We could remove the node from DT in such a case, but it's better to skip nodes that are marked as "disabled" in DT so that we can describe the hardware that exists and use the status property to indicate how the firmware has configured things. Cc: Stuart Yoder <stuyoder@gmail.com> Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Rajendra Nayak <rnayak@codeaurora.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>