Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+21 -13
+5 -6
drivers/ata/libata-core.c
··· 42 42 #include <linux/workqueue.h> 43 43 #include <linux/scatterlist.h> 44 44 #include <linux/io.h> 45 - #include <linux/async.h> 46 45 #include <linux/log2.h> 47 46 #include <linux/slab.h> 48 47 #include <linux/glob.h> ··· 5777 5778 /* perform each probe asynchronously */ 5778 5779 for (i = 0; i < host->n_ports; i++) { 5779 5780 struct ata_port *ap = host->ports[i]; 5780 - async_schedule(async_port_probe, ap); 5781 + ap->cookie = async_schedule(async_port_probe, ap); 5781 5782 } 5782 5783 5783 5784 return 0; ··· 5919 5920 { 5920 5921 int i; 5921 5922 5922 - /* Ensure ata_port probe has completed */ 5923 - async_synchronize_full(); 5924 - 5925 - for (i = 0; i < host->n_ports; i++) 5923 + for (i = 0; i < host->n_ports; i++) { 5924 + /* Ensure ata_port probe has completed */ 5925 + async_synchronize_cookie(host->ports[i]->cookie + 1); 5926 5926 ata_port_detach(host->ports[i]); 5927 + } 5927 5928 5928 5929 /* the host is dead now, dissociate ACPI */ 5929 5930 ata_acpi_dissociate(host);
+6 -3
drivers/ata/libata-scsi.c
··· 3684 3684 { 3685 3685 struct scsi_cmnd *scmd = qc->scsicmd; 3686 3686 const u8 *cdb = scmd->cmnd; 3687 - const u8 *p; 3688 3687 u8 pg, spg; 3689 3688 unsigned six_byte, pg_len, hdr_len, bd_len; 3690 3689 int len; 3691 3690 u16 fp = (u16)-1; 3692 3691 u8 bp = 0xff; 3692 + u8 buffer[64]; 3693 + const u8 *p = buffer; 3693 3694 3694 3695 VPRINTK("ENTER\n"); 3695 3696 ··· 3724 3723 if (!scsi_sg_count(scmd) || scsi_sglist(scmd)->length < len) 3725 3724 goto invalid_param_len; 3726 3725 3727 - p = page_address(sg_page(scsi_sglist(scmd))); 3728 - 3729 3726 /* Move past header and block descriptors. */ 3730 3727 if (len < hdr_len) 3728 + goto invalid_param_len; 3729 + 3730 + if (!sg_copy_to_buffer(scsi_sglist(scmd), scsi_sg_count(scmd), 3731 + buffer, sizeof(buffer))) 3731 3732 goto invalid_param_len; 3732 3733 3733 3734 if (six_byte)
+7 -4
drivers/ata/sata_rcar.c
··· 907 907 pm_runtime_enable(dev); 908 908 ret = pm_runtime_get_sync(dev); 909 909 if (ret < 0) 910 - goto err_pm_disable; 910 + goto err_pm_put; 911 911 912 912 host = ata_host_alloc(dev, 1); 913 913 if (!host) { ··· 937 937 938 938 err_pm_put: 939 939 pm_runtime_put(dev); 940 - err_pm_disable: 941 940 pm_runtime_disable(dev); 942 941 return ret; 943 942 } ··· 990 991 int ret; 991 992 992 993 ret = pm_runtime_get_sync(dev); 993 - if (ret < 0) 994 + if (ret < 0) { 995 + pm_runtime_put(dev); 994 996 return ret; 997 + } 995 998 996 999 if (priv->type == RCAR_GEN3_SATA) { 997 1000 sata_rcar_init_module(priv); ··· 1018 1017 int ret; 1019 1018 1020 1019 ret = pm_runtime_get_sync(dev); 1021 - if (ret < 0) 1020 + if (ret < 0) { 1021 + pm_runtime_put(dev); 1022 1022 return ret; 1023 + } 1023 1024 1024 1025 sata_rcar_setup_port(host); 1025 1026
+3
include/linux/libata.h
··· 22 22 #include <linux/acpi.h> 23 23 #include <linux/cdrom.h> 24 24 #include <linux/sched.h> 25 + #include <linux/async.h> 25 26 26 27 /* 27 28 * Define if arch has non-standard setup. This is a _PCI_ standard ··· 872 871 873 872 struct timer_list fastdrain_timer; 874 873 unsigned long fastdrain_cnt; 874 + 875 + async_cookie_t cookie; 875 876 876 877 int em_message_type; 877 878 void *private_data;