Skip to content

Commit 31a3faf

Browse files
committed
Merge branch 'for-4.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
Pull libata fixes from Tejun Heo: "Late fixes for libata. There's a minor platform driver fix but the important one is READ LOG PAGE. This is a new ATA command which is used to test some optional features but it broke probing of some devices - they locked up instead of failing the unknown command. Christoph tried blacklisting, but, after finding out there are multiple devices which fail this way, backed off to testing feature bit in IDENTIFY data first, which is a bit lossy (we can miss features on some devices) but should be a lot safer" * 'for-4.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: Revert "libata: quirk read log on no-name M.2 SSD" libata: check for trusted computing in IDENTIFY DEVICE data libata: quirk read log on no-name M.2 SSD sata: ahci-da850: Fix some error handling paths in 'ahci_da850_probe()'
2 parents 785373b + 2aca392 commit 31a3faf

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

drivers/ata/ahci_da850.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,16 @@ static int ahci_da850_probe(struct platform_device *pdev)
216216
return rc;
217217

218218
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
219-
if (!res)
219+
if (!res) {
220+
rc = -ENODEV;
220221
goto disable_resources;
222+
}
221223

222224
pwrdn_reg = devm_ioremap(dev, res->start, resource_size(res));
223-
if (!pwrdn_reg)
225+
if (!pwrdn_reg) {
226+
rc = -ENOMEM;
224227
goto disable_resources;
228+
}
225229

226230
da850_sata_init(dev, pwrdn_reg, hpriv->mmio, mpy);
227231

drivers/ata/libata-core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,6 +2411,9 @@ static void ata_dev_config_trusted(struct ata_device *dev)
24112411
u64 trusted_cap;
24122412
unsigned int err;
24132413

2414+
if (!ata_id_has_trusted(dev->id))
2415+
return;
2416+
24142417
if (!ata_identify_page_supported(dev, ATA_LOG_SECURITY)) {
24152418
ata_dev_warn(dev,
24162419
"Security Log not supported\n");

include/linux/ata.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ enum {
6060
ATA_ID_FW_REV = 23,
6161
ATA_ID_PROD = 27,
6262
ATA_ID_MAX_MULTSECT = 47,
63-
ATA_ID_DWORD_IO = 48,
63+
ATA_ID_DWORD_IO = 48, /* before ATA-8 */
64+
ATA_ID_TRUSTED = 48, /* ATA-8 and later */
6465
ATA_ID_CAPABILITY = 49,
6566
ATA_ID_OLD_PIO_MODES = 51,
6667
ATA_ID_OLD_DMA_MODES = 52,
@@ -889,6 +890,13 @@ static inline bool ata_id_has_dword_io(const u16 *id)
889890
return id[ATA_ID_DWORD_IO] & (1 << 0);
890891
}
891892

893+
static inline bool ata_id_has_trusted(const u16 *id)
894+
{
895+
if (ata_id_major_version(id) <= 7)
896+
return false;
897+
return id[ATA_ID_TRUSTED] & (1 << 0);
898+
}
899+
892900
static inline bool ata_id_has_unload(const u16 *id)
893901
{
894902
if (ata_id_major_version(id) >= 7 &&

0 commit comments

Comments
 (0)