History log of /linux-master/drivers/ata/sata_gemini.c
Revision Date Author Comments
# e85006ae 02-Apr-2024 Chen Ni <nichen@iscas.ac.cn>

ata: sata_gemini: Check clk_enable() result

The call to clk_enable() in gemini_sata_start_bridge() can fail.
Add a check to detect such failure.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>


# 8566572b 23-Aug-2023 Damien Le Moal <dlemoal@kernel.org>

ata: sata_gemini: Add missing MODULE_DESCRIPTION

Add the missing MODULE_DESCRIPTION() to avoid warnings such as:

WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/ata/sata_gemini.o

when compiling with W=1.

Fixes: be4e456ed3a5 ("ata: Add driver for Faraday Technology FTIDE010")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>


# 114dda82 31-Jul-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ata: sata_gemini: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>


# 61e6ae71 14-Jul-2023 Rob Herring <robh@kernel.org>

ata: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>


# 6c4c900b 13-Oct-2022 Damien Le Moal <damien.lemoal@opensource.wdc.com>

ata: sata_gemini: Remove dependency on OF for compile tests

If CONFIG_OF is disabled, then using the macro of_match_ptr() results
in the gemini_sata_of_match variable being unused, which generates a
compilation warning and a compilation error if CONFIG_WERROR is enabled.

Removing the use of this macro by directly assigning the
gemini_sata_of_match match table to the .of_match_table field in the
platform driver definition allows removing the dependency on OF for
compile tests, thus improving compile test coverage.

Fixes: f7220eac752f ("ata: Kconfig: fix sata gemini compile test condition")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>


# 0cb63670 21-Apr-2022 Lv Ruyi <lv.ruyi@zte.com.cn>

ata: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap_resource() separately.Make the
code simpler without functional changes.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>


# 5e776d7b 03-Mar-2022 Geert Uytterhoeven <geert+renesas@glider.be>

ata: Drop commas after OF match table sentinels

It does not make sense to have a comma after a sentinel, as any new
elements must be added before the sentinel.

Add comments to clarify the purpose of the empty elements.
Rewrap entries to a single line to have a consistent style.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Florian Fainelli <f.fainelli@gmail.com> [ahci_brcm]
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>


# 97b7925a 21-Dec-2021 Hannes Reinecke <hare@suse.de>

ata: sata_gemini: convert pr_err() calls

Convert pr_err() calls to dev_err()

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>


# 09c434b8 19-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Add SPDX license identifier for more missed files

Add SPDX license identifiers to all files which:

- Have no license information of any form

- Have MODULE_LICENCE("GPL*") inside which was used in the initial
scan/conversion to ignore the file

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

GPL-2.0-only

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d872ced2 08-Aug-2017 Linus Walleij <linus.walleij@linaro.org>

ata: sata_gemini: Introduce explicit IDE pin control

The IDE pins are managed by the pin controller, if we want to
use these, we need to ask the pin controller to explicitly enable
them as by default, these pins are used for other business and
most users just rely on the SATA bridge.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>


# d99058a2 08-Aug-2017 Linus Walleij <linus.walleij@linaro.org>

ata: sata_gemini: Retire custom pin control

I added a proper pin control driver for the Gemini SoC, so retire
this custom code and rely on the pin controller to set up the pads.

The "IOMUX" which is routing signals between the ATA and SATA
bridge inside of the chip is not about pin control and remains in
place.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>


# afbd39a4 19-Jul-2017 Philipp Zabel <p.zabel@pengutronix.de>

ata: sata_gemini: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: linux-ide@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>


# cea9c8d3 15-Jul-2017 Julia Lawall <Julia.Lawall@lip6.fr>

ata: Drop unnecessary static

Drop static on a local variable, when the variable is initialized before
any possible use. Thus, the static has no benefit.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@bad exists@
position p;
identifier x;
type T;
@@
static T x@p;
...
x = <+...x...+>

@@
identifier x;
expression e;
type T;
position p != bad.p;
@@
-static
T x@p;
... when != x
when strict
?x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>


# be4e456e 04-Jun-2017 Linus Walleij <linus.walleij@linaro.org>

ata: Add driver for Faraday Technology FTIDE010

This adds a driver for the Faraday Technology FTIDE010
PATA IP block.

When used with the Storlink/Storm/Cortina Systems Gemini
SoC, the PATA interface is accompanied by a PATA<->SATA
bridge, so while the device appear as a PATA controller,
it attaches physically to SATA disks, and also has a
designated memory area with registers to set up the bridge.

The Gemini SATA bridge is separated into its own driver
file to make things modular and make it possible to reuse
the PATA driver as stand-alone on other systems than the
Gemini.

dmesg excerpt from the D-Link DIR-685 storage router:
gemini-sata-bridge 46000000.sata: SATA ID 00000e00, PHY ID: 01000100
gemini-sata-bridge 46000000.sata: set up the Gemini IDE/SATA nexus
ftide010 63000000.ata: set up Gemini PATA0
ftide010 63000000.ata: device ID 00000500, irq 26, io base 0x63000000
ftide010 63000000.ata: SATA0 (master) start
gemini-sata-bridge 46000000.sata: SATA0 PHY ready
scsi host0: pata-ftide010
ata1: PATA max UDMA/133 irq 26
ata1.00: ATA-8: INTEL SSDSA2CW120G3, 4PC10302, max UDMA/133
ata1.00: 234441648 sectors, multi 1: LBA48 NCQ (depth 0/32)
ata1.00: configured for UDMA/133
scsi 0:0:0:0: Direct-Access ATA INTEL SSDSA2CW12 0302 PQ: 0 ANSI: 5
ata1.00: Enabling discard_zeroes_data
sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/112 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
ata1.00: Enabling discard_zeroes_data
ata1.00: Enabling discard_zeroes_data
sd 0:0:0:0: [sda] Attached SCSI disk

After this I can flawlessly mount and read/write copy etc files
from /dev/sda[n].

Cc: John Feng-Hsin Chiang <john453@faraday-tech.com>
Cc: Greentime Hu <green.hu@gmail.com>
Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>