Skip to content

Commit 284fce0

Browse files
committed
Merge tag 'ata-5.17-rc4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata
Pull ata fixes from Damien Le Moal: "A couple of additional fixes for 5.17-rc4: - Fix compilation warnings in the sata_fsl driver (powerpc) (me) - Disable TRIM commands on M88V29 devices as these commands are failing despite the device reporting it supports TRIM (Zoltan)" * tag 'ata-5.17-rc4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: libata-core: Disable TRIM on M88V29 ata: sata_fsl: fix sscanf() and sysfs_emit() format strings
2 parents c3ee3a9 + c8ea23d commit 284fce0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

drivers/ata/libata-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4029,6 +4029,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
40294029

40304030
/* devices that don't properly handle TRIM commands */
40314031
{ "SuperSSpeed S238*", NULL, ATA_HORKAGE_NOTRIM, },
4032+
{ "M88V29*", NULL, ATA_HORKAGE_NOTRIM, },
40324033

40334034
/*
40344035
* As defined, the DRAT (Deterministic Read After Trim) and RZAT

drivers/ata/sata_fsl.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static void fsl_sata_set_irq_coalescing(struct ata_host *host,
322322
static ssize_t fsl_sata_intr_coalescing_show(struct device *dev,
323323
struct device_attribute *attr, char *buf)
324324
{
325-
return sysfs_emit(buf, "%d %d\n",
325+
return sysfs_emit(buf, "%u %u\n",
326326
intr_coalescing_count, intr_coalescing_ticks);
327327
}
328328

@@ -332,10 +332,8 @@ static ssize_t fsl_sata_intr_coalescing_store(struct device *dev,
332332
{
333333
unsigned int coalescing_count, coalescing_ticks;
334334

335-
if (sscanf(buf, "%d%d",
336-
&coalescing_count,
337-
&coalescing_ticks) != 2) {
338-
printk(KERN_ERR "fsl-sata: wrong parameter format.\n");
335+
if (sscanf(buf, "%u%u", &coalescing_count, &coalescing_ticks) != 2) {
336+
dev_err(dev, "fsl-sata: wrong parameter format.\n");
339337
return -EINVAL;
340338
}
341339

@@ -359,7 +357,7 @@ static ssize_t fsl_sata_rx_watermark_show(struct device *dev,
359357
rx_watermark &= 0x1f;
360358
spin_unlock_irqrestore(&host->lock, flags);
361359

362-
return sysfs_emit(buf, "%d\n", rx_watermark);
360+
return sysfs_emit(buf, "%u\n", rx_watermark);
363361
}
364362

365363
static ssize_t fsl_sata_rx_watermark_store(struct device *dev,
@@ -373,17 +371,17 @@ static ssize_t fsl_sata_rx_watermark_store(struct device *dev,
373371
void __iomem *csr_base = host_priv->csr_base;
374372
u32 temp;
375373

376-
if (sscanf(buf, "%d", &rx_watermark) != 1) {
377-
printk(KERN_ERR "fsl-sata: wrong parameter format.\n");
374+
if (kstrtouint(buf, 10, &rx_watermark) < 0) {
375+
dev_err(dev, "fsl-sata: wrong parameter format.\n");
378376
return -EINVAL;
379377
}
380378

381379
spin_lock_irqsave(&host->lock, flags);
382380
temp = ioread32(csr_base + TRANSCFG);
383381
temp &= 0xffffffe0;
384382
iowrite32(temp | rx_watermark, csr_base + TRANSCFG);
385-
386383
spin_unlock_irqrestore(&host->lock, flags);
384+
387385
return strlen(buf);
388386
}
389387

0 commit comments

Comments
 (0)