20 Jul, 2016
3 commits
-
`changeable` is the "version" of mode page requested by the user.
It will be less confusing/misleading if we do not check it
"together" with the setting bits of the drive.Not to mention that we currently have ata_mselect_*() implemented
in a way that each of them will serve exclusively a particular bit
on each page. The old style will hence make the condition look even
more unnecessarily arcane if the ata_msense_*() is reflecting more
than one bit.Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo -
Due to PCI subsystem behaviour, unloading AHCI driver will disable
MSI and enable INTx. When HBA supports MSIx or Multiple MSI, Driver's
irq handler doesn't clear GHC.IS register. It works well when reading or
writing data and GHC.IS is always non-zero. But when unloading driver
(or any other operation which causes disable MSIx and enable INTx), PCI
subsystem uses config write(Rx04.bit10) to enable INTx. Because
GHC.IS is non-zero, HBA will falsely assume some port needs interrupt
service. Then it asserts INTx. To make things worse, when AHCI controller
shares the same interrupt pin with other PCI device, that PCI device's ISR
will be called and nobody de-asserts previous INTx.
This patch clears GHC.IS in ahci_port_stop() even when using MSIx or
MMSI to prevent this case. It ensures GHC.IS is zero before PCI subsystem
enables INTx.tj: Minor updates to the comment.
Signed-off-by: Raymond Pang
Signed-off-by: Tejun Heo -
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.Signed-off-by: Wei Yongjun
Signed-off-by: Tejun Heo
19 Jul, 2016
4 commits
-
This avoid the need to always translate between the two in ata_prot_flags
and generally cleans up the taskfile protocol usage.Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
Instead we can simply check for PIO or DMA in ata_is_data.
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
The only caller can just check for !ata_is_data instead.
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
Since we set ATA_MAX_SECTORS_LBA48 to 65535 to avoid the corner case
in some drives that commands with "count" set to 0000h (which
reprsents 65536) does not work as expected, lba_48_ok(), which is
used for number-of-blocks checking when libata pack commands, should
use the same limit as well. In fact, there is no reason for the two
functions not to use the macros anyway.Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo
15 Jul, 2016
4 commits
-
The reset_all variable name is misleading as this bit is also applicable to
open, close, and finish actions. So rename that variable to "all" and remove
the unnecessary mask operation that's already done earlier.Signed-off-by: Damien Le Moal
[hch: split from the previous patch]
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
The subcommand for NCQ NON-DATA must be specified in the feature
(low byte), not the high-order count byte. Also make sure to properly
cast the all bit to a u16 before shiting it by 8 to avoid undefined
behavior.Signed-off-by: Damien Le Moal
[hch: split the original patch into two, updated changelog]
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
Include reporting options when translating REPORT ZONES commmand to
ATA NCQ, and make sure we only look at the actually specified bits
in the CDB for the options.Signed-off-by: Damien Le Moal
[hch: update patch description]
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
Add a new taskfile protocol ATA_PROT_NCQ_NODATA to handle
ATA NCQ NO-DATA commands correctly.
And fixup ata_scsi_zbc_out_xlat() to use it.Signed-off-by: Hannes Reinecke
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo
14 Jul, 2016
5 commits
-
Some taskfile protocol values where missing in ata_eh_link_report().
Signed-off-by: Hannes Reinecke
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
The taskfile protocol is a numeric value, and can not be ORed. Currently
this is harmless as the protocol is always zeroed before, but if it ever
has a non-zero value the ORing would create incorrect results.Signed-off-by: Hannes Reinecke
[hch: updated patch description]
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
Use accessors instead of the raw protocol value.
Signed-off-by: Hannes Reinecke
[hch: trivial cleanup of the ata_task assignments]
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
Use accessor functions instead of the raw value.
Signed-off-by: Hannes Reinecke
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo -
This way we don't have to worry about the exact bit postition of the
test to leak out and any crazy propagation effects in the callers.Suggested-by: Tejun Heo
Signed-off-by: Christoph Hellwig
Signed-off-by: Tejun Heo
13 Jul, 2016
4 commits
-
Currently libata statically allows only 1-block (512-byte) payload
for each TRIM command. Each payload can carry 64 TRIM ranges since
each range requires 8 bytes.It is silly to keep doing the calculation (512 / 8) in different
places. Hence, define the new ATA_MAX_TRIM_RNUM for the result.Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo -
Currently if a WRITE SAME (16) command is issued to the SATL with
"number of blocks" that is larger than the "Maximum write same length"
(which is the maximum number of blocks per TRIM command allowed in
libata, currently 65535 * 512 / 8 blocks), the SATL will accept the
command and translate it to a TRIM command with the upper limit.However, according to SBC (as of sbc4r11.pdf), the "device server"
should terminate the command with "Invalid field in CDB" in that case.Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo -
To make it consistent with the recently added ata_mselect_control().
We probably shouldn't have the word "mode" in its name anyway, since
that's not the case for other ata_msense_*() / ata_mselect_*() either.Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo -
The bit should always be set to 1 when the requested version of
page is "changeable" because we've made it so in ata_mselect_control().
Also, it should always be set to 1 if ATA_DFLAG_D_SENSE is set (when
the requested version of page is "current" or "default").Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo
12 Jul, 2016
5 commits
-
According to the HPT366 data sheet, PCI config space dword 0x40-0x43
bits 11:8 specify the primary drive cmd_high_time, however,
currently just 3 bits of the 4 are being used because the mask
is 0x700 and not 0x0f00. Fix the mask, allowing for the 40MHz clock
to be detected.Signed-off-by: Colin Ian King
Signed-off-by: Tejun Heo -
The comment suggests we should be having an SPC-3 version descriptor
but the 0260h is the code for "SPC-2 (no version claimed)". Correct
it to 0300h so that it has the "SPC-3 (no version claimed)" descriptor.Note that we are claiming SPC-3 version compatibility in the VERSION
field of the standard INQUIRY data. Therefore, I assume the typo was
on the code but not on the comment.Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo -
Avoid performance bottleneck when being SCSI pass-through'd to
virtual machines with other OSes (e.g. Windows) via virtio-scsi
and scsi-block in qemu.Ref.: https://github.com/YanVugenfirer/kvm-guest-drivers-windows/issues/63
Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo -
Without this fix, the DRA bit of the caching mode page would not
be updated when the read look-ahead feature is toggled (e.g. with
`smartctl --set`), but will only be until, for example, the write
cache feature is touched.Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo -
Commit 856c46639309 ("libata: support device-managed ZAC devices")
had the line that "bumps" the VERSION field in standard INQUIRY data
removed. Add it back and claim SPC-5 version compatibility, which
matches with the current version descriptor "SPC-5 (no version claimed)"
that is used for ZAC devices.Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo
07 Jul, 2016
2 commits
-
It's Command Descriptor Block. Also capitalized it.
Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo -
It does not make sense and is confusing to respond with "Invalid
field in CDB" while we have no support at all implemented for
FORMAT UNIT. It is decent to let it go to the default, which
will respond with "Invalid command operation code" instead.Signed-off-by: Tom Yan
Signed-off-by: Tejun Heo
29 Jun, 2016
1 commit
-
Note that `&acdev->host->lock' and `qc->ap->lock' denote the same lock, and it's
particularly confusing to spin_lock on the former but spin_unlock on the latter.Signed-off-by: Iago Abal
Signed-off-by: Tejun Heo
18 Jun, 2016
1 commit
-
The sysfs file for the libata error handling has multiple issues
in the way it prints time stamps:* it prints a 9-digit nanosecond value using a %06lu format string,
which drops some leading zeroes
* it converts a 64-bit jiffes value to a timespec using
jiffies_to_timespec(), which takes a 'long' argument, so the
result is wrong after a jiffies overflow (49 days).
* we try to avoid using timespec because that generally overflows
in 2038, although this particular usage is ok.This replaces the jiffies_to_timespec call with an open-coded
implementation that gets it right.Signed-off-by: Arnd Bergmann
Signed-off-by: Tejun Heo
17 Jun, 2016
7 commits
-
Add sata support to the Northstar Plus SoC device tree.
Signed-off-by: Yendapally Reddy Dhananjaya Reddy
Acked-by: Florian Fainelli
Signed-off-by: Tejun Heo -
This patch adds support for Broadcom NSP SATA3 PHY in existing
Broadcom SATA PHY driver.Signed-off-by: Yendapally Reddy Dhananjaya Reddy
Acked-by: Florian Fainelli
Signed-off-by: Tejun Heo -
Add SATA3 support for Broadcom NSP SoC
Signed-off-by: Yendapally Reddy Dhananjaya Reddy
Acked-by: Florian Fainelli
Signed-off-by: Tejun Heo -
Rename the existing Broadcom STB ahci driver to common
Broadcom SATA3 driver to share this across Broadcom SoCs.Signed-off-by: Yendapally Reddy Dhananjaya Reddy
Acked-by: Florian Fainelli
Signed-off-by: Tejun Heo -
Add documentation for SATA PHY available in Broadcom's
NSP SoC.Signed-off-by: Yendapally Reddy Dhananjaya Reddy
Acked-by: Florian Fainelli
Signed-off-by: Tejun Heo -
Add support for Broadcom NSP SoC ahci
Signed-off-by: Yendapally Reddy Dhananjaya Reddy
Acked-by: Florian Fainelli
Signed-off-by: Tejun Heo -
Renames the dt bindings document of Broadcom STB ahci driver to
common Broadcom ahci driver bindings documentSigned-off-by: Yendapally Reddy Dhananjaya Reddy
Acked-by: Florian Fainelli
Signed-off-by: Tejun Heo
27 May, 2016
4 commits
-
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.Signed-off-by: Javier Martinez Canillas
Signed-off-by: Tejun Heo -
Submitters of device tree binding documentation may forget to CC
the subsystem maintainer if this is missing.Signed-off-by: Geert Uytterhoeven
Cc: Tejun Heo
Cc: linux-ide@vger.kernel.org
Signed-off-by: Tejun Heo -
Remove extraneous space on if statement and on the following line,
trivial fix, no functional changeSigned-off-by: Colin Ian King
Signed-off-by: Tejun Heo -
Pull misc kbuild updates from Michal Marek:
"This is the non-critical part of kbuild:- Coccinelle fixes, one semantic patch less in this round [Vaishali
Thakkar, Wolfram Sang, Kees Cook]- rpm-pkg support for (open)SUSE's update-bootloader [Jiří Kosian]
- rpm-pkg restored support for $RPMOPTS [Srinivas Pandruvada]
- deb-pkg fixes for the linux-headers package [Bjørn Mork, Azriel
Samson]"* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
coccicheck: Fix missing 0 index in kill loop
scripts/package/Makefile: rpmbuild add support of RPMOPTS
builddeb: fix missing headers in linux-headers package
builddeb: include objtool binary in headers package
kbuild/mkspec: support 'update-bootloader'-based systems
scripts: coccinelle: remove check to move constants to right
Coccinelle: setup_timer: Add space in front of parentheses