Re: [PATCH v1 3/3] spi: geni-qcom: Add target abort support
From: Konrad Dybcio
Date: Thu Jan 29 2026 - 06:43:01 EST
On 1/28/26 5:28 PM, Praveen Talari wrote:
> Hi Konrad
>
> On 1/27/2026 6:51 PM, Konrad Dybcio wrote:
>> On 1/22/26 4:10 PM, Praveen Talari wrote:
>>> SPI target mode currently lacks a mechanism to gracefully abort ongoing
>>> transfers when the client or core needs to cancel active transactions.
>>>
>>> Implement spi_geni_target_abort() to handle aborting SPI target
>>> operations when the client and core want to cancel ongoing transfers.
>>> This provides a mechanism for graceful termination of active SPI
>>> transactions in target mode.
>>>
>>> Signed-off-by: Praveen Talari <praveen.talari@xxxxxxxxxxxxxxxx>
>>> ---
>>> drivers/spi/spi-geni-qcom.c | 14 ++++++++++++++
>>> 1 file changed, 14 insertions(+)
>>>
>>> diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
>>> index e5320e2fb834..231fd31de048 100644
>>> --- a/drivers/spi/spi-geni-qcom.c
>>> +++ b/drivers/spi/spi-geni-qcom.c
>>> @@ -1009,6 +1009,17 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
>>> return IRQ_HANDLED;
>>> }
>>> +static int spi_geni_target_abort(struct spi_controller *spi)
>>> +{
>>> + if (!spi->cur_msg)
>>> + return 0;
>>> +
>>> + handle_se_timeout(spi, spi->cur_msg);
>>
>> I can't help but notice this function never even dereferences this
>> argument
>
> Yes, you’re correct. Since the argument is never dereferenced, it is safe to pass either cur_msg or NULL here.
Would you like to send a patch removing the unused argument?
Konrad