Re: [PATCH 4/4] qla2xxx_nvmet: Add FC-NVMe Target handling
[ Ha ha. The kbuild-bot automatically inserts complimentary things that "I love your patch." In fact, I have not looked at your patch at all, I'm just forwarding this email from a robot after glancing at the code. - dan carpenter ] Hi Anil, I love your patch! Perhaps something to improve: [auto build test WARNING on scsi/for-next] [also build test WARNING on next-20171110] [cannot apply to v4.14] url: https://github.com/0day-ci/linux/commits/Himanshu-Madhani/qla2xxx-Add-FC-NVMe-Target-support/20171107-153645 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next drivers/scsi/qla2xxx/qla_target.c:886 qlt_queue_purex() warn: taking sizeof binop drivers/scsi/qla2xxx/qla_target.c:893 qlt_queue_purex() error: memcpy() 'p->purex_pyld' too small (4 vs 44) # https://github.com/0day-ci/linux/commit/9c5e24e821aa40552221b3103bc914bc4cd42293 git remote add linux-review https://github.com/0day-ci/linux git remote update linux-review git checkout 9c5e24e821aa40552221b3103bc914bc4cd42293 vim +886 drivers/scsi/qla2xxx/qla_target.c 9c5e24e8 Anil Gurumurthy 2017-11-06 863 9c5e24e8 Anil Gurumurthy 2017-11-06 864 static void qlt_queue_purex(scsi_qla_host_t *vha, 9c5e24e8 Anil Gurumurthy 2017-11-06 865struct atio_from_isp *atio) 9c5e24e8 Anil Gurumurthy 2017-11-06 866 { 9c5e24e8 Anil Gurumurthy 2017-11-06 867struct qla_tgt_purex_op *p; 9c5e24e8 Anil Gurumurthy 2017-11-06 868unsigned long flags; 9c5e24e8 Anil Gurumurthy 2017-11-06 869struct purex_entry_24xx *purex = 9c5e24e8 Anil Gurumurthy 2017-11-06 870(struct purex_entry_24xx *)&atio->u.raw; 9c5e24e8 Anil Gurumurthy 2017-11-06 871uint16_t len = purex->frame_size; 9c5e24e8 Anil Gurumurthy 2017-11-06 872uint8_t *purex_pyld_tmp; 9c5e24e8 Anil Gurumurthy 2017-11-06 873 9c5e24e8 Anil Gurumurthy 2017-11-06 874p = kzalloc(sizeof(*p), GFP_ATOMIC); 9c5e24e8 Anil Gurumurthy 2017-11-06 875if (p == NULL) 9c5e24e8 Anil Gurumurthy 2017-11-06 876goto out; 9c5e24e8 Anil Gurumurthy 2017-11-06 877 9c5e24e8 Anil Gurumurthy 2017-11-06 878p->vha = vha; 9c5e24e8 Anil Gurumurthy 2017-11-06 879memcpy(&p->atio, atio, sizeof(*atio)); 9c5e24e8 Anil Gurumurthy 2017-11-06 880 9c5e24e8 Anil Gurumurthy 2017-11-06 881ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0xff11, 9c5e24e8 Anil Gurumurthy 2017-11-06 882"Dumping the Purex IOCB received\n"); 9c5e24e8 Anil Gurumurthy 2017-11-06 883ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0xe012, 9c5e24e8 Anil Gurumurthy 2017-11-06 884(uint8_t *)purex, 64); 9c5e24e8 Anil Gurumurthy 2017-11-06 885 9c5e24e8 Anil Gurumurthy 2017-11-06 @886p->purex_pyld = kzalloc(sizeof(purex->entry_count * 64), GFP_ATOMIC); 9c5e24e8 Anil Gurumurthy 2017-11-06 887purex_pyld_tmp = (uint8_t *)p->purex_pyld; 9c5e24e8 Anil Gurumurthy 2017-11-06 888p->purex_pyld_len = len; 9c5e24e8 Anil Gurumurthy 2017-11-06 889 9c5e24e8 Anil Gurumurthy 2017-11-06 890if (len < PUREX_PYLD_SIZE) 9c5e24e8 Anil Gurumurthy 2017-11-06 891len = PUREX_PYLD_SIZE; 9c5e24e8 Anil Gurumurthy 2017-11-06 892 9c5e24e8 Anil Gurumurthy 2017-11-06 @893memcpy(p->purex_pyld, &purex->d_id, PUREX_PYLD_SIZE); 9c5e24e8 Anil Gurumurthy 2017-11-06 894purex_pyld_tmp += PUREX_PYLD_SIZE; 9c5e24e8 Anil Gurumurthy 2017-11-06 895len -= PUREX_PYLD_SIZE; 9c5e24e8 Anil Gurumurthy 2017-11-06 896 9c5e24e8 Anil Gurumurthy 2017-11-06 897while (len > 0) { 9c5e24e8 Anil Gurumurthy 2017-11-06 898int cpylen; 9c5e24e8 Anil Gurumurthy 2017-11-06 899struct __status_cont *cont_atio; 9c5e24e8 Anil Gurumurthy 2017-11-06 900 9c5e24e8 Anil Gurumurthy 2017-11-06 901cont_atio = (struct __status_cont *)qlt_get_next_atio_pkt(vha); 9c5e24e8 Anil Gurumurthy 2017-11-06 902cpylen = len > CONT_SENSE_DATA ? CONT_SENSE_DATA : len; 9c5e24e8 Anil Gurumurthy 2017-11-06 903ql_log(ql_log_info, vha, 0xff12, 9c5e24e8 Anil Gurumurthy 2017-11-06 904"cont_atio: %p, cpylen: %#x\n", cont_atio, cpylen); 9c5e24e8 Anil Gurumurthy 2017-11-06 905 9c5e24e8 Anil Gurumurthy 2017-11-06 906memcpy(purex_pyld_tmp, &cont_atio->data[0], cpylen); 9c5e24e8 Anil Gurumurthy 2017-11-06 907 9c5e24e8 Anil Gurumurthy 2017-11-06 908purex_pyld_tmp += cpylen; 9c5e24e8 Anil Gurumurthy 2017-11-06 909len -= cpylen; 9c5e24e8 Anil Gurumurthy 2017-11-06 910} 9c5e24e8 Anil Gurumurthy 2017-11-06 911 9c5e24e8 Anil Gurumurthy 2017-11-06 912ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0xff11, 9c5e24e8 Anil Gurumurthy 2017-11-06 913"Dumping the Purex IOCB(%p) received\n", p->purex_pyld); 9c5e24e8 Anil Gurumurthy 2017-11-06 914ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer,
Re: [PATCH] scsi: bnx2i: bnx2i_hwi: use swap macro in bnx2i_send_iscsi_nopout
On 04/11/17 1:28 AM, "Gustavo A. R. Silva" wrote: >Make use of the swap macro and remove unnecessary variable tmp. >This makes the code easier to read and maintain. > >This code was detected with the help of Coccinelle. > >Signed-off-by: Gustavo A. R. Silva >--- > drivers/scsi/bnx2i/bnx2i_hwi.c | 9 +++-- > 1 file changed, 3 insertions(+), 6 deletions(-) > >diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c >b/drivers/scsi/bnx2i/bnx2i_hwi.c >index e0640e0..9e3bf53 100644 >--- a/drivers/scsi/bnx2i/bnx2i_hwi.c >+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c >@@ -547,12 +547,9 @@ int bnx2i_send_iscsi_nopout(struct bnx2i_conn >*bnx2i_conn, > nopout_wqe->op_attr = ISCSI_FLAG_CMD_FINAL; > memcpy(nopout_wqe->lun, &nopout_hdr->lun, 8); > >- if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { >- u32 tmp = nopout_wqe->lun[0]; >- /* 57710 requires LUN field to be swapped */ >- nopout_wqe->lun[0] = nopout_wqe->lun[1]; >- nopout_wqe->lun[1] = tmp; >- } >+ /* 57710 requires LUN field to be swapped */ >+ if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) >+ swap(nopout_wqe->lun[0], nopout_wqe->lun[1]); > > nopout_wqe->itt = ((u16)task->itt | > (ISCSI_TASK_TYPE_MPATH << >-- >2.7.4 Thanks, Acked-by: Manish Rangankar >
Re: [PATCH V9 1/4] dma-mapping: Rework dma_get_cache_alignment()
But in b44_init(), there is no device instances. -- Original -- From: "Christoph Hellwig"; Date: Fri, Nov 10, 2017 08:30 PM To: "Huacai Chen"; Cc: "Christoph Hellwig"; "Marek Szyprowski"; "Robin Murphy"; "Andrew Morton"; "Fuxin Zhang"; "linux-kernel"; "Ralf Baechle"; "James Hogan"; "linux-mips"; "James E . J . Bottomley"; "Martin K . Petersen"; "linux-scsi"; "stable"; "Michael S . Tsirkin"; "Pawel Osciak"; "Kyungmin Park"; "Michael Chan"; "Benjamin Herrenschmidt"; "Ivan Mikhaylov"; "Tariq Toukan"; "Andy Gross"; "Mark A . Greer"; "Robert Baldyga"; Subject: Re: [PATCH V9 1/4] dma-mapping: Rework dma_get_cache_alignment() > diff --git a/drivers/net/ethernet/broadcom/b44.c > b/drivers/net/ethernet/broadcom/b44.c > index a1125d1..2f6ffe5 100644 > --- a/drivers/net/ethernet/broadcom/b44.c > +++ b/drivers/net/ethernet/broadcom/b44.c > @@ -2344,6 +2344,10 @@ static int b44_init_one(struct ssb_device *sdev, > struct net_device *dev; > struct b44 *bp; > int err; > + unsigned int dma_desc_align_size = > dma_get_cache_alignment(sdev->dma_dev); > + > + /* Setup paramaters for syncing RX/TX DMA descriptors */ > + dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, > sizeof(struct dma_desc)); > > instance++; > > @@ -2587,12 +2591,8 @@ static inline void b44_pci_exit(void) > > static int __init b44_init(void) > { > - unsigned int dma_desc_align_size = dma_get_cache_alignment(); > int err; > > - /* Setup paramaters for syncing RX/TX DMA descriptors */ > - dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, > sizeof(struct dma_desc)); > - This looks wrong - you override a global variable for each probed device.
RE: [PATCH] scsi: ufs: Fix Runtime PM
> -Original Message- > From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- > ow...@vger.kernel.org] On Behalf Of Michal Potomski > Sent: Thursday, November 09, 2017 11:17 AM > To: linux-scsi@vger.kernel.org > Cc: vinholika...@gmail.com; martin.peter...@oracle.com; > j...@linux.vnet.ibm.com; subha...@codeaurora.org; > szymonx.mielcza...@intel.com > Subject: [PATCH] scsi: ufs: Fix Runtime PM > > From: Michał Potomski > > Recent testing of Runtime PM for UFS has shown it's not working as intended. > To acheive fully working Runtime PM, first we have to put back scsi_device > autopm reference counter. > > Existing implementation was prone to races and not working for tranfsers to > sleeping devices. Wouldn't calling pm_runtime_mark_last_busy() just before pm_runtime_put_autosuspend() suffice? This commit aims to fix this to acheive fully working > environment. Due to runtime PM being previously disabled by not putting > scsi_device autopm counter, the Runtime PM is set to be forbidden as > default, to not cause problems with hosts and devices, which do not fully > support different Device and Link states. > > It can be still enabled through sysFS power/control attribute. > > Signed-off-by: Michał Potomski > --- > drivers/scsi/ufs/ufshcd-pci.c | 4 +++- > drivers/scsi/ufs/ufshcd.c | 55 ++--- > -- > 2 files changed, 47 insertions(+), 12 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd-pci.c b/drivers/scsi/ufs/ufshcd-pci.c > index > 925b0ec7ec54..4fffb1123876 100644 > --- a/drivers/scsi/ufs/ufshcd-pci.c > +++ b/drivers/scsi/ufs/ufshcd-pci.c > @@ -184,8 +184,10 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct > pci_device_id *id) > } > > pci_set_drvdata(pdev, hba); > + pm_runtime_set_autosuspend_delay(&pdev->dev, 3000); > + pm_runtime_use_autosuspend(&pdev->dev); > pm_runtime_put_noidle(&pdev->dev); > - pm_runtime_allow(&pdev->dev); > + pm_runtime_forbid(&pdev->dev); > > return 0; > } > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index > 011c3369082c..e7c7ed9bf8a5 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -240,6 +240,28 @@ static inline bool ufshcd_valid_tag(struct ufs_hba > *hba, int tag) > return tag >= 0 && tag < hba->nutrs; > } > > +static void ufshcd_pm_runtime_get(struct device *dev) { > + // Don't trigger PM events while in transition states > + if (dev->power.runtime_status == RPM_RESUMING || > + dev->power.runtime_status == RPM_SUSPENDING) > + pm_runtime_get_noresume(dev); > + else > + pm_runtime_get_sync(dev); > +} > + > +static void ufshcd_pm_runtime_put(struct device *dev) { > + pm_runtime_mark_last_busy(dev); > + > + // Don't trigger PM events while in transition states > + if (dev->power.runtime_status == RPM_RESUMING || > + dev->power.runtime_status == RPM_SUSPENDING) > + pm_runtime_put_noidle(dev); > + else > + pm_runtime_put_autosuspend(dev); > +} > + > static inline int ufshcd_enable_irq(struct ufs_hba *hba) { > int ret = 0; > @@ -1345,7 +1367,7 @@ static ssize_t ufshcd_clkscale_enable_store(struct > device *dev, > if (value == hba->clk_scaling.is_allowed) > goto out; > > - pm_runtime_get_sync(hba->dev); > + ufshcd_pm_runtime_get(hba->dev); > ufshcd_hold(hba, false); > > cancel_work_sync(&hba->clk_scaling.suspend_work); > @@ -1364,7 +1386,7 @@ static ssize_t ufshcd_clkscale_enable_store(struct > device *dev, > } > > ufshcd_release(hba); > - pm_runtime_put_sync(hba->dev); > + ufshcd_pm_runtime_put(hba->dev); > out: > return count; > } > @@ -1948,6 +1970,7 @@ ufshcd_send_uic_cmd(struct ufs_hba *hba, struct > uic_command *uic_cmd) > unsigned long flags; > > ufshcd_hold(hba, false); > + ufshcd_pm_runtime_get(hba->dev); > mutex_lock(&hba->uic_cmd_mutex); > ufshcd_add_delay_before_dme_cmd(hba); > > @@ -1959,6 +1982,7 @@ ufshcd_send_uic_cmd(struct ufs_hba *hba, struct > uic_command *uic_cmd) > > mutex_unlock(&hba->uic_cmd_mutex); > > + ufshcd_pm_runtime_put(hba->dev); > ufshcd_release(hba); > return ret; > } > @@ -2345,6 +2369,7 @@ static int ufshcd_queuecommand(struct Scsi_Host > *host, struct scsi_cmnd *cmd) > clear_bit_unlock(tag, &hba->lrb_in_use); > goto out; > } > + ufshcd_pm_runtime_get(hba->dev); > WARN_ON(hba->clk_gating.state != CLKS_ON); > > lrbp = &hba->lrb[tag]; > @@ -3555,6 +3580,7 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, > struct uic_command *cmd) > int ret; > bool reenable_intr = false; > > + ufshcd_pm_runtime_get(hba->dev); > mutex_lock(&hba->uic_cmd_mutex); > init_completion(&uic_async_done); > ufshcd_add_delay_before_dme_cmd(hba); > @@ -3609,6 +3635,7 @@ static int ufshcd
Re: [PATCH] uas: Add US_FL_NO_ATA_1X quirk for one more Seagate device
Hi, On 13-11-17 07:14, Jérôme Carretero wrote: On Mon, 13 Nov 2017 07:01:30 +0300 Andrey Astafyev <1...@246060.ru> wrote: 13.11.2017 00:42, Jérôme Carretero пишет: Nov 12 16:20:59 Bidule kernel: sd 22:0:0:0: [sdaa] tag#2 uas_eh_abort_handler 0 uas-tag 3 inflight: CMD OUT [...] Do you see such things? Hi, I've seen dmesg output like this so I've added my device to quirks list like any other Seagate USB drive. Hi Andrey, Hans, For my devices, adding US_FL_NO_ATA_1X to unusual_uas.h didn't change anything, and while adding US_FL_IGNORE_UAS (using quirks=0bc2:ab34:u,0bc2:ab38:u) there are still device resets, but they cause shorter hangs in system activity (~1 second when UAS was more like ~20). The errors you are seeing are write errors. If you're seeing these errors with both the usb-storage and uas drivers then there likely is something wrong with your setup / hardware. Does the drive in question use an external power-supply or is it USB bus-powered? If it is the latter then that is likely the problem. Anyways things I would check and try to swap are both the cable used, the power-supply used (if any), the USB-port used as well as trying the disk on a completely different computer. I've the feeling something is busted with your hardware, it could be the disk itself. Did you mention that this was the first release of a new higher capacity ? Those often have some kinks which are worked out in later revisions. Regards, Hans
[PATCH] scsi: ufs: Fix Runtime PM
From: Michał Potomski Recent testing of Runtime PM for UFS has shown it's not working as intended. To acheive fully working Runtime PM, first we have to put back scsi_device autopm reference counter. Existing implementation was prone to races and not working for tranfsers to sleeping devices. This commit aims to fix this to acheive fully working environment. Due to runtime PM being previously disabled by not putting scsi_device autopm counter, the Runtime PM is set to be forbidden as default, to not cause problems with hosts and devices, which do not fully support different Device and Link states. It can be still enabled through sysFS power/control attribute. Changes since v1: - Fix compilation error for certain kernel configs, - Move pm_mark_last_busy(), only to relevant context. Signed-off-by: Michał Potomski --- drivers/scsi/ufs/ufshcd-pci.c | 4 ++- drivers/scsi/ufs/ufshcd.c | 64 +++ 2 files changed, 56 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd-pci.c b/drivers/scsi/ufs/ufshcd-pci.c index 925b0ec7ec54..4fffb1123876 100644 --- a/drivers/scsi/ufs/ufshcd-pci.c +++ b/drivers/scsi/ufs/ufshcd-pci.c @@ -184,8 +184,10 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) } pci_set_drvdata(pdev, hba); + pm_runtime_set_autosuspend_delay(&pdev->dev, 3000); + pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_put_noidle(&pdev->dev); - pm_runtime_allow(&pdev->dev); + pm_runtime_forbid(&pdev->dev); return 0; } diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 011c3369082c..7ff7f51afe26 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -240,6 +240,37 @@ static inline bool ufshcd_valid_tag(struct ufs_hba *hba, int tag) return tag >= 0 && tag < hba->nutrs; } +#ifdef CONFIG_PM +static void ufshcd_pm_runtime_get(struct device *dev) +{ + // Don't trigger PM events while in transition states + if (dev->power.runtime_status == RPM_RESUMING || + dev->power.runtime_status == RPM_SUSPENDING) + pm_runtime_get_noresume(dev); + else + pm_runtime_get_sync(dev); +} + +static void ufshcd_pm_runtime_put(struct device *dev) +{ + // Don't trigger PM events while in transition states + if (dev->power.runtime_status == RPM_RESUMING || + dev->power.runtime_status == RPM_SUSPENDING) + pm_runtime_put_noidle(dev); + else { + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); + } +} +#else +static void ufshcd_pm_runtime_get(struct device *dev) +{ +} +static void ufshcd_pm_runtime_put(struct device *dev) +{ +} +#endif + static inline int ufshcd_enable_irq(struct ufs_hba *hba) { int ret = 0; @@ -1345,7 +1376,7 @@ static ssize_t ufshcd_clkscale_enable_store(struct device *dev, if (value == hba->clk_scaling.is_allowed) goto out; - pm_runtime_get_sync(hba->dev); + ufshcd_pm_runtime_get(hba->dev); ufshcd_hold(hba, false); cancel_work_sync(&hba->clk_scaling.suspend_work); @@ -1364,7 +1395,7 @@ static ssize_t ufshcd_clkscale_enable_store(struct device *dev, } ufshcd_release(hba); - pm_runtime_put_sync(hba->dev); + ufshcd_pm_runtime_put(hba->dev); out: return count; } @@ -1948,6 +1979,7 @@ ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd) unsigned long flags; ufshcd_hold(hba, false); + ufshcd_pm_runtime_get(hba->dev); mutex_lock(&hba->uic_cmd_mutex); ufshcd_add_delay_before_dme_cmd(hba); @@ -1959,6 +1991,7 @@ ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd) mutex_unlock(&hba->uic_cmd_mutex); + ufshcd_pm_runtime_put(hba->dev); ufshcd_release(hba); return ret; } @@ -2345,6 +2378,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) clear_bit_unlock(tag, &hba->lrb_in_use); goto out; } + ufshcd_pm_runtime_get(hba->dev); WARN_ON(hba->clk_gating.state != CLKS_ON); lrbp = &hba->lrb[tag]; @@ -3555,6 +3589,7 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd) int ret; bool reenable_intr = false; + ufshcd_pm_runtime_get(hba->dev); mutex_lock(&hba->uic_cmd_mutex); init_completion(&uic_async_done); ufshcd_add_delay_before_dme_cmd(hba); @@ -3609,6 +3644,7 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd) ufshcd_enable_intr(hba, UIC_COMMAND_COMPL); spin_unlock_irqrestore(hba->host->host_lock, flags); mutex_unlock(&hba->uic_cmd_mutex); + ufshcd_pm_runtime_put(hba->dev); return ret; } @@ -4386,6 +4422,7 @@ static int ufshcd_slave_con
Re: isci regression in 4.11.0-rc2 by scsi: libsas: allow async aborts
ping - anybody? Greets, Stefan Am 08.11.2017 um 10:33 schrieb Stefan Priebe - Profihost AG: > Hello, > > after upgrading some servers from 4.9 to a kernel > 4.11 i saw a > regression where i cannot boot into the os. > > The kernel is crashing in the isci (NOT iscsi) driver in task abort. > > Message: > Unable to handle kernel NULL pointer dereference at isci_task_abort_task > > git bisect detected the following offending commit: > 909657615d9b3ce709be4fd95b9a9e8c8c7c2be6 is the first bad commit > commit 909657615d9b3ce709be4fd95b9a9e8c8c7c2be6 > Author: Christoph Hellwig > Date: Thu Apr 6 15:36:32 2017 +0200 > > scsi: libsas: allow async aborts > > We now first try to call ->eh_abort_handler from a work queue, but > libsas > was always failing that for no good reason. Allow async aborts. > > Reviewed-by: Johannes Thumshirn > Reviewed-by: Hannes Reinecke > Signed-off-by: Christoph Hellwig > Signed-off-by: Martin K. Petersen > > :04 04 b15f1eb57bf74667aefb7a304fa09bf58386eaf2 > 64df540499763db44c7e1b6ec9a55ffa9b2ebedc M drivers > > i can't grab much information except for a photo as the boot process is > before netconsole or others can jump in. > > The caller of isci_task_abort_task seems to be sas_eh_abort_handler. > > Thanks! > > Greets, > Stefan >
Hello Dear...
Hello Dear... I know that this message will come to you as a surprise. I hoped that you will not expose or betray this trust and confident that I am about to repose on you, my name is M, Shakour Rosarita. I am 19 years old Girl, female, from Tartu Syria, (never married) 61 kg, white in complexion, and I am currently living in the refugee camp here in Abidjan Ivory Coast, My late beloved father M,Shakour Hassin was a renowned businessman and owner of Natour Petrol Station in Syria, he was killed in a stampede riot in Tartu, Syria. When I got the news about my parents. I fled to a nearby country Jordan before I joined a ferry to Africa and came to Abidjan capital city Ivory Coast West Africa find safety here. I came in 2015 to Abidjan and I now live in refugee camps here as refugees are allowed freely to enter here without, My late father deposited (US$6.200.000.00m) My late father kept the money at the bank of Africa, I want you to help me transfer the money to your hand so that you will help me bring me into your country for my continue education. I sent my pictures here for you to see. Who I am seriously looking for a good-person in my life, so I want to hear from you soon and learn more about you. I am an open-minded and friendly girl to share a good time with you and have fun and enjoy on the go, bird watching, the rest of our lives. My Hobbies, tourism books, dance, music, soccer, tennis, swimming and cinema. I would just think about you, including your dose and doesn’t .I believe we will do well together, and live like one family. Thank you and God bless you, for you in your promise to help me here, looking forward to your reply by the grace of God and have a good day. I hope you send me your photos as well? I await your next reply in faith please reply through my private email at (mshakourrosarit...@gmail.com): Thanks. Ms Rosarita
Re: [Y2038] [PATCH 3/7] scsi: bfa: improve bfa_ioc_send_enable/disable data
On Fri, 2017-11-10 at 16:37 +0100, Arnd Bergmann wrote: > In bfa_ioc_send_enable, we use the deprecated do_gettimeofday() function > to read the current time. This is not a problem, since the firmware > interface is already limited to 32-bit timestamps, but it's better > to use ktime_get_seconds() and document what the limitation is. > > I noticed that I did the same change in commit a5af83925363 ("bna: > avoid writing uninitialized data into hw registers") for the ethernet > driver. That commit also changed the "disable" funtion to initialize > the data we pass to the firmware properly, so I'm doing the same > thing here. > > Signed-off-by: Arnd Bergmann > --- > drivers/scsi/bfa/bfa_ioc.c | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c > index 256f4afaccf9..117332537763 100644 > --- a/drivers/scsi/bfa/bfa_ioc.c > +++ b/drivers/scsi/bfa/bfa_ioc.c > @@ -1809,13 +1809,12 @@ static void > bfa_ioc_send_enable(struct bfa_ioc_s *ioc) > { > struct bfi_ioc_ctrl_req_s enable_req; > - struct timeval tv; > > bfi_h2i_set(enable_req.mh, BFI_MC_IOC, BFI_IOC_H2I_ENABLE_REQ, > bfa_ioc_portid(ioc)); > enable_req.clscode = cpu_to_be16(ioc->clscode); > - do_gettimeofday(&tv); > - enable_req.tv_sec = be32_to_cpu(tv.tv_sec); > + /* unsigned 32-bit time_t overflow in y2106 */ > + enable_req.tv_sec = be32_to_cpu(ktime_get_real_seconds()); The byte order conversion should also logically be cpu_to_be32(), not be32_to_cpu(). Ben. > bfa_ioc_mbox_send(ioc, &enable_req, sizeof(struct bfi_ioc_ctrl_req_s)); > } > > @@ -1826,6 +1825,9 @@ bfa_ioc_send_disable(struct bfa_ioc_s *ioc) > > bfi_h2i_set(disable_req.mh, BFI_MC_IOC, BFI_IOC_H2I_DISABLE_REQ, > bfa_ioc_portid(ioc)); > + disable_req.clscode = cpu_to_be16(ioc->clscode); > + /* unsigned 32-bit time_t overflow in y2106 */ > + disable_req.tv_sec = be32_to_cpu(ktime_get_real_seconds()); > bfa_ioc_mbox_send(ioc, &disable_req, sizeof(struct bfi_ioc_ctrl_req_s)); > } > -- Ben Hutchings Software Developer, Codethink Ltd.
Re: [Y2038] [PATCH 3/7] scsi: bfa: improve bfa_ioc_send_enable/disable data
On Mon, Nov 13, 2017 at 3:08 PM, Ben Hutchings wrote: > On Fri, 2017-11-10 at 16:37 +0100, Arnd Bergmann wrote: >> >> bfi_h2i_set(enable_req.mh, BFI_MC_IOC, BFI_IOC_H2I_ENABLE_REQ, >> bfa_ioc_portid(ioc)); >> enable_req.clscode = cpu_to_be16(ioc->clscode); >> - do_gettimeofday(&tv); >> - enable_req.tv_sec = be32_to_cpu(tv.tv_sec); >> + /* unsigned 32-bit time_t overflow in y2106 */ >> + enable_req.tv_sec = be32_to_cpu(ktime_get_real_seconds()); > > The byte order conversion should also logically be cpu_to_be32(), not > be32_to_cpu(). > Right, I had not noticed that. I just tried fixing this, looking at what sparse thinks of the file as a whole. I found it basically hopeless to fix the endianess warnings in this driver, it seems completely random here whether they are used correctly, in the opposite direction as expected, or just flip data in place as in attr->part[i].part_off = be32_to_cpu(f->part[i].part_off); I'd rather not touch that part. IIRC I had at some point spent a day trying to clean up the "warning: symbol 'bfa_flash_sem_get' was not declared. Should it be static?" sparse warnings for some driver, before giving up for similar reasons. Arnd
Re:
Attn: I am wondering why You haven't respond to my email for some days now. reference to my client's contract balance payment of (11.7M,USD) Kindly get back to me for more details. Best Regards Amos Kalonzo
Re: [PATCH] uas: Add US_FL_NO_ATA_1X quirk for one more Seagate device
Hi Hans, On Mon, 13 Nov 2017 10:04:53 +0100 Hans de Goede wrote: > Hi, > > On 13-11-17 07:14, Jérôme Carretero wrote: > > On Mon, 13 Nov 2017 07:01:30 +0300 > > Andrey Astafyev <1...@246060.ru> wrote: > > > >> 13.11.2017 00:42, Jérôme Carretero пишет: > >>> Nov 12 16:20:59 Bidule kernel: sd 22:0:0:0: [sdaa] tag#2 > >>> uas_eh_abort_handler 0 uas-tag 3 inflight: CMD OUT > >>> [...] > >>> Do you see such things? > > For my devices, adding US_FL_NO_ATA_1X to unusual_uas.h didn't > > change anything, and while adding US_FL_IGNORE_UAS (using > > quirks=0bc2:ab34:u,0bc2:ab38:u) there are still device resets, > > but they cause shorter hangs in system activity (~1 second when > > UAS was more like ~20). > > The errors you are seeing are write errors. If you're seeing these > errors with both the usb-storage and uas drivers then there likely > is something wrong with your setup / hardware. My latest drives are Seagate Backup+ Hub 8TB and have ~ 50 hours of uptime. I have connected them to different controllers and they do the same as the first generation of the same capacity from 2015. SMART says that everything is OK on these disks (I have another that was RMA'ed and the symptoms of failure are something else), and if there were USB errors, the messages wouldn't be at the higher SCSI level, I guess I would see "xact failed" USB errors... no? > Does the drive in question use an external power-supply or is it > USB bus-powered? If it is the latter then that is likely the problem. External power supply & ~2-ft cable provided by Seagate. > Anyways things I would check and try to swap are both the cable > used, the power-supply used (if any), the USB-port used as well > as trying the disk on a completely different computer. I did that. The same thing happens. > I've the feeling something is busted with your hardware, it > could be the disk itself. Did you mention that this was the first > release of a new higher capacity ? Those often have some kinks > which are worked out in later revisions. No, that's about the 3rd release I think. I really suspect this has to do with GC activity of these SMR drives, as if the write activity is throttled or in more spaced bursts (same USB-level intensity), then there is no problem. I will do longer tests and see if only some of them do that, after they have been subjected to similar usage history. Best regards, -- Jérôme
Re: [PATCH V4] scsi_debugfs: fix crash in scsi_show_rq()
On Sat, 2017-11-11 at 10:43 +0800, Ming Lei wrote: > On Fri, Nov 10, 2017 at 08:51:58AM -0800, James Bottomley wrote: > > > > On Fri, 2017-11-10 at 17:01 +0800, Ming Lei wrote: > > > > > > cmd->cmnd can be allocated/freed dynamically in case of > > > T10_PI_TYPE2_PROTECTION, so we should check it in scsi_show_rq() > > > because this request may have been freed already here, and cmd- > > > >cmnd has been set as null. > > > > > > We choose to accept read-after-free and dump request data as far > > > as possible. > > > > > > This patch fixs the following kernel crash when dumping request > > > via block's debugfs interface: > > > > > > [ 252.962045] BUG: unable to handle kernel NULL pointer > > > dereference > > > at (null) > > > [ 252.963007] IP: scsi_format_opcode_name+0x1a/0x1c0 > > > [ 252.963007] PGD 25e75a067 P4D 25e75a067 PUD 25e75b067 PMD 0 > > > [ 252.963007] Oops: [#1] PREEMPT SMP > > > [ 252.963007] Dumping ftrace buffer: > > > [ 252.963007](ftrace buffer empty) > > > [ 252.963007] Modules linked in: scsi_debug ebtable_filter > > > ebtables > > > ip6table_filter ip6_tables xt_CHECKSUM iptable_mangle > > > ipt_MASQUERADE > > > nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 > > > nf_defrag_ipv4 > > > nf_nat_ipv4 nf_nat nf_conntrack libcrc32c bridge stp llc > > > iptable_filter fuse ip_tables sd_mod sg mptsas mptscsih mptbase > > > crc32c_intel ahci libahci nvme serio_raw scsi_transport_sas > > > libata > > > lpc_ich nvme_core virtio_scsi binfmt_misc dm_mod iscsi_tcp > > > libiscsi_tcp libiscsi scsi_transport_iscsi null_blk configs > > > [ 252.963007] CPU: 1 PID: 1881 Comm: cat Not tainted 4.14.0- > > > rc2.blk_mq_io_hang+ #516 > > > [ 252.963007] Hardware name: QEMU Standard PC (Q35 + ICH9, > > > 2009), > > > BIOS 1.9.3-1.fc25 04/01/2014 > > > [ 252.963007] task: 88025e6f6000 task.stack: > > > c90001bd > > > [ 252.963007] RIP: 0010:scsi_format_opcode_name+0x1a/0x1c0 > > > [ 252.963007] RSP: 0018:c90001bd3c50 EFLAGS: 00010286 > > > [ 252.963007] RAX: 4843 RBX: 0050 RCX: > > > > > > [ 252.963007] RDX: RSI: 0050 RDI: > > > c90001bd3cd8 > > > [ 252.963007] RBP: c90001bd3c88 R08: 1000 R09: > > > > > > [ 252.963007] R10: 880275134000 R11: 88027513406c R12: > > > 0050 > > > [ 252.963007] R13: c90001bd3cd8 R14: R15: > > > > > > [ 252.963007] FS: 7f4d11762700() > > > GS:88027fc4() > > > knlGS: > > > [ 252.963007] CS: 0010 DS: ES: CR0: 80050033 > > > [ 252.963007] CR2: CR3: 00025e789003 CR4: > > > 003606e0 > > > [ 252.963007] DR0: DR1: DR2: > > > > > > [ 252.963007] DR3: DR6: fffe0ff0 DR7: > > > 0400 > > > [ 252.963007] Call Trace: > > > [ 252.963007] __scsi_format_command+0x27/0xc0 > > > [ 252.963007] scsi_show_rq+0x5c/0xc0 > > > [ 252.963007] ? seq_printf+0x4e/0x70 > > > [ 252.963007] ? blk_flags_show+0x5b/0xf0 > > > [ 252.963007] __blk_mq_debugfs_rq_show+0x116/0x130 > > > [ 252.963007] blk_mq_debugfs_rq_show+0xe/0x10 > > > [ 252.963007] seq_read+0xfe/0x3b0 > > > [ 252.963007] ? __handle_mm_fault+0x631/0x1150 > > > [ 252.963007] full_proxy_read+0x54/0x90 > > > [ 252.963007] __vfs_read+0x37/0x160 > > > [ 252.963007] ? security_file_permission+0x9b/0xc0 > > > [ 252.963007] vfs_read+0x96/0x130 > > > [ 252.963007] SyS_read+0x55/0xc0 > > > [ 252.963007] entry_SYSCALL_64_fastpath+0x1a/0xa5 > > > [ 252.963007] RIP: 0033:0x7f4d1127e9b0 > > > [ 252.963007] RSP: 002b:7ffd27082568 EFLAGS: 0246 > > > ORIG_RAX: > > > > > > [ 252.963007] RAX: ffda RBX: 7f4d1154bb20 RCX: > > > 7f4d1127e9b0 > > > [ 252.963007] RDX: 0002 RSI: 7f4d115a7000 RDI: > > > 0003 > > > [ 252.963007] RBP: 00021010 R08: R09: > > > > > > [ 252.963007] R10: 037b R11: 0246 R12: > > > 00022000 > > > [ 252.963007] R13: 7f4d1154bb78 R14: 1000 R15: > > > 0002 > > > [ 252.963007] Code: c6 e8 1b ca 24 00 eb 8c e8 74 2c ae ff 0f 1f > > > 40 > > > 00 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 41 54 53 49 89 fd 49 89 > > > f4 > > > 48 83 ec 18 <44> 0f b6 32 48 c7 45 c8 00 00 00 00 65 48 8b 04 25 > > > 28 > > > 00 00 00 > > > [ 252.963007] RIP: scsi_format_opcode_name+0x1a/0x1c0 RSP: > > > c90001bd3c50 > > > [ 252.963007] CR2: > > > [ 252.963007] ---[ end trace 83c5bddfbaa6573c ]--- > > > [ 252.963007] Kernel panic - not syncing: Fatal exception > > > [ 252.963007] Dumping ftrace buffer: > > > [ 252.963007](ftrace buffer empty) > > > [ 252.963007] Kernel Offset: disabled > > > [ 252.963007] ---[ end Kernel panic - not syncing: Fat
[REPOST PATCH] scsi: ses: don't ask for diagnostic pages repeatedly during probe
We are testing if there is a match with the ses device in a loop by calling ses_match_to_enclosure(), which will issue scsi receive diagnostics commands to the ses device for every device on the same host. On one of our boxes with 840 disks, it takes a long time to load the driver: [root@g1b-oss06 ~]# time modprobe ses real40m48.247s user0m0.001s sys 0m0.196s With the patch: [root@g1b-oss06 ~]# time modprobe ses real0m17.915s user0m0.008s sys 0m0.053s Note that we still need to refresh page 10 when we see a new disk to create the link. Signed-off-by: Li Dongyang --- drivers/scsi/ses.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 11826c5c2dd4..62f04c0511cf 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -615,13 +615,16 @@ static void ses_enclosure_data_process(struct enclosure_device *edev, } static void ses_match_to_enclosure(struct enclosure_device *edev, - struct scsi_device *sdev) + struct scsi_device *sdev, + int refresh) { + struct scsi_device *edev_sdev = to_scsi_device(edev->edev.parent); struct efd efd = { .addr = 0, }; - ses_enclosure_data_process(edev, to_scsi_device(edev->edev.parent), 0); + if (refresh) + ses_enclosure_data_process(edev, edev_sdev, 0); if (scsi_is_sas_rphy(sdev->sdev_target->dev.parent)) efd.addr = sas_get_address(sdev); @@ -652,7 +655,7 @@ static int ses_intf_add(struct device *cdev, struct enclosure_device *prev = NULL; while ((edev = enclosure_find(&sdev->host->shost_gendev, prev)) != NULL) { - ses_match_to_enclosure(edev, sdev); + ses_match_to_enclosure(edev, sdev, 1); prev = edev; } return -ENODEV; @@ -768,7 +771,7 @@ static int ses_intf_add(struct device *cdev, shost_for_each_device(tmp_sdev, sdev->host) { if (tmp_sdev->lun != 0 || scsi_device_enclosure(tmp_sdev)) continue; - ses_match_to_enclosure(edev, tmp_sdev); + ses_match_to_enclosure(edev, tmp_sdev, 0); } return 0; -- 2.14.2
Re: [PATCH V4] scsi_debugfs: fix crash in scsi_show_rq()
Hi James, On Mon, Nov 13, 2017 at 10:55:52AM -0800, James Bottomley wrote: > On Sat, 2017-11-11 at 10:43 +0800, Ming Lei wrote: > > On Fri, Nov 10, 2017 at 08:51:58AM -0800, James Bottomley wrote: > > > > > > On Fri, 2017-11-10 at 17:01 +0800, Ming Lei wrote: > > > > > > > > cmd->cmnd can be allocated/freed dynamically in case of > > > > T10_PI_TYPE2_PROTECTION, so we should check it in scsi_show_rq() > > > > because this request may have been freed already here, and cmd- > > > > >cmnd has been set as null. > > > > > > > > We choose to accept read-after-free and dump request data as far > > > > as possible. > > > > > > > > This patch fixs the following kernel crash when dumping request > > > > via block's debugfs interface: > > > > > > > > [ 252.962045] BUG: unable to handle kernel NULL pointer > > > > dereference > > > > at (null) > > > > [ 252.963007] IP: scsi_format_opcode_name+0x1a/0x1c0 > > > > [ 252.963007] PGD 25e75a067 P4D 25e75a067 PUD 25e75b067 PMD 0 > > > > [ 252.963007] Oops: [#1] PREEMPT SMP > > > > [ 252.963007] Dumping ftrace buffer: > > > > [ 252.963007](ftrace buffer empty) > > > > [ 252.963007] Modules linked in: scsi_debug ebtable_filter > > > > ebtables > > > > ip6table_filter ip6_tables xt_CHECKSUM iptable_mangle > > > > ipt_MASQUERADE > > > > nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 > > > > nf_defrag_ipv4 > > > > nf_nat_ipv4 nf_nat nf_conntrack libcrc32c bridge stp llc > > > > iptable_filter fuse ip_tables sd_mod sg mptsas mptscsih mptbase > > > > crc32c_intel ahci libahci nvme serio_raw scsi_transport_sas > > > > libata > > > > lpc_ich nvme_core virtio_scsi binfmt_misc dm_mod iscsi_tcp > > > > libiscsi_tcp libiscsi scsi_transport_iscsi null_blk configs > > > > [ 252.963007] CPU: 1 PID: 1881 Comm: cat Not tainted 4.14.0- > > > > rc2.blk_mq_io_hang+ #516 > > > > [ 252.963007] Hardware name: QEMU Standard PC (Q35 + ICH9, > > > > 2009), > > > > BIOS 1.9.3-1.fc25 04/01/2014 > > > > [ 252.963007] task: 88025e6f6000 task.stack: > > > > c90001bd > > > > [ 252.963007] RIP: 0010:scsi_format_opcode_name+0x1a/0x1c0 > > > > [ 252.963007] RSP: 0018:c90001bd3c50 EFLAGS: 00010286 > > > > [ 252.963007] RAX: 4843 RBX: 0050 RCX: > > > > > > > > [ 252.963007] RDX: RSI: 0050 RDI: > > > > c90001bd3cd8 > > > > [ 252.963007] RBP: c90001bd3c88 R08: 1000 R09: > > > > > > > > [ 252.963007] R10: 880275134000 R11: 88027513406c R12: > > > > 0050 > > > > [ 252.963007] R13: c90001bd3cd8 R14: R15: > > > > > > > > [ 252.963007] FS: 7f4d11762700() > > > > GS:88027fc4() > > > > knlGS: > > > > [ 252.963007] CS: 0010 DS: ES: CR0: 80050033 > > > > [ 252.963007] CR2: CR3: 00025e789003 CR4: > > > > 003606e0 > > > > [ 252.963007] DR0: DR1: DR2: > > > > > > > > [ 252.963007] DR3: DR6: fffe0ff0 DR7: > > > > 0400 > > > > [ 252.963007] Call Trace: > > > > [ 252.963007] __scsi_format_command+0x27/0xc0 > > > > [ 252.963007] scsi_show_rq+0x5c/0xc0 > > > > [ 252.963007] ? seq_printf+0x4e/0x70 > > > > [ 252.963007] ? blk_flags_show+0x5b/0xf0 > > > > [ 252.963007] __blk_mq_debugfs_rq_show+0x116/0x130 > > > > [ 252.963007] blk_mq_debugfs_rq_show+0xe/0x10 > > > > [ 252.963007] seq_read+0xfe/0x3b0 > > > > [ 252.963007] ? __handle_mm_fault+0x631/0x1150 > > > > [ 252.963007] full_proxy_read+0x54/0x90 > > > > [ 252.963007] __vfs_read+0x37/0x160 > > > > [ 252.963007] ? security_file_permission+0x9b/0xc0 > > > > [ 252.963007] vfs_read+0x96/0x130 > > > > [ 252.963007] SyS_read+0x55/0xc0 > > > > [ 252.963007] entry_SYSCALL_64_fastpath+0x1a/0xa5 > > > > [ 252.963007] RIP: 0033:0x7f4d1127e9b0 > > > > [ 252.963007] RSP: 002b:7ffd27082568 EFLAGS: 0246 > > > > ORIG_RAX: > > > > > > > > [ 252.963007] RAX: ffda RBX: 7f4d1154bb20 RCX: > > > > 7f4d1127e9b0 > > > > [ 252.963007] RDX: 0002 RSI: 7f4d115a7000 RDI: > > > > 0003 > > > > [ 252.963007] RBP: 00021010 R08: R09: > > > > > > > > [ 252.963007] R10: 037b R11: 0246 R12: > > > > 00022000 > > > > [ 252.963007] R13: 7f4d1154bb78 R14: 1000 R15: > > > > 0002 > > > > [ 252.963007] Code: c6 e8 1b ca 24 00 eb 8c e8 74 2c ae ff 0f 1f > > > > 40 > > > > 00 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 41 54 53 49 89 fd 49 89 > > > > f4 > > > > 48 83 ec 18 <44> 0f b6 32 48 c7 45 c8 00 00 00 00 65 48 8b 04 25 > > > > 28 > > > > 00 00 00 > > > > [ 252.963007] RIP: scsi_format_opcode_name+0x1a/0x1c0 RSP: > > > > c90001bd3c50 > > > > [ 252.963007] CR2: > > > > [ 252.963007] ---[ end tra