aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2018-01-29rbd: don't NULL out ->obj_request in rbd_img_obj_parent_read_full()Ilya Dryomov1-2/+0
If rbd_img_request_submit() fails, parent_request->obj_request is NULLed out, triggering an assert in rbd_obj_request_put(): rbd_img_request_put(parent_request) rbd_parent_request_destroy rbd_obj_request_put(NULL) Just remove it -- parent_request->obj_request will be put in rbd_parent_request_destroy(). Signed-off-by: Ilya Dryomov <[email protected]>
2018-01-29rbd: use kmem_cache_zalloc() in rbd_img_request_create()Ilya Dryomov1-7/+2
Signed-off-by: Ilya Dryomov <[email protected]>
2018-01-29rbd: obj_request->completion is unusedIlya Dryomov1-6/+1
Signed-off-by: Ilya Dryomov <[email protected]>
2018-01-29drm/sun4i: backend: Check for the number of alpha planesMaxime Ripard3-22/+55
Due to the way the composition is done in hardware, we can only have a single alpha-enabled plane active at a time, placed in the second (highest priority) pipe. Make sure of that in our atomic_check to not end up in an impossible scenario. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/7371f62a1385f2cbe3ed75dfca2e746338eb2286.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/sun4i: backend: Add support for zposMaxime Ripard4-0/+24
Our various planes have a configurable zpos, that combined with the pipes allow to configure the composition. Since the interaction between the pipes, zpos and alphas framebuffers is not trivial, let's just enable the zpos as an immutable property for now, and use that zpos in our atomic_update part. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/b006853e908bd06661c5bc1f2191121523bce0e4.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/sun4i: backend: Set a default zpos in our reset hookMaxime Ripard1-0/+2
The plane state zpos value will be set only if there's an existing state attached to the plane when creating the property. However, this is not the case during the probe, and we therefore need to put our default value in our reset hook. Acked-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/b6a183234f0ad5a9a58c780c9cabbe29cbf40888.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/sun4i: backend: Move the coord function in the shared partMaxime Ripard1-2/+1
The function supposed to update a plane's coordinates is called in both branches of our function. Let's move it out the if statement. Acked-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/2cd57bcf13652109da7bd5bbe12fa1d29429f02f.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/sun4i: framebuffer: Add a custom atomic_checkMaxime Ripard1-1/+13
In order to support normalized zpos, we need to call drm_atomic_normalize_zpos in our driver's drm_mode_config_funcs' atomic_check. Let's duplicate the definition of drm_atomic_helper_check for now. Acked-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/67cb4ca9889e6bf29314db37127ff15eed279c53.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/sun4i: backend: Fix define typoMaxime Ripard1-1/+3
There was a typo in the width spelling of the (unused) SUN4I_BACKEND_IYUVLINEWITDTH_REG macro. Fix it. Acked-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/6b2e872b611b733a98a38902a2197b70c725e0b9.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/sun4i: backend: Fix structure indentationMaxime Ripard1-4/+4
The sun4i_plane_desc structure was somehow indented to two tabulations instead of one as we shoud do. Fix that. Acked-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/8a6714bddb865adfcfe2b792e406a2f10bb819bc.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/vc4: Use the alpha format field in drm_format_infoMaxime Ripard1-12/+11
Now that the drm_format_info has a alpha field to tell if a format embeds an alpha component in it, let's use it. Cc: Eric Anholt <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/38d4d0a085634a0b8308e819c846b9173d4d93df.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29media: dvb_demux: improve debug messagesMauro Carvalho Chehab1-21/+22
Do some cleanup of debug messages, making them cleaner and easier to be used to analyze what's going on. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-01-29media: dvb_demux: Better handle discontinuity errorsMauro Carvalho Chehab1-2/+6
When a packet discontinuity happens, it is not just the payload that was lost. The headers are lost too. So, the max size is not 184 but, instead 188. Also, while printing warnings, make a distinction between MPEG-TS indicated discontinuity and detected one. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-01-29media: cxusb, dib0700: ignore XC2028_I2C_FLUSHMauro Carvalho Chehab2-0/+3
The XC2028_I2C_FLUSH only needs to be implemented on a few devices. Others can safely ignore it. That prevents filling the dmesg with lots of messages like: dib0700: stk7700ph_xc3028_callback: unknown command 2, arg 0 Cc: [email protected] Fixes: 4d37ece757a8 ("[media] tuner/xc2028: Add I2C flush callback") Reported-by: Enrico Mioso <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-01-29media: ts2020: avoid integer overflows on 32 bit machinesMauro Carvalho Chehab1-2/+2
Before this patch, when compiled for arm32, the signal strength were reported as: Lock (0x1f) Signal= 4294908.66dBm C/N= 12.79dB Because of a 32 bit integer overflow. After it, it is properly reported as: Lock (0x1f) Signal= -58.64dBm C/N= 12.79dB Cc: [email protected] Fixes: 0f91c9d6bab9 ("[media] TS2020: Calculate tuner gain correctly") Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-01-29drm/rockchip: Use the alpha format field in drm_format_infoMaxime Ripard1-12/+1
Now that the drm_format_info has a alpha field to tell if a format embeds an alpha component in it, let's use it. Acked-by: Sandy huang <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/5a217e8c93eea6f0a7f6bc5883424b47dbb6c664.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/atmel-exynos: Use the alpha format field in drm_format_infoMaxime Ripard1-13/+1
Now that the drm_format_info has a alpha field to tell if a format embeds an alpha component in it, let's use it. Cc: Joonyoung Shim <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: Seung-Woo Kim <[email protected]> Acked-by: Inki Dae <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/cb1bdfbb481419a17cc4f6c8a1f07930136ac13f.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/atmel-hlcdc: Use the alpha format field in drm_format_infoMaxime Ripard1-19/+5
Now that the drm_format_info has a alpha field to tell if a format embeds an alpha component in it, let's use it. Acked-by: Boris Brezillon <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/23518426a46320dd884465cebec0961f839f2972.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/fourcc: Add a alpha field to drm_format_infoMaxime Ripard1-25/+25
There's a bunch of drivers that duplicate the same function to know if a particular format embeds an alpha component or not. Let's create a field in the drm_format_info to avoid duplicating that logic and looking up formats all the time. Cc: Eric Anholt <[email protected]> Cc: Inki Dae <[email protected]> Cc: Joonyoung Shim <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Mark Yao <[email protected]> Cc: Seung-Woo Kim <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/9cd9951d147ff810c1f6f68d79e7983361ed6b68.1516617243.git-series.maxime.ripard@free-electrons.com
2018-01-29drm/stm: ltdc: use crtc_mode_fixup to update adjusted_mode clockPhilippe CORNU1-10/+25
There is a difference between the panel/bridge requested pixel clock value and the real one due to the hw platform clock preciseness (pll, dividers...). This patch updates the adjusted_mode clock value with the real hw clock value so then attached encoder & connector can use it for precise timing computations. Signed-off-by: Philippe Cornu <[email protected]> Reviewed-by: Yannick Fertré <[email protected]> Signed-off-by: Benjamin Gaignard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-01-29Merge drm-next into drm-intel-next-queuedJoonas Lahtinen1280-18955/+30194
Pull 4.15 into drm-intel-next-queued for next feature pull. Signed-off-by: Joonas Lahtinen <[email protected]>
2018-01-29Revert "drm/i915: mark all device info struct with __initconst"Lionel Landwerlin1-48/+48
This reverts commit 5b54eddd3920e9f6f1a6d972454baf350cbae77e. Conflicts: drivers/gpu/drm/i915/i915_pci.c Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104805 Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Fixes: 5b54eddd3920 ("drm/i915: mark all device info struct with __initconst") Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2018-01-29Merge tag 'nand/for-4.16' of git://git.infradead.org/linux-mtd into mtd/nextBoris Brezillon47-1399/+5858
Pull NAND changes from Boris Brezillon: " Core changes: * Fix NAND_CMD_NONE handling in nand_command[_lp]() hooks * Introduce the ->exec_op() infrastructure * Rework NAND buffers handling * Fix ECC requirements for K9F4G08U0D * Fix nand_do_read_oob() to return the number of bitflips * Mark K9F1G08U0E as not supporting subpage writes Driver changes: * MTK: Rework the driver to support new IP versions * OMAP OneNAND: Full rework to use new APIs (libgpio, dmaengine) and fix DT support * Marvell: Add a new driver to replace the pxa3xx one "
2018-01-29Merge tag 'spi-nor/for-4.16' of git://git.infradead.org/linux-mtd into mtd/nextBoris Brezillon6-162/+231
Pull spi-nor changes from Cyrille Pitchen: " This pull-request contains the following notable changes: Core changes: * Add support to new ISSI and Cypress/Spansion memory parts. * Fix support of Micron memories by checking error bits in the FSR. * Fix update of block-protection bits by reading back the SR. * Restore the internal state of the SPI flash memory when removing the device. Driver changes: * Maintenance for Freescale, Intel and Metiatek drivers. * Add support of the direct access mode for the Cadence QSPI controller. "
2018-01-28NTB: ntb_perf: fix cast to restricted __le32Serge Semin1-15/+13
Sparse is whining about the u32 and __le32 mixed usage in the driver drivers/ntb/test/ntb_perf.c:288:21: warning: cast to restricted __le32 drivers/ntb/test/ntb_perf.c:295:37: warning: incorrect type in argument 4 (different base types) drivers/ntb/test/ntb_perf.c:295:37: expected unsigned int [unsigned] [usertype] val drivers/ntb/test/ntb_perf.c:295:37: got restricted __le32 [usertype] <noident> ... NTB hardware drivers shall accept CPU-endian data and translate it to the portable formate by internal means, so the explicit conversions are not necessary before Scratchpad/Messages API usage anymore. Fixes: b83003b3fdc1 ("NTB: ntb_perf: Add full multi-port NTB API support") Signed-off-by: Serge Semin <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_perf: Fix an error code in perf_copy_chunk()Dan Carpenter1-1/+2
We accidentally return success if dmaengine_submit() fails. The fix is to preserve the error code from dma_submit_error(). Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: Make function switchtec_ntb_remove() staticWei Yongjun1-2/+2
Fixes the following sparse warnings: drivers/ntb/hw/mscc/ntb_hw_switchtec.c:1552:6: warning: symbol 'switchtec_ntb_remove' was not declared. Should it be static? Signed-off-by: Wei Yongjun <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: ntb_tool: fix memory leak on 'buf' on error exit pathColin Ian King1-1/+3
Currently there is a memory leak on buf when the call to ntb_mw_get_align fails. Add an exit err label and jump to this so that kfree on buf frees the memory. Detected by CoverityScan, CID#1464286 ("Resource leak") Fixes: d637628ce00c ("NTB: ntb_tool: Add full multi-port NTB API support") Signed-off-by: Colin Ian King <[email protected]> Acked-by: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: ntb_perf: fix printing of resource_size_tArnd Bergmann1-2/+2
On 32-bit architectures, resource_size_t is usually 'unsigned int' or 'unsigned long' but not 'unsigned long long', so we get a warning about printing the wrong data: drivers/ntb/test/ntb_perf.c: In function 'perf_setup_peer_mw': drivers/ntb/test/ntb_perf.c:1390:35: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t {aka unsigned int}' [-Werror=format=] This changes the format string to the special %pa that is already used elsewhere in the same file. Fixes: b83003b3fdc1 ("NTB: ntb_perf: Add full multi-port NTB API support") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: ntb_hw_idt: Set NTB_TOPO_SWITCH topologySerge Semin1-1/+1
Since Switchtec patch there has been a new topology added to the NTB API. It's called NTB_TOPO_SWITCH and dedicated for PCIe switch chips. Even though topo field isn't used within the IDT driver much, lets set it for the sake of unification. Signed-off-by: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: ntb_perf: Add full multi-port NTB API supportSerge Semin1-601/+1219
Former NTB Performance driver could only work with NTB devices, which got Scratchpads available and had just two ports. Since there are devices, which don't have Scratchpads and got more than two peer ports, the performance measuring tool needs to be rewritten. This patch adds the ability to test any available NTB peer. Additionally it allows to set NTB memory windows up using any available data exchange interface: Scratchpad or Message registers. Some cleanups are also added here. Signed-off-by: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: ntb_tool: Add full multi-port NTB API supportSerge Semin1-580/+1240
Former NTB Debugging tool driver supported only the limited functionality of the recently updated NTB API, which is now available to work with the truly NTB multi-port devices and devices, which got NTB Message registers instead of Scratchpads. This patch fully rewrites the driver so one would fully expose all the new NTB API interfaces. Particularly it concerns the Message registers, peer ports API, NTB link settings. Additional cleanups are also added here. Signed-off-by: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: ntb_pp: Add full multi-port NTB API supportSerge Semin1-165/+282
Current Ping Pong driver can't truly work with multi-port devices. Additionally it requires the Scratchpad registers being available on NTB device. This patches rewrites the driver so one would perform the cyclic Ping-Pong algorithm around all the available NTB peers and makes it working with NTB hardware, which doesn't support Scratchpads, but such alternative as NTB Message register. Additional cleanups are also added here. Signed-off-by: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: Set dma mask and dma coherent mask to NTB devicesSerge Semin4-2/+15
The dma_mask and dma_coherent_mask fields of the NTB struct device weren't initialized in hardware drivers. In fact it should be done instead of PCIe interface usage, since NTB clients are supposed to use NTB API and left unaware of real hardware implementation. In addition to that ntb_device_register() method shouldn't clear the passed ntb_dev structure, since it dma_mask is initialized by hardware drivers. Signed-off-by: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: Rename NTB messaging API methodsSerge Semin1-15/+12
There is a common methods signature form used over all the NTB API like functions naming scheme, arguments names and order, etc. Recently added NTB messaging API IO callbacks were named a bit different so should be renamed to be in compliance with the rest of the API. Signed-off-by: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: fix logic errorArnd Bergmann1-1/+1
Newer gcc (version 7 and 8 presumably) warn about a statement mixing the << operator with logical and: drivers/ntb/hw/mscc/ntb_hw_switchtec.c: In function 'switchtec_ntb_init_sndev': drivers/ntb/hw/mscc/ntb_hw_switchtec.c:888:24: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context] My interpretation here is that the author must have intended a bitmask rather than a comparison, so I'm changing the '&&' to '&', which makes a lot more sense in the context. Fixes: 1b249475275d ("ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setups") Reviewed-by: Logan Gunthorpe <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: Check for alignment of the buffer in mw_set_trans()Logan Gunthorpe1-0/+13
With Switchtec hardware, the buffer used for a memory window must be aligned to its size (the hardware only replaces the lower bits). In certain circumstances dma_alloc_coherent() will not provide a buffer that adheres to this requirement like when using the CMA and CONFIG_CMA_ALIGNMENT is set lower than the buffer size. When we get an unaligned buffer mw_set_trans() should return an error. We also log an error so we know the cause of the problem. Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_transport: Fix bug with max_mw_size parameterLogan Gunthorpe1-0/+3
When using the max_mw_size parameter of ntb_transport to limit the size of the Memory windows, communication cannot be established and the queues freeze. This is because the mw_size that's reported to the peer is correctly limited but the size used locally is not. So the MW is initialized with a buffer smaller than the window but the TX side is using the full window. This means the TX side will be writing to a region of the window that points nowhere. This is easily fixed by applying the same limit to tx_size in ntb_transport_init_queue(). Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers") Signed-off-by: Logan Gunthorpe <[email protected]> Acked-by: Allen Hubbe <[email protected]> Cc: Dave Jiang <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: Force down the link before initializingLogan Gunthorpe1-7/+50
If one host crashes and soft reboots, the other host may not see a link down event. Then when the crashed host comes back up, the surviving host may not know the link was reset and the NTB clients may not work without being reset. To solve this, we send a LINK_FORCE_DOWN message to each peer every time we come up, before we register the NTB device. If a surviving host still thinks the link is up it will take it down immediately. In this way, once the crashed host comes up fully, it will send a regular link up event as per usual and the link will be properly restarted. While we are in the area, this also fixes the MSG_LINK_UP message that was in the link down function that was reported by Doug Meyers. Signed-off-by: Logan Gunthorpe <[email protected]> Reported-by: ThanhTuThai <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: Crosslink doorbells and messagesLogan Gunthorpe1-10/+55
In a crosslink configuration doorbells and messages largely work the same but the NTB registers must be accessed through the reserved LUT window. Also, as a bonus, seeing there are now two independent sets of NTB links, both partitions can actually use all 60 doorbell registers instead of them having to be split into two for each partition. Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: Add initialization code for crosslinkLogan Gunthorpe1-5/+197
Crosslink is a feature of the Switchtec switches that is similar to the B2B mode of other NTB devices. It allows a system to be designed that is perfectly symmetric with two identical switches that link two hosts together. In order for the system to be symmetric, there is an empty host-less partition between the two switches which the host must enumerate and assign BAR addresses to. The firmware in the switch manages this specially so that the BAR addresses on both sides of the empty partition will be identical despite being in the same partition with the same address space. The driver determines whether crosslink is enabled by a flag set in the NTB partition info registers which are set by the switch's configuration file. When crosslink is enabled, a reserved LUT window is setup to point to the peer's switch's NTB registers and the local MWs are set to forward to the host-less partition's BARs. (Yes, this hurts my brain too.) Once this is setup, largely the same NTB infrastructure is used to communicate between the two hosts. Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: Make switchtec_ntb_init_req_id_table() more generalLogan Gunthorpe1-36/+56
This is a prep patch in order to support the crosslink feature which will require the driver to setup the requester ID table in another partition as well as it's own. To aid this, create a helper function which sets up the requester IDs from an array. Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: Create helper function to setup reserved LUT MWsLogan Gunthorpe1-29/+43
This is a prep patch in order to support the crosslink feature which will require the driver to use another reserved LUT window. To simplify this we move the code which sets up the reserved LUT window into a helper function which will be used by the crosslink initialization. Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: Keep track of the number of LUT windows used by the driverLogan Gunthorpe1-4/+8
This is a prep patch in order to support the crosslink feature which will require the driver to use another reserved LUT window. To simplify this, we add some code to track the number of reserved LUT windows in use instead of assuming this is always 1. Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setupsKelvin Cao1-9/+48
Allow using Switchtec NTB in setups that have more than two partitions. Note: this does not enable having multi-host communication, it only allows for a single NTB link between two hosts in a network that might have more than two. Use following logic to determine the NT peer partition: 1) If there are 2 partitions, and the target vector is set in the Switchtec configuration, use the partition specified in target vector. 2) If there are 2 partitions and target vector is unset use the only other partition as specified in the NT EP map. 3) If there are more than 2 partitions and target vector is set use the other partition specified in target vector. 4) If there are more than 2 partitions and target vector is unset, this is invalid and report an error. Signed-off-by: Kelvin Cao <[email protected]> [[email protected]: commit message fleshed out] Signed-off-by: Logan Gunthorpe <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: switchtec_ntb: Add new line on appropriate printksJon Mason1-21/+21
Trivial addition of "\n" to the dev_* prints where necessary Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: switchtec_ntb: fix spelling mistake: "peforming" -> "performing"Colin Ian King1-1/+1
Trivial fix to spelling mistake in dev_err error message Signed-off-by: Colin Ian King <[email protected]> Reviewed-By: Logan Gunthorpe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb: remove Intel Atom NTB driver supportDave Jiang2-363/+4
Removing dead code since this is not being used. Signed-off-by: Dave Jiang <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28ntb: remove unneeded DRIVER_LICENSE #definesGreg Kroah-Hartman4-8/+4
There is no need to #define the license of the driver, just put it in the MODULE_LICENSE() line directly as a text string. This allows tools that check that the module license matches the source code license to work properly, as there is no need to unwind the unneeded dereference, especially when the string is defined just a few lines above the usage of it. Reported-and-reviewed-by: Philippe Ombredanne <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Cc: Dave Jiang <[email protected]> Cc: Allen Hubbe <[email protected]> Cc: Gary R Hook <[email protected]> Cc: Serge Semin <[email protected]> Signed-off-by: Jon Mason <[email protected]>
2018-01-28NTB: ntb_hw_switchtec: Fix peer BAR bug in switchtec_ntb_init_shared_mwDoug Meyer1-4/+5
This resolves a bug which may incorrectly configure the peer host's LUT for shared memory window access. The code was using the local host's first BAR number, rather than the peer hosts's first BAR number, to determine what peer NT control register to program. The bug will cause the Switchtec NTB link to work only if both peers have the same first NTB BAR configured. In all other configurations, the link will not come up, failing silently. When both hosts have the same first BAR, the configuration works only because the first BAR numbers happent to be the same. When the hosts do not have the same first BAR, then the LUT translation will not be configured in the correct peer LUT and will not give the peer the shared memory window access required for the link to operate. Signed-off-by: Doug Meyer <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]> Fixes: 678784a44ae8 ("NTB: switchtec_ntb: Initialize hardware for memory windows") Signed-off-by: Jon Mason <[email protected]>