linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rpi-kernel
	<linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	notro-L59+Z2yzLopAfugRpC6u6w@public.gmane.org
Subject: Re: [PATCH] SPI: bcm2835: move to the transfer_one driver model
Date: Wed, 01 Apr 2015 09:20:02 -0600	[thread overview]
Message-ID: <551C0CA2.40406@wwwdotorg.org> (raw)
In-Reply-To: <E13569A5-33E5-48ED-B25F-EC7374E144C9-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>

On 03/31/2015 08:49 AM, Martin Sperl wrote:
>
>> On 28.03.2015, at 05:09, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
>>> As for testing: I have also tried to test with mmc_spi, but I have not
>>> been able to make that driver work reliably in any recent kernel
>>> versions.
>>> Most of the time I see timeouts - and with lots of different SD-cards...
>>>
>>> IIRC the last time I tested it successfully was with 3.12.
>>
>> It'd be great if you could use "git bisect" to track down the change
>> that broke this.
...
> Bisection between these shows the responsible commit is:
...
> commit 0589342c27944e50ebd7a54f5215002b6598b748
> Author: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
> Date:   Tue Oct 29 23:36:46 2013 -0500
>
>      of: set dma_mask to point to coherent_dma_mask
>
>      Platform devices created by DT code don't initialize dma_mask pointer to
>      anything. Set it to coherent_dma_mask by default if the architecture
>      code has not set it.
>
>      Signed-off-by: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
...
> Now I went back to 4.0.rc5+ and patched it as follows:
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -179,9 +179,10 @@ static void of_dma_configure(struct device *dev)
>           * Set it to coherent_dma_mask by default if the architecture
>           * code has not set it.
>           */
> +/*
>          if (!dev->dma_mask)
>                  dev->dma_mask = &dev->coherent_dma_mask;
> -
> +*/
>          ret = of_dma_get_range(dev->of_node, &dma_addr, &paddr, &size);
>          if (ret < 0) {
>                  dma_addr = offset = 0;
>
> And now it works - the SD card gets detected immediately,
> I can mount it and everything...

Does that change cause the SDHCI core to use vs. not-use any of the 
SDHCI DMA modes? If so, I wonder if this is because the upstream kernel 
doesn't deal with the bcm2835's ARM physical address <-> SoC bus address 
conversions, which in turn can cause DMA and CPU access to not use the 
same caching settings and become incoherent, which in turn can cause DMA 
data corruption. See the following link for some background:

https://www.mail-archive.com/u-boot-0aAXYlwwYIKGBzrmiIFOJg@public.gmane.org/msg167376.html
[PATCH 2/3] ARM: bcm2835: implement phys_to_bus/bus_to_phys

(you'll want to read all of patches 1-3 for the complete background I 
think, but patch 2 describes the HW issue)
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-04-01 15:20 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  9:01 [PATCH] SPI: BCM2835: fix all checkpath --strict messages kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found] ` <1426755714-28130-1-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-19  9:01   ` [PATCH V2] SPI: BCM2835: allow arbitrary GPIO to act as SPI-chip_select kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]     ` <1426755714-28130-2-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-20  5:05       ` Stephen Warren
     [not found]         ` <550BAA89.5090707-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-20  9:52           ` Mark Brown
     [not found]             ` <20150320095247.GE2869-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-03-25  7:10               ` [PATCH V2 - RESEND] " Martin Sperl
     [not found]                 ` <1756D77D-173D-4D6D-B629-59CC8A49714F-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-25 15:16                   ` Mark Brown
     [not found]                     ` <20150325151611.GA3572-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-03-25 16:13                       ` Martin Sperl
     [not found]                         ` <681599F9-2D88-49FF-BD16-4F388D0B2874-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-25 16:54                           ` Mark Brown
     [not found]                             ` <20150325165441.GI3572-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-03-25 17:59                               ` Martin Sperl
     [not found]                                 ` <767DFCCF-C8A4-44B3-9E85-96011B0FF0FA-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-25 18:50                                   ` Mark Brown
     [not found]                                     ` <20150325185007.GL3572-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-03-25 19:43                                       ` Martin Sperl
     [not found]                                         ` <561486F6-3580-4884-8A6A-8477D8C3BDC9-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-25 21:02                                           ` Mark Brown
2015-03-26 10:08                                           ` [PATCH] SPI: bcm2835: move to the transfer_one driver model Martin Sperl
     [not found]                                             ` <30057D30-6A2D-4517-B374-76FF2448E455-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-26 17:35                                               ` Mark Brown
     [not found]                                                 ` <20150326173511.GW3572-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-03-26 17:47                                                   ` Stephen Warren
2015-03-26 19:15                                                   ` Martin Sperl
     [not found]                                                     ` <C176096E-3731-4F47-9DCF-AE83B143EB9D-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-27  1:32                                                       ` Mark Brown
2015-03-28  4:09                                               ` Stephen Warren
     [not found]                                                 ` <5516296A.2030505-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-28 18:11                                                   ` Martin Sperl
     [not found]                                                     ` <AB966507-3A94-4421-8153-AB4090E309AF-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-29  3:24                                                       ` Stephen Warren
     [not found]                                                         ` <55177076.9000208-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-29 10:19                                                           ` Martin Sperl
     [not found]                                                             ` <74807CAA-A444-413B-9C9B-C3B06D5C18E6-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-29 21:44                                                               ` Martin Sperl
2015-03-31 14:49                                                   ` Martin Sperl
     [not found]                                                     ` <E13569A5-33E5-48ED-B25F-EC7374E144C9-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-04-01 15:20                                                       ` Stephen Warren [this message]
     [not found]                                                         ` <551C0CA2.40406-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-04-03 10:17                                                           ` Martin Sperl
     [not found]                                                             ` <A1AEABE2-F0D2-481B-BD83-E1AD7861E960-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-04-06 17:26                                                               ` Mark Brown
2015-03-19  9:01   ` [PATCH] SPI: BCM2835: clock divider can be a multiple of 2 kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]     ` <1426755714-28130-3-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-20  5:06       ` Stephen Warren
     [not found]         ` <550BAAD8.20206-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-20  7:04           ` Martin Sperl
     [not found]             ` <6EBE48E2-80E7-454C-A84C-231D45DC64E0-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-20 14:25               ` Noralf Trønnes
2015-03-23 18:53       ` Mark Brown
2015-03-19  9:01   ` [PATCH] SPI: BCM2835: enable support of 3-wire mode kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]     ` <1426755714-28130-4-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-20  5:12       ` Stephen Warren
     [not found]         ` <550BAC49.3000105-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-20  6:17           ` Martin Sperl
2015-03-23 18:57       ` Mark Brown
2015-03-20  4:58   ` [PATCH] SPI: BCM2835: fix all checkpath --strict messages Stephen Warren
     [not found]     ` <550BA8FE.7030001-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-20  6:26       ` Martin Sperl
     [not found]         ` <7727F65E-D8BC-4299-A359-56FA449C3379-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-20 13:40           ` Mark Brown
     [not found]             ` <20150320134053.GN2869-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-03-20 14:26               ` [PATCH V2] " Martin Sperl
     [not found]                 ` <78137BE7-37A4-4144-BBCC-CBEDA70DD31A-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-20 18:05                   ` Mark Brown
2015-03-20 13:36   ` [PATCH] " Mark Brown

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=551C0CA2.40406@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org \
    --cc=lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=notro-L59+Z2yzLopAfugRpC6u6w@public.gmane.org \
    /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).