aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-05-07Merge tag 'char-misc-5.2-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-miscLinus Torvalds29-398/+144
Pull char/misc update part 2 from Greg KH: "Here is the "real" big set of char/misc driver patches for 5.2-rc1 Loads of different driver subsystem stuff in here, all over the places: - thunderbolt driver updates - habanalabs driver updates - nvmem driver updates - extcon driver updates - intel_th driver updates - mei driver updates - coresight driver updates - soundwire driver cleanups and updates - fastrpc driver updates - other minor driver updates - chardev minor fixups Feels like this tree is getting to be a dumping ground of "small driver subsystems" these days. Which is fine with me, if it makes things easier for those subsystem maintainers. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.2-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (255 commits) intel_th: msu: Add current window tracking intel_th: msu: Add a sysfs attribute to trigger window switch intel_th: msu: Correct the block wrap detection intel_th: Add switch triggering support intel_th: gth: Factor out trace start/stop intel_th: msu: Factor out pipeline draining intel_th: msu: Switch over to scatterlist intel_th: msu: Replace open-coded list_{first,last,next}_entry variants intel_th: Only report useful IRQs to subdevices intel_th: msu: Start handling IRQs intel_th: pci: Use MSI interrupt signalling intel_th: Communicate IRQ via resource intel_th: Add "rtit" source device intel_th: Skip subdevices if their MMIO is missing intel_th: Rework resource passing between glue layers and core intel_th: SPDX-ify the documentation intel_th: msu: Fix single mode with IOMMU coresight: funnel: Support static funnel dt-bindings: arm: coresight: Unify funnel DT binding coresight: replicator: Add new device id for static replicator ...
2019-04-25mei: expose device state in sysfsAlexander Usyskin4-18/+72
Expose mei device state to user-space through sysfs. This gives indication to applications that driver is in transition, usefully mostly to detect link reset state. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25mei: hdcp: use own Kconfig fileTomas Winkler2-9/+14
The mei/hdcp module have its own Makefile so naturally it should have associated Kconfig in the same directory. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-08drivers: Remove explicit invocations of mmiowb()Will Deacon1-3/+0
mmiowb() is now implied by spin_unlock() on architectures that require it, so there is no reason to call it from driver code. This patch was generated using coccinelle: @mmiowb@ @@ - mmiowb(); and invoked as: $ for d in drivers include/linux/qed sound; do \ spatch --include-headers --sp-file mmiowb.cocci --dir $d --in-place; done NOTE: mmiowb() has only ever guaranteed ordering in conjunction with spin_unlock(). However, pairing each mmiowb() removal in this patch with the corresponding call to spin_unlock() is not at all trivial, so there is a small chance that this change may regress any drivers incorrectly relying on mmiowb() to order MMIO writes between CPUs using lock-free synchronisation. If you've ended up bisecting to this commit, you can reintroduce the mmiowb() calls using wmb() instead, which should restore the old behaviour on all architectures other than some esoteric ia64 systems. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
2019-03-28mei: adjust the copyright notice in the files.Tomas Winkler26-25/+26
Use unified version of the copyright notice in the files Update copyright years according the year the files were touched, except this patch and SPDX conversions. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-28mei/hdcp: Fix SPDX identifiersTomas Winkler2-2/+2
1. Remove redundant parentheses around single license 2. Fix the license to GPL-2.0 and not GPL-2.0+ in mei_hdcp.h Cc: Ramalingam C <ramalingam.c@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-28mei: convert to SPDX license tagsTomas Winkler22-344/+29
Replace boiler plate licenses texts with the SPDX license identifiers in the mei files header. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-28mei: add missing SPDX tag to mei KconfigTomas Winkler1-0/+1
Add SPDX tag with GPLv2 license to mei Kconfig. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-28Merge tag 'topic/mei-hdcp-2019-02-26' of git://anongit.freedesktop.org/drm/drm-intel into char-misc-nextGreg Kroah-Hartman6-0/+1261
Daniel writes: mei-hdcp driver mei driver for the me hdcp client, for use by drm/i915. Including the following prep work: - whitelist hdcp client in mei bus - merge to include char-misc-next - drm/i915 side of the mei_hdcp/i915 component interface - component prep work (including one patch touching i915&snd-hda) * tag 'topic/mei-hdcp-2019-02-26' of git://anongit.freedesktop.org/drm/drm-intel: (23 commits) misc/mei/hdcp: Component framework for I915 Interface misc/mei/hdcp: Closing wired HDCP2.2 Tx Session misc/mei/hdcp: Enabling the HDCP authentication misc/mei/hdcp: Verify M_prime misc/mei/hdcp: Repeater topology verification and ack misc/mei/hdcp: Prepare Session Key misc/mei/hdcp: Verify L_prime misc/mei/hdcp: Initiate Locality check misc/mei/hdcp: Store the HDCP Pairing info misc/mei/hdcp: Verify H_prime misc/mei/hdcp: Verify Receiver Cert and prepare km misc/mei/hdcp: Initiate Wired HDCP2.2 Tx Session misc/mei/hdcp: Define ME FW interface for HDCP2.2 misc/mei/hdcp: Client driver for HDCP application mei: bus: whitelist hdcp client drm/audio: declaration of struct device drm: helper functions for hdcp2 seq_num to from u32 drm/i915: MEI interface definition drm/i915: header for i915 - MEI_HDCP interface drm/i915: enum port definition is moved into i915_drm.h ...
2019-02-26mei: bus: move hw module get/put to probe/releaseAlexander Usyskin1-11/+10
Fix unbalanced module reference counting during internal reset, which prevents the drivers unloading. Tracking mei_me/txe modules on mei client bus via mei_cldev_enable/disable is error prone due to possible internal reset flow, where clients are disconnected underneath. Moving reference counting to probe and release of mei bus client driver solves this issue in simplest way, as each client provides only a single connection to a client bus driver. Cc: <stable@vger.kernel.org> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-25misc/mei/hdcp: Component framework for I915 InterfaceRamalingam C1-3/+83
Mei hdcp driver is designed as component slave for the I915 component master. v2: Rebased. v3: Notifier chain is adopted for cldev state update [Tomas] v4: Made static dummy functions as inline in mei_hdcp.h API for polling client device status IS_ENABLED used in header, for config status for mei_hdcp. v5: Replacing the notifier with component framework. [Daniel] v6: Rebased on the I915 comp master redesign. v7: mei_hdcp_component_registered is made static [Uma] Need for global static variable mei_cldev is removed. v8: master comp is added to be matched with i915 subcomponent [daniel] v9: only comp_master is set and retrieved as driver_data [Daniel] Reviewed-by Daniel. v10: small corrections at probe [Tomas] v11: bind and unbind logs are made as debug logs [Tomas] cldev_enable failure is handled [Tomas] Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-16-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Closing wired HDCP2.2 Tx SessionRamalingam C1-1/+54
Request the ME to terminate the HDCP2.2 session for a port. On Success, ME FW will mark the intel port as Deauthenticated and terminate the wired HDCP2.2 Tx session started due to the cmd WIRED_INITIATE_HDCP2_SESSION. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] Style and typos fixed [Uma] v5: Extra line is removed. v6: Collected the Rb-ed by. Rebased. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc addition.[Tomas] v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-15-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Enabling the HDCP authenticationRamalingam C1-1/+54
Request to ME to configure a port as authenticated. On Success, ME FW will mark the port as authenticated and provides HDCP cipher with the encryption keys. Enabling the Authentication can be requested once all stages of HDCP2.2 authentication is completed by interacting with ME FW. Only after this stage, driver can enable the HDCP encryption for the port, through HW registers. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] Style and typos fixed [Uma] v5: Rebased. v6: Collected the Rb-ed by. Rebased. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc addition. [Tomas] v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-14-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Verify M_primeRamalingam C1-1/+66
Request to ME to verify the M_Prime received from the HDCP sink. ME FW will calculate the M and compare with M_prime received as part of RepeaterAuth_Stream_Ready, which is HDCP2.2 protocol msg. On successful completion of this stage, downstream propagation of the stream management info is completed. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] endianness conversion func is moved to drm_hdcp.h [Uma] v5: Rebased. v6: Collected the Rb-ed by. Rebasing. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc addition. [Tomas] drm_hdcp2_u32_to_seq_num() is used for u32 to seq_num. v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: %s/__swab16/cpu_to_be16 [Tomas] Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-13-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Repeater topology verification and ackRamalingam C1-1/+76
Request ME to verify the downstream topology information received. ME FW will validate the Repeaters receiver id list and downstream topology. On Success ME FW will provide the Least Significant 128bits of VPrime, which forms the repeater ack. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] Style and typos fixed [Uma] v5: Rebased. v6: Rebasing. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc addition. [Tomas] v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-12-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Prepare Session KeyRamalingam C1-1/+58
Request to ME to prepare the encrypted session key. On Success, ME provides Encrypted session key. Function populates the HDCP2.2 authentication msg SKE_Send_Eks. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] Style fixed [Uma] v5: Rebased. v6: Collected the Rb-ed by. Rebasing. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc addition. [Tomas] v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-11-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Verify L_primeRamalingam C1-1/+59
Request to ME to verify the LPrime received from HDCP sink. On Success, ME FW will verify the received Lprime by calculating and comparing with L. This represents the completion of Locality Check. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] Style fixed [Uma] v5: Rebased. v6: Collected the Rb-ed by. Rebasing. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc addition. [Tomas] memcpy for const length. v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-10-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Initiate Locality checkRamalingam C1-1/+56
Requests ME to start the second stage of HDCP2.2 authentication, called Locality Check. On Success, ME FW will provide LC_Init message to send to hdcp sink. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd used for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] Style fixed [Uma] v5: Rebased. v6: Collected the Rb-ed by. Rebasing. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc addition. [Tomas] v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-9-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Store the HDCP Pairing infoRamalingam C1-1/+59
Provides Pairing info to ME to store. Pairing is a process to fast track the subsequent authentication with the same HDCP sink. On Success, received HDCP pairing info is stored in non-volatile memory of ME. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] Style fixed [Uma] v5: Rebased. v6: Collected the Rb-ed by. Rebasing. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc addition. [Tomas] memcpy for const length. v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-8-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Verify H_primeRamalingam C1-1/+57
Requests for the verification of AKE_Send_H_prime. ME will calculate the H and comparing it with received H_Prime. The result will be returned as status. Here AKE_Send_H_prime is a HDCP2.2 Authentication msg. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] Styles and typos fixed [Uma] v5: Rebased. v6: Collected the Rb-ed by. Rebasing. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc Addition [Tomas] memcpy for const length. v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-7-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Verify Receiver Cert and prepare kmRamalingam C1-1/+82
Requests for verification for receiver certification and also the preparation for next AKE auth message with km. On Success ME FW validate the HDCP2.2 receivers certificate and do the revocation check on the receiver ID. AKE_Stored_Km will be prepared if the receiver is already paired, else AKE_No_Stored_Km will be prepared. Here AKE_Stored_Km and AKE_No_Stored_Km are HDCP2.2 protocol msgs. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd is used for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] v5: Rebased. v6: Collected the Rb-ed by. Rebasing. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc Addition. [Tomas] memcpy for const length. v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: Fixed the conversion of u8 to bool [Tomas] K-Doc fix [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-6-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Initiate Wired HDCP2.2 Tx SessionRamalingam C2-0/+105
Request ME FW to start the HDCP2.2 session for an intel port. Prepares payloads for command WIRED_INITIATE_HDCP2_SESSION and sends to ME FW. On Success, ME FW will start a HDCP2.2 session for the port and provides the content for HDCP2.2 AKE_Init message. v2: Rebased. v3: cldev is add as a separate parameter [Tomas] Redundant comment and typecast are removed [Tomas] v4: %zd is used for size [Alexander] %s/return -1/return -EIO [Alexander] Spellings in commit msg is fixed [Uma] v5: Rebased. v6: Collected the rb-ed by. Realigning the patches in the series. v7: Adjust to the new mei interface. Fix for kdoc. v8: K-Doc Addition. memcpy for const length. v9: s/mei_hdcp_ddi/mei_fw_ddi s/i915_port/mei_i915_port [Tomas] renamed func as mei_hdcp_* [Tomas] Instead of macro, inline func for ddi index is used. [Tomas] v10: Switch case for the coversion between i915_port to mei_ddi [Tomas] Kernel doc fix. v11: mei_hdcp_ops is defined as const. [Tomas] Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-5-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Define ME FW interface for HDCP2.2Ramalingam C1-0/+366
Defines the HDCP specific ME FW interfaces such as Request CMDs, payload structure for CMDs and their response status codes. This patch defines payload size(Excluding the Header)for each WIRED HDCP2.2 CMDs. v2: Rebased. v3: Extra comments are removed. v4: %s/\/\*\*/\/\* v5: Extra lines are removed. v6: Remove redundant text from the License header %s/LPRIME_HALF/V_PRIME_HALF %s/uintxx_t/uxx v7: Extra taps removed. v8: k is defined as __be16 [Tomas] Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Acked-by Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-4-git-send-email-ramalingam.c@intel.com
2019-02-25misc/mei/hdcp: Client driver for HDCP applicationRamalingam C4-0/+83
ME FW contributes a vital role in HDCP2.2 authentication. HDCP2.2 driver needs to communicate to ME FW for each step of the HDCP2.2 authentication. ME FW prepare and HDCP2.2 authentication parameters and encrypt them as per spec. With such parameter Driver prepares HDCP2.2 auth messages and communicate with HDCP2.2 sink. Similarly HDCP2.2 sink's response is shared with ME FW for decrypt and verification. Once All the steps of HDCP2.2 authentications are complete on driver's request ME FW will configure the port as authenticated and supply the HDCP keys to the Gen HW for encryption. Only after this stage HDCP2.2 driver can start the HDCP2.2 encryption for a port. ME FW is interfaced to kernel through MEI Bus Driver. To obtain the HDCP2.2 services from the ME FW through MEI Bus driver MEI Client Driver is developed. v2: hdcp files are moved to drivers/misc/mei/hdcp/ [Tomas] v3: Squashed the Kbuild support [Tomas] UUID renamed and Module License is modified [Tomas] drv_data is set to null at remove [Tomas] v4: Module name is changed to "MEI HDCP" I915 Selects the MEI_HDCP v5: Remove redundant text from the License header Fix malformed licence Removed the drv_data resetting. v6: K-Doc addition. [Tomas] v7: %s/UUID_LE/GUID_INIT [Tomas] GPL Ver is 2.0 than 2.0+ [Tomas] v8: Added more info into Kconfig addition [Tomas] Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-3-git-send-email-ramalingam.c@intel.com
2019-02-25mei: bus: whitelist hdcp clientTomas Winkler1-0/+16
Whitelist HDCP client for in kernel drm use v2: Rebased. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-2-git-send-email-ramalingam.c@intel.com
2019-02-20mei: hbm: clean the feature flags on link resetAlexander Usyskin1-0/+7
The list of supported functions can be altered upon link reset, clean the flags to allow correct selections of supported features. Cc: <stable@vger.kernel.org> v4.19+ Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-12mei: bus: export to_mei_cl_device for mei client devices driversTomas Winkler1-1/+0
Export to_mei_cl_device macro, as it is needed also in the mei client drivers. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-11Merge 5.0-rc6 into char-misc-nextGreg Kroah-Hartman3-1/+8
We need the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-30mei: free read cb on ctrl_wr list flushAlexander Usyskin1-1/+4
There is a little window during disconnection flow when read cb is moved between lists and may be not freed. Remove moving read cbs explicitly during flash fixes this memory leak. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-30mei: me: add ice lake point device id.Tomas Winkler2-0/+4
Add icelake mei device id. Cc: <stable@vger.kernel.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-28Merge 5.0-rc4 into char-misc-nextGreg Kroah-Hartman3-4/+14
We need the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-13mei: squash single_recv_buf into one bit in client propertiesAlexander Usyskin1-1/+2
single_recv_buf member of struct mei_client_properties has a boolean value and can be represented in on bit, to free other 7 bits for another usage. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-13mei: me: add denverton innovation engine device IDsTomas Winkler2-0/+4
Add the Denverton innovation engine (IE) device ids. The IE is an ME-like device which provides HW security offloading. Cc: <stable@vger.kernel.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-13mei: me: mark LBG devices as having dma supportAlexander Usyskin1-1/+1
The LBG server platform sports DMA support. Cc: <stable@vger.kernel.org> #v5.0+ Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-13mei: dma: silent the reject messageTomas Winkler1-3/+9
Not all FW versions support DMA on their first release, hence it is normal behavior to receive a reject response upon DMA setup request. In order to prevent confusion, the DMA setup reject message is printed only in debug level. Cc: <stable@vger.kernel.org> #v5.0+ Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26mei: me: mark CNP devices as having dma supportAlexander Usyskin1-2/+2
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26mei: bump hbm version to 2.1Alexander Usyskin1-1/+1
Bump HBM version to 2.1 to indicate DMA transfer support. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26mei: dma ring: implement transmit flowTomas Winkler3-13/+142
Implement a circular buffer on allocated system memory. Read and write indices are stored on the control block which is also shared between the device and the host. Two new functions are exported from the DMA module: mei_dma_ring_write, and mei_dma_ring_empty_slots. The former simply copy a packet on the TX DMA circular buffer and later, returns the number of empty slots on the TX DMA circular buffer. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26mei: dma ring: implement rx circular buffer logicTomas Winkler6-15/+98
Implement circular buffer protocol over receive dma buffer. Add extension to the mei message header that holds length of the buffer on the dma buffer. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26mei: hw: add dma ring control blockTomas Winkler4-0/+46
The DMA ring control block contains write and read indices for host and device circular buffers. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26mei: hbm: setup dma ringTomas Winkler2-3/+85
DMA ring is allocated upon HBM handshake and the ring parameters are set via dedicated HBM_DMA_SETUP request command. The firmware will perform its setup and respond with a status. On failure the DMA buffers are released. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26mei: dma ring buffers allocationTomas Winkler4-0/+126
Allocate DMA ring buffers from managed coherent memory. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07mei: expedite ioctl return on the notify set operation errorAlexander Usyskin1-1/+3
The notify set operation ioctl will wait till timeout is expired even in case when the FW returned an error. Check the status field of the client object in wait_event_timeout() to determine if the caller can return earlier. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07mei: flush queues by the host client onlyAlexander Usyskin1-19/+2
During queues flush, the me client in most cases is already unlinked hence the me client id is unavailable. The host client structure pointer is enough for identification. The function mei_cl_cmp_id() is dropped as it has no more usage. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07mei: hbm: drop BUG() from the hbm handlerTomas Winkler1-2/+2
Drop BUG() from the hbm handler in order not to crash the whole kernel on faulty firmware implementation. Instead of it, just return an error resulting into link reset. There is no any known issue of faulty firmware in this matter, the change is just to ease the development. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02mei: replace POLL* with EPOLL* for write queues.Tomas Winkler1-2/+2
Looks like during merging the bulk POLL* -> EPOLL* replacement missed the patch 'commit af336cabe083 ("mei: limit the number of queued writes")' Fix sparse warning: drivers/misc/mei/main.c:602:13: warning: restricted __poll_t degrades to integer drivers/misc/mei/main.c:605:30: warning: invalid assignment: |= drivers/misc/mei/main.c:605:30: left side has type restricted __poll_t drivers/misc/mei/main.c:605:30: right side has type int Fixes: af336cabe083 ("mei: limit the number of queued writes") Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25misc: remove redundant include moduleparam.hzhong jiang1-1/+0
module.h already contains moduleparam.h, so it is safe to remove the redundant include. The issue is detected with the help of Coccinelle. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-12mei: bus: need to unlink client before freeingTomas Winkler1-5/+4
In case a client fails to connect in mei_cldev_enable(), the caller won't call the mei_cldev_disable leaving the client in a linked stated. Upon driver unload the client structure will be freed in mei_cl_bus_dev_release(), leaving a stale pointer on a fail_list. This will eventually end up in crash during power down flow in mei_cl_set_disonnected(). RIP: mei_cl_set_disconnected+0x5/0x260[mei] Call trace: mei_cl_all_disconnect+0x22/0x30 mei_reset+0x194/0x250 __synchronize_hardirq+0x43/0x50 _cond_resched+0x15/0x30 mei_me_intr_clear+0x20/0x100 mei_stop+0x76/0xb0 mei_me_shutdown+0x3f/0x80 pci_device_shutdown+0x34/0x60 kernel_restart+0x0e/0x30 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200455 Fixes: 'c110cdb17148 ("mei: bus: make a client pointer always available")' Cc: <stable@vger.kernel.org> 4.10+ Tested-by: Georg Müller <georgmueller@gmx.net> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-12mei: bus: fix hw module get/put balanceTomas Winkler1-2/+1
In case the device is not connected it doesn't 'get' hw module and hence should not 'put' it on disable. Cc: <stable@vger.kernel.org> 4.16+ Fixes:'commit 257355a44b99 ("mei: make module referencing local to the bus.c")' Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200455 Tested-by: Georg Müller <georgmueller@gmx.net> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-12mei: fix use-after-free in mei_cl_writeJohn Hubbard1-1/+1
KASAN reports a use-after-free during startup, in mei_cl_write: BUG: KASAN: use-after-free in mei_cl_write+0x601/0x870 [mei] (drivers/misc/mei/client.c:1770) This is caused by commit 98e70866aacb ("mei: add support for variable length mei headers."), which changed the return value from len, to buf->size. That ends up using a stale buf pointer, because blocking call, the cb (callback) is deleted in me_cl_complete() function. However, fortunately, len remains unchanged throughout the function (and I don't see anything else that would require re-reading buf->size either), so the fix is to simply revert the change, and return len, as before. Fixes: 98e70866aacb ("mei: add support for variable length mei headers.") CC: Arnd Bergmann <arnd@arndb.de> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: John Hubbard <jhubbard@nvidia.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>