All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Kamal Dasu <kdasu.kdev@gmail.com>
Cc: linux-mtd@lists.infradead.org, f.fainelli@gmail.com,
	richard@nod.at, marek.vasut@gmail.com,
	bcm-kernel-feedback-list@broadcom.com, cyrille.pitchen@atmel.com,
	computersforpeace@gmail.com, dwmw2@infradead.org
Subject: Re: [PATCH V3, 1/2] mtd: nand: brcmnand: Change brcmnand_set_wp() prototype
Date: Mon, 27 Feb 2017 17:09:11 +0100	[thread overview]
Message-ID: <20170227170911.5b0fa0a7@bbrezillon> (raw)
In-Reply-To: <1487647832-10544-1-git-send-email-kdasu.kdev@gmail.com>

Hi Kamal,

This time I'm not even in the recipients list :-(. Can you please make
sure you Cc all the relevant maintainers when sending a patch (this is
not the first time it happens).

Thanks,

Boris

On Mon, 20 Feb 2017 22:30:31 -0500
Kamal Dasu <kdasu.kdev@gmail.com> wrote:

> Changing brcmnand_set_wp() prototype in prepration for refactoring the nand
> write protect logic to add flash status byte check for the protection bit.
> 
> Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> ---
>  drivers/mtd/nand/brcmnand/brcmnand.c | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c b/drivers/mtd/nand/brcmnand/brcmnand.c
> index 42ebd73..c7c4efe 100644
> --- a/drivers/mtd/nand/brcmnand/brcmnand.c
> +++ b/drivers/mtd/nand/brcmnand/brcmnand.c
> @@ -765,11 +765,14 @@ enum {
>  	CS_SELECT_AUTO_DEVICE_ID_CFG		= BIT(30),
>  };
>  
> -static inline void brcmnand_set_wp(struct brcmnand_controller *ctrl, bool en)
> +static int brcmnand_set_wp(struct brcmnand_host *host, int en)
>  {
> +	struct brcmnand_controller *ctrl = host->ctrl;
>  	u32 val = en ? CS_SELECT_NAND_WP : 0;
>  
>  	brcmnand_rmw_reg(ctrl, BRCMNAND_CS_SELECT, CS_SELECT_NAND_WP, 0, val);
> +
> +	return 0;
>  }
>  
>  /***********************************************************************
> @@ -1029,7 +1032,7 @@ static void brcmnand_wp(struct mtd_info *mtd, int wp)
>  			dev_dbg(ctrl->dev, "WP %s\n", wp ? "on" : "off");
>  			old_wp = wp;
>  		}
> -		brcmnand_set_wp(ctrl, wp);
> +		brcmnand_set_wp(host, wp);
>  	}
>  }
>  
> @@ -2462,14 +2465,6 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
>  	/* Disable XOR addressing */
>  	brcmnand_rmw_reg(ctrl, BRCMNAND_CS_XOR, 0xff, 0, 0);
>  
> -	if (ctrl->features & BRCMNAND_HAS_WP) {
> -		/* Permanently disable write protection */
> -		if (wp_on == 2)
> -			brcmnand_set_wp(ctrl, false);
> -	} else {
> -		wp_on = 0;
> -	}
> -
>  	/* IRQ */
>  	ctrl->irq = platform_get_irq(pdev, 0);
>  	if ((int)ctrl->irq < 0) {
> @@ -2522,6 +2517,18 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
>  			}
>  
>  			list_add_tail(&host->node, &ctrl->host_list);
> +
> +			if (ctrl->features & BRCMNAND_HAS_WP) {
> +				/* Permanently disable write protection */
> +				if (wp_on == 2) {
> +					ret = brcmnand_set_wp(host, false);
> +					if (ret)
> +						goto err;
> +				}
> +			} else {
> +				wp_on = 0;
> +			}
> +
>  		}
>  	}
>  

  parent reply	other threads:[~2017-02-27 16:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21  3:30 [PATCH V3, 1/2] mtd: nand: brcmnand: Change brcmnand_set_wp() prototype Kamal Dasu
2017-02-21  3:30 ` [PATCH V3, 2/2] mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program Kamal Dasu
2017-02-27 17:15   ` Boris Brezillon
2017-02-27 22:37     ` Kamal Dasu
2017-02-27 16:09 ` Boris Brezillon [this message]
2017-02-27 16:41   ` [PATCH V3, 1/2] mtd: nand: brcmnand: Change brcmnand_set_wp() prototype Kamal Dasu

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=20170227170911.5b0fa0a7@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=dwmw2@infradead.org \
    --cc=f.fainelli@gmail.com \
    --cc=kdasu.kdev@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    /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.