All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Marek Vasut <marek.vasut@gmail.com>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH 14/14] gpio: pca953x: Restore registers after suspend/resume cycle
Date: Tue, 18 Dec 2018 13:57:54 +0100	[thread overview]
Message-ID: <CAMuHMdVRW49R015G+t5zw57z-JMcfbJ+6mAthkDD9P4-edRxtA@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdUc4v5C-KCkuAQ_nsbcjWjYDyUggPDgi1tivMbcRcCNDQ@mail.gmail.com>

Hi Marek,

On Mon, Dec 3, 2018 at 6:55 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Sun, Dec 2, 2018 at 8:36 PM Marek Vasut <marek.vasut@gmail.com> wrote:
> > It is possible that the PCA953x is powered down during suspend.
> > Use regmap cache to assure the registers in the PCA953x are in
> > line with the driver state after resume.
> >
> > Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
>
> Thanks for your series!
>
> Background info: the main motivation for this series is to make sure SATA
> keeps working after system suspend/resume on the Salvator-XS development
> board, where the SATA functionality is configured using a gpio hog.
>
> With your series applied, the SATA link seems to be functional after resume.
> Dmesg difference:
>
>      ata1: link resume succeeded after 1 retries
>     -ata1: SATA link down (SStatus 0 SControl 300)
>     -ata1: link resume succeeded after 1 retries
>     -ata1: SATA link down (SStatus 0 SControl 300)
>     -ata1: link resume succeeded after 1 retries
>     -ata1: SATA link down (SStatus 0 SControl 300)
>     -ata1.00: disabled
>     -sd 0:0:0:0: rejecting I/O to offline device
>     +ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
>     +ata1.00: configured for UDMA/133
>
> However, when trying to read from an attached hard drive, it fails:
>
>     ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
>     ata1.00: failed command: READ DMA
>     ata1.00: cmd c8/00:20:00:00:00/00:00:00:00:00/e0 tag 0 dma 16384 in
>              res 40/00:00:01:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
>     ata1.00: status: { DRDY }
>     ata1: hard resetting link
>     ata1: link resume succeeded after 1 retries
>     ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
>     ata1.00: configured for UDMA/133
>     sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00
> driverbyte=0x08
>     sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
>     sd 0:0:0:0: [sda] tag#0 ASC=0x21 ASCQ=0x4
>     sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 00 00 00 00 00 00 20 00
>     print_req_error: I/O error, dev sda, sector 0
>     ata1: EH complete
>     ...
>     Buffer I/O error on dev sda, logical block 0, async page read
>
> Does SATA work for you after resume!
> This could still be an issue in the sata_rcar driver.

FTR, it wasn't. With V3 as present in gpio/for-next, SATA works fine after
resume.
Major difference seems to be the use of regmap_bulk_read() vs. regmap_read().

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2018-12-18 12:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-02 19:35 [PATCH 01/14] gpio: pca953x: Deduplicate the bank_size Marek Vasut
2018-12-02 19:35 ` [PATCH 02/14] gpio: pca953x: Fix AI overflow on PCAL6524 Marek Vasut
2018-12-03  9:37   ` Bartosz Golaszewski
2018-12-02 19:35 ` [PATCH 03/14] gpio: pca953x: Repair multi-byte IO address increment on PCA9575 Marek Vasut
2018-12-03 10:09   ` Geert Uytterhoeven
2018-12-02 19:35 ` [PATCH 04/14] gpio: pca953x: Unify pca95{3,7}x_write_regs_16() Marek Vasut
2018-12-02 19:35 ` [PATCH 05/14] gpio: pca953x: Unify pca953x_{read,write}_regs_{16,24}() Marek Vasut
2018-12-02 19:35 ` [PATCH 06/14] gpio: pca953x: Unify pca953x_{read,write}_regs_{8,mul}() Marek Vasut
2018-12-02 19:35 ` [PATCH 07/14] gpio: pca953x: Factor out common code from device_pca95xx_init() Marek Vasut
2018-12-02 19:35 ` [PATCH 08/14] gpio: pca953x: Zap ad-hoc I2C block write in multi GPIO set Marek Vasut
2018-12-02 19:35 ` [PATCH 09/14] gpio: pca953x: Extract the register address mangling to single function Marek Vasut
2018-12-02 19:35 ` [PATCH 10/14] gpio: pca953x: Perform basic regmap conversion Marek Vasut
2018-12-02 19:35 ` [PATCH 11/14] gpio: pca953x: Zap ad-hoc reg_direction cache Marek Vasut
2018-12-02 19:35 ` [PATCH 12/14] gpio: pca953x: Zap ad-hoc reg_output cache Marek Vasut
2018-12-02 19:35 ` [PATCH 13/14] gpio: pca953x: Zap single use of pca953x_read_single() Marek Vasut
2018-12-02 19:35 ` [PATCH 14/14] gpio: pca953x: Restore registers after suspend/resume cycle Marek Vasut
2018-12-03 17:55   ` Geert Uytterhoeven
2018-12-03 21:42     ` Marek Vasut
2018-12-18 12:57     ` Geert Uytterhoeven [this message]
2018-12-18 13:43       ` Geert Uytterhoeven
2018-12-05 14:39   ` Geert Uytterhoeven
2018-12-05 14:45     ` Marek Vasut
2018-12-03  9:36 ` [PATCH 01/14] gpio: pca953x: Deduplicate the bank_size Bartosz Golaszewski
2018-12-03 11:00   ` Marek Vasut

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=CAMuHMdVRW49R015G+t5zw57z-JMcfbJ+6mAthkDD9P4-edRxtA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=marek.vasut@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 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.