* Re: [PATCH v3 00/27] kill devm_ioremap_nocache
From: Guenter Roeck @ 2017-12-23 15:57 UTC (permalink / raw)
To: Greg KH, Yisheng Xie
Cc: linux-mips, ulf.hansson, jakub.kicinski, platform-driver-x86,
airlied, linux-wireless, linus.walleij, alsa-devel, dri-devel,
linux-kernel, linux-ide, linux-mtd, daniel.vetter, dan.j.williams,
jason, linux-rtc, boris.brezillon, mchehab, dmaengine, vinod.koul,
richard, marek.vasut, industrypack-devel, linux-pci, dvhart, wg,
linux-media, seanpaul, devel, linux-watchdog, arnd, b.zolnierkie,
marc.zyngier, jslaby
In-Reply-To: <20171223134831.GB10103@kroah.com>
On 12/23/2017 05:48 AM, Greg KH wrote:
> On Sat, Dec 23, 2017 at 06:55:25PM +0800, Yisheng Xie wrote:
>> Hi all,
>>
>> When I tried to use devm_ioremap function and review related code, I found
>> devm_ioremap and devm_ioremap_nocache is almost the same with each other,
>> except one use ioremap while the other use ioremap_nocache.
>
> For all arches? Really? Look at MIPS, and x86, they have different
> functions.
>
Both mips and x86 end up mapping the same function, but other arches don't.
mn10300 is one where ioremap and ioremap_nocache are definitely different.
Guenter
>> While ioremap's
>> default function is ioremap_nocache, so devm_ioremap_nocache also have the
>> same function with devm_ioremap, which can just be killed to reduce the size
>> of devres.o(from 20304 bytes to 18992 bytes in my compile environment).
>>
>> I have posted two versions, which use macro instead of function for
>> devm_ioremap_nocache[1] or devm_ioremap[2]. And Greg suggest me to kill
>> devm_ioremap_nocache for no need to keep a macro around for the duplicate
>> thing. So here comes v3 and please help to review.
>
> I don't think this can be done, what am I missing? These functions are
> not identical, sorry for missing that before.
>
> thanks,
>
> greg k-h
>
^ permalink raw reply
* Re: [PATCH v3 00/27] kill devm_ioremap_nocache
From: Greg KH @ 2017-12-23 13:48 UTC (permalink / raw)
To: Yisheng Xie
Cc: linux-mips, ulf.hansson, jakub.kicinski, platform-driver-x86,
airlied, linux-wireless, linus.walleij, alsa-devel, dri-devel,
linux-kernel, linux-ide, linux-mtd, daniel.vetter, dan.j.williams,
jason, linux-rtc, boris.brezillon, mchehab, dmaengine, vinod.koul,
richard, marek.vasut, industrypack-devel, linux-pci, dvhart,
linux, linux-media, seanpaul, devel, linux-watchdog, arnd,
b.zolnierkie, marc.zyngier, jslaby
In-Reply-To: <1514026525-32538-1-git-send-email-xieyisheng1@huawei.com>
On Sat, Dec 23, 2017 at 06:55:25PM +0800, Yisheng Xie wrote:
> Hi all,
>
> When I tried to use devm_ioremap function and review related code, I found
> devm_ioremap and devm_ioremap_nocache is almost the same with each other,
> except one use ioremap while the other use ioremap_nocache.
For all arches? Really? Look at MIPS, and x86, they have different
functions.
> While ioremap's
> default function is ioremap_nocache, so devm_ioremap_nocache also have the
> same function with devm_ioremap, which can just be killed to reduce the size
> of devres.o(from 20304 bytes to 18992 bytes in my compile environment).
>
> I have posted two versions, which use macro instead of function for
> devm_ioremap_nocache[1] or devm_ioremap[2]. And Greg suggest me to kill
> devm_ioremap_nocache for no need to keep a macro around for the duplicate
> thing. So here comes v3 and please help to review.
I don't think this can be done, what am I missing? These functions are
not identical, sorry for missing that before.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH v3 27/27] devres: kill devm_ioremap_nocache
From: Greg KH @ 2017-12-23 13:45 UTC (permalink / raw)
To: Yisheng Xie
Cc: linux-mips, ulf.hansson, jakub.kicinski, lgirdwood, airlied,
linux-pci, alsa-devel, dri-devel, platform-driver-x86, linux-ide,
linux-mtd, daniel.vetter, tglx, linux-watchdog, linux-rtc,
boris.brezillon, andriy.shevchenko, vinod.koul, richard,
alexandre.belloni, marek.vasut, industrypack-devel, jslaby,
dvhart, linux, linux-media, devel, jason, arnd, b.zolnierkie,
marc.zyngier, linux-mmc, linux-can, linux-gp
In-Reply-To: <1514026979-33838-1-git-send-email-xieyisheng1@huawei.com>
On Sat, Dec 23, 2017 at 07:02:59PM +0800, Yisheng Xie wrote:
> --- a/lib/devres.c
> +++ b/lib/devres.c
> @@ -44,35 +44,6 @@ void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
> EXPORT_SYMBOL(devm_ioremap);
>
> /**
> - * devm_ioremap_nocache - Managed ioremap_nocache()
> - * @dev: Generic device to remap IO address for
> - * @offset: Resource address to map
> - * @size: Size of map
> - *
> - * Managed ioremap_nocache(). Map is automatically unmapped on driver
> - * detach.
> - */
> -void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
> - resource_size_t size)
> -{
> - void __iomem **ptr, *addr;
> -
> - ptr = devres_alloc(devm_ioremap_release, sizeof(*ptr), GFP_KERNEL);
> - if (!ptr)
> - return NULL;
> -
> - addr = ioremap_nocache(offset, size);
Wait, devm_ioremap() calls ioremap(), not ioremap_nocache(), are you
_SURE_ that these are all identical? For all arches? If so, then
ioremap_nocache() can also be removed, right?
In my quick glance, I don't think you can do this series at all :(
greg k-h
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* [PATCH v3 27/27] devres: kill devm_ioremap_nocache
From: Yisheng Xie @ 2017-12-23 11:02 UTC (permalink / raw)
To: linux-kernel, gregkh
Cc: ysxie, ulf.hansson, linux-mmc, boris.brezillon, richard,
marek.vasut, cyrille.pitchen, linux-mtd, alsa-devel, wim, linux,
linux-watchdog, b.zolnierkie, linux-fbdev, linus.walleij,
linux-gpio, ralf, linux-mips, lgirdwood, broonie, tglx, jason,
marc.zyngier, arnd, andriy.shevchenko, industrypack-devel, wg,
mkl, linux-can, mcheh
Now, nobody use devm_ioremap_nocache anymore, can it can just be
removed. After this patch the size of devres.o will be reduced from
20304 bytes to 18992 bytes.
Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
---
Documentation/driver-model/devres.txt | 1 -
include/linux/io.h | 2 --
lib/devres.c | 29 -----------------------------
scripts/coccinelle/free/devm_free.cocci | 2 --
4 files changed, 34 deletions(-)
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index c180045..c3fddb5 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -292,7 +292,6 @@ IOMAP
devm_ioport_map()
devm_ioport_unmap()
devm_ioremap()
- devm_ioremap_nocache()
devm_ioremap_wc()
devm_ioremap_resource() : checks resource, requests memory region, ioremaps
devm_iounmap()
diff --git a/include/linux/io.h b/include/linux/io.h
index 32e30e8..a9c7270 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -75,8 +75,6 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr)
void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
resource_size_t size);
-void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
- resource_size_t size);
void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset,
resource_size_t size);
void devm_iounmap(struct device *dev, void __iomem *addr);
diff --git a/lib/devres.c b/lib/devres.c
index 5f2aedd..f818fcf 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -44,35 +44,6 @@ void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
EXPORT_SYMBOL(devm_ioremap);
/**
- * devm_ioremap_nocache - Managed ioremap_nocache()
- * @dev: Generic device to remap IO address for
- * @offset: Resource address to map
- * @size: Size of map
- *
- * Managed ioremap_nocache(). Map is automatically unmapped on driver
- * detach.
- */
-void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
- resource_size_t size)
-{
- void __iomem **ptr, *addr;
-
- ptr = devres_alloc(devm_ioremap_release, sizeof(*ptr), GFP_KERNEL);
- if (!ptr)
- return NULL;
-
- addr = ioremap_nocache(offset, size);
- if (addr) {
- *ptr = addr;
- devres_add(dev, ptr);
- } else
- devres_free(ptr);
-
- return addr;
-}
-EXPORT_SYMBOL(devm_ioremap_nocache);
-
-/**
* devm_ioremap_wc - Managed ioremap_wc()
* @dev: Generic device to remap IO address for
* @offset: Resource address to map
diff --git a/scripts/coccinelle/free/devm_free.cocci b/scripts/coccinelle/free/devm_free.cocci
index c990d2c..36b8752 100644
--- a/scripts/coccinelle/free/devm_free.cocci
+++ b/scripts/coccinelle/free/devm_free.cocci
@@ -51,8 +51,6 @@ expression x;
|
x = devm_ioremap(...)
|
- x = devm_ioremap_nocache(...)
-|
x = devm_ioport_map(...)
)
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 00/27] kill devm_ioremap_nocache
From: Yisheng Xie @ 2017-12-23 10:55 UTC (permalink / raw)
To: linux-kernel, gregkh
Cc: ysxie, ulf.hansson, linux-mmc, boris.brezillon, richard,
marek.vasut, cyrille.pitchen, linux-mtd, alsa-devel, wim, linux,
linux-watchdog, b.zolnierkie, linux-fbdev, linus.walleij,
linux-gpio, ralf, linux-mips, lgirdwood, broonie, tglx, jason,
marc.zyngier, arnd, andriy.shevchenko, industrypack-devel, wg,
mkl, linux-can, mcheh
Hi all,
When I tried to use devm_ioremap function and review related code, I found
devm_ioremap and devm_ioremap_nocache is almost the same with each other,
except one use ioremap while the other use ioremap_nocache. While ioremap's
default function is ioremap_nocache, so devm_ioremap_nocache also have the
same function with devm_ioremap, which can just be killed to reduce the size
of devres.o(from 20304 bytes to 18992 bytes in my compile environment).
I have posted two versions, which use macro instead of function for
devm_ioremap_nocache[1] or devm_ioremap[2]. And Greg suggest me to kill
devm_ioremap_nocache for no need to keep a macro around for the duplicate
thing. So here comes v3 and please help to review.
Thanks so much!
Yisheng Xie
[1] https://lkml.org/lkml/2017/11/20/135
[2] https://lkml.org/lkml/2017/11/25/21
Yisheng Xie (27):
ASOC: replace devm_ioremap_nocache with devm_ioremap
spi: replace devm_ioremap_nocache with devm_ioremap
staging: replace devm_ioremap_nocache with devm_ioremap
ipack: replace devm_ioremap_nocache with devm_ioremap
media: replace devm_ioremap_nocache with devm_ioremap
gpio: replace devm_ioremap_nocache with devm_ioremap
mmc: replace devm_ioremap_nocache with devm_ioremap
PCI: replace devm_ioremap_nocache with devm_ioremap
platform/x86: replace devm_ioremap_nocache with devm_ioremap
tty: replace devm_ioremap_nocache with devm_ioremap
video: replace devm_ioremap_nocache with devm_ioremap
rtc: replace devm_ioremap_nocache with devm_ioremap
char: replace devm_ioremap_nocache with devm_ioremap
mtd: nand: replace devm_ioremap_nocache with devm_ioremap
dmaengine: replace devm_ioremap_nocache with devm_ioremap
ata: replace devm_ioremap_nocache with devm_ioremap
irqchip: replace devm_ioremap_nocache with devm_ioremap
pinctrl: replace devm_ioremap_nocache with devm_ioremap
drm: replace devm_ioremap_nocache with devm_ioremap
regulator: replace devm_ioremap_nocache with devm_ioremap
watchdog: replace devm_ioremap_nocache with devm_ioremap
tools/testing/nvdimm: replace devm_ioremap_nocache with devm_ioremap
MIPS: pci: replace devm_ioremap_nocache with devm_ioremap
can: replace devm_ioremap_nocache with devm_ioremap
wireless: replace devm_ioremap_nocache with devm_ioremap
ethernet: replace devm_ioremap_nocache with devm_ioremap
devres: kill devm_ioremap_nocache
Documentation/driver-model/devres.txt | 1 -
arch/mips/pci/pci-ar2315.c | 3 +--
drivers/ata/pata_arasan_cf.c | 3 +--
drivers/ata/pata_octeon_cf.c | 9 ++++----
drivers/ata/pata_rb532_cf.c | 2 +-
drivers/char/hw_random/bcm63xx-rng.c | 3 +--
drivers/char/hw_random/octeon-rng.c | 10 ++++-----
drivers/dma/altera-msgdma.c | 3 +--
drivers/dma/sprd-dma.c | 4 ++--
drivers/gpio/gpio-ath79.c | 3 +--
drivers/gpio/gpio-em.c | 6 ++---
drivers/gpio/gpio-htc-egpio.c | 4 ++--
drivers/gpio/gpio-xgene.c | 3 +--
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +-
drivers/gpu/drm/msm/msm_drv.c | 2 +-
drivers/gpu/drm/sti/sti_dvo.c | 3 +--
drivers/gpu/drm/sti/sti_hda.c | 4 ++--
drivers/gpu/drm/sti/sti_hdmi.c | 2 +-
drivers/gpu/drm/sti/sti_tvout.c | 2 +-
drivers/gpu/drm/sti/sti_vtg.c | 2 +-
drivers/ipack/devices/ipoctal.c | 13 +++++------
drivers/irqchip/irq-renesas-intc-irqpin.c | 4 ++--
drivers/media/platform/tegra-cec/tegra_cec.c | 4 ++--
drivers/mmc/host/sdhci-acpi.c | 3 +--
drivers/mtd/nand/fsl_upm.c | 4 ++--
drivers/net/can/sja1000/sja1000_platform.c | 4 ++--
drivers/net/ethernet/altera/altera_tse_main.c | 3 +--
drivers/net/ethernet/ethoc.c | 8 +++----
drivers/net/ethernet/lantiq_etop.c | 4 ++--
drivers/net/ethernet/ti/netcp_core.c | 2 +-
drivers/net/wireless/ath/ath9k/ahb.c | 2 +-
drivers/pci/dwc/pci-dra7xx.c | 2 +-
drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 2 +-
drivers/pinctrl/bcm/pinctrl-nsp-mux.c | 4 ++--
drivers/pinctrl/freescale/pinctrl-imx1-core.c | 2 +-
drivers/pinctrl/pinctrl-amd.c | 4 ++--
drivers/platform/x86/intel_pmc_core.c | 5 ++---
drivers/regulator/ti-abb-regulator.c | 6 ++---
drivers/rtc/rtc-sh.c | 4 ++--
drivers/spi/spi-jcore.c | 3 +--
drivers/staging/fsl-mc/bus/mc-io.c | 8 +++----
drivers/tty/mips_ejtag_fdc.c | 4 ++--
drivers/tty/serial/8250/8250_omap.c | 3 +--
drivers/tty/serial/lantiq.c | 3 +--
drivers/tty/serial/meson_uart.c | 3 +--
drivers/tty/serial/owl-uart.c | 2 +-
drivers/tty/serial/pic32_uart.c | 4 ++--
drivers/video/fbdev/mbx/mbxfb.c | 9 ++++----
drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 +-
drivers/video/fbdev/pxa168fb.c | 4 ++--
drivers/watchdog/bcm63xx_wdt.c | 4 ++--
drivers/watchdog/rc32434_wdt.c | 4 ++--
include/linux/io.h | 2 --
lib/devres.c | 29 -------------------------
scripts/coccinelle/free/devm_free.cocci | 2 --
sound/soc/au1x/ac97c.c | 4 ++--
sound/soc/au1x/i2sc.c | 4 ++--
sound/soc/intel/atom/sst/sst_acpi.c | 20 ++++++++---------
sound/soc/intel/boards/mfld_machine.c | 4 ++--
sound/soc/sh/fsi.c | 4 ++--
tools/testing/nvdimm/Kbuild | 2 +-
tools/testing/nvdimm/test/iomap.c | 2 +-
62 files changed, 109 insertions(+), 168 deletions(-)
--
1.8.3.1
^ permalink raw reply
* [PATCH v3 16/27] ata: replace devm_ioremap_nocache with devm_ioremap
From: Yisheng Xie @ 2017-12-23 11:00 UTC (permalink / raw)
To: linux-kernel, gregkh; +Cc: ysxie, Yisheng Xie, Tejun Heo, linux-ide
Default ioremap is ioremap_nocache, so devm_ioremap has the same
function with devm_ioremap_nocache, which can just be killed to
save the size of devres.o
This patch is to use use devm_ioremap instead of devm_ioremap_nocache,
which should not have any function change but prepare for killing
devm_ioremap_nocache.
Cc: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
---
drivers/ata/pata_arasan_cf.c | 3 +--
drivers/ata/pata_octeon_cf.c | 9 ++++-----
drivers/ata/pata_rb532_cf.c | 2 +-
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index b4d5477..c046a56 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -827,8 +827,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA;
acdev->pbase = res->start;
- acdev->vbase = devm_ioremap_nocache(&pdev->dev, res->start,
- resource_size(res));
+ acdev->vbase = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (!acdev->vbase) {
dev_warn(&pdev->dev, "ioremap fail\n");
return -ENOMEM;
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index d3d851b..b653770 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -891,7 +891,7 @@ static int octeon_cf_probe(struct platform_device *pdev)
of_node_put(dma_node);
return -EINVAL;
}
- cf_port->dma_base = (u64)devm_ioremap_nocache(&pdev->dev, res_dma->start,
+ cf_port->dma_base = (u64)devm_ioremap(&pdev->dev, res_dma->start,
resource_size(res_dma));
if (!cf_port->dma_base) {
of_node_put(dma_node);
@@ -909,8 +909,8 @@ static int octeon_cf_probe(struct platform_device *pdev)
if (!res_cs1)
return -EINVAL;
- cs1 = devm_ioremap_nocache(&pdev->dev, res_cs1->start,
- resource_size(res_cs1));
+ cs1 = devm_ioremap(&pdev->dev, res_cs1->start,
+ resource_size(res_cs1));
if (!cs1)
return rv;
@@ -925,8 +925,7 @@ static int octeon_cf_probe(struct platform_device *pdev)
if (!res_cs0)
return -EINVAL;
- cs0 = devm_ioremap_nocache(&pdev->dev, res_cs0->start,
- resource_size(res_cs0));
+ cs0 = devm_ioremap(&pdev->dev, res_cs0->start, resource_size(res_cs0));
if (!cs0)
return rv;
diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
index 653b9a0..af57298 100644
--- a/drivers/ata/pata_rb532_cf.c
+++ b/drivers/ata/pata_rb532_cf.c
@@ -156,7 +156,7 @@ static int rb532_pata_driver_probe(struct platform_device *pdev)
info->gpio_line = gpio;
info->irq = irq;
- info->iobase = devm_ioremap_nocache(&pdev->dev, res->start,
+ info->iobase = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
if (!info->iobase)
return -ENOMEM;
--
1.8.3.1
^ permalink raw reply related
* [PATCH] ata: ahci_brcm: Avoid clobbering SATA_TOP_CTRL_BUS_CTRL
From: Florian Fainelli @ 2017-12-22 19:43 UTC (permalink / raw)
To: linux-kernel
Cc: bcm-kernel-feedback-list, Florian Fainelli, Tejun Heo, linux-ide
We are doing a blind write to SATA_TOP_CTRL_BUS_CTRL to set the system
endian, but in doing so, we are also overwriting other bits, such as the
SATA_SCB_BURST_SIZE and SATA_FIFO_SIZE bits, which impact performance.
Do a read/modify/write so we keep the default values.
While we are at it, we also greatly simplify the logic and just leave
the NSP specific bit settings, instead of having a completely different
sequence.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Tejun, this is against your "for-next" branch, thank you!
drivers/ata/ahci_brcm.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 5936d1679bf3..ad3b8826ec79 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -70,6 +70,13 @@
(DATA_ENDIAN << DMADESC_ENDIAN_SHIFT) | \
(MMIO_ENDIAN << MMIO_ENDIAN_SHIFT))
+#define BUS_CTRL_ENDIAN_NSP_CONF \
+ (0x02 << DMADATA_ENDIAN_SHIFT | 0x02 << DMADESC_ENDIAN_SHIFT)
+
+#define BUS_CTRL_ENDIAN_CONF_MASK \
+ (0x3 << MMIO_ENDIAN_SHIFT | 0x3 << DMADESC_ENDIAN_SHIFT | \
+ 0x3 << DMADATA_ENDIAN_SHIFT | 0x3 << PIODATA_ENDIAN_SHIFT)
+
enum brcm_ahci_version {
BRCM_SATA_BCM7425 = 1,
BRCM_SATA_BCM7445,
@@ -250,18 +257,16 @@ static u32 brcm_ahci_get_portmask(struct platform_device *pdev,
static void brcm_sata_init(struct brcm_ahci_priv *priv)
{
void __iomem *ctrl = priv->top_ctrl + SATA_TOP_CTRL_BUS_CTRL;
+ u32 data;
/* Configure endianness */
- if (priv->version == BRCM_SATA_NSP) {
- u32 data = brcm_sata_readreg(ctrl);
-
- data &= ~((0x03 << DMADATA_ENDIAN_SHIFT) |
- (0x03 << DMADESC_ENDIAN_SHIFT));
- data |= (0x02 << DMADATA_ENDIAN_SHIFT) |
- (0x02 << DMADESC_ENDIAN_SHIFT);
- brcm_sata_writereg(data, ctrl);
- } else
- brcm_sata_writereg(BUS_CTRL_ENDIAN_CONF, ctrl);
+ data = brcm_sata_readreg(ctrl);
+ data &= ~BUS_CTRL_ENDIAN_CONF_MASK;
+ if (priv->version == BRCM_SATA_NSP)
+ data |= BUS_CTRL_ENDIAN_NSP_CONF;
+ else
+ data |= BUS_CTRL_ENDIAN_CONF;
+ brcm_sata_writereg(data, ctrl);
}
#ifdef CONFIG_PM_SLEEP
--
2.15.0
^ permalink raw reply related
* Re: about warning in ata_eh_finish()
From: Jason Yan @ 2017-12-21 1:31 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide
In-Reply-To: <20171220173636.GC3413940@devbig577.frc2.facebook.com>
Tejun,
On 2017/12/21 1:36, Tejun Heo wrote:
> Which kernel version are you running on what sort of device? Can you
> post the full log?
We have tested kernel 4.12 to 4.15, all have this warning.
Some sas/sata disks directly connected to hisi sas controller.
The full log is as follows, please ignore the duplicated log because I
didn't close the boot console.
--IPOP Time:12/3/2017_2:03:56--
[26578.886290] driverversion:v1.6.
[26578.886290] driverversion:v1.6.
[26578.897569] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26578.897569] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26578.925190] | 0| 0| 0| 0 | 0 |
2 |0x5001882016000000| 0|
[26578.925190] | 0| 0| 0| 0 | 0 |
2 |0x5001882016000000| 0|
[26578.951506] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26578.951506] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26578.976032] | 0 | 0| 0| 0|
0| 0| 0|
[26578.976032] | 0 | 0| 0| 0|
0| 0| 0|
[26579.000336] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.000336] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.025793] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.025793] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.051973] | 0| 1| 1| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.051973] | 0| 1| 1| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.077037] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.077037] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.101389] | 0 | 0| 0| 0|
0| 0| 0|
[26579.101389] | 0 | 0| 0| 0|
0| 0| 0|
[26579.125601] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.125601] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.150496] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.150496] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.175551] | 0| 2| 2| 0 | 0 |
1 |0x5001882016000000| 0|
[26579.175551] | 0| 2| 2| 0 | 0 |
1 |0x5001882016000000| 0|
[26579.200592] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.200592] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.224980] | 0 | 0| 0| 0|
0| 0| 0|
[26579.224980] | 0 | 0| 0| 0|
0| 0| 0|
[26579.249208] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.249208] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.274325] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.274325] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.299307] | 0| 3| 3| 0 | 0 |
1 |0x5001882016000000| 0|
[26579.299307] | 0| 3| 3| 0 | 0 |
1 |0x5001882016000000| 0|
[26579.324170] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.324170] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.348738] | 0 | 0| 0| 0|
0| 0| 0|
[26579.348738] | 0 | 0| 0| 0|
0| 0| 0|
[26579.372943] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.372943] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.397802] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.397802] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.423176] | 0| 4| 4| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.423176] | 0| 4| 4| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.448025] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.448025] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.472366] | 0 | 0| 0| 0|
0| 0| 0|
[26579.472366] | 0 | 0| 0| 0|
0| 0| 0|
[26579.496780] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.496780] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.521676] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.521676] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.546648] | 0| 5| 5| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.546648] | 0| 5| 5| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.571522] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.571522] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.595796] | 0 | 0| 0| 0|
0| 0| 0|
[26579.595796] | 0 | 0| 0| 0|
0| 0| 0|
[26579.620742] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.620742] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.646939] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.646939] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.671955] | 0| 6| 6| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.671955] | 0| 6| 6| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.696767] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.696767] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.722604] | 0 | 0| 0| 0|
0| 0| 0|
[26579.722604] | 0 | 0| 0| 0|
0| 0| 0|
[26579.746776] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.746776] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.771601] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.771601] |core id|port id | phy id |phy mode | phy status | phy
type | dev sas address |dev info |
[26579.796675] | 0| 7| 7| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.796675] | 0| 7| 7| 0 | 0 |
2 |0x5001882016000000| 0|
[26579.821494] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.821494] |dq_1b_ecc |iost_1b_ecc
|tct_ram_ecc|dq_ram_ecc|iost_ram_ecc|itct_1b_ecc|axi incorrect|
[26579.845648] | 0 | 0| 0| 0|
0| 0| 0|
[26579.845648] | 0 | 0| 0| 0|
0| 0| 0|
[26579.870194] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.870194] - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[26579.895005]
===================================================================================================
[26579.895005]
===================================================================================================
[26579.922206] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26579.922206] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26579.949162] | 0| 0| 0| 8| 16|
8| 8| 11| 1.5G|
[26579.949162] | 0| 0| 0| 8| 16|
8| 8| 11| 1.5G|
[26579.976014]
===================================================================================================
[26579.976014]
===================================================================================================
[26580.002861] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.002861] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.029907] | 0| 1| 1| 8| 16|
8| 8| 11| 1.5G|
[26580.029907] | 0| 1| 1| 8| 16|
8| 8| 11| 1.5G|
[26580.057054]
===================================================================================================
[26580.057054]
===================================================================================================
[26580.083917] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.083917] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.110862] | 0| 2| 2| 8| 16|
8| 8| 11| 1.5G|
[26580.110862] | 0| 2| 2| 8| 16|
8| 8| 11| 1.5G|
[26580.137742]
===================================================================================================
[26580.137742]
===================================================================================================
[26580.164967] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.164967] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.191859] | 0| 3| 3| 8| 16|
8| 8| 11| 1.5G|
[26580.191859] | 0| 3| 3| 8| 16|
8| 8| 11| 1.5G|
[26580.218635]
===================================================================================================
[26580.218635]
===================================================================================================
[26580.245459] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.245459] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.272329] | 0| 4| 4| 8| 16|
8| 8| 11| 1.5G|
[26580.272329] | 0| 4| 4| 8| 16|
8| 8| 11| 1.5G|
[26580.299178]
===================================================================================================
[26580.299178]
===================================================================================================
[26580.326276] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.326276] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.353183] | 0| 5| 5| 8| 16|
8| 8| 11| 1.5G|
[26580.353183] | 0| 5| 5| 8| 16|
8| 8| 11| 1.5G|
[26580.379961]
===================================================================================================
[26580.379961]
===================================================================================================
[26580.406824] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.406824] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.433665] | 0| 6| 6| 8| 16|
8| 8| 11| 1.5G|
[26580.433665] | 0| 6| 6| 8| 16|
8| 8| 11| 1.5G|
[26580.460516]
===================================================================================================
[26580.460516]
===================================================================================================
[26580.487277] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.487277] |core id|port id|phy id|phy nums|queue count|max phy
nums|mini linkrate|max linkrate|nego linkrate|
[26580.514383] | 0| 7| 7| 8| 16|
8| 8| 11| 1.5G|
[26580.514383] | 0| 7| 7| 8| 16|
8| 8| 11| 1.5G|
[26625.414506] hisi_sas_v3_hw 0000:74:02.0: phydown: phy0 phy_state=0xfe
[26625.414506] hisi_sas_v3_hw 0000:74:02.0: phydown: phy0 phy_state=0xfe
[26625.930184] sd 2:0:46:0: [sda] Synchronizing SCSI cache
[26625.930184] sd 2:0:46:0: [sda] Synchronizing SCSI cache
[26626.029224] sd 2:0:46:0: [sda] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26626.029224] sd 2:0:46:0: [sda] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26626.379429] hisi_sas_v3_hw 0000:74:02.0: dev[0:1] is gone
[26626.379429] hisi_sas_v3_hw 0000:74:02.0: dev[0:1] is gone
--IPOP Time:12/3/2017_2:04:56--
[26636.989039] hisi_sas_v3_hw 0000:74:02.0: phyup: phy0 link_rate=8
[26636.989039] hisi_sas_v3_hw 0000:74:02.0: phyup: phy0 link_rate=8
[26637.107664] hisi_sas_v3_hw 0000:74:02.0: dev[0:1] found
[26637.107664] hisi_sas_v3_hw 0000:74:02.0: dev[0:1] found
[26637.480378] scsi 2:0:54:0: Direct-Access HGST HUC101818CS4200
A902 PQ: 0 ANSI: 6
[26637.480378] scsi 2:0:54:0: Direct-Access HGST HUC101818CS4200
A902 PQ: 0 ANSI: 6
[26638.259023] sd 2:0:54:0: [sda] 3516328368 512-byte logical blocks:
(1.80 TB/1.64 TiB)
[26638.259023] sd 2:0:54:0: [sda] 3516328368 512-byte logical blocks:
(1.80 TB/1.64 TiB)
[26638.284719] sd 2:0:54:0: [sda] 4096-byte physical blocks
[26638.284719] sd 2:0:54:0: [sda] 4096-byte physical blocks
[26638.343873] sd 2:0:54:0: [sda] Write Protect is off
[26638.343873] sd 2:0:54:0: [sda] Write Protect is off
[26638.526156] sd 2:0:54:0: [sda] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26638.526156] sd 2:0:54:0: [sda] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26640.229889] sd 2:0:54:0: [sda] Attached SCSI disk
[26640.229889] sd 2:0:54:0: [sda] Attached SCSI disk
[26648.873697] hisi_sas_v3_hw 0000:74:02.0: phydown: phy1 phy_state=0xfd
[26648.873697] hisi_sas_v3_hw 0000:74:02.0: phydown: phy1 phy_state=0xfd
[26649.219357] sd 2:0:47:0: [sdb] Synchronizing SCSI cache
[26649.219357] sd 2:0:47:0: [sdb] Synchronizing SCSI cache
[26649.286834] sd 2:0:47:0: [sdb] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26649.286834] sd 2:0:47:0: [sdb] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26649.724381] hisi_sas_v3_hw 0000:74:02.0: dev[1:1] is gone
[26649.724381] hisi_sas_v3_hw 0000:74:02.0: dev[1:1] is gone
[26660.708058] hisi_sas_v3_hw 0000:74:02.0: phyup: phy1 link_rate=8
[26660.708058] hisi_sas_v3_hw 0000:74:02.0: phyup: phy1 link_rate=8
[26660.820772] hisi_sas_v3_hw 0000:74:02.0: dev[1:1] found
[26660.820772] hisi_sas_v3_hw 0000:74:02.0: dev[1:1] found
[26661.157316] scsi 2:0:55:0: Direct-Access SEAGATE ST600MM0088
N003 PQ: 0 ANSI: 6
[26661.157316] scsi 2:0:55:0: Direct-Access SEAGATE ST600MM0088
N003 PQ: 0 ANSI: 6
[26662.261880] sd 2:0:55:0: [sdb] 1172123568 512-byte logical blocks:
(600 GB/559 GiB)
[26662.261880] sd 2:0:55:0: [sdb] 1172123568 512-byte logical blocks:
(600 GB/559 GiB)
[26662.340445] sd 2:0:55:0: [sdb] Write Protect is off
[26662.340445] sd 2:0:55:0: [sdb] Write Protect is off
[26662.497744] sd 2:0:55:0: [sdb] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26662.497744] sd 2:0:55:0: [sdb] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26663.814019] sd 2:0:55:0: [sdb] Attached SCSI disk
[26663.814019] sd 2:0:55:0: [sdb] Attached SCSI disk
[26672.036357] hisi_sas_v3_hw 0000:74:02.0: phydown: phy2 phy_state=0xfb
[26672.036357] hisi_sas_v3_hw 0000:74:02.0: phydown: phy2 phy_state=0xfb
[26672.284269] sd 2:0:48:0: [sdc] Synchronizing SCSI cache
[26672.284269] sd 2:0:48:0: [sdc] Synchronizing SCSI cache
[26672.320666] sd 2:0:48:0: [sdc] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26672.320666] sd 2:0:48:0: [sdc] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26672.351326] sd 2:0:48:0: [sdc] Stopping disk
[26672.351326] sd 2:0:48:0: [sdc] Stopping disk
[26672.371145] sd 2:0:48:0: [sdc] Start/Stop Unit failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26672.371145] sd 2:0:48:0: [sdc] Start/Stop Unit failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
--IPOP Time:12/3/2017_2:05:57--
[26703.586351] hisi_sas_v3_hw 0000:74:02.0: task prep: SATA/STP port2
not attach device
[26703.586351] hisi_sas_v3_hw 0000:74:02.0: task prep: SATA/STP port2
not attach device
[26703.607605] hisi_sas_v3_hw 0000:74:02.0: task exec: failed[138]!
[26703.607605] hisi_sas_v3_hw 0000:74:02.0: task exec: failed[138]!
[26703.627180] hisi_sas_v3_hw 0000:74:02.0: abort tmf: executing
internal task failed: 138
[26703.627180] hisi_sas_v3_hw 0000:74:02.0: abort tmf: executing
internal task failed: 138
[26703.649037] hisi_sas_v3_hw 0000:74:02.0: ata disk reset failed
[26703.649037] hisi_sas_v3_hw 0000:74:02.0: ata disk reset failed
[26703.666632] hisi_sas_v3_hw 0000:74:02.0: abort task: rc=138
[26703.666632] hisi_sas_v3_hw 0000:74:02.0: abort task: rc=138
[26705.746557] ------------[ cut here ]------------
[26705.746557] ------------[ cut here ]------------
[26705.760518] WARNING: CPU: 1 PID: 6796 at drivers/ata/libata-eh.c:4037
ata_eh_finish+0xb4/0xcc
[26705.760518] WARNING: CPU: 1 PID: 6796 at drivers/ata/libata-eh.c:4037
ata_eh_finish+0xb4/0xcc
[26705.782955] Modules linked in: debug_nic_mii(OE) hisi_sas_test_hw(OE)
hisi_sas_test_main(OE)
[26705.782955] Modules linked in: debug_nic_mii(OE) hisi_sas_test_hw(OE)
hisi_sas_test_main(OE)
[26705.806236] CPU: 1 PID: 6796 Comm: kworker/u4:2 Tainted: G
OEL 4.14.0 #1
[26705.806236] CPU: 1 PID: 6796 Comm: kworker/u4:2 Tainted: G
OEL 4.14.0 #1
[26705.827152] Workqueue: events_unbound async_run_entry_fn
[26705.827152] Workqueue: events_unbound async_run_entry_fn
[26705.841354] task: ffff8021f7761080 task.stack: ffff00000fb28000
[26705.841354] task: ffff8021f7761080 task.stack: ffff00000fb28000
[26705.857045] PC is at ata_eh_finish+0xb4/0xcc
[26705.857045] PC is at ata_eh_finish+0xb4/0xcc
[26705.868483] LR is at ata_do_eh+0x68/0xd8
[26705.868483] LR is at ata_do_eh+0x68/0xd8
[26705.878946] pc : [<ffff0000088baf70>] lr : [<ffff0000088bb764>]
pstate: 60c00149
[26705.878946] pc : [<ffff0000088baf70>] lr : [<ffff0000088bb764>]
pstate: 60c00149
[26705.898332] sp : ffff00000fb2bc40
[26705.898332] sp : ffff00000fb2bc40
[26705.907213] x29: ffff00000fb2bc40 x28: ffff8021ede761a0
[26705.907213] x29: ffff00000fb2bc40 x28: ffff8021ede761a0
[26705.921495] x27: 0000000000020200 x26: ffff8021ede76218
[26705.921495] x27: 0000000000020200 x26: ffff8021ede76218
[26705.935716] x25: ffff8021ede75e80 x24: 0000000000000140
[26705.935716] x25: ffff8021ede75e80 x24: 0000000000000140
[26705.949909] x23: ffff0000088adb8c x22: ffff000008878fe4
[26705.949909] x23: ffff0000088adb8c x22: ffff000008878fe4
[26705.964086] x21: ffff8021ede74000 x20: ffff8021ede75e38
[26705.964086] x21: ffff8021ede74000 x20: ffff8021ede75e38
[26705.978292] x19: ffff8021ede75e38 x18: 000000000003fee6
[26705.978292] x19: ffff8021ede75e38 x18: 000000000003fee6
[26705.992502] x17: 0000ffffbc4eb5b8 x16: ffff00000814a650
[26705.992502] x17: 0000ffffbc4eb5b8 x16: ffff00000814a650
[26706.006700] x15: 00001c71e0000000 x14: 0000000000000000
[26706.006700] x15: 00001c71e0000000 x14: 0000000000000000
[26706.020896] x13: 0000000000000000 x12: 0000000000000000
[26706.020896] x13: 0000000000000000 x12: 0000000000000000
[26706.035096] x11: 0000000000000000 x10: 0000000000000000
[26706.035096] x11: 0000000000000000 x10: 0000000000000000
[26706.049291] x9 : 0000000000000000 x8 : 0000000000000000
[26706.049291] x9 : 0000000000000000 x8 : 0000000000000000
[26706.063450] x7 : ffff8021ede75000 x6 : 0000000000000000
[26706.063450] x7 : ffff8021ede75000 x6 : 0000000000000000
[26706.077657] x5 : 0000000000000000 x4 : ffff8021ede75e80
[26706.077657] x5 : 0000000000000000 x4 : ffff8021ede75e80
[26706.091791] x3 : 0000000000000000 x2 : e51c5c8d83755700
[26706.091791] x3 : 0000000000000000 x2 : e51c5c8d83755700
[26706.105972] x1 : 0000000000000000 x0 : 0000000000000001
[26706.105972] x1 : 0000000000000000 x0 : 0000000000000001
[26706.120282] Call trace:
[26706.120282] Call trace:
[26706.127051] Exception stack(0xffff00000fb2bb00 to 0xffff00000fb2bc40)
[26706.127051] Exception stack(0xffff00000fb2bb00 to 0xffff00000fb2bc40)
[26706.144156] bb00: 0000000000000001 0000000000000000 e51c5c8d83755700
0000000000000000
[26706.144156] bb00: 0000000000000001 0000000000000000 e51c5c8d83755700
0000000000000000
[26706.164797] bb20: ffff8021ede75e80 0000000000000000 0000000000000000
ffff8021ede75000
[26706.164797] bb20: ffff8021ede75e80 0000000000000000 0000000000000000
ffff8021ede75000
[26706.185380] bb40: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[26706.185380] bb40: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[26706.205972] bb60: 0000000000000000 0000000000000000 0000000000000000
00001c71e0000000
[26706.205972] bb60: 0000000000000000 0000000000000000 0000000000000000
00001c71e0000000
[26706.226616] bb80: ffff00000814a650 0000ffffbc4eb5b8 000000000003fee6
ffff8021ede75e38
[26706.226616] bb80: ffff00000814a650 0000ffffbc4eb5b8 000000000003fee6
ffff8021ede75e38
[26706.247247] bba0: ffff8021ede75e38 ffff8021ede74000 ffff000008878fe4
ffff0000088adb8c
[26706.247247] bba0: ffff8021ede75e38 ffff8021ede74000 ffff000008878fe4
ffff0000088adb8c
[26706.267813] bbc0: 0000000000000140 ffff8021ede75e80 ffff8021ede76218
0000000000020200
[26706.267813] bbc0: 0000000000000140 ffff8021ede75e80 ffff8021ede76218
0000000000020200
[26706.288375] bbe0: ffff8021ede761a0 ffff00000fb2bc40 ffff0000088bb764
ffff00000fb2bc40
[26706.288375] bbe0: ffff8021ede761a0 ffff00000fb2bc40 ffff0000088bb764
ffff00000fb2bc40
[26706.308933] bc00: ffff0000088baf70 0000000060c00149 ffff8021ede77790
00000000088b8c60
[26706.308933] bc00: ffff0000088baf70 0000000060c00149 ffff8021ede77790
00000000088b8c60
[26706.329512] bc20: ffffffffffffffff 0000000000000000 ffff00000fb2bc40
ffff0000088baf70
[26706.329512] bc20: ffffffffffffffff 0000000000000000 ffff00000fb2bc40
ffff0000088baf70
[26706.350156] [<ffff0000088baf70>] ata_eh_finish+0xb4/0xcc
[26706.350156] [<ffff0000088baf70>] ata_eh_finish+0xb4/0xcc
[26706.364260] [<ffff0000088bb764>] ata_do_eh+0x68/0xd8
[26706.364260] [<ffff0000088bb764>] ata_do_eh+0x68/0xd8
[26706.377497] [<ffff0000088bb818>] ata_std_error_handler+0x44/0x8c
[26706.377497] [<ffff0000088bb818>] ata_std_error_handler+0x44/0x8c
[26706.393406] [<ffff0000088bb408>] ata_scsi_port_error_handler+0x480/0x694
[26706.393406] [<ffff0000088bb408>] ata_scsi_port_error_handler+0x480/0x694
[26706.411352] [<ffff000008879364>] async_sas_ata_eh+0x4c/0x80
[26706.411352] [<ffff000008879364>] async_sas_ata_eh+0x4c/0x80
[26706.426133] [<ffff0000080f6be8>] async_run_entry_fn+0x4c/0x170
[26706.426133] [<ffff0000080f6be8>] async_run_entry_fn+0x4c/0x170
[26706.441841] [<ffff0000080ebd70>] process_one_work+0x144/0x390
[26706.441841] [<ffff0000080ebd70>] process_one_work+0x144/0x390
[26706.457057] [<ffff0000080ec100>] worker_thread+0x144/0x418
[26706.457057] [<ffff0000080ec100>] worker_thread+0x144/0x418
[26706.471610] [<ffff0000080f2c98>] kthread+0x10c/0x138
[26706.471610] [<ffff0000080f2c98>] kthread+0x10c/0x138
[26706.484991] [<ffff0000080855dc>] ret_from_fork+0x10/0x18
[26706.484991] [<ffff0000080855dc>] ret_from_fork+0x10/0x18
[26706.499044] ---[ end trace b555600a8adbf64c ]---
[26706.499044] ---[ end trace b555600a8adbf64c ]---
[26706.541683] scsi 2:0:48:0: [sdc] tag#1 FAILED Result:
hostbyte=DID_ABORT driverbyte=DRIVER_OK
[26706.541683] scsi 2:0:48:0: [sdc] tag#1 FAILED Result:
hostbyte=DID_ABORT driverbyte=DRIVER_OK
[26706.567810] scsi 2:0:48:0: [sdc] tag#1 CDB: Read(16) 88 00 00 00 00
00 12 bf 94 b0 00 00 05 98 00 00
[26706.567810] scsi 2:0:48:0: [sdc] tag#1 CDB: Read(16) 88 00 00 00 00
00 12 bf 94 b0 00 00 05 98 00 00
[26706.595023] print_req_error: I/O error, dev sdc, sector 314545328
[26706.595023] print_req_error: I/O error, dev sdc, sector 314545328
[26706.620247] scsi 2:0:48:0: [sdc] tag#0 FAILED Result:
hostbyte=DID_ABORT driverbyte=DRIVER_OK
[26706.620247] scsi 2:0:48:0: [sdc] tag#0 FAILED Result:
hostbyte=DID_ABORT driverbyte=DRIVER_OK
[26706.644961] scsi 2:0:48:0: [sdc] tag#0 CDB: Read(16) 88 00 00 00 00
00 12 bf 8c b0 00 00 08 00 00 00
[26706.644961] scsi 2:0:48:0: [sdc] tag#0 CDB: Read(16) 88 00 00 00 00
00 12 bf 8c b0 00 00 08 00 00 00
[26706.669886] print_req_error: I/O error, dev sdc, sector 314543280
[26706.669886] print_req_error: I/O error, dev sdc, sector 314543280
[26706.830360] hisi_sas_v3_hw 0000:74:02.0: dev[2:5] is gone
[26706.830360] hisi_sas_v3_hw 0000:74:02.0: dev[2:5] is gone
[26707.136481] hisi_sas_v3_hw 0000:74:02.0: phyup: phy2 link_rate=8(sata)
[26707.136481] hisi_sas_v3_hw 0000:74:02.0: phyup: phy2 link_rate=8(sata)
[26707.197919] hisi_sas_v3_hw 0000:74:02.0: dev[2:5] found
[26707.197919] hisi_sas_v3_hw 0000:74:02.0: dev[2:5] found
[26707.591580] ata17.00: ATA-9: HUS726060ALE610, T7MH, max UDMA/133
[26707.591580] ata17.00: ATA-9: HUS726060ALE610, T7MH, max UDMA/133
[26707.609692] ata17.00: 11721045168 sectors, multi 0: LBA48 NCQ (depth
31/32)
[26707.609692] ata17.00: 11721045168 sectors, multi 0: LBA48 NCQ (depth
31/32)
[26707.684979] ata17.00: configured for UDMA/133
[26707.684979] ata17.00: configured for UDMA/133
[26707.875096] scsi 2:0:56:0: Direct-Access ATA HUS726060ALE610
T7MH PQ: 0 ANSI: 5
[26707.875096] scsi 2:0:56:0: Direct-Access ATA HUS726060ALE610
T7MH PQ: 0 ANSI: 5
[26708.110173] sd 2:0:56:0: [sdc] 11721045168 512-byte logical blocks:
(6.00 TB/5.46 TiB)
[26708.110173] sd 2:0:56:0: [sdc] 11721045168 512-byte logical blocks:
(6.00 TB/5.46 TiB)
[26708.135492] sd 2:0:56:0: [sdc] 4096-byte physical blocks
[26708.135492] sd 2:0:56:0: [sdc] 4096-byte physical blocks
[26708.209552] sd 2:0:56:0: [sdc] Write Protect is off
[26708.209552] sd 2:0:56:0: [sdc] Write Protect is off
[26708.236055] sd 2:0:56:0: [sdc] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[26708.236055] sd 2:0:56:0: [sdc] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[26708.615290] sd 2:0:56:0: [sdc] Attached SCSI disk
[26708.615290] sd 2:0:56:0: [sdc] Attached SCSI disk
[26718.256091] hisi_sas_v3_hw 0000:74:02.0: phydown: phy3 phy_state=0xf7
[26718.256091] hisi_sas_v3_hw 0000:74:02.0: phydown: phy3 phy_state=0xf7
[26718.451643] sd 2:0:49:0: [sdd] Synchronizing SCSI cache
[26718.451643] sd 2:0:49:0: [sdd] Synchronizing SCSI cache
[26718.489868] sd 2:0:49:0: [sdd] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26718.489868] sd 2:0:49:0: [sdd] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26718.520730] sd 2:0:49:0: [sdd] Stopping disk
[26718.520730] sd 2:0:49:0: [sdd] Stopping disk
[26718.537621] sd 2:0:49:0: [sdd] Start/Stop Unit failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26718.537621] sd 2:0:49:0: [sdd] Start/Stop Unit failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26718.727537] hisi_sas_v3_hw 0000:74:02.0: dev[3:5] is gone
[26718.727537] hisi_sas_v3_hw 0000:74:02.0: dev[3:5] is gone
[26729.780626] hisi_sas_v3_hw 0000:74:02.0: phyup: phy3 link_rate=8(sata)
[26729.780626] hisi_sas_v3_hw 0000:74:02.0: phyup: phy3 link_rate=8(sata)
[26729.840148] hisi_sas_v3_hw 0000:74:02.0: dev[3:5] found
[26729.840148] hisi_sas_v3_hw 0000:74:02.0: dev[3:5] found
[26730.099183] ata18.00: ATA-10: INTEL SSDSC2BB960G7, N2010101, max UDMA/133
[26730.099183] ata18.00: ATA-10: INTEL SSDSC2BB960G7, N2010101, max UDMA/133
[26730.118817] ata18.00: 1875385008 sectors, multi 1: LBA48 NCQ (depth
31/32)
[26730.118817] ata18.00: 1875385008 sectors, multi 1: LBA48 NCQ (depth
31/32)
[26730.163992] ata18.00: configured for UDMA/133
[26730.163992] ata18.00: configured for UDMA/133
[26730.368127] scsi 2:0:57:0: Direct-Access ATA INTEL
SSDSC2BB96 0101 PQ: 0 ANSI: 5
[26730.368127] scsi 2:0:57:0: Direct-Access ATA INTEL
SSDSC2BB96 0101 PQ: 0 ANSI: 5
[26730.485519] ata18.00: Enabling discard_zeroes_data
[26730.485519] ata18.00: Enabling discard_zeroes_data
[26730.562133] sd 2:0:57:0: [sdd] 1875385008 512-byte logical blocks:
(960 GB/894 GiB)
[26730.562133] sd 2:0:57:0: [sdd] 1875385008 512-byte logical blocks:
(960 GB/894 GiB)
[26730.586390] sd 2:0:57:0: [sdd] 4096-byte physical blocks
[26730.586390] sd 2:0:57:0: [sdd] 4096-byte physical blocks
[26730.624535] sd 2:0:57:0: [sdd] Write Protect is off
[26730.624535] sd 2:0:57:0: [sdd] Write Protect is off
[26730.655565] sd 2:0:57:0: [sdd] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[26730.655565] sd 2:0:57:0: [sdd] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[26730.758190] ata18.00: Enabling discard_zeroes_data
[26730.758190] ata18.00: Enabling discard_zeroes_data
[26730.965130] ata18.00: Enabling discard_zeroes_data
[26730.965130] ata18.00: Enabling discard_zeroes_data
[26731.035218] sd 2:0:57:0: [sdd] Attached SCSI disk
[26731.035218] sd 2:0:57:0: [sdd] Attached SCSI disk
[26741.033891] hisi_sas_v3_hw 0000:74:02.0: phydown: phy4 phy_state=0xef
[26741.033891] hisi_sas_v3_hw 0000:74:02.0: phydown: phy4 phy_state=0xef
[26741.262803] sd 2:0:50:0: [sde] Synchronizing SCSI cache
[26741.262803] sd 2:0:50:0: [sde] Synchronizing SCSI cache
[26741.291251] sd 2:0:50:0: [sde] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26741.291251] sd 2:0:50:0: [sde] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26741.452295] hisi_sas_v3_hw 0000:74:02.0: dev[4:1] is gone
[26741.452295] hisi_sas_v3_hw 0000:74:02.0: dev[4:1] is gone
--IPOP Time:12/3/2017_2:06:57--
[26752.519335] hisi_sas_v3_hw 0000:74:02.0: phyup: phy4 link_rate=8
[26752.519335] hisi_sas_v3_hw 0000:74:02.0: phyup: phy4 link_rate=8
[26752.603868] hisi_sas_v3_hw 0000:74:02.0: dev[4:1] found
[26752.603868] hisi_sas_v3_hw 0000:74:02.0: dev[4:1] found
[26752.761954] scsi 2:0:58:0: Direct-Access HGST HUC156060CS4200
A360 PQ: 0 ANSI: 6
[26752.761954] scsi 2:0:58:0: Direct-Access HGST HUC156060CS4200
A360 PQ: 0 ANSI: 6
[26753.016839] sd 2:0:58:0: [sde] 146515446 4096-byte logical blocks:
(600 GB/559 GiB)
[26753.016839] sd 2:0:58:0: [sde] 146515446 4096-byte logical blocks:
(600 GB/559 GiB)
[26753.060446] sd 2:0:58:0: [sde] Write Protect is off
[26753.060446] sd 2:0:58:0: [sde] Write Protect is off
[26753.112410] sd 2:0:58:0: [sde] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26753.112410] sd 2:0:58:0: [sde] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26754.048264] sd 2:0:58:0: [sde] Attached SCSI disk
[26754.048264] sd 2:0:58:0: [sde] Attached SCSI disk
[26763.914651] hisi_sas_v3_hw 0000:74:02.0: phydown: phy5 phy_state=0xdf
[26763.914651] hisi_sas_v3_hw 0000:74:02.0: phydown: phy5 phy_state=0xdf
[26764.123860] sd 2:0:51:0: [sdf] Synchronizing SCSI cache
[26764.123860] sd 2:0:51:0: [sdf] Synchronizing SCSI cache
[26764.160910] sd 2:0:51:0: [sdf] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26764.160910] sd 2:0:51:0: [sdf] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26764.349635] hisi_sas_v3_hw 0000:74:02.0: dev[5:1] is gone
[26764.349635] hisi_sas_v3_hw 0000:74:02.0: dev[5:1] is gone
[26775.341199] hisi_sas_v3_hw 0000:74:02.0: phyup: phy5 link_rate=8
[26775.341199] hisi_sas_v3_hw 0000:74:02.0: phyup: phy5 link_rate=8
[26775.417619] hisi_sas_v3_hw 0000:74:02.0: dev[5:1] found
[26775.417619] hisi_sas_v3_hw 0000:74:02.0: dev[5:1] found
[26775.571880] scsi 2:0:59:0: Direct-Access HITACHI HUC109090CSS600
A440 PQ: 0 ANSI: 6
[26775.571880] scsi 2:0:59:0: Direct-Access HITACHI HUC109090CSS600
A440 PQ: 0 ANSI: 6
[26775.797378] sd 2:0:59:0: [sdf] 1758174768 512-byte logical blocks:
(900 GB/838 GiB)
[26775.797378] sd 2:0:59:0: [sdf] 1758174768 512-byte logical blocks:
(900 GB/838 GiB)
[26775.835526] sd 2:0:59:0: [sdf] Write Protect is off
[26775.835526] sd 2:0:59:0: [sdf] Write Protect is off
[26775.892457] sd 2:0:59:0: [sdf] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26775.892457] sd 2:0:59:0: [sdf] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26776.788901] sd 2:0:59:0: [sdf] Attached SCSI disk
[26776.788901] sd 2:0:59:0: [sdf] Attached SCSI disk
[26786.638978] hisi_sas_v3_hw 0000:74:02.0: phydown: phy6 phy_state=0xbf
[26786.638978] hisi_sas_v3_hw 0000:74:02.0: phydown: phy6 phy_state=0xbf
[26786.868652] sd 2:0:52:0: [sdg] Synchronizing SCSI cache
[26786.868652] sd 2:0:52:0: [sdg] Synchronizing SCSI cache
[26786.905217] sd 2:0:52:0: [sdg] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26786.905217] sd 2:0:52:0: [sdg] Synchronize Cache(10) failed: Result:
hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[26787.060205] hisi_sas_v3_hw 0000:74:02.0: dev[6:1] is gone
[26787.060205] hisi_sas_v3_hw 0000:74:02.0: dev[6:1] is gone
[26798.172445] hisi_sas_v3_hw 0000:74:02.0: phyup: phy6 link_rate=8
[26798.172445] hisi_sas_v3_hw 0000:74:02.0: phyup: phy6 link_rate=8
[26798.255947] hisi_sas_v3_hw 0000:74:02.0: dev[6:1] found
[26798.255947] hisi_sas_v3_hw 0000:74:02.0: dev[6:1] found
[26798.437811] scsi 2:0:60:0: Direct-Access SEAGATE ST300MM0008
N003 PQ: 0 ANSI: 6
[26798.437811] scsi 2:0:60:0: Direct-Access SEAGATE ST300MM0008
N003 PQ: 0 ANSI: 6
[26799.063474] sd 2:0:60:0: [sdg] 585937500 512-byte logical blocks:
(300 GB/279 GiB)
[26799.063474] sd 2:0:60:0: [sdg] 585937500 512-byte logical blocks:
(300 GB/279 GiB)
[26799.119535] sd 2:0:60:0: [sdg] Write Protect is off
[26799.119535] sd 2:0:60:0: [sdg] Write Protect is off
[26799.172090] sd 2:0:60:0: [sdg] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26799.172090] sd 2:0:60:0: [sdg] Write cache: enabled, read cache:
enabled, supports DPO and FUA
[26799.760024] sd 2:0:60:0: [sdg] Attached SCSI disk
[26799.760024] sd 2:0:60:0: [sdg] Attached SCSI disk
[26809.413584] hisi_sas_v3_hw 0000:74:02.0: phydown: phy7 phy_state=0x7f
[26809.413584] hisi_sas_v3_hw 0000:74:02.0: phydown: phy7 phy_state=0x7f
[26809.631741] sd 2:0:53:0: [sdh] Synchronizing SCSI cache
[26809.631741] sd 2:0:53:0: [sdh] Synchronizing SCSI cache
^ permalink raw reply
* Re: about warning in ata_eh_finish()
From: Tejun Heo @ 2017-12-20 17:36 UTC (permalink / raw)
To: Jason Yan; +Cc: linux-ide
In-Reply-To: <5A39FF85.1040904@huawei.com>
On Wed, Dec 20, 2017 at 02:13:25PM +0800, Jason Yan wrote:
> Hi, Tejun,
>
> We often see this warning when using sata disks with libsas:
>
> [26705.760518] WARNING: CPU: 1 PID: 6796 at
> drivers/ata/libata-eh.c:4037 ata_eh_finish+0xb4/0xcc
>
> [26706.350156] [<ffff0000088baf70>] ata_eh_finish+0xb4/0xcc
> [26706.364260] [<ffff0000088bb764>] ata_do_eh+0x68/0xd8
> [26706.377497] [<ffff0000088bb818>] ata_std_error_handler+0x44/0x8c
> [26706.393406] [<ffff0000088bb408>] ata_scsi_port_error_handler+0x480/0x694
> [26706.411352] [<ffff000008879364>] async_sas_ata_eh+0x4c/0x80
> [26706.426133] [<ffff0000080f6be8>] async_run_entry_fn+0x4c/0x170
> [26706.441841] [<ffff0000080ebd70>] process_one_work+0x144/0x390
> [26706.457057] [<ffff0000080ec100>] worker_thread+0x144/0x418
> [26706.471610] [<ffff0000080f2c98>] kthread+0x10c/0x138
> [26706.484991] [<ffff0000080855dc>] ret_from_fork+0x10/0x18
>
> This seems implies that ap->nr_active_links is wrong and should be zero.
> But I didn't see any other errors. The disks work well.
Which kernel version are you running on what sort of device? Can you
post the full log?
Thanks.
--
tejun
^ permalink raw reply
* about warning in ata_eh_finish()
From: Jason Yan @ 2017-12-20 6:13 UTC (permalink / raw)
To: tj, linux-ide
Hi, Tejun,
We often see this warning when using sata disks with libsas:
[26705.760518] WARNING: CPU: 1 PID: 6796 at drivers/ata/libata-eh.c:4037
ata_eh_finish+0xb4/0xcc
[26706.350156] [<ffff0000088baf70>] ata_eh_finish+0xb4/0xcc
[26706.364260] [<ffff0000088bb764>] ata_do_eh+0x68/0xd8
[26706.377497] [<ffff0000088bb818>] ata_std_error_handler+0x44/0x8c
[26706.393406] [<ffff0000088bb408>] ata_scsi_port_error_handler+0x480/0x694
[26706.411352] [<ffff000008879364>] async_sas_ata_eh+0x4c/0x80
[26706.426133] [<ffff0000080f6be8>] async_run_entry_fn+0x4c/0x170
[26706.441841] [<ffff0000080ebd70>] process_one_work+0x144/0x390
[26706.457057] [<ffff0000080ec100>] worker_thread+0x144/0x418
[26706.471610] [<ffff0000080f2c98>] kthread+0x10c/0x138
[26706.484991] [<ffff0000080855dc>] ret_from_fork+0x10/0x18
This seems implies that ap->nr_active_links is wrong and should be zero.
But I didn't see any other errors. The disks work well.
Question:
ap->nr_active_links seems can be modified by different cpus
simultaneously, should it be atomic_t? Is this the reason of the warning
above?
^ permalink raw reply
* Re: [PATCH V4 10/26] Drivers: ide: deprecate pci_get_bus_and_slot()
From: David Miller @ 2017-12-19 14:13 UTC (permalink / raw)
To: okaya
Cc: linux-pci, timur, linux-arm-msm, linux-arm-kernel, linux-ide,
linux-kernel
In-Reply-To: <1513661883-28662-11-git-send-email-okaya@codeaurora.org>
From: Sinan Kaya <okaya@codeaurora.org>
Date: Tue, 19 Dec 2017 00:37:46 -0500
> pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
> where a PCI device is present. This restricts the device drivers to be
> reused for other domain numbers.
>
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
>
> Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
> and extract the domain number from struct pci_dev.
>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH] libata: apply MAX_SEC_1024 to all LITEON EP1 series devices
From: Tejun Heo @ 2017-12-19 13:30 UTC (permalink / raw)
To: Xinyu Lin; +Cc: linux-ide
In-Reply-To: <20171217121339.7772-1-xinyu0123@gmail.com>
On Sun, Dec 17, 2017 at 08:13:39PM +0800, Xinyu Lin wrote:
> LITEON EP1 has the same timeout issues as CX1 series devices.
>
> Revert max_sectors to the value of 1024.
>
> 'e0edc8c54646 ("libata: apply MAX_SEC_1024 to all CX1-JB*-HP devices")'
>
> Signed-off-by: Xinyu Lin <xinyu0123@gmail.com>
Applied to libata/for-4.15-fixes.
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH] sata: rcar_sata: Reset SATA PHY when Salvator-X board resumes
From: Simon Horman @ 2017-12-19 8:26 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Yoshihiro Kaneko, linux-ide@vger.kernel.org, Tejun Heo,
Magnus Damm, Geert Uytterhoeven, Linux-Renesas
In-Reply-To: <CAMuHMdXXa5pA7eXrmEamKXY_v8t2LKSq7bA6ysH5S2Pqq-b5aA@mail.gmail.com>
On Wed, Dec 06, 2017 at 07:56:09PM +0100, Geert Uytterhoeven wrote:
> Hi Kaneko-san,
>
> On Wed, Dec 6, 2017 at 7:45 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> > From: Khiem Nguyen <khiem.nguyen.xt@rvc.renesas.com>
> >
> > Because power of Salvator-X board is cut off in suspend,
> > it needs to reset SATA PHY state in resume.
> > Otherwise, SATA partition could not be accessed anymore.
>
> Thanks for your patch!
>
> So this is needed on R-Car Gen3 only.
>
> > --- a/drivers/ata/sata_rcar.c
> > +++ b/drivers/ata/sata_rcar.c
> > @@ -977,11 +977,43 @@ static int sata_rcar_resume(struct device *dev)
> > struct sata_rcar_priv *priv = host->private_data;
> > void __iomem *base = priv->base;
> > int ret;
> > + u32 val;
> >
> > ret = clk_prepare_enable(priv->clk);
> > if (ret)
> > return ret;
> >
> > + /* Re-use from sata_rcar_init_controller() */
> > + /* reset and setup phy */
> > + switch (priv->type) {
> > + case RCAR_GEN1_SATA:
> > + sata_rcar_gen1_phy_init(priv);
>
> Hence why do this (and the below) on R-Car Gen1, too?
>
> > + break;
> > + case RCAR_GEN2_SATA:
> > + sata_rcar_gen2_phy_init(priv);
>
> And on both R-Car Gen2 and Gen3 (currently Gen3 is treated like Gen2
> everywhere in the driver)?
> What about introducing RCAR_GEN3_SATA, and doing the reinit on R-Car Gen3
> only?
Agreed, that seems to make sense.
Kaneko-san, could you look into implementing this?
>
> > + break;
> > + default:
> > + dev_warn(host->dev, "SATA phy is not initialized\n");
> > + break;
> > + }
>
> [...]
>
> 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
>
^ permalink raw reply
* [PATCH V4 10/26] Drivers: ide: deprecate pci_get_bus_and_slot()
From: Sinan Kaya @ 2017-12-19 5:37 UTC (permalink / raw)
To: linux-pci, timur
Cc: linux-arm-msm, linux-arm-kernel, Sinan Kaya, David S. Miller,
open list:IDE SUBSYSTEM, open list
In-Reply-To: <1513661883-28662-1-git-send-email-okaya@codeaurora.org>
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.
Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().
Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
drivers/ide/sl82c105.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c
index 8755df3..3300dac 100644
--- a/drivers/ide/sl82c105.c
+++ b/drivers/ide/sl82c105.c
@@ -239,8 +239,9 @@ static u8 sl82c105_bridge_revision(struct pci_dev *dev)
/*
* The bridge should be part of the same device, but function 0.
*/
- bridge = pci_get_bus_and_slot(dev->bus->number,
- PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
+ bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus),
+ dev->bus->number,
+ PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
if (!bridge)
return -1;
--
1.9.1
^ permalink raw reply related
* [PATCH V4 04/26] ata: deprecate pci_get_bus_and_slot()
From: Sinan Kaya @ 2017-12-19 5:37 UTC (permalink / raw)
To: linux-pci, timur
Cc: linux-arm-msm, linux-arm-kernel, Sinan Kaya,
Bartlomiej Zolnierkiewicz, Tejun Heo,
open list:LIBATA PATA DRIVERS, open list
In-Reply-To: <1513661883-28662-1-git-send-email-okaya@codeaurora.org>
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.
Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().
Use pci_get_domain_bus_and_slot() and extract the actual domain number
from the pdev passed in.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Acked-by: Tejun Heo <tj@kernel.org>
---
drivers/ata/pata_ali.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index d19cd88..0b122f9 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -466,7 +466,8 @@ static void ali_init_chipset(struct pci_dev *pdev)
tmp |= 0x01; /* CD_ROM enable for DMA */
pci_write_config_byte(pdev, 0x53, tmp);
}
- north = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
+ north = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), 0,
+ PCI_DEVFN(0, 0));
if (north && north->vendor == PCI_VENDOR_ID_AL && ali_isa_bridge) {
/* Configure the ALi bridge logic. For non ALi rely on BIOS.
Set the south bridge enable bit */
--
1.9.1
^ permalink raw reply related
* Re: Distress Call Please don't ignore
From: Sandra Younes @ 2017-12-18 21:44 UTC (permalink / raw)
Good Day,
Forgive my indignation if this message comes to you as a surprise and may offend your personality for contacting you without your prior consent and writing through this channel.
I came across your name and contact on the course of my personal searching when i was searching for a foreign reliable partner. I was assured of your capability and reliability after going true your profile.
I'm (Miss. Sandra) from Benghazi libya, My father of blessed memory by name late General Abdel Fattah Younes who was shot death by Islamist-linked militia within the anti-Gaddafi forces on 28th July, 2011 and after two days later my mother with my two brothers was killed one early morning by the rebels as result of civil war that is going on in my country Libya, then after the burial of my parents, my uncles conspired and sold my father's properties and left nothing for me. On a faithful morning, I opened my father's briefcase and discover a document which he has deposited ($6.250M USD) in a bank in a Turkish Bank which has a small branch in Canada with my name as the legitimate/next of kin. Meanwhile i have located the bank,and have also discussed the possiblity of transfering the fund. M
y father left a clause to the bank that i must introduce a trusted foreign partner who would be my trustee to help me invest this fund; hence the need for your assistance,i request that you be my t
rustee and assist me in e
You will also be responsible for the investment and management of the fund for me and also you will help me get a good school where i will further my education.
I agreed to give you 40% of the $6.250M once the transfer is done. this is my true life story, I will be glad to receive your respond soonest for more details to enable us start and champion the transfer less than 14 banking days as i was informed by the bank manager.
Thanks for giving me your attention,
Yours sincerely,
Miss. Sandra Younes
^ permalink raw reply
* [PATCH] libata: apply MAX_SEC_1024 to all LITEON EP1 series devices
From: Xinyu Lin @ 2017-12-17 12:13 UTC (permalink / raw)
To: tj; +Cc: linux-ide, xinyu0123
LITEON EP1 has the same timeout issues as CX1 series devices.
Revert max_sectors to the value of 1024.
'e0edc8c54646 ("libata: apply MAX_SEC_1024 to all CX1-JB*-HP devices")'
Signed-off-by: Xinyu Lin <xinyu0123@gmail.com>
---
drivers/ata/libata-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2a882929de4a..ca52a15af077 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4443,6 +4443,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
* https://bugzilla.kernel.org/show_bug.cgi?id=121671
*/
{ "LITEON CX1-JB*-HP", NULL, ATA_HORKAGE_MAX_SEC_1024 },
+ { "LITEON EP1-*", NULL, ATA_HORKAGE_MAX_SEC_1024 },
/* Devices we expect to fail diagnostics */
--
2.14.1
^ permalink raw reply related
* [PATCH 0/6] Fix cdrom autoclose
From: Michal Suchanek @ 2017-12-14 15:13 UTC (permalink / raw)
To: Jens Axboe, Jonathan Corbet, Borislav Petkov, Tim Waugh,
David S. Miller, James E.J. Bottomley, Martin K. Petersen,
Michal Suchanek, Christophe JAILLET, Kees Cook, John Stultz,
Thomas Gleixner, Russell King, Greg Kroah-Hartman,
Philippe Ombredanne, linux-doc, linux-kernel, linux-ide,
linux-scsi
Hello,
there is cdrom autoclose feature that is supposed to close the tray, wait for
the disc to become ready, and then open the device.
This used to work in ancient times. Then in old times there was a hack in
util-linux which worked around the breakage which probably resulted from
switching to scsi emulation.
Currently util-linux maintainer refuses to merge another hack on the basis that
kernel still has the feature so it should be fixed there. Indeed, to implement
this feature effectively from userspace one would need to know when the CD-ROM
is in the "drive becoming ready" state which is knowledge that never leaves the
hardware-specific driver and is passed neither to userspace nor the generic
cdrom driver.
So this patchset fixes the kernel autoclose implementation in cdrom.c and to
do so reports the "drive becoming ready" state from the harware specific
drivers.
Michal Suchanek (6):
delay: add poll_event_interruptible
cdrom: factor out common open_for_* code
cdrom: wait for tray to close
cdrom: introduce CDS_DRIVE_ERROR
Documentetion: cdrom: introduce CDS_DRIVE_ERROR
cdrom: wait for drive to become ready
Documentation/cdrom/cdrom-standard.tex | 8 ++-
Documentation/cdrom/ide-cd | 6 ++
Documentation/ioctl/cdrom.txt | 1 +
drivers/block/paride/pcd.c | 2 +-
drivers/cdrom/cdrom.c | 124 ++++++++++++++++-----------------
drivers/cdrom/gdrom.c | 2 +-
drivers/ide/ide-cd_ioctl.c | 12 ++--
drivers/scsi/sr_ioctl.c | 2 +-
include/linux/delay.h | 12 ++++
include/uapi/linux/cdrom.h | 1 +
10 files changed, 99 insertions(+), 71 deletions(-)
--
2.13.6
^ permalink raw reply
* [PATCH 5/6] Documentetion: cdrom: introduce CDS_DRIVE_ERROR
From: Michal Suchanek @ 2017-12-14 15:13 UTC (permalink / raw)
To: Tim Waugh, Borislav Petkov, David S. Miller, Jens Axboe,
James E.J. Bottomley, Martin K. Petersen, Michal Suchanek,
Kees Cook, Christophe JAILLET, linux-kernel, linux-ide,
linux-scsi
In-Reply-To: <cover.1513263482.git.msuchanek@suse.de>
CDS_DRIVE_NOT_READY is used for the state in which CDROM is 'becoming
ready' (typically analyzing the disc) but also as the fallback when
nothing else applies. Introduce CDS_DRIVE_ERROR for the fallback case.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
Documentation/cdrom/cdrom-standard.tex | 8 +++++++-
Documentation/cdrom/ide-cd | 6 ++++++
Documentation/ioctl/cdrom.txt | 1 +
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/Documentation/cdrom/cdrom-standard.tex b/Documentation/cdrom/cdrom-standard.tex
index 8f85b0e41046..018284ba696a 100644
--- a/Documentation/cdrom/cdrom-standard.tex
+++ b/Documentation/cdrom/cdrom-standard.tex
@@ -371,11 +371,17 @@ $$
CDS_NO_INFO& no information available\cr
CDS_NO_DISC& no disc is inserted, tray is closed\cr
CDS_TRAY_OPEN& tray is opened\cr
-CDS_DRIVE_NOT_READY& something is wrong, tray is moving?\cr
+CDS_DRIVE_NOT_READY& tray just closed?\cr
CDS_DISC_OK& a disc is loaded and everything is fine\cr
+CDS_DRIVE_ERROR& something is wrong\cr
}
$$
+Note: The IDE and SCSI cdroms have a status code 'drive becoming ready' which
+is typically returned when the drive has just closed and is analyzing the disc.
+For other cdrom types this state is not reported by the hardware or not
+implemented by the driver.
+
\subsection{$Int\ media_changed(struct\ cdrom_device_info * cdi, int\ disc_nr)$}
This function is very similar to the original function in $struct\
diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd
index a5f2a7f1ff46..9324a8fd9a39 100644
--- a/Documentation/cdrom/ide-cd
+++ b/Documentation/cdrom/ide-cd
@@ -455,6 +455,9 @@ main (int argc, char **argv)
case CDS_DRIVE_NOT_READY:
printf ("Drive Not Ready.\n");
break;
+ case CDS_DRIVE_ERROR:
+ printf ("Drive problem.\n");
+ break;
default:
printf ("This Should not happen!\n");
break;
@@ -481,6 +484,9 @@ main (int argc, char **argv)
case CDS_NO_INFO:
printf ("No Information available.");
break;
+ case CDS_DRIVE_ERROR:
+ printf ("Drive problem.\n");
+ break;
default:
printf ("This Should not happen!\n");
break;
diff --git a/Documentation/ioctl/cdrom.txt b/Documentation/ioctl/cdrom.txt
index a4d62a9d6771..7720d11807c3 100644
--- a/Documentation/ioctl/cdrom.txt
+++ b/Documentation/ioctl/cdrom.txt
@@ -700,6 +700,7 @@ CDROM_DRIVE_STATUS Get tray position, etc.
CDS_TRAY_OPEN
CDS_DRIVE_NOT_READY
CDS_DISC_OK
+ CDS_DRIVE_ERROR
-1 error
error returns:
--
2.13.6
^ permalink raw reply related
* Re: When will Linux support new RAID controllers
From: David F. @ 2017-12-13 20:20 UTC (permalink / raw)
To: Dennis Mungai
Cc: Alan Cox, Christoph Hellwig, linux-raid@vger.kernel.org,
linux-ide, Dan Williams, linux-nvme
In-Reply-To: <CAKKYfmGbz5wpU3pAY2rTsuY=e9DsDW=FgTqrbf-shu7TDg1mnA@mail.gmail.com>
Where is the code/patch that was released? If nobody knows about it,
nobody can work on it.
"I am not aware of anyone in Intel working on it or planning to work on it
at this point. Nothing stops someone outside of Intel doing that from the
code that was released."
On Thu, Dec 7, 2017 at 6:18 AM, Dennis Mungai <dmngaie@gmail.com> wrote:
> Eventually, a driver will roll out. The question is when.
>
>
>
> On 7 December 2017 at 17:16, Alan Cox <gnomes@lxorguk.ukuu.org.uk> wrote:
>> On Mon, 4 Dec 2017 18:01:10 -0800
>> "David F." <df7729@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Any word if the patch is available?
>>>
>>> Is this going mainline anytime soon?
>>
>> I am not aware of anyone in Intel working on it or planning to work on it
>> at this point. Nothing stops someone outside of Intel doing that from the
>> code that was released.
>>
>> For things that need BIOS changes whatever the vendor my experience has
>> always been that you make the most impact by talking to the actual system
>> vendor (who controls the BIOS), including telling them why you didn't buy
>> their machine. At the end of the day businesses make decisions based on
>> dollars.
>>
>> Alan
^ permalink raw reply
* [GIT PULL] libata fixes for v4.15-rc3
From: Tejun Heo @ 2017-12-11 21:51 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-ide, linux-kernel
Hello, Linus.
Nothing too interesting. David Milburn improved a corner case
misbehavior during hotplug. Other than that, minor driver-specific
fixes.
Thanks.
The following changes since commit 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323:
Linux 4.15-rc1 (2017-11-26 16:01:47 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git for-4.15-fixes
for you to fetch changes up to 2dc0b46b5ea30f169b0b272253ea846a5a281731:
libata: sata_down_spd_limit should return if driver has not recorded sstatus speed (2017-12-04 13:57:03 -0800)
----------------------------------------------------------------
Albert Pool (1):
ata: mediatek: Fix typo in module description
Arvind Yadav (2):
pata_pdc2027x: Remove unnecessary error check
pata_pdc2027x : make pdc2027x_*_timing structures const
David Milburn (1):
libata: sata_down_spd_limit should return if driver has not recorded sstatus speed
Matthias Brugger (1):
ahci: mtk: Change driver name to ahci-mtk
Yuantian Tang (1):
ahci: qoriq: refine port register configuration
drivers/ata/ahci_mtk.c | 6 +++---
drivers/ata/ahci_qoriq.c | 12 ++++++++++++
drivers/ata/libata-core.c | 12 +++++++++---
drivers/ata/pata_pdc2027x.c | 16 ++++++----------
4 files changed, 30 insertions(+), 16 deletions(-)
--
tejun
^ permalink raw reply
* Re: [PATCH v2] ahci: Allow setting a default LPM policy for mobile chipsets
From: Tejun Heo @ 2017-12-11 16:54 UTC (permalink / raw)
To: Hans de Goede; +Cc: linux-ide, linux-kernel
In-Reply-To: <20171211165216.5604-1-hdegoede@redhat.com>
On Mon, Dec 11, 2017 at 05:52:16PM +0100, Hans de Goede wrote:
> On many laptops setting a different LPM policy then unknown /
> max_performance can lead to power-savings of 1.0 - 1.5 Watts (when idle).
>
> Modern ultrabooks idle around 6W (at 50% screen brightness), 1.0 - 1.5W
> is a significant chunk of this.
>
> There are some performance / latency costs to enabling LPM by default,
> so it is desirable to make it possible to set a different LPM policy
> for mobile / laptop variants of chipsets / "South Bridges" vs their
> desktop / server counterparts. Also enabling LPM by default is not
> entirely without risk of regressions. At least min_power is known to
> cause issues with some disks, including some reports of data corruption.
>
> This commits adds a new ahci.mobile_lpm_policy kernel cmdline option,
> which defaults to a new SATA_MOBILE_LPM_POLICY Kconfig option so that
> Linux distributions can choose to set a LPM policy for mobile chipsets
> by default.
>
> The reason to have both a kernel cmdline option and a Kconfig default
> value for it, is to allow easy overriding of the default to allow
> trouble-shooting without needing to rebuild the kernel.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Applied to libata/for-4.16.
Thanks, Hans.
--
tejun
^ permalink raw reply
* [PATCH v2] ahci: Allow setting a default LPM policy for mobile chipsets
From: Hans de Goede @ 2017-12-11 16:52 UTC (permalink / raw)
To: Tejun Heo; +Cc: Hans de Goede, linux-ide, linux-kernel
On many laptops setting a different LPM policy then unknown /
max_performance can lead to power-savings of 1.0 - 1.5 Watts (when idle).
Modern ultrabooks idle around 6W (at 50% screen brightness), 1.0 - 1.5W
is a significant chunk of this.
There are some performance / latency costs to enabling LPM by default,
so it is desirable to make it possible to set a different LPM policy
for mobile / laptop variants of chipsets / "South Bridges" vs their
desktop / server counterparts. Also enabling LPM by default is not
entirely without risk of regressions. At least min_power is known to
cause issues with some disks, including some reports of data corruption.
This commits adds a new ahci.mobile_lpm_policy kernel cmdline option,
which defaults to a new SATA_MOBILE_LPM_POLICY Kconfig option so that
Linux distributions can choose to set a LPM policy for mobile chipsets
by default.
The reason to have both a kernel cmdline option and a Kconfig default
value for it, is to allow easy overriding of the default to allow
trouble-shooting without needing to rebuild the kernel.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Remove .config changes from the patch
---
drivers/ata/Kconfig | 19 +++++++++++
drivers/ata/ahci.c | 97 +++++++++++++++++++++++++++++++----------------------
drivers/ata/ahci.h | 3 ++
3 files changed, 78 insertions(+), 41 deletions(-)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index cb5339166563..b3fad5663aeb 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -92,6 +92,25 @@ config SATA_AHCI
If unsure, say N.
+config SATA_MOBILE_LPM_POLICY
+ int "Default SATA Link Power Management policy for mobile chipsets"
+ range 0 4
+ default 0
+ depends on SATA_AHCI
+ help
+ Select the Default SATA Link Power Management (LPM) policy to use
+ for mobile / laptop variants of chipsets / "South Bridges".
+
+ The value set has the following meanings:
+ 0 => Keep firmware settings
+ 1 => Maximum performance
+ 2 => Medium power
+ 3 => Medium power with Device Initiated PM enabled
+ 4 => Minimum power
+
+ Note "Minimum power" is known to cause issues, including disk
+ corruption, with some disks and should not be used.
+
config SATA_AHCI_PLATFORM
tristate "Platform AHCI SATA support"
help
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 844f697bedbf..8e910fae8892 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -65,6 +65,7 @@ enum board_ids {
/* board IDs by feature in alphabetical order */
board_ahci,
board_ahci_ign_iferr,
+ board_ahci_mobile,
board_ahci_nomsi,
board_ahci_noncq,
board_ahci_nosntf,
@@ -140,6 +141,13 @@ static const struct ata_port_info ahci_port_info[] = {
.udma_mask = ATA_UDMA6,
.port_ops = &ahci_ops,
},
+ [board_ahci_mobile] = {
+ AHCI_HFLAGS (AHCI_HFLAG_IS_MOBILE),
+ .flags = AHCI_FLAG_COMMON,
+ .pio_mask = ATA_PIO4,
+ .udma_mask = ATA_UDMA6,
+ .port_ops = &ahci_ops,
+ },
[board_ahci_nomsi] = {
AHCI_HFLAGS (AHCI_HFLAG_NO_MSI),
.flags = AHCI_FLAG_COMMON,
@@ -252,13 +260,13 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x2924), board_ahci }, /* ICH9 */
{ PCI_VDEVICE(INTEL, 0x2925), board_ahci }, /* ICH9 */
{ PCI_VDEVICE(INTEL, 0x2927), board_ahci }, /* ICH9 */
- { PCI_VDEVICE(INTEL, 0x2929), board_ahci }, /* ICH9M */
- { PCI_VDEVICE(INTEL, 0x292a), board_ahci }, /* ICH9M */
- { PCI_VDEVICE(INTEL, 0x292b), board_ahci }, /* ICH9M */
- { PCI_VDEVICE(INTEL, 0x292c), board_ahci }, /* ICH9M */
- { PCI_VDEVICE(INTEL, 0x292f), board_ahci }, /* ICH9M */
+ { PCI_VDEVICE(INTEL, 0x2929), board_ahci_mobile }, /* ICH9M */
+ { PCI_VDEVICE(INTEL, 0x292a), board_ahci_mobile }, /* ICH9M */
+ { PCI_VDEVICE(INTEL, 0x292b), board_ahci_mobile }, /* ICH9M */
+ { PCI_VDEVICE(INTEL, 0x292c), board_ahci_mobile }, /* ICH9M */
+ { PCI_VDEVICE(INTEL, 0x292f), board_ahci_mobile }, /* ICH9M */
{ PCI_VDEVICE(INTEL, 0x294d), board_ahci }, /* ICH9 */
- { PCI_VDEVICE(INTEL, 0x294e), board_ahci }, /* ICH9M */
+ { PCI_VDEVICE(INTEL, 0x294e), board_ahci_mobile }, /* ICH9M */
{ PCI_VDEVICE(INTEL, 0x502a), board_ahci }, /* Tolapai */
{ PCI_VDEVICE(INTEL, 0x502b), board_ahci }, /* Tolapai */
{ PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */
@@ -268,9 +276,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x3b23), board_ahci }, /* PCH AHCI */
{ PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */
{ PCI_VDEVICE(INTEL, 0x3b25), board_ahci }, /* PCH RAID */
- { PCI_VDEVICE(INTEL, 0x3b29), board_ahci }, /* PCH M AHCI */
+ { PCI_VDEVICE(INTEL, 0x3b29), board_ahci_mobile }, /* PCH M AHCI */
{ PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */
- { PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH M RAID */
+ { PCI_VDEVICE(INTEL, 0x3b2c), board_ahci_mobile }, /* PCH M RAID */
{ PCI_VDEVICE(INTEL, 0x3b2f), board_ahci }, /* PCH AHCI */
{ PCI_VDEVICE(INTEL, 0x19b0), board_ahci }, /* DNV AHCI */
{ PCI_VDEVICE(INTEL, 0x19b1), board_ahci }, /* DNV AHCI */
@@ -293,9 +301,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x19cE), board_ahci }, /* DNV AHCI */
{ PCI_VDEVICE(INTEL, 0x19cF), board_ahci }, /* DNV AHCI */
{ PCI_VDEVICE(INTEL, 0x1c02), board_ahci }, /* CPT AHCI */
- { PCI_VDEVICE(INTEL, 0x1c03), board_ahci }, /* CPT M AHCI */
+ { PCI_VDEVICE(INTEL, 0x1c03), board_ahci_mobile }, /* CPT M AHCI */
{ PCI_VDEVICE(INTEL, 0x1c04), board_ahci }, /* CPT RAID */
- { PCI_VDEVICE(INTEL, 0x1c05), board_ahci }, /* CPT M RAID */
+ { PCI_VDEVICE(INTEL, 0x1c05), board_ahci_mobile }, /* CPT M RAID */
{ PCI_VDEVICE(INTEL, 0x1c06), board_ahci }, /* CPT RAID */
{ PCI_VDEVICE(INTEL, 0x1c07), board_ahci }, /* CPT RAID */
{ PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */
@@ -304,28 +312,28 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x2826), board_ahci }, /* PBG RAID */
{ PCI_VDEVICE(INTEL, 0x2323), board_ahci }, /* DH89xxCC AHCI */
{ PCI_VDEVICE(INTEL, 0x1e02), board_ahci }, /* Panther Point AHCI */
- { PCI_VDEVICE(INTEL, 0x1e03), board_ahci }, /* Panther Point M AHCI */
+ { PCI_VDEVICE(INTEL, 0x1e03), board_ahci_mobile }, /* Panther M AHCI */
{ PCI_VDEVICE(INTEL, 0x1e04), board_ahci }, /* Panther Point RAID */
{ PCI_VDEVICE(INTEL, 0x1e05), board_ahci }, /* Panther Point RAID */
{ PCI_VDEVICE(INTEL, 0x1e06), board_ahci }, /* Panther Point RAID */
- { PCI_VDEVICE(INTEL, 0x1e07), board_ahci }, /* Panther Point M RAID */
+ { PCI_VDEVICE(INTEL, 0x1e07), board_ahci_mobile }, /* Panther M RAID */
{ PCI_VDEVICE(INTEL, 0x1e0e), board_ahci }, /* Panther Point RAID */
{ PCI_VDEVICE(INTEL, 0x8c02), board_ahci }, /* Lynx Point AHCI */
- { PCI_VDEVICE(INTEL, 0x8c03), board_ahci }, /* Lynx Point M AHCI */
+ { PCI_VDEVICE(INTEL, 0x8c03), board_ahci_mobile }, /* Lynx M AHCI */
{ PCI_VDEVICE(INTEL, 0x8c04), board_ahci }, /* Lynx Point RAID */
- { PCI_VDEVICE(INTEL, 0x8c05), board_ahci }, /* Lynx Point M RAID */
+ { PCI_VDEVICE(INTEL, 0x8c05), board_ahci_mobile }, /* Lynx M RAID */
{ PCI_VDEVICE(INTEL, 0x8c06), board_ahci }, /* Lynx Point RAID */
- { PCI_VDEVICE(INTEL, 0x8c07), board_ahci }, /* Lynx Point M RAID */
+ { PCI_VDEVICE(INTEL, 0x8c07), board_ahci_mobile }, /* Lynx M RAID */
{ PCI_VDEVICE(INTEL, 0x8c0e), board_ahci }, /* Lynx Point RAID */
- { PCI_VDEVICE(INTEL, 0x8c0f), board_ahci }, /* Lynx Point M RAID */
- { PCI_VDEVICE(INTEL, 0x9c02), board_ahci }, /* Lynx Point-LP AHCI */
- { PCI_VDEVICE(INTEL, 0x9c03), board_ahci }, /* Lynx Point-LP AHCI */
- { PCI_VDEVICE(INTEL, 0x9c04), board_ahci }, /* Lynx Point-LP RAID */
- { PCI_VDEVICE(INTEL, 0x9c05), board_ahci }, /* Lynx Point-LP RAID */
- { PCI_VDEVICE(INTEL, 0x9c06), board_ahci }, /* Lynx Point-LP RAID */
- { PCI_VDEVICE(INTEL, 0x9c07), board_ahci }, /* Lynx Point-LP RAID */
- { PCI_VDEVICE(INTEL, 0x9c0e), board_ahci }, /* Lynx Point-LP RAID */
- { PCI_VDEVICE(INTEL, 0x9c0f), board_ahci }, /* Lynx Point-LP RAID */
+ { PCI_VDEVICE(INTEL, 0x8c0f), board_ahci_mobile }, /* Lynx M RAID */
+ { PCI_VDEVICE(INTEL, 0x9c02), board_ahci_mobile }, /* Lynx LP AHCI */
+ { PCI_VDEVICE(INTEL, 0x9c03), board_ahci_mobile }, /* Lynx LP AHCI */
+ { PCI_VDEVICE(INTEL, 0x9c04), board_ahci_mobile }, /* Lynx LP RAID */
+ { PCI_VDEVICE(INTEL, 0x9c05), board_ahci_mobile }, /* Lynx LP RAID */
+ { PCI_VDEVICE(INTEL, 0x9c06), board_ahci_mobile }, /* Lynx LP RAID */
+ { PCI_VDEVICE(INTEL, 0x9c07), board_ahci_mobile }, /* Lynx LP RAID */
+ { PCI_VDEVICE(INTEL, 0x9c0e), board_ahci_mobile }, /* Lynx LP RAID */
+ { PCI_VDEVICE(INTEL, 0x9c0f), board_ahci_mobile }, /* Lynx LP RAID */
{ PCI_VDEVICE(INTEL, 0x1f22), board_ahci }, /* Avoton AHCI */
{ PCI_VDEVICE(INTEL, 0x1f23), board_ahci }, /* Avoton AHCI */
{ PCI_VDEVICE(INTEL, 0x1f24), board_ahci }, /* Avoton RAID */
@@ -353,26 +361,26 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x8d66), board_ahci }, /* Wellsburg RAID */
{ PCI_VDEVICE(INTEL, 0x8d6e), board_ahci }, /* Wellsburg RAID */
{ PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */
- { PCI_VDEVICE(INTEL, 0x9c83), board_ahci }, /* Wildcat Point-LP AHCI */
- { PCI_VDEVICE(INTEL, 0x9c85), board_ahci }, /* Wildcat Point-LP RAID */
- { PCI_VDEVICE(INTEL, 0x9c87), board_ahci }, /* Wildcat Point-LP RAID */
- { PCI_VDEVICE(INTEL, 0x9c8f), board_ahci }, /* Wildcat Point-LP RAID */
+ { PCI_VDEVICE(INTEL, 0x9c83), board_ahci_mobile }, /* Wildcat LP AHCI */
+ { PCI_VDEVICE(INTEL, 0x9c85), board_ahci_mobile }, /* Wildcat LP RAID */
+ { PCI_VDEVICE(INTEL, 0x9c87), board_ahci_mobile }, /* Wildcat LP RAID */
+ { PCI_VDEVICE(INTEL, 0x9c8f), board_ahci_mobile }, /* Wildcat LP RAID */
{ PCI_VDEVICE(INTEL, 0x8c82), board_ahci }, /* 9 Series AHCI */
- { PCI_VDEVICE(INTEL, 0x8c83), board_ahci }, /* 9 Series M AHCI */
+ { PCI_VDEVICE(INTEL, 0x8c83), board_ahci_mobile }, /* 9 Series M AHCI */
{ PCI_VDEVICE(INTEL, 0x8c84), board_ahci }, /* 9 Series RAID */
- { PCI_VDEVICE(INTEL, 0x8c85), board_ahci }, /* 9 Series M RAID */
+ { PCI_VDEVICE(INTEL, 0x8c85), board_ahci_mobile }, /* 9 Series M RAID */
{ PCI_VDEVICE(INTEL, 0x8c86), board_ahci }, /* 9 Series RAID */
- { PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series M RAID */
+ { PCI_VDEVICE(INTEL, 0x8c87), board_ahci_mobile }, /* 9 Series M RAID */
{ PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */
- { PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series M RAID */
- { PCI_VDEVICE(INTEL, 0x9d03), board_ahci }, /* Sunrise Point-LP AHCI */
- { PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */
- { PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */
+ { PCI_VDEVICE(INTEL, 0x8c8f), board_ahci_mobile }, /* 9 Series M RAID */
+ { PCI_VDEVICE(INTEL, 0x9d03), board_ahci_mobile }, /* Sunrise LP AHCI */
+ { PCI_VDEVICE(INTEL, 0x9d05), board_ahci_mobile }, /* Sunrise LP RAID */
+ { PCI_VDEVICE(INTEL, 0x9d07), board_ahci_mobile }, /* Sunrise LP RAID */
{ PCI_VDEVICE(INTEL, 0xa102), board_ahci }, /* Sunrise Point-H AHCI */
- { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H M AHCI */
+ { PCI_VDEVICE(INTEL, 0xa103), board_ahci_mobile }, /* Sunrise M AHCI */
{ PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */
{ PCI_VDEVICE(INTEL, 0xa106), board_ahci }, /* Sunrise Point-H RAID */
- { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H M RAID */
+ { PCI_VDEVICE(INTEL, 0xa107), board_ahci_mobile }, /* Sunrise M RAID */
{ PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */
{ PCI_VDEVICE(INTEL, 0x2822), board_ahci }, /* Lewisburg RAID*/
{ PCI_VDEVICE(INTEL, 0x2823), board_ahci }, /* Lewisburg AHCI*/
@@ -386,10 +394,10 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0xa206), board_ahci }, /* Lewisburg RAID*/
{ PCI_VDEVICE(INTEL, 0xa252), board_ahci }, /* Lewisburg RAID*/
{ PCI_VDEVICE(INTEL, 0xa256), board_ahci }, /* Lewisburg RAID*/
- { PCI_VDEVICE(INTEL, 0x0f22), board_ahci }, /* Bay Trail AHCI */
- { PCI_VDEVICE(INTEL, 0x0f23), board_ahci }, /* Bay Trail AHCI */
- { PCI_VDEVICE(INTEL, 0x22a3), board_ahci }, /* Cherry Trail AHCI */
- { PCI_VDEVICE(INTEL, 0x5ae3), board_ahci }, /* Apollo Lake AHCI */
+ { PCI_VDEVICE(INTEL, 0x0f22), board_ahci_mobile }, /* Bay Trail AHCI */
+ { PCI_VDEVICE(INTEL, 0x0f23), board_ahci_mobile }, /* Bay Trail AHCI */
+ { PCI_VDEVICE(INTEL, 0x22a3), board_ahci_mobile }, /* Cherry Tr. AHCI */
+ { PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_mobile }, /* ApolloLake AHCI */
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
@@ -597,6 +605,9 @@ static int marvell_enable = 1;
module_param(marvell_enable, int, 0644);
MODULE_PARM_DESC(marvell_enable, "Marvell SATA via AHCI (1 = enabled)");
+static int mobile_lpm_policy = CONFIG_SATA_MOBILE_LPM_POLICY;
+module_param(mobile_lpm_policy, int, 0644);
+MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets");
static void ahci_pci_save_initial_config(struct pci_dev *pdev,
struct ahci_host_priv *hpriv)
@@ -1732,6 +1743,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ap->flags & ATA_FLAG_EM)
ap->em_message_type = hpriv->em_msg_type;
+ if ((hpriv->flags & AHCI_HFLAG_IS_MOBILE) &&
+ mobile_lpm_policy >= ATA_LPM_UNKNOWN &&
+ mobile_lpm_policy <= ATA_LPM_MIN_POWER)
+ ap->target_lpm_policy = mobile_lpm_policy;
/* disabled/not-implemented port */
if (!(hpriv->port_map & (1 << i)))
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 749fd94441b0..a9d996e17d75 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -251,6 +251,9 @@ enum {
AHCI_HFLAG_YES_ALPM = (1 << 23), /* force ALPM cap on */
AHCI_HFLAG_NO_WRITE_TO_RO = (1 << 24), /* don't write to read
only registers */
+ AHCI_HFLAG_IS_MOBILE = (1 << 25), /* mobile chipset, use
+ SATA_MOBILE_LPM_POLICY
+ as default lpm_policy */
/* ap->flags bits */
--
2.14.3
^ permalink raw reply related
* Re: [PATCH 3/3] ahci: Allow setting a default LPM policy for mobile chipsets
From: Hans de Goede @ 2017-12-11 16:29 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-kernel
In-Reply-To: <20171211144223.GB2421075@devbig577.frc2.facebook.com>
Hi,
On 11-12-17 15:42, Tejun Heo wrote:
> Hello, Hans.
>
> On Wed, Dec 06, 2017 at 04:41:10PM +0100, Hans de Goede wrote:
>> CONFIG_SATA_AHCI=y
>> +CONFIG_SATA_MOBILE_LPM_POLICY=3
>
> This would change the default behavior. Can we not do that?
Actually if you would try to apply this git will likely
complain that .config is not tracked by git. I'm tracking
my own personal .config in my own git-repo and the change
to that accidentally ended up in the commit/patch, my bad,
sorry.
I will submit a v2 with this fixed.
Regards,
Hans
^ permalink raw reply
* Re: [PATCH v5] pata_pdc2027x: Fix pdc_adjust_pll() to return the error value
From: Tejun Heo @ 2017-12-11 15:10 UTC (permalink / raw)
To: Arvind Yadav; +Cc: b.zolnierkie, linux-kernel, linux-ide
In-Reply-To: <8a90e02cc2ccca6277702b6b7ec8f5ca1f85ba4d.1512580696.git.arvind.yadav.cs@gmail.com>
On Wed, Dec 06, 2017 at 10:52:54PM +0530, Arvind Yadav wrote:
> This change is to ensure that function pdc_adjust_pll() returns the
> error value to avoid the unnecessary error check for pdc_hardware_init()
> in pdc2027x_reinit_one().
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Doesn't apply on libata/for-4.16.
Thanks.
--
tejun
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox