[PATCH v2 2/3] lib: logic_pio: Reject access to unregistered CPU MMIO regions

2019-03-20 Thread John Garry
/arm-kernel/msg694702.html Signed-off-by: John Garry --- lib/logic_pio.c | 70 - 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/lib/logic_pio.c b/lib/logic_pio.c index feea48fd1a0d..026a4fb4b944 100644 --- a/lib/logic_pio.c +++ b/lib

[PATCH v2 0/3] Fix system crash for accessing unmapped IO port regions

2019-03-20 Thread John Garry
of region is ioport_resource - Add patch to fix some logic_pio.c prints John Garry (3): resource: Request IO port regions from children of ioport_resource lib: logic_pio: Reject access to unregistered CPU MMIO regions lib: logic_pio: Make some prints explicitly hex include/linux/iop

Re: [PATCH/RFC] driver core: Postpone DMA tear-down until after devres release

2019-03-07 Thread John Garry
On 07/03/2019 14:52, Robin Murphy wrote: Hi John, Hi Robin, ok, fine. It's a pain bisecting another rmmod issue with it... Cheers, On 07/03/2019 14:45, John Garry wrote: [...] Hi guys, Any idea what happened to this fix? It's been in -next for a while (commit 376991db4b64) - I assume

Re: [PATCH/RFC] driver core: Postpone DMA tear-down until after devres release

2019-03-07 Thread John Garry
On 11/02/2019 10:22, Robin Murphy wrote: On 08/02/2019 18:55, Geert Uytterhoeven wrote: Hi Robin, On Fri, Feb 8, 2019 at 6:55 PM Robin Murphy wrote: On 08/02/2019 16:40, Joerg Roedel wrote: On Thu, Feb 07, 2019 at 08:36:53PM +0100, Geert Uytterhoeven wrote: diff --git a/drivers/base/dd.c

Re: [PATCH RFC 1/1] iommu: set the default iommu-dma mode as non-strict

2019-03-06 Thread John Garry
(VFIO) is untrusted, ok. But a malicious driver loaded into the kernel address space would have much easier ways to corrupt the system than to exploit lazy mode... Yes, so that we have no need to consider untrusted drivers. For (3), I agree that we should at least disallow lazy mode if

[PATCH 6/6] scsi: hisi_sas: Change SERDES_CFG init value to increase reliability of HiLink

2019-02-28 Thread John Garry
Reviewed-by: Yupeng Zhou Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 720721196b12..e2f2c04355b9 100644 --- a/drivers/scsi/hisi_sas

[PATCH 0/6] hisi_sas: Some misc patches

2019-02-28 Thread John Garry
changes - Add support to coalesce and print PHY errors - A tidy-up patch John Garry (1): scsi: hisi_sas: Set PHY linkrate when disconnected Xiang Chen (4): scsi: hisi_sas: Change return variable type in phy_up_v3_hw() scsi: hisi_sas: Fix a timeout race of driver internal and SMP IO scsi

[PATCH 4/6] scsi: hisi_sas: Set PHY linkrate when disconnected

2019-02-28 Thread John Garry
t's imperfect, as sas_phy_data is internal to libsas. I can't see another way without adding a new field to hisi_sas_phy and managing it, or changing SCSI SAS transport. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 10 ++ 1 file changed, 10 insertions(+) diff --

[PATCH 2/6] scsi: hisi_sas: Fix a timeout race of driver internal and SMP IO

2019-02-28 Thread John Garry
237] [] scsi_error_handler+0x148/0x5c0 [ 729.206009] [] kthread+0x10c/0x138 [ 729.211563] [] ret_from_fork+0x10/0x18 To solve the issue, callback function task_done of those IOs need to be called when on SAS controller reset. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_

[PATCH 5/6] scsi: hisi_sas: Send HARD RESET to clear the previous affiliation of STP target port

2019-02-28 Thread John Garry
, and caller would wait for link to be established, cf. sas_ata_hard_reset(). Co-developed-by: Luo Jiaxing Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 7 drivers/scsi/hisi_sas/hisi_sas_main.c | 44 -- drivers/scsi

[PATCH 1/6] scsi: hisi_sas: Change return variable type in phy_up_v3_hw()

2019-02-28 Thread John Garry
From: Xiang Chen According to the tool fortify, phy_up_v3_hw() returns signed value, while it should return an unsigned value. So change variable "res" from int to irq_return_t. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 +

[PATCH 3/6] scsi: hisi_sas: print PHY RX errors count for later revision of v3 hw

2019-02-28 Thread John Garry
use hisi_sas_phy.lock to protect error count value. Because we update them by calling phy_get_events_v3_hw(), which is also used by core driver (for get PHY events function). We relocate phy_get_events_v3_hw() to avoid a further declaration. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry

