History log of /linux-master/drivers/misc/mei/hw-txe.c
Revision Date Author Comments
# 4b25cf09 18-Sep-2022 Jilin Yuan <yuanjilin@cdjrlc.com>

mei: fix repeated words in comments

Delete the redundant word 'from'.

Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Jilin Yuan <yuanjilin@cdjrlc.com>
Link: https://lore.kernel.org/r/20220918100431.28381-1-yuanjilin@cdjrlc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 95953618 07-Sep-2022 Alexander Usyskin <alexander.usyskin@intel.com>

mei: extend timeouts on slow devices

Parametrize operational timeouts in order
to support slow firmware on some graphics devices.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-9-tomas.winkler@intel.com
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>


# d325537b 12-Nov-2021 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

mei: Remove some dead code

'generated' is known to be true here, so "true || whatever" will still be
true.

So, remove some dead code.

Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/3f904c291f3eed06223dd8d494028e0d49df6f10.1636711522.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c614970e 23-Jul-2020 Tomas Winkler <tomas.winkler@intel.com>

mei: hw: use sizeof of variable instead of struct type

Use sizeof(*dev) + sizeof(*hw) instead of
sizeof(struct mei_device) + sizeof(struct mei_me_hw)

There is a possibility of bug when variable type has changed but
corresponding struct passed to the sizeof has not.

Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20200723145927.882743-6-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 261e071a 06-Nov-2019 Tomas Winkler <tomas.winkler@intel.com>

mei: abstract fw status register read.

This is to allow working with mei devices embedded within
another pci device, where mei device is represented
as a platform child device and fw status registers
are not necessarily resident in the device pci config space.

Bump the copyright year to 2019 on the modified files.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20191106223841.15802-4-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1e55b609 11-Mar-2019 Tomas Winkler <tomas.winkler@intel.com>

mei: adjust the copyright notice in the files.

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>


# 9fff0425 11-Mar-2019 Tomas Winkler <tomas.winkler@intel.com>

mei: convert to SPDX license tags

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>


# 98e70866 31-Jul-2018 Tomas Winkler <tomas.winkler@intel.com>

mei: add support for variable length mei headers.

Remove header size knowledge from me and txe hw layers,
this requires to change the write handler to accept
header and its length as well as data and its length.

HBM messages are fixed to use basic header, hence we add mei_hbm2slots()
that converts HBM message length and mei message header,
while mei_data2slots() converts data length directly to the slots.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8c8d964c 23-Jul-2018 Tomas Winkler <tomas.winkler@intel.com>

mei: move hbuf_depth from the mei device to the hw modules

The host buffer depth is hardware specific so it's better to
handle it inside the me and txe hw modules. In me the depth
is read from register in txe it's a constant number.
The value is now retrieved via mei_hbuf_depth accessor,
while it replaces mei_hbuf_max_len.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9fc5f0f8 23-Jul-2018 Tomas Winkler <tomas.winkler@intel.com>

mei: cleanup slots to data conversions

Cleanup conversions between slots and data.
Define MEI_SLOT_SIZE instead of using 4 or sizeof(u32) across
the source code.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 44c98df0 12-Jul-2018 Tomas Winkler <tomas.winkler@intel.com>

mei: use correct type for counter variable in for loops

In for loops use same type for counter variable
as has the limiting variable.

drivers/misc/mei/bus-fixup.c:489:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/misc/mei/hw-txe.c:725:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/misc/mei/hw-txe.c:744:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# de877437 12-Jul-2018 Tomas Winkler <tomas.winkler@intel.com>

mei: check for error returned from mei_hbuf_empty_slots()

mei_hbuf_empty_slots() may return with an error in case
of circular buffer overflow. This type of error may
be caused only by a bug. However currently, the error
won't be detected due signed type promotion in comparison to u32.
We add explicit check for less then zero and explicit cast
in comparison to suppress singn-compare warning.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 16ae30ea 05-Jan-2018 Dan Carpenter <dan.carpenter@oracle.com>

mei: fix an && vs || typo

->dev_state can't be both MEI_DEV_RESETTING and MEI_DEV_POWER_DOWN at
the same time. && was clearing intended here.

Fixes: 8d52af6795c0 ("mei: speed up the power down flow")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8d52af67 12-Dec-2017 Tomas Winkler <tomas.winkler@intel.com>

mei: speed up the power down flow

