From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCBDFC2D0C0 for ; Mon, 23 Dec 2019 11:10:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5B2FC206D3 for ; Mon, 23 Dec 2019 11:10:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PfYjObav" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B2FC206D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A1A468E0005; Mon, 23 Dec 2019 06:10:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A36C8E0001; Mon, 23 Dec 2019 06:10:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 81BEF8E0005; Mon, 23 Dec 2019 06:10:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 61B1E8E0001 for ; Mon, 23 Dec 2019 06:10:25 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id EBCE85DD3 for ; Mon, 23 Dec 2019 11:10:24 +0000 (UTC) X-FDA: 76296137568.05.balls30_3dae2acd10d05 X-HE-Tag: balls30_3dae2acd10d05 X-Filterd-Recvd-Size: 31415 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Dec 2019 11:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577099423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BERYL1gFOZqInqBYYKtoLNwPfAwXnB2J8aOxW17BwWE=; b=PfYjObavet4Za0av3L747Tns9Ihwd+P+oJB7YpbmrRybyu70CfcwQ/X/ijc7gsOy2DFkov zJkriIVwf0EvAgL6Gemgn5nxJDKY3wVET/Jj1IpueRrGUlgj3u5Yan5XAnSDeeVdXoavSm wCNYo7ptOlMsfUGVA6f11iJ2UTnu9Mo= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-190-OEBR6HpPM1iFqJ33TMAEqw-1; Mon, 23 Dec 2019 06:10:21 -0500 Received: by mail-wr1-f72.google.com with SMTP id d8so1390268wrq.12 for ; Mon, 23 Dec 2019 03:10:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=edTQ6MTHrhcpCdabK/a6Ku+9MyY+RFTlk1BsSE60NDY=; b=blGpBn+E1UYyMc6gU6T7B/AjnbrZ6191wImoKOBBVOS5754dqVgaj33AXxQmvfcRlu wKUJL72xvTqxM6FaOUo5WDZ8J7hpJV1gtmjkaoQmCvmodXPaZc0gpo2x2l7e59B662uT YX9XURLIbCEjdsclA/7GhtJn1cQapRBm1z2gvNW+zvS9YIUVI7B6xtWQCeaDyINU1Vge ARLw2THqHFTYK/oiwOeSf6Se2G6HrGnSv+/Lmd/MEPl3GQvjKGT2WmoP1Kl7oC5wonrC jhS673x0cMg1nolHVYSTWAtCTE60PxlTkOiK75lvmy15+NWhBLUPpa+vJPsttwU6kKo9 EwUA== X-Gm-Message-State: APjAAAWq4MiApXuQh2Ig75oJfoIJ0xOFr57KxrAPaGNLW16U1Hh3myXI bRxVzH+SAoCPpwnKDwhWK6u5ThDfVXVoVkPL5DT6c3aT3azf5ry0xoywUZ5vh7dSwuN7ZgGPM7m ci+/g5GKi8GY= X-Received: by 2002:a05:600c:2050:: with SMTP id p16mr28870443wmg.176.1577099419283; Mon, 23 Dec 2019 03:10:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxdMrTOwnX4PgT7TLOsMfJoyNaXaLIWzurd5RdZdR+OPh62YTSk7Y3yPT0m+zsu+n3D4cBB/w== X-Received: by 2002:a05:600c:2050:: with SMTP id p16mr28870362wmg.176.1577099418259; Mon, 23 Dec 2019 03:10:18 -0800 (PST) Received: from localhost (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id l7sm20124218wrq.61.2019.12.23.03.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2019 03:10:17 -0800 (PST) Date: Mon, 23 Dec 2019 12:10:15 +0100 From: Oleksandr Natalenko To: kbuild-all@lists.01.org Cc: Andrew Morton , Linux Memory Management List , Corey Minyard , Jens Axboe Subject: Re: [linux-next:master 4314/4896] drivers/char/ipmi/ipmi_ssif.c:781:3: note: in expansion of macro 'memcpy' Message-ID: <20191223111015.ztav74pbg7iz3t7z@butterfly.localdomain> References: <201912220427.DzimHOR3%lkp@intel.com> MIME-Version: 1.0 In-Reply-To: <201912220427.DzimHOR3%lkp@intel.com> X-MC-Unique: OEBR6HpPM1iFqJ33TMAEqw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: /cc Corey and Jens. On Sun, Dec 22, 2019 at 04:34:30AM +0800, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.g= it master > head: 9f8535c5f75f0e23359962527dbfd31478b2cf16 > commit: 933639f5723a15a13e2105603de9e240bae2f546 [4314/4896] init/Kconfig= : enable -O3 for all arches > config: alpha-randconfig-a001-20191222 (attached as .config) > compiler: alpha-linux-gcc (GCC) 7.5.0 > reproduce: > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > git checkout 933639f5723a15a13e2105603de9e240bae2f546 > # save the attached .config to linux build tree > GCC_VERSION=3D7.5.0 make.cross ARCH=3Dalpha=20 >=20 > If you fix the issue, kindly add following tag > Reported-by: kbuild test robot >=20 > All warnings (new ones prefixed by >>): >=20 > In file included from include/linux/string.h:20:0, > from include/linux/bitmap.h:9, > from include/linux/nodemask.h:95, > from include/linux/mmzone.h:17, > from include/linux/gfp.h:6, > from include/linux/umh.h:4, > from include/linux/kmod.h:9, > from include/linux/module.h:16, > from drivers/char/ipmi/ipmi_ssif.c:37: > drivers/char/ipmi/ipmi_ssif.c: In function 'msg_written_handler': > arch/alpha/include/asm/string.h:22:16: warning: argument 2 null where = non-null expected [-Wnonnull] > #define memcpy __builtin_memcpy > >> drivers/char/ipmi/ipmi_ssif.c:781:3: note: in expansion of macro 'memc= py' > memcpy(msg->rsp, data, msg->rsp_size); > ^~~~~~ > arch/alpha/include/asm/string.h:22:16: note: in a call to built-in fun= ction '__builtin_memcpy' > #define memcpy __builtin_memcpy > >> drivers/char/ipmi/ipmi_ssif.c:781:3: note: in expansion of macro 'memc= py' > memcpy(msg->rsp, data, msg->rsp_size); > ^~~~~~ > -- > fs/io_uring.c: In function 'io_link_timeout_fn': > >> fs/io_uring.c:2831:2: warning: argument 2 null where non-null expected= [-Wnonnull] > io_put_req_find_next(req, nxt); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > fs/io_uring.c:1036:13: note: in a call to function 'io_put_req_find_ne= xt' declared here > static void io_put_req_find_next(struct io_kiocb *req, struct io_kioc= b **nxtptr) > ^~~~~~~~~~~~~~~~~~~~ >=20 > vim +/memcpy +781 drivers/char/ipmi/ipmi_ssif.c >=20 > 259307074bfcf1 Corey Minyard 2012-03-19 622 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 623 static void msg_done_hand= ler(struct ssif_info *ssif_info, int result, > 259307074bfcf1 Corey Minyard 2012-03-19 624 =09=09=09 unsigned ch= ar *data, unsigned int len) > 259307074bfcf1 Corey Minyard 2012-03-19 625 { > 259307074bfcf1 Corey Minyard 2012-03-19 626 =09struct ipmi_smi_msg *m= sg; > 259307074bfcf1 Corey Minyard 2012-03-19 627 =09unsigned long oflags, = *flags; > 259307074bfcf1 Corey Minyard 2012-03-19 628 =09int rv; > 259307074bfcf1 Corey Minyard 2012-03-19 629 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 630 =09/* > 259307074bfcf1 Corey Minyard 2012-03-19 631 =09 * We are single-threa= ded here, so no need for a lock until we > 259307074bfcf1 Corey Minyard 2012-03-19 632 =09 * start messing with = driver states or the queues. > 259307074bfcf1 Corey Minyard 2012-03-19 633 =09 */ > 259307074bfcf1 Corey Minyard 2012-03-19 634 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 635 =09if (result < 0) { > 259307074bfcf1 Corey Minyard 2012-03-19 636 =09=09ssif_info->retries_= left--; > 259307074bfcf1 Corey Minyard 2012-03-19 637 =09=09if (ssif_info->retr= ies_left > 0) { > 259307074bfcf1 Corey Minyard 2012-03-19 638 =09=09=09ssif_inc_stat(ss= if_info, receive_retries); > 259307074bfcf1 Corey Minyard 2012-03-19 639 =20 > 9162052173d238 Corey Minyard 2015-04-24 640 =09=09=09flags =3D ipmi_s= sif_lock_cond(ssif_info, &oflags); > 9162052173d238 Corey Minyard 2015-04-24 641 =09=09=09ssif_info->waiti= ng_alert =3D true; > 9162052173d238 Corey Minyard 2015-04-24 642 =09=09=09ssif_info->rtc_u= s_timer =3D SSIF_MSG_USEC; > 0711e8c1b4572d Jan Glauber 2018-10-11 643 =09=09=09if (!ssif_info->= stopping) > 259307074bfcf1 Corey Minyard 2012-03-19 644 =09=09=09=09mod_timer(&ss= if_info->retry_timer, > 259307074bfcf1 Corey Minyard 2012-03-19 645 =09=09=09=09=09 jiffies = + SSIF_MSG_JIFFIES); > 9162052173d238 Corey Minyard 2015-04-24 646 =09=09=09ipmi_ssif_unlock= _cond(ssif_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 647 =09=09=09return; > 259307074bfcf1 Corey Minyard 2012-03-19 648 =09=09} > 259307074bfcf1 Corey Minyard 2012-03-19 649 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 650 =09=09ssif_inc_stat(ssif_= info, receive_errors); > 259307074bfcf1 Corey Minyard 2012-03-19 651 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 652 =09=09if (ssif_info->ssi= f_debug & SSIF_DEBUG_MSG) > 83af41947c5cbd Corey Minyard 2018-11-27 653 =09=09=09dev_dbg(&ssif_in= fo->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 654 =09=09=09=09"%s: Error %d= \n", __func__, result); > 259307074bfcf1 Corey Minyard 2012-03-19 655 =09=09len =3D 0; > 259307074bfcf1 Corey Minyard 2012-03-19 656 =09=09goto continue_op; > 259307074bfcf1 Corey Minyard 2012-03-19 657 =09} > 259307074bfcf1 Corey Minyard 2012-03-19 658 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 659 =09if ((len > 1) && (ssif= _info->multi_pos =3D=3D 0) > 259307074bfcf1 Corey Minyard 2012-03-19 660 =09=09=09=09&& (data[0] = =3D=3D 0x00) && (data[1] =3D=3D 0x01)) { > 259307074bfcf1 Corey Minyard 2012-03-19 661 =09=09/* Start of multi-p= art read. Start the next transaction. */ > 259307074bfcf1 Corey Minyard 2012-03-19 662 =09=09int i; > 259307074bfcf1 Corey Minyard 2012-03-19 663 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 664 =09=09ssif_inc_stat(ssif_= info, received_message_parts); > 259307074bfcf1 Corey Minyard 2012-03-19 665 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 666 =09=09/* Remove the multi= -part read marker. */ > 259307074bfcf1 Corey Minyard 2012-03-19 667 =09=09len -=3D 2; > 7d6380cd40f799 Corey Minyard 2018-11-16 668 =09=09data +=3D 2; > 3d69d43baa2749 Corey Minyard 2015-04-29 669 =09=09for (i =3D 0; i < l= en; i++) > 7d6380cd40f799 Corey Minyard 2018-11-16 670 =09=09=09ssif_info->data[= i] =3D data[i]; > 259307074bfcf1 Corey Minyard 2012-03-19 671 =09=09ssif_info->multi_le= n =3D len; > 259307074bfcf1 Corey Minyard 2012-03-19 672 =09=09ssif_info->multi_po= s =3D 1; > 259307074bfcf1 Corey Minyard 2012-03-19 673 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 674 =09=09rv =3D ssif_i2c_sen= d(ssif_info, msg_done_handler, I2C_SMBUS_READ, > 259307074bfcf1 Corey Minyard 2012-03-19 675 =09=09=09=09 SSIF_IPMI_M= ULTI_PART_RESPONSE_MIDDLE, > 259307074bfcf1 Corey Minyard 2012-03-19 676 =09=09=09=09 ssif_info->= recv, I2C_SMBUS_BLOCK_DATA); > 259307074bfcf1 Corey Minyard 2012-03-19 677 =09=09if (rv < 0) { > 259307074bfcf1 Corey Minyard 2012-03-19 678 =09=09=09if (ssif_info->s= sif_debug & SSIF_DEBUG_MSG) > 83af41947c5cbd Corey Minyard 2018-11-27 679 =09=09=09=09dev_dbg(&ssif= _info->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 680 =09=09=09=09=09"Error fro= m i2c_non_blocking_op(1)\n"); > 259307074bfcf1 Corey Minyard 2012-03-19 681 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 682 =09=09=09result =3D -EIO; > 259307074bfcf1 Corey Minyard 2012-03-19 683 =09=09} else > 259307074bfcf1 Corey Minyard 2012-03-19 684 =09=09=09return; > 259307074bfcf1 Corey Minyard 2012-03-19 685 =09} else if (ssif_info->= multi_pos) { > 259307074bfcf1 Corey Minyard 2012-03-19 686 =09=09/* Middle of multi-= part read. Start the next transaction. */ > 259307074bfcf1 Corey Minyard 2012-03-19 687 =09=09int i; > 259307074bfcf1 Corey Minyard 2012-03-19 688 =09=09unsigned char block= num; > 259307074bfcf1 Corey Minyard 2012-03-19 689 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 690 =09=09if (len =3D=3D 0) { > 259307074bfcf1 Corey Minyard 2012-03-19 691 =09=09=09result =3D -EIO; > 259307074bfcf1 Corey Minyard 2012-03-19 692 =09=09=09if (ssif_info->s= sif_debug & SSIF_DEBUG_MSG) > 83af41947c5cbd Corey Minyard 2018-11-27 693 =09=09=09=09dev_dbg(&ssif= _info->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 694 =09=09=09=09=09"Middle me= ssage with no data\n"); > 259307074bfcf1 Corey Minyard 2012-03-19 695 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 696 =09=09=09goto continue_op= ; > 259307074bfcf1 Corey Minyard 2012-03-19 697 =09=09} > 259307074bfcf1 Corey Minyard 2012-03-19 698 =20 > 3d69d43baa2749 Corey Minyard 2015-04-29 699 =09=09blocknum =3D data[0= ]; > 7d6380cd40f799 Corey Minyard 2018-11-16 700 =09=09len--; > 7d6380cd40f799 Corey Minyard 2018-11-16 701 =09=09data++; > 7d6380cd40f799 Corey Minyard 2018-11-16 702 =20 > 7d6380cd40f799 Corey Minyard 2018-11-16 703 =09=09if (blocknum !=3D 0= xff && len !=3D 31) { > 7d6380cd40f799 Corey Minyard 2018-11-16 704 =09=09 /* All blocks b= ut the last must have 31 data bytes. */ > 7d6380cd40f799 Corey Minyard 2018-11-16 705 =09=09=09result =3D -EIO; > 7d6380cd40f799 Corey Minyard 2018-11-16 706 =09=09=09if (ssif_info->s= sif_debug & SSIF_DEBUG_MSG) > 83af41947c5cbd Corey Minyard 2018-11-27 707 =09=09=09=09dev_dbg(&ssif= _info->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 708 =09=09=09=09=09"Received = middle message <31\n"); > 259307074bfcf1 Corey Minyard 2012-03-19 709 =20 > 7d6380cd40f799 Corey Minyard 2018-11-16 710 =09=09=09goto continue_op= ; > 7d6380cd40f799 Corey Minyard 2018-11-16 711 =09=09} > 7d6380cd40f799 Corey Minyard 2018-11-16 712 =20 > 7d6380cd40f799 Corey Minyard 2018-11-16 713 =09=09if (ssif_info->mult= i_len + len > IPMI_MAX_MSG_LENGTH) { > 259307074bfcf1 Corey Minyard 2012-03-19 714 =09=09=09/* Received mess= age too big, abort the operation. */ > 259307074bfcf1 Corey Minyard 2012-03-19 715 =09=09=09result =3D -E2BI= G; > 259307074bfcf1 Corey Minyard 2012-03-19 716 =09=09=09if (ssif_info->s= sif_debug & SSIF_DEBUG_MSG) > 83af41947c5cbd Corey Minyard 2018-11-27 717 =09=09=09=09dev_dbg(&ssif= _info->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 718 =09=09=09=09=09"Received = message too big\n"); > 259307074bfcf1 Corey Minyard 2012-03-19 719 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 720 =09=09=09goto continue_op= ; > 259307074bfcf1 Corey Minyard 2012-03-19 721 =09=09} > 259307074bfcf1 Corey Minyard 2012-03-19 722 =20 > 3d69d43baa2749 Corey Minyard 2015-04-29 723 =09=09for (i =3D 0; i < l= en; i++) > 7d6380cd40f799 Corey Minyard 2018-11-16 724 =09=09=09ssif_info->data[= i + ssif_info->multi_len] =3D data[i]; > 259307074bfcf1 Corey Minyard 2012-03-19 725 =09=09ssif_info->multi_le= n +=3D len; > 259307074bfcf1 Corey Minyard 2012-03-19 726 =09=09if (blocknum =3D=3D= 0xff) { > 259307074bfcf1 Corey Minyard 2012-03-19 727 =09=09=09/* End of read *= / > 259307074bfcf1 Corey Minyard 2012-03-19 728 =09=09=09len =3D ssif_inf= o->multi_len; > 259307074bfcf1 Corey Minyard 2012-03-19 729 =09=09=09data =3D ssif_in= fo->data; > 55be8658c7e2fe Kamlakant Patel 2019-04-24 730 =09=09} else if (blocknum= + 1 !=3D ssif_info->multi_pos) { > 259307074bfcf1 Corey Minyard 2012-03-19 731 =09=09=09/* > 259307074bfcf1 Corey Minyard 2012-03-19 732 =09=09=09 * Out of sequen= ce block, just abort. Block > 259307074bfcf1 Corey Minyard 2012-03-19 733 =09=09=09 * numbers start= at zero for the second block, > 259307074bfcf1 Corey Minyard 2012-03-19 734 =09=09=09 * but multi_pos= starts at one, so the +1. > 259307074bfcf1 Corey Minyard 2012-03-19 735 =09=09=09 */ > 55be8658c7e2fe Kamlakant Patel 2019-04-24 736 =09=09=09if (ssif_info->s= sif_debug & SSIF_DEBUG_MSG) > 55be8658c7e2fe Kamlakant Patel 2019-04-24 737 =09=09=09=09dev_dbg(&ssif= _info->client->dev, > 55be8658c7e2fe Kamlakant Patel 2019-04-24 738 =09=09=09=09=09"Received = message out of sequence, expected %u, got %u\n", > 55be8658c7e2fe Kamlakant Patel 2019-04-24 739 =09=09=09=09=09ssif_info-= >multi_pos - 1, blocknum); > 259307074bfcf1 Corey Minyard 2012-03-19 740 =09=09=09result =3D -EIO; > 259307074bfcf1 Corey Minyard 2012-03-19 741 =09=09} else { > 259307074bfcf1 Corey Minyard 2012-03-19 742 =09=09=09ssif_inc_stat(ss= if_info, received_message_parts); > 259307074bfcf1 Corey Minyard 2012-03-19 743 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 744 =09=09=09ssif_info->multi= _pos++; > 259307074bfcf1 Corey Minyard 2012-03-19 745 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 746 =09=09=09rv =3D ssif_i2c_= send(ssif_info, msg_done_handler, > 259307074bfcf1 Corey Minyard 2012-03-19 747 =09=09=09=09=09 I2C_SMB= US_READ, > 259307074bfcf1 Corey Minyard 2012-03-19 748 =09=09=09=09=09 SSIF_IP= MI_MULTI_PART_RESPONSE_MIDDLE, > 259307074bfcf1 Corey Minyard 2012-03-19 749 =09=09=09=09=09 ssif_in= fo->recv, > 259307074bfcf1 Corey Minyard 2012-03-19 750 =09=09=09=09=09 I2C_SMB= US_BLOCK_DATA); > 259307074bfcf1 Corey Minyard 2012-03-19 751 =09=09=09if (rv < 0) { > 259307074bfcf1 Corey Minyard 2012-03-19 752 =09=09=09=09if (ssif_info= ->ssif_debug & SSIF_DEBUG_MSG) > 83af41947c5cbd Corey Minyard 2018-11-27 753 =09=09=09=09=09dev_dbg(&s= sif_info->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 754 =09=09=09=09=09=09"Error = from ssif_i2c_send\n"); > 259307074bfcf1 Corey Minyard 2012-03-19 755 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 756 =09=09=09=09result =3D -E= IO; > 259307074bfcf1 Corey Minyard 2012-03-19 757 =09=09=09} else > 259307074bfcf1 Corey Minyard 2012-03-19 758 =09=09=09=09return; > 259307074bfcf1 Corey Minyard 2012-03-19 759 =09=09} > 259307074bfcf1 Corey Minyard 2012-03-19 760 =09} > 259307074bfcf1 Corey Minyard 2012-03-19 761 =20 > 7d6380cd40f799 Corey Minyard 2018-11-16 762 continue_op: > 259307074bfcf1 Corey Minyard 2012-03-19 763 =09if (result < 0) { > 259307074bfcf1 Corey Minyard 2012-03-19 764 =09=09ssif_inc_stat(ssif_= info, receive_errors); > 259307074bfcf1 Corey Minyard 2012-03-19 765 =09} else { > 259307074bfcf1 Corey Minyard 2012-03-19 766 =09=09ssif_inc_stat(ssif_= info, received_messages); > 259307074bfcf1 Corey Minyard 2012-03-19 767 =09=09ssif_inc_stat(ssif_= info, received_message_parts); > 259307074bfcf1 Corey Minyard 2012-03-19 768 =09} > 259307074bfcf1 Corey Minyard 2012-03-19 769 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 770 =09if (ssif_info->ssif_de= bug & SSIF_DEBUG_STATE) > 83af41947c5cbd Corey Minyard 2018-11-27 771 =09=09dev_dbg(&ssif_info-= >client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 772 =09=09=09"DONE 1: state = =3D %d, result=3D%d\n", > 259307074bfcf1 Corey Minyard 2012-03-19 773 =09=09=09ssif_info->ssif_= state, result); > 259307074bfcf1 Corey Minyard 2012-03-19 774 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 775 =09flags =3D ipmi_ssif_lo= ck_cond(ssif_info, &oflags); > 259307074bfcf1 Corey Minyard 2012-03-19 776 =09msg =3D ssif_info->cur= r_msg; > 259307074bfcf1 Corey Minyard 2012-03-19 777 =09if (msg) { > 259307074bfcf1 Corey Minyard 2012-03-19 778 =09=09msg->rsp_size =3D l= en; > 259307074bfcf1 Corey Minyard 2012-03-19 779 =09=09if (msg->rsp_size >= IPMI_MAX_MSG_LENGTH) > 259307074bfcf1 Corey Minyard 2012-03-19 780 =09=09=09msg->rsp_size = =3D IPMI_MAX_MSG_LENGTH; > 259307074bfcf1 Corey Minyard 2012-03-19 @781 =09=09memcpy(msg->rsp, da= ta, msg->rsp_size); > 259307074bfcf1 Corey Minyard 2012-03-19 782 =09=09ssif_info->curr_msg= =3D NULL; > 259307074bfcf1 Corey Minyard 2012-03-19 783 =09} > 259307074bfcf1 Corey Minyard 2012-03-19 784 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 785 =09switch (ssif_info->ssi= f_state) { > 259307074bfcf1 Corey Minyard 2012-03-19 786 =09case SSIF_NORMAL: > 259307074bfcf1 Corey Minyard 2012-03-19 787 =09=09ipmi_ssif_unlock_co= nd(ssif_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 788 =09=09if (!msg) > 259307074bfcf1 Corey Minyard 2012-03-19 789 =09=09=09break; > 259307074bfcf1 Corey Minyard 2012-03-19 790 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 791 =09=09if (result < 0) > 259307074bfcf1 Corey Minyard 2012-03-19 792 =09=09=09return_hosed_msg= (ssif_info, msg); > 259307074bfcf1 Corey Minyard 2012-03-19 793 =09=09else > 259307074bfcf1 Corey Minyard 2012-03-19 794 =09=09=09deliver_recv_msg= (ssif_info, msg); > 259307074bfcf1 Corey Minyard 2012-03-19 795 =09=09break; > 259307074bfcf1 Corey Minyard 2012-03-19 796 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 797 =09case SSIF_GETTING_FLAG= S: > 259307074bfcf1 Corey Minyard 2012-03-19 798 =09=09/* We got the flags= from the SSIF, now handle them. */ > 259307074bfcf1 Corey Minyard 2012-03-19 799 =09=09if ((result < 0) ||= (len < 4) || (data[2] !=3D 0)) { > 259307074bfcf1 Corey Minyard 2012-03-19 800 =09=09=09/* > 259307074bfcf1 Corey Minyard 2012-03-19 801 =09=09=09 * Error fetchin= g flags, or invalid length, > 259307074bfcf1 Corey Minyard 2012-03-19 802 =09=09=09 * just give up = for now. > 259307074bfcf1 Corey Minyard 2012-03-19 803 =09=09=09 */ > 259307074bfcf1 Corey Minyard 2012-03-19 804 =09=09=09ssif_info->ssif_= state =3D SSIF_NORMAL; > 259307074bfcf1 Corey Minyard 2012-03-19 805 =09=09=09ipmi_ssif_unlock= _cond(ssif_info, flags); > 83af41947c5cbd Corey Minyard 2018-11-27 806 =09=09=09dev_warn(&ssif_i= nfo->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 807 =09=09=09=09 "Error getti= ng flags: %d %d, %x\n", > f002612b9d8661 Kamlakant Patel 2018-03-13 808 =09=09=09=09 result, len,= (len >=3D 3) ? data[2] : 0); > 259307074bfcf1 Corey Minyard 2012-03-19 809 =09=09} else if (data[0] = !=3D (IPMI_NETFN_APP_REQUEST | 1) << 2 > 259307074bfcf1 Corey Minyard 2012-03-19 810 =09=09=09 || data[1] != =3D IPMI_GET_MSG_FLAGS_CMD) { > 4495ec6d770e1b Corey Minyard 2017-06-30 811 =09=09=09/* > 4495ec6d770e1b Corey Minyard 2017-06-30 812 =09=09=09 * Don't abort h= ere, maybe it was a queued > 4495ec6d770e1b Corey Minyard 2017-06-30 813 =09=09=09 * response to a= previous command. > 4495ec6d770e1b Corey Minyard 2017-06-30 814 =09=09=09 */ > 4495ec6d770e1b Corey Minyard 2017-06-30 815 =09=09=09ipmi_ssif_unlock= _cond(ssif_info, flags); > 83af41947c5cbd Corey Minyard 2018-11-27 816 =09=09=09dev_warn(&ssif_i= nfo->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 817 =09=09=09=09 "Invalid res= ponse getting flags: %x %x\n", > 259307074bfcf1 Corey Minyard 2012-03-19 818 =09=09=09=09 data[0], dat= a[1]); > 259307074bfcf1 Corey Minyard 2012-03-19 819 =09=09} else { > 259307074bfcf1 Corey Minyard 2012-03-19 820 =09=09=09ssif_inc_stat(ss= if_info, flag_fetches); > 259307074bfcf1 Corey Minyard 2012-03-19 821 =09=09=09ssif_info->msg_f= lags =3D data[3]; > 259307074bfcf1 Corey Minyard 2012-03-19 822 =09=09=09handle_flags(ssi= f_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 823 =09=09} > 259307074bfcf1 Corey Minyard 2012-03-19 824 =09=09break; > 259307074bfcf1 Corey Minyard 2012-03-19 825 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 826 =09case SSIF_CLEARING_FLA= GS: > 259307074bfcf1 Corey Minyard 2012-03-19 827 =09=09/* We cleared the f= lags. */ > 259307074bfcf1 Corey Minyard 2012-03-19 828 =09=09if ((result < 0) ||= (len < 3) || (data[2] !=3D 0)) { > 259307074bfcf1 Corey Minyard 2012-03-19 829 =09=09=09/* Error clearin= g flags */ > 83af41947c5cbd Corey Minyard 2018-11-27 830 =09=09=09dev_warn(&ssif_i= nfo->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 831 =09=09=09=09 "Error clear= ing flags: %d %d, %x\n", > f002612b9d8661 Kamlakant Patel 2018-03-13 832 =09=09=09=09 result, len,= (len >=3D 3) ? data[2] : 0); > 259307074bfcf1 Corey Minyard 2012-03-19 833 =09=09} else if (data[0] = !=3D (IPMI_NETFN_APP_REQUEST | 1) << 2 > 259307074bfcf1 Corey Minyard 2012-03-19 834 =09=09=09 || data[1] != =3D IPMI_CLEAR_MSG_FLAGS_CMD) { > 83af41947c5cbd Corey Minyard 2018-11-27 835 =09=09=09dev_warn(&ssif_i= nfo->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 836 =09=09=09=09 "Invalid res= ponse clearing flags: %x %x\n", > 259307074bfcf1 Corey Minyard 2012-03-19 837 =09=09=09=09 data[0], dat= a[1]); > 259307074bfcf1 Corey Minyard 2012-03-19 838 =09=09} > 259307074bfcf1 Corey Minyard 2012-03-19 839 =09=09ssif_info->ssif_sta= te =3D SSIF_NORMAL; > 259307074bfcf1 Corey Minyard 2012-03-19 840 =09=09ipmi_ssif_unlock_co= nd(ssif_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 841 =09=09break; > 259307074bfcf1 Corey Minyard 2012-03-19 842 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 843 =09case SSIF_GETTING_EVEN= TS: > 259307074bfcf1 Corey Minyard 2012-03-19 844 =09=09if ((result < 0) ||= (len < 3) || (msg->rsp[2] !=3D 0)) { > 259307074bfcf1 Corey Minyard 2012-03-19 845 =09=09=09/* Error getting= event, probably done. */ > 259307074bfcf1 Corey Minyard 2012-03-19 846 =09=09=09msg->done(msg); > 259307074bfcf1 Corey Minyard 2012-03-19 847 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 848 =09=09=09/* Take off the = event flag. */ > 259307074bfcf1 Corey Minyard 2012-03-19 849 =09=09=09ssif_info->msg_f= lags &=3D ~EVENT_MSG_BUFFER_FULL; > 259307074bfcf1 Corey Minyard 2012-03-19 850 =09=09=09handle_flags(ssi= f_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 851 =09=09} else if (msg->rsp= [0] !=3D (IPMI_NETFN_APP_REQUEST | 1) << 2 > 259307074bfcf1 Corey Minyard 2012-03-19 852 =09=09=09 || msg->rsp[1= ] !=3D IPMI_READ_EVENT_MSG_BUFFER_CMD) { > 83af41947c5cbd Corey Minyard 2018-11-27 853 =09=09=09dev_warn(&ssif_i= nfo->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 854 =09=09=09=09 "Invalid res= ponse getting events: %x %x\n", > 259307074bfcf1 Corey Minyard 2012-03-19 855 =09=09=09=09 msg->rsp[0],= msg->rsp[1]); > 259307074bfcf1 Corey Minyard 2012-03-19 856 =09=09=09msg->done(msg); > 259307074bfcf1 Corey Minyard 2012-03-19 857 =09=09=09/* Take off the = event flag. */ > 259307074bfcf1 Corey Minyard 2012-03-19 858 =09=09=09ssif_info->msg_f= lags &=3D ~EVENT_MSG_BUFFER_FULL; > 259307074bfcf1 Corey Minyard 2012-03-19 859 =09=09=09handle_flags(ssi= f_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 860 =09=09} else { > 259307074bfcf1 Corey Minyard 2012-03-19 861 =09=09=09handle_flags(ssi= f_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 862 =09=09=09ssif_inc_stat(ss= if_info, events); > 259307074bfcf1 Corey Minyard 2012-03-19 863 =09=09=09deliver_recv_msg= (ssif_info, msg); > 259307074bfcf1 Corey Minyard 2012-03-19 864 =09=09} > 259307074bfcf1 Corey Minyard 2012-03-19 865 =09=09break; > 259307074bfcf1 Corey Minyard 2012-03-19 866 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 867 =09case SSIF_GETTING_MESS= AGES: > 259307074bfcf1 Corey Minyard 2012-03-19 868 =09=09if ((result < 0) ||= (len < 3) || (msg->rsp[2] !=3D 0)) { > 259307074bfcf1 Corey Minyard 2012-03-19 869 =09=09=09/* Error getting= event, probably done. */ > 259307074bfcf1 Corey Minyard 2012-03-19 870 =09=09=09msg->done(msg); > 259307074bfcf1 Corey Minyard 2012-03-19 871 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 872 =09=09=09/* Take off the = msg flag. */ > 259307074bfcf1 Corey Minyard 2012-03-19 873 =09=09=09ssif_info->msg_f= lags &=3D ~RECEIVE_MSG_AVAIL; > 259307074bfcf1 Corey Minyard 2012-03-19 874 =09=09=09handle_flags(ssi= f_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 875 =09=09} else if (msg->rsp= [0] !=3D (IPMI_NETFN_APP_REQUEST | 1) << 2 > 259307074bfcf1 Corey Minyard 2012-03-19 876 =09=09=09 || msg->rsp[1= ] !=3D IPMI_GET_MSG_CMD) { > 83af41947c5cbd Corey Minyard 2018-11-27 877 =09=09=09dev_warn(&ssif_i= nfo->client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 878 =09=09=09=09 "Invalid res= ponse clearing flags: %x %x\n", > 259307074bfcf1 Corey Minyard 2012-03-19 879 =09=09=09=09 msg->rsp[0],= msg->rsp[1]); > 259307074bfcf1 Corey Minyard 2012-03-19 880 =09=09=09msg->done(msg); > 259307074bfcf1 Corey Minyard 2012-03-19 881 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 882 =09=09=09/* Take off the = msg flag. */ > 259307074bfcf1 Corey Minyard 2012-03-19 883 =09=09=09ssif_info->msg_f= lags &=3D ~RECEIVE_MSG_AVAIL; > 259307074bfcf1 Corey Minyard 2012-03-19 884 =09=09=09handle_flags(ssi= f_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 885 =09=09} else { > 259307074bfcf1 Corey Minyard 2012-03-19 886 =09=09=09ssif_inc_stat(ss= if_info, incoming_messages); > 259307074bfcf1 Corey Minyard 2012-03-19 887 =09=09=09handle_flags(ssi= f_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 888 =09=09=09deliver_recv_msg= (ssif_info, msg); > 259307074bfcf1 Corey Minyard 2012-03-19 889 =09=09} > 259307074bfcf1 Corey Minyard 2012-03-19 890 =09=09break; > 259307074bfcf1 Corey Minyard 2012-03-19 891 =09} > 259307074bfcf1 Corey Minyard 2012-03-19 892 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 893 =09flags =3D ipmi_ssif_lo= ck_cond(ssif_info, &oflags); > 259307074bfcf1 Corey Minyard 2012-03-19 894 =09if (SSIF_IDLE(ssif_inf= o) && !ssif_info->stopping) { > 259307074bfcf1 Corey Minyard 2012-03-19 895 =09=09if (ssif_info->req_= events) > 259307074bfcf1 Corey Minyard 2012-03-19 896 =09=09=09start_event_fetc= h(ssif_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 897 =09=09else if (ssif_info-= >req_flags) > 259307074bfcf1 Corey Minyard 2012-03-19 898 =09=09=09start_flag_fetch= (ssif_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 899 =09=09else > 259307074bfcf1 Corey Minyard 2012-03-19 900 =09=09=09start_next_msg(s= sif_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 901 =09} else > 259307074bfcf1 Corey Minyard 2012-03-19 902 =09=09ipmi_ssif_unlock_co= nd(ssif_info, flags); > 259307074bfcf1 Corey Minyard 2012-03-19 903 =20 > 259307074bfcf1 Corey Minyard 2012-03-19 904 =09if (ssif_info->ssif_de= bug & SSIF_DEBUG_STATE) > 83af41947c5cbd Corey Minyard 2018-11-27 905 =09=09dev_dbg(&ssif_info-= >client->dev, > 83af41947c5cbd Corey Minyard 2018-11-27 906 =09=09=09"DONE 2: state = =3D %d.\n", ssif_info->ssif_state); > 259307074bfcf1 Corey Minyard 2012-03-19 907 } > 259307074bfcf1 Corey Minyard 2012-03-19 908 =20 >=20 > :::::: The code at line 781 was first introduced by commit > :::::: 259307074bfcf1ff88016e12c68f057aee6cb694 ipmi: Add SMBus interface= driver (SSIF) >=20 > :::::: TO: Corey Minyard > :::::: CC: Corey Minyard >=20 > --- > 0-DAY kernel test infrastructure Open Source Technology C= enter > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corpor= ation --=20 Best regards, Oleksandr Natalenko (post-factum) Senior Software Maintenance Engineer