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 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"This is a set of two small fixes, both to code which went in during
the merge window: cxgb4i has a scheduling in atomic bug in its new
ipv6 code and uas fails to work properly with the new scsi-mq code"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
[SCSI] uas: disable use of blk-mq I/O path
[SCSI] cxgb4i: avoid holding mutex in interrupt context

+62 -7
+1 -1
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
··· 1647 1647 if (event_dev->priv_flags & IFF_802_1Q_VLAN) 1648 1648 event_dev = vlan_dev_real_dev(event_dev); 1649 1649 1650 - cdev = cxgbi_device_find_by_netdev(event_dev, NULL); 1650 + cdev = cxgbi_device_find_by_netdev_rcu(event_dev, NULL); 1651 1651 1652 1652 if (!cdev) 1653 1653 return ret;
+51 -6
drivers/scsi/cxgbi/libcxgbi.c
··· 57 57 static LIST_HEAD(cdev_list); 58 58 static DEFINE_MUTEX(cdev_mutex); 59 59 60 + static LIST_HEAD(cdev_rcu_list); 61 + static DEFINE_SPINLOCK(cdev_rcu_lock); 62 + 60 63 int cxgbi_device_portmap_create(struct cxgbi_device *cdev, unsigned int base, 61 64 unsigned int max_conn) 62 65 { ··· 145 142 list_add_tail(&cdev->list_head, &cdev_list); 146 143 mutex_unlock(&cdev_mutex); 147 144 145 + spin_lock(&cdev_rcu_lock); 146 + list_add_tail_rcu(&cdev->rcu_node, &cdev_rcu_list); 147 + spin_unlock(&cdev_rcu_lock); 148 + 148 149 log_debug(1 << CXGBI_DBG_DEV, 149 150 "cdev 0x%p, p# %u.\n", cdev, nports); 150 151 return cdev; ··· 160 153 log_debug(1 << CXGBI_DBG_DEV, 161 154 "cdev 0x%p, p# %u,%s.\n", 162 155 cdev, cdev->nports, cdev->nports ? cdev->ports[0]->name : ""); 156 + 163 157 mutex_lock(&cdev_mutex); 164 158 list_del(&cdev->list_head); 165 159 mutex_unlock(&cdev_mutex); 160 + 161 + spin_lock(&cdev_rcu_lock); 162 + list_del_rcu(&cdev->rcu_node); 163 + spin_unlock(&cdev_rcu_lock); 164 + synchronize_rcu(); 165 + 166 166 cxgbi_device_destroy(cdev); 167 167 } 168 168 EXPORT_SYMBOL_GPL(cxgbi_device_unregister); ··· 181 167 mutex_lock(&cdev_mutex); 182 168 list_for_each_entry_safe(cdev, tmp, &cdev_list, list_head) { 183 169 if ((cdev->flags & flag) == flag) { 184 - log_debug(1 << CXGBI_DBG_DEV, 185 - "cdev 0x%p, p# %u,%s.\n", 186 - cdev, cdev->nports, cdev->nports ? 187 - cdev->ports[0]->name : ""); 188 - list_del(&cdev->list_head); 189 - cxgbi_device_destroy(cdev); 170 + mutex_unlock(&cdev_mutex); 171 + cxgbi_device_unregister(cdev); 172 + mutex_lock(&cdev_mutex); 190 173 } 191 174 } 192 175 mutex_unlock(&cdev_mutex); ··· 202 191 } 203 192 } 204 193 mutex_unlock(&cdev_mutex); 194 + 205 195 log_debug(1 << CXGBI_DBG_DEV, 206 196 "lldev 0x%p, NO match found.\n", lldev); 207 197 return NULL; ··· 241 229 return NULL; 242 230 } 243 231 EXPORT_SYMBOL_GPL(cxgbi_device_find_by_netdev); 232 + 233 + struct cxgbi_device *cxgbi_device_find_by_netdev_rcu(struct net_device *ndev, 234 + int *port) 235 + { 236 + struct net_device *vdev = NULL; 237 + struct cxgbi_device *cdev; 238 + int i; 239 + 240 + if (ndev->priv_flags & IFF_802_1Q_VLAN) { 241 + vdev = ndev; 242 + ndev = vlan_dev_real_dev(ndev); 243 + pr_info("vlan dev %s -> %s.\n", vdev->name, ndev->name); 244 + } 245 + 246 + rcu_read_lock(); 247 + list_for_each_entry_rcu(cdev, &cdev_rcu_list, rcu_node) { 248 + for (i = 0; i < cdev->nports; i++) { 249 + if (ndev == cdev->ports[i]) { 250 + cdev->hbas[i]->vdev = vdev; 251 + rcu_read_unlock(); 252 + if (port) 253 + *port = i; 254 + return cdev; 255 + } 256 + } 257 + } 258 + rcu_read_unlock(); 259 + 260 + log_debug(1 << CXGBI_DBG_DEV, 261 + "ndev 0x%p, %s, NO match found.\n", ndev, ndev->name); 262 + return NULL; 263 + } 264 + EXPORT_SYMBOL_GPL(cxgbi_device_find_by_netdev_rcu); 244 265 245 266 static struct cxgbi_device *cxgbi_device_find_by_mac(struct net_device *ndev, 246 267 int *port)
+3
drivers/scsi/cxgbi/libcxgbi.h
··· 527 527 #define CXGBI_FLAG_IPV4_SET 0x10 528 528 struct cxgbi_device { 529 529 struct list_head list_head; 530 + struct list_head rcu_node; 530 531 unsigned int flags; 531 532 struct net_device **ports; 532 533 void *lldev; ··· 710 709 void cxgbi_device_unregister_all(unsigned int flag); 711 710 struct cxgbi_device *cxgbi_device_find_by_lldev(void *); 712 711 struct cxgbi_device *cxgbi_device_find_by_netdev(struct net_device *, int *); 712 + struct cxgbi_device *cxgbi_device_find_by_netdev_rcu(struct net_device *, 713 + int *); 713 714 int cxgbi_hbas_add(struct cxgbi_device *, u64, unsigned int, 714 715 struct scsi_host_template *, 715 716 struct scsi_transport_template *);
+7
drivers/usb/storage/uas.c
··· 970 970 .cmd_per_lun = 1, /* until we override it */ 971 971 .skip_settle_delay = 1, 972 972 .ordered_tag = 1, 973 + 974 + /* 975 + * The uas drivers expects tags not to be bigger than the maximum 976 + * per-device queue depth, which is not true with the blk-mq tag 977 + * allocator. 978 + */ 979 + .disable_blk_mq = true, 973 980 }; 974 981 975 982 #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \