All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Milton Miller II <miltonm@us.ibm.com>
Cc: openbmc@lists.ozlabs.org, Andrew Jeffery <andrew@aj.id.au>
Subject: Re: [PATCH dev-5.0 2/4] mtd: spi-nor: aspeed: clarify 4BYTE address mode mask
Date: Fri, 19 Apr 2019 08:09:27 +0200	[thread overview]
Message-ID: <92f87d93-f120-98c0-aa02-44f17c9f7a5b@kaod.org> (raw)
In-Reply-To: <OF6182D899.1A05425F-ON002583E0.0076364D-002583E0.007B584C@notes.na.collabserv.com>

On 4/19/19 12:27 AM, Milton Miller II wrote:
> About 04/17/2019 09:18AM in some timezone, Cédric Le Goater wrote:
> 
>>Subject: [PATCH dev-5.0 2/4] mtd: spi-nor: aspeed: clarify 4BYTE
>>address mode mask
>>
> 
> Missing  change log here.

This is a oneliner patch.

> 
>>Signed-off-by: Cédric Le Goater <clg@kaod.org <mailto:clg@kaod.org>>
>>---
>> drivers/mtd/spi-nor/aspeed-smc.c | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>>diff --git a/drivers/mtd/spi-nor/aspeed-smc.c
>>b/drivers/mtd/spi-nor/aspeed-smc.c
>>index ee3059b27c07..1437732fdea1 100644
>>--- a/drivers/mtd/spi-nor/aspeed-smc.c
>>+++ b/drivers/mtd/spi-nor/aspeed-smc.c
>>@@ -884,7 +884,15 @@ static const uint32_t aspeed_smc_hclk_divs[] = {
>>
>> static u32 aspeed_smc_default_read(struct aspeed_smc_chip *chip)
>> {
>>- return (chip->ctl_val[smc_read] & 0x2000) |
>>+ /*
>>+ * Keep the 4Byte address mode on the AST2400 SPI controller.
>>+ * Other controllers set the 4Byte mode in the CE Control
>>+ * Register
>>+ */
>>+ u32 ctl_mask = chip->controller->info == &spi_2400_info ?
>>+ CONTROL_IO_ADDRESS_4B : 0;
>>+
> 
> I dislike this patch because it violates the data driven model of the types.
> 
> Either a dupicate method should be created or at least a member of the
> type structure should be used instead of a compare to a specific instance.

we could add a ops returning the bitmask. yes. I think this is a efficient
considering the patch is not in mainline and was not reviewed by the Linux
maintainers.

C.


> 
>>+ return (chip->ctl_val[smc_read] & ctl_mask) |
>> (0x00 << 28) | /* Single bit */
>> (0x00 << 24) | /* CE# max */
>> (0x03 << 16) | /* use normal reads */
>>--
>>2.20.1
>>
>>

  reply	other threads:[~2019-04-19  7:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 13:39 [PATCH dev-5.0 0/4] spi-nor: aspeed: add support for the 4B opcodes Cédric Le Goater
2019-04-17 13:39 ` [PATCH dev-5.0 1/4] mtd: spi-nor: aspeed: introduce a aspeed_smc_default_read() helper Cédric Le Goater
2019-04-17 18:09   ` Alexander Amelkin
2019-04-18  6:07     ` Andrew Jeffery
2019-04-18  6:23       ` Cédric Le Goater
2019-04-17 13:39 ` [PATCH dev-5.0 2/4] mtd: spi-nor: aspeed: clarify 4BYTE address mode mask Cédric Le Goater
2019-04-18  6:09   ` Andrew Jeffery
2019-04-17 13:39 ` [PATCH dev-5.0 3/4] mtd: spi-nor: aspeed: use memcpy_fromio() to capture the optimization buffer Cédric Le Goater
2019-04-18  6:10   ` Andrew Jeffery
2019-04-17 13:39 ` [PATCH dev-5.0 4/4] mtd: spi-nor: aspeed: add support for the 4B opcodes Cédric Le Goater
2019-04-18  6:10   ` Andrew Jeffery
2019-04-18 21:23 ` [PATCH dev-5.0 3/4] mtd: spi-nor: aspeed: use memcpy_fromio() to capture the optimization buffer Milton Miller II
2019-04-19  1:03   ` Andrew Jeffery
2019-04-19  6:02     ` Cédric Le Goater
2019-04-19  7:23       ` Andrew Jeffery
2019-04-19  8:09         ` Cédric Le Goater
2019-04-19  8:22           ` Andrew Jeffery
2019-05-02  3:53           ` Andrew Jeffery
2019-05-03 22:19           ` Milton Miller II
2019-04-18 22:27 ` [PATCH dev-5.0 2/4] mtd: spi-nor: aspeed: clarify 4BYTE address mode mask Milton Miller II
2019-04-19  6:09   ` Cédric Le Goater [this message]
2019-04-19  6:41     ` Andrew Jeffery
2019-04-18 22:41 ` [PATCH dev-5.0 0/4] spi-nor: aspeed: add support for the 4B opcodes Milton Miller II
2019-04-19  7:08   ` Cédric Le Goater

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=92f87d93-f120-98c0-aa02-44f17c9f7a5b@kaod.org \
    --to=clg@kaod.org \
    --cc=andrew@aj.id.au \
    --cc=miltonm@us.ibm.com \
    --cc=openbmc@lists.ozlabs.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 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.