From 3433ddbb0061e089b1bfa91d8ddf6e4d8aeae011 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 23 Sep 2018 21:55:10 +0200 Subject: [PATCH] drop ipmi patch from older kernels. --- ...ilities-detection-to-the-detect-call.patch | 185 ------------------ queue-3.18/series | 1 - ...ilities-detection-to-the-detect-call.patch | 185 ------------------ queue-4.14/series | 1 - ...ilities-detection-to-the-detect-call.patch | 185 ------------------ queue-4.4/series | 1 - ...ilities-detection-to-the-detect-call.patch | 185 ------------------ queue-4.9/series | 1 - 8 files changed, 744 deletions(-) delete mode 100644 queue-3.18/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch delete mode 100644 queue-4.14/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch delete mode 100644 queue-4.4/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch delete mode 100644 queue-4.9/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch diff --git a/queue-3.18/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch b/queue-3.18/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch deleted file mode 100644 index 4c2f2d6a3bf..00000000000 --- a/queue-3.18/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch +++ /dev/null @@ -1,185 +0,0 @@ -From c86ba91be75702c013bbf7379542920b6920e98f Mon Sep 17 00:00:00 2001 -From: Corey Minyard -Date: Thu, 23 Aug 2018 15:22:35 -0500 -Subject: ipmi: Move BT capabilities detection to the detect call - -From: Corey Minyard - -commit c86ba91be75702c013bbf7379542920b6920e98f upstream. - -The capabilities detection was being done as part of the normal -state machine, but it was possible for it to be running while -the upper layers of the IPMI driver were initializing the -device, resulting in error and failure to initialize. - -Move the capabilities detection to the the detect function, -so it's done before anything else runs on the device. This also -simplifies the state machine and removes some code, as a bonus. - -Signed-off-by: Corey Minyard -Reported-by: Andrew Banman -Tested-by: Andrew Banman -Cc: -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/char/ipmi/ipmi_bt_sm.c | 92 +++++++++++++++++++++-------------------- - 1 file changed, 48 insertions(+), 44 deletions(-) - ---- a/drivers/char/ipmi/ipmi_bt_sm.c -+++ b/drivers/char/ipmi/ipmi_bt_sm.c -@@ -77,8 +77,6 @@ enum bt_states { - BT_STATE_RESET3, - BT_STATE_RESTART, - BT_STATE_PRINTME, -- BT_STATE_CAPABILITIES_BEGIN, -- BT_STATE_CAPABILITIES_END, - BT_STATE_LONG_BUSY /* BT doesn't get hosed :-) */ - }; - -@@ -104,7 +102,6 @@ struct si_sm_data { - int error_retries; /* end of "common" fields */ - int nonzero_status; /* hung BMCs stay all 0 */ - enum bt_states complete; /* to divert the state machine */ -- int BT_CAP_outreqs; - long BT_CAP_req2rsp; - int BT_CAP_retries; /* Recommended retries */ - }; -@@ -155,8 +152,6 @@ static char *state2txt(unsigned char sta - case BT_STATE_RESET3: return("RESET3"); - case BT_STATE_RESTART: return("RESTART"); - case BT_STATE_LONG_BUSY: return("LONG_BUSY"); -- case BT_STATE_CAPABILITIES_BEGIN: return("CAP_BEGIN"); -- case BT_STATE_CAPABILITIES_END: return("CAP_END"); - } - return("BAD STATE"); - } -@@ -203,7 +198,6 @@ static unsigned int bt_init_data(struct - bt->complete = BT_STATE_IDLE; /* end here */ - bt->BT_CAP_req2rsp = BT_NORMAL_TIMEOUT * USEC_PER_SEC; - bt->BT_CAP_retries = BT_NORMAL_RETRY_LIMIT; -- /* BT_CAP_outreqs == zero is a flag to read BT Capabilities */ - return 3; /* We claim 3 bytes of space; ought to check SPMI table */ - } - -@@ -469,7 +463,7 @@ static enum si_sm_result error_recovery( - - static enum si_sm_result bt_event(struct si_sm_data *bt, long time) - { -- unsigned char status, BT_CAP[8]; -+ unsigned char status; - static enum bt_states last_printed = BT_STATE_PRINTME; - int i; - -@@ -522,12 +516,6 @@ static enum si_sm_result bt_event(struct - if (status & BT_H_BUSY) /* clear a leftover H_BUSY */ - BT_CONTROL(BT_H_BUSY); - -- bt->timeout = bt->BT_CAP_req2rsp; -- -- /* Read BT capabilities if it hasn't been done yet */ -- if (!bt->BT_CAP_outreqs) -- BT_STATE_CHANGE(BT_STATE_CAPABILITIES_BEGIN, -- SI_SM_CALL_WITHOUT_DELAY); - BT_SI_SM_RETURN(SI_SM_IDLE); - - case BT_STATE_XACTION_START: -@@ -632,37 +620,6 @@ static enum si_sm_result bt_event(struct - BT_STATE_CHANGE(BT_STATE_XACTION_START, - SI_SM_CALL_WITH_DELAY); - -- /* -- * Get BT Capabilities, using timing of upper level state machine. -- * Set outreqs to prevent infinite loop on timeout. -- */ -- case BT_STATE_CAPABILITIES_BEGIN: -- bt->BT_CAP_outreqs = 1; -- { -- unsigned char GetBT_CAP[] = { 0x18, 0x36 }; -- bt->state = BT_STATE_IDLE; -- bt_start_transaction(bt, GetBT_CAP, sizeof(GetBT_CAP)); -- } -- bt->complete = BT_STATE_CAPABILITIES_END; -- BT_STATE_CHANGE(BT_STATE_XACTION_START, -- SI_SM_CALL_WITH_DELAY); -- -- case BT_STATE_CAPABILITIES_END: -- i = bt_get_result(bt, BT_CAP, sizeof(BT_CAP)); -- bt_init_data(bt, bt->io); -- if ((i == 8) && !BT_CAP[2]) { -- bt->BT_CAP_outreqs = BT_CAP[3]; -- bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC; -- bt->BT_CAP_retries = BT_CAP[7]; -- } else -- printk(KERN_WARNING "IPMI BT: using default values\n"); -- if (!bt->BT_CAP_outreqs) -- bt->BT_CAP_outreqs = 1; -- printk(KERN_WARNING "IPMI BT: req2rsp=%ld secs retries=%d\n", -- bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries); -- bt->timeout = bt->BT_CAP_req2rsp; -- return SI_SM_CALL_WITHOUT_DELAY; -- - default: /* should never occur */ - return error_recovery(bt, - status, -@@ -673,6 +630,11 @@ static enum si_sm_result bt_event(struct - - static int bt_detect(struct si_sm_data *bt) - { -+ unsigned char GetBT_CAP[] = { 0x18, 0x36 }; -+ unsigned char BT_CAP[8]; -+ enum si_sm_result smi_result; -+ int rv; -+ - /* - * It's impossible for the BT status and interrupt registers to be - * all 1's, (assuming a properly functioning, self-initialized BMC) -@@ -683,6 +645,48 @@ static int bt_detect(struct si_sm_data * - if ((BT_STATUS == 0xFF) && (BT_INTMASK_R == 0xFF)) - return 1; - reset_flags(bt); -+ -+ /* -+ * Try getting the BT capabilities here. -+ */ -+ rv = bt_start_transaction(bt, GetBT_CAP, sizeof(GetBT_CAP)); -+ if (rv) { -+ dev_warn(bt->io->dev, -+ "Can't start capabilities transaction: %d\n", rv); -+ goto out_no_bt_cap; -+ } -+ -+ smi_result = SI_SM_CALL_WITHOUT_DELAY; -+ for (;;) { -+ if (smi_result == SI_SM_CALL_WITH_DELAY || -+ smi_result == SI_SM_CALL_WITH_TICK_DELAY) { -+ schedule_timeout_uninterruptible(1); -+ smi_result = bt_event(bt, jiffies_to_usecs(1)); -+ } else if (smi_result == SI_SM_CALL_WITHOUT_DELAY) { -+ smi_result = bt_event(bt, 0); -+ } else -+ break; -+ } -+ -+ rv = bt_get_result(bt, BT_CAP, sizeof(BT_CAP)); -+ bt_init_data(bt, bt->io); -+ if (rv < 8) { -+ dev_warn(bt->io->dev, "bt cap response too short: %d\n", rv); -+ goto out_no_bt_cap; -+ } -+ -+ if (BT_CAP[2]) { -+ dev_warn(bt->io->dev, "Error fetching bt cap: %x\n", BT_CAP[2]); -+out_no_bt_cap: -+ dev_warn(bt->io->dev, "using default values\n"); -+ } else { -+ bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC; -+ bt->BT_CAP_retries = BT_CAP[7]; -+ } -+ -+ dev_info(bt->io->dev, "req2rsp=%ld secs retries=%d\n", -+ bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries); -+ - return 0; - } - diff --git a/queue-3.18/series b/queue-3.18/series index 7f7873653f3..11b5b4384d6 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -81,7 +81,6 @@ rdma-cma-protect-cma-dev-list-with-lock.patch pstore-fix-incorrect-persistent-ram-buffer-mapping.patch xen-netfront-fix-waiting-for-xenbus-state-change.patch ib-ipoib-avoid-a-race-condition-between-start_xmit-and-cm_rep_handler.patch -ipmi-move-bt-capabilities-detection-to-the-detect-call.patch tools-hv-fix-a-bug-in-the-key-delete-code.patch usb-don-t-die-twice-if-pci-xhci-host-is-not-responding-in-resume.patch usb-add-quirk-to-support-dji-cinessd.patch diff --git a/queue-4.14/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch b/queue-4.14/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch deleted file mode 100644 index 4c2f2d6a3bf..00000000000 --- a/queue-4.14/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch +++ /dev/null @@ -1,185 +0,0 @@ -From c86ba91be75702c013bbf7379542920b6920e98f Mon Sep 17 00:00:00 2001 -From: Corey Minyard -Date: Thu, 23 Aug 2018 15:22:35 -0500 -Subject: ipmi: Move BT capabilities detection to the detect call - -From: Corey Minyard - -commit c86ba91be75702c013bbf7379542920b6920e98f upstream. - -The capabilities detection was being done as part of the normal -state machine, but it was possible for it to be running while -the upper layers of the IPMI driver were initializing the -device, resulting in error and failure to initialize. - -Move the capabilities detection to the the detect function, -so it's done before anything else runs on the device. This also -simplifies the state machine and removes some code, as a bonus. - -Signed-off-by: Corey Minyard -Reported-by: Andrew Banman -Tested-by: Andrew Banman -Cc: -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/char/ipmi/ipmi_bt_sm.c | 92 +++++++++++++++++++++-------------------- - 1 file changed, 48 insertions(+), 44 deletions(-) - ---- a/drivers/char/ipmi/ipmi_bt_sm.c -+++ b/drivers/char/ipmi/ipmi_bt_sm.c -@@ -77,8 +77,6 @@ enum bt_states { - BT_STATE_RESET3, - BT_STATE_RESTART, - BT_STATE_PRINTME, -- BT_STATE_CAPABILITIES_BEGIN, -- BT_STATE_CAPABILITIES_END, - BT_STATE_LONG_BUSY /* BT doesn't get hosed :-) */ - }; - -@@ -104,7 +102,6 @@ struct si_sm_data { - int error_retries; /* end of "common" fields */ - int nonzero_status; /* hung BMCs stay all 0 */ - enum bt_states complete; /* to divert the state machine */ -- int BT_CAP_outreqs; - long BT_CAP_req2rsp; - int BT_CAP_retries; /* Recommended retries */ - }; -@@ -155,8 +152,6 @@ static char *state2txt(unsigned char sta - case BT_STATE_RESET3: return("RESET3"); - case BT_STATE_RESTART: return("RESTART"); - case BT_STATE_LONG_BUSY: return("LONG_BUSY"); -- case BT_STATE_CAPABILITIES_BEGIN: return("CAP_BEGIN"); -- case BT_STATE_CAPABILITIES_END: return("CAP_END"); - } - return("BAD STATE"); - } -@@ -203,7 +198,6 @@ static unsigned int bt_init_data(struct - bt->complete = BT_STATE_IDLE; /* end here */ - bt->BT_CAP_req2rsp = BT_NORMAL_TIMEOUT * USEC_PER_SEC; - bt->BT_CAP_retries = BT_NORMAL_RETRY_LIMIT; -- /* BT_CAP_outreqs == zero is a flag to read BT Capabilities */ - return 3; /* We claim 3 bytes of space; ought to check SPMI table */ - } - -@@ -469,7 +463,7 @@ static enum si_sm_result error_recovery( - - static enum si_sm_result bt_event(struct si_sm_data *bt, long time) - { -- unsigned char status, BT_CAP[8]; -+ unsigned char status; - static enum bt_states last_printed = BT_STATE_PRINTME; - int i; - -@@ -522,12 +516,6 @@ static enum si_sm_result bt_event(struct - if (status & BT_H_BUSY) /* clear a leftover H_BUSY */ - BT_CONTROL(BT_H_BUSY); - -- bt->timeout = bt->BT_CAP_req2rsp; -- -- /* Read BT capabilities if it hasn't been done yet */ -- if (!bt->BT_CAP_outreqs) -- BT_STATE_CHANGE(BT_STATE_CAPABILITIES_BEGIN, -- SI_SM_CALL_WITHOUT_DELAY); - BT_SI_SM_RETURN(SI_SM_IDLE); - - case BT_STATE_XACTION_START: -@@ -632,37 +620,6 @@ static enum si_sm_result bt_event(struct - BT_STATE_CHANGE(BT_STATE_XACTION_START, - SI_SM_CALL_WITH_DELAY); - -- /* -- * Get BT Capabilities, using timing of upper level state machine. -- * Set outreqs to prevent infinite loop on timeout. -- */ -- case BT_STATE_CAPABILITIES_BEGIN: -- bt->BT_CAP_outreqs = 1; -- { -- unsigned char GetBT_CAP[] = { 0x18, 0x36 }; -- bt->state = BT_STATE_IDLE; -- bt_start_transaction(bt, GetBT_CAP, sizeof(GetBT_CAP)); -- } -- bt->complete = BT_STATE_CAPABILITIES_END; -- BT_STATE_CHANGE(BT_STATE_XACTION_START, -- SI_SM_CALL_WITH_DELAY); -- -- case BT_STATE_CAPABILITIES_END: -- i = bt_get_result(bt, BT_CAP, sizeof(BT_CAP)); -- bt_init_data(bt, bt->io); -- if ((i == 8) && !BT_CAP[2]) { -- bt->BT_CAP_outreqs = BT_CAP[3]; -- bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC; -- bt->BT_CAP_retries = BT_CAP[7]; -- } else -- printk(KERN_WARNING "IPMI BT: using default values\n"); -- if (!bt->BT_CAP_outreqs) -- bt->BT_CAP_outreqs = 1; -- printk(KERN_WARNING "IPMI BT: req2rsp=%ld secs retries=%d\n", -- bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries); -- bt->timeout = bt->BT_CAP_req2rsp; -- return SI_SM_CALL_WITHOUT_DELAY; -- - default: /* should never occur */ - return error_recovery(bt, - status, -@@ -673,6 +630,11 @@ static enum si_sm_result bt_event(struct - - static int bt_detect(struct si_sm_data *bt) - { -+ unsigned char GetBT_CAP[] = { 0x18, 0x36 }; -+ unsigned char BT_CAP[8]; -+ enum si_sm_result smi_result; -+ int rv; -+ - /* - * It's impossible for the BT status and interrupt registers to be - * all 1's, (assuming a properly functioning, self-initialized BMC) -@@ -683,6 +645,48 @@ static int bt_detect(struct si_sm_data * - if ((BT_STATUS == 0xFF) && (BT_INTMASK_R == 0xFF)) - return 1; - reset_flags(bt); -+ -+ /* -+ * Try getting the BT capabilities here. -+ */ -+ rv = bt_start_transaction(bt, GetBT_CAP, sizeof(GetBT_CAP)); -+ if (rv) { -+ dev_warn(bt->io->dev, -+ "Can't start capabilities transaction: %d\n", rv); -+ goto out_no_bt_cap; -+ } -+ -+ smi_result = SI_SM_CALL_WITHOUT_DELAY; -+ for (;;) { -+ if (smi_result == SI_SM_CALL_WITH_DELAY || -+ smi_result == SI_SM_CALL_WITH_TICK_DELAY) { -+ schedule_timeout_uninterruptible(1); -+ smi_result = bt_event(bt, jiffies_to_usecs(1)); -+ } else if (smi_result == SI_SM_CALL_WITHOUT_DELAY) { -+ smi_result = bt_event(bt, 0); -+ } else -+ break; -+ } -+ -+ rv = bt_get_result(bt, BT_CAP, sizeof(BT_CAP)); -+ bt_init_data(bt, bt->io); -+ if (rv < 8) { -+ dev_warn(bt->io->dev, "bt cap response too short: %d\n", rv); -+ goto out_no_bt_cap; -+ } -+ -+ if (BT_CAP[2]) { -+ dev_warn(bt->io->dev, "Error fetching bt cap: %x\n", BT_CAP[2]); -+out_no_bt_cap: -+ dev_warn(bt->io->dev, "using default values\n"); -+ } else { -+ bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC; -+ bt->BT_CAP_retries = BT_CAP[7]; -+ } -+ -+ dev_info(bt->io->dev, "req2rsp=%ld secs retries=%d\n", -+ bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries); -+ - return 0; - } - diff --git a/queue-4.14/series b/queue-4.14/series index 331c892e3a7..61103230a54 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -78,7 +78,6 @@ xen-netfront-fix-waiting-for-xenbus-state-change.patch ib-ipoib-avoid-a-race-condition-between-start_xmit-and-cm_rep_handler.patch s390-crypto-fix-return-code-checking-in-cbc_paes_crypt.patch mmc-omap_hsmmc-fix-wakeirq-handling-on-removal.patch -ipmi-move-bt-capabilities-detection-to-the-detect-call.patch ipmi-fix-i2c-client-removal-in-the-ssif-driver.patch tools-hv-fix-a-bug-in-the-key-delete-code.patch misc-hmc6352-fix-potential-spectre-v1.patch diff --git a/queue-4.4/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch b/queue-4.4/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch deleted file mode 100644 index 4c2f2d6a3bf..00000000000 --- a/queue-4.4/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch +++ /dev/null @@ -1,185 +0,0 @@ -From c86ba91be75702c013bbf7379542920b6920e98f Mon Sep 17 00:00:00 2001 -From: Corey Minyard -Date: Thu, 23 Aug 2018 15:22:35 -0500 -Subject: ipmi: Move BT capabilities detection to the detect call - -From: Corey Minyard - -commit c86ba91be75702c013bbf7379542920b6920e98f upstream. - -The capabilities detection was being done as part of the normal -state machine, but it was possible for it to be running while -the upper layers of the IPMI driver were initializing the -device, resulting in error and failure to initialize. - -Move the capabilities detection to the the detect function, -so it's done before anything else runs on the device. This also -simplifies the state machine and removes some code, as a bonus. - -Signed-off-by: Corey Minyard -Reported-by: Andrew Banman -Tested-by: Andrew Banman -Cc: -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/char/ipmi/ipmi_bt_sm.c | 92 +++++++++++++++++++++-------------------- - 1 file changed, 48 insertions(+), 44 deletions(-) - ---- a/drivers/char/ipmi/ipmi_bt_sm.c -+++ b/drivers/char/ipmi/ipmi_bt_sm.c -@@ -77,8 +77,6 @@ enum bt_states { - BT_STATE_RESET3, - BT_STATE_RESTART, - BT_STATE_PRINTME, -- BT_STATE_CAPABILITIES_BEGIN, -- BT_STATE_CAPABILITIES_END, - BT_STATE_LONG_BUSY /* BT doesn't get hosed :-) */ - }; - -@@ -104,7 +102,6 @@ struct si_sm_data { - int error_retries; /* end of "common" fields */ - int nonzero_status; /* hung BMCs stay all 0 */ - enum bt_states complete; /* to divert the state machine */ -- int BT_CAP_outreqs; - long BT_CAP_req2rsp; - int BT_CAP_retries; /* Recommended retries */ - }; -@@ -155,8 +152,6 @@ static char *state2txt(unsigned char sta - case BT_STATE_RESET3: return("RESET3"); - case BT_STATE_RESTART: return("RESTART"); - case BT_STATE_LONG_BUSY: return("LONG_BUSY"); -- case BT_STATE_CAPABILITIES_BEGIN: return("CAP_BEGIN"); -- case BT_STATE_CAPABILITIES_END: return("CAP_END"); - } - return("BAD STATE"); - } -@@ -203,7 +198,6 @@ static unsigned int bt_init_data(struct - bt->complete = BT_STATE_IDLE; /* end here */ - bt->BT_CAP_req2rsp = BT_NORMAL_TIMEOUT * USEC_PER_SEC; - bt->BT_CAP_retries = BT_NORMAL_RETRY_LIMIT; -- /* BT_CAP_outreqs == zero is a flag to read BT Capabilities */ - return 3; /* We claim 3 bytes of space; ought to check SPMI table */ - } - -@@ -469,7 +463,7 @@ static enum si_sm_result error_recovery( - - static enum si_sm_result bt_event(struct si_sm_data *bt, long time) - { -- unsigned char status, BT_CAP[8]; -+ unsigned char status; - static enum bt_states last_printed = BT_STATE_PRINTME; - int i; - -@@ -522,12 +516,6 @@ static enum si_sm_result bt_event(struct - if (status & BT_H_BUSY) /* clear a leftover H_BUSY */ - BT_CONTROL(BT_H_BUSY); - -- bt->timeout = bt->BT_CAP_req2rsp; -- -- /* Read BT capabilities if it hasn't been done yet */ -- if (!bt->BT_CAP_outreqs) -- BT_STATE_CHANGE(BT_STATE_CAPABILITIES_BEGIN, -- SI_SM_CALL_WITHOUT_DELAY); - BT_SI_SM_RETURN(SI_SM_IDLE); - - case BT_STATE_XACTION_START: -@@ -632,37 +620,6 @@ static enum si_sm_result bt_event(struct - BT_STATE_CHANGE(BT_STATE_XACTION_START, - SI_SM_CALL_WITH_DELAY); - -- /* -- * Get BT Capabilities, using timing of upper level state machine. -- * Set outreqs to prevent infinite loop on timeout. -- */ -- case BT_STATE_CAPABILITIES_BEGIN: -- bt->BT_CAP_outreqs = 1; -- { -- unsigned char GetBT_CAP[] = { 0x18, 0x36 }; -- bt->state = BT_STATE_IDLE; -- bt_start_transaction(bt, GetBT_CAP, sizeof(GetBT_CAP)); -- } -- bt->complete = BT_STATE_CAPABILITIES_END; -- BT_STATE_CHANGE(BT_STATE_XACTION_START, -- SI_SM_CALL_WITH_DELAY); -- -- case BT_STATE_CAPABILITIES_END: -- i = bt_get_result(bt, BT_CAP, sizeof(BT_CAP)); -- bt_init_data(bt, bt->io); -- if ((i == 8) && !BT_CAP[2]) { -- bt->BT_CAP_outreqs = BT_CAP[3]; -- bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC; -- bt->BT_CAP_retries = BT_CAP[7]; -- } else -- printk(KERN_WARNING "IPMI BT: using default values\n"); -- if (!bt->BT_CAP_outreqs) -- bt->BT_CAP_outreqs = 1; -- printk(KERN_WARNING "IPMI BT: req2rsp=%ld secs retries=%d\n", -- bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries); -- bt->timeout = bt->BT_CAP_req2rsp; -- return SI_SM_CALL_WITHOUT_DELAY; -- - default: /* should never occur */ - return error_recovery(bt, - status, -@@ -673,6 +630,11 @@ static enum si_sm_result bt_event(struct - - static int bt_detect(struct si_sm_data *bt) - { -+ unsigned char GetBT_CAP[] = { 0x18, 0x36 }; -+ unsigned char BT_CAP[8]; -+ enum si_sm_result smi_result; -+ int rv; -+ - /* - * It's impossible for the BT status and interrupt registers to be - * all 1's, (assuming a properly functioning, self-initialized BMC) -@@ -683,6 +645,48 @@ static int bt_detect(struct si_sm_data * - if ((BT_STATUS == 0xFF) && (BT_INTMASK_R == 0xFF)) - return 1; - reset_flags(bt); -+ -+ /* -+ * Try getting the BT capabilities here. -+ */ -+ rv = bt_start_transaction(bt, GetBT_CAP, sizeof(GetBT_CAP)); -+ if (rv) { -+ dev_warn(bt->io->dev, -+ "Can't start capabilities transaction: %d\n", rv); -+ goto out_no_bt_cap; -+ } -+ -+ smi_result = SI_SM_CALL_WITHOUT_DELAY; -+ for (;;) { -+ if (smi_result == SI_SM_CALL_WITH_DELAY || -+ smi_result == SI_SM_CALL_WITH_TICK_DELAY) { -+ schedule_timeout_uninterruptible(1); -+ smi_result = bt_event(bt, jiffies_to_usecs(1)); -+ } else if (smi_result == SI_SM_CALL_WITHOUT_DELAY) { -+ smi_result = bt_event(bt, 0); -+ } else -+ break; -+ } -+ -+ rv = bt_get_result(bt, BT_CAP, sizeof(BT_CAP)); -+ bt_init_data(bt, bt->io); -+ if (rv < 8) { -+ dev_warn(bt->io->dev, "bt cap response too short: %d\n", rv); -+ goto out_no_bt_cap; -+ } -+ -+ if (BT_CAP[2]) { -+ dev_warn(bt->io->dev, "Error fetching bt cap: %x\n", BT_CAP[2]); -+out_no_bt_cap: -+ dev_warn(bt->io->dev, "using default values\n"); -+ } else { -+ bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC; -+ bt->BT_CAP_retries = BT_CAP[7]; -+ } -+ -+ dev_info(bt->io->dev, "req2rsp=%ld secs retries=%d\n", -+ bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries); -+ - return 0; - } - diff --git a/queue-4.4/series b/queue-4.4/series index 3fb919f903a..71c415ceb6b 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -31,7 +31,6 @@ rdma-cma-protect-cma-dev-list-with-lock.patch pstore-fix-incorrect-persistent-ram-buffer-mapping.patch xen-netfront-fix-waiting-for-xenbus-state-change.patch ib-ipoib-avoid-a-race-condition-between-start_xmit-and-cm_rep_handler.patch -ipmi-move-bt-capabilities-detection-to-the-detect-call.patch tools-hv-fix-a-bug-in-the-key-delete-code.patch misc-hmc6352-fix-potential-spectre-v1.patch usb-don-t-die-twice-if-pci-xhci-host-is-not-responding-in-resume.patch diff --git a/queue-4.9/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch b/queue-4.9/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch deleted file mode 100644 index 4c2f2d6a3bf..00000000000 --- a/queue-4.9/ipmi-move-bt-capabilities-detection-to-the-detect-call.patch +++ /dev/null @@ -1,185 +0,0 @@ -From c86ba91be75702c013bbf7379542920b6920e98f Mon Sep 17 00:00:00 2001 -From: Corey Minyard -Date: Thu, 23 Aug 2018 15:22:35 -0500 -Subject: ipmi: Move BT capabilities detection to the detect call - -From: Corey Minyard - -commit c86ba91be75702c013bbf7379542920b6920e98f upstream. - -The capabilities detection was being done as part of the normal -state machine, but it was possible for it to be running while -the upper layers of the IPMI driver were initializing the -device, resulting in error and failure to initialize. - -Move the capabilities detection to the the detect function, -so it's done before anything else runs on the device. This also -simplifies the state machine and removes some code, as a bonus. - -Signed-off-by: Corey Minyard -Reported-by: Andrew Banman -Tested-by: Andrew Banman -Cc: -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/char/ipmi/ipmi_bt_sm.c | 92 +++++++++++++++++++++-------------------- - 1 file changed, 48 insertions(+), 44 deletions(-) - ---- a/drivers/char/ipmi/ipmi_bt_sm.c -+++ b/drivers/char/ipmi/ipmi_bt_sm.c -@@ -77,8 +77,6 @@ enum bt_states { - BT_STATE_RESET3, - BT_STATE_RESTART, - BT_STATE_PRINTME, -- BT_STATE_CAPABILITIES_BEGIN, -- BT_STATE_CAPABILITIES_END, - BT_STATE_LONG_BUSY /* BT doesn't get hosed :-) */ - }; - -@@ -104,7 +102,6 @@ struct si_sm_data { - int error_retries; /* end of "common" fields */ - int nonzero_status; /* hung BMCs stay all 0 */ - enum bt_states complete; /* to divert the state machine */ -- int BT_CAP_outreqs; - long BT_CAP_req2rsp; - int BT_CAP_retries; /* Recommended retries */ - }; -@@ -155,8 +152,6 @@ static char *state2txt(unsigned char sta - case BT_STATE_RESET3: return("RESET3"); - case BT_STATE_RESTART: return("RESTART"); - case BT_STATE_LONG_BUSY: return("LONG_BUSY"); -- case BT_STATE_CAPABILITIES_BEGIN: return("CAP_BEGIN"); -- case BT_STATE_CAPABILITIES_END: return("CAP_END"); - } - return("BAD STATE"); - } -@@ -203,7 +198,6 @@ static unsigned int bt_init_data(struct - bt->complete = BT_STATE_IDLE; /* end here */ - bt->BT_CAP_req2rsp = BT_NORMAL_TIMEOUT * USEC_PER_SEC; - bt->BT_CAP_retries = BT_NORMAL_RETRY_LIMIT; -- /* BT_CAP_outreqs == zero is a flag to read BT Capabilities */ - return 3; /* We claim 3 bytes of space; ought to check SPMI table */ - } - -@@ -469,7 +463,7 @@ static enum si_sm_result error_recovery( - - static enum si_sm_result bt_event(struct si_sm_data *bt, long time) - { -- unsigned char status, BT_CAP[8]; -+ unsigned char status; - static enum bt_states last_printed = BT_STATE_PRINTME; - int i; - -@@ -522,12 +516,6 @@ static enum si_sm_result bt_event(struct - if (status & BT_H_BUSY) /* clear a leftover H_BUSY */ - BT_CONTROL(BT_H_BUSY); - -- bt->timeout = bt->BT_CAP_req2rsp; -- -- /* Read BT capabilities if it hasn't been done yet */ -- if (!bt->BT_CAP_outreqs) -- BT_STATE_CHANGE(BT_STATE_CAPABILITIES_BEGIN, -- SI_SM_CALL_WITHOUT_DELAY); - BT_SI_SM_RETURN(SI_SM_IDLE); - - case BT_STATE_XACTION_START: -@@ -632,37 +620,6 @@ static enum si_sm_result bt_event(struct - BT_STATE_CHANGE(BT_STATE_XACTION_START, - SI_SM_CALL_WITH_DELAY); - -- /* -- * Get BT Capabilities, using timing of upper level state machine. -- * Set outreqs to prevent infinite loop on timeout. -- */ -- case BT_STATE_CAPABILITIES_BEGIN: -- bt->BT_CAP_outreqs = 1; -- { -- unsigned char GetBT_CAP[] = { 0x18, 0x36 }; -- bt->state = BT_STATE_IDLE; -- bt_start_transaction(bt, GetBT_CAP, sizeof(GetBT_CAP)); -- } -- bt->complete = BT_STATE_CAPABILITIES_END; -- BT_STATE_CHANGE(BT_STATE_XACTION_START, -- SI_SM_CALL_WITH_DELAY); -- -- case BT_STATE_CAPABILITIES_END: -- i = bt_get_result(bt, BT_CAP, sizeof(BT_CAP)); -- bt_init_data(bt, bt->io); -- if ((i == 8) && !BT_CAP[2]) { -- bt->BT_CAP_outreqs = BT_CAP[3]; -- bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC; -- bt->BT_CAP_retries = BT_CAP[7]; -- } else -- printk(KERN_WARNING "IPMI BT: using default values\n"); -- if (!bt->BT_CAP_outreqs) -- bt->BT_CAP_outreqs = 1; -- printk(KERN_WARNING "IPMI BT: req2rsp=%ld secs retries=%d\n", -- bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries); -- bt->timeout = bt->BT_CAP_req2rsp; -- return SI_SM_CALL_WITHOUT_DELAY; -- - default: /* should never occur */ - return error_recovery(bt, - status, -@@ -673,6 +630,11 @@ static enum si_sm_result bt_event(struct - - static int bt_detect(struct si_sm_data *bt) - { -+ unsigned char GetBT_CAP[] = { 0x18, 0x36 }; -+ unsigned char BT_CAP[8]; -+ enum si_sm_result smi_result; -+ int rv; -+ - /* - * It's impossible for the BT status and interrupt registers to be - * all 1's, (assuming a properly functioning, self-initialized BMC) -@@ -683,6 +645,48 @@ static int bt_detect(struct si_sm_data * - if ((BT_STATUS == 0xFF) && (BT_INTMASK_R == 0xFF)) - return 1; - reset_flags(bt); -+ -+ /* -+ * Try getting the BT capabilities here. -+ */ -+ rv = bt_start_transaction(bt, GetBT_CAP, sizeof(GetBT_CAP)); -+ if (rv) { -+ dev_warn(bt->io->dev, -+ "Can't start capabilities transaction: %d\n", rv); -+ goto out_no_bt_cap; -+ } -+ -+ smi_result = SI_SM_CALL_WITHOUT_DELAY; -+ for (;;) { -+ if (smi_result == SI_SM_CALL_WITH_DELAY || -+ smi_result == SI_SM_CALL_WITH_TICK_DELAY) { -+ schedule_timeout_uninterruptible(1); -+ smi_result = bt_event(bt, jiffies_to_usecs(1)); -+ } else if (smi_result == SI_SM_CALL_WITHOUT_DELAY) { -+ smi_result = bt_event(bt, 0); -+ } else -+ break; -+ } -+ -+ rv = bt_get_result(bt, BT_CAP, sizeof(BT_CAP)); -+ bt_init_data(bt, bt->io); -+ if (rv < 8) { -+ dev_warn(bt->io->dev, "bt cap response too short: %d\n", rv); -+ goto out_no_bt_cap; -+ } -+ -+ if (BT_CAP[2]) { -+ dev_warn(bt->io->dev, "Error fetching bt cap: %x\n", BT_CAP[2]); -+out_no_bt_cap: -+ dev_warn(bt->io->dev, "using default values\n"); -+ } else { -+ bt->BT_CAP_req2rsp = BT_CAP[6] * USEC_PER_SEC; -+ bt->BT_CAP_retries = BT_CAP[7]; -+ } -+ -+ dev_info(bt->io->dev, "req2rsp=%ld secs retries=%d\n", -+ bt->BT_CAP_req2rsp / USEC_PER_SEC, bt->BT_CAP_retries); -+ - return 0; - } - diff --git a/queue-4.9/series b/queue-4.9/series index f314c4fc216..f527384cf19 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -49,7 +49,6 @@ pstore-fix-incorrect-persistent-ram-buffer-mapping.patch xen-netfront-fix-waiting-for-xenbus-state-change.patch ib-ipoib-avoid-a-race-condition-between-start_xmit-and-cm_rep_handler.patch mmc-omap_hsmmc-fix-wakeirq-handling-on-removal.patch -ipmi-move-bt-capabilities-detection-to-the-detect-call.patch tools-hv-fix-a-bug-in-the-key-delete-code.patch misc-hmc6352-fix-potential-spectre-v1.patch usb-don-t-die-twice-if-pci-xhci-host-is-not-responding-in-resume.patch -- 2.47.3