* Re: [PATCH v1 1/1] ata: sata_mv: Convert to devm_ioremap_resource()
From: Tejun Heo @ 2017-01-09 12:43 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Arvind Yadav, linux-ide
In-Reply-To: <20170108224922.147261-1-andriy.shevchenko@linux.intel.com>
On Mon, Jan 09, 2017 at 12:49:22AM +0200, Andy Shevchenko wrote:
> Convert to devm_ioremap_resource() which provides more consistent error
> handling.
>
> Note that devm_ioremap_resource() provides its own error messages.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied to libata/for-4.11.
Thanks.
--
tejun
^ permalink raw reply
* [PATCH v1 1/1] ata: sata_mv: Convert to devm_ioremap_resource()
From: Andy Shevchenko @ 2017-01-08 22:49 UTC (permalink / raw)
To: Tejun Heo, Arvind Yadav, linux-ide; +Cc: Andy Shevchenko
Convert to devm_ioremap_resource() which provides more consistent error
handling.
Note that devm_ioremap_resource() provides its own error messages.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/ata/sata_mv.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 2f32782cea6d..58fe0b846fed 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -4067,6 +4067,7 @@ static int mv_platform_probe(struct platform_device *pdev)
struct ata_host *host;
struct mv_host_priv *hpriv;
struct resource *res;
+ void __iomem *mmio;
int n_ports = 0, irq = 0;
int rc;
int port;
@@ -4085,8 +4086,9 @@ static int mv_platform_probe(struct platform_device *pdev)
* Get the register base first
*/
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res == NULL)
- return -EINVAL;
+ mmio = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(mmio))
+ return PTR_ERR(mmio);
/* allocate host */
if (pdev->dev.of_node) {
@@ -4130,12 +4132,7 @@ static int mv_platform_probe(struct platform_device *pdev)
hpriv->board_idx = chip_soc;
host->iomap = NULL;
- hpriv->base = devm_ioremap(&pdev->dev, res->start,
- resource_size(res));
- if (!hpriv->base)
- return -ENOMEM;
-
- hpriv->base -= SATAHC0_REG_BASE;
+ hpriv->base = mmio - SATAHC0_REG_BASE;
hpriv->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(hpriv->clk))
--
2.11.0
^ permalink raw reply related
* Re: [V1] ata: sata_mv:- Handle return value of devm_ioremap.
From: Andy Shevchenko @ 2017-01-08 22:08 UTC (permalink / raw)
To: Tejun Heo; +Cc: Arvind Yadav, linux-ide, linux-kernel@vger.kernel.org
In-Reply-To: <20170108184922.GC9403@mtj.duckdns.org>
On Sun, Jan 8, 2017 at 8:49 PM, Tejun Heo <tj@kernel.org> wrote:
> On Sat, Jan 07, 2017 at 12:52:57AM +0200, Andy Shevchenko wrote:
>> On Fri, Jan 6, 2017 at 10:46 PM, Tejun Heo <tj@kernel.org> wrote:
>> > On Mon, Dec 12, 2016 at 11:13:27PM +0530, Arvind Yadav wrote:
>> >> Here, If devm_ioremap will fail. It will return NULL.
>> >> Then hpriv->base = NULL - 0x20000; Kernel can run into
>> >> a NULL-pointer dereference. This error check will avoid
>> >> NULL pointer dereference.
>> >>
>> >> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> >
>> > Applied to libata/for-4.10-fixes.
>>
>> Hold on, why not to convert to devm_ioremap_resource() ?
>
> Care to send the patch?
Incremental or substitute?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [V1] ata: sata_mv:- Handle return value of devm_ioremap.
From: Tejun Heo @ 2017-01-08 18:49 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Arvind Yadav, linux-ide, linux-kernel@vger.kernel.org
In-Reply-To: <CAHp75Vf79R8H89npEPjbWkWqPXEKAiJ4Yru98T5nYK0x+FZuxw@mail.gmail.com>
On Sat, Jan 07, 2017 at 12:52:57AM +0200, Andy Shevchenko wrote:
> On Fri, Jan 6, 2017 at 10:46 PM, Tejun Heo <tj@kernel.org> wrote:
> > On Mon, Dec 12, 2016 at 11:13:27PM +0530, Arvind Yadav wrote:
> >> Here, If devm_ioremap will fail. It will return NULL.
> >> Then hpriv->base = NULL - 0x20000; Kernel can run into
> >> a NULL-pointer dereference. This error check will avoid
> >> NULL pointer dereference.
> >>
> >> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> >
> > Applied to libata/for-4.10-fixes.
>
> Hold on, why not to convert to devm_ioremap_resource() ?
Care to send the patch?
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH 1/3] ata: allow subsystem to be used on m68k arch
From: Christoph Hellwig @ 2017-01-08 10:08 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Christoph Hellwig, Tejun Heo, Geert Uytterhoeven, Michael Schmitz,
linux-ide, linux-m68k, linux-kernel
In-Reply-To: <3484511.F6TxDiWTi4@amdc3058>
On Fri, Dec 30, 2016 at 06:14:36PM +0100, Bartlomiej Zolnierkiewicz wrote:
> * m32r: I don't know why it was restricted but it builds fine nowadays
> (I will fix it later in incremental patch)
>
> * s390: no PATA hardware, legacy IDE subsystem is also not supported
s390 now has PCIe support, so PATA could be attached through a PCIe to
PCI bridge in theory. And while that is very theoretical not having
arch ifdefs is still something we should strive for, so I'd suggest
removing the condition entirely.
^ permalink raw reply
* RE: [LSF/MM TOPIC] status update on stream IDs
From: Changho Choi @ 2017-01-07 2:06 UTC (permalink / raw)
To: Andreas Dilger
Cc: lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
Kwan (Hingkwan) Huen
In-Reply-To: <87B8B7C67ECB1048AE5FA3C64D62B73E1CA9473A@SSIEXCH-MB3.ssi.samsung.com>
Hi Andreas,
Thanks for the heads up!
There has been big progress on it. It was ratified as a NVMe 1.3 standard in Oct 31st, 2016 in NVMe org(As you may already understand it was ratified as SCSI standard in T10 in May, 2015).
The standard compliant product is available for NVMe and SAS in the market.
Also Jens Axboe implemented the features in Kernel, etc.
We are more than happy to update the status in the meeting.
Also it would be a great time to revive the Linux Kernel implementation discussion to support both application-assigned stream ID and kernel-assigned stream ID at the same time.
I think people will start circulating the possible approaches sooner or later unless it is already started.
Thanks,
Changho
[resend to include other relevant lists]
On Jan 6, 2017, at 4:54 PM, Andreas Dilger <adilger@dilger.ca> wrote:
>
> At LSF/MM'16 and Linux FAST (https://lwn.net/Articles/685499/) there
> were discussions about adding stream IDs to the block/device layer to
> allow higher layers (filesystems, applications) to identify IO streams
> so lower layers (SSDs, hybrid storage, etc.) can make better allocation/placement decisions.
>
> It would be useful to get an update on the state of this work, and
> discuss any obstacles that need to be resolved for getting this code landed.
Cheers, Andreas
^ permalink raw reply
* RE: [LSF/MM TOPIC] status update on stream IDs
From: Kwan (Hingkwan) Huen @ 2017-01-07 1:38 UTC (permalink / raw)
To: Andreas Dilger, lsf-pc@lists.linux-foundation.org
Cc: linux-fsdevel, linux-block@vger.kernel.org,
linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org,
linux-ide@vger.kernel.org
In-Reply-To: <7B0B6B53-D692-4084-AC63-55138132F509@dilger.ca>
It's been a while since Jens posted the write stream ID patches.
https://lwn.net/Articles/679136/
As recall, these patches provide the framework enabling applications to write data along with the stream ID hint. Writes with the same stream ID indicate that data being written related to each other. This simple ID hint allows SSD to organize data more efficiently internally, resulting better performance of the device in the long run and longer device lifespan. However, without a mature spec describing how the device works, and a device that can be easily acquired for testing, these patches were too early back then.
With the new NVMe v1.3 spec draft available now, which includes the latest streams directive feature, and we already have the device available on hand, would like to bring this up again discuss this with the community for opinions. Here are some ideas we have in mind based on what's been done in Jens' patch from the link above. Any comments and suggestions are welcome and appreciated.
Jens' patches already provides the frame work that passes the stream ID from Application to kernel with new system call streamid(). What's needed is that the block device driver will need to pick up the stream ID from the bio and attached to the write command to the device. This completes the whole data path.
The stream management (enable/allocate/open/close, etc.) can go through functions mapped via backing device info (bdi) to allow same function all from application to manage streams in either a SCSI or NVMe device. The actual functions will be implemented in the block device driver and stream status and statistics can be stored, accessed and updated in gendisk struct.
If anyone wants kernel to assign the ID, the write requests will need to be intercepted to collect statistics of the workload pattern, run some algorithm that determines and applies the write requests to appropriate stream. Or Kernel maintainers would have already good idea for the stream ID assignment. In this case they can just implement it without adding extra stream detection modules. These can be done in the block device with stream mapping stored in gendisk struct.
Regards,
kwan
________________________________________
From: Linux-nvme [linux-nvme-bounces@lists.infradead.org] on behalf of Andreas Dilger [adilger@dilger.ca]
Sent: Friday, January 06, 2017 3:58 PM
To: lsf-pc@lists.linux-foundation.org
Cc: linux-fsdevel; linux-block@vger.kernel.org; linux-nvme@lists.infradead.org; linux-scsi@vger.kernel.org; linux-ide@vger.kernel.org
Subject: Re: [LSF/MM TOPIC] status update on stream IDs
[resend to include other relevant lists]
On Jan 6, 2017, at 4:54 PM, Andreas Dilger <adilger@dilger.ca> wrote:
>
> At LSF/MM'16 and Linux FAST (https://lwn.net/Articles/685499/) there were
> discussions about adding stream IDs to the block/device layer to allow higher
> layers (filesystems, applications) to identify IO streams so lower layers
> (SSDs, hybrid storage, etc.) can make better allocation/placement decisions.
>
> It would be useful to get an update on the state of this work, and discuss
> any obstacles that need to be resolved for getting this code landed.
Cheers, Andreas
^ permalink raw reply
* Re: [LSF/MM TOPIC] status update on stream IDs
From: Andreas Dilger @ 2017-01-06 23:58 UTC (permalink / raw)
To: lsf-pc; +Cc: linux-fsdevel, linux-block, linux-scsi, linux-nvme, linux-ide
In-Reply-To: <E86FC13D-0058-473C-B9D6-36B988ABEFFE@dilger.ca>
[-- Attachment #1: Type: text/plain, Size: 619 bytes --]
[resend to include other relevant lists]
On Jan 6, 2017, at 4:54 PM, Andreas Dilger <adilger@dilger.ca> wrote:
>
> At LSF/MM'16 and Linux FAST (https://lwn.net/Articles/685499/) there were
> discussions about adding stream IDs to the block/device layer to allow higher
> layers (filesystems, applications) to identify IO streams so lower layers
> (SSDs, hybrid storage, etc.) can make better allocation/placement decisions.
>
> It would be useful to get an update on the state of this work, and discuss
> any obstacles that need to be resolved for getting this code landed.
Cheers, Andreas
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [V1] ata: sata_mv:- Handle return value of devm_ioremap.
From: Andy Shevchenko @ 2017-01-06 22:52 UTC (permalink / raw)
To: Tejun Heo; +Cc: Arvind Yadav, linux-ide, linux-kernel@vger.kernel.org
In-Reply-To: <20170106204620.GD29909@mtj.duckdns.org>
On Fri, Jan 6, 2017 at 10:46 PM, Tejun Heo <tj@kernel.org> wrote:
> On Mon, Dec 12, 2016 at 11:13:27PM +0530, Arvind Yadav wrote:
>> Here, If devm_ioremap will fail. It will return NULL.
>> Then hpriv->base = NULL - 0x20000; Kernel can run into
>> a NULL-pointer dereference. This error check will avoid
>> NULL pointer dereference.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>
> Applied to libata/for-4.10-fixes.
Hold on, why not to convert to devm_ioremap_resource() ?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [V1] ata: sata_mv:- Handle return value of devm_ioremap.
From: Tejun Heo @ 2017-01-06 20:46 UTC (permalink / raw)
To: Arvind Yadav; +Cc: linux-ide, linux-kernel
In-Reply-To: <1481564607-9626-1-git-send-email-arvind.yadav.cs@gmail.com>
On Mon, Dec 12, 2016 at 11:13:27PM +0530, Arvind Yadav wrote:
> Here, If devm_ioremap will fail. It will return NULL.
> Then hpriv->base = NULL - 0x20000; Kernel can run into
> a NULL-pointer dereference. This error check will avoid
> NULL pointer dereference.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Applied to libata/for-4.10-fixes.
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH 1/1] libata: Fix ATA request sense
From: Tejun Heo @ 2017-01-06 20:44 UTC (permalink / raw)
To: Damien Le Moal; +Cc: linux-ide, Hannes Reinecke
In-Reply-To: <1482110260-14551-1-git-send-email-damien.lemoal@wdc.com>
On Mon, Dec 19, 2016 at 10:17:40AM +0900, Damien Le Moal wrote:
> For an ATA device supporting the sense data reporting feature set,
> a failed command will trigger the execution of ata_eh_request_sense if
> the result task file of the failed command has the ATA_SENSE bit set
> (sense data available bit). ata_eh_request_sense executes the
> REQUEST SENSE DATA EXT command to retrieve the sense data of the failed
> command. On success of REQUEST SENSE DATA EXT, the ATA_SENSE bit will
> NOT be set (the command succeeded) but ata_eh_request_sense
> nevertheless tests the availability of sense data by testing that bit
> presence in the result tf of the REQUEST SENSE DATA EXT command.
> This leads to a falsy assume that request sense data failed and to the
> warning message:
>
> atax.xx: request sense failed stat 50 emask 0
>
> Upon success of REQUEST SENSE DATA EXT, set the ATA_SENSE bit in the
> result task file command so that sense data can be returned by
> ata_eh_request_sense.
>
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Applied to libata/for-4.10-fixes with patch description updated as
suggested by Sergei.
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH] ata: sata_mv: fix module license specification
From: Tejun Heo @ 2017-01-06 20:37 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: linux-ide
In-Reply-To: <20161220211522.25856-1-uwe@kleine-koenig.org>
On Tue, Dec 20, 2016 at 10:15:22PM +0100, Uwe Kleine-König wrote:
> The header allows GPL v2 only, so declare "GPL v2" for MODULE_LICENSE
>
> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Applied to libata/for-4.11.
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH v3 1/1] ahci: imx: Add imx53 SATA temperature sensor support
From: Tejun Heo @ 2017-01-06 20:35 UTC (permalink / raw)
To: Fabien Lahoudere
Cc: linux-ide, linux-kernel, rui.zhang, edubezval, Csaba Kertesz
In-Reply-To: <1477426087-20263-1-git-send-email-fabien.lahoudere@collabora.co.uk>
On Tue, Oct 25, 2016 at 10:08:07PM +0200, Fabien Lahoudere wrote:
> From: Csaba Kertesz <csaba.kertesz@vincit.fi>
>
> Add a hwmon entry to get the temperature from the die of imx53
> SATA.
>
> The original patch was made by Richard Zhu for kernel 2.6.x:
> ENGR00134041-MX53-Add-the-SATA-AHCI-temperature-monitor.patch
>
> Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
Applied to libata/for-4.11.
Thanks.
--
tejun
^ permalink raw reply
* [PATCH for-4.10-fixes] libata: apply MAX_SEC_1024 to all CX1-JB*-HP devices
From: Tejun Heo @ 2017-01-06 16:48 UTC (permalink / raw)
To: Marko Koski-Vähälä; +Cc: linux-ide
In-Reply-To: <e0d6b4dc-9f3f-f97b-4bc1-5b1bb746a801@koski-vahala.com>
Marko reports that CX1-JB512-HP shows the same timeout issues as
CX1-JB256-HP. Let's apply MAX_SEC_128 to all devices in the series.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Marko Koski-Vähälä <marko@koski-vahala.com>
Cc: stable@vger.kernel.org # v3.19+
---
Applying to libata/for-4.10-fixes.
Thanks.
drivers/ata/libata-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index dc70b5f..f70eb6b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4356,10 +4356,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "ST380013AS", "3.20", ATA_HORKAGE_MAX_SEC_1024 },
/*
- * Device times out with higher max sects.
+ * These devices time out with higher max sects.
* https://bugzilla.kernel.org/show_bug.cgi?id=121671
*/
- { "LITEON CX1-JB256-HP", NULL, ATA_HORKAGE_MAX_SEC_1024 },
+ { "LITEON CX1-JB*-HP", NULL, ATA_HORKAGE_MAX_SEC_1024 },
/* Devices we expect to fail diagnostics */
^ permalink raw reply related
* Re: [PATCH] ata: ahci_xgene: free structure returned by acpi_get_object_info()
From: Tejun Heo @ 2017-01-06 16:39 UTC (permalink / raw)
To: Michał Kępień; +Cc: linux-ide, linux-kernel
In-Reply-To: <20170105141401.4896-1-kernel@kempniu.pl>
On Thu, Jan 05, 2017 at 03:14:01PM +0100, Michał Kępień wrote:
> acpi_get_object_info() allocates the returned structure, which the
> caller has to free when the call succeeds. Free it when appropriate.
>
> Fixes: c9802a4be661 ("ata: ahci_xgene: Add AHCI Support for 2nd HW version of APM X-Gene SoC AHCI SATA Host controller.")
> Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Applied to libata/for-4.11.
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH 0/6] ata: Missing HAS_DMA dependencies
From: Tejun Heo @ 2017-01-06 16:37 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Bartlomiej Zolnierkiewicz, linux-ide, linux-m68k, linux-kernel
In-Reply-To: <1483466989-9091-1-git-send-email-geert@linux-m68k.org>
On Tue, Jan 03, 2017 at 07:09:43PM +0100, Geert Uytterhoeven wrote:
> Hi all,
>
> Bartlomiej's "[PATCH 1/3] ata: allow subsystem to be used on m68k arch"
> exposed a few missing dependencies on HAS_DMA. This series allows to
> build again "allmodconfig" and "allyesconfig" kernels tailored for
> Sun-3, which sets NO_DMA=y.
Applied to 1-6 to libata/for-4.11.
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH 0/3] ata: add m68k/Atari Falcon PATA support
From: Michael Schmitz @ 2017-01-05 21:01 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Tejun Heo, Geert Uytterhoeven, linux-ide, Linux/m68k,
Linux Kernel Development
In-Reply-To: <1483106478-1382-1-git-send-email-b.zolnierkie@samsung.com>
Hi Bartlomiej,
thanks for caring to support our legacy PATA systems!
On Sat, Dec 31, 2016 at 3:01 AM, Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
> Hi,
>
> This patchset adds m68k/Atari Falcon PATA support to libata.
> The major difference in the new libata's pata_falcon host
> driver when compared to legacy IDE's falconide host driver is
> that we are using polled PIO mode and thus avoiding the need
> for STDMA locking magic altogether.
I don't suppose this is the default libata mode for PIO?
How is polling implemented in libata? Sleeping for something
approximating the average seek latency shouldn't hurt but spinning
wont be acceptable for a low performance single CPU architecture like
the Falcon.
> Tested under ARAnyM emulator.
Not sure that the emulator is really feature complete enough - I'll
get this tested on my Falcon in the next few weeks. I'm a bit worried
about IDE still generating interrupts on seek completion (did you spot
anything like that, Geert?).
Cheers,
Michael
^ permalink raw reply
* [PATCH] ata: ahci_xgene: free structure returned by acpi_get_object_info()
From: Michał Kępień @ 2017-01-05 14:14 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-kernel
acpi_get_object_info() allocates the returned structure, which the
caller has to free when the call succeeds. Free it when appropriate.
Fixes: c9802a4be661 ("ata: ahci_xgene: Add AHCI Support for 2nd HW version of APM X-Gene SoC AHCI SATA Host controller.")
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
---
drivers/ata/ahci_xgene.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 73b19b277138..c2b5941d9184 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -821,8 +821,10 @@ static int xgene_ahci_probe(struct platform_device *pdev)
dev_warn(&pdev->dev, "%s: Error reading device info. Assume version1\n",
__func__);
version = XGENE_AHCI_V1;
- } else if (info->valid & ACPI_VALID_CID) {
- version = XGENE_AHCI_V2;
+ } else {
+ if (info->valid & ACPI_VALID_CID)
+ version = XGENE_AHCI_V2;
+ kfree(info);
}
}
}
--
2.11.0
^ permalink raw reply related
* Staff Security Password
From: Maria Canales @ 2017-01-05 12:12 UTC (permalink / raw)
To: info@med.uni-marburg.de
Your e-mailbox password will soon expire. To keep your password active. Click Here<http://krw2f.tripod.com/> to update
Thank you,
Help Desk 2017©
^ permalink raw reply
* [PATCH 5/6] libata: Make ata_sg_clean() static again
From: Geert Uytterhoeven @ 2017-01-03 18:09 UTC (permalink / raw)
To: Tejun Heo, Bartlomiej Zolnierkiewicz
Cc: linux-ide, linux-m68k, linux-kernel, Geert Uytterhoeven
In-Reply-To: <1483466989-9091-1-git-send-email-geert@linux-m68k.org>
Commit 70e6ad0c6d1e6cb9 ("[PATCH] libata: prepare ata_sg_clean() for
invocation from EH") made ata_sg_clean() global, but no user outside
libata-core.c has ever materialized.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/ata/libata-core.c | 2 +-
drivers/ata/libata.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9cd0a2d4181699d9..a7e3df5abaa3124f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4822,7 +4822,7 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,
* LOCKING:
* spin_lock_irqsave(host lock)
*/
-void ata_sg_clean(struct ata_queued_cmd *qc)
+static void ata_sg_clean(struct ata_queued_cmd *qc)
{
struct ata_port *ap = qc->ap;
struct scatterlist *sg = qc->sg;
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 8f3a5596dd676b95..1133e9439f9c537e 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -89,7 +89,6 @@ extern int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
extern int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel);
extern unsigned int ata_dev_set_feature(struct ata_device *dev,
u8 enable, u8 feature);
-extern void ata_sg_clean(struct ata_queued_cmd *qc);
extern void ata_qc_free(struct ata_queued_cmd *qc);
extern void ata_qc_issue(struct ata_queued_cmd *qc);
extern void __ata_qc_complete(struct ata_queued_cmd *qc);
--
1.9.1
^ permalink raw reply related
* [PATCH 4/6] ata: AHCI and other non-SFF native drivers should depend on HAS_DMA
From: Geert Uytterhoeven @ 2017-01-03 18:09 UTC (permalink / raw)
To: Tejun Heo, Bartlomiej Zolnierkiewicz
Cc: linux-ide, linux-m68k, linux-kernel, Geert Uytterhoeven
In-Reply-To: <1483466989-9091-1-git-send-email-geert@linux-m68k.org>
If NO_DMA=y:
ERROR: "bad_dma_ops" [drivers/ata/libahci_platform.ko] undefined!
ERROR: "dmam_alloc_coherent" [drivers/ata/libahci.ko] undefined!
Add a block dependency on HAS_DMA to fix this.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/ata/Kconfig | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index a973aa8aa5513eea..78c00202102913a0 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -80,6 +80,8 @@ config SATA_PMP
This option adds support for SATA Port Multipliers
(the SATA version of an ethernet hub, or SAS expander).
+if HAS_DMA
+
comment "Controllers with non-SFF native interface"
config SATA_AHCI
@@ -232,6 +234,8 @@ config SATA_SIL24
If unsure, say N.
+endif # HAS_DMA
+
config ATA_SFF
bool "ATA SFF support (for legacy IDE and PATA)"
default y
--
1.9.1
^ permalink raw reply related
* [PATCH 6/6] libata: Protect DMA core code by #ifdef CONFIG_HAS_DMA
From: Geert Uytterhoeven @ 2017-01-03 18:09 UTC (permalink / raw)
To: Tejun Heo, Bartlomiej Zolnierkiewicz
Cc: linux-ide, linux-m68k, linux-kernel, Geert Uytterhoeven
In-Reply-To: <1483466989-9091-1-git-send-email-geert@linux-m68k.org>
If NO_DMA=y:
ERROR: "bad_dma_ops" [drivers/ata/libata.ko] undefined!
To fix this, protect the DMA code by #ifdef CONFIG_HAS_DMA, and provide
dummies of ata_sg_clean() and ata_sg_setup() for the !CONFIG_HAS_DMA
case.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/ata/libata-core.c | 61 +++++++++++++++++++++++++++--------------------
1 file changed, 35 insertions(+), 26 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a7e3df5abaa3124f..dc70b5f997f1f13e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4814,32 +4814,6 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,
}
/**
- * ata_sg_clean - Unmap DMA memory associated with command
- * @qc: Command containing DMA memory to be released
- *
- * Unmap all mapped DMA memory associated with this command.
- *
- * LOCKING:
- * spin_lock_irqsave(host lock)
- */
-static void ata_sg_clean(struct ata_queued_cmd *qc)
-{
- struct ata_port *ap = qc->ap;
- struct scatterlist *sg = qc->sg;
- int dir = qc->dma_dir;
-
- WARN_ON_ONCE(sg == NULL);
-
- VPRINTK("unmapping %u sg elements\n", qc->n_elem);
-
- if (qc->n_elem)
- dma_unmap_sg(ap->dev, sg, qc->orig_n_elem, dir);
-
- qc->flags &= ~ATA_QCFLAG_DMAMAP;
- qc->sg = NULL;
-}
-
-/**
* atapi_check_dma - Check whether ATAPI DMA can be supported
* @qc: Metadata associated with taskfile to check
*
@@ -4923,6 +4897,34 @@ void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
qc->cursg = qc->sg;
}
+#ifdef CONFIG_HAS_DMA
+
+/**
+ * ata_sg_clean - Unmap DMA memory associated with command
+ * @qc: Command containing DMA memory to be released
+ *
+ * Unmap all mapped DMA memory associated with this command.
+ *
+ * LOCKING:
+ * spin_lock_irqsave(host lock)
+ */
+void ata_sg_clean(struct ata_queued_cmd *qc)
+{
+ struct ata_port *ap = qc->ap;
+ struct scatterlist *sg = qc->sg;
+ int dir = qc->dma_dir;
+
+ WARN_ON_ONCE(sg == NULL);
+
+ VPRINTK("unmapping %u sg elements\n", qc->n_elem);
+
+ if (qc->n_elem)
+ dma_unmap_sg(ap->dev, sg, qc->orig_n_elem, dir);
+
+ qc->flags &= ~ATA_QCFLAG_DMAMAP;
+ qc->sg = NULL;
+}
+
/**
* ata_sg_setup - DMA-map the scatter-gather table associated with a command.
* @qc: Command with scatter-gather table to be mapped.
@@ -4955,6 +4957,13 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
return 0;
}
+#else /* !CONFIG_HAS_DMA */
+
+static inline void ata_sg_clean(struct ata_queued_cmd *qc) {}
+static inline int ata_sg_setup(struct ata_queued_cmd *qc) { return -1; }
+
+#endif /* !CONFIG_HAS_DMA */
+
/**
* swap_buf_le16 - swap halves of 16-bit words in place
* @buf: Buffer to swap
--
1.9.1
^ permalink raw reply related
* [PATCH 3/6] ata: ATA_BMDMA should depend on HAS_DMA
From: Geert Uytterhoeven @ 2017-01-03 18:09 UTC (permalink / raw)
To: Tejun Heo, Bartlomiej Zolnierkiewicz
Cc: linux-ide, linux-m68k, linux-kernel, Geert Uytterhoeven
In-Reply-To: <1483466989-9091-1-git-send-email-geert@linux-m68k.org>
If NO_DMA=y:
ERROR: "dmam_alloc_coherent" [drivers/ata/libata.ko] undefined!
Add a dependency on HAS_DMA to fix this.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/ata/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 275dbbded6dbe03b..a973aa8aa5513eea 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -289,6 +289,7 @@ config SATA_SX4
config ATA_BMDMA
bool "ATA BMDMA support"
+ depends on HAS_DMA
default y
help
This option adds support for SFF ATA controllers with BMDMA
--
1.9.1
^ permalink raw reply related
* [PATCH 2/6] ata: SATA_HIGHBANK should depend on HAS_DMA
From: Geert Uytterhoeven @ 2017-01-03 18:09 UTC (permalink / raw)
To: Tejun Heo, Bartlomiej Zolnierkiewicz
Cc: linux-ide, linux-m68k, linux-kernel, Geert Uytterhoeven
In-Reply-To: <1483466989-9091-1-git-send-email-geert@linux-m68k.org>
If NO_DMA=y:
ERROR: "bad_dma_ops" [drivers/ata/sata_highbank.ko] undefined!
Add a dependency on HAS_DMA to fix this.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/ata/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 7b36b791078a4806..275dbbded6dbe03b 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -344,6 +344,7 @@ config SATA_DWC_VDEBUG
config SATA_HIGHBANK
tristate "Calxeda Highbank SATA support"
+ depends on HAS_DMA
depends on ARCH_HIGHBANK || COMPILE_TEST
help
This option enables support for the Calxeda Highbank SoC's
--
1.9.1
^ permalink raw reply related
* [PATCH 1/6] ata: SATA_MV should depend on HAS_DMA
From: Geert Uytterhoeven @ 2017-01-03 18:09 UTC (permalink / raw)
To: Tejun Heo, Bartlomiej Zolnierkiewicz
Cc: linux-ide, linux-m68k, linux-kernel, Geert Uytterhoeven
In-Reply-To: <1483466989-9091-1-git-send-email-geert@linux-m68k.org>
If NO_DMA=y:
ERROR: "dma_pool_alloc" [drivers/ata/sata_mv.ko] undefined!
ERROR: "dmam_pool_create" [drivers/ata/sata_mv.ko] undefined!
ERROR: "dma_pool_free" [drivers/ata/sata_mv.ko] undefined!
Add a dependency on HAS_DMA to fix this.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/ata/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index cbd101933c69322a..7b36b791078a4806 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -353,6 +353,7 @@ config SATA_HIGHBANK
config SATA_MV
tristate "Marvell SATA support"
+ depends on HAS_DMA
depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \
ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST
select GENERIC_PHY
--
1.9.1
^ permalink raw reply related
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