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

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Two medium sized fixes, both in drivers.

The UFS one adds parsing of clock info structures, which is required
by some host drivers and the aacraid one reverts the IRQ affinity
mapping patch which has been causing regressions noted in kernel
bugzilla 217599"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: ufs: core: Store min and max clk freq from OPP table
Revert "scsi: aacraid: Reply queue mapping to CPUs based on IRQ affinity"

+57 -43
-1
drivers/scsi/aacraid/aacraid.h
··· 1678 1678 u32 handle_pci_error; 1679 1679 bool init_reset; 1680 1680 u8 soft_reset_support; 1681 - u8 use_map_queue; 1682 1681 }; 1683 1682 1684 1683 #define aac_adapter_interrupt(dev) \
+1 -5
drivers/scsi/aacraid/commsup.c
··· 223 223 struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd) 224 224 { 225 225 struct fib *fibptr; 226 - u32 blk_tag; 227 - int i; 228 226 229 - blk_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); 230 - i = blk_mq_unique_tag_to_tag(blk_tag); 231 - fibptr = &dev->fibs[i]; 227 + fibptr = &dev->fibs[scsi_cmd_to_rq(scmd)->tag]; 232 228 /* 233 229 * Null out fields that depend on being zero at the start of 234 230 * each I/O
-14
drivers/scsi/aacraid/linit.c
··· 19 19 20 20 #include <linux/compat.h> 21 21 #include <linux/blkdev.h> 22 - #include <linux/blk-mq-pci.h> 23 22 #include <linux/completion.h> 24 23 #include <linux/init.h> 25 24 #include <linux/interrupt.h> ··· 502 503 sdev->tagged_supported = 1; 503 504 504 505 return 0; 505 - } 506 - 507 - static void aac_map_queues(struct Scsi_Host *shost) 508 - { 509 - struct aac_dev *aac = (struct aac_dev *)shost->hostdata; 510 - 511 - blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT], 512 - aac->pdev, 0); 513 - aac->use_map_queue = true; 514 506 } 515 507 516 508 /** ··· 1488 1498 .bios_param = aac_biosparm, 1489 1499 .shost_groups = aac_host_groups, 1490 1500 .slave_configure = aac_slave_configure, 1491 - .map_queues = aac_map_queues, 1492 1501 .change_queue_depth = aac_change_queue_depth, 1493 1502 .sdev_groups = aac_dev_groups, 1494 1503 .eh_abort_handler = aac_eh_abort, ··· 1775 1786 shost->max_lun = AAC_MAX_LUN; 1776 1787 1777 1788 pci_set_drvdata(pdev, shost); 1778 - shost->nr_hw_queues = aac->max_msix; 1779 - shost->host_tagset = 1; 1780 1789 1781 1790 error = scsi_add_host(shost, &pdev->dev); 1782 1791 if (error) ··· 1906 1919 struct aac_dev *aac = (struct aac_dev *)shost->hostdata; 1907 1920 1908 1921 aac_cancel_rescan_worker(aac); 1909 - aac->use_map_queue = false; 1910 1922 scsi_remove_host(shost); 1911 1923 1912 1924 __aac_shutdown(aac);
+2 -23
drivers/scsi/aacraid/src.c
··· 493 493 #endif 494 494 495 495 u16 vector_no; 496 - struct scsi_cmnd *scmd; 497 - u32 blk_tag; 498 - struct Scsi_Host *shost = dev->scsi_host_ptr; 499 - struct blk_mq_queue_map *qmap; 500 496 501 497 atomic_inc(&q->numpending); 502 498 ··· 505 509 if ((dev->comm_interface == AAC_COMM_MESSAGE_TYPE3) 506 510 && dev->sa_firmware) 507 511 vector_no = aac_get_vector(dev); 508 - else { 509 - if (!fib->vector_no || !fib->callback_data) { 510 - if (shost && dev->use_map_queue) { 511 - qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT]; 512 - vector_no = qmap->mq_map[raw_smp_processor_id()]; 513 - } 514 - /* 515 - * We hardcode the vector_no for 516 - * reserved commands as a valid shost is 517 - * absent during the init 518 - */ 519 - else 520 - vector_no = 0; 521 - } else { 522 - scmd = (struct scsi_cmnd *)fib->callback_data; 523 - blk_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); 524 - vector_no = blk_mq_unique_tag_to_hwq(blk_tag); 525 - } 526 - } 512 + else 513 + vector_no = fib->vector_no; 527 514 528 515 if (native_hba) { 529 516 if (fib->flags & FIB_CONTEXT_FLAG_NATIVE_HBA_TMF) {
+54
drivers/ufs/host/ufshcd-pltfrm.c
··· 8 8 * Vinayak Holikatti <h.vinayak@samsung.com> 9 9 */ 10 10 11 + #include <linux/clk.h> 11 12 #include <linux/module.h> 12 13 #include <linux/platform_device.h> 13 14 #include <linux/pm_opp.h> ··· 214 213 } 215 214 } 216 215 216 + /** 217 + * ufshcd_parse_clock_min_max_freq - Parse MIN and MAX clocks freq 218 + * @hba: per adapter instance 219 + * 220 + * This function parses MIN and MAX frequencies of all clocks required 221 + * by the host drivers. 222 + * 223 + * Returns 0 for success and non-zero for failure 224 + */ 225 + static int ufshcd_parse_clock_min_max_freq(struct ufs_hba *hba) 226 + { 227 + struct list_head *head = &hba->clk_list_head; 228 + struct ufs_clk_info *clki; 229 + struct dev_pm_opp *opp; 230 + unsigned long freq; 231 + u8 idx = 0; 232 + 233 + list_for_each_entry(clki, head, list) { 234 + if (!clki->name) 235 + continue; 236 + 237 + clki->clk = devm_clk_get(hba->dev, clki->name); 238 + if (IS_ERR(clki->clk)) 239 + continue; 240 + 241 + /* Find Max Freq */ 242 + freq = ULONG_MAX; 243 + opp = dev_pm_opp_find_freq_floor_indexed(hba->dev, &freq, idx); 244 + if (IS_ERR(opp)) { 245 + dev_err(hba->dev, "Failed to find OPP for MAX frequency\n"); 246 + return PTR_ERR(opp); 247 + } 248 + clki->max_freq = dev_pm_opp_get_freq_indexed(opp, idx); 249 + dev_pm_opp_put(opp); 250 + 251 + /* Find Min Freq */ 252 + freq = 0; 253 + opp = dev_pm_opp_find_freq_ceil_indexed(hba->dev, &freq, idx); 254 + if (IS_ERR(opp)) { 255 + dev_err(hba->dev, "Failed to find OPP for MIN frequency\n"); 256 + return PTR_ERR(opp); 257 + } 258 + clki->min_freq = dev_pm_opp_get_freq_indexed(opp, idx++); 259 + dev_pm_opp_put(opp); 260 + } 261 + 262 + return 0; 263 + } 264 + 217 265 static int ufshcd_parse_operating_points(struct ufs_hba *hba) 218 266 { 219 267 struct device *dev = hba->dev; ··· 328 278 dev_err(dev, "Failed to add OPP table: %d\n", ret); 329 279 return ret; 330 280 } 281 + 282 + ret = ufshcd_parse_clock_min_max_freq(hba); 283 + if (ret) 284 + return ret; 331 285 332 286 hba->use_pm_opp = true; 333 287