Message ID | 20181031230541.28822-1-sashal@kernel.org |
---|---|
State | Superseded |
Headers | show |
Series | [AUTOSEL,4.19,001/146] net: socionext: Reset tx queue in ndo_stop | expand |
On 10/31/2018 07:03 PM, Sasha Levin wrote: > From: Prarit Bhargava <prarit@redhat.com> > > [ Upstream commit f69ffc5d3db8f1f03fd6d1df5930f9a1fbd787b6 ] > > cpupower crashes on VMWare guests. The guests have the AMD PStateDef MSR > (0xC0010064 + state number) set to zero. As a result fid and did are zero > and the crash occurs because of a divide by zero (cof = fid/did). This > can be prevented by checking the enable bit in the PStateDef MSR before > calculating cof. By doing this the value of pstate[i] remains zero and > the value can be tested before displaying the active Pstates. > > Check the enable bit in the PstateDef register for all supported families > and only print out enabled Pstates. > Hi Sasha, This patch, f69ffc5d3db8, depends on 8c22e2f69592 ("cpupower: Fix AMD Family 0x17 msr_pstate size"). Without 8c22e2f69592 the patch below will always read a value of "0" and not output the correct data. 8c22e2f69592 must be applied to any stable branch that f69ffc5d3db8 is applied to. P. > Signed-off-by: Prarit Bhargava <prarit@redhat.com> > Cc: Shuah Khan <shuah@kernel.org> > Cc: Stafford Horne <shorne@gmail.com> > Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org> > Signed-off-by: Sasha Levin <sashal@kernel.org> > --- > tools/power/cpupower/utils/cpufreq-info.c | 2 ++ > tools/power/cpupower/utils/helpers/amd.c | 5 +++++ > 2 files changed, 7 insertions(+) > > diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c > index df43cd45d810..ccd08dd00996 100644 > --- a/tools/power/cpupower/utils/cpufreq-info.c > +++ b/tools/power/cpupower/utils/cpufreq-info.c > @@ -200,6 +200,8 @@ static int get_boost_mode(unsigned int cpu) > printf(_(" Boost States: %d\n"), b_states); > printf(_(" Total States: %d\n"), pstate_no); > for (i = 0; i < pstate_no; i++) { > + if (!pstates[i]) > + continue; > if (i < b_states) > printf(_(" Pstate-Pb%d: %luMHz (boost state)" > "\n"), i, pstates[i]); > diff --git a/tools/power/cpupower/utils/helpers/amd.c b/tools/power/cpupower/utils/helpers/amd.c > index bb41cdd0df6b..58d23997424d 100644 > --- a/tools/power/cpupower/utils/helpers/amd.c > +++ b/tools/power/cpupower/utils/helpers/amd.c > @@ -119,6 +119,11 @@ int decode_pstates(unsigned int cpu, unsigned int cpu_family, > } > if (read_msr(cpu, MSR_AMD_PSTATE + i, &pstate.val)) > return -1; > + if ((cpu_family == 0x17) && (!pstate.fam17h_bits.en)) > + continue; > + else if (!pstate.bits.en) > + continue; > + > pstates[i] = get_cof(cpu_family, pstate); > } > *no = i; >
On Thu, Nov 01, 2018 at 07:43:35AM -0400, Prarit Bhargava wrote: > > >On 10/31/2018 07:03 PM, Sasha Levin wrote: >> From: Prarit Bhargava <prarit@redhat.com> >> >> [ Upstream commit f69ffc5d3db8f1f03fd6d1df5930f9a1fbd787b6 ] >> >> cpupower crashes on VMWare guests. The guests have the AMD PStateDef MSR >> (0xC0010064 + state number) set to zero. As a result fid and did are zero >> and the crash occurs because of a divide by zero (cof = fid/did). This >> can be prevented by checking the enable bit in the PStateDef MSR before >> calculating cof. By doing this the value of pstate[i] remains zero and >> the value can be tested before displaying the active Pstates. >> >> Check the enable bit in the PstateDef register for all supported families >> and only print out enabled Pstates. >> > >Hi Sasha, > >This patch, f69ffc5d3db8, depends on 8c22e2f69592 ("cpupower: Fix AMD Family >0x17 msr_pstate size"). Without 8c22e2f69592 the patch below will always read a >value of "0" and not output the correct data. > >8c22e2f69592 must be applied to any stable branch that f69ffc5d3db8 is applied to. I'll grab it too, thank you. -- Thanks, Sasha
Sasha Levin <sashal@kernel.org> 于2018年11月1日周四 上午12:45写道: > > From: Shaohua Li <shli@fb.com> > > [ Upstream commit d595567dc4f0c1d90685ec1e2e296e2cad2643ac ] > > If we change the number of array's device after device is removed from array, > then add the device back to array, we can see that device is added as active > role instead of spare which we expected. > > Please see the below link for details: > https://marc.info/?l=linux-raid&m=153736982015076&w=2 > > This is caused by that we prefer to use device's previous role which is > recorded by saved_raid_disk, but we should respect the new number of > conf->raid_disks since it could be changed after device is removed. > > Reported-by: Gioh Kim <gi-oh.kim@profitbricks.com> > Tested-by: Gioh Kim <gi-oh.kim@profitbricks.com> > Acked-by: Guoqing Jiang <gqjiang@suse.com>9e753ba9b9b405e3902d9f08aec5f2ea58a0c317 > Signed-off-by: Shaohua Li <shli@fb.com> > Signed-off-by: Sasha Levin <sashal@kernel.org> Hi Sasha, This patch breaks linear hotadd please also include commit 9e753ba9b9b405e3902d9f08aec5f2ea58a0c317 MD: fix invalid stored role for a disk - try2 Regards, Jack Wang > --- > drivers/md/md.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/md/md.c b/drivers/md/md.c > index 8668793262d0..85459c17cc60 100644 > --- a/drivers/md/md.c > +++ b/drivers/md/md.c > @@ -1776,6 +1776,10 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev) > } else > set_bit(In_sync, &rdev->flags); > rdev->raid_disk = role; > + if (role >= mddev->raid_disks) { > + rdev->saved_raid_disk = -1; > + rdev->raid_disk = -1; > + } > break; > } > if (sb->devflags & WriteMostly1) > -- > 2.17.1 >
diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index 4289ccb26e4e..d2caeb9edc04 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -940,6 +940,9 @@ static void netsec_uninit_pkt_dring(struct netsec_priv *priv, int id) dring->head = 0; dring->tail = 0; dring->pkt_cnt = 0; + + if (id == NETSEC_RING_TX) + netdev_reset_queue(priv->ndev); } static void netsec_free_dring(struct netsec_priv *priv, int id)