When mei driver is powering down due to suspend or shutdown
it will iterate over the mei client bus and disconnect
each client device attached in turn.
The power down flow consist of the link rest, which causes all clients
get disconnected at once, hence the individual disconnection
can be omitted and significantly reduce power down flow.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f8a09605 26-Jan-2017 Tomas Winkler <tomas.winkler@intel.com>

mei: simplify error handling via devres function.

Use devm_ and pcim_ functions to make error handling
simpler and code smaller and tidier.

Based on original patch by
mei: me: use managed functions pcim_* and devm_*
https://lkml.org/lkml/2016/2/1/339

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 962ff7bc 27-Jan-2017 Alexander Usyskin <alexander.usyskin@intel.com>

mei: replace callback structures used as list head by list_head

mei_dev structure used struct mei_cl_cb type variables as for holding
callbacks list heads. Replace them by the actual struct list_head
as there is no other info that is handled. This slims down
the mei_dev structure and mostly streamline the code.

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>


# 4a8efd4a 04-Dec-2016 Tomas Winkler <tomas.winkler@intel.com>

mei: synchronize irq before initiating a reset.

We need to synchronize irqs before issuing reset to make sure that the
clients communication is concluded and doesn't leak to the reset flow
and confusing the state machine.

This issue is happening during suspend/resume stress testing.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4b9960d0 10-Nov-2016 Tomas Winkler <tomas.winkler@intel.com>

mei: constify buffer in the write functions calls

The write buffer should not by modified so make it constant. Also
hitchhike some style fixes on the way in the interface and rename
mei_me_write_message to mei_me_hbuf_write for consistency.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 43605e29 18-Oct-2016 Alexander Usyskin <alexander.usyskin@intel.com>

mei: txe: don't clean an unprocessed interrupt cause.

SEC registers are not accessible when the TXE device is in low power
state, hence the SEC interrupt cannot be processed if device is not
awake.

In some rare cases entrance to low power state (aliveness off) and input
ready bits can be signaled at the same time, resulting in communication
stall as input ready won't be signaled again after waking up. To resolve
this IPC_HHIER_SEC bit in HHISR_REG should not be cleaned if the
interrupt is not processed.

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>


# 77537ad2 16-Jun-2016 Alexander Usyskin <alexander.usyskin@intel.com>

mei: recover after errors in runtime pm flow

Schedule link reset if failed to perform runtime suspend or resume.
Set active runtime pm stte on link reset
to clean runtimr pm error, if present.

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>


# a96c5482 07-Feb-2016 Tomas Winkler <tomas.winkler@intel.com>

mei: trace pci configuration space io

Use tracing events also for reading and writing pci configuration space
<debugfs>/tracing/events/mei/mei_pci_reg_{read,write}

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3dc196ea 12-Jun-2015 Alexander Usyskin <alexander.usyskin@intel.com>

mei: me: wait for power gating exit confirmation

Fix the hbm power gating state machine so it will wait till it receives
confirmation interrupt for the PG_ISOLATION_EXIT message.

In process of the suspend flow the devices first have to exit from the
power gating state (runtime pm resume).
If we do not handle the confirmation interrupt after sending
PG_ISOLATION_EXIT message, we may receive it already after the suspend
flow has changed the device state and interrupt will be interpreted as a
spurious event, consequently link reset will be invoked which will
prevent the device from completing the suspend flow

kernel: [6603] mei_reset:136: mei_me 0000:00:16.0: powering down: end of reset
kernel: [476] mei_me_irq_thread_handler:643: mei_me 0000:00:16.0: function called after ISR to handle the interrupt processing.
kernel: mei_me 0000:00:16.0: FW not ready: resetting

Cc: <stable@vger.kernel.org> #3.18+
Cc: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=86241
Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770397
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
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>


# fe292283 14-Apr-2015 Tomas Winkler <tomas.winkler@intel.com>

mei: txe: reduce suspend/resume time

HW has to be in known state before the initialisation
sequence is started. The polling step for settling aliveness
was set to 200ms while in practise this can be done in up to 30msecs.

Cc: <stable@vger.kernel.org> #3.18+
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Barak Yoresh <barak.yoresh@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3908be6f 10-Feb-2015 Alexander Usyskin <alexander.usyskin@intel.com>

mei: fix function names and format in KDoc

Align functions names in KDoc with real ones.
Fix comment format to be KDoc and fix wrong syntax there.

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>


# edca5ea3 19-Nov-2014 Alexander Usyskin <alexander.usyskin@intel.com>

mei: read and print all six FW status registers

ME devices prior to PCH8 (Lynx Point) have two FW status registers,
on PCH8 and newer excluding txe there are six FW status registers.

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>


# 480bd3c4 29-Sep-2014 Fengguang Wu <fengguang.wu@intel.com>

mei: mei_txe_fw_sts can be static

CC: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ce23139c 29-Sep-2014 Alexander Usyskin <alexander.usyskin@intel.com>

mei: fix kernel-doc warnings

Add missed parameters descriptions and return values descriptions

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>


# a8605ea2 29-Sep-2014 Alexander Usyskin <alexander.usyskin@intel.com>

mei: fix KDoc documentation formatting

Fix Kdoc documentation formatting warnings
genertaed by ./scripts/kernel-doc

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>


# 0a01e974 29-Sep-2014 Alexander Usyskin <alexander.usyskin@intel.com>

mei: trivial: fix errors in prints in comments

Fix misspellings and wrong print texts

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>


# 4ad96db6 29-Sep-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: push pci cfg structure me hw

Device specific configurations are currently only needed by me hw
so we can remove it from txe

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d08b8fc0 29-Sep-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: remove the reference to pdev from mei_device

For purpose of adding testing HW we would like
to get rid of pci dependency in generic mei code.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1bd30b6a 29-Sep-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: move fw_status back to hw ops handlers

fw status retrieval has pci specific implementation
so we push it back to the hw layer

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2bf94cab 29-Sep-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: get rid of most of the pci dependencies in mei

For purpose of adding testing HW we would like
to get rid of pci dependency in generic mei code
This patch provides only straight forward changes
FW status and prob quirks need to be handled separately

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3a7e9b6c 29-Sep-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: push all standard settings into mei_device_init

Setting of hw_ops and device has should be in
mei_device_init.
We add reference to the parent device and remove
pci dependent cfg

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>


# 92db1555 29-Sep-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: fix style warning: Missing a blank line after declarations

fix new style warning: Missing a blank line after declarations

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f642155 20-Jul-2014 Alexander Usyskin <alexander.usyskin@intel.com>

mei: drop unused hw dependent fw status functions

We introduced unified FW status function in patch
mei: add per device configuration (lkml.org/lkml/2014/5/12/607)

This change made hw_ops functions unused and obsolete
therefore we remove these functions from source code.

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>


# 8d929d48 12-May-2014 Alexander Usyskin <alexander.usyskin@intel.com>

mei: add per device configuration

Add mei_cfg structure that holds per device configuration
data and hooks, as the first step we add firmware
status register offsets

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>


# 04dd3661 31-Mar-2014 Alexander Usyskin <alexander.usyskin@intel.com>

mei: extract fw status registers

Fetch FW status registers, as they are important in
in understanding of FW reset reasons

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>


# 964a2331 18-Mar-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: expose hardware power gating state to mei layer

Since the runtime pm and the internal power gating
cannot be in complete sync in regards to I/O
operations, we need to expose the device
hardware internal power gating state to mei layer

2. We add pg_state handler that translate the hw
internal pg state to mei layer

2. We add power gating event variable to keep
power track of power gating transitions

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Reviewed-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ee7e5afd 18-Mar-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: condition PGI support on HW and HBM version

Enable power gating isolation only if hw and fw support it.
This is indicated by ME_PGIC_HRA bit in ME_CSR_HA register
and on HBM protocol version.

The information is exported to MEI layer through
new pg_is_enabled hw op.

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>


# 9d098192 19-Feb-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: revamp writing slot counting

Since txe use doorbell and not circular buffer
we have to cheat in write slot counting, txe always consume all the
slots upon write. In order for it to work we need to track
slots using mei_hbuf_empty_slots() instead of tracking it in mei layer

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6aae48ff 19-Feb-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: add mei_hbuf_acquire wrapper

A client has to acquire host buffer
before writing, we add lock like wrapper
to replace the code snippet

if (dev->hbuf_is_ready)
dev->hbuf_is_ready = false;

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4a22176a 20-Feb-2014 Stephen Rothwell <sfr@canb.auug.org.au>

mei: txe: include irqreturn.h for irqreturn_t etc

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 32e2b59f 15-Jan-2014 Tomas Winkler <tomas.winkler@intel.com>

mei: txe: add hw-txe.c

hw-txe.c adds txe hw specific functionality
It implements hw specific interrupt handler, mei_hw_ops
functions and as well txe hw helpers

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>