libata-5.8-2020-06-19

-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAl7s0McQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpvbNEAC1oSIlpp0v1ahvt8EDVPGL+0P4YfscrSf0
 5KGvt0vCRfzgluSbDZgVG1sW5uG87ymMSFegwr/OL/AVsyf54z5DKRGEQjh41Kw0
 uFVq/5XWUg4B3OV8m8v3idS4LmSLTqqhGxc1Yf+NUeI6Gf+tyWUvyw2+fpihwtzd
 XdPcz+oxpUbJtOt0O3umua8HW8ncnWm5wd+DwvDBPec4hSz/G1nfrwpHSxj0JJcr
 zfbjZLPZZy9XZnlxxpOA9XgANYNklM/Kf3xXqk+3cVWKhE2oiIpYlR+3hqs398YX
 BgEIzHsacf/8b6WMRmRIsyCoKfiGA5ec5kTKp8typmP3GFBKbYTCVLgHT3K/iIV6
 BYaar0PBPeQhRYWlGQVZvoEwuF+c64BXzNLQB96YTCRJvhsUhmjdYQCYQNLcb99C
 zbpwJ3wukWLs1LJx8lgEbRIG3hZGDpO5k0prYuqkfX4Py6lzdGKJP29QStjCoydx
 NMr+V3tsf3PD+xASGavak/cQESctGVzEl9VBsQOZj8seB1RjzP7wzBRMuHXkcYxo
 v7MMM/6o4y8uPei2Ch69FSNZ2w9XsuE7YfTqTeE5VMHYh9pnYtlMNbESWpLoasXK
 Akxvt3+JNShNYv1ecbhn75HASioTP0i9OmClOrCSoP/Zf7ot5rxsTIE4cyRNLKDh
 JES0sjUZYQ==
 =iH5/
 -----END PGP SIGNATURE-----

Merge tag 'libata-5.8-2020-06-19' of git://git.kernel.dk/linux-block

Pull libata fixes from Jens Axboe:
 "A few minor changes that should go into this release"

* tag 'libata-5.8-2020-06-19' of git://git.kernel.dk/linux-block:
  libata: Use per port sync for detach
  ata/libata: Fix usage of page address by page_address in ata_scsi_mode_select_xlat function
  sata_rcar: handle pm_runtime_get_sync failure cases
This commit is contained in:
Linus Torvalds 2020-06-19 13:09:40 -07:00
commit 592be758f1
4 changed files with 21 additions and 13 deletions

View File

@ -42,7 +42,6 @@
#include <linux/workqueue.h>
#include <linux/scatterlist.h>
#include <linux/io.h>
#include <linux/async.h>
#include <linux/log2.h>
#include <linux/slab.h>
#include <linux/glob.h>
@ -5778,7 +5777,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
/* perform each probe asynchronously */
for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap = host->ports[i];
async_schedule(async_port_probe, ap);
ap->cookie = async_schedule(async_port_probe, ap);
}
return 0;
@ -5920,11 +5919,11 @@ void ata_host_detach(struct ata_host *host)
{
int i;
/* Ensure ata_port probe has completed */
async_synchronize_full();
for (i = 0; i < host->n_ports; i++)
for (i = 0; i < host->n_ports; i++) {
/* Ensure ata_port probe has completed */
async_synchronize_cookie(host->ports[i]->cookie + 1);
ata_port_detach(host->ports[i]);
}
/* the host is dead now, dissociate ACPI */
ata_acpi_dissociate(host);

View File

@ -3684,12 +3684,13 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
{
struct scsi_cmnd *scmd = qc->scsicmd;
const u8 *cdb = scmd->cmnd;
const u8 *p;
u8 pg, spg;
unsigned six_byte, pg_len, hdr_len, bd_len;
int len;
u16 fp = (u16)-1;
u8 bp = 0xff;
u8 buffer[64];
const u8 *p = buffer;
VPRINTK("ENTER\n");
@ -3723,12 +3724,14 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
if (!scsi_sg_count(scmd) || scsi_sglist(scmd)->length < len)
goto invalid_param_len;
p = page_address(sg_page(scsi_sglist(scmd)));
/* Move past header and block descriptors. */
if (len < hdr_len)
goto invalid_param_len;
if (!sg_copy_to_buffer(scsi_sglist(scmd), scsi_sg_count(scmd),
buffer, sizeof(buffer)))
goto invalid_param_len;
if (six_byte)
bd_len = p[3];
else

View File

@ -907,7 +907,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
ret = pm_runtime_get_sync(dev);
if (ret < 0)
goto err_pm_disable;
goto err_pm_put;
host = ata_host_alloc(dev, 1);
if (!host) {
@ -937,7 +937,6 @@ static int sata_rcar_probe(struct platform_device *pdev)
err_pm_put:
pm_runtime_put(dev);
err_pm_disable:
pm_runtime_disable(dev);
return ret;
}
@ -991,8 +990,10 @@ static int sata_rcar_resume(struct device *dev)
int ret;
ret = pm_runtime_get_sync(dev);
if (ret < 0)
if (ret < 0) {
pm_runtime_put(dev);
return ret;
}
if (priv->type == RCAR_GEN3_SATA) {
sata_rcar_init_module(priv);
@ -1017,8 +1018,10 @@ static int sata_rcar_restore(struct device *dev)
int ret;
ret = pm_runtime_get_sync(dev);
if (ret < 0)
if (ret < 0) {
pm_runtime_put(dev);
return ret;
}
sata_rcar_setup_port(host);

View File

@ -22,6 +22,7 @@
#include <linux/acpi.h>
#include <linux/cdrom.h>
#include <linux/sched.h>
#include <linux/async.h>
/*
* Define if arch has non-standard setup. This is a _PCI_ standard
@ -872,6 +873,8 @@ struct ata_port {
struct timer_list fastdrain_timer;
unsigned long fastdrain_cnt;
async_cookie_t cookie;
int em_message_type;
void *private_data;