Akinobu Mita | 29 Jan 00:30 2015
Picon

[PATCH v2 1/2] ata: ahci_platform: fix owner module reference mismatch for scsi host

The owner module reference of the ahci platform's scsi_host is
initialized to libahci_platform's one, because these drivers use a
scsi_host_template defined in libahci_platform.  So these drivers can
be unloaded even if the scsi device is being accessed.

This fixes it by pushing the scsi_host_template from libahci_platform
to all leaf drivers.  The scsi_host_template is passed through a new
argument of ahci_platform_init_host().

Signed-off-by: Akinobu Mita <akinobu.mita <at> gmail.com>
Cc: Hans de Goede <hdegoede <at> redhat.com>
Cc: Tejun Heo <tj <at> kernel.org>
Cc: Christoph Hellwig <hch <at> lst.de>
Cc: "James E.J. Bottomley" <JBottomley <at> parallels.com>
Cc: linux-ide <at> vger.kernel.org
Cc: linux-scsi <at> vger.kernel.org
---
* Changes in v2
- use the specific platform driver name for each sht
- add comments on top of ATA_BASE_SHT and AHCI_SHT

 drivers/ata/ahci.h             |  4 ++++
 drivers/ata/ahci_da850.c       | 11 +++++++++--
 drivers/ata/ahci_imx.c         | 11 +++++++++--
 drivers/ata/ahci_mvebu.c       | 11 +++++++++--
 drivers/ata/ahci_platform.c    | 11 +++++++++--
 drivers/ata/ahci_st.c          | 11 +++++++++--
 drivers/ata/ahci_sunxi.c       | 11 +++++++++--
 drivers/ata/ahci_tegra.c       | 11 +++++++++--
 drivers/ata/ahci_xgene.c       | 11 +++++++++--
(Continue reading)

Tina Ruchandani | 27 Jan 11:19 2015
Picon

[PATCH v3] ata: Use 64-bit timekeeping

Function pdc_detect_pll_input_clock uses 'struct timeval'
to measure start and end times, used to compute the pll_clock value.
'struct timeval' on 32-bit systems will have its tv_sec field
overflow in year 2038 and beyond. This patch uses 'ktime_t'
(which uses 64 bits for seconds) for start and end times instead.

Suggested-by: Arnd Bergmann <arnd <at> arndb.de>
Signed-off-by: Tina Ruchandani <ruchandani.tina <at> gmail.com>
---
Changes in v3:
	- Switch back to usec_elapsed being a 'long'.
Changes in v2:
	- Switch from timespec64 to ktime_t - more efficient.
	- Use ktime_us_delta to get usec_elapsed, it is more
	  efficient than manual computation of usecs from timespec64.
---
 drivers/ata/pata_pdc2027x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 4d06a5c..dca8251 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
 <at>  <at>  -28,6 +28,7  <at>  <at> 
 #include <linux/blkdev.h>
 #include <linux/delay.h>
 #include <linux/device.h>
+#include <linux/ktime.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_host.h>
(Continue reading)

Shaohua Li | 24 Jan 05:17 2015

[PATCH] libata: make sata_sil24 use fifo tag allocator

libata starts using block tag now, we can use BLK_TAG_ALLOC_FIFO to
solve the sata_sil24 tag bug.

https://bugzilla.kernel.org/show_bug.cgi?id=87101

Cc: Jens Axboe <axboe <at> fb.com>
Cc: Tejun Heo <tj <at> kernel.org>
Cc: Christoph Hellwig <hch <at> infradead.org>
Cc: Dan Williams <dan.j.williams <at> intel.com>
Signed-off-by: Shaohua Li <shli <at> fb.com>
---
 drivers/ata/sata_sil24.c | 3 ++-
 include/linux/libata.h   | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index ea65594..5242897 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
 <at>  <at>  -246,7 +246,7  <at>  <at>  enum {
 	/* host flags */
 	SIL24_COMMON_FLAGS	= ATA_FLAG_SATA | ATA_FLAG_PIO_DMA |
 				  ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA |
-				  ATA_FLAG_AN | ATA_FLAG_PMP | ATA_FLAG_LOWTAG,
+				  ATA_FLAG_AN | ATA_FLAG_PMP,
 	SIL24_FLAG_PCIX_IRQ_WOC	= (1 << 24), /* IRQ loss errata on PCI-X */

 	IRQ_STAT_4PORTS		= 0xf,
 <at>  <at>  -388,6 +388,7  <at>  <at>  static struct scsi_host_template sil24_sht = {
 	.can_queue		= SIL24_MAX_CMDS,
(Continue reading)

Aleksey Makarov | 23 Jan 19:41 2015

[PATCH v2] SATA: OCTEON: support SATA on OCTEON platform

The OCTEON SATA controller is currently found on cn71XX devices.

Signed-off-by: David Daney <david.daney <at> cavium.com>
Signed-off-by: Vinita Gupta <vgupta <at> caviumnetworks.com>
Signed-off-by: Aleksey Makarov <aleksey.makarov <at> auriga.com>
---

Version 1:

https://lkml.kernel.org/g/<1421681040-3392-1-git-send-email-aleksey.makarov <at> auriga.com>

Changes in v2:
- The driver was rewritten as a driver for the UCTL SATA controller glue.
  It allowed to get rid of the most changes in ahci_platform.c
- Documentation for the device tree bindings was fixed.

 .../devicetree/bindings/ata/ahci-platform.txt      |   1 +
 .../devicetree/bindings/mips/cavium/sata-uctl.txt  |  28 ++++
 drivers/ata/Kconfig                                |   9 ++
 drivers/ata/Makefile                               |   1 +
 drivers/ata/ahci_platform.c                        |   1 +
 drivers/ata/sata_octeon.c                          | 157 +++++++++++++++++++++
 6 files changed, 197 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mips/cavium/sata-uctl.txt
 create mode 100644 drivers/ata/sata_octeon.c

diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index 4ab09f2..1a5d3be 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
(Continue reading)

Jack Williams | 23 Jan 01:21 2015
Picon

[PATCH] [BUG] libata: NULL pointer panic in ata_eh_link_report()

I've been trying to boot the linux-next tree and my system is getting a
kernel panic from an attempt to dereference a NULL pointer inside
ata_eh_link_report(). The following commit introduced the bug.

commit: cbba5b0ee4c6c2fc8b78a21d0900099d480cf2e9

The bug appears when the local variable cdb_len is initialized with
qc->dev->cdb_len without first checking qc->flags for ATA_QCFLAG_FAILED.
For whatever reason, qc->dev is NULL when it runs through my
motherboard's Marvell 91xx Config ATA device.

Signed-off-by: Jack Williams <jacwil014 <at> gmail.com>
---
 drivers/ata/libata-eh.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7478c8d0c2cb..b09efdd6d125 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
 <at>  <at>  -2481,16 +2481,18  <at>  <at>  static void ata_eh_link_report(struct ata_link *link)
 	for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
 		struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
 		struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf;
 		const u8 *cdb = qc->cdb;
-		size_t cdb_len = qc->dev->cdb_len;
+		size_t cdb_len;
 		char data_buf[20] = "";
 		char cdb_buf[70] = "";

(Continue reading)

Richard Nolde | 21 Jan 22:34 2015
Picon

Sata_inic 162x support is broken message

I've recently upgraded one of my older backup Linux boxes to Fedora 20 
(I know that 21 is out already, but 20 is what I running on my 
production box and I wanted to be able to fall back seamlessly). When I 
did this, I started getting an error message about he sata_inic 162x 
kernel module being borked. After tracing through various postings, it 
looks like this driver is going the way of the dodo bird.  However, it 
worked fine for me for four or five years, and I can remember no 
instances of data corruption. I have several of cards, sold under the 
SIIG nameplate as SC-SA1012-S1 v1.0 which has one internal SATA port and 
one external SATA port and another model SC-SAT212-S4 with two internal 
ports and no external ports. I have used these cards to attach external 
Hard disks with esata or USB options and disks up to 1 TB in size. I've 
also used the second port for internal disks and DVD drives.

I'm not a kernel developer, but I am a systems programmer and I 
contribute to the LibTiff distribution with a utility called tiffcrop 
and patches for some of the other utilities. Since I have an extra box 
or two in which I could run tests, I would volunteer to help anyone that 
would be interested in working on the driver by running tests as 
directed by the developer. I have built my own kernels in the past, so 
compiling a custom kernel with any set of options requested would not be 
an issue. Most of my extra boxes are 32 bit Intel boxes, but my backup 
box is a 64 bit AMD Athalon model. My production box is a 64 bit Intel 
x86-64 but I don't think it save to run test kernels on that as my job 
depends on it and the data on the disks.

Please let me know if I can be of assistance in revitalizing this driver.

Richard Nolde

(Continue reading)

Tejun Heo | 20 Jan 18:08 2015

[GIT PULL] libata fixes for v3.19-rc5

Hello, Linus.

* Bartlomiej will be co-maintaining PATA portion of libata.  git
  workflow will stay the same.

* sata_sil24 wasn't happy with tag ordered submission.  An option to
  restore the old tag allocation behavior is implemented for sil24.

* A very old race condition in PIO host state machine which can
  trigger BUG fixed.

* Other driver-specific changes.

Thanks.

The following changes since commit 97bf6af1f928216fd6c5a66e8a57bfa95a659672:

  Linux 3.19-rc1 (2014-12-20 17:08:50 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git for-3.19-fixes

for you to fetch changes up to ce7514526742c0898b837d4395f515b79dfb5a12:

  libata: prevent HSM state change race between ISR and PIO (2015-01-19 14:11:23 -0500)

----------------------------------------------------------------
Alexandre Belloni (1):
      ata: pata_at91: depend on !ARCH_MULTIPLATFORM
(Continue reading)

David Milburn | 19 Jan 20:03 2015
Picon

[PATCH v2] libata: prevent HSM state change race between ISR and PIO

From: David Jeffery <djeffery <at> redhat.com>

It is possible for ata_sff_flush_pio_task() to set ap->hsm_task_state to
HSM_ST_IDLE in between the time __ata_sff_port_intr() checks for HSM_ST_IDLE
and before it calls ata_sff_hsm_move() causing ata_sff_hsm_move() to BUG().

This problem is hard to reproduce making this patch hard to verify, but this
fix will prevent the race.

I have not been able to reproduce the problem, but here is a crash dump from
a 2.6.32 kernel.

On examining the ata port's state, its hsm_task_state field has a value of HSM_ST_IDLE:

crash> struct ata_port.hsm_task_state ffff881c1121c000
  hsm_task_state = 0

Normally, this should not be possible as ata_sff_hsm_move() was called from ata_sff_host_intr(), 
which checks hsm_task_state and won't call ata_sff_hsm_move() if it has a HSM_ST_IDLE value.

PID: 11053  TASK: ffff8816e846cae0  CPU: 0   COMMAND: "sshd"
 #0 [ffff88008ba03960] machine_kexec at ffffffff81038f3b
 #1 [ffff88008ba039c0] crash_kexec at ffffffff810c5d92
 #2 [ffff88008ba03a90] oops_end at ffffffff8152b510
 #3 [ffff88008ba03ac0] die at ffffffff81010e0b
 #4 [ffff88008ba03af0] do_trap at ffffffff8152ad74
 #5 [ffff88008ba03b50] do_invalid_op at ffffffff8100cf95
 #6 [ffff88008ba03bf0] invalid_op at ffffffff8100bf9b
    [exception RIP: ata_sff_hsm_move+317]
    RIP: ffffffff813a77ad  RSP: ffff88008ba03ca0  RFLAGS: 00010097
(Continue reading)

Gene Heskett | 19 Jan 17:45 2015

64 bit kernel won't mount /

Greetings;

Amd Phenom, 8Gb of dram on an Asus M2N-SLI Deluxe board.  So old USB3 
isn't.

Ubuntu 10.04.4 LTS 32 bit server install here.  A recent experiment with a 
32 bit Wheezy (2.7) worked extremely well when I enabled it to install an 
amd64 kernel, fastest and smoothest this machine has ever worked.  
Unfortunately I destroyed it by installing a library firefox was 
complaining about the lack thereof, it pulled in about 20 other packages 
and destroyed what little KDE I had installed to be able to use kmail.

I have been reading up on man fstab, but it has not solved my problem of 
the boot waiting, sometimes for 30 seconds, for the drive to be mounted at 
/ to appear.  There is no disk activity during this wait period, and it 
does not always do it when booting a 32 bit PAE kernel.

But if I build an amd64 version of that kernel, it stops dead, no disk 
activity after announcing that the / device has not yet checked in.

But, after waiting a minute, I hit m to get what is marked as a root 
terminal, but which has no rights, I see that the directory contents of / 
are visible.

Fdisk complains that there are 3503 unallocated 512 byte sectors after 
partition 1 on the disk, but its been doing that for 3 or 4 years.  
Terrabyte disk so its not seriously effected unless it slows it somehow 
that I haven't noticed.

On wheezy, for as long as it worked, it worked a treat.
(Continue reading)

David Milburn | 19 Jan 17:27 2015
Picon

[PATCH] libata: prevent HSM state change race between ISR and PIO

From: David Jeffery <djeffery <at> redhat.com>

It is possible for ata_sff_flush_pio_task() to set ap->hsm_task_state to
HSM_ST_IDLE in between the time __ata_sff_port_intr() checks for HSM_ST_IDLE
and before it calls ata_sff_hsm_move() causing ata_sff_hsm_move() to BUG().

This problem is hard to reproduce making this patch hard to verify, but this
fix will prevent the race.

I have not been able to reproduce the problem, but here is a crash dump from
a 2.6.32 kernel.

On examining the ata port's state, its hsm_task_state field has a value of HSM_ST_IDLE:

crash> struct ata_port.hsm_task_state ffff881c1121c000
  hsm_task_state = 0

Normally, this should not be possible as ata_sff_hsm_move() was called from ata_sff_host_intr(), 
which checks hsm_task_state and won't call ata_sff_hsm_move() if it has a HSM_ST_IDLE value.

PID: 11053  TASK: ffff8816e846cae0  CPU: 0   COMMAND: "sshd"
 #0 [ffff88008ba03960] machine_kexec at ffffffff81038f3b
 #1 [ffff88008ba039c0] crash_kexec at ffffffff810c5d92
 #2 [ffff88008ba03a90] oops_end at ffffffff8152b510
 #3 [ffff88008ba03ac0] die at ffffffff81010e0b
 #4 [ffff88008ba03af0] do_trap at ffffffff8152ad74
 #5 [ffff88008ba03b50] do_invalid_op at ffffffff8100cf95
 #6 [ffff88008ba03bf0] invalid_op at ffffffff8100bf9b
    [exception RIP: ata_sff_hsm_move+317]
    RIP: ffffffff813a77ad  RSP: ffff88008ba03ca0  RFLAGS: 00010097
(Continue reading)

Hannes Reinecke | 19 Jan 13:00 2015
Picon

[PATCH] libata: fixup oops in ata_eh_link_report()

We should only try to evaluate the cdb if this is an ATAPI
device, for any other device the 'cdb' field and the cdb_len
has no meaning.

Signed-off-by: Hannes Reinecke <hare <at> suse.de>
---
 drivers/ata/libata-eh.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 9179f11..584c6ae 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
 <at>  <at>  -2481,8 +2481,6  <at>  <at>  static void ata_eh_link_report(struct ata_link *link)
 	for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
 		struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
 		struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf;
-		const u8 *cdb = qc->cdb;
-		size_t cdb_len = qc->dev->cdb_len;
 		char data_buf[20] = "";
 		char cdb_buf[70] = "";

 <at>  <at>  -2510,6 +2508,9  <at>  <at>  static void ata_eh_link_report(struct ata_link *link)
 		}

 		if (ata_is_atapi(qc->tf.protocol)) {
+			const u8 *cdb = qc->cdb;
+			size_t cdb_len = qd->dev->cdb_len;
+
 			if (qc->scsicmd) {
(Continue reading)


Gmane