From: Christian Loehle <christian.loehle@arm.com>
To: Avri Altman <Avri.Altman@wdc.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
Ricky WU <ricky_wu@realtek.com>,
Shawn Lin <shawn.lin@rock-chips.com>
Subject: Re: [PATCH v6 3/9] mmc: core: Add open-ended Ext memory addressing
Date: Thu, 5 Sep 2024 09:27:08 +0100 [thread overview]
Message-ID: <79dd252f-3e44-4459-bf64-4608eda377ea@arm.com> (raw)
In-Reply-To: <DM6PR04MB65750F714B37FC40466063C5FC9D2@DM6PR04MB6575.namprd04.prod.outlook.com>
On 9/5/24 07:12, Avri Altman wrote:
> Thanks for having a look.
>
>>>
>>> + if (mrq->cmd && mrq->cmd->has_ext_addr)
>>> + mmc_send_ext_addr(host, mrq->cmd->ext_addr);
>>
>> We should check that this was actually successful, right?
> Actually no, as errors in CMD22 are being carried in the subsequent command.
I see, sorry for the noise.
>
>>
>>> +
>>> init_completion(&mrq->cmd_completion);
>>>
>>> mmc_retune_hold(host);
>>> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index
>>> f0ac2e469b32..41c21c216584 100644
>>> --- a/include/linux/mmc/core.h
>>> +++ b/include/linux/mmc/core.h
>>> @@ -76,6 +76,11 @@ struct mmc_command {
>>> */
>>> #define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_MASK)
>>>
>>> + /* for SDUC */
>>> + u8 has_ext_addr;
>>> + u8 ext_addr;
>>> + u16 reserved;
>>
>> Is there a reason for has_ext_addr being u8?
> Theoretically a single bit suffices, and since ext_addr uses only 6 bits, I had that bit to spare in ext_addr,
> but I see no reason to be cheap here - see the reserved u16.
>
>> What's the reserved for?
> Not to break the packed 4bytes alignment of mmc_command.
FWIW, that's what it looks like so I was a bit surprised:
pahole -C mmc_command vmlinux
struct mmc_command {
u32 opcode; /* 0 4 */
u32 arg; /* 4 4 */
u32 resp[4]; /* 8 16 */
unsigned int flags; /* 24 4 */
bool has_ext_addr; /* 28 1 */
u8 ext_addr; /* 29 1 */
u16 reserved; /* 30 2 */
unsigned int retries; /* 32 4 */
int error; /* 36 4 */
unsigned int busy_timeout; /* 40 4 */
/* XXX 4 bytes hole, try to pack */
struct mmc_data * data; /* 48 8 */
struct mmc_request * mrq; /* 56 8 */
/* size: 64, cachelines: 1, members: 12 */
/* sum members: 60, holes: 1, sum holes: 4 */
};
has_ext_addr also should be equivalent to:
mmc_card_ult_capacity(card) && opcode in [17,18,24,25,32,33]
but the flag is also fine.
I'm a bit hesitant to put my R-b but it all looks plausible
to me FWIW.
next prev parent reply other threads:[~2024-09-05 8:27 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 14:52 [PATCH v6 0/9] Add SDUC Support Avri Altman
2024-09-04 14:52 ` [PATCH v6 1/9] mmc: sd: SDUC Support Recognition Avri Altman
2024-09-06 6:39 ` Adrian Hunter
2024-09-06 8:10 ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 2/9] mmc: sd: Add Extension memory addressing Avri Altman
2024-09-04 14:52 ` [PATCH v6 3/9] mmc: core: Add open-ended Ext " Avri Altman
2024-09-04 22:13 ` Christian Loehle
2024-09-05 6:12 ` Avri Altman
2024-09-05 7:25 ` Adrian Hunter
2024-09-05 8:27 ` Christian Loehle [this message]
2024-09-05 9:47 ` Avri Altman
2024-09-06 8:02 ` Adrian Hunter
2024-09-06 8:20 ` Avri Altman
2024-09-06 8:33 ` Adrian Hunter
2024-09-06 10:11 ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 4/9] mmc: core: Don't use close-ended rw for SDUC Avri Altman
2024-09-04 14:52 ` [PATCH v6 5/9] mmc: core: Allow mmc erase to carry large addresses Avri Altman
2024-09-04 14:52 ` [PATCH v6 6/9] mmc: core: Add Ext memory addressing for erase Avri Altman
2024-09-06 10:06 ` Adrian Hunter
2024-09-06 10:14 ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 7/9] mmc: core: Adjust ACMD22 to SDUC Avri Altman
2024-09-06 10:57 ` Adrian Hunter
2024-09-06 11:07 ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 8/9] mmc: core: Disable SDUC for mmc_test Avri Altman
2024-09-06 10:10 ` Adrian Hunter
2024-09-06 10:15 ` Avri Altman
2024-09-04 14:52 ` [PATCH v6 9/9] mmc: core: Enable SDUC Avri Altman
2024-09-06 11:10 ` [PATCH v6 0/9] Add SDUC Support Adrian Hunter
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=79dd252f-3e44-4459-bf64-4608eda377ea@arm.com \
--to=christian.loehle@arm.com \
--cc=Avri.Altman@wdc.com \
--cc=adrian.hunter@intel.com \
--cc=linux-mmc@vger.kernel.org \
--cc=ricky_wu@realtek.com \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@linaro.org \
/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