Re: [PATCH -next] scsi: hisi_sas: remove duplicated code

2019-02-19 Thread John Garry
On 19/02/2019 14:40, YueHaibing wrote: move some functions to hisi_sas_main.c, which can eliminate redundant code. main.c is for core driver, and does not access hw directly - We have hw module - like hisi_sas_v1_hw.c - for this. You're moving hw accessors to main.c now. I don't think

[PATCH] ata: libahci: Only warn for AHCI_HFLAG_MULTI_MSI set when genuine custom irq handler implemented

2019-02-18 Thread John Garry
->irq_handler to ahci_single_level_irq_intr() if not already set, in ahci_init_one()->ahci_pci_save_initial_config()->ahci_save_initial_config(). Stop having this warn being misleading by adding a check for hpriv->irq_handler != ahci_single_level_irq_intr. Signed-off-by: John Garry

Re: [PATCH] net: hns: Fix object reference leaks in hns_dsaf_roce_reset()

2019-02-15 Thread John Garry
On 15/02/2019 11:25, Salil Mehta wrote: From: John Garry Sent: Friday, February 15, 2019 10:52 AM On 14/02/2019 06:41, Huang Zijiang wrote: The of_find_device_by_node() takes a reference to the underlying device structure, we should release that reference. of_find_device_by_node

Re: [PATCH] net: hns: Fix object reference leaks in hns_dsaf_roce_reset()

