lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 21 Jun 2016 12:33:59 +0000 (UTC)
From:	Gerd Hoffmann <kraxel@...hat.com>
To:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 21/32] mmc: bcm2835-sdhost: Add new driver for the internal SD controller.

  Hi,

> > +	mmiowb();
> > +}
> 
> What is the barrier for? Same question for all the other instances

No idea.  Removed them all, seems to work fine still.
Guess writel() & friends have the needed barriers on arm?

> > +
> > +static void bcm2835_sdhost_reset(struct mmc_host *mmc)
> > +{
> > +	struct bcm2835_host *host = mmc_priv(mmc);
> > +	unsigned long flags;
> > +
> > +	spin_lock_irqsave(&host->lock, flags);
> > +	bcm2835_sdhost_reset_internal(host);
> > +	spin_unlock_irqrestore(&host->lock, flags);
> > +}
> 
> The spinlock seems to only protect the reset from happening concurrently
> with bcm2835_sdhost_dma_complete() here. So if you ensure that this
> function is no longer pending, you can probably use msleep() above.

There is also a tasklet.  And IRQs.  But bcm2835_sdhost_reset_internal
clears hcfg (temporately), so IRQs shouldn't be a problem I think.  So how
about this?

@@ -334,9 +334,10 @@ static void bcm2835_sdhost_reset(struct mmc_host *mmc)
        struct bcm2835_host *host = mmc_priv(mmc);
        unsigned long flags;
 
-       spin_lock_irqsave(&host->lock, flags);
+       if (host->dma_chan)
+               dmaengine_terminate_sync(host->dma_chan);
+       tasklet_kill(&host->finish_tasklet);
        bcm2835_sdhost_reset_internal(host);
-       spin_unlock_irqrestore(&host->lock, flags);
 }
 

> > +	if (IS_ERR_OR_NULL(host->dma_chan_tx) ||
> > +	    IS_ERR_OR_NULL(host->dma_chan_rx)) {
> > +		pr_err("%s: unable to initialise DMA channels. Falling back to PIO\n",
> > +		       mmc_hostname(mmc));
> 
> When are these ever NULL?

When there are no dma channels configured in the device tree.

cheers,
  Gerd


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