summaryrefslogtreecommitdiff
path: root/drivers/staging
AgeCommit message (Collapse)Author
2018-01-22Temporary fix to make eth0 PHY work in LSDK Linux on grapeboard prototypevojo
2017-12-12Merge branch 'linux-4.9-nxp' into linux-4.9 on Dec. 8, 2017Xie Xiaobo
Signed-off-by: Xiaobo Xie <xiaobo.xie@nxp.com>
2017-12-12Merge Linaro linux 4.9.62 into linux-4.9Xie Xiaobo
Signed-off-by: Xiaobo Xie <xiaobo.xie@nxp.com>
2017-12-12staging: fsl_ppfe/eth: Avoid packet drop at TMU queuesKavi Akhila-B46177
Added flow control between TMU queues and PFE Linux driver, based on TMU credits availability. Added tx_qos module parameter to control this behavior. Use queue-0 as default queue to transmit packets. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Akhila Kavi <akhila.kavi@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
2017-12-12staging: fsl_ppfe/eth: add function to update tmu creditsCalvin Johnson
__hif_lib_update_credit function is used to update the tmu credits. If tx_qos is set, tmu credit is updated based on the number of packets transmitted by tmu. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
2017-12-12staging: fsl_ppfe/eth: Disable autonegotiation for 2.5G SGMIIBhaskar Upadhaya
PCS initialization sequence for 2.5G SGMII interface governs auto negotiation to be in disabled mode Signed-off-by: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com>
2017-12-12staging: fsl_ppfe/eth: Enable PFE in clause 45 modeBhaskar Upadhaya
when we opearate in clause 45 mode, we need to call the function get_phy_device() with its 3rd argument as "true" and then the resultant phy device needs to be register with phy layer via phy_device_register() Signed-off-by: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com>
2017-12-12staging: fsl-dpaa2/mac: Free phydev on unbindBogdan Purcareata
Stop polling and unregister / disconnect the phydev structure on DPAA2 mac driver unbind. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/mac: Cleanup codeBogdan Purcareata
- move dpaa2_mac_open and dpaa2_mac_stop out of CONFIG_FSL_DPAA2_MAC_NETDEVS, since their implementation is necessary regardless of it - reorder ndo ops to match function implementation order - update comment to describe the phy connection mode that's to be used - it no longer depends on DPC, but on the device tree Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/mac: Remove redundant freeBogdan Purcareata
free_netdev (put_device) already handles freeing the private data structure, and KASAN will complain due to a free after free if we explicitly do the same afterwards. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add DCB KconfigIoana Radulescu
Add a Kconfig option for enabling Data Center Bridging (DCB) support in the Ethernet driver. This is needed for priority flow control support. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: defer probe if no mc portal is foundNipun Gupta
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Remove unused FD fieldIoana Radulescu
According to the hardware ArchDef, the PTV1 field in FD[CTRL] is ignored by WRIOP, so setting it for Tx FDs is pointless. Remove all references to it from the code. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Use napi_consume_skb()Ioana Radulescu
While in NAPI context, free skbs by calling napi_consume_skb() instead of dev_kfree_skb(), to take advantage of the bulk freeing mechanism. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Don't yield the cpu unless necessaryIoana Radulescu
When releasing buffers to the hardware pool, don't call cpu_relax() unless we are actually waiting for the QBMan portal to finish the previous command. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Don't include HH_DATA_MOD in needed_headroomBogdan Purcareata
The network stack will take care to reserve space for HH_DATA_MOD when building the skb, so there's no need to account for it in the netdevice needed headroom. Based on that, decrease the frame buffer headroom for ingress frames. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Update Rx headroom computationBogdan Purcareata
Instead of the old opaque value, define the Rx buffer headroom size based on other frame buffer fields, in accordance to how we expect them to be configured by MC. Based on DPNI_BUF_LAYOUT_OPT_TIMESTAMP, MC will enable an additional field in the Tx hardware annotation area, increasing its size to 128. Update the driver value to reflect this. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Don't account SWA in tx_data_offsetBogdan Purcareata
When configuring the Tx buffer layout, the software annotation size is mentioned, and MC accounts for it when configuring the frame tx_data_offset. No need to handle it in the driver as well. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add buffer count to channel statsBogdan Purcareata
Since adding support for multiple buffer thresholds (taildrop, flow control pause frames, PFC pause frames), it's useful to have the per-channel buffer count available in the debug stats. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Fix NAPI initializationIoana Radulescu
Make sure the NAPI instances are enabled only after all other device initialization is done, to avoid accessing uninit vars. Mirror that change on device remove routine. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Account for Rx FD buffers on error pathIoana Radulescu
On Rx path, if we fail to build an skb from the incoming FD, we still need to update the channel buffer count accordingly, otherwise we risk depleting the pool while the software counter still sees available buffers. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Fix potential endless loopIoana Radulescu
We incorrectly assumed that dpaa2_io_release() can only return -EBUSY as an error code, when in fact it can also fail in case some of its arguments don't have valid values. Make sure we only retry the operation while the portal is busy and abort for all other error cases, otherwise we risk entering an endless loop. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Fix compiling errors for backporting dash-ltsGuanhua Gao
Fix compiling errors for backporting dash-lts. Signed-off-by: Guanhua Gao <guanhua.gao>
2017-12-12staging: fsl-dpaa2/eth: Get PFC config from HWBogdan Purcareata
The dpaa2-eth PFC configuration is kept in a private driver variable. When getting PFC configuration via ieee_getpfc, get it straight from the Management Complex based on the Rx congestion notification setup. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add dpni_get_congestion_notif APIBogdan Purcareata
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Configure PFC in MCBogdan Purcareata
Implement the following: - Enable PFC in DPNI options. - Set queue taildrops for priorities (traffic classes) that are not PFC enabled (pause frames are not sent in case of congestion). Since the buffer pool is shared, we can't risk other traffic to consume all available buffers. - Configure Rx congestion notifications for PFC enabled priorities. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Refactor fq taildrop setupBogdan Purcareata
With the introduction of PFC support, there are multiple ways taildrop is configured, based on the DPNI pause frame configuration: - no pause frames - per-queue taildrop thresholds. - pause frames - no taildrop thresholds (pause frames sent based on buffer depletion). - PFC pause frames - per-group (traffic class) taildrop thresholds for non-PFC enabled priorities (pause frames sent based on Rx congestion notifications). Refactor the fq taildrop setup area. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add ingress classificationBogdan Purcareata
Configure static ingress classification based on VLAN PCP, required by PFC. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add DCB supportBogdan Purcareata
Add initial DCB ops in the DPAA2 Ethernet driver. Currently they are dummy calls. Tested integration with userspace lldpad: - lldpad daemon running - bring interface up - lldptool -L -i niX adminStatus=rxtx - lldptool -T -i niX -V PFC -c enabled={prio comma separated list} - lldptool -t -i niX -V PFC -c enabled Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Switch to v2 dpni_set_pools cmdBogdan Purcareata
The v2 dpni_set_pools command format allows sending an additional parameter, the priority mask for the buffer pool. This can be used to configure multiple buffer pools for the same dpni, to serve different priorities. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add fs entries for all tcsBogdan Purcareata
The current MC (10.3.1) design uses a separate flow steering table for each traffic class. When adding a flow steering rule, add it for each traffic class. The location of the rule is the same in all tables. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Handle multiple traffic classesBogdan Purcareata
The driver only handles frame workqueues associated with traffic class 0. Add support for multiple traffic classes for the same flowid, based on the tc field in the fq struct, and the num_tcs parameter in the dpni atttributes. Create a separate fq for each tc x flowid. Display the information in debugfs. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl_ppfe/eth: Make phy_ethtool_ksettings_get return voidCalvin Johnson
Make return value void since function never return meaningful value Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
2017-12-12fsl_qbman/usdpaa: Invalidate software portals before useRoy Pledge
Invalidate the cache for the software portals before using them since the portals are non coherent. This ensures that the core using the portal is seeing the most up to date information in case the cache contained older data. This is important during the cleanup phase if cleanup occurs on a differnt core than what the application was using. Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
2017-12-12staging/fsl_qbman: Calculate valid bit from MC-RRRoy Pledge
Use the management commmand response registers to determine the next expected valid bit when initializing a software portal. This avoids using the wrong valid bit in cases where a command was partially written but then not completed. Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
2017-12-12staging: fsl_ppfe/eth: fix read/write/ack idx issueCalvin Johnson
While fixing checkpatch errors some of the index increments were commented out. They are enabled. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
2017-12-12staging: fsl_ppfe/eth: remove unused functionsCalvin Johnson
Remove unused functions hif_xmit_pkt & hif_lib_xmit_pkt. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
2017-12-12staging: fsl_ppfe/eth: fix RGMII tx delay issueCalvin Johnson
Recently logic to enable RGMII tx delay was changed by below patch. https://patchwork.kernel.org/patch/9447581/ Based on the patch, appropriate change is made in PFE driver. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
2017-12-12change _nfct to nfct for linux 4.9Calvin Johnson
Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
2017-12-12staging: fsl_ppfe/eth: introduce pfe driverCalvin Johnson
[pfe part] This patch introduces Linux support for NXP's LS1012A Packet Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding engine to provide high performance Ethernet interfaces. The device includes two Ethernet ports. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com> Integrated-by: Zhao Qiang <qiang.zhao@nxp.com>
2017-12-12staging: fsl_ppfe/eth: header files for pfe driverCalvin Johnson
This patch has all pfe header files. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
2017-12-12staging: fsl_ppfe/eth: introduce pfe driverZhao Qiang
[config part] This patch introduces Linux support for NXP's LS1012A Packet Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding engine to provide high performance Ethernet interfaces. The device includes two Ethernet ports. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com> Integrated-by: Zhao Qiang <qiang.zhao@nxp.com>
2017-11-15iio: trigger: free trigger resource correctlyAlison Schofield
[ Upstream commit 10e840dfb0b7fc345082dd9e5fff3c1c02e7690e ] These stand-alone trigger drivers were using iio_trigger_put() where they should have been using iio_trigger_free(). The iio_trigger_put() adds a module_put which is bad since they never did a module_get. In the sysfs driver, module_get/put's are used as triggers are added & removed. This extra module_put() occurs on an error path in the probe routine (probably rare). In the bfin-timer & interrupt trigger drivers, the module resources are not explicitly managed, so it's doing a put on something that was never get'd. It occurs on the probe error path and on the remove path (not so rare). Tested with the sysfs trigger driver. The bfin & interrupt drivers were build tested & inspected only. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08staging: r8712u: Fix Sparse warning in rtl871x_xmit.cLarry Finger
[ Upstream commit 07222e535831b916221dd2a48a3047ec7e45dc72 ] Sparse reports the following: CHECK drivers/staging/rtl8712/rtl871x_xmit.c drivers/staging/rtl8712/rtl871x_xmit.c:350:44: warning: restricted __le32 degrades to integer drivers/staging/rtl8712/rtl871x_xmit.c:491:23: warning: incorrect type in initializer (different base types) drivers/staging/rtl8712/rtl871x_xmit.c:491:23: expected unsigned short [usertype] *fctrl drivers/staging/rtl8712/rtl871x_xmit.c:491:23: got restricted __le16 *<noident> drivers/staging/rtl8712/rtl871x_xmit.c:580:36: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_xmit.c:580:36: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/rtl8712/rtl871x_xmit.c:580:36: got restricted __be16 [usertype] <noident> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08staging: lustre: lmv: Error not handled for lmv_find_targetUlka Vaze
[ Upstream commit 30af99db7ab3483f5ce83ccb890533c9378c2ced ] This issue is found by smatch; has been reported as- Unchecked usage of potential ERR_PTR result in lmv_hsm_req_count and lmv_hsm_req_build. Added ERR_PTR in both functions and also return value check added. Signed-off-by: Ulka Vaze <ulka.vaze@yahoo.in> Signed-off-by: Aditya Pandit <panditadityashreesh@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6523 Reviewed-on: http://review.whamcloud.com/14918 Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.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@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08staging: lustre: ptlrpc: skip lock if export failedAlexander Boyko
[ Upstream commit 4c43c27ddc461d8473cedd70f2549614641dfbc7 ] This patch resolves IO vs eviction race. After eviction failed export stayed at stale list, a client had IO processing and reconnected during it. A client sent brw rpc with last lock cookie and new connection. The lock with failed export was found and assert was happened. (ost_handler.c:1812:ost_prolong_lock_one()) ASSERTION( lock->l_export == opd->opd_exp ) failed: 1. Skip the lock at ldlm_handle2lock if lock export failed. 2. Validation of lock for IO was added at hpreq_check(). The lock searching is based on granted interval tree. If server doesn`t have a valid lock, it reply to client with ESTALE. Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7702 Seagate-bug-id: MRP-2787 Reviewed-on: http://review.whamcloud.com/18120 Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Vitaly Fertman <vitaly.fertman@seagate.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.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@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08staging: lustre: hsm: stack overrun in hai_dump_data_fieldfrank zago
[ Upstream commit 22aadb91c0a0055935109c175f5446abfb130702 ] The function hai_dump_data_field will do a stack buffer overrun when cat'ing /sys/fs/lustre/.../hsm/actions if an action has some data in it. hai_dump_data_field uses snprintf. But there is no check for truncation, and the value returned by snprintf is used as-is. The coordinator code calls hai_dump_data_field with 12 bytes in the buffer. The 6th byte of data is printed incompletely to make room for the terminating NUL. However snprintf still returns 2, so when hai_dump_data_field writes the final NUL, it does it outside the reserved buffer, in the 13th byte of the buffer. This stack buffer overrun hangs my VM. Fix by checking that there is enough room for the next 2 characters plus the NUL terminator. Don't print half bytes. Change the format to 02X instead of .2X, which makes more sense. Signed-off-by: frank zago <fzago@cray.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8171 Reviewed-on: http://review.whamcloud.com/20338 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Jean-Baptiste Riaux <riaux.jb@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.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@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08staging: lustre: llite: don't invoke direct_IO for the EOF caseYang Sheng
[ Upstream commit 77759771fb95420d23876cb104ab65c022613325 ] The function generic_file_read_iter() does not check EOF before invoke direct_IO callback. So we have to check it ourselves. Signed-off-by: Yang Sheng <yang.sheng@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8969 Reviewed-on: https://review.whamcloud.com/24552 Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Bobi Jam <bobijam@hotmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.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@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08staging: rtl8712u: Fix endian settings for structs describing network packetsLarry Finger
[ Upstream commit 221c46d28957bd6e2158abc2179ce4a8c9ce07d3 ] The headers describing a number of network packets do not have the correct endian settings for several types of data. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08staging: fsl-mc: Add missing headerBogdan Purcareata
[ Upstream commit 07e9ef146071adf316312b3dd4abfe41c9a45a7d ] Compiling the fsl-mc bus driver will yield a couple of static analysis errors: warning: symbol 'fsl_mc_msi_domain_alloc_irqs' was not declared warning: symbol 'fsl_mc_msi_domain_free_irqs' was not declared. warning: symbol 'its_fsl_mc_msi_init' was not declared. warning: symbol 'its_fsl_mc_msi_cleanup' was not declared. Since these are properly declared, but the header is not included, add it in the source files. This way the symbol is properly exported. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>