[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159242860191.62212.18088243128415903480@swboyd.mtv.corp.google.com>
Date: Wed, 17 Jun 2020 14:16:41 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Douglas Anderson <dianders@...omium.org>,
Mark Brown <broonie@...nel.org>
Cc: Alok Chauhan <alokc@...eaurora.org>, skakit@...eaurora.org,
Douglas Anderson <dianders@...omium.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-spi@...r.kernel.org
Subject: Re: [PATCH v3 5/5] spi: spi-geni-qcom: Don't keep a local state variable
Quoting Douglas Anderson (2020-06-16 03:40:50)
> diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
> index 63a62548b078..6feea88d63ac 100644
> --- a/drivers/spi/spi-geni-qcom.c
> +++ b/drivers/spi/spi-geni-qcom.c
> @@ -63,13 +63,6 @@
> #define TIMESTAMP_AFTER BIT(3)
> #define POST_CMD_DELAY BIT(4)
>
> -enum spi_m_cmd_opcode {
> - CMD_NONE,
> - CMD_XFER,
> - CMD_CS,
> - CMD_CANCEL,
> -};
> -
> struct spi_geni_master {
> struct geni_se se;
> struct device *dev;
> @@ -81,10 +74,11 @@ struct spi_geni_master {
> unsigned int tx_rem_bytes;
> unsigned int rx_rem_bytes;
> const struct spi_transfer *cur_xfer;
> - struct completion xfer_done;
> + struct completion cs_done;
> + struct completion cancel_done;
> + struct completion abort_done;
I wonder if it would be better to use the wait_bit() APIs. That would
let us have one word for various bits like CS_DONE, CANCEL_DONE,
ABORT_DONE and then wake up the waiters when the particular bit happens
to come in through the isr. It is probably over-engineering though
because it saves a handful of bytes while increasing complexity.
Otherwise I like this patch.
> unsigned int oversampling;
> spinlock_t lock;
> - enum spi_m_cmd_opcode cur_mcmd;
> int irq;
> };
>
Powered by blists - more mailing lists