All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gole, Dhruva" <d-gole@ti.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>, <linux-spi@vger.kernel.org>
Subject: Re: Re: [PATCH 2/4] spi: intel: Implement adjust_op_size()
Date: Fri, 28 Oct 2022 12:16:43 +0530	[thread overview]
Message-ID: <32870277-555b-f384-c9e8-2b4225cb2943@ti.com> (raw)
In-Reply-To: <Y1t13q53WbQxDzST@black.fi.intel.com>


On 10/28/2022 11:55 AM, Mika Westerberg wrote:
> Hi,
>
> On Fri, Oct 28, 2022 at 11:42:09AM +0530, Gole, Dhruva wrote:
>> Hi Mika,
>>
>> On 10/25/2022 12:16 PM, Mika Westerberg wrote:
>>> This allows us to get rid of the checks in the intel_spi_[sh]w_cycle()
>>> and makes it possible for the SPI-NOR core to split the transaction into
>>> smaller chunks as needed.
>> If I understand correctly, the controller ops are called from spi-mem.c, and
>>
>> spi_mem_adjust_op does exist and on it's own does "split a data transfer
>>   operation into multiple ones"
>>
>> So is this really something that you require the controller to do and
>>
>> can we not rely on spi-mem.c to do it's thing instead?
> How does it know the size supported by the hardware? I think this is the
> reason spi_mem_adjust_op was introduced but I may be mistaken.'

The following piece of code might help:

         op->data.nbytes = min3((size_t)op->data.nbytes,
                        spi_max_transfer_size(mem->spi),
                        spi_max_message_size(mem->spi)

I believe this will help it know the size supported by the hardware.

and on the controller side:

in case of cadence I have seen it pickup the fifo depth from DTSI, for eg.

arch/arm64/boot/dts/ti/k3-am62-main.dtsi: cdns,fifo-depth = <256>;

>
>> I would like to point you to another controller spi-cadence-quadspi.c
>>
>> that also doesn't have it's own adjust_op_size but I haven't seen any issues
>> as such
>>
>> inspite. This is because everything first goes through spi-mem.c then onto
>> the controllers drivers.
> Well Intel SPI driver did not not have any issues previously either
> because it handled the read/write split internally but SFDP read is done
> through "register read side" which only supported max 64-byte read until
> now :-)

-- 
Regards,
Dhruva Gole <d-gole@ti.com>


  reply	other threads:[~2022-10-28  6:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25  6:46 [PATCH 0/4] spi: intel: Add support for SFDP opcode Mika Westerberg
2022-10-25  6:46 ` [PATCH 1/4] spi: intel: Use ->replacement_op in intel_spi_hw_cycle() Mika Westerberg
2022-10-25  6:46 ` [PATCH 2/4] spi: intel: Implement adjust_op_size() Mika Westerberg
2022-10-28  6:12   ` Gole, Dhruva
2022-10-28  6:25     ` Mika Westerberg
2022-10-28  6:46       ` Gole, Dhruva [this message]
2022-10-28  7:05         ` Mika Westerberg
2022-10-25  6:46 ` [PATCH 3/4] spi: intel: Take possible chip address into account in intel_spi_read/write_reg() Mika Westerberg
2022-10-25  6:46 ` [PATCH 4/4] spi: intel: Add support for SFDP opcode Mika Westerberg
2022-11-22 12:30 ` [PATCH 0/4] " Mika Westerberg
2022-11-22 14:57   ` Mark Brown
2022-11-25 21:55 ` Mark Brown

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=32870277-555b-f384-c9e8-2b4225cb2943@ti.com \
    --to=d-gole@ti.com \
    --cc=broonie@kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.