linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: "Rémi Cardona" <remi.cardona@smartjog.com>
Cc: linux-media@vger.kernel.org, liplianin@me.by
Subject: Re: [PATCH 2/7] [media] ds3000: remove useless 'locking'
Date: Wed, 03 Oct 2012 03:37:02 +0300	[thread overview]
Message-ID: <506B88AE.7050806@iki.fi> (raw)
In-Reply-To: <1348837172-11784-3-git-send-email-remi.cardona@smartjog.com>

On 09/28/2012 03:59 PM, Rémi Cardona wrote:
> Since b9bf2eafaad9c1ef02fb3db38c74568be601a43a, the function
> ds3000_firmware_ondemand() is called only once during init. This
> locking scheme may have been useful when the firmware was loaded at
> each tune.
>
> Furthermore, it looks like this 'lock' was put in to prevent concurrent
> access (and not recursion as the comments suggest). However, this open-
> coded mechanism is anything but race-free and should have used a proper
> mutex.
>
> Signed-off-by: Rémi Cardona <remi.cardona@smartjog.com>

Reviewed-by: Antti Palosaari <crope@iki.fi>

> ---
>   drivers/media/dvb-frontends/ds3000.c |    9 ---------
>   1 file changed, 9 deletions(-)
>
> diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c
> index 46874c7..474f26e 100644
> --- a/drivers/media/dvb-frontends/ds3000.c
> +++ b/drivers/media/dvb-frontends/ds3000.c
> @@ -233,7 +233,6 @@ struct ds3000_state {
>   	struct i2c_adapter *i2c;
>   	const struct ds3000_config *config;
>   	struct dvb_frontend frontend;
> -	u8 skip_fw_load;
>   	/* previous uncorrected block counter for DVB-S2 */
>   	u16 prevUCBS2;
>   };
> @@ -395,8 +394,6 @@ static int ds3000_firmware_ondemand(struct dvb_frontend *fe)
>   	if (ds3000_readreg(state, 0xb2) <= 0)
>   		return ret;
>
> -	if (state->skip_fw_load)
> -		return 0;
>   	/* Load firmware */
>   	/* request the firmware, this will block until someone uploads it */
>   	printk(KERN_INFO "%s: Waiting for firmware upload (%s)...\n", __func__,
> @@ -410,9 +407,6 @@ static int ds3000_firmware_ondemand(struct dvb_frontend *fe)
>   		return ret;
>   	}
>
> -	/* Make sure we don't recurse back through here during loading */
> -	state->skip_fw_load = 1;
> -
>   	ret = ds3000_load_firmware(fe, fw);
>   	if (ret)
>   		printk("%s: Writing firmware to device failed\n", __func__);
> @@ -422,9 +416,6 @@ static int ds3000_firmware_ondemand(struct dvb_frontend *fe)
>   	dprintk("%s: Firmware upload %s\n", __func__,
>   			ret == 0 ? "complete" : "failed");
>
> -	/* Ensure firmware is always loaded if required */
> -	state->skip_fw_load = 0;
> -
>   	return ret;
>   }
>
>


-- 
http://palosaari.fi/

  parent reply	other threads:[~2012-10-03  0:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1348837172-11784-1-git-send-email-remi.cardona@smartjog.com>
2012-10-01 10:15 ` [PATCH v3 0/7] ds3000/dw2102 improvements Rémi Cardona
2012-10-03  0:34   ` Antti Palosaari
     [not found] ` <1348837172-11784-2-git-send-email-remi.cardona@smartjog.com>
2012-10-03  0:36   ` [PATCH 1/7] [media] ds3000: Declare MODULE_FIRMWARE usage Antti Palosaari
     [not found] ` <1348837172-11784-3-git-send-email-remi.cardona@smartjog.com>
2012-10-03  0:37   ` Antti Palosaari [this message]
     [not found] ` <1348837172-11784-4-git-send-email-remi.cardona@smartjog.com>
2012-10-03  0:37   ` [PATCH 3/7] [media] ds3000: properly report register read errors Antti Palosaari
     [not found] ` <1348837172-11784-5-git-send-email-remi.cardona@smartjog.com>
2012-10-03  0:37   ` [PATCH 4/7] [media] ds3000: bail out early on i2c failures during firmware load Antti Palosaari
     [not found] ` <1348837172-11784-6-git-send-email-remi.cardona@smartjog.com>
2012-10-03  0:37   ` [PATCH 5/7] [media] ds3000: properly report firmware probing issues Antti Palosaari
     [not found] ` <1348837172-11784-7-git-send-email-remi.cardona@smartjog.com>
2012-10-03  0:38   ` [PATCH 6/7] [media] ds3000: add module parameter to force firmware upload Antti Palosaari
2012-10-07 12:34     ` Mauro Carvalho Chehab
     [not found] ` <1348837172-11784-8-git-send-email-remi.cardona@smartjog.com>
2012-10-03  0:41   ` [PATCH 7/7] [media] dw2102: Declare MODULE_FIRMWARE usage Antti Palosaari

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=506B88AE.7050806@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=liplianin@me.by \
    --cc=remi.cardona@smartjog.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;
as well as URLs for NNTP newsgroup(s).