[PATCH v5 00/18] compat_ioctl.c removal, part 2/3

2019-08-14 Thread Arnd Bergmann
ppp_generic Arnd Bergmann (16): xfs: compat_ioctl: use compat_ptr() xfs: compat_ioctl: add missing conversions gfs2: add compat_ioctl support fs: compat_ioctl: move FITRIM emulation into file systems watchdog: cpwd: use generic compat_ptr_ioctl compat_ioctl: move WDIOC handling into wdt

Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl

2019-04-26 Thread Arnd Bergmann
On Thu, Apr 25, 2019 at 11:25 PM Johannes Berg wrote: > On Thu, 2019-04-25 at 17:55 +0200, Arnd Bergmann wrote: > > On Thu, Apr 25, 2019 at 5:35 PM Al Viro wrote: > > > > > > On Thu, Apr 25, 2019 at 12:21:53PM -0300, Mauro Carvalho Chehab wrote: > > >

Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl

2019-04-25 Thread Arnd Bergmann
On Thu, Apr 25, 2019 at 5:35 PM Al Viro wrote: > > On Thu, Apr 25, 2019 at 12:21:53PM -0300, Mauro Carvalho Chehab wrote: > > > If I understand your patch description well, using compat_ptr_ioctl > > only works if the driver is not for s390, right? > > No; s390 is where "oh, just set ->compat_ioct

Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl

2019-04-25 Thread Arnd Bergmann
On Thu, Apr 25, 2019 at 5:22 PM Mauro Carvalho Chehab wrote: > Em Tue, 16 Apr 2019 22:25:33 +0200 Arnd Bergmann escreveu: > > If I understand your patch description well, using compat_ptr_ioctl > only works if the driver is not for s390, right? No, the purpose of compat_ptr_ioctl(

[PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl

2019-04-16 Thread Arnd Bergmann
e not interpreted as integer values. Acked-by: Jason Gunthorpe Acked-by: Daniel Vetter Acked-by: Mauro Carvalho Chehab Acked-by: Greg Kroah-Hartman Acked-by: David Sterba Acked-by: Darren Hart (VMware) Acked-by: Jonathan Cameron Acked-by: Bjorn Andersson Signed-off-by: Arnd Bergmann --- dr

[PATCH v3 13/26] compat_ioctl: move tape handling into drivers

2019-04-16 Thread Arnd Bergmann
that is now in a new linux/mtio.h header that wraps the existing uapi/linux/mtio.h header and provides an abstraction to let drivers handle both cases easily. Signed-off-by: Arnd Bergmann --- drivers/ide/ide-tape.c| 31 drivers/s390/char/tape_char.c | 41

[PATCH v3 10/26] compat_ioctl: use correct compat_ptr() translation in drivers

2019-04-16 Thread Arnd Bergmann
thing, but using the new compat_ptr_ioctl() helper makes it more correct in theory, and simplifies the code. Acked-by: Greg Kroah-Hartman Acked-by: Andrew Donnellan Acked-by: Felipe Balbi Signed-off-by: Arnd Bergmann --- drivers/misc/cxl/flash.c| 8 +--- drivers/misc/g

[PATCH v3 00/26] compat_ioctl: cleanups

2019-04-16 Thread Arnd Bergmann
aintainers. I hope you can still take these for the coming merge window, unless new problems come up. Arnd Arnd Bergmann (26): compat_ioctl: pppoe: fix PPPOEIOCSFWD handling compat_ioctl: move simple ppp command handling into driver compat_ioctl: avoid unused function warning fo

[PATCH 4/4] scsi: ufs: hisi: fix ufs_hba_variant_ops passing

2019-03-04 Thread Arnd Bergmann
e] Rework this code to pass the data directly, and while we're at it, correctly handle the const pointers. Fixes: 653fcb07d95e ("scsi: ufs: Add HI3670 SoC UFS driver support") Signed-off-by: Arnd Bergmann --- drivers/scsi/ufs/ufs-hisi.c | 11 --- drivers/scsi/ufs/uf

[PATCH 3/4] scsi: qla2xxx: avoid printf format warning

2019-03-04 Thread Arnd Bergmann
boundary in physical addresses would still be mapped into dma addresses within the low 4GB space, so I suspect that we actually want to check sg_dma_address() instead of sg_phys() here. Fixes: 50b812755e97 ("scsi: qla2xxx: Fix DMA error when the DIF sg buffer crosses 4GB boundary") Sig

[PATCH 2/4] scsi: lpfc: fix 32-bit format string warning

2019-03-04 Thread Arnd Bergmann
type 'long int', but argument 5 has type 'unsigned int' [-Werror=format=] This is harmless, but portable code should just use %zd to avoid the warning. Fixes: 0794d601d174 ("scsi: lpfc: Implement common IO buffers between NVME and SCSI") Signed-off-by: Arnd Bergmann

[PATCH 1/4] scsi: lpfc: fix unused variable warning

2019-03-04 Thread Arnd Bergmann
x27; [-Werror=unused-variable] uint32_t code, status, idx, cpu; Move the declaration into the same block to avoid the warning. Fixes: 63df6d637e33 ("scsi: lpfc: Adapt cpucheck debugfs logic to Hardware Queues") Signed-off-by: Arnd Bergmann --- drivers/scsi/lpfc/lpfc_nvme.c | 3

Re: [PATCH v8 01/25] scsi/atari_scsi: Don't select CONFIG_NVRAM

2018-12-29 Thread Arnd Bergmann
On Sat, Dec 29, 2018 at 3:51 AM Michael Schmitz wrote: > > Hi Finn, > > Am 29.12.2018 um 15:34 schrieb Finn Thain: > > On Sat, 29 Dec 2018, Michael Schmitz wrote: > > > >> > >> IS_BUILTIN(CONFIG_NVRAM) is probably what Christophe really meant to > >> suggest. > >> > >> Or (really going out on a l

[PATCH 0/7] v4.19-stable randconfig fixes

2018-12-14 Thread Arnd Bergmann
warning by fixing the code correctly in each of these cases, but if you disagree, applying the mainline change should work equally well, so decide for yourself. Arnd Arnd Bergmann (5): scsi: raid_attrs: fix unused variable warning slimbus: ngd: mark PM functions as __maybe_unused [st

[PATCH 2/7] scsi: raid_attrs: fix unused variable warning

2018-12-14 Thread Arnd Bergmann
roblem that for some reason was very hard to run into, but it is very easy to fix, by replacing the incorrect #ifdef with a simpler IS_ENABLED() check. Fixes: fac829fdcaf4 ("[SCSI] raid_attrs: fix dependency problems") Signed-off-by: Arnd Bergmann Signed-off-by: Martin K. Petersen ---

[PATCH 2/2] scsi: aacraid: change event_wait to a completion

2018-12-10 Thread Arnd Bergmann
The event_wait semaphore has completion semantics, so we can change it over to the completion interface for clarity without changing the behavior. Signed-off-by: Arnd Bergmann --- drivers/scsi/aacraid/aacraid.h | 3 ++- drivers/scsi/aacraid/commctrl.c | 1 - drivers/scsi/aacraid/commsup.c

[PATCH 1/2] scsi: aacraid: change wait_sem to a completion

2018-12-10 Thread Arnd Bergmann
The wait_sem member is used like a completion, so we should use the respective API. The behavior is unchanged. Signed-off-by: Arnd Bergmann --- drivers/scsi/aacraid/aacraid.h | 2 +- drivers/scsi/aacraid/commctrl.c | 4 ++-- drivers/scsi/aacraid/commsup.c | 4 ++-- 3 files changed, 5

Re: [PATCH] scsi: qla2xxx: fix unused function warning

2018-12-10 Thread Arnd Bergmann
On Mon, Dec 10, 2018 at 10:01 PM Bart Van Assche wrote: > > On Mon, 2018-12-10 at 21:51 +0100, Arnd Bergmann wrote: > > In what seems to be a mismatch between the scsi-fixes branch and > > the scsi-mkp/for-next branch, a newly introduced variable from > > one patch got

[PATCH] scsi: qla2xxx: fix unused function warning

2018-12-10 Thread Arnd Bergmann
or: unused variable 'status' [-Werror=unused-variable] Remove the variable again. Fixes: c4e521b654e1 ("scsi: qla2xxx: Split the __qla2x00_abort_all_cmds() function") Fixes: f2ffd4e5bc7b ("scsi: qla2xxx: Timeouts occur on surprise removal of QLogic adapter") Signe

[PATCH] scsi: myrs: only build on little-endian platforms

2018-11-02 Thread Arnd Bergmann
never had a working driver on it for big-endian platforms, it's unlikely to make a difference to users. Signed-off-by: Arnd Bergmann --- drivers/scsi/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index f07444d30b21..640cd1b31a18 100644

[PATCH] scsi: myrs: avoid stack overflow warning

2018-11-02 Thread Arnd Bergmann
than 1024 bytes [-Werror=frame-larger-than=] We only really need three members of the structure, so just read them manually here instead of copying the entire structure. Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller (SCSI interface)") Signed-off-by: Arnd Bergmann --- driv

[PATCH] scsi: myrb: fix sprintf buffer overflow warning

2018-11-02 Thread Arnd Bergmann
k after it that will bail out in case of out of range version numbers. This means we can simply use snprintf() instead of sprintf() to limit the output buffer size, and it will work correctly. Fixes: 081ff398c56c ("scsi: myrb: Add Mylex RAID controller (block interface)") Signed-off-by: A

[PATCH] scsi: lpfc: fix remoteport access

2018-11-02 Thread Arnd Bergmann
;nrport' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (nrport->port_role & FC_PORT_ROLE_NVME_INITIATOR) This changes the logic back to what it was, while keeping the added spinlock. Fixes: 9e210178267b ("scsi: lpfc: Synchronize access to remoteport

[PATCH] cxgb4i: fix thermal configuration dependencies

2018-11-02 Thread Arnd Bergmann
'select NETDEVICES'. This is something we really should not do anyway, as a driver symbol should never select another major subsystem, so let's turn that into a 'depends on'. I don't see any downsides of that, as NETDEVICES is only disabled in rather obscure cases that

Re: scsi: myrs: warning fix, was: [GIT PULL] first round of SCSI updates for the 4.19+ merge window

2018-10-26 Thread Arnd Bergmann
On 10/26/18, Hannes Reinecke wrote: > On 10/26/18 10:16 AM, Arnd Bergmann wrote: >> On Wed, Oct 24, 2018 at 1:00 PM James Bottomley >> wrote: >>> >>> James Bottomley (1): >>>scsi: myrs: fix build failure on 32 bit >> >> Hi James a

scsi: myrs: warning fix, was: [GIT PULL] first round of SCSI updates for the 4.19+ merge window

2018-10-26 Thread Arnd Bergmann
On Wed, Oct 24, 2018 at 1:00 PM James Bottomley wrote: > > James Bottomley (1): > scsi: myrs: fix build failure on 32 bit Hi James and Hannes, Since James mentioned 32-bit compiles during the kernel summit, I'd like to confirm that I hit this on my randconfig builder now, with some latency

[PATCH] scsi: ufs: fix integer type usage in uapi header

2018-10-12 Thread Arnd Bergmann
2bf27a41 ("scsi: ufs: Add a bsg endpoint that supports UPIUs") Signed-off-by: Arnd Bergmann --- include/uapi/scsi/scsi_bsg_ufs.h | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/uapi/scsi/scsi_bsg_ufs.h b/include/uapi/scsi/scsi_bsg_ufs.h index 1b259306

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

2018-10-02 Thread Arnd Bergmann
On Sat, Sep 15, 2018 at 8:38 AM Nathan Chancellor wrote: > Reported-by: Nick Desaulniers > Signed-off-by: Nathan Chancellor > --- > drivers/message/fusion/mptbase.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/message/fusion/mptbase.c > b/drivers/messag

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-24 Thread Arnd Bergmann
On Mon, Sep 24, 2018 at 10:35 PM Jason Gunthorpe wrote: > On Mon, Sep 24, 2018 at 10:18:52PM +0200, Arnd Bergmann wrote: > > On Tue, Sep 18, 2018 at 7:59 PM Jason Gunthorpe wrote: > > > On Tue, Sep 18, 2018 at 10:51:08AM -0700, Darren Hart wrote: > > > > On Fri, Se

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-24 Thread Arnd Bergmann
On Tue, Sep 18, 2018 at 7:59 PM Jason Gunthorpe wrote: > > On Tue, Sep 18, 2018 at 10:51:08AM -0700, Darren Hart wrote: > > On Fri, Sep 14, 2018 at 09:57:48PM +0100, Al Viro wrote: > > > On Fri, Sep 14, 2018 at 01:35:06PM -0700, Darren Hart wrote: > > > > > > > Acked-by: Darren Hart (VMware) > >

[PATCH v2 07/17] compat_ioctl: move tape handling into drivers

2018-09-12 Thread Arnd Bergmann
that is now in a new linux/mtio.h header that wraps the existing uapi/linux/mtio.h header and provides an abstraction to let drivers handle both cases easily. Signed-off-by: Arnd Bergmann --- drivers/ide/ide-tape.c| 31 +++ drivers/s390/char/tape_char.c | 41

[PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-12 Thread Arnd Bergmann
e not interpreted as integer values. Signed-off-by: Arnd Bergmann --- drivers/android/binder.c| 2 +- drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +- drivers/dma-buf/dma-buf.c | 4 +--- drivers/dma-buf/sw_sync.c | 2 +- drivers/dm

[PATCH v2 03/17] compat_ioctl: use correct compat_ptr() translation in drivers

2018-09-12 Thread Arnd Bergmann
thing, but using the new generic_compat_ioctl_ptrarg helper makes it more correct in theory, and simplifies the code. Signed-off-by: Arnd Bergmann --- drivers/misc/cxl/flash.c| 8 +--- drivers/misc/genwqe/card_dev.c | 23 +-- drivers/scsi/megaraid/megaraid

Re: [PATCH 11/11] compat_ioctl: move tape handling into drivers

2018-09-11 Thread Arnd Bergmann
On Tue, Sep 11, 2018 at 5:36 PM Arnd Bergmann wrote: > > On Sun, Sep 9, 2018 at 6:38 AM Al Viro wrote: > > > > On Sat, Sep 08, 2018 at 04:28:17PM +0200, Arnd Bergmann wrote: > > > MTIOCPOS and MTIOCGET are incompatible between 32-bit and 64-bit user > > >

[PATCH] [v2] scsi: ips: fix firmware timestamps for 32-bit

2018-04-20 Thread Arnd Bergmann
interfaces. Signed-off-by: Arnd Bergmann --- v2: addressed review comments from Finn Thain: - rewrite changelog text - drop now-unused macros - fix incorrect century calculation --- drivers/scsi/ips.c | 78 +++--- drivers/scsi/ips.h | 11

[PATCH] [RESEND 2] scsi: esas2r: use ktime_get_real_seconds()

2018-04-20 Thread Arnd Bergmann
. This changes do_gettimeofday() to ktime_get_real_seconds(), which at least simplifies the code a bit, and avoids the deprecated interface. I'm adding a comment about the overflow to document what happens. Signed-off-by: Arnd Bergmann --- Originally submitted in November 2017, no reply. Sent

Re: 答复: 答复: 答复: [PATCH v8 2/5] dt-bindings: scsi: ufs: add document for hisi-ufs

2018-03-28 Thread Arnd Bergmann
On Tue, Mar 27, 2018 at 8:15 AM, liwei (CM) wrote: > Hi, Arnd > > At present our ufs module mainly has four clocks from the outside: > hclk_ufs: main clock of ufs controller ,freq is 207.5MHz > cfg_phy_clk: configuration clock of MPHY, freq is 51.875MHz > ref_phy_clk: reference clock of MPHY

Re: 答复: 答复: [PATCH v8 2/5] dt-bindings: scsi: ufs: add document for hisi-ufs

2018-03-26 Thread Arnd Bergmann
On Mon, Mar 26, 2018 at 12:26 PM, liwei (CM) wrote: > 发件人: arndbergm...@gmail.com [mailto:arndbergm...@gmail.com] 代表 Arnd Bergmann > > 主题: Re: 答复: [PATCH v8 2/5] dt-bindings: scsi: ufs: add document for hisi-ufs > > On Fri, Mar 23, 2018 at 3:22 AM, liwei (CM) wrote: > >&g

Re: 答复: [PATCH v8 2/5] dt-bindings: scsi: ufs: add document for hisi-ufs

2018-03-26 Thread Arnd Bergmann
tter left documented in your own binding. I've added a "jedec,ufshci-3.0" compatible string, which appears to be the latest version of the ufshci itself, and I've documented four clocks that are already used by the qualcomm variant of the platform device. Please have a look at th

Re: [PATCH v2] lpfc: use __raw_writeX on DPP copies

2018-03-05 Thread Arnd Bergmann
mpilation on some 32-bit systems as writeq() is not supported > on all architectures. Additionally, it was pointed out that as writeX() > does byteswapping if necessary for pci vs the cpu endianness, the code > was broken on BE PPC. > > After discussions with Arnd Bergmann, we&#

[PATCH] scsi: mpt3sas: clarify mmio pointer types

2018-03-01 Thread Arnd Bergmann
: Introduce Base function for cloning.") Signed-off-by: Arnd Bergmann --- drivers/scsi/mpt3sas/mpt3sas_base.c | 42 - drivers/scsi/mpt3sas/mpt3sas_base.h | 2 +- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/mpt3sas/

Re: [PATCH] lpfc: correct writeq failures on 32-bit architectures

2018-02-27 Thread Arnd Bergmann
On Tue, Feb 27, 2018 at 9:24 PM, James Smart wrote: > On 2/27/2018 12:15 PM, Arnd Bergmann wrote: >> >> Could you add an #ifdef and comment around the 'if (q->dpp_enable ...)' >> block then to make sure that if anybody tries to make it work on other >> arch

Re: [PATCH] lpfc: correct writeq failures on 32-bit architectures

2018-02-27 Thread Arnd Bergmann
On Tue, Feb 27, 2018 at 7:05 PM, James Smart wrote: > On 2/27/2018 12:58 AM, Arnd Bergmann wrote: > > So you point out a very real concern, as in most cases the source buffer is > a bytestream and the desire is to send the bytestream in the same byte order > as in memory. It

Re: [PATCH] lpfc: correct writeq failures on 32-bit architectures

2018-02-27 Thread Arnd Bergmann
On Mon, Feb 26, 2018 at 10:41 PM, James Smart wrote: > On 2/26/2018 12:04 PM, Arnd Bergmann wrote: >> >> For the endianess, the key to understanding this is that readl/writel and >> readq/writeq follow the convention of accessing data as little-endian >> because

Re: [PATCH] lpfc: correct writeq failures on 32-bit architectures

2018-02-26 Thread Arnd Bergmann
On Mon, Feb 26, 2018 at 6:01 PM, James Smart wrote: > > > On 2/26/2018 12:36 AM, Arnd Bergmann wrote: >> >> Unfortunately, this is still broken on all big-endian architectures. You >> could >> use __raw_writeq() here to fix it, or change the if() clause

[PATCH] scsi: qedi: fix build regression

2018-02-26 Thread Arnd Bergmann
nst struct qedi_debugfs_ops qedi_debugfs_ops[]; ^~~~ This removes the useless #ifdef around the declarations in qedi_dbg.h to make it always build. Fixes: 779936faf4f1 ("scsi: qedi: fix building with LTO") Signed-off-by: Arnd Bergmann --

Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq

2018-02-26 Thread Arnd Bergmann
On Sun, Feb 25, 2018 at 11:02 AM, Johannes Thumshirn wrote: > Arnd Bergmann writes: >> 32-bit architectures generally cannot use writeq(), so we now get a build >> failure for the lpfc driver: >> >> drivers/scsi/lpfc/lpfc_sli.c: In function 'lpfc_sli4_wq_put'

Re: [PATCH] lpfc: correct writeq failures on 32-bit architectures

2018-02-26 Thread Arnd Bergmann
On Sat, Feb 24, 2018 at 11:30 PM, James Smart wrote: > writeq() is not present on all 32-bit architectures. > > When 32-bit, use writel() > > Signed-off-by: Dick Kennedy > Signed-off-by: James Smart > --- > drivers/scsi/lpfc/lpfc_sli.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git

Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq

2018-02-23 Thread Arnd Bergmann
On Fri, Feb 23, 2018 at 4:36 PM, Arnd Bergmann wrote: > @@ -138,12 +137,10 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, union lpfc_wqe > *wqe) > if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED) > bf_set(wqe_wqid, &wqe->

Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq

2018-02-23 Thread Arnd Bergmann
On Fri, Feb 23, 2018 at 5:41 PM, David Laight wrote: > From: Arnd Bergmann >> Sent: 23 February 2018 15:37 >> >> 32-bit architectures generally cannot use writeq(), so we now get a build >> failure for the lpfc driver: >> >> drivers/scsi/lpfc/lpfc_sli.c: In

[PATCH] scsi: lpfc: use memcpy_toio instead of writeq

2018-02-23 Thread Arnd Bergmann
to get a write-combining mapping on all architectures that support this? Fixes: 1351e69fc6db ("scsi: lpfc: Add push-to-adapter support to sli4") Signed-off-by: Arnd Bergmann --- drivers/scsi/lpfc/lpfc_sli.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dri

[4.4-stable 08/22] ncr5380: shut up gcc indentation warning

2018-02-20 Thread Arnd Bergmann
t;ncr5380: Use runtime register mapping"). We don't want the entire patch backported to stable kernels, but we can backport one hunk to get rid of the warning. Signed-off-by: Arnd Bergmann --- drivers/scsi/g_NCR5380.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/

Re: [PATCH v8 2/5] dt-bindings: scsi: ufs: add document for hisi-ufs

2018-02-19 Thread Arnd Bergmann
On Tue, Feb 13, 2018 at 11:14 AM, Li Wei wrote: > add ufs node document for Hisilicon. > > Signed-off-by: Li Wei > --- > Documentation/devicetree/bindings/ufs/ufs-hisi.txt | 37 > ++ > 1 file changed, 37 insertions(+) > create mode 100644 Documentation/devicetree/bindings/u

Re: [PATCH/RFC 0/6] Allow compile-testing NO_DMA

2018-02-06 Thread Arnd Bergmann
On Tue, Feb 6, 2018 at 2:05 PM, Robin Murphy wrote: > > It looks like we have only one real arch (score) without IOMEM, and two > (s390 and tile) where it is possible to configure out, so it does seem like > a reasonable feature to assume. Maybe we could have something like > asm-generic/no-io.h t

Re: [PATCH/RFC 0/6] Allow compile-testing NO_DMA

2018-02-06 Thread Arnd Bergmann
On Tue, Feb 6, 2018 at 11:14 AM, Geert Uytterhoeven wrote: > Hi all, > > If NO_DMA=y, get_dma_ops() returns a reference to the non-existing > symbol bad_dma_ops, thus causing a link failure if it is ever used. > > The intention of this is twofold: > 1. To catch users of the DMA API on sy

[PATCH 6/6] scsi: qedf: use correct strncpy() size

2018-02-02 Thread Arnd Bergmann
length of the source argument [-Werror=stringop-overflow=] This changes it to strscpy() with the correct length, guaranteeing a properly nul-terminated string of the right size. Signed-off-by: Arnd Bergmann --- drivers/scsi/qedf/qedf_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 3/6] scsi: sym53c416: avoid section mismatch with LTO

2018-02-02 Thread Arnd Bergmann
he annotation here to kill off the warning instead of doing a larger rework. Signed-off-by: Arnd Bergmann --- drivers/scsi/sym53c416.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c index 5bdcbe8fa958..e68bcdc75bc3 100644 --- a

[PATCH 5/6] scsi: qedi: fix building with LTO

2018-02-02 Thread Arnd Bergmann
{ This changes the declaration to match the definition, and adapts the users as necessary. Since both array can be constant here, I'm adding the 'const' everywhere for consistency. Signed-off-by: Arnd Bergmann --- drivers/scsi/qedi/qedi_dbg.h | 2 +- drivers/scsi/qedi/qedi_d

[PATCH 4/6] scsi: qedf: fix LTO-enabled build

2018-02-02 Thread Arnd Bergmann
ile where it belongs. The file operations can also be marked 'const' like the qedf_debugfs_ops. Signed-off-by: Arnd Bergmann --- drivers/scsi/qedf/qedf_dbg.h | 17 ++--- drivers/scsi/qedf/qedf_debugfs.c | 6 +++--- drivers/scsi/qedf/qedf_main.c| 8 +++- 3 files

[PATCH 2/6] scsi: NCR53c406a: avoid section mismatch with LTO

2018-02-02 Thread Arnd Bergmann
he annotation here to kill off the warning instead of doing a larger rework. Signed-off-by: Arnd Bergmann --- drivers/scsi/NCR53c406a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c index 6e110c630d2c..44b09870bf51 100644

[PATCH 0/6] scsi: fixes for building with LTO

2018-02-02 Thread Arnd Bergmann
I experimented with link time optimization after Nico's article at https://lwn.net/Articles/744507/ Here is a set of patches that came out of it for the scsi subsystem. Arnd Bergmann (6): scsi: fc_encode: work around strncpy size warnings scsi: NCR53c406a: avoid section mismatch wit

[PATCH 1/6] scsi: fc_encode: work around strncpy size warnings

2018-02-02 Thread Arnd Bergmann
o a region of size 1 overflows the destination [-Werror=stringop-overflow=] strncpy((char *)&entry->value, ^ No idea what the right fix is. Signed-off-by: Arnd Bergmann --- include/scsi/fc/fc_ms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/scsi/f

[PATCH] scsi: arcmsr: avoid do_gettimeofday

2018-01-21 Thread Arnd Bergmann
l adjustment. Fixes: b416c099472a ("scsi: arcmsr: Add a function to set date and time to firmware") Signed-off-by: Arnd Bergmann --- drivers/scsi/arcmsr/arcmsr_hba.c | 37 ++--- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/drivers/scsi/arcm

Re: [PATCH] [RESEND] scsi: ips: fix firmware timestamps for 32-bit

2018-01-18 Thread Arnd Bergmann
On Thu, Jan 18, 2018 at 10:35 AM, Finn Thain wrote: > On Wed, 17 Jan 2018, Arnd Bergmann wrote: > >> do_gettimeofday() is deprecated since it will stop working in 2038 on >> 32-bit platforms. The firmware interface here actually supports times >> until year 25500,

[PATCH] scsi: fas216: fix sense buffer initialization

2018-01-18 Thread Arnd Bergmann
check whether we actually need to initialize the buffer here, but it's clear that if we do it, we should use the correct size. Fixes: de25deb18016 ("[SCSI] use dynamically allocated sense buffer") Signed-off-by: Arnd Bergmann --- drivers/scsi/arm/fas216.c | 2 +- 1 file changed

[PATCH] [RESEND] scsi: fnic: use 64-bit timestamps

2018-01-17 Thread Arnd Bergmann
struct timespec is deprecated since it overflows in 2038 on 32-bit architectures, so we should use timespec64 consistently. I'm slightly adapting the format strings here, to make sure we print the nanoseconds with the correct number of leading zeroes. Signed-off-by: Arnd Bergmann --- Origi

[PATCH] [RESEND] scsi: esas2r: use ktime_get_real_seconds()

2018-01-17 Thread Arnd Bergmann
. This changes do_gettimeofday() to ktime_get_real_seconds(), which at least simplifies the code a bit, and avoids the deprecated interface. I'm adding a comment about the overflow to document what happens. Signed-off-by: Arnd Bergmann --- Originally submitted in November 2017, no reply s

[PATCH] [RESEND] scsi: ips: fix firmware timestamps for 32-bit

2018-01-17 Thread Arnd Bergmann
right format also has the advantage of greatly simplifying the time management code. Signed-off-by: Arnd Bergmann --- Submitted originally in November 2017. The aacr...@adaptec.com apparently bounced. Trying again now with a few people on Cc that previously reviewed patches to this driver

[PATCH] [RESEND] megaraid: use ktime_get_real for firmware time

2018-01-17 Thread Arnd Bergmann
do_gettimeofday() overflows in 2038 on 32-bit architectures and is deprecated, so convert this driver to call ktime_get_real() directly. This also simplifies the calculation. Signed-off-by: Arnd Bergmann --- Sent originally in Nov 2017, no comments. Please apply --- drivers/scsi/megaraid

Re: [PATCH] scsi: mptfusion: use strlcpy() instead of strncpy()

2018-01-08 Thread Arnd Bergmann
d 100 equals destination size [-Wstringop-truncation] > > We need to use strlcpy() to make sure the dest string is > nul-terminated. > > Signed-off-by: Xiongfeng Wang Looks correct to me, Acked-by: Arnd Bergmann

[PATCH] scsi: bfa: fix type conversion warning

2017-12-06 Thread Arnd Bergmann
rather unusual way of using the private data only as a pointer to the previously allocated structure. I did not try to get rid of the extra indirection level entirely, which would have been rather invasive and required reworking the entire initialization sequence. Fixes: 45349821ab3a ("

[PATCH] scsi: bfa: convert to strlcpy/strlcat

2017-12-04 Thread Arnd Bergmann
or=stringop-truncation] drivers/scsi/bfa/bfa_fcbuild.c:1253:25: note: length computed here drivers/scsi/bfa/bfa_fcbuild.c: In function 'fc_rsnn_nn_build': drivers/scsi/bfa/bfa_fcbuild.c:1275:2: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as

Re: News UBSAN warnings in aacraid

2017-11-28 Thread Arnd Bergmann
On Tue, Nov 28, 2017 at 2:05 PM, Meelis Roos wrote: >> I think this chunk would solve the problem and result in the >> same behavior as before: >> >> --- a/drivers/scsi/aacraid/commsup.c >> +++ b/drivers/scsi/aacraid/commsup.c >> @@ -2511,8 +2511,8 @@ int aac_command_thread(void *data) >>

[PATCH] scsi: aacraid: address UBSAN warning regression

2017-11-28 Thread Arnd Bergmann
though. Fixes: 820f18865912 ("scsi: aacraid: use timespec64 instead of timeval") Tested-by: Meelis Roos Signed-off-by: Arnd Bergmann --- drivers/scsi/aacraid/commsup.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scs

Re: News UBSAN warnings in aacraid

2017-11-27 Thread Arnd Bergmann
On Mon, Nov 27, 2017 at 8:17 PM, Meelis Roos wrote: > Tried 4.15-rc1 on an old 32-bit HP Netserver with aacraid card. Compared > to 4.14, there are new UBSAN warnings with timer related backtraces, so > the timespec64 change seems suspicious: > [ 12.228155] UBSAN: Undefined behaviour in > driv

[PATCH] scsi: debug: remove jiffies_to_timespec

2017-11-27 Thread Arnd Bergmann
There is no need to go through an intermediate timespec to convert to ktime_t when we just want a simple multiplication. This gets rid of one of the few users of jiffies_to_timespec, which I hope to remove as part of the y2038 cleanup. Signed-off-by: Arnd Bergmann --- drivers/scsi/scsi_debug.c

Re: [Y2038] [PATCH 3/7] scsi: bfa: improve bfa_ioc_send_enable/disable data

2017-11-13 Thread Arnd Bergmann
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

[PATCH 1/3] scsi: 3ware: fix 32-bit time calculations

2017-11-10 Thread Arnd Bergmann
that without breaking the ABI. User space has 90 years to learn to deal with it, so it's probably ok. I'm changing it to use ktime_get_real_seconds() with a comment to document what happens when. Signed-off-by: Arnd Bergmann --- drivers/scsi/3w-9xxx.c | 5 ++--- drivers/scsi/3w-

[PATCH 2/3] scsi: 3ware: use 64-bit times for FW time sync

2017-11-10 Thread Arnd Bergmann
ktime_get_real_seconds(). Signed-off-by: Arnd Bergmann --- drivers/scsi/3w-9xxx.c | 8 +++- drivers/scsi/3w-sas.c | 10 -- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index cb9af3f7b653..b1c9bd9c1bfd 100644 --- a

[PATCH 3/3] scsi: 3w-9xxx: rework lock timeouts

2017-11-10 Thread Arnd Bergmann
rflow time. This changes it to using monotonic time, using ktime_get() to simplify the code. Signed-off-by: Arnd Bergmann --- drivers/scsi/3w-9xxx.c | 13 ++--- drivers/scsi/3w-9xxx.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/3w-9xxx.c b/drive

[PATCH] megaraid: use ktime_get_real for firmware time

2017-11-10 Thread Arnd Bergmann
do_gettimeofday() overflows in 2038 on 32-bit architectures and is deprecated, so convert this driver to call ktime_get_real() directly. This also simplifies the calculation. Signed-off-by: Arnd Bergmann --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 7 +++ 1 file changed, 3 insertions

[PATCH] scsi: ips: fix firmware timestamps for 32-bit

2017-11-10 Thread Arnd Bergmann
right format also has the advantage of greatly simplifying the time management code. Signed-off-by: Arnd Bergmann --- drivers/scsi/ips.c | 78 +++--- drivers/scsi/ips.h | 2 +- 2 files changed, 17 insertions(+), 63 deletions(-) diff --git a

[PATCH 0/7] scsi: bfa: do_gettimeofday removal

2017-11-10 Thread Arnd Bergmann
ch in the series ("scsi: bfa: use 64-bit times in bfa_aen_entry_s ABI") is one that needs to be reviewed very carefully, and it can be skipped if the maintainers prefer to leave the 32-bit ABI unchanged, the rest are hopefully fairly straightforward. Arnd Arnd Bergmann (7):

[PATCH 2/7] scsi: bfa: use proper time accessor for stats_reset_time

2017-11-10 Thread Arnd Bergmann
settimeofday calls and other problems. This uses the ktime_get_seconds() function instead, which does what we need here. Signed-off-by: Arnd Bergmann --- drivers/scsi/bfa/bfa_port.c | 15 +++ drivers/scsi/bfa/bfa_port.h | 2 +- drivers/scsi/bfa/bfa_svc.c | 15 --- drivers/scsi

[PATCH] scsi: esas2r: use ktime_get_real_seconds()

2017-11-10 Thread Arnd Bergmann
. This changes do_gettimeofday() to ktime_get_real_seconds(), which at least simplifies the code a bit, and avoids the deprecated interface. I'm adding a comment about the overflow to document what happens. Signed-off-by: Arnd Bergmann --- drivers/scsi/esas2r/esas2r_init.c | 5 ++--- 1 file ch

[PATCH 4/7] scsi: bfa: document overflow of io_profile_start_time

2017-11-10 Thread Arnd Bergmann
point at which it overflows to where we actually assign it to the bfa_fcpim_del_itn_stats_s structure, with an appropriate comment. Signed-off-by: Arnd Bergmann --- drivers/scsi/bfa/bfa_fcpim.c | 3 ++- drivers/scsi/bfa/bfa_fcpim.h | 4 ++-- drivers/scsi/bfa/bfad_bsg.c | 4 +--- 3 files changed

[PATCH 1/7] scsi: bfa: use ktime_get_real_ts64 for firmware timestamp

2017-11-10 Thread Arnd Bergmann
leap seconds, or the y2038 overflow. This converts it to ktime_get_ts64(), which has none of those problems but is not synchronized to wall-clock time. Signed-off-by: Arnd Bergmann --- drivers/scsi/bfa/bfa_cs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scs

[PATCH 6/7] scsi: bfa: try to sanitize vendor netlink events

2017-11-10 Thread Arnd Bergmann
2106. Since the macro becomes overly complex at this point, I'm changing it to an inline function for readability. I'm not changing the 32-bit user-space ABI at this point, to keep the changes separate, I deally this would be defined using the same binary layout for all arch

[PATCH 5/7] scsi: bfa: replace bfa_get_log_time() with ktime_get_real_seconds()

2017-11-10 Thread Arnd Bergmann
the same thing as bfa_get_log_time() without that problem, so we can simply remove the former use ktime_get_real_seconds() instead. Signed-off-by: Arnd Bergmann --- drivers/scsi/bfa/bfa_svc.c | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a

[PATCH 7/7] scsi: bfa: use 64-bit times in bfa_aen_entry_s ABI

2017-11-10 Thread Arnd Bergmann
e breakage. I'm posting it under the assumption that there are no open-source tools using the netlink interface, and that users of the binaries provided by qlogic for SLES10/11 and RHEL5/6 are not actually being used on new future systems with 32-bit x86 kernels. Signed-off-by: Arnd Bergmann -

[PATCH 3/7] scsi: bfa: improve bfa_ioc_send_enable/disable data

2017-11-10 Thread Arnd Bergmann
d 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.

[PATCH] aacraid: use timespec64 instead of timeval

2017-11-07 Thread Arnd Bergmann
, and avoids relying on signed integer overflow to pass times into the second interface. The interface used in aac_send_hosttime() however is still problematic in year 2106 when 32-bit seconds overflow. Hopefully we don't have to worry about aacraid by that time. Signed-off-by: Arnd Ber

[PATCH] fnic: use 64-bit timestamps

2017-11-07 Thread Arnd Bergmann
struct timespec is deprecated since it overflows in 2038 on 32-bit architectures, so we should use timespec64 consistently. I'm slightly adapting the format strings here, to make sure we print the nanoseconds with the correct number of leading zeroes. Signed-off-by: Arnd Bergmann --- dr

[PATCH] mpt3sas: fix dma_addr_t casts

2017-11-06 Thread Arnd Bergmann
ot of type casts in the process. I'm also renaming some variables to avoid confusion between physical and dma address spaces that are often distinct. Fixes: 016d5c35e278 ("scsi: mpt3sas: SGL to PRP Translation for I/Os to NVMe devices") Signed-off-by: Arnd Bergmann --- drivers/scsi/mp

Re: [PATCH] scsi: hisi_sas: select CONFIG_RAS

2017-11-03 Thread Arnd Bergmann
On Fri, Nov 3, 2017 at 11:14 AM, John Garry wrote: > + Shiju, who authored the original patch > >> index d42f29a5eb65..6ad8a6251d21 100644 >> --- a/drivers/scsi/hisi_sas/Kconfig >> +++ b/drivers/scsi/hisi_sas/Kconfig >> @@ -4,6 +4,7 @@ config SCSI_HISI_SAS >> depends on ARM64 || COMPILE_T

[PATCH] scsi: hisi_sas: select CONFIG_RAS

2017-11-02 Thread Arnd Bergmann
like this, but the change fixes the link error. Fixes: dfeb5021f001 ("scsi: hisi_sas: report ECC and AXI errors in v2 hw to userspace") Signed-off-by: Arnd Bergmann --- drivers/scsi/hisi_sas/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/hisi_sas/Kconfig b/dri

Re: [PATCH] block: fix CDROM dependency on BLK_DEV

2017-11-02 Thread Arnd Bergmann
On Thu, Nov 2, 2017 at 3:59 PM, Bart Van Assche wrote: > On Thu, 2017-11-02 at 12:19 +0100, Arnd Bergmann wrote: >> After the cdrom cleanup, I get randconfig warnings for some configurations: >> >> warning: (BLK_DEV_IDECD && BLK_DEV_SR) selects CDROM which has

[PATCH] block: fix CDROM dependency on BLK_DEV

2017-11-02 Thread Arnd Bergmann
eady have this and don't need a change. Fixes: 2a750166a5be ("block: Rework drivers/cdrom/Makefile") Signed-off-by: Arnd Bergmann --- drivers/ide/Kconfig | 1 + drivers/scsi/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ide/Kconfig b/drive

Re: 答复: [PATCH v5 2/5] dt-bindings: scsi: ufs: add document for hisi-ufs

2017-10-30 Thread Arnd Bergmann
On Tue, Oct 24, 2017 at 11:06 AM, liwei (CM) wrote: > what's your opinion about my explanation and revision method? > I am looking forward to your reply, thanks! Sorry for the delay, I was travelling last week. > 发件人: arndbergm...@gmail.com [mailto:arndbergm...@gmail.com] 代表 Arnd

Re: [PATCH v5 2/5] dt-bindings: scsi: ufs: add document for hisi-ufs

2017-10-20 Thread Arnd Bergmann
On Fri, Oct 20, 2017 at 10:52 AM, Li Wei wrote: > --- /dev/null > +++ b/Documentation/devicetree/bindings/ufs/ufs-hisi.txt > @@ -0,0 +1,46 @@ > +* Hisilicon Universal Flash Storage (UFS) Host Controller > + > +UFS nodes are defined to describe on-chip UFS hardware macro. > +Each UFS Host Controlle

  1   2   3   4   5   >