mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
for-4.17/block-20180402
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABCAAGBQJawr05AAoJEPfTWPspceCmT2UP/1uuaqwzyl4VjFNb/k7KS7UM
+Cs/1HBlGomgMA8orDTGqtWqLRdR3z4RSh0+MvXTzQ78HpFVYz7CbDc9itHm+G9M
X0ypD4kF/JGCFb5cxk+x6qv28uO2nv4DP3+0hHqJWLH4UVJBWDY6bs4BPShsf9QB
I6XjioNMhoqylXgdOITLODJZz+TcChlJMDAqwhpJwh9TH1wjobleAZ6AdmCPfgi5
h0UCKMUKzcVJlNZwQUrzrs2cxcx9Uhunnbz7HK0ZV4n/FKFtDpGynFpQQ71pZxKe
Be0ZOBPCQvC3ykOM/egCIvC/e5y7FgrjORD6jxyu1PTwAugI5E1VYSMxHkXvgPAx
zOo9A7RT4GPO2tDQv+DbzNFpqeSAclTgSmr+/y1wmheBs8DiSt7MPVBiNM4zdCNv
NLk9z7IEjFhdmluSB/LbTb1aokypMb/q7QTLouPHdwGn80k7yrhFyLHgdjpNTQ2K
UHfHZvGxkOX6SmFhBNOtIFUkuSceenh64a0RkRle7filx+ImpbCVm2/GYi9zZNCu
EtctgzLbLmz40zMiyDaZS2bxBgGzfn6yf4xd9LsaAJPMhvZnmXogT0D9ctWXB0WU
mMaS7sOkLnNjnGkzF1fHkeiZ/oigrstJbe+CA7BtOdwxpWn6MZBgKEoFQ6iA2b3X
5J1axMgVH5LAsIEcEQVq
=RVhK
-----END PGP SIGNATURE-----
Merge tag 'for-4.17/block-20180402' of git://git.kernel.dk/linux-block
Pull block layer updates from Jens Axboe:
"It's a pretty quiet round this time, which is nice. This contains:
- series from Bart, cleaning up the way we set/test/clear atomic
queue flags.
- series from Bart, fixing races between gendisk and queue
registration and removal.
- set of bcache fixes and improvements from various folks, by way of
Michael Lyle.
- set of lightnvm updates from Matias, most of it being the 1.2 to
2.0 transition.
- removal of unused DIO flags from Nikolay.
- blk-mq/sbitmap memory ordering fixes from Omar.
- divide-by-zero fix for BFQ from Paolo.
- minor documentation patches from Randy.
- timeout fix from Tejun.
- Alpha "can't write a char atomically" fix from Mikulas.
- set of NVMe fixes by way of Keith.
- bsg and bsg-lib improvements from Christoph.
- a few sed-opal fixes from Jonas.
- cdrom check-disk-change deadlock fix from Maurizio.
- various little fixes, comment fixes, etc from various folks"
* tag 'for-4.17/block-20180402' of git://git.kernel.dk/linux-block: (139 commits)
blk-mq: Directly schedule q->timeout_work when aborting a request
blktrace: fix comment in blktrace_api.h
lightnvm: remove function name in strings
lightnvm: pblk: remove some unnecessary NULL checks
lightnvm: pblk: don't recover unwritten lines
lightnvm: pblk: implement 2.0 support
lightnvm: pblk: implement get log report chunk
lightnvm: pblk: rename ppaf* to addrf*
lightnvm: pblk: check for supported version
lightnvm: implement get log report chunk helpers
lightnvm: make address conversions depend on generic device
lightnvm: add support for 2.0 address format
lightnvm: normalize geometry nomenclature
lightnvm: complete geo structure with maxoc*
lightnvm: add shorten OCSSD version in geo
lightnvm: add minor version to generic geometry
lightnvm: simplify geometry structure
lightnvm: pblk: refactor init/exit sequences
lightnvm: Avoid validation of default op value
lightnvm: centralize permission check for lightnvm ioctl
...
This commit is contained in:
commit
3526dd0c78
148 changed files with 4266 additions and 2060 deletions
|
|
@ -554,15 +554,14 @@ static void add_token_u64(int *err, struct opal_dev *cmd, u64 number)
|
|||
|
||||
size_t len;
|
||||
int msb;
|
||||
u8 n;
|
||||
|
||||
if (!(number & ~TINY_ATOM_DATA_MASK)) {
|
||||
add_token_u8(err, cmd, number);
|
||||
return;
|
||||
}
|
||||
|
||||
msb = fls(number);
|
||||
len = DIV_ROUND_UP(msb, 4);
|
||||
msb = fls64(number);
|
||||
len = DIV_ROUND_UP(msb, 8);
|
||||
|
||||
if (cmd->pos >= IO_BUFFER_LENGTH - len - 1) {
|
||||
pr_debug("Error adding u64: end of buffer.\n");
|
||||
|
|
@ -570,10 +569,8 @@ static void add_token_u64(int *err, struct opal_dev *cmd, u64 number)
|
|||
return;
|
||||
}
|
||||
add_short_atom_header(cmd, false, false, len);
|
||||
while (len--) {
|
||||
n = number >> (len * 8);
|
||||
add_token_u8(err, cmd, n);
|
||||
}
|
||||
while (len--)
|
||||
add_token_u8(err, cmd, number >> (len * 8));
|
||||
}
|
||||
|
||||
static void add_token_bytestring(int *err, struct opal_dev *cmd,
|
||||
|
|
@ -871,6 +868,9 @@ static int response_parse(const u8 *buf, size_t length,
|
|||
static size_t response_get_string(const struct parsed_resp *resp, int n,
|
||||
const char **store)
|
||||
{
|
||||
u8 skip;
|
||||
const struct opal_resp_tok *token;
|
||||
|
||||
*store = NULL;
|
||||
if (!resp) {
|
||||
pr_debug("Response is NULL\n");
|
||||
|
|
@ -883,13 +883,30 @@ static size_t response_get_string(const struct parsed_resp *resp, int n,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (resp->toks[n].type != OPAL_DTA_TOKENID_BYTESTRING) {
|
||||
token = &resp->toks[n];
|
||||
if (token->type != OPAL_DTA_TOKENID_BYTESTRING) {
|
||||
pr_debug("Token is not a byte string!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
*store = resp->toks[n].pos + 1;
|
||||
return resp->toks[n].len - 1;
|
||||
switch (token->width) {
|
||||
case OPAL_WIDTH_TINY:
|
||||
case OPAL_WIDTH_SHORT:
|
||||
skip = 1;
|
||||
break;
|
||||
case OPAL_WIDTH_MEDIUM:
|
||||
skip = 2;
|
||||
break;
|
||||
case OPAL_WIDTH_LONG:
|
||||
skip = 4;
|
||||
break;
|
||||
default:
|
||||
pr_debug("Token has invalid width!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
*store = token->pos + skip;
|
||||
return token->len - skip;
|
||||
}
|
||||
|
||||
static u64 response_get_u64(const struct parsed_resp *resp, int n)
|
||||
|
|
|
|||
Loading…
Reference in a new issue