From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: <shaopeijie@cestc.cn>, <pmenzel@molgen.mpg.de>
Cc: <peterhuewe@gmx.de>, <jgg@ziepe.ca>,
<linux-integrity@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] tpm_tis_spi: Release chip select when flow control fails
Date: Wed, 24 May 2023 05:06:09 +0300 [thread overview]
Message-ID: <CSU52BU1D59A.1J8RKQA5FLAV3@suppilovahvero> (raw)
In-Reply-To: <20230523024536.4294-1-shaopeijie@cestc.cn>
On Tue May 23, 2023 at 5:45 AM EEST, wrote:
> From: Peijie Shao <shaopeijie@cestc.cn>
>
> The failure paths in tpm_tis_spi_transfer() do not deactivate
> chip select. Send an empty message (cs_select == 0) to overcome
> this.
>
> The patch is tested by two ways.
> One way needs to touch hardware:
> 1. force pull MISO pin down to GND, it emulates a forever
> 'WAIT' timing.
> 2. probe cs pin by an oscilloscope.
> 3. load tpm_tis_spi.ko.
> After loading, dmesg prints:
> "probe of spi0.0 failed with error -110"
> and oscilloscope shows cs pin goes high(deactivated) after
> the failure. Before the patch, cs pin keeps low.
>
> Second way is by writing a fake spi controller.
> 1. implement .transfer_one method, fill all rx buf with 0.
> 2. implement .set_cs method, print the state of cs pin.
> we can see cs goes high after the failure.
>
> Signed-off-by: Peijie Shao <shaopeijie@cestc.cn>
Looks good to me + great explanation, thank you.
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
BR, Jarkko
next prev parent reply other threads:[~2023-05-24 2:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 7:01 [PATCH v2] tpm_tis_spi: fix:release chip select when flow control fails shaopeijie
2023-05-22 8:17 ` Paul Menzel
2023-05-24 2:52 ` Jarkko Sakkinen
2023-05-23 2:45 ` shaopeijie
2023-05-23 2:45 ` [PATCH v3] tpm_tis_spi: Release " shaopeijie
2023-05-24 2:06 ` Jarkko Sakkinen [this message]
2023-05-24 3:14 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CSU52BU1D59A.1J8RKQA5FLAV3@suppilovahvero \
--to=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=pmenzel@molgen.mpg.de \
--cc=shaopeijie@cestc.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox