summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* scsi: vmw_pvscsi: Silence dma mapping errorsThomas Hellstrom2019-12-191-3/+3
| | | | | | | | | | | | | These errors typically occur with swiotlb when the swiotlb buffer is full. But they are transient and would typically unnecessarily worry a user. Instead of errors, print debug messages. Cc: "James E.J. Bottomley" <jejb@linux.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20191203193052.7583-2-thomas_os@shipmail.org Acked-by: Jim Gill <jgill@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: vmw_pvscsi: Fix swiotlb operationThomas Hellstrom2019-12-191-0/+14
| | | | | | | | | | | | | | With swiotlb, the first byte of the sense buffer may in some cases be uninitialized since we use DMA_FROM_DEVICE, and the device incorrectly doesn't clear it. In those cases, clear it after DMA unmapping. Cc: "James E.J. Bottomley" <jejb@linux.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20191203193052.7583-1-thomas_os@shipmail.org Suggested-by: Vishal Bhakta <vbhakta@vmware.com> Acked-by: Jim Gill <jgill@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: csiostor: Adjust indentation in csio_device_resetNathan Chancellor2019-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Clang warns: ../drivers/scsi/csiostor/csio_scsi.c:1386:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] csio_lnodes_exit(hw, 1); ^ ../drivers/scsi/csiostor/csio_scsi.c:1382:2: note: previous statement is here if (*buf != '1') ^ 1 warning generated. This warning occurs because there is a space after the tab on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns. Fixes: a3667aaed569 ("[SCSI] csiostor: Chelsio FCoE offload driver") Link: https://github.com/ClangBuiltLinux/linux/issues/818 Link: https://lore.kernel.org/r/20191218014726.8455-1-natechancellor@gmail.com Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: aic7xxx: Adjust indentation in ahc_find_syncrateNathan Chancellor2019-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Clang warns: ../drivers/scsi/aic7xxx/aic7xxx_core.c:2317:5: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] if ((syncrate->sxfr_u2 & ST_SXFR) != 0) ^ ../drivers/scsi/aic7xxx/aic7xxx_core.c:2310:4: note: previous statement is here if (syncrate == &ahc_syncrates[maxsync]) ^ 1 warning generated. This warning occurs because there is a space amongst the tabs on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns. This has been a problem since the beginning of git history hence no fixes tag. Link: https://github.com/ClangBuiltLinux/linux/issues/817 Link: https://lore.kernel.org/r/20191218014220.52746-1-natechancellor@gmail.com Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: qla4xxx: Adjust indentation in qla4xxx_mem_freeNathan Chancellor2019-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Clang warns: ../drivers/scsi/qla4xxx/ql4_os.c:4148:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] if (ha->fw_dump) ^ ../drivers/scsi/qla4xxx/ql4_os.c:4144:2: note: previous statement is here if (ha->queues) ^ 1 warning generated. This warning occurs because there is a space after the tab on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns. Fixes: 068237c87c64 ("[SCSI] qla4xxx: Capture minidump for ISP82XX on firmware failure") Link: https://github.com/ClangBuiltLinux/linux/issues/819 Link: https://lore.kernel.org/r/20191218015252.20890-1-natechancellor@gmail.com Acked-by: Manish Rangankar <mrangankar@marvell.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: libfc: remove unnecessary assertion on ep variableAditya Pakki2019-12-191-1/+0
| | | | | | | | | | In ft_recv_write_data(), the pointer ep is dereferenced first and then asserts for NULL. The patch removes the unnecessary assertion. Link: https://lore.kernel.org/r/20191217212214.30722-1-pakki001@umn.edu Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: initio: make initio_state_7() staticChen Zhou2019-12-191-1/+1
| | | | | | | | | | | Fix sparse warning: drivers/scsi/initio.c:1643:5: warning: symbol 'initio_state_7' was not declared. Should it be static? Link: https://lore.kernel.org/r/20191217134309.41649-1-chenzhou10@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Chen Zhou <chenzhou10@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ibmvscsi_tgt: remove set but not used variables 'iue' and 'sd'Chen Zhou2019-12-191-5/+0
| | | | | | | | | | | | | | Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function ibmvscsis_send_messages: drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1888:19: warning: variable iue set but not used [-Wunused-but-set-variable] drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function ibmvscsis_queue_data_in: drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:3806:8: warning: variable sd set but not used [-Wunused-but-set-variable] Link: https://lore.kernel.org/r/20191213064042.161840-1-chenzhou10@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Chen Zhou <chenzhou10@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: sym53c8xx: fix typos in commentsChen Zhou2019-12-191-2/+2
| | | | | | | | Fix the typo "GPOI" -> "GPIO" in comment. Link: https://lore.kernel.org/r/20191212023556.72618-1-chenzhou10@huawei.com Signed-off-by: Chen Zhou <chenzhou10@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: core: Fix a compiler warning triggered by the SCSI logging codeBart Van Assche2019-12-191-1/+1
| | | | | | | | | | | | | | | | | | This patch fixes the following compiler warning: In file included from drivers/scsi/scsi_error.c:46: drivers/scsi/scsi_error.c: In function 'scsi_eh_target_reset': drivers/scsi/scsi_logging.h:65:81: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] 65 | LOGGING(SCSI_LOG_ERROR_SHIFT, SCSI_LOG_ERROR_BITS, LEVEL,CMD); | ^ drivers/scsi/scsi_error.c:1562:4: note: in expansion of macro 'SCSI_LOG_ERROR_RECOVERY' 1562 | SCSI_LOG_ERROR_RECOVERY(3, | ^~~~~~~~~~~~~~~~~~~~~~~ Link: https://lore.kernel.org/r/20191209174205.190025-1-bvanassche@acm.org Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Power off hook for Cadence UFS driverSheeba B2019-12-191-0/+1
| | | | | | | | | | Attach power off hook to Cadence UFS driver. Link: https://lore.kernel.org/r/1576491432-631-1-git-send-email-sheebab@cadence.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Sheeba B <sheebab@cadence.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: disable interrupt during clock-gatingStanley Chu2019-12-191-0/+4
| | | | | | | | | | | Similar to suspend, ufshcd interrupt can be disabled since there won't be any host controller transaction expected till clocks ungated. Link: https://lore.kernel.org/r/1575721321-8071-3-git-send-email-stanley.chu@mediatek.com Reviewed-by: Asutosh Das <asutoshd@codeaurora.org> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: disable irq before disabling clocksStanley Chu2019-12-191-5/+6
| | | | | | | | | | | | | | | | | During suspend flow, interrupt shall be disabled before disabling clocks to avoid potential system hang due to accessing host registers after host clocks are disabled. For example, if an interrupt comes with IRQF_IRQPOLL flag configured with the misrouted interrupt recovery feature enabled, ufshcd ISR may be triggered even if nothing shall be done for UFS. In this case, system hang may happen if UFS interrupt status register is accessed with host clocks disabled. Link: https://lore.kernel.org/r/1575721321-8071-2-git-send-email-stanley.chu@mediatek.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Simplify a conditionDan Carpenter2019-12-191-2/+1
| | | | | | | | | | | We know that "check_for_bkops" is non-zero on this side of the || because it was checked on the other side. Link: https://lore.kernel.org/r/20191213104935.wgpq2epaz6zh5zus@kili.mountain Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Unlock on a couple error pathsDan Carpenter2019-12-191-4/+10
| | | | | | | | | | | We introduced a few new error paths, but we can't return directly, we first have to unlock "hba->clk_scaling_lock" first. Fixes: a276c19e3e98 ("scsi: ufs: Avoid busy-waiting by eliminating tag conflicts") Link: https://lore.kernel.org/r/20191213104828.7i64cpoof26rc4fw@kili.mountain Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Update L4 attributes on manual hibern8 exit in Cadence UFS.Sheeba B2019-12-191-0/+106
| | | | | | | | | | | Backup L4 attributes duirng manual hibern8 entry and restore the L4 attributes on manual hibern8 exit as per JESD220C. Link: https://lore.kernel.org/r/1575606303-10917-1-git-send-email-sheebab@cadence.com Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Tested-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Sheeba B <sheebab@cadence.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: delete unused structure filed trBean Huo2019-12-191-2/+1
| | | | | | | | | | | Delete unused structure field tr in structure utp_upiu_req, since no person uses it for task management. Fixes: df032bf27a41 ("scsi: ufs: Add a bsg endpoint that supports UPIUs") Link: https://lore.kernel.org/r/20191205220912.5696-1-huobean@gmail.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Do not free irq in suspendCan Guo2019-12-191-14/+4
| | | | | | | | | | | | Since ufshcd irq resource is allocated with the device resource management aware IRQ request implementation, we don't really need to free up irq during suspend, disabling it during suspend and reenabling it during resume should be good enough. Link: https://lore.kernel.org/r/0101016ed3d69793-22918f99-23bf-495d-8a36-a9c108d1cbce-000000@us-west-2.amazonses.com Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Do not clear the DL layer timersCan Guo2019-12-192-0/+31
| | | | | | | | | | | | | | | | | | | During power mode change, PACP_PWR_Req frame sends PAPowerModeUserData parameters (and they are considered valid by device if Flags[4] - UserDataValid bit is set in the same frame). Currently we don't set these PAPowerModeUserData parameters and hardware always sets UserDataValid bit which would clear all the DL layer timeout values of the peer device after the power mode change. This change sets the PAPowerModeUserData[0..5] to UniPro specification recommended default values, in addition we are also setting the relevant DME_LOCAL_* timer attributes as required by UFS HCI specification. Link: https://lore.kernel.org/r/0101016ed3d688a4-cfaeb1c9-238b-46c4-9c89-d48c410ba325-000000@us-west-2.amazonses.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Release clock if DMA map failsCan Guo2019-12-191-0/+1
| | | | | | | | | | | | In queuecommand path, if DMA map fails, it bails out with clock held. In this case, release the clock to keep its usage paired. [mkp: applied by hand] Link: https://lore.kernel.org/r/0101016ed3d66395-1b7e7fce-b74d-42ca-a88a-4db78b795d3b-000000@us-west-2.amazonses.com Reviewed-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Use DBD setting in mode senseCan Guo2019-12-191-0/+3
| | | | | | | | | | | | | | | | | | | UFS standard requires DBD field to be set to 1 in MODE SENSE(10). Some card vendors are more strict and check the DBD field, hence respond with CHECK_CONDITION (Sense key set to ILLEGAL_REQUEST and ASC set to INVALID FIELD IN CDB). When host sends MODE SENSE for page caching, as a result of the CHECK_CONDITION response, host assumes that the device doesn't support the cache feature and doesn't send SYNCHRONIZE_CACHE commands to flush the device cache. This can result in data corruption in case of sudden power down when there is data stored in the device cache. This patch fixes the DBD field setting as required in UFS standard. Link: https://lore.kernel.org/r/0101016ed3d657e4-32a6dd52-1505-4312-97ff-2bd3bee59eb7-000000@us-west-2.amazonses.com Reviewed-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: core: Adjust DBD setting in MODE SENSE for caching mode page per LLDCan Guo2019-12-192-0/+3
| | | | | | | | | | | UFS JEDEC standards require DBD field to be set to 1 in mode sense command. This patch allows LLD to define the setting of DBD, if required. Link: https://lore.kernel.org/r/0101016ed3d643f9-ffd45d6c-c593-4a13-a18f-a32da3d3bb97-000000@us-west-2.amazonses.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Complete pending requests in host reset and restore pathCan Guo2019-12-192-14/+12
| | | | | | | | | | | | | | | | | | | | | | In UFS host reset and restore path, before probe, we stop and start the host controller once. After host controller is stopped, the pending requests, if any, are cleared from the doorbell, but no completion IRQ would be raised due to the hba is stopped. These pending requests shall be completed along with the first NOP_OUT command (as it is the first command which can raise a transfer completion IRQ) sent during probe. Since the OCSs of these pending requests are not SUCCESS (because they are not yet literally finished), their UPIUs shall be dumped. When there are multiple pending requests, the UPIU dump can be overwhelming and may lead to stability issues because it is in atomic context. Therefore, before probe, complete these pending requests right after host controller is stopped and silence the UPIU dump from them. Link: https://lore.kernel.org/r/1574751214-8321-5-git-send-email-cang@qti.qualcomm.com Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Tested-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Avoid messing up the compl_time_stamp of lrbsCan Guo2019-12-191-2/+2
| | | | | | | | | | | | | | To be on the safe side, do not touch lrb after clearing its slot in the lrb_in_use bitmap to avoid messing up the next task which would possibly occupy this lrb. [mkp: applied by hand] Link: https://lore.kernel.org/r/1574751214-8321-4-git-send-email-cang@qti.qualcomm.com Reviewed by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Update VCCQ2 and VCCQ min/max voltage hard codesCan Guo2019-12-191-3/+3
| | | | | | | | | | | | | Per UFS 3.0 JEDEC standard, the VCCQ2 min voltage is 1.7v and the VCCQ voltage range is 1.14v ~ 1.26v. Update their hard codes accordingly to make sure they work in a safe range compliant for ver 1.0/1.1/2.0/2.1/3.0 UFS devices. Link: https://lore.kernel.org/r/1574751214-8321-3-git-send-email-cang@qti.qualcomm.com Reviewed-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Recheck bkops level if bkops is disabledAsutosh Das2019-12-191-0/+3
| | | | | | | | | | | | | | | | | bkops level should be rechecked upon receiving an exception. Currently the level is being cached and never updated. Update bkops each time the level is checked. Also do not use the cached bkops level value if it is disabled and then enabled. Fixes: afdfff59a0e0 (scsi: ufs: handle non spec compliant bkops behaviour by device) Link: https://lore.kernel.org/r/1574751214-8321-2-git-send-email-cang@qti.qualcomm.com Reviewed-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Tested-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFsBart Van Assche2019-12-192-62/+80
| | | | | | | | | | | | | | | | | Manage TMF tags with blk_{get,put}_request() instead of ufshcd_get_tm_free_slot() / ufshcd_put_tm_slot(). Store a per-request completion pointer in request.end_io_data instead of using a waitqueue to report TMF completion. Cc: Can Guo <cang@codeaurora.org> Cc: Stanley Chu <stanley.chu@mediatek.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20191209181309.196233-3-bvanassche@acm.org Tested-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: ufs: Avoid busy-waiting by eliminating tag conflictsBart Van Assche2019-12-192-77/+50
| | | | | | | | | | | | | | | | | | | | | Instead of tracking which tags are in use in the ufs_hba.lrb_in_use bitmask, rely on the block layer tag allocation mechanism. This patch removes the following busy-waiting loop if ufshcd_issue_devman_upiu_cmd() and the block layer accidentally allocate the same tag for a SCSI request: * ufshcd_queuecommand() returns SCSI_MLQUEUE_HOST_BUSY. * The SCSI core requeues the SCSI command. Cc: Can Guo <cang@codeaurora.org> Cc: Stanley Chu <stanley.chu@mediatek.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20191209181309.196233-2-bvanassche@acm.org Tested-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: esp_scsi: Add support for FSC chipKars de Jong2019-12-192-16/+28
| | | | | | | | | | | | | | | | | The FSC (NCR53CF9x-2 / SYM53CF9x-2) has a different family code than QLogic or Emulex parts. This caused it to be detected as a FAS100A. Unforunately, this meant the configuration of the CONFIG3 register was incorrect. This causes data transfer issues with FAST-SCSI targets. The FSC also has the CONFIG4 register. It can be used to enable a feature called Active Negation which should always be enabled according to the data manual. Link: https://lore.kernel.org/r/20191119202021.28720-3-jongk@linux-m68k.org Reviewed-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Kars de Jong <jongk@linux-m68k.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: esp_scsi: Correct ordering of PCSCSI definition in esp_rev enumKars de Jong2019-12-192-9/+10
| | | | | | | | | | | | | | | | | | | The order of the definitions in the esp_rev enum is important. The values are used in comparisons for chip features. Add a comment to the enum explaining this. Also, the actual values for the enum fields are irrelevant, so remove the explicit values (suggested by Geert Uytterhoeven). This makes adding a new field in the middle of the enum easier. Finally, move the PCSCSI definition to the right place in the enum. In its previous location, at the end of the enum, the wrong values are written to the CONFIG3 register when used with FAST-SCSI targets. Link: https://lore.kernel.org/r/20191119202021.28720-2-jongk@linux-m68k.org Signed-off-by: Kars de Jong <jongk@linux-m68k.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* Linux 5.5-rc2v5.5-rc2Linus Torvalds2019-12-151-1/+1
|
* Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdmaLinus Torvalds2019-12-1513-73/+180
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull rdma fixes from Doug Ledford: "A small collection of -rc fixes. Mostly. One API addition, but that's because we wanted to use it in a fix. There's also a bug fix that is going to render the 5.5 kernel's soft-RoCE driver incompatible with all soft-RoCE versions prior, but it's required to actually implement the protocol according to the RoCE spec and required in order for the soft-RoCE driver to be able to successfully work with actual RoCE hardware. Summary: - Update Steve Wise info - Fix for soft-RoCE crc calculations (will break back compatibility, but only with the soft-RoCE driver, which has had this bug since it was introduced and it is an on-the-wire bug, but will make soft-RoCE fully compatible with real RoCE hardware) - cma init fixup - counters oops fix - fix for mlx4 init/teardown sequence - fix for mkx5 steering rules - introduce a cleanup API, which isn't a fix, but we want to use it in the next fix - fix for mlx5 memory management that uses API in previous patch" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: IB/mlx5: Fix device memory flows IB/core: Introduce rdma_user_mmap_entry_insert_range() API IB/mlx5: Fix steering rule of drop and count IB/mlx4: Follow mirror sequence of device add during device removal RDMA/counter: Prevent auto-binding a QP which are not tracked with res rxe: correctly calculate iCRC for unaligned payloads Update mailmap info for Steve Wise RDMA/cma: add missed unregister_pernet_subsys in init failure
| * IB/mlx5: Fix device memory flowsYishai Hadas2019-12-124-52/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix device memory flows so that only once there will be no live mmaped VA to a given allocation the matching object will be destroyed. This prevents a potential scenario that existing VA that was mmaped by one process might still be used post its deallocation despite that it's owned now by other process. The above is achieved by integrating with IB core APIs to manage mmap/munmap. Only once the refcount will become 0 the DM object and its underlay area will be freed. Fixes: 3b113a1ec3d4 ("IB/mlx5: Support device memory type attribute") Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Link: https://lore.kernel.org/r/20191212100237.330654-3-leon@kernel.org Signed-off-by: Doug Ledford <dledford@redhat.com>
| * IB/core: Introduce rdma_user_mmap_entry_insert_range() APIYishai Hadas2019-12-122-9/+44
| | | | | | | | | | | | | | | | | | | | Introduce rdma_user_mmap_entry_insert_range() API to be used once the required key for the given entry should be in a given range. Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Link: https://lore.kernel.org/r/20191212100237.330654-2-leon@kernel.org Signed-off-by: Doug Ledford <dledford@redhat.com>
| * IB/mlx5: Fix steering rule of drop and countMaor Gottlieb2019-12-121-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | There are two flow rule destinations: QP and packet. While users are setting DROP packet rule, the QP should not be set as a destination. Fixes: 3b3233fbf02e ("IB/mlx5: Add flow counters binding support") Signed-off-by: Maor Gottlieb <maorg@mellanox.com> Reviewed-by: Raed Salem <raeds@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Link: https://lore.kernel.org/r/20191212091214.315005-4-leon@kernel.org Signed-off-by: Doug Ledford <dledford@redhat.com>
| * IB/mlx4: Follow mirror sequence of device add during device removalParav Pandit2019-12-121-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code device add sequence is: ib_register_device() ib_mad_init() init_sriov_init() register_netdev_notifier() Therefore, the remove sequence should be, unregister_netdev_notifier() close_sriov() mad_cleanup() ib_unregister_device() However it is not above. Hence, make do above remove sequence. Fixes: fa417f7b520ee ("IB/mlx4: Add support for IBoE") Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Maor Gottlieb <maorg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Link: https://lore.kernel.org/r/20191212091214.315005-3-leon@kernel.org Signed-off-by: Doug Ledford <dledford@redhat.com>
| * RDMA/counter: Prevent auto-binding a QP which are not tracked with resMark Zhang2019-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some QPs (e.g. XRC QP) are not tracked in kernel, in this case they have an invalid res and should not be bound to any dynamically-allocated counter in auto mode. This fixes below call trace: BUG: kernel NULL pointer dereference, address: 0000000000000390 PGD 80000001a7233067 P4D 80000001a7233067 PUD 1a7215067 PMD 0 Oops: 0000 [#1] SMP PTI CPU: 2 PID: 24822 Comm: ibv_xsrq_pingpo Not tainted 5.4.0-rc5+ #21 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014 RIP: 0010:rdma_counter_bind_qp_auto+0x142/0x270 [ib_core] Code: e1 48 85 c0 48 89 c2 0f 84 bc 00 00 00 49 8b 06 48 39 42 48 75 d6 40 3a aa 90 00 00 00 75 cd 49 8b 86 00 01 00 00 48 8b 4a 28 <8b> 80 90 03 00 00 39 81 90 03 00 00 75 b4 85 c0 74 b0 48 8b 04 24 RSP: 0018:ffffc900003f39c0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000 RDX: ffff88820020ec00 RSI: 0000000000000004 RDI: ffffffffffffffc0 RBP: 0000000000000001 R08: ffff888224149ff0 R09: ffffc900003f3968 R10: ffffffffffffffff R11: ffff8882249c5848 R12: ffffffffffffffff R13: ffff88821d5aca50 R14: ffff8881f7690800 R15: ffff8881ff890000 FS: 00007fe53a3e1740(0000) GS:ffff888237b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000390 CR3: 00000001a7292006 CR4: 00000000003606a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: _ib_modify_qp+0x3a4/0x3f0 [ib_core] ? lookup_get_idr_uobject.part.8+0x23/0x40 [ib_uverbs] modify_qp+0x322/0x3e0 [ib_uverbs] ib_uverbs_modify_qp+0x43/0x70 [ib_uverbs] ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xb1/0xf0 [ib_uverbs] ib_uverbs_run_method+0x6be/0x760 [ib_uverbs] ? uverbs_disassociate_api+0xd0/0xd0 [ib_uverbs] ib_uverbs_cmd_verbs+0x18d/0x3a0 [ib_uverbs] ? get_acl+0x1a/0x120 ? __alloc_pages_nodemask+0x15d/0x2c0 ib_uverbs_ioctl+0xa7/0x110 [ib_uverbs] do_vfs_ioctl+0xa5/0x610 ksys_ioctl+0x60/0x90 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x48/0x110 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 99fa331dc862 ("RDMA/counter: Add "auto" configuration mode support") Signed-off-by: Mark Zhang <markz@mellanox.com> Reviewed-by: Maor Gottlieb <maorg@mellanox.com> Reviewed-by: Ido Kalir <idok@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Link: https://lore.kernel.org/r/20191212091214.315005-2-leon@kernel.org Signed-off-by: Doug Ledford <dledford@redhat.com>
| * rxe: correctly calculate iCRC for unaligned payloadsSteve Wise2019-12-093-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If RoCE PDUs being sent or received contain pad bytes, then the iCRC is miscalculated, resulting in PDUs being emitted by RXE with an incorrect iCRC, as well as ingress PDUs being dropped due to erroneously detecting a bad iCRC in the PDU. The fix is to include the pad bytes, if any, in iCRC computations. Note: This bug has caused broken on-the-wire compatibility with actual hardware RoCE devices since the soft-RoCE driver was first put into the mainstream kernel. Fixing it will create an incompatibility with the original soft-RoCE devices, but is necessary to be compatible with real hardware devices. Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: Steve Wise <larrystevenwise@gmail.com> Link: https://lore.kernel.org/r/20191203020319.15036-2-larrystevenwise@gmail.com Signed-off-by: Doug Ledford <dledford@redhat.com>
| * Update mailmap info for Steve WiseSteve Wise2019-12-091-0/+2
| | | | | | | | | | | | Signed-off-by: Steve Wise <larrystevenwise@gmail.com> Link: https://lore.kernel.org/r/20191203020319.15036-1-larrystevenwise@gmail.com Signed-off-by: Doug Ledford <dledford@redhat.com>
| * RDMA/cma: add missed unregister_pernet_subsys in init failureChuhong Yuan2019-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The driver forgets to call unregister_pernet_subsys() in the error path of cma_init(). Add the missed call to fix it. Fixes: 4be74b42a6d0 ("IB/cma: Separate port allocation to network namespaces") Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Reviewed-by: Parav Pandit <parav@mellanox.com> Link: https://lore.kernel.org/r/20191206012426.12744-1-hslester96@gmail.com Signed-off-by: Doug Ledford <dledford@redhat.com>
* | Merge tag 'riscv/for-v5.5-rc2' of ↵Linus Torvalds2019-12-152-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Paul Walmsley: "Two minor build fixes: - Fix builds of the ELF loader when built with 'make -j1' (nommu only) - Fix CONFIG_SOC_SIFIVE builds when CONFIG_TTY is disabled (found during randconfig testing)" * tag 'riscv/for-v5.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: only select serial sifive if TTY is enabled riscv: Fix build dependency for loader
| * | riscv: only select serial sifive if TTY is enabledKefeng Wang2019-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is some warning if TTY is not enabled, and lead to build error, only select serial sifive if TTY enabled, and this also makes randconfig happy. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> [paul.walmsley@sifive.com: updated to apply] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
| * | riscv: Fix build dependency for loaderOlof Johansson2019-12-081-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Makefile addition for the flat image loader missed an obj prefix. For most parallel builds this worked out fine, but with -j1 the dependency wasn't fulfilled and thus fails: arch/riscv/boot/loader.S: Assembler messages: arch/riscv/boot/loader.S:7: Error: file not found: arch/riscv/boot/Image Fixes: 405fe7aa0dba ("riscv: provide a flat image loader") Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Olof Johansson <olof@lixom.net> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
* | Merge tag 'for-linus-5.5b-rc2-tag' of ↵Linus Torvalds2019-12-152-1/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "Two fixes: one for a resource accounting bug in some configurations and a fix for another patch which went into rc1" * tag 'for-linus-5.5b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/balloon: fix ballooned page accounting without hotplug enabled xen-blkback: prevent premature module unload
| * | xen/balloon: fix ballooned page accounting without hotplug enabledJuergen Gross2019-12-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is not defined reserve_additional_memory() will set balloon_stats.target_pages to a wrong value in case there are still some ballooned pages allocated via alloc_xenballooned_pages(). This will result in balloon_process() no longer be triggered when ballooned pages are freed in batches. Reported-by: Nicholas Tsirakis <niko.tsirakis@gmail.com> Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Juergen Gross <jgross@suse.com>
| * | xen-blkback: prevent premature module unloadPaul Durrant2019-12-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Objects allocated by xen_blkif_alloc come from the 'blkif_cache' kmem cache. This cache is destoyed when xen-blkif is unloaded so it is necessary to wait for the deferred free routine used for such objects to complete. This necessity was missed in commit 14855954f636 "xen-blkback: allow module to be cleanly unloaded". This patch fixes the problem by taking/releasing extra module references in xen_blkif_alloc/free() respectively. Signed-off-by: Paul Durrant <pdurrant@amazon.com> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Juergen Gross <jgross@suse.com>
* | | Merge branch 'remove-ksys-mount-dup' of ↵Linus Torvalds2019-12-159-41/+63
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux Pull ksys_mount() and ksys_dup() removal from Dominik Brodowski: "This small series replaces all in-kernel calls to the userspace-focused ksys_mount() and ksys_dup() with calls to kernel-centric functions: For each replacement of ksys_mount() with do_mount(), one needs to verify that the first and third parameter (char *dev_name, char *type) are strings allocated in kernelspace and that the fifth parameter (void *data) is either NULL or refers to a full page (only occurence in init/do_mounts.c::do_mount_root()). The second and fourth parameters (char *dir_name, unsigned long flags) are passed by ksys_mount() to do_mount() unchanged, and therefore do not require particular care. Moreover, instead of pretending to be userspace, the opening of /dev/console as stdin/stdout/stderr can be implemented using in-kernel functions as well. Thereby, ksys_dup() can be removed for good" [ This doesn't get rid of the special "kernel init runs with KERNEL_DS" case, but it at least removes _some_ of the users of "treat kernel pointers as user pointers for our magical init sequence". One day we'll hopefully be rid of it all, and can initialize our init_thread addr_limit to USER_DS. - Linus ] * 'remove-ksys-mount-dup' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: fs: remove ksys_dup() init: unify opening /dev/console as stdin/stdout/stderr init: use do_mount() instead of ksys_mount() initrd: use do_mount() instead of ksys_mount() devtmpfs: use do_mount() instead of ksys_mount()
| * | | fs: remove ksys_dup()Dominik Brodowski2019-12-123-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ksys_dup() is used only at one place in the kernel, namely to duplicate fd 0 of /dev/console to stdout and stderr. The same functionality can be achieved by using functions already available within the kernel namespace. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * | | init: unify opening /dev/console as stdin/stdout/stderrDominik Brodowski2019-12-123-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge the two instances where /dev/console is opened as stdin/stdout/stderr. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * | | init: use do_mount() instead of ksys_mount()Dominik Brodowski2019-12-123-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In prepare_namespace(), do_mount() can be used instead of ksys_mount() as the first and third argument are const strings in the kernel, the second and fourth argument are passed through anyway, and the fifth argument is NULL. In do_mount_root(), ksys_mount() is called with the first and third argument being already kernelspace strings, which do not need to be copied over from userspace to kernelspace (again). The second and fourth arguments are passed through to do_mount() anyway. The fifth argument, while already residing in kernelspace, needs to be put into a page of its own. Then, do_mount() can be used instead of ksys_mount(). Once this is done, there are no in-kernel users to ksys_mount() left, which can therefore be removed. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>