2019-02-15 Thread John Garry
On 14/02/2019 06:41, Huang Zijiang wrote: The of_find_device_by_node() takes a reference to the underlying device structure, we should release that reference. of_find_device_by_node() is not called for every path, so is this change proper: /* find the platform device corresponding

[PATCH] scsi: libsas: Fix rphy phy_identifier for PHYs with end devices attached

2019-02-14 Thread John Garry
3 platform-HISI0162:01-sas-exp0x500e004aaa1f-phy8-lun-0-part2 -> ../../sdf2 lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaa1f-phy8-lun-0-part3 -> ../../sdf3 Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Reported-by: dann frazier Signed-of

Re: [PATCH v2 2/2] cpufreq / cppc: Work around for Hisilicon CPPC cpufreq

2019-02-14 Thread John Garry
On 14/02/2019 07:46, Xiongfeng Wang wrote: Hisilicon chips do not support delivered performance counter register and reference performance counter register. But the platform can calculate the real performance using its own method. This patch provide a workaround for this problem, and other

Re: [PATCH v2 0/2] Work around for Hisilicon CPPC cpufreq

2019-02-14 Thread John Garry
On 14/02/2019 07:46, Xiongfeng Wang wrote: Hisilicon chips do not support delivered performance counter register and reference performance counter register. But the platform can calculate the real performance using its own method. This patch provide a workaround for this problem, and other

Re: linux-next: manual merge of the scsi-mkp tree with Linus' tree

2019-02-11 Thread John Garry
On 11/02/2019 04:31, Stephen Rothwell wrote: Hi all, Today's linux-next merge of the scsi-mkp tree got a conflict in: drivers/scsi/hisi_sas/hisi_sas_v3_hw.c between commit: 7bb25a89aad2 ("scsi: hisi_sas: Set protection parameters prior to adding SCSI host") from Linus' tree and commit:

[PATCH] ACPI/PPTT: Add acpi_pptt_warn_missing() to consolidate logs

2019-02-07 Thread John Garry
be inaccurate [7.145368] ACPI PPTT: No PPTT table found, cache topology may be inaccurate These logs are generated with pr_warn_once(), so the intention was for a single log, but the logs overlap, so consolidate them. Signed-off-by: John Garry diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c

[PATCH 1/6] scsi: hisi_sas: Add support for DIX feature for v3 hw

2019-02-06 Thread John Garry
Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 40 --- drivers/scsi/hisi_sas/hisi_sas_main.c | 96 +++--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 80 + 3 files changed, 184 insertions(+), 32 deletions(-) diff --git

[PATCH 5/6] scsi: hisi_sas: Use pci_irq_get_affinity() for v3 hw as experimental

2019-02-06 Thread John Garry
to sort out the per-HBA tags performance issue. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 4 ++ drivers/scsi/hisi_sas/hisi_sas_main.c | 33 ++--- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 1 + drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

[PATCH 2/6] scsi: hisi_sas: Add manual trigger for debugfs dump

2019-02-06 Thread John Garry
From: Luo Jiaxing Add an interface to manually trigger a debugfs dump. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 34 +++ 1 file changed, 34 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b

[PATCH 4/6] scsi: hisi_sas: Issue internal abort on all relevant queues

2019-02-06 Thread John Garry
to be issued on the same queue as the command which we are trying to abort. For aborting all commands associated with a device, we issue a separate internal abort on all relevant queues. Issuing multiple internal aborts in this fashion would have not side affect. Signed-off-by: John Garry Signed-off

[PATCH 6/6] scsi: hisi_sas: Do some more tidy-up

2019-02-06 Thread John Garry
Do some very minor tidy-up, for things like needlessly initing variable and not leaving whitespace before quote endings. Originally-from: Xiang Chen Originally-from: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 10 +- drivers/scsi/hisi_sas

[PATCH 0/6] hisi_sas: DIX support, performance optimisation, and misc patches

2019-02-06 Thread John Garry
idying and a driver debugfs feature This series is based on Martin's 5.1 queue + "scsi: hisi_sas: Set protection parameters prior to adding SCSI host" John Garry (2): scsi: hisi_sas: Issue internal abort on all relevant queues scsi: hisi_sas: Do some more tidy-up Luo Jiaxing (1):

[PATCH 3/6] scsi: hisi_sas: change queue depth from 512 to 4096

2019-02-06 Thread John Garry
From: Xiang Chen If sending IOs to many disks from single queue, it is possible that the queue may be full. To avoid the situation, change queue depth from 512 to 4096 which is the max number of IOs for v3 hw. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas

Re: Question on handling managed IRQs when hotplugging CPUs

2019-02-06 Thread John Garry
On 05/02/2019 18:23, Christoph Hellwig wrote: On Tue, Feb 05, 2019 at 03:09:28PM +, John Garry wrote: For SCSI devices, unfortunately not all IO sent to the HW originates from blk-mq or any other single entity. Where else would SCSI I/O originate from? Please note that I was referring

Re: Question on handling managed IRQs when hotplugging CPUs

2019-02-05 Thread John Garry
On 05/02/2019 15:15, Hannes Reinecke wrote: On 2/5/19 4:09 PM, John Garry wrote: On 05/02/2019 14:52, Keith Busch wrote: On Tue, Feb 05, 2019 at 05:24:11AM -0800, John Garry wrote: On 04/02/2019 07:12, Hannes Reinecke wrote: Hi Hannes, So, as the user then has to wait for the system

Re: Question on handling managed IRQs when hotplugging CPUs

2019-02-05 Thread John Garry
On 05/02/2019 14:52, Keith Busch wrote: On Tue, Feb 05, 2019 at 05:24:11AM -0800, John Garry wrote: On 04/02/2019 07:12, Hannes Reinecke wrote: Hi Hannes, So, as the user then has to wait for the system to declars 'ready for CPU remove', why can't we just disable the SQ and wait for all I/O

Re: Question on handling managed IRQs when hotplugging CPUs

2019-02-05 Thread John Garry
On 04/02/2019 07:12, Hannes Reinecke wrote: On 2/1/19 10:57 PM, Thomas Gleixner wrote: On Fri, 1 Feb 2019, Hannes Reinecke wrote: Thing is, if we have _managed_ CPU hotplug (ie if the hardware provides some means of quiescing the CPU before hotplug) then the whole thing is trivial; disable SQ

Re: [PATCH v2 4/7] scsi: libsas: split the replacement of sas disks in two steps

2019-02-01 Thread John Garry
On 01/02/2019 01:58, Jason Yan wrote: On 2019/2/1 0:38, John Garry wrote: On 31/01/2019 10:29, John Garry wrote: On 31/01/2019 02:04, Jason Yan wrote: On 2019/1/31 1:22, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: Now if a new device replaced a old device, the sas address

Re: [PATCH v2 7/7] scsi: libsas: fix issue of swapping two sas disks

2019-02-01 Thread John Garry
On 01/02/2019 02:04, Jason Yan wrote: On 2019/2/1 0:34, John Garry wrote: On 31/01/2019 02:55, Jason Yan wrote: On 2019/1/31 1:53, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: The work flow of revalidation now is scanning expander phy by the sequence of the phy and check

Re: Question on handling managed IRQs when hotplugging CPUs

2019-01-31 Thread John Garry
On 30/01/2019 12:43, Thomas Gleixner wrote: On Wed, 30 Jan 2019, John Garry wrote: On 29/01/2019 17:20, Keith Busch wrote: On Tue, Jan 29, 2019 at 05:12:40PM +, John Garry wrote: On 29/01/2019 15:44, Keith Busch wrote: Hm, we used to freeze the queues with CPUHP_BLK_MQ_PREPARE callback

Re: [PATCH v2 4/7] scsi: libsas: split the replacement of sas disks in two steps

2019-01-31 Thread John Garry
On 31/01/2019 10:29, John Garry wrote: On 31/01/2019 02:04, Jason Yan wrote: On 2019/1/31 1:22, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: Now if a new device replaced a old device, the sas address will change. Hmmm... not if it's a SATA disk, which would have some same

Re: [PATCH v2 7/7] scsi: libsas: fix issue of swapping two sas disks

2019-01-31 Thread John Garry
On 31/01/2019 02:55, Jason Yan wrote: On 2019/1/31 1:53, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: The work flow of revalidation now is scanning expander phy by the sequence of the phy and check if the phy have changed. This will leads to an issue of swapping two sas disks

Re: [PATCH v2 4/7] scsi: libsas: split the replacement of sas disks in two steps

2019-01-31 Thread John Garry
On 31/01/2019 02:04, Jason Yan wrote: On 2019/1/31 1:22, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: Now if a new device replaced a old device, the sas address will change. Hmmm... not if it's a SATA disk, which would have some same invented SAS address. Yes, it's only

Re: [PATCH v2 3/7] scsi: libsas: optimize the debug print of the revalidate process

2019-01-31 Thread John Garry
On 31/01/2019 01:31, Jason Yan wrote: On 2019/1/31 0:41, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: sas_rediscover() returns error code if discover failed for a expander phy. And sas_ex_revalidate_domain() only returns the last phy's error code. So when sas_revalidate_domain

Re: [RFC PATCH] USB: PCI: set 32bit DMA mask for PCI based USB controllers

2019-01-31 Thread John Garry
On 30/01/2019 07:01, Hanjun Guo wrote: From: Hanjun Guo We met an issue that when we update the IORT table to revision D, and the kernel update to 4.19, the USB on D06 (ARM64 based server) will probe fail: [ 13.495751] CPU: 0 PID: 15 Comm: kworker/0:1 Not tainted 4.19.0-00115-gb2b5200 #5 [

Re: [PATCH v2 6/7] scsi: libsas: reset the phy address if discover failed

2019-01-31 Thread John Garry
On 31/01/2019 02:13, Jason Yan wrote: On 2019/1/31 1:36, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: When we failed to discover the device, the phy address is still kept /s/phy/PHY/ in ex_phy. So when the next time we revalidate this phy the address and device type

Re: [PATCH v2 1/7] scsi: libsas: reset the negotiated_linkrate when phy is down

2019-01-31 Thread John Garry
On 31/01/2019 01:11, Jason Yan wrote: On 2019/1/30 21:08, John Garry wrote: On 30/01/2019 08:24, Jason Yan wrote: If the device is unplugged or disconnected, the negotiated_linkrate still can be seen from the userspace by sysfs. This makes people confused and leaks information of the device

Re: [PATCH v2 7/7] scsi: libsas: fix issue of swapping two sas disks

2019-01-30 Thread John Garry
next revalidation will process the discovering of the new devices. Tested-by: Chen Liangfei Signed-off-by: Jason Yan CC: Xiaofei Tan CC: chenxiang CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke

Re: [PATCH v2 6/7] scsi: libsas: reset the phy address if discover failed

2019-01-30 Thread John Garry
-by: Jason Yan CC: Xiaofei Tan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke --- drivers/scsi/libsas/sas_expander.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/libsas/sas_expander.c b

Re: [PATCH v2 4/7] scsi: libsas: split the replacement of sas disks in two steps

2019-01-30 Thread John Garry
revalidate again. Signed-off-by: Jason Yan CC: chenxiang CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke --- drivers/scsi/libsas/sas_discover.c | 20 +++- drivers/scsi/libsas/sas_expander.c | 20

Re: [PATCH v2 3/7] scsi: libsas: optimize the debug print of the revalidate process

2019-01-30 Thread John Garry
PHY, or just the PHY where res != 0? I don't see any optimisation here. Maybe an improvement. Signed-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke --- drivers/scsi/libsas

Re: [PATCH v2 2/7] scsi: libsas: only clear phy->in_shutdown after shutdown event done

2019-01-30 Thread John Garry
ent will clear phy->in_shutdown and a new shutdown-event will be queued. The queue will be full of these shutdown-events. Fix this by only clear phy->in_shutdown in sas_phye_shutdown(), that is after the first shutdown-event has been executed. Seems ok as a fix: Reviewed-by: John Garr

Re: [PATCH v2 1/7] scsi: libsas: reset the negotiated_linkrate when phy is down

2019-01-30 Thread John Garry
-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke --- drivers/scsi/libsas/sas_expander.c | 2 ++ include/scsi/libsas.h | 3 +++ 2 files changed, 5 insertions(+) diff --git

Re: Question on handling managed IRQs when hotplugging CPUs

2019-01-30 Thread John Garry
On 29/01/2019 17:20, Keith Busch wrote: On Tue, Jan 29, 2019 at 05:12:40PM +, John Garry wrote: On 29/01/2019 15:44, Keith Busch wrote: Hm, we used to freeze the queues with CPUHP_BLK_MQ_PREPARE callback, which would reap all outstanding commands before the CPU and IRQ are taken offline

Re: Question on handling managed IRQs when hotplugging CPUs

2019-01-29 Thread John Garry
On 29/01/2019 16:27, Thomas Gleixner wrote: On Tue, 29 Jan 2019, John Garry wrote: On 29/01/2019 12:01, Thomas Gleixner wrote: If the last CPU which is associated to a queue (and the corresponding interrupt) goes offline, then the subsytem/driver code has to make sure that: 1) No more

Re: Question on handling managed IRQs when hotplugging CPUs

2019-01-29 Thread John Garry
On 29/01/2019 15:44, Keith Busch wrote: On Tue, Jan 29, 2019 at 03:25:48AM -0800, John Garry wrote: Hi, I have a question on $subject which I hope you can shed some light on. According to commit c5cb83bb337c25 ("genirq/cpuhotplug: Handle managed IRQs on CPU hotplug"), if we offlin

Re: Question on handling managed IRQs when hotplugging CPUs

2019-01-29 Thread John Garry
Hi Hannes, Thomas, On 29/01/2019 12:01, Thomas Gleixner wrote: On Tue, 29 Jan 2019, Hannes Reinecke wrote: That actually is a very good question, and I have been wondering about this for quite some time. I find it a bit hard to envision a scenario where the IRQ affinity is automatically (and,

Question on handling managed IRQs when hotplugging CPUs

2019-01-29 Thread John Garry
Hi, I have a question on $subject which I hope you can shed some light on. According to commit c5cb83bb337c25 ("genirq/cpuhotplug: Handle managed IRQs on CPU hotplug"), if we offline the last CPU in a managed IRQ affinity mask, the IRQ is shutdown. The reasoning is that this IRQ is thought

Re: [PATCH] block: set rq->cmd_flags with bio->opf instead of data->cmd_flags when bio is not Null

2019-01-28 Thread John Garry
On 28/01/2019 15:57, Christoph Hellwig wrote: On Mon, Jan 28, 2019 at 03:36:58PM +, John Garry wrote: As I understood, the problem is the scenario of calling blk_mq_make_request()->bio_integrity_prep() where we then allocate a bio integrity payload in calling bio_integrity_al

Re: [PATCH] block: set rq->cmd_flags with bio->opf instead of data->cmd_flags when bio is not Null

2019-01-28 Thread John Garry
On 28/01/2019 14:07, Christoph Hellwig wrote: for rq->cmd_flags. It will cause dix=0 in function sd_setup_read_write_cmnd() when enabled DIX, which will cause IO exception when enabled DIX. For some IOs such as internal IO from SCSI layer, the parameter bio of function blk_mq_get_request() is

[PATCH 00/13] hisi_sas: Misc fixes and other more minor patches

2019-01-25 Thread John Garry
This series includes a misc assortment of fixes found during testing. Also includes is some debugfs tidy-up and a patch missed from original upstreaming. John Garry (5): scsi: hisi_sas: No need to check return value of debugfs_create functions scsi: hisi_sas: Fix type casting and missing

[PATCH 06/13] scsi: hisi_sas: remove the check of sas_dev status in hisi_sas_I_T_nexus_reset()

2019-01-25 Thread John Garry
loop of reset for directly-attached SATA device at probe time, actually we flutter it for it, so it is not necessary to add the check now. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 6 -- drivers/scsi/hisi_sas/hisi_sas_main.c | 9

[PATCH 02/13] scsi: hisi_sas: Fix type casting and missing static qualifier in debugfs code

2019-01-25 Thread John Garry
Sparse can detect some type casting issues in the debugfs code, so fix it up. Also a missing static qualifier is added to hisi_sas_debugfs_to_reg_name(). Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 4 ++-- drivers/scsi/hisi_sas/hisi_sas_main.c | 21

[PATCH 08/13] scsi: hisi_sas: Reject setting programmed minimum linkrate > 1.5G

2019-01-25 Thread John Garry
Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 8f7f82d..32f6928 100644 --- a/drivers/scsi/hisi_

[PATCH 13/13] scsi: hisi_sas: Add missing seq_printf() call in hisi_sas_show_row_32()

2019-01-25 Thread John Garry
This call must have been missed when I reworked the debugfs feature for upstreaming, so add it back. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas

[PATCH 05/13] scsi: hisi_sas: shutdown axi bus to avoid exception CQ returned

2019-01-25 Thread John Garry
. To avoid the exception situation, shutdown AXI bus after fatal AXI interrupt. In SAS controller reset, it will restart AXI bus. For later version of v3 hw, hardware will shutdown AXI bus for this situation, so just fix current ver of v3 hw. Signed-off-by: Xiang Chen Signed-off-by: John Garry

[PATCH 12/13] scsi: hisi_sas: Fix to only call scsi_get_prot_op() for non-NULL scsi_cmnd

2019-01-25 Thread John Garry
A NULL-pointer dereference was introduced for TMF SSP commands from the upstreaming reworking. Fix this by relocating the scsi_get_prot_op() callsite. Fixes: d6a9000b81be ("scsi: hisi_sas: Add support for DIF feature for v2 hw") Signed-off-by: John Garry --- drivers/scs

[PATCH 07/13] scsi: hisi_sas: Remove unused parameter of function hisi_sas_alloc()

2019-01-25 Thread John Garry
From: Xiang Chen Actually in function hisi_sas_alloc(), parameter shost is not used, so remove it. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 2 +- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

[PATCH 11/13] scsi: hisi_sas: Some misc tidy-up

2019-01-25 Thread John Garry
Sparse detected some problems in the driver, so tidy them up. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi

[PATCH 03/13] scsi: hisi_sas: Add debugfs ITCT file and add file operations

2019-01-25 Thread John Garry
From: Luo Jiaxing This patch create debugfs file for ITCT and add file operations. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/scsi/hisi_sas

[PATCH 10/13] scsi: hisi_sas: Correct memory allocation size for DQ debugfs

2019-01-25 Thread John Garry
From: Luo Jiaxing Some sizes we allocate for debugfs structure is incorrect, so fix them. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hisi_sas

[PATCH 01/13] scsi: hisi_sas: No need to check return value of debugfs_create functions

2019-01-25 Thread John Garry
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c

[PATCH 04/13] scsi: hisi_sas: send primitive NOTIFY to SSP situation only

2019-01-25 Thread John Garry
From: Xiang Chen Send primitive NOTIFY to SSP situation only, or it causes underflow issue when sending IO. And also rename hisi_sas_hw.sl_notify() to hisi_sas_hw. sl_notify_ssp(). Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 2 +- drivers

[PATCH 09/13] scsi: hisi_sas: Fix losing directly attached disk when hot-plug

2019-01-25 Thread John Garry
. If the PHY is not up in 20s, do link reset. Notes: the 20s is an experience value. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 4 drivers/scsi/hisi_sas/hisi_sas_main.c | 26 ++ drivers/scsi/hisi_sas/hisi_sas_v2_hw.c

Re: [PATCH 0/7] SCSI: cleanup debugfs usage

2019-01-23 Thread John Garry
On 22/01/2019 15:08, Greg Kroah-Hartman wrote: When calling debugfs code, there is no need to ever check the return value of the call, as no logic should ever change if a call works properly or not. Fix up a bunch of x86-specific code to not care about the results of debugfs. Greg

Re: [PATCH] scsi: isci: initialize shost fully before calling scsi_add_host()

2019-01-16 Thread John Garry
On 16/01/2019 02:54, Martin K. Petersen wrote: Hi John, Hi Martin, So in this case I think that accessor functions are actually better because they allow us to print a big fat warning when you twiddle something you shouldn't post-initialization. So that's something I think we could--and

Re: Please remove warnings from msi.c:1269 and blk-mq-pci.c:52 some day

2019-01-15 Thread John Garry
On 14/01/2019 18:05, Jens Axboe wrote: On 1/14/19 11:05 AM, Christoph Hellwig wrote: On Mon, Jan 14, 2019 at 11:02:07AM -0700, Keith Busch wrote: User fin4478 informs me Ming's patch above fixes the warnings, but responding to the mailing lists from that email account are blocked for

Re: [PATCH] scsi: isci: initialize shost fully before calling scsi_add_host()

2019-01-14 Thread John Garry
On 12/01/2019 02:34, Martin K. Petersen wrote: John, So how about just drop these APIs and let the user set the shost protection parameters directly, like other shost parameters, The protection interfaces here obviously predate the block layer allocation changes that made this particular

[PATCH] scsi: hisi_sas: Set protection parameters prior to adding SCSI host

2019-01-10 Thread John Garry
ature for v2 hw") Signed-off-by: John Garry diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index b780b52..18d1f2cb 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2675,6 +2675,12 @@ s

Re: [PATCH] scsi: isci: initialize shost fully before calling scsi_add_host()

2019-01-10 Thread John Garry
On 09/01/2019 18:41, Christoph Hellwig wrote: This looks good. I wonder if there is any good way to prevent other drivers from picking up this bug byt using a better interface, but that should not delay your fix. . I noticed that hisi_sas has this same problem but I forgot to fix it. So

[PATCH] scsi: hisi_sas: Use scsi lld debugfs folder

2019-01-09 Thread John Garry
Since we now have a dedicated folder for scsi llds in the debugfs tree, relocate the root of the driver debugfs folder to that same location. Signed-off-by: John Garry --- This patch depends on https://www.spinics.net/lists/linux-scsi/msg126764.html diff --git a/drivers/scsi/hisi_sas/hisi_sas.h

[PATCH v2] scsi: sd: Make protection lookup tables static and relocate functions

2019-01-08 Thread John Garry
to that same c file. The inline specifier is dropped also, since gcc should be able to make the decision to inline. Signed-off-by: John Garry --- Differences v1->v2: - relocate functions to sd.c and drop inline specifier diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3bb2b33..e7dcc02 100

Re: [PATCH] scsi: sd: Make protection lookup tables static

2019-01-07 Thread John Garry
On 07/01/2019 16:57, Bart Van Assche wrote: On Mon, 2019-01-07 at 22:41 +0800, John Garry wrote: Currently the protection lookup tables in sd_prot_flag_mask() and sd_prot_op() are declared non-static. As such, they will be rebuilt for each respective function call. Optimise by making them

[PATCH] scsi: sd: Make protection lookup tables static

2019-01-07 Thread John Garry
filename 254031024 16 26443674b drivers/scsi/sd.o After: text data bss dec hex filename 252991024 16 2633966e3 drivers/scsi/sd.o Signed-off-by: John Garry diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h index 1d63f3a..89e6d42 100644 --- a/drivers

Re: [PATCH] scsi/mvsas/mv_init.c: Use dma_zalloc_coherent

2019-01-07 Thread John Garry
On 04/01/2019 19:49, Souptick Joarder wrote: On Fri, Jan 4, 2019 at 9:34 PM John Garry wrote: On 04/01/2019 15:11, Sabyasachi Gupta wrote: On Fri, Jan 4, 2019 at 6:43 PM John Garry wrote: On 04/01/2019 12:48, Sabyasachi Gupta wrote: On Wed, Dec 19, 2018 at 6:49 PM Sabyasachi Gupta wrote

Re: [PATCH] HISI LPC: Don't fail probe for unrecognised child devices

2019-01-07 Thread John Garry
On 04/01/2019 22:25, Olof Johansson wrote: On Thu, Jan 03, 2019 at 07:57:02PM +0800, John Garry wrote: Currently for ACPI-based FW we fail the probe for an unrecognised child HID. However, there is FW in the field with LPC child devices having fake HIDs, namely "IPI0002", which w

Re: [PATCH] scsi/mvsas/mv_init.c: Use dma_zalloc_coherent

2019-01-04 Thread John Garry
On 04/01/2019 15:11, Sabyasachi Gupta wrote: On Fri, Jan 4, 2019 at 6:43 PM John Garry wrote: On 04/01/2019 12:48, Sabyasachi Gupta wrote: On Wed, Dec 19, 2018 at 6:49 PM Sabyasachi Gupta wrote: On Sat, Dec 1, 2018 at 6:40 PM Sabyasachi Gupta wrote: On Wed, Nov 21, 2018 at 7:18 PM

[PATCH 1/3] scsi: libsas: Fix some indentation in libsas.h

2019-01-04 Thread John Garry
ier names). All libsas code can be audited for checkpatch issues later. Signed-off-by: John Garry --- include/scsi/libsas.h | 56 +-- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h in

[PATCH 2/3] scsi: libsas: Check SMP PHY control function result

2019-01-04 Thread John Garry
to ensure the function result is accepted, so add a check for this. Tested-by: Jian Luo Signed-off-by: John Garry --- drivers/scsi/libsas/sas_expander.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas

[PATCH 0/3] libsas: SATA PHY connection rate matching during disovery

2019-01-04 Thread John Garry
for the latter is much more complicated, and will be done as follow-up to this series. A minor tidy-up to libsas.h is also included. John Garry (3): scsi: libsas: Fix some indentation in libsas.h scsi: libsas: Check SMP PHY control function result scsi: libsas: Support SATA PHY connection rate

[PATCH 3/3] scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery

2019-01-04 Thread John Garry
alone for now. Tested-by: Jian Luo Signed-off-by: John Garry --- drivers/scsi/libsas/sas_expander.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 8817b8e..83e3715 100644 --- a/drivers/scsi/

Re: [PATCH] scsi/mvsas/mv_init.c: Use dma_zalloc_coherent

2019-01-04 Thread John Garry
On 04/01/2019 12:48, Sabyasachi Gupta wrote: On Wed, Dec 19, 2018 at 6:49 PM Sabyasachi Gupta wrote: On Sat, Dec 1, 2018 at 6:40 PM Sabyasachi Gupta wrote: On Wed, Nov 21, 2018 at 7:18 PM Sabyasachi Gupta wrote: Replace dma_alloc_coherent + memset with dma_zalloc_coherent If you're

[PATCH] HISI LPC: Don't fail probe for unrecognised child devices

2019-01-03 Thread John Garry
ne version. To provide compatibility support for these dodgy FWs, just discard the unrecognised HIDs instead of failing the probe altogether. Tested-by: Zengruan Ye Signed-off-by: John Garry diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index d5f8545..19d7b6f 100644 --- a/d

Re: hns3: Compilation of hns3_enet.c is triggered without changes

2019-01-02 Thread John Garry
On 29/12/2018 13:10, Stefan Wahren wrote: Hi, during development i noticed that hns3_enet.c is compiled even without any changes to this file. I think the reason for this is the usage of VERMAGIC_STRING in this file. So it would be nice if you could somehow replace this define. Kind regards

[PATCH 5/8] scsi: hisi_sas: Add debugfs for port registers

2018-12-19 Thread John Garry
From: Luo Jiaxing This patch create debugfs file for port register and add file operations. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 43 ++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 55

[PATCH 3/8] scsi: hisi_sas: Take debugfs snapshot for all regs

2018-12-19 Thread John Garry
From: Luo Jiaxing This patch take snapshot for global regs, port regs, CQ, DQ, IOST, ITCT. Then, Add code for snapshot trig and generate dump directory. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 15 +++- drivers/scsi/hisi_sas

[PATCH 4/8] scsi: hisi_sas: Debugfs global register create file and add file operations

2018-12-19 Thread John Garry
From: Luo Jiaxing This patch create debugfs file for global register and add file operations. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 8 drivers/scsi/hisi_sas/hisi_sas_main.c | 64 +++ drivers/scsi

[PATCH 8/8] scsi: hisi_sas: Add debugfs IOST file and add file operations

2018-12-19 Thread John Garry
From: Luo Jiaxing This patch create debugfs file for IOST and add file operations. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 51 +++ 1 file changed, 51 insertions(+) diff --git a/drivers/scsi/hisi_sas

[PATCH 2/8] scsi: hisi_sas: Alloc debugfs snapshot buffer memory for all registers

2018-12-19 Thread John Garry
-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 15 +++ drivers/scsi/hisi_sas/hisi_sas_main.c | 76 ++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 8 3 files changed, 99 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi

[PATCH 7/8] scsi: hisi_sas: Add debugfs DQ file and add file operations

2018-12-19 Thread John Garry
From: Luo Jiaxing This patch create debugfs file for DQ and add file operations Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 52 +++ 1 file changed, 52 insertions(+) diff --git a/drivers/scsi/hisi_sas

[PATCH 0/8] hisi_sas: debugfs support

2018-12-19 Thread John Garry
This patchset adds debugfs support for capturing driver state for particular times when the HW has malfunctioned (and we must reset the HW). Every controller HW version has had bugs. These bugs have been very painful to debug. One useful tool to debug these is being able to capture and export HW

[PATCH 6/8] scsi: hisi_sas: Add debugfs CQ file and add file operations

2018-12-19 Thread John Garry
From: Luo Jiaxing This patch create debugfs file for CQ and add file operations. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 70 +++ 1 file changed, 70 insertions(+) diff --git a/drivers/scsi/hisi_sas

[PATCH 1/8] scsi: hisi_sas: Create root and device debugfs directories

2018-12-19 Thread John Garry
-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 9 + drivers/scsi/hisi_sas/hisi_sas_main.c | 27 +++ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 + 3 files changed, 41 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi

Re: [PATCH v5 1/2] scsi: hisi_sas: Add support for DIF feature for v2 hw

2018-12-19 Thread John Garry
On 19/12/2018 04:35, Martin K. Petersen wrote: John, From: Xiang Chen For v3 hw, we support DIF operation for SAS, but not SATA. In addition, DIF CRC16 is supported. This patchset adds the SW support for the described features. The main components are as follows: - Get protection mask

Re: [PATCH v4 4/5] scsi: hisi_sas: Add support for DIF feature for v3 hw

2018-12-17 Thread John Garry
On 13/12/2018 13:35, John Garry wrote: to set your controller flags. +if (prot_op == SCSI_PROT_WRITE_INSERT) { +unsigned int interval = scsi_prot_interval(scsi_cmnd); +unsigned int ilog2_interval = ilog2(interval); + +len = (task->total_xfer_

<    5   6   7   8   9   10   11   12   13   14   >