Re: [PATCH] scsi: sd: don't crash the host on invalid commands

2018-09-20 Thread Johannes Thumshirn
On Thu, Sep 20, 2018 at 11:18:19AM -0700, Bart Van Assche wrote: > On Thu, 2018-09-20 at 09:19 +0200, Johannes Thumshirn wrote: > > Have you considered to use WARN_ON_ONCE() instead of WARN_ON(1)? Otherwise > this patch looks good to me. Indeed I did and then forgot to 'git commit --amend' it bef

Re: [PATCH v2 1/6] mpt3sas: Introduce mpt3sas_base_pci_device_is_available

2018-09-20 Thread Sreekanth Reddy
On Thu, Sep 20, 2018 at 4:37 PM Christoph Hellwig wrote: > > > +u8 > > +mpt3sas_base_pci_device_is_available(struct MPT3SAS_ADAPTER *ioc) > > +{ > > + if (ioc->pci_error_recovery || > > + (!pci_device_is_present(ioc->pdev))) > > + return 0; > > + > > + return 1; >

Re: [PATCH] scsi: advansys: Remove unnecessary parentheses

2018-09-20 Thread Hannes Reinecke
On 9/20/18 10:58 PM, Nathan Chancellor wrote: Clang warns when multiple pairs of parentheses are used for a single conditional statement. drivers/scsi/advansys.c:6451:20: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((sdtr_

[PATCH v9 5/7] scsi: ufs: Power on phy after it is initialized

2018-09-20 Thread Can Guo
From: Can Guo Before UFS PHY is initialized, powering on it has no effect but increases the PHY's power on count. Then when power on PHY to enable it after phy initialization where it is really needed, as PHY's power on count is not zero, again it would do nothing but directly return and leaves t

[PATCH v9 4/7] scsi: ufs: Add core reset support

2018-09-20 Thread Can Guo
From: Dov Levenglick Enables core reset support. Add full initialization of the PHY and the controller before initializing UFS PHY and during link recovery. Signed-off-by: Dov Levenglick Signed-off-by: Amit Nischal Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo --- drivers/scsi/ufs/

[PATCH v9 0/7] Support for Qualcomm UFS QMP PHY on SDM845

2018-09-20 Thread Can Guo
From: Can Guo This patch series adds support for UFS QMP PHY on SDM845 and the compatible string for it. This patch series depends on the current proposed QMP V3 USB3 UNI PHY support for sdm845 driver [1], on the DT bindings for the QMP V3 USB3 PHYs based dirver [2], and also rebased on updated p

[PATCH v9 0/7] Support for Qualcomm UFS QMP PHY on SDM845

2018-09-20 Thread Can Guo
From: Can Guo This patch series adds support for UFS QMP PHY on SDM845 and the compatible string for it. This patch series depends on the current proposed QMP V3 USB3 UNI PHY support for sdm845 driver [1], on the DT bindings for the QMP V3 USB3 PHYs based dirver [2], and also rebased on updated p

Re: [PATCH] scsi: advansys: Remove unnecessary parentheses

2018-09-20 Thread Martin K. Petersen
Nathan, > Clang warns when multiple pairs of parentheses are used for a single > conditional statement. > > drivers/scsi/advansys.c:6451:20: warning: equality comparison with > extraneous parentheses [-Wparentheses-equality] > if ((sdtr_data == 0xFF)) { >

Re: [PATCH v5] target/iblock: split T10 PI SGL across command bios

2018-09-20 Thread Martin K. Petersen
Greg, > Split the PI SGL across the bios in the command, so each bio's > bio_integrity_payload contains the protection information for the data > in the bio. That is indeed how the bio integrity code is intended to be used. I have queued it up. Thanks! -- Martin K. Petersen Oracle Linux

Re: [PATCH] scsi: sd: Use info prints if no write cache

2018-09-20 Thread Martin K. Petersen
Per, > If the disk has no write cache the following errors are being logged. > * sd 1:0:0:0: [sdb] No Caching mode page found > * sd 1:0:0:0: [sdb] Assuming drive cache: write through > > Lower the severity from error to info. > The absence of a write cache should not be treated as an error. > T

Re: [PATCH v2] lpfc: Synchronize access to remoteport via rport

2018-09-20 Thread Martin K. Petersen
James, > The driver currently uses the ndlp to get the local rport which is > then used to get the nvme transport remoteport pointer. There can > be cases where a stale remoteport pointer is obtained as > synchronization isn't done through the different dereferences. > > Correct by using locks t

Re: [PATCH RFC] scsi: ufs: Disable blk-mq for now

2018-09-20 Thread Martin K. Petersen
Adrian, > blk-mq does not support runtime pm, so disable blk-mq support for now. Applied to 4.19/scsi-fixes. Looking forward to getting this fixed up properly in 4.20. Thanks! -- Martin K. Petersen Oracle Linux Engineering

[PATCH] ipr: System hung while dlpar adding primary ipr adapter back

2018-09-20 Thread wenxiong
From: Wen Xiong While dlpar adding primary ipr adapter back, driver goes through adapter initilization then schedule ipr_worker_thread to start te disk scan by dropping the host lock, calling scsi_add_device. Then get the adapter reset request again, so driver does scsi_block_requests, this will

[PATCH] scsi: qla2xxx: Simplify conditional check

2018-09-20 Thread Nathan Chancellor
Clang generates a warning when it sees a logical not followed by a conditional operator like ==, >, or < because it thinks that the logical not should be applied to the whole statement: drivers/scsi/qla2xxx/qla_nx.c:3702:7: warning: logical not is only applied to the left hand side of this compari

[PATCH] scsi: bfa: Remove unused functions

2018-09-20 Thread Nathan Chancellor
Clang warns when a variable is assigned to itself. drivers/scsi/bfa/bfa_fcbuild.c:199:6: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] len = len; ~~~ ^ ~~~ drivers/scsi/bfa/bfa_fcbuild.c:838:6: warning: explicitly assigning value of variabl

[PATCH] scsi: qla2xxx: Remove unnecessary self assignment

2018-09-20 Thread Nathan Chancellor
Clang warns when a variable is assigned to itself. drivers/scsi/qla2xxx/qla_mbx.c:1514:4: warning: explicitly assigning value of variable of type 'uint64_t' (aka 'unsigned long long') to itself [-Wself-assign] l = l; ~ ^ ~ 1 warning generated. This construct is usually used to avo

[PATCH] scsi: FlashPoint: Remove unnecessary parentheses

2018-09-20 Thread Nathan Chancellor
Clang warns when multiple pairs of parentheses are used for a single conditional statement. In file included from drivers/scsi/BusLogic.c:57: drivers/scsi/FlashPoint.c:2947:34: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((c

[PATCH] scsi: advansys: Remove unnecessary parentheses

2018-09-20 Thread Nathan Chancellor
Clang warns when multiple pairs of parentheses are used for a single conditional statement. drivers/scsi/advansys.c:6451:20: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((sdtr_data == 0xFF)) {

[PATCH] scsi: arcmsr: Remove unnecessary parentheses

2018-09-20 Thread Nathan Chancellor
Clang warns when multiple pairs of parentheses are used for a single conditional statement. drivers/scsi/arcmsr/arcmsr_hba.c:4138:19: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((acb->dev_id == 0x1680)) { ^ drivers/

[PATCH] scsi: mpt3sas: Remove unnecessary parentheses and simplify null checks

2018-09-20 Thread Nathan Chancellor
Clang warns when multiple pairs of parentheses are used for a single conditional statement. drivers/scsi/mpt3sas/mpt3sas_base.c:535:11: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((ioc == NULL)) ^~~ drivers/scsi/mpt3sas/mpt3sas

Re: [PATCH] scsi: sd: don't crash the host on invalid commands

2018-09-20 Thread Bart Van Assche
On Thu, 2018-09-20 at 09:19 +0200, Johannes Thumshirn wrote: > When sd_init_command() get's a with a unknown req_op() it crashes the > system via BUG(). > > This makes debugging the actual reason for the broken request > cmd_flags pretty hard as the system is down before it's able to write > out d

Re: sd 6:0:0:0: [sdb] Unaligned partial completion

2018-09-20 Thread Ted Cabeen
On 06/11/2018 04:08 PM, James Bottomley wrote: On Mon, 2018-06-11 at 14:59 -0700, Ted Cabeen wrote: On 06/11/2018 02:40 PM, James Bottomley wrote: On Mon, 2018-06-11 at 12:20 -0400, Douglas Gilbert wrote: I have also seen Aborted Command sense when doing heavy testing on one or more SAS disks

[PATCH v4 2/2] scsi: ufs: Add UFS platform driver for Cadence UFS

2018-09-20 Thread Janek Kotas
This patch adds a device tree platform driver for Cadence UFS Host Controller. It can be enabled with SCSI_UFS_CDNS_PLATFORM Kconfig option. Signed-off-by: Jan Kotas --- drivers/scsi/ufs/Kconfig | 8 +++ drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/cdns-pltfrm.c | 149 +++

[PATCH v4 0/2] scsi: ufs: Add UFS platform driver and bindings for Cadence UFS

2018-09-20 Thread Janek Kotas
This patchset adds a driver support for Cadence UFS controller. It was verified on Cadence Palladium emulation platform. Changes since V3: Updated comments and cleaned up the cdns-pltfrm.c. Changes since V2: Updated dt bindings documentation. Changes since V1: Renamed the

Re: [PATCH v5 4/6] scsi: ufs: Add API to execute raw upiu commands

2018-09-20 Thread Christoph Hellwig
On Thu, Sep 20, 2018 at 08:30:29AM +, Avri Altman wrote: > > > + > > > + hba->dev_cmd.complete = &wait; > > > + > > > + /* Make sure descriptors are ready before ringing the doorbell */ > > > + wmb(); > > > + spin_lock_irqsave(hba->host->host_lock, flags); > > > + ufshcd_send_command(hba, tag);

[PATCH v4 1/2] dt-bindings: ufs: Add bindings for Cadence UFS

2018-09-20 Thread Janek Kotas
This patch adds a DT binding documentation for Cadence UFS Host Controller. Signed-off-by: Jan Kotas --- .../devicetree/bindings/ufs/cdns,ufshc.txt | 31 ++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt diff

RE: [PATCH v5 5/6] scsi: ufs-bsg: Add support for raw upiu in ufs_bsg_request()

2018-09-20 Thread Avri Altman
> > +static inline struct ufs_hba *dev_to_ufs_hba(struct device *d) > > +{ > > + struct Scsi_Host *shost = dev_to_shost(d->parent); > > + > > + return shost_priv(shost); > > This just has one caller that culd directly do: > > struct ufs_hba *hba = shost_priv(dev_to_shost(job->dev-par

Re: [PATCH v2 1/6] mpt3sas: Introduce mpt3sas_base_pci_device_is_available

2018-09-20 Thread Christoph Hellwig
> +u8 > +mpt3sas_base_pci_device_is_available(struct MPT3SAS_ADAPTER *ioc) > +{ > + if (ioc->pci_error_recovery || > + (!pci_device_is_present(ioc->pdev))) > + return 0; > + > + return 1; > +} This should simplify be: bool mpt3sas_base_pci_device_is_available(stru

[PATCH v2 5/6] mpt3sas: Fix driver modifying NVRAM/persistent data.

2018-09-20 Thread Suganath Prabu S
* If EEDPTagMode field in manufacturing page11 is set, unset it. This is needed to fix a hardware bug in SAS3/SAS2 cards, So, skipping EEDPTagMode changes in Manufacturing page11 for SAS35 controllers. * Fix driver modifying NVRAM/persistent data in Manufacturing page11 along with current copy. Dr

[PATCH v2 4/6] mpt3sas: Fix Sync cache command failure during driver unload.

2018-09-20 Thread Suganath Prabu S
This is to fix Sync cache and start stop command failures with DID_NO_CONNECT during driver unload. 1) Release drives first from SML, then remove internally in driver. 2) And allow sync cache and Start stop commands to firmware, even when remove_host flag is set v2 Changeset: Replaced this funct

[PATCH v2 6/6] mpt3sas: Bump driver version to 27.100.00.00.

2018-09-20 Thread Suganath Prabu S
Modify driver version to 27.100.00.00 (which is equivalent to PH8 OOB driver) Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h

[PATCH v2 1/6] mpt3sas: Introduce mpt3sas_base_pci_device_is_available

2018-09-20 Thread Suganath Prabu S
* Driver uses "pci_device_is_present" to check whether If Hot unplugged: the outstanding IOs with 'DID_NO_CONNECT' before removing the drives attached to the HBA. "DID_NO_CONNECT" status and free the smid, if driver detects that HBA is hot unplugged. * In the hard reset flush out all the outstandi

[PATCH v2 0/6] mpt3sas: Hot-Plug Surprise removal support on IOC.

2018-09-20 Thread Suganath Prabu S
Posting below set of patches to support PCIe Hot Plug surprise removal, and few defect fixes. This is NOT the normal PCIe Hot Plug support, whereby the user informs the OS that a hot removal is desired, the OS does an orderly shutdown of the driver on the device, special hot plug circuitry removes

[PATCH v2 3/6] mpt3sas: Introdude _scsih_get_shost_and_ioc.

2018-09-20 Thread Suganath Prabu S
The code for getting shost and IOC is redundant so moved that to function "scsih_get_shost_and_ioc". Also checks for NULL are added to IOC and shost. Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 98 ++-- 1 file changed, 82 insertions(

[PATCH v2 2/6] mpt3sas: Separate out mpt3sas_wait_for_ioc_to_operational

2018-09-20 Thread Suganath Prabu S
Introduce mpt3sas_wait_for_ioc_to_operational. This section of code "wait for IOC to be operational" is used in many places across the driver, and hence moved this section of code in to the function "mpt3sas_wait_for_ioc_to_operational". Also added HBA hot unplug checks, and this returns with err

[PATCH] scsi: qla2xxx: don't allow negative thresholds

2018-09-20 Thread Dan Carpenter
We shouldn't allow negative thresholds. I don't know what it would do but it can't be good. Fixes: 8b4673ba3a1b ("scsi: qla2xxx: Add support for ZIO6 interrupt threshold") Signed-off-by: Dan Carpenter diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index a31d23905

[Bug 198975] Highpoint 840A RocketRAID Controller and drives are NOT detected by SCSI_HPTIOP kernel module

2018-09-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=198975 --- Comment #5 from Matthias Lippert (mae.lipp...@gmail.com) --- i contacted them and they doesnt seem to be interested to include the 800er series support into the mainline kernel. i asked for permission to use their released opensource drivers a

Re: [PATCH 4/6] qla2xxx_nvmet: Add FC-NVMe Target handling

2018-09-20 Thread Dan Carpenter
Hi Anil, I love your patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Himanshu-Madhani/qla2xxx-Add-FC-NVMe-Target-support/20180916-090108 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next smatch warnings: drivers/scsi/qla2xxx/qla

[PATCH] scsi: sd: Use info prints if no write cache

2018-09-20 Thread Per Forlin
From: Per Forlin If the disk has no write cache the following errors are being logged. * sd 1:0:0:0: [sdb] No Caching mode page found * sd 1:0:0:0: [sdb] Assuming drive cache: write through Lower the severity from error to info. The absence of a write cache should not be treated as an error. The

RE: [PATCH v5 4/6] scsi: ufs: Add API to execute raw upiu commands

2018-09-20 Thread Avri Altman
> > + lrbp->command_type = hba->ufs_version == UFSHCI_VERSION_10 || > > +hba->ufs_version == UFSHCI_VERSION_11 ? > > +UTP_CMD_TYPE_DEV_MANAGE : > > +UTP_CMD_TYPE_UFS_STORAGE; > > I think a good old if/self or even a switch s

[PATCH v2] scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes

2018-09-20 Thread xiubli
From: Xiubo Li Currently there has one cmd timeout timer and one qfull timer for each udev, and whenever there has any new coming cmd it will update the cmd timer or qfull timer. And for some corner case the timers are always working only for the ringbuffer's and full queue's newest cmd. That's t

Re: [PATCH] scsi: sd: don't crash the host on invalid commands

2018-09-20 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

[PATCH] scsi: sd: don't crash the host on invalid commands

2018-09-20 Thread Johannes Thumshirn
When sd_init_command() get's a with a unknown req_op() it crashes the system via BUG(). This makes debugging the actual reason for the broken request cmd_flags pretty hard as the system is down before it's able to write out debugging data on the serial console or the trace buffer. Change the BUG(

[PATCH] scsi: sd: don't crash the host on invalid commands

2018-09-20 Thread Johannes Thumshirn
When sd_init_command() get's a with a unknown req_op() it crashes the system via BUG(). This makes debugging the actual reason for the broken request cmd_flags pretty hard as the system is down before it's able to write out debugging data on the serial console or the trace buffer. Change the BUG(