Commit 45b6ae76 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
 "A couple of bug fixes, minor cleanup and a change to the default
  config"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/dasd: fix failing CUIR assignment under LPAR
  s390/pageattr: handle numpages parameter correctly
  s390/dasd: fix hanging device after clear subchannel
  s390/qdio: avoid reschedule of outbound tasklet once killed
  s390/qdio: remove checks for ccw device internal state
  s390/qdio: fix double return code evaluation
  s390/qdio: get rid of spin_lock_irqsave usage
  s390/cio: remove subchannel_id from ccw_device_private
  s390/qdio: obtain subchannel_id via ccw_device_get_schid()
  s390/cio: stop using subchannel_id from ccw_device_private
  s390/config: make the vector optimized crc function builtin
  s390/lib: fix memcmp and strstr
  s390/crc32-vx: Fix checksum calculation for small sizes
  s390: clarify compressed image code path
parents ae5d68be af775210
...@@ -21,16 +21,21 @@ ENTRY(startup_continue) ...@@ -21,16 +21,21 @@ ENTRY(startup_continue)
lg %r15,.Lstack-.LPG1(%r13) lg %r15,.Lstack-.LPG1(%r13)
aghi %r15,-160 aghi %r15,-160
brasl %r14,decompress_kernel brasl %r14,decompress_kernel
# setup registers for memory mover & branch to target # Set up registers for memory mover. We move the decompressed image to
# 0x11000, starting at offset 0x11000 in the decompressed image so
# that code living at 0x11000 in the image will end up at 0x11000 in
# memory.
lgr %r4,%r2 lgr %r4,%r2
lg %r2,.Loffset-.LPG1(%r13) lg %r2,.Loffset-.LPG1(%r13)
la %r4,0(%r2,%r4) la %r4,0(%r2,%r4)
lg %r3,.Lmvsize-.LPG1(%r13) lg %r3,.Lmvsize-.LPG1(%r13)
lgr %r5,%r3 lgr %r5,%r3
# move the memory mover someplace safe # Move the memory mover someplace safe so it doesn't overwrite itself.
la %r1,0x200 la %r1,0x200
mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13) mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
# decompress image is started at 0x11000 # When the memory mover is done we pass control to
# arch/s390/kernel/head64.S:startup_continue which lives at 0x11000 in
# the decompressed image.
lgr %r6,%r2 lgr %r6,%r2
br %r1 br %r1
mover: mover:
......
...@@ -678,7 +678,7 @@ CONFIG_CRYPTO_SHA512_S390=m ...@@ -678,7 +678,7 @@ CONFIG_CRYPTO_SHA512_S390=m
CONFIG_CRYPTO_DES_S390=m CONFIG_CRYPTO_DES_S390=m
CONFIG_CRYPTO_AES_S390=m CONFIG_CRYPTO_AES_S390=m
CONFIG_CRYPTO_GHASH_S390=m CONFIG_CRYPTO_GHASH_S390=m
CONFIG_CRYPTO_CRC32_S390=m CONFIG_CRYPTO_CRC32_S390=y
CONFIG_ASYMMETRIC_KEY_TYPE=y CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m
CONFIG_X509_CERTIFICATE_PARSER=m CONFIG_X509_CERTIFICATE_PARSER=m
......
...@@ -616,7 +616,7 @@ CONFIG_CRYPTO_SHA512_S390=m ...@@ -616,7 +616,7 @@ CONFIG_CRYPTO_SHA512_S390=m
CONFIG_CRYPTO_DES_S390=m CONFIG_CRYPTO_DES_S390=m
CONFIG_CRYPTO_AES_S390=m CONFIG_CRYPTO_AES_S390=m
CONFIG_CRYPTO_GHASH_S390=m CONFIG_CRYPTO_GHASH_S390=m
CONFIG_CRYPTO_CRC32_S390=m CONFIG_CRYPTO_CRC32_S390=y
CONFIG_ASYMMETRIC_KEY_TYPE=y CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m
CONFIG_X509_CERTIFICATE_PARSER=m CONFIG_X509_CERTIFICATE_PARSER=m
......
...@@ -615,7 +615,7 @@ CONFIG_CRYPTO_SHA512_S390=m ...@@ -615,7 +615,7 @@ CONFIG_CRYPTO_SHA512_S390=m
CONFIG_CRYPTO_DES_S390=m CONFIG_CRYPTO_DES_S390=m
CONFIG_CRYPTO_AES_S390=m CONFIG_CRYPTO_AES_S390=m
CONFIG_CRYPTO_GHASH_S390=m CONFIG_CRYPTO_GHASH_S390=m
CONFIG_CRYPTO_CRC32_S390=m CONFIG_CRYPTO_CRC32_S390=y
CONFIG_ASYMMETRIC_KEY_TYPE=y CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m
CONFIG_X509_CERTIFICATE_PARSER=m CONFIG_X509_CERTIFICATE_PARSER=m
......
...@@ -51,6 +51,9 @@ u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size); ...@@ -51,6 +51,9 @@ u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
struct kernel_fpu vxstate; \ struct kernel_fpu vxstate; \
unsigned long prealign, aligned, remaining; \ unsigned long prealign, aligned, remaining; \
\ \
if (datalen < VX_MIN_LEN + VX_ALIGN_MASK) \
return ___crc32_sw(crc, data, datalen); \
\
if ((unsigned long)data & VX_ALIGN_MASK) { \ if ((unsigned long)data & VX_ALIGN_MASK) { \
prealign = VX_ALIGNMENT - \ prealign = VX_ALIGNMENT - \
((unsigned long)data & VX_ALIGN_MASK); \ ((unsigned long)data & VX_ALIGN_MASK); \
...@@ -59,9 +62,6 @@ u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size); ...@@ -59,9 +62,6 @@ u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
data = (void *)((unsigned long)data + prealign); \ data = (void *)((unsigned long)data + prealign); \
} \ } \
\ \
if (datalen < VX_MIN_LEN) \
return ___crc32_sw(crc, data, datalen); \
\
aligned = datalen & ~VX_ALIGN_MASK; \ aligned = datalen & ~VX_ALIGN_MASK; \
remaining = datalen & VX_ALIGN_MASK; \ remaining = datalen & VX_ALIGN_MASK; \
\ \
......
...@@ -234,7 +234,7 @@ CONFIG_CRYPTO_SHA256_S390=m ...@@ -234,7 +234,7 @@ CONFIG_CRYPTO_SHA256_S390=m
CONFIG_CRYPTO_SHA512_S390=m CONFIG_CRYPTO_SHA512_S390=m
CONFIG_CRYPTO_DES_S390=m CONFIG_CRYPTO_DES_S390=m
CONFIG_CRYPTO_AES_S390=m CONFIG_CRYPTO_AES_S390=m
CONFIG_CRYPTO_CRC32_S390=m CONFIG_CRYPTO_CRC32_S390=y
CONFIG_CRC7=m CONFIG_CRC7=m
# CONFIG_XZ_DEC_X86 is not set # CONFIG_XZ_DEC_X86 is not set
# CONFIG_XZ_DEC_POWERPC is not set # CONFIG_XZ_DEC_POWERPC is not set
......
...@@ -309,7 +309,9 @@ ENTRY(startup_kdump) ...@@ -309,7 +309,9 @@ ENTRY(startup_kdump)
l %r15,.Lstack-.LPG0(%r13) l %r15,.Lstack-.LPG0(%r13)
ahi %r15,-STACK_FRAME_OVERHEAD ahi %r15,-STACK_FRAME_OVERHEAD
brasl %r14,verify_facilities brasl %r14,verify_facilities
/* Continue with startup code in head64.S */ # For uncompressed images, continue in
# arch/s390/kernel/head64.S. For compressed images, continue in
# arch/s390/boot/compressed/head.S.
jg startup_continue jg startup_continue
.Lstack: .Lstack:
......
...@@ -237,11 +237,10 @@ char * strrchr(const char * s, int c) ...@@ -237,11 +237,10 @@ char * strrchr(const char * s, int c)
EXPORT_SYMBOL(strrchr); EXPORT_SYMBOL(strrchr);
static inline int clcle(const char *s1, unsigned long l1, static inline int clcle(const char *s1, unsigned long l1,
const char *s2, unsigned long l2, const char *s2, unsigned long l2)
int *diff)
{ {
register unsigned long r2 asm("2") = (unsigned long) s1; register unsigned long r2 asm("2") = (unsigned long) s1;
register unsigned long r3 asm("3") = (unsigned long) l2; register unsigned long r3 asm("3") = (unsigned long) l1;
register unsigned long r4 asm("4") = (unsigned long) s2; register unsigned long r4 asm("4") = (unsigned long) s2;
register unsigned long r5 asm("5") = (unsigned long) l2; register unsigned long r5 asm("5") = (unsigned long) l2;
int cc; int cc;
...@@ -252,7 +251,6 @@ static inline int clcle(const char *s1, unsigned long l1, ...@@ -252,7 +251,6 @@ static inline int clcle(const char *s1, unsigned long l1,
" srl %0,28" " srl %0,28"
: "=&d" (cc), "+a" (r2), "+a" (r3), : "=&d" (cc), "+a" (r2), "+a" (r3),
"+a" (r4), "+a" (r5) : : "cc"); "+a" (r4), "+a" (r5) : : "cc");
*diff = *(char *)r2 - *(char *)r4;
return cc; return cc;
} }
...@@ -270,9 +268,9 @@ char * strstr(const char * s1,const char * s2) ...@@ -270,9 +268,9 @@ char * strstr(const char * s1,const char * s2)
return (char *) s1; return (char *) s1;
l1 = __strend(s1) - s1; l1 = __strend(s1) - s1;
while (l1-- >= l2) { while (l1-- >= l2) {
int cc, dummy; int cc;
cc = clcle(s1, l1, s2, l2, &dummy); cc = clcle(s1, l2, s2, l2);
if (!cc) if (!cc)
return (char *) s1; return (char *) s1;
s1++; s1++;
...@@ -313,11 +311,11 @@ EXPORT_SYMBOL(memchr); ...@@ -313,11 +311,11 @@ EXPORT_SYMBOL(memchr);
*/ */
int memcmp(const void *cs, const void *ct, size_t n) int memcmp(const void *cs, const void *ct, size_t n)
{ {
int ret, diff; int ret;
ret = clcle(cs, n, ct, n, &diff); ret = clcle(cs, n, ct, n);
if (ret) if (ret)
ret = diff; ret = ret == 1 ? -1 : 1;
return ret; return ret;
} }
EXPORT_SYMBOL(memcmp); EXPORT_SYMBOL(memcmp);
......
...@@ -252,6 +252,8 @@ static int change_page_attr(unsigned long addr, unsigned long end, ...@@ -252,6 +252,8 @@ static int change_page_attr(unsigned long addr, unsigned long end,
int rc = -EINVAL; int rc = -EINVAL;
pgd_t *pgdp; pgd_t *pgdp;
if (addr == end)
return 0;
if (end >= MODULES_END) if (end >= MODULES_END)
return -EINVAL; return -EINVAL;
mutex_lock(&cpa_mutex); mutex_lock(&cpa_mutex);
......
...@@ -1643,9 +1643,18 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1643,9 +1643,18 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
u8 *sense = NULL; u8 *sense = NULL;
int expires; int expires;
cqr = (struct dasd_ccw_req *) intparm;
if (IS_ERR(irb)) { if (IS_ERR(irb)) {
switch (PTR_ERR(irb)) { switch (PTR_ERR(irb)) {
case -EIO: case -EIO:
if (cqr && cqr->status == DASD_CQR_CLEAR_PENDING) {
device = (struct dasd_device *) cqr->startdev;
cqr->status = DASD_CQR_CLEARED;
dasd_device_clear_timer(device);
wake_up(&dasd_flush_wq);
dasd_schedule_device_bh(device);
return;
}
break; break;
case -ETIMEDOUT: case -ETIMEDOUT:
DBF_EVENT_DEVID(DBF_WARNING, cdev, "%s: " DBF_EVENT_DEVID(DBF_WARNING, cdev, "%s: "
...@@ -1661,7 +1670,6 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1661,7 +1670,6 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
} }
now = get_tod_clock(); now = get_tod_clock();
cqr = (struct dasd_ccw_req *) intparm;
/* check for conditions that should be handled immediately */ /* check for conditions that should be handled immediately */
if (!cqr || if (!cqr ||
!(scsw_dstat(&irb->scsw) == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) && !(scsw_dstat(&irb->scsw) == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) &&
......
...@@ -5078,6 +5078,8 @@ static int dasd_eckd_read_message_buffer(struct dasd_device *device, ...@@ -5078,6 +5078,8 @@ static int dasd_eckd_read_message_buffer(struct dasd_device *device,
return PTR_ERR(cqr); return PTR_ERR(cqr);
} }
cqr->lpm = lpum;
retry:
cqr->startdev = device; cqr->startdev = device;
cqr->memdev = device; cqr->memdev = device;
cqr->block = NULL; cqr->block = NULL;
...@@ -5122,6 +5124,14 @@ static int dasd_eckd_read_message_buffer(struct dasd_device *device, ...@@ -5122,6 +5124,14 @@ static int dasd_eckd_read_message_buffer(struct dasd_device *device,
(prssdp + 1); (prssdp + 1);
memcpy(messages, message_buf, memcpy(messages, message_buf,
sizeof(struct dasd_rssd_messages)); sizeof(struct dasd_rssd_messages));
} else if (cqr->lpm) {
/*
* on z/VM we might not be able to do I/O on the requested path
* but instead we get the required information on any path
* so retry with open path mask
*/
cqr->lpm = 0;
goto retry;
} else } else
DBF_EVENT_DEVID(DBF_WARNING, device->cdev, DBF_EVENT_DEVID(DBF_WARNING, device->cdev,
"Reading messages failed with rc=%d\n" "Reading messages failed with rc=%d\n"
......
...@@ -762,7 +762,6 @@ static int io_subchannel_initialize_dev(struct subchannel *sch, ...@@ -762,7 +762,6 @@ static int io_subchannel_initialize_dev(struct subchannel *sch,
priv->state = DEV_STATE_NOT_OPER; priv->state = DEV_STATE_NOT_OPER;
priv->dev_id.devno = sch->schib.pmcw.dev; priv->dev_id.devno = sch->schib.pmcw.dev;
priv->dev_id.ssid = sch->schid.ssid; priv->dev_id.ssid = sch->schid.ssid;
priv->schid = sch->schid;
INIT_WORK(&priv->todo_work, ccw_device_todo); INIT_WORK(&priv->todo_work, ccw_device_todo);
INIT_LIST_HEAD(&priv->cmb_list); INIT_LIST_HEAD(&priv->cmb_list);
...@@ -1000,7 +999,6 @@ static int ccw_device_move_to_sch(struct ccw_device *cdev, ...@@ -1000,7 +999,6 @@ static int ccw_device_move_to_sch(struct ccw_device *cdev,
put_device(&old_sch->dev); put_device(&old_sch->dev);
/* Initialize new subchannel. */ /* Initialize new subchannel. */
spin_lock_irq(sch->lock); spin_lock_irq(sch->lock);
cdev->private->schid = sch->schid;
cdev->ccwlock = sch->lock; cdev->ccwlock = sch->lock;
if (!sch_is_pseudo_sch(sch)) if (!sch_is_pseudo_sch(sch))
sch_set_cdev(sch, cdev); sch_set_cdev(sch, cdev);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
static void static void
ccw_device_msg_control_check(struct ccw_device *cdev, struct irb *irb) ccw_device_msg_control_check(struct ccw_device *cdev, struct irb *irb)
{ {
struct subchannel *sch = to_subchannel(cdev->dev.parent);
char dbf_text[15]; char dbf_text[15];
if (!scsw_is_valid_cstat(&irb->scsw) || if (!scsw_is_valid_cstat(&irb->scsw) ||
...@@ -36,10 +37,10 @@ ccw_device_msg_control_check(struct ccw_device *cdev, struct irb *irb) ...@@ -36,10 +37,10 @@ ccw_device_msg_control_check(struct ccw_device *cdev, struct irb *irb)
"received" "received"
" ... device %04x on subchannel 0.%x.%04x, dev_stat " " ... device %04x on subchannel 0.%x.%04x, dev_stat "
": %02X sch_stat : %02X\n", ": %02X sch_stat : %02X\n",
cdev->private->dev_id.devno, cdev->private->schid.ssid, cdev->private->dev_id.devno, sch->schid.ssid,
cdev->private->schid.sch_no, sch->schid.sch_no,
scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw)); scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw));
sprintf(dbf_text, "chk%x", cdev->private->schid.sch_no); sprintf(dbf_text, "chk%x", sch->schid.sch_no);
CIO_TRACE_EVENT(0, dbf_text); CIO_TRACE_EVENT(0, dbf_text);
CIO_HEX_EVENT(0, irb, sizeof(struct irb)); CIO_HEX_EVENT(0, irb, sizeof(struct irb));
} }
......
...@@ -120,7 +120,6 @@ struct ccw_device_private { ...@@ -120,7 +120,6 @@ struct ccw_device_private {
int state; /* device state */ int state; /* device state */
atomic_t onoff; atomic_t onoff;
struct ccw_dev_id dev_id; /* device id */ struct ccw_dev_id dev_id; /* device id */
struct subchannel_id schid; /* subchannel number */
struct ccw_request req; /* internal I/O request */ struct ccw_request req; /* internal I/O request */
int iretry; int iretry;
u8 pgid_valid_mask; /* mask of valid PGIDs */ u8 pgid_valid_mask; /* mask of valid PGIDs */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment