mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Michael Ellerman <mpe@ellerman.id.au>,
	Anatolij Gustschin <agust@denx.de>
Cc: Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/mpc52xx_lpbfifo: Drop unused functions
Date: Wed, 12 Apr 2023 17:05:24 +0200	[thread overview]
Message-ID: <20230412150524.ojsvukh47hing6db@pengutronix.de> (raw)
In-Reply-To: <20221228145129.31700-1-u.kleine-koenig@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 7036 bytes --]

On Wed, Dec 28, 2022 at 03:51:29PM +0100, Uwe Kleine-König wrote:
> The four exported functions mpc52xx_lpbfifo_submit(),
> mpc52xx_lpbfifo_abort(), mpc52xx_lpbfifo_poll(), and
> mpc52xx_lpbfifo_start_xfer() are not used. So they can be dropped and the
> definitions needed to call them can be moved into the driver file.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

I never got feedback about this driver and it has not appeared in next
up to now. Did it fell through the cracks?

Best regards
Uwe

> ---
>  arch/powerpc/include/asm/mpc52xx.h            |  41 ------
>  arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c | 134 +++++-------------
>  2 files changed, 33 insertions(+), 142 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/mpc52xx.h b/arch/powerpc/include/asm/mpc52xx.h
> index 5ea16a71c2f0..01ae6c351e50 100644
> --- a/arch/powerpc/include/asm/mpc52xx.h
> +++ b/arch/powerpc/include/asm/mpc52xx.h
> @@ -285,47 +285,6 @@ extern int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, u64 period,
>  extern u64 mpc52xx_gpt_timer_period(struct mpc52xx_gpt_priv *gpt);
>  extern int mpc52xx_gpt_stop_timer(struct mpc52xx_gpt_priv *gpt);
>  
> -/* mpc52xx_lpbfifo.c */
> -#define MPC52XX_LPBFIFO_FLAG_READ		(0)
> -#define MPC52XX_LPBFIFO_FLAG_WRITE		(1<<0)
> -#define MPC52XX_LPBFIFO_FLAG_NO_INCREMENT	(1<<1)
> -#define MPC52XX_LPBFIFO_FLAG_NO_DMA		(1<<2)
> -#define MPC52XX_LPBFIFO_FLAG_POLL_DMA		(1<<3)
> -
> -struct mpc52xx_lpbfifo_request {
> -	struct list_head list;
> -
> -	/* localplus bus address */
> -	unsigned int cs;
> -	size_t offset;
> -
> -	/* Memory address */
> -	void *data;
> -	phys_addr_t data_phys;
> -
> -	/* Details of transfer */
> -	size_t size;
> -	size_t pos;	/* current position of transfer */
> -	int flags;
> -	int defer_xfer_start;
> -
> -	/* What to do when finished */
> -	void (*callback)(struct mpc52xx_lpbfifo_request *);
> -
> -	void *priv;		/* Driver private data */
> -
> -	/* statistics */
> -	int irq_count;
> -	int irq_ticks;
> -	u8 last_byte;
> -	int buffer_not_done_cnt;
> -};
> -
> -extern int mpc52xx_lpbfifo_submit(struct mpc52xx_lpbfifo_request *req);
> -extern void mpc52xx_lpbfifo_abort(struct mpc52xx_lpbfifo_request *req);
> -extern void mpc52xx_lpbfifo_poll(void);
> -extern int mpc52xx_lpbfifo_start_xfer(struct mpc52xx_lpbfifo_request *req);
> -
>  /* mpc52xx_pic.c */
>  extern void mpc52xx_init_irq(void);
>  extern unsigned int mpc52xx_get_irq(void);
> diff --git a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
> index 6d1dd6e87478..32fd1345ffeb 100644
> --- a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
> +++ b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
> @@ -38,6 +38,39 @@ MODULE_LICENSE("GPL");
>  #define LPBFIFO_REG_FIFO_CONTROL	(0x48)
>  #define LPBFIFO_REG_FIFO_ALARM		(0x4C)
>  
> +#define MPC52XX_LPBFIFO_FLAG_WRITE		(1<<0)
> +#define MPC52XX_LPBFIFO_FLAG_NO_DMA		(1<<2)
> +#define MPC52XX_LPBFIFO_FLAG_POLL_DMA		(1<<3)
> +
> +struct mpc52xx_lpbfifo_request {
> +	struct list_head list;
> +
> +	/* localplus bus address */
> +	unsigned int cs;
> +	size_t offset;
> +
> +	/* Memory address */
> +	void *data;
> +	phys_addr_t data_phys;
> +
> +	/* Details of transfer */
> +	size_t size;
> +	size_t pos;	/* current position of transfer */
> +	int flags;
> +	int defer_xfer_start;
> +
> +	/* What to do when finished */
> +	void (*callback)(struct mpc52xx_lpbfifo_request *);
> +
> +	void *priv;		/* Driver private data */
> +
> +	/* statistics */
> +	int irq_count;
> +	int irq_ticks;
> +	u8 last_byte;
> +	int buffer_not_done_cnt;
> +};
> +
>  struct mpc52xx_lpbfifo {
>  	struct device *dev;
>  	phys_addr_t regs_phys;
> @@ -381,107 +414,6 @@ static irqreturn_t mpc52xx_lpbfifo_bcom_irq(int irq, void *dev_id)
>  	return IRQ_HANDLED;
>  }
>  
> -/**
> - * mpc52xx_lpbfifo_poll - Poll for DMA completion
> - */
> -void mpc52xx_lpbfifo_poll(void)
> -{
> -	struct mpc52xx_lpbfifo_request *req = lpbfifo.req;
> -	int dma = !(req->flags & MPC52XX_LPBFIFO_FLAG_NO_DMA);
> -	int write = req->flags & MPC52XX_LPBFIFO_FLAG_WRITE;
> -
> -	/*
> -	 * For more information, see comments on the "Fat Lady" 
> -	 */
> -	if (dma && write)
> -		mpc52xx_lpbfifo_irq(0, NULL);
> -	else 
> -		mpc52xx_lpbfifo_bcom_irq(0, NULL);
> -}
> -EXPORT_SYMBOL(mpc52xx_lpbfifo_poll);
> -
> -/**
> - * mpc52xx_lpbfifo_submit - Submit an LPB FIFO transfer request.
> - * @req: Pointer to request structure
> - *
> - * Return: %0 on success, -errno code on error
> - */
> -int mpc52xx_lpbfifo_submit(struct mpc52xx_lpbfifo_request *req)
> -{
> -	unsigned long flags;
> -
> -	if (!lpbfifo.regs)
> -		return -ENODEV;
> -
> -	spin_lock_irqsave(&lpbfifo.lock, flags);
> -
> -	/* If the req pointer is already set, then a transfer is in progress */
> -	if (lpbfifo.req) {
> -		spin_unlock_irqrestore(&lpbfifo.lock, flags);
> -		return -EBUSY;
> -	}
> -
> -	/* Setup the transfer */
> -	lpbfifo.req = req;
> -	req->irq_count = 0;
> -	req->irq_ticks = 0;
> -	req->buffer_not_done_cnt = 0;
> -	req->pos = 0;
> -
> -	mpc52xx_lpbfifo_kick(req);
> -	spin_unlock_irqrestore(&lpbfifo.lock, flags);
> -	return 0;
> -}
> -EXPORT_SYMBOL(mpc52xx_lpbfifo_submit);
> -
> -int mpc52xx_lpbfifo_start_xfer(struct mpc52xx_lpbfifo_request *req)
> -{
> -	unsigned long flags;
> -
> -	if (!lpbfifo.regs)
> -		return -ENODEV;
> -
> -	spin_lock_irqsave(&lpbfifo.lock, flags);
> -
> -	/*
> -	 * If the req pointer is already set and a transfer was
> -	 * started on submit, then this transfer is in progress
> -	 */
> -	if (lpbfifo.req && !lpbfifo.req->defer_xfer_start) {
> -		spin_unlock_irqrestore(&lpbfifo.lock, flags);
> -		return -EBUSY;
> -	}
> -
> -	/*
> -	 * If the req was previously submitted but not
> -	 * started, start it now
> -	 */
> -	if (lpbfifo.req && lpbfifo.req == req &&
> -	    lpbfifo.req->defer_xfer_start) {
> -		out_8(lpbfifo.regs + LPBFIFO_REG_PACKET_SIZE, 0x01);
> -	}
> -
> -	spin_unlock_irqrestore(&lpbfifo.lock, flags);
> -	return 0;
> -}
> -EXPORT_SYMBOL(mpc52xx_lpbfifo_start_xfer);
> -
> -void mpc52xx_lpbfifo_abort(struct mpc52xx_lpbfifo_request *req)
> -{
> -	unsigned long flags;
> -
> -	spin_lock_irqsave(&lpbfifo.lock, flags);
> -	if (lpbfifo.req == req) {
> -		/* Put it into reset and clear the state */
> -		bcom_gen_bd_rx_reset(lpbfifo.bcom_rx_task);
> -		bcom_gen_bd_tx_reset(lpbfifo.bcom_tx_task);
> -		out_be32(lpbfifo.regs + LPBFIFO_REG_ENABLE, 0x01010000);
> -		lpbfifo.req = NULL;
> -	}
> -	spin_unlock_irqrestore(&lpbfifo.lock, flags);
> -}
> -EXPORT_SYMBOL(mpc52xx_lpbfifo_abort);
> -
>  static int mpc52xx_lpbfifo_probe(struct platform_device *op)
>  {
>  	struct resource res;
> -- 
> 2.38.1
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2023-04-12 15:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28 14:51 Uwe Kleine-König
2022-12-29 17:28 ` Uwe Kleine-König
2023-04-12 15:05 ` Uwe Kleine-König [this message]
2023-04-13  0:11   ` Michael Ellerman
2023-04-13  6:16     ` [PATCH] powerpc: Drop MPC5200 LocalPlus bus FIFO driver Uwe Kleine-König
2023-05-09  8:21       ` Uwe Kleine-König
2023-05-12  2:42         ` Michael Ellerman

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=20230412150524.ojsvukh47hing6db@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=agust@denx.